From 384cb9064de8c93362ce0941e9ea61c2f150d49d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Leonardo=20Eug=C3=AAnio?= Date: Sun, 7 Aug 2022 21:40:27 -0300 Subject: [PATCH] add parenting binds --- user/sway.nix | 60 ++++++++++++++++++++++++++++++--------------------- 1 file changed, 36 insertions(+), 24 deletions(-) diff --git a/user/sway.nix b/user/sway.nix index 88c6a39..d356646 100644 --- a/user/sway.nix +++ b/user/sway.nix @@ -194,6 +194,20 @@ in { "move workspace output ${direction}"; })); + parenting_binds = { + "${mod}+equal" = "focus parent"; + "${mod}+minus" = "focus child"; + "${mod}+r" = "layout toggle split"; + "${mod}+t" = "layout toggle split tabbed stacking"; + "${mod}+b" = "splith"; + "${mod}+v" = "splitv"; + "${mod}+a" = "focus parent"; + + ## TODO: + # "${mod}+Shift+minus" = "move scratchpad"; + # "${mod}+minus" = "scratchpad show"; + }; + audio_binds = { XF86AudioRaiseVolume = "exec pactl set-sink-volume @DEFAULT_SINK@ +10%"; @@ -212,30 +226,28 @@ in { "--locked Ctrl+${mod}+z" = "exec ${_suspend}/bin/_suspend"; "${mod}+Alt+c" = "exec ${_sway_idle_toggle}/bin/_sway_idle_toggle"; }; - in { - "${mod}+Return" = "exec ${terminal}"; - "${mod}+Ctrl+Return" = "exec thunar"; - "${mod}+x" = "kill"; - "${mod}+s" = "exec ${menu}"; - "${mod}+m" = "mode audio"; - "${mod}+b" = "splith"; - "${mod}+v" = "splitv"; - "${mod}+t" = "layout toggle split tabbed stacking"; - "${mod}+r" = "layout toggle split"; - "${mod}+f" = "fullscreen toggle"; - "${mod}+a" = "focus parent"; - # "${mod}+s" = "layout stacking"; - "${mod}+w" = "layout tabbed"; - # "${mod}+e" = "layout toggle split"; - "${mod}+Shift+space" = "floating toggle"; - "${mod}+space" = "focus mode_toggle"; - "${mod}+Shift+minus" = "move scratchpad"; - "${mod}+minus" = "scratchpad show"; - "${mod}+Shift+c" = "reload"; - # "${mod}+Shift+e" = - # "exec swaynag -t warning -m 'You pressed the exit shortcut. Do you really want to exit sway? This will end your Wayland session.' -b 'Yes, exit sway' 'swaymsg exit'"; - } // workspace_binds // prev_next_binds // movement_binds // audio_binds - // system_binds; + other_binds = { + "${mod}+s" = "exec ${menu}"; + "${mod}+Return" = "exec ${terminal}"; + "${mod}+Ctrl+Return" = "exec thunar"; + "${mod}+x" = "kill"; + "${mod}+m" = "mode audio"; + "${mod}+f" = "fullscreen toggle"; + "${mod}+Shift+space" = "floating toggle"; + "${mod}+space" = "focus mode_toggle"; + "${mod}+Shift+c" = "reload"; + # "${mod}+Shift+e" = + # "exec swaynag -t warning -m 'You pressed the exit shortcut. Do you really want to exit sway? This will end your Wayland session.' -b 'Yes, exit sway' 'swaymsg exit'"; + }; + in mergeAttrsSet [ + other_binds + workspace_binds + prev_next_binds + movement_binds + audio_binds + system_binds + parenting_binds + ]; terminal = pkgs.alacritty.executable; }; };