From 9d31a63799ebdc9afad10022477e63b5a54bf763 Mon Sep 17 00:00:00 2001 From: Olli Date: Sun, 29 Mar 2026 13:17:43 +0200 Subject: [PATCH] sway: Add key bindings for screenshots --- sway/config | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/sway/config b/sway/config index b1a9aac..21a9dc9 100644 --- a/sway/config +++ b/sway/config @@ -150,6 +150,23 @@ mode "$mode_system" { } bindcode $mod+Shift+55 mode "$mode_system" +# Screenshot +set $mode_screenshot Screenshot (o) output, (a) active, (r) region, (Shift+o) copy output, (Shift+a) copy active, (Shift+r) copy region +mode "$mode_screenshot" { + bindsym o exec 'grimshot save output | xargs -I {} notify-send -t 10000 Screenshot "{}"', mode "default" + bindsym a exec 'grimshot save active | xargs -I {} notify-send -t 10000 Screenshot "{}"', mode "default" + bindsym r exec 'grimshot save area | xargs -I {} notify-send -t 10000 Screenshot "{}"', mode "default" + bindsym Shift+o exec 'grimshot copy output | xargs -I {} notify-send -t 10000 Screenshot "{}"', mode "default" + bindsym Shift+a exec 'grimshot copy active | xargs -I {} notify-send -t 10000 Screenshot "{}"', mode "default" + bindsym Shift+r exec 'grimshot copy area | xargs -I {} notify-send -t 10000 Screenshot "{}"', mode "default" + bindsym Return mode "default" + bindsym mod3+Return mode "default" + bindsym Escape mode "default" + bindsym mod3+Escape mode "default" +} +bindsym $mod+l mode "$mode_screenshot" +bindsym Print exec grimshot save output | xargs -I {} notify-send -t 10000 Screenshot "{}" + # Systemd environment exec "systemctl --user import-environment; systemctl --user start sway-session.target" exec dbus-update-activation-environment --systemd WAYLAND_DISPLAY XDG_CURRENT_DESKTOP=sway