From 3b48d974180f649b45e11fb58306de55278f0f09 Mon Sep 17 00:00:00 2001 From: Andrea Date: Thu, 6 Mar 2025 13:26:29 +0100 Subject: [PATCH] chore(sway): update config --- sway/config | 10 ++++++---- sway/scripts/toggle-screen-recorder.sh | 17 ++++++++++------- 2 files changed, 16 insertions(+), 11 deletions(-) diff --git a/sway/config b/sway/config index dc0793e..017700a 100644 --- a/sway/config +++ b/sway/config @@ -205,9 +205,9 @@ bindsym $mod+Shift+minus move scratchpad bindsym $mod+minus scratchpad show # Resizing containers -bindsym $mod+r mode "resize" +bindsym $mod+r mode "Resize" -mode "resize" { +mode "Resize" { # left will shrink the containers width bindsym $left resize shrink width 10px # right will grow the containers width @@ -219,12 +219,13 @@ mode "resize" { # Return to default mode bindsym Escape mode "default" + bindsym $mod+r mode "default" } # screenshot -bindsym Print mode "screenshot" +bindsym Print mode "Screenshot" -mode "screenshot" { +mode "Screenshot" { bindsym Mod4+s+v exec grimshot save active - | swappy -f - bindsym $mod+c+v exec grimshot copy active bindsym $mod+s+a exec grimshot save area - | swappy -f - @@ -235,6 +236,7 @@ mode "screenshot" { # Return to default mode bindsym Escape mode "default" + bindsym Print mode "default" } # Status Bar: diff --git a/sway/scripts/toggle-screen-recorder.sh b/sway/scripts/toggle-screen-recorder.sh index d7123bb..cc624cc 100644 --- a/sway/scripts/toggle-screen-recorder.sh +++ b/sway/scripts/toggle-screen-recorder.sh @@ -1,10 +1,13 @@ #!/bin/bash -pid="$(pgrep "wf-recorder" || pgrep "slurp")" -status=$? +main() { + local pid="$(pgrep "wf-recorder" || pgrep "slurp")" -if [[ $status != 0 ]]; then - GEO="$(slurp)" && wf-recorder -g "$GEO" -f "$HOME/Pictures/$(date +'recording_%Y-%m-%d-%H%M%S.mp4')" -else - pkill --signal SIGINT wf-recorder -fi \ No newline at end of file + if [[ $? != 0 ]]; then + GEO="$(slurp)" && wf-recorder -g "$GEO" -f "$HOME/Pictures/$(date +'recording_%Y-%m-%d-%H%M%S.mp4')" + else + pkill --signal SIGINT wf-recorder + fi +} + +main \ No newline at end of file