sway: write a bad one-liner

This commit is contained in:
Artemis Tosini 2024-05-21 21:56:31 +00:00
parent 6c6ea5f157
commit 3309392b6d
Signed by: artemist
SSH key fingerprint: SHA256:EsuWCwx6fjxxExxf65rX+ocQJJAdw4R1KarpFue6Uwc

View file

@ -83,6 +83,9 @@ in
"${mod}+k" = "move workspace to right";
"${mod}+l" = "exec swaylock";
"${mod}+Mod1+e" = "exec wofi-emoji";
"${mod}+Mod1+q" = "kill";
# Sink 0 means the default AIUI
"XF86AudioRaiseVolume" = "exec pactl set-sink-volume 0 +5%";
"Shift+XF86AudioRaiseVolume" = "exec pactl set-sink-volume 0 +1%";
@ -93,8 +96,13 @@ in
"Shift+XF86MonBrightnessUp" = "exec light -A 1";
"XF86MonBrightnessDown" = "exec light -U 5";
"Shift+XF86MonBrightnessDown" = "exec light -U 1";
"Print" = ''exec grim "$(xdg-user-dir PICTURES)/Screenshot/$(date +'%F %H-%M-%S-%N_screenshot.png')"'';
"Shift+Print" = ''exec grim -g "$(slurp)" "$(xdg-user-dir PICTURES)/Screenshot/$(date +'%F %H-%M-%S-%N_screenshot.png')"'';
# sorry
"Print" = ''exec ${pkgs.writeScript "bad-screenshot" ''
grim -g "$(swaymsg -t get_tree | jq -r '.. | .nodes? | .[]? | . as $parent | .nodes[] | select(.pid? and .visible?) | "\($parent.rect.x + .deco_rect.x),\($parent.rect.y + .deco_rect.y) \(.rect.width)x\(.rect.height + .deco_rect.height)"' | slurp -r -o)" "$(xdg-user-dir PICTURES)/Screenshot/$(date +'%F %H-%M-%S-%N_screenshot.png')"
''}'';
"Shift+Print" = ''exec grim -g "$(slurp -d)" "$(xdg-user-dir PICTURES)/Screenshot/$(date +'%F %H-%M-%S-%N_screenshot.png')"'';
"Mod1+Print" = ''exec grim "$(xdg-user-dir PICTURES)/Screenshot/$(date +'%F %H-%M-%S-%N_screenshot.png')"'';
}
// extraGotoBindings
// extraMoveBindings