diff --git a/modules/cli/bin/share.nix b/modules/cli/bin/share.nix index 9f7ef11..527da47 100644 --- a/modules/cli/bin/share.nix +++ b/modules/cli/bin/share.nix @@ -6,7 +6,7 @@ pkgs.writeShellApplication { runtimeInputs = with pkgs; [ curl coreutils rofi p7zip xclip ]; text = '' - files="$(find "$HOME" -maxdepth 10 -type 'f' -not -path '*/.*' | rofi -dmenu -d 15 -p 'Files to share')" + files="$(find "$PWD" -maxdepth 10 -type 'f' -not -path '*/.*' | rofi -dmenu -d 15 -p 'File to share')" password="$(rofi -dmenu -p 'Password for encryption')" zipname="$HOME/Downloads/share-$(date +"%Y-%m-%d").zip" if [[ $password == "" ]]; then @@ -15,7 +15,9 @@ pkgs.writeShellApplication { args="-p""$password""" fi 7z a "$zipname" "$files" "$args" -mx9 > /dev/null - curl -s -F"file=@$zipname" 0x0.st | xclip -sel c + link="$(curl -s -F"file=@$zipname" 0x0.st)" + echo "$link" + echo "$link" | xclip -sel c rm "$zipname" ''; }