From 27bb824394260c261eba167cc9d16bb29e56c600 Mon Sep 17 00:00:00 2001 From: Ivan Malison Date: Fri, 11 Nov 2016 16:13:16 -0800 Subject: [PATCH] [Xmonad] Add selectLimit and keybinding --- dotfiles/xmonad/xmonad.hs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/dotfiles/xmonad/xmonad.hs b/dotfiles/xmonad/xmonad.hs index 1b6e614b..edf94bab 100644 --- a/dotfiles/xmonad/xmonad.hs +++ b/dotfiles/xmonad/xmonad.hs @@ -38,7 +38,7 @@ import XMonad.Layout.NoBorders import XMonad.Layout.Spacing import qualified XMonad.StackSet as W import XMonad.Util.CustomKeys -import XMonad.Util.Dmenu (menuMapArgs) +import qualified XMonad.Util.Dmenu as DM import qualified XMonad.Util.ExtensibleState as XS import XMonad.Util.Minimize import XMonad.Util.NamedWindows (getName) @@ -87,6 +87,10 @@ myManageHook = composeAll . concat $ -- Toggles unmodifyLayout (ModifiedLayout _ x') = x' +selectLimit = do + result <- DM.menuArgs "rofi" ["-dmenu", "-i"] ["2", "3", "4"] + setLimit $ read result + data MyToggles = LIMIT | GAPS | MAGICFOCUS @@ -102,7 +106,7 @@ myToggles = [LIMIT, GAPS, MAGICFOCUS] togglesMap = M.fromList [(show toggle, toggle) | toggle <- myToggles] selectToggle = do - Just selectedToggle <- menuMapArgs "rofi" ["-dmenu", "-i"] togglesMap + Just selectedToggle <- DM.menuMapArgs "rofi" ["-dmenu", "-i"] togglesMap sendMessage $ Toggle selectedToggle -- Layout setup @@ -317,6 +321,7 @@ addKeys conf@XConfig {modMask = modm} = , ((modm .|. controlMask, xK_space), sendMessage $ JumpToLayout "Full") , ((modm, xK_slash), sendMessage $ Toggle MIRROR) , ((modm, xK_5), selectToggle) + , ((modm, xK_4), selectLimit) , ((modm, xK_m), withFocused minimizeWindow) , ((modm .|. shiftMask, xK_m), restoreAllMinimized) , ((modm, xK_backslash), toggleWS)