1
0
Fork 0

sway: Add key bindings for screenshots

This commit is contained in:
Olli 2026-03-29 13:17:43 +02:00
commit 9d31a63799

View file

@ -150,6 +150,23 @@ mode "$mode_system" {
} }
bindcode $mod+Shift+55 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 # Systemd environment
exec "systemctl --user import-environment; systemctl --user start sway-session.target" exec "systemctl --user import-environment; systemctl --user start sway-session.target"
exec dbus-update-activation-environment --systemd WAYLAND_DISPLAY XDG_CURRENT_DESKTOP=sway exec dbus-update-activation-environment --systemd WAYLAND_DISPLAY XDG_CURRENT_DESKTOP=sway