From 22a1f5e5f282260579eacdb48db963fdd733934a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Leonardo=20Eug=C3=AAnio?= Date: Sun, 7 Aug 2022 16:02:21 -0300 Subject: [PATCH] update prev next binds --- user/sway.nix | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/user/sway.nix b/user/sway.nix index c47edb4..ba21d55 100644 --- a/user/sway.nix +++ b/user/sway.nix @@ -126,9 +126,12 @@ in { "--whole-window" else ""; - prev_binds = map (key: { - "${maybe_window key} ${mod}+${key}" = "workspace prev_on_output"; - }) [ + makePrevNextBindFunction = (prev_or_next: + map (key: { + "${maybe_window key} ${mod}+${key}" = + "workspace ${prev_or_next}_on_output"; + })); + prev_binds = makePrevNextBindFunction "prev" [ key.tabL "bracketleft" "Prior" @@ -136,10 +139,16 @@ in { "button4" "Shift+Tab" ]; - next_binds = map (key: { - "${maybe_window key} ${mod}+${key}" = "workspace next_on_output"; - }) [ key.tabR "bracketright" "Next" "button8" "button5" "Tab" ]; + next_binds = makePrevNextBindFunction "next" [ + key.tabR + "bracketright" + "Next" + "button8" + "button5" + "Tab" + ]; in mergeAttrsSet (prev_binds ++ next_binds); + movement_binds = { "${mod}+${key.left}" = "focus left"; "${mod}+${key.down}" = "focus down";