Added screenshot script for SwayWM
This commit is contained in:
@@ -297,7 +297,7 @@ bindsym $mod+r mode "resize"
|
|||||||
# Brightness lower with custom value('-' sign needed)
|
# Brightness lower with custom value('-' sign needed)
|
||||||
bindsym XF86MonBrightnessDown exec swayosd-client --brightness -5
|
bindsym XF86MonBrightnessDown exec swayosd-client --brightness -5
|
||||||
# Special key to take a screenshot with grim
|
# Special key to take a screenshot with grim
|
||||||
bindsym Print exec grim ~/Pictures/Screenshots/$(date "+%Y-%m-%d"T"%H:%M:%S").png
|
bindsym Print exec ./scripts/screenshot.sh
|
||||||
# Lock the screen
|
# Lock the screen
|
||||||
bindsym $mod+Alt+l exec $lockman
|
bindsym $mod+Alt+l exec $lockman
|
||||||
# Kill focused window
|
# Kill focused window
|
||||||
|
|||||||
8
sway/.config/sway/scripts/screenshot.sh
Executable file
8
sway/.config/sway/scripts/screenshot.sh
Executable file
@@ -0,0 +1,8 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
file="$HOME/Pictures/Screenshots/$(date +%Y-%m-%dT%H:%M:%S).png"
|
||||||
|
thumb="/tmp/screenshot-thumb.png"
|
||||||
|
grim "$file" \
|
||||||
|
&& wl-copy < "$file" \
|
||||||
|
&& magick "$file" -resize 640x480 "$thumb" \
|
||||||
|
&& fyi -i "$thumb" "📸 Catch screenshot"
|
||||||
Reference in New Issue
Block a user