From e811fb0c73047f97a1d602368eb1bf988a8dc6d6 Mon Sep 17 00:00:00 2001 From: MoritzBoehme Date: Mon, 24 Jan 2022 11:19:36 +0100 Subject: [PATCH] :rocket: use pwd as path and print link --- modules/cli/bin/share.nix | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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" ''; }