Adjust screenshot script for Wayland
Signed-off-by: Severin Kaderli <severin@kaderli.dev>
This commit is contained in:
parent
0b655edfbe
commit
b313e1ba77
2 changed files with 5 additions and 8 deletions
|
@ -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
|
||||
|
||||
|
|
|
@ -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}"
|
Loading…
Add table
Add a link
Reference in a new issue