diff --git a/files/bin/flameshot-upload b/files/bin/flameshot-upload new file mode 100755 index 0000000..f6f5fe3 --- /dev/null +++ b/files/bin/flameshot-upload @@ -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 diff --git a/files/i3.conf b/files/i3.conf index 06041b4..58dd72a 100644 --- a/files/i3.conf +++ b/files/i3.conf @@ -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