🚀 use pwd as path and print link
This commit is contained in:
parent
14c3b823a3
commit
e811fb0c73
1 changed files with 4 additions and 2 deletions
|
@ -6,7 +6,7 @@ pkgs.writeShellApplication {
|
||||||
runtimeInputs = with pkgs; [ curl coreutils rofi p7zip xclip ];
|
runtimeInputs = with pkgs; [ curl coreutils rofi p7zip xclip ];
|
||||||
|
|
||||||
text = ''
|
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')"
|
password="$(rofi -dmenu -p 'Password for encryption')"
|
||||||
zipname="$HOME/Downloads/share-$(date +"%Y-%m-%d").zip"
|
zipname="$HOME/Downloads/share-$(date +"%Y-%m-%d").zip"
|
||||||
if [[ $password == "" ]]; then
|
if [[ $password == "" ]]; then
|
||||||
|
@ -15,7 +15,9 @@ pkgs.writeShellApplication {
|
||||||
args="-p""$password"""
|
args="-p""$password"""
|
||||||
fi
|
fi
|
||||||
7z a "$zipname" "$files" "$args" -mx9 > /dev/null
|
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"
|
rm "$zipname"
|
||||||
'';
|
'';
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue