From b313e1ba774f1a67633ac3f684c1096fcbcd151c Mon Sep 17 00:00:00 2001 From: Severin Kaderli Date: Sun, 9 Jan 2022 18:46:19 +0100 Subject: [PATCH] Adjust screenshot script for Wayland Signed-off-by: Severin Kaderli --- system/.config/sway/config | 1 + system/.local/bin/screenshot | 12 ++++-------- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/system/.config/sway/config b/system/.config/sway/config index 509b677..7ed885a 100644 --- a/system/.config/sway/config +++ b/system/.config/sway/config @@ -44,6 +44,7 @@ bindsym $SUPER+Return exec kitty # Kill focused window bindsym $SUPER+Shift+Q kill +bindsym Print exec screenshot floating_modifier $SUPER normal diff --git a/system/.local/bin/screenshot b/system/.local/bin/screenshot index 53e63a3..3e14626 100755 --- a/system/.local/bin/screenshot +++ b/system/.local/bin/screenshot @@ -21,18 +21,14 @@ ACTIONS=( "2: Selection" ) -FILENAME="${HOME}/pictures/screenshots/%Y-%m-%dT%H%M%S.png" +FILENAME="$(xdg-user-dir PICTURES)/screenshots/$(date +'%Y-%m-%dT%H%M%S').png" -SELECTION=$(printf '%s\n' "${ACTIONS[@]}" | rofi -dmenu -i -p "${PROMPT}" | cut -d ":" -f1) +SELECTION=$(printf '%s\n' "${ACTIONS[@]}" | fuzzel -dmenu -I| cut -d ":" -f1) case "${SELECTION}" in "1") - FILE=$(escrotum "${FILENAME}") + grim - | tee "${FILENAME}" | wl-copy ;; "2") - FILE=$(escrotum -s "${FILENAME}") + grim -g "$(slurp)" - | tee "${FILENAME}" | wl-copy ;; esac - -# Save the screenshot also in the clipboard -TYPE=$(file -b --mime-type "${FILE}") -xclip -selection clipboard -t "${TYPE}" < "${FILE}" \ No newline at end of file