diff --git a/config/hypr/config/keybindings/other.conf b/config/hypr/config/keybindings/other.conf index a6bd892..5530a48 100644 --- a/config/hypr/config/keybindings/other.conf +++ b/config/hypr/config/keybindings/other.conf @@ -11,6 +11,8 @@ bind = $mainMod SHIFT, B, exec, bash ~/config/scripts/hot-reload.sh # Screenshot keybinds bind = $mainMod, PRINT, exec, bash ~/config/scripts/screenshot-selection.sh bind = $mainMod SHIFT, PRINT, exec, bash ~/config/scripts/screenshot-fullscreen.sh +bind = ALT SHIFT, PRINT, exec, bash ~/config/scripts/edit-last-screenshot.sh + # Music volume control bind = $mainMod, XF86AudioRaiseVolume, exec, playerctl -p cider,OCbwoy3_s_iPhone volume 0.02+ diff --git a/scripts/edit-last-screenshot.sh b/scripts/edit-last-screenshot.sh new file mode 100644 index 0000000..6189fcc --- /dev/null +++ b/scripts/edit-last-screenshot.sh @@ -0,0 +1,11 @@ +#!/bin/bash + +SCREENSHOTS_DIR="$HOME/Pictures/Screenshots" + +LAST_SCREENSHOT=$(ls -t "$SCREENSHOTS_DIR" | head -n 1) + +if [[ -n "$LAST_SCREENSHOT" ]]; then + swappy -f "$SCREENSHOTS_DIR/$LAST_SCREENSHOT" -o "$SCREENSHOTS_DIR/$LAST_SCREENSHOT" +else + notify-send -u critical -t 3 "Error" "Can't find screenshot :(" +fi diff --git a/scripts/screenshot-fullscreen.sh b/scripts/screenshot-fullscreen.sh index 36558b5..0047717 100644 --- a/scripts/screenshot-fullscreen.sh +++ b/scripts/screenshot-fullscreen.sh @@ -7,5 +7,5 @@ echo "$SS_PATH" if [[ -n "$SS_PATH" && "$SS_PATH" == /home/ocbwoy3/Pictures/Screenshots/* ]]; then wl-copy < "$SS_PATH" - notify-send "Screenshot" "Successfully captured screenshot to clipboard" + notify-send "Screenshot" "Successfully captured screenshot to clipboard.\nOpen swappy with ALT+SHIFT+PS." fi diff --git a/scripts/screenshot-selection.sh b/scripts/screenshot-selection.sh index a3563dc..7b53e6a 100755 --- a/scripts/screenshot-selection.sh +++ b/scripts/screenshot-selection.sh @@ -7,5 +7,5 @@ echo "$SS_PATH" if [[ -n "$SS_PATH" && "$SS_PATH" == /home/ocbwoy3/Pictures/Screenshots/* ]]; then wl-copy < "$SS_PATH" - notify-send "Screenshot" "Successfully captured screenshot to clipboard" + notify-send "Screenshot" "Successfully captured selection to clipboard.\nOpen swappy with ALT+SHIFT+PS." fi