Add keyboard shortcut to upload screenshots to remote server

This commit is contained in:
Jake Howard 2020-05-10 22:06:11 +01:00
parent 86c4a236f5
commit bee635b5d3
Signed by: jake
GPG key ID: 57AFB45680EDD477
2 changed files with 21 additions and 1 deletions

17
files/bin/flameshot-upload Executable file
View file

@ -0,0 +1,17 @@
#!/usr/bin/env bash
filename=$(date '+%s').png
save_path=$HOME/Upload/img/$filename
temp_file=$(mktemp)
flameshot gui -r > "$temp_file"
if grep -Fq "screenshot aborted" "$temp_file"; then
rm "$temp_file"
exit 1
fi
mv "$temp_file" "$save_path"
echo "Saved to $save_path."
echo "https://img.theorangeone.net/$filename" | xclip -i -selection c

View file

@ -47,9 +47,12 @@ bindsym $mod+Shift+c exec --no-startup-id vscode-project-list
# Screenshots
bindsym Shift+Print exec --no-startup-id flameshot screen -c
bindsym Print exec --no-startup-id flameshot gui
bindsym XF86LaunchB exec --no-startup-id flameshot gui
bindsym Shift+Print exec --no-startup-id flameshot screen -c
bindsym Shift+XF86LaunchB exec --no-startup-id flameshot screen -c
bindsym $mod+Print exec --no-startup-id flameshot-upload
bindsym $mod+XF86LaunchB exec --no-startup-id flameshot-upload
bindsym $mod+Shift+q kill