add: new hyprland keybinding for saving screenshots

This commit is contained in:
Kiana Sheibani 2024-11-04 16:43:04 -05:00
parent 539429e421
commit 9910a2fddb
Signed by: toki
GPG key ID: 6CB106C25E86A9F7
2 changed files with 13 additions and 0 deletions

View file

@ -155,6 +155,9 @@ in {
"$mod Shift, 8, hy3:movetoworkspace, 8"
"$mod Shift, 9, hy3:movetoworkspace, 9"
"$mod Shift, 0, hy3:movetoworkspace, 10"
# Screenshot
"$mod, P, exec, ${scripts}/screenshot-save"
];
bindn = [

View file

@ -0,0 +1,10 @@
#!/usr/bin/env bash
if test $(wl-paste -l) = "image/png"; then
name=$(date '+%Y-%m-%d_%H-%M-%S').png
wl-paste -t "image/png" > ~/Pictures/"$name"
notify-send "Image stored at $name" \
-a grim -c screenshot -u low -t 3000
else
notify-send "No image in clipboard" \
-a grim -c screenshot -u low -t 3000
fi