Adding gridSelect to xmonad
This commit is contained in:
parent
432ccefd58
commit
447b513161
|
@ -10,6 +10,8 @@
|
||||||
- [[#variables][Variables]]
|
- [[#variables][Variables]]
|
||||||
- [[#autostart-the-startup-hook][Autostart (The Startup Hook)]]
|
- [[#autostart-the-startup-hook][Autostart (The Startup Hook)]]
|
||||||
- [[#gridselect][Gridselect]]
|
- [[#gridselect][Gridselect]]
|
||||||
|
- [[#gridselect-configuration][GridSelect Configuration]]
|
||||||
|
- [[#gridselect-menus][Gridselect Menus]]
|
||||||
- [[#scratchpads][Scratchpads]]
|
- [[#scratchpads][Scratchpads]]
|
||||||
- [[#layouts][Layouts]]
|
- [[#layouts][Layouts]]
|
||||||
- [[#workspaces][Workspaces]]
|
- [[#workspaces][Workspaces]]
|
||||||
|
@ -201,7 +203,30 @@ Select only =ONE= of the following four ways to set the wallpaper.
|
||||||
* Gridselect
|
* Gridselect
|
||||||
GridSelect displays items (programs, open windows, etc.) in a 2D grid and lets the user select from it with the cursor/hjkl keys or the mouse.
|
GridSelect displays items (programs, open windows, etc.) in a 2D grid and lets the user select from it with the cursor/hjkl keys or the mouse.
|
||||||
|
|
||||||
|
** GridSelect Configuration
|
||||||
#+BEGIN_SRC haskell
|
#+BEGIN_SRC haskell
|
||||||
|
myNavigation :: TwoD a (Maybe a)
|
||||||
|
myNavigation = makeXEventhandler $ shadowWithKeymap navKeyMap navDefaultHandler
|
||||||
|
where navKeyMap = M.fromList [
|
||||||
|
((0,xK_Escape), cancel)
|
||||||
|
,((0,xK_Return), select)
|
||||||
|
,((0,xK_slash) , substringSearch myNavigation)
|
||||||
|
,((0,xK_Left) , move (-1,0) >> myNavigation)
|
||||||
|
,((0,xK_h) , move (-1,0) >> myNavigation)
|
||||||
|
,((0,xK_Right) , move (1,0) >> myNavigation)
|
||||||
|
,((0,xK_l) , move (1,0) >> myNavigation)
|
||||||
|
,((0,xK_Down) , move (0,1) >> myNavigation)
|
||||||
|
,((0,xK_j) , move (0,1) >> myNavigation)
|
||||||
|
,((0,xK_Up) , move (0,-1) >> myNavigation)
|
||||||
|
,((0,xK_k) , move (0,-1) >> myNavigation)
|
||||||
|
,((0,xK_y) , move (-1,-1) >> myNavigation)
|
||||||
|
,((0,xK_i) , move (1,-1) >> myNavigation)
|
||||||
|
,((0,xK_n) , move (-1,1) >> myNavigation)
|
||||||
|
,((0,xK_m) , move (1,-1) >> myNavigation)
|
||||||
|
,((0,xK_space) , setPos (0,0) >> myNavigation)
|
||||||
|
]
|
||||||
|
navDefaultHandler = const myNavigation
|
||||||
|
|
||||||
myColorizer :: Window -> Bool -> X (String, String)
|
myColorizer :: Window -> Bool -> X (String, String)
|
||||||
myColorizer = colorRangeFromClassName
|
myColorizer = colorRangeFromClassName
|
||||||
(0x28,0x2c,0x34) -- lowest inactive bg
|
(0x28,0x2c,0x34) -- lowest inactive bg
|
||||||
|
@ -216,6 +241,7 @@ mygridConfig colorizer = (buildDefaultGSConfig myColorizer)
|
||||||
{ gs_cellheight = 40
|
{ gs_cellheight = 40
|
||||||
, gs_cellwidth = 200
|
, gs_cellwidth = 200
|
||||||
, gs_cellpadding = 6
|
, gs_cellpadding = 6
|
||||||
|
, gs_navigate = myNavigation
|
||||||
, gs_originFractX = 0.5
|
, gs_originFractX = 0.5
|
||||||
, gs_originFractY = 0.5
|
, gs_originFractY = 0.5
|
||||||
, gs_font = myFont
|
, gs_font = myFont
|
||||||
|
@ -231,61 +257,98 @@ spawnSelected' lst = gridselect conf lst >>= flip whenJust spawn
|
||||||
, gs_originFractY = 0.5
|
, gs_originFractY = 0.5
|
||||||
, gs_font = myFont
|
, gs_font = myFont
|
||||||
}
|
}
|
||||||
|
#+end_src
|
||||||
|
|
||||||
myTestGrid = [ ("MyAppGrid", spawnSelected' myAppGrid)
|
** Gridselect Menus
|
||||||
, ("Accessories", spawnSelected' myAccessories)
|
#+begin_src haskell
|
||||||
, ("Education", spawnSelected' myOffice)
|
gsCategories =
|
||||||
, ("Games", spawnSelected' myOffice)
|
[ ("Games", spawnSelected' gsGames)
|
||||||
, ("Internet", spawnSelected' myOffice)
|
--, ("Education", spawnSelected' gsEducation)
|
||||||
, ("Multimedia", spawnSelected' myOffice)
|
, ("Internet", spawnSelected' gsInternet)
|
||||||
, ("Office", spawnSelected' myOffice)
|
, ("Multimedia", spawnSelected' gsMultimedia)
|
||||||
, ("System", spawnSelected' myOffice)
|
, ("Office", spawnSelected' gsOffice)
|
||||||
, ("Utilities", spawnSelected' myOffice)
|
, ("Settings", spawnSelected' gsSettings)
|
||||||
|
, ("System", spawnSelected' gsSystem)
|
||||||
|
, ("Utilities", spawnSelected' gsUtilities)
|
||||||
]
|
]
|
||||||
|
|
||||||
myAppGrid = [ ("Audacity", "audacity")
|
gsAccessories =
|
||||||
, ("Deadbeef", "deadbeef")
|
[ ("0 A.D.", "0ad")
|
||||||
, ("Emacs", "emacsclient -c -a emacs")
|
, ("Battle For Wesnoth", "wesnoth")
|
||||||
|
, ("OpenArena", "openarena")
|
||||||
|
, ("Sauerbraten", "sauerbraten")
|
||||||
|
, ("Steam", "steam")
|
||||||
|
, ("Unvanquished", "unvanquished")
|
||||||
|
, ("Xonotic", "xonotic-glx")
|
||||||
|
]
|
||||||
|
|
||||||
|
gsGames =
|
||||||
|
[ ("0 A.D.", "0ad")
|
||||||
|
, ("Battle For Wesnoth", "wesnoth")
|
||||||
|
, ("OpenArena", "openarena")
|
||||||
|
, ("Sauerbraten", "sauerbraten")
|
||||||
|
, ("Steam", "steam")
|
||||||
|
, ("Unvanquished", "unvanquished")
|
||||||
|
, ("Xonotic", "xonotic-glx")
|
||||||
|
]
|
||||||
|
|
||||||
|
gsInternet =
|
||||||
|
[ ("Brave", "brave")
|
||||||
|
, ("Discord", "discord")
|
||||||
|
, ("Element", "element-desktop")
|
||||||
, ("Firefox", "firefox")
|
, ("Firefox", "firefox")
|
||||||
, ("Geany", "geany")
|
, ("LBRY App", "lbry")
|
||||||
, ("Geary", "geary")
|
, ("Mailspring", "mailspring")
|
||||||
, ("Gimp", "gimp")
|
, ("Nextcloud", "nextcloud")
|
||||||
, ("Kdenlive", "kdenlive")
|
, ("Qutebrowser", "qutebrowser")
|
||||||
, ("LibreOffice Impress", "loimpress")
|
, ("Transmission", "transmission-gtk")
|
||||||
, ("LibreOffice Writer", "lowriter")
|
, ("Zoom", "zoom")
|
||||||
, ("OBS", "obs")
|
|
||||||
, ("PCManFM", "pcmanfm")
|
|
||||||
]
|
]
|
||||||
|
|
||||||
myAccessories = [ ("Audacity", "audacity")
|
gsMultimedia =
|
||||||
|
[ ("Audacity", "audacity")
|
||||||
|
, ("Blender", "blender")
|
||||||
, ("Deadbeef", "deadbeef")
|
, ("Deadbeef", "deadbeef")
|
||||||
, ("Emacs", "emacsclient -c -a emacs")
|
|
||||||
, ("Firefox", "firefox")
|
|
||||||
, ("Geany", "geany")
|
|
||||||
, ("Geary", "geary")
|
|
||||||
, ("Gimp", "gimp")
|
|
||||||
, ("Kdenlive", "kdenlive")
|
, ("Kdenlive", "kdenlive")
|
||||||
, ("LibreOffice Impress", "loimpress")
|
, ("OBS Studio", "obs")
|
||||||
, ("LibreOffice Writer", "lowriter")
|
, ("VLC", "vlc")
|
||||||
, ("OBS", "obs")
|
|
||||||
, ("PCManFM", "pcmanfm")
|
|
||||||
]
|
]
|
||||||
|
|
||||||
myOffice = [ ("Audacity", "audacity")
|
gsOffice =
|
||||||
, ("Deadbeef", "deadbeef")
|
[ ("Document Viewer", "evince")
|
||||||
, ("Emacs", "emacsclient -c -a emacs")
|
, ("LibreOffice", "libreoffice")
|
||||||
, ("Firefox", "firefox")
|
, ("LO Base", "lobase")
|
||||||
, ("Geany", "geany")
|
, ("LO Calc", "localc")
|
||||||
, ("Geary", "geary")
|
, ("LO Draw", "lodraw")
|
||||||
, ("Gimp", "gimp")
|
, ("LO Impress", "loimpress")
|
||||||
, ("Kdenlive", "kdenlive")
|
, ("LO Math", "lomath")
|
||||||
, ("LibreOffice Impress", "loimpress")
|
, ("LO Writer", "lowriter")
|
||||||
, ("LibreOffice Writer", "lowriter")
|
|
||||||
, ("OBS", "obs")
|
|
||||||
, ("PCManFM", "pcmanfm")
|
|
||||||
]
|
]
|
||||||
|
|
||||||
|
gsSettings =
|
||||||
|
[ ("ARandR", "arandr")
|
||||||
|
, ("ArchLinux Tweak Tool", "archlinux-tweak-tool")
|
||||||
|
, ("Customize Look and Feel", "lxappearance")
|
||||||
|
, ("Firewall Configuration", "sudo gufw")
|
||||||
|
]
|
||||||
|
|
||||||
|
gsSystem =
|
||||||
|
[ ("Alacritty", "alacritty")
|
||||||
|
, ("Bash", (myTerminal ++ " -e bash"))
|
||||||
|
, ("Htop", (myTerminal ++ " -e htop"))
|
||||||
|
, ("Fish", (myTerminal ++ " -e fish"))
|
||||||
|
, ("PCManFM", "pcmanfm")
|
||||||
|
, ("VirtualBox", "virtualbox")
|
||||||
|
, ("Virt-Manager", "virt-manager")
|
||||||
|
, ("Zsh", (myTerminal ++ " -e zsh"))
|
||||||
|
]
|
||||||
|
|
||||||
|
gsUtilities =
|
||||||
|
[ ("Emacs", "emacs")
|
||||||
|
, ("Emacsclient", "emacsclient -c -a 'emacs'")
|
||||||
|
, ("Nitrogen", "nitrogen")
|
||||||
|
, ("Vim", (myTerminal ++ " -e vim"))
|
||||||
|
]
|
||||||
|
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
|
|
||||||
|
@ -610,7 +673,7 @@ myKeys c = (subtitle "Custom Keys":) $ mkNamedKeymap c $
|
||||||
, ("C-M1-l", addName "Increase screen spacing" $ incScreenSpacing 4)
|
, ("C-M1-l", addName "Increase screen spacing" $ incScreenSpacing 4)
|
||||||
|
|
||||||
-- Grid Select (CTR-g followed by a key)
|
-- Grid Select (CTR-g followed by a key)
|
||||||
, ("C-g g", addName "Select favorite apps" $ runSelectedAction def myTestGrid)
|
, ("C-g g", addName "Select favorite apps" $ runSelectedAction def gsCategories)
|
||||||
, ("C-g t", addName "Goto selected window" $ goToSelected $ mygridConfig myColorizer)
|
, ("C-g t", addName "Goto selected window" $ goToSelected $ mygridConfig myColorizer)
|
||||||
, ("C-g b", addName "Bring selected window" $ bringSelected $ mygridConfig myColorizer)
|
, ("C-g b", addName "Bring selected window" $ bringSelected $ mygridConfig myColorizer)
|
||||||
|
|
||||||
|
|
|
@ -136,6 +136,28 @@ myStartupHook = do
|
||||||
-- spawnOnce "nitrogen --restore &" -- if you prefer nitrogen to feh
|
-- spawnOnce "nitrogen --restore &" -- if you prefer nitrogen to feh
|
||||||
setWMName "LG3D"
|
setWMName "LG3D"
|
||||||
|
|
||||||
|
myNavigation :: TwoD a (Maybe a)
|
||||||
|
myNavigation = makeXEventhandler $ shadowWithKeymap navKeyMap navDefaultHandler
|
||||||
|
where navKeyMap = M.fromList [
|
||||||
|
((0,xK_Escape), cancel)
|
||||||
|
,((0,xK_Return), select)
|
||||||
|
,((0,xK_slash) , substringSearch myNavigation)
|
||||||
|
,((0,xK_Left) , move (-1,0) >> myNavigation)
|
||||||
|
,((0,xK_h) , move (-1,0) >> myNavigation)
|
||||||
|
,((0,xK_Right) , move (1,0) >> myNavigation)
|
||||||
|
,((0,xK_l) , move (1,0) >> myNavigation)
|
||||||
|
,((0,xK_Down) , move (0,1) >> myNavigation)
|
||||||
|
,((0,xK_j) , move (0,1) >> myNavigation)
|
||||||
|
,((0,xK_Up) , move (0,-1) >> myNavigation)
|
||||||
|
,((0,xK_k) , move (0,-1) >> myNavigation)
|
||||||
|
,((0,xK_y) , move (-1,-1) >> myNavigation)
|
||||||
|
,((0,xK_i) , move (1,-1) >> myNavigation)
|
||||||
|
,((0,xK_n) , move (-1,1) >> myNavigation)
|
||||||
|
,((0,xK_m) , move (1,-1) >> myNavigation)
|
||||||
|
,((0,xK_space) , setPos (0,0) >> myNavigation)
|
||||||
|
]
|
||||||
|
navDefaultHandler = const myNavigation
|
||||||
|
|
||||||
myColorizer :: Window -> Bool -> X (String, String)
|
myColorizer :: Window -> Bool -> X (String, String)
|
||||||
myColorizer = colorRangeFromClassName
|
myColorizer = colorRangeFromClassName
|
||||||
(0x28,0x2c,0x34) -- lowest inactive bg
|
(0x28,0x2c,0x34) -- lowest inactive bg
|
||||||
|
@ -150,6 +172,7 @@ mygridConfig colorizer = (buildDefaultGSConfig myColorizer)
|
||||||
{ gs_cellheight = 40
|
{ gs_cellheight = 40
|
||||||
, gs_cellwidth = 200
|
, gs_cellwidth = 200
|
||||||
, gs_cellpadding = 6
|
, gs_cellpadding = 6
|
||||||
|
, gs_navigate = myNavigation
|
||||||
, gs_originFractX = 0.5
|
, gs_originFractX = 0.5
|
||||||
, gs_originFractY = 0.5
|
, gs_originFractY = 0.5
|
||||||
, gs_font = myFont
|
, gs_font = myFont
|
||||||
|
@ -166,57 +189,93 @@ spawnSelected' lst = gridselect conf lst >>= flip whenJust spawn
|
||||||
, gs_font = myFont
|
, gs_font = myFont
|
||||||
}
|
}
|
||||||
|
|
||||||
myTestGrid = [ ("MyAppGrid", spawnSelected' myAppGrid)
|
gsCategories =
|
||||||
, ("Accessories", spawnSelected' myAccessories)
|
[ ("Games", spawnSelected' gsGames)
|
||||||
, ("Education", spawnSelected' myOffice)
|
--, ("Education", spawnSelected' gsEducation)
|
||||||
, ("Games", spawnSelected' myOffice)
|
, ("Internet", spawnSelected' gsInternet)
|
||||||
, ("Internet", spawnSelected' myOffice)
|
, ("Multimedia", spawnSelected' gsMultimedia)
|
||||||
, ("Multimedia", spawnSelected' myOffice)
|
, ("Office", spawnSelected' gsOffice)
|
||||||
, ("Office", spawnSelected' myOffice)
|
, ("Settings", spawnSelected' gsSettings)
|
||||||
, ("System", spawnSelected' myOffice)
|
, ("System", spawnSelected' gsSystem)
|
||||||
, ("Utilities", spawnSelected' myOffice)
|
, ("Utilities", spawnSelected' gsUtilities)
|
||||||
]
|
]
|
||||||
|
|
||||||
myAppGrid = [ ("Audacity", "audacity")
|
gsAccessories =
|
||||||
, ("Deadbeef", "deadbeef")
|
[ ("0 A.D.", "0ad")
|
||||||
, ("Emacs", "emacsclient -c -a emacs")
|
, ("Battle For Wesnoth", "wesnoth")
|
||||||
, ("Firefox", "firefox")
|
, ("OpenArena", "openarena")
|
||||||
, ("Geany", "geany")
|
, ("Sauerbraten", "sauerbraten")
|
||||||
, ("Geary", "geary")
|
, ("Steam", "steam")
|
||||||
, ("Gimp", "gimp")
|
, ("Unvanquished", "unvanquished")
|
||||||
, ("Kdenlive", "kdenlive")
|
, ("Xonotic", "xonotic-glx")
|
||||||
, ("LibreOffice Impress", "loimpress")
|
|
||||||
, ("LibreOffice Writer", "lowriter")
|
|
||||||
, ("OBS", "obs")
|
|
||||||
, ("PCManFM", "pcmanfm")
|
|
||||||
]
|
]
|
||||||
|
|
||||||
myAccessories = [ ("Audacity", "audacity")
|
gsGames =
|
||||||
, ("Deadbeef", "deadbeef")
|
[ ("0 A.D.", "0ad")
|
||||||
, ("Emacs", "emacsclient -c -a emacs")
|
, ("Battle For Wesnoth", "wesnoth")
|
||||||
, ("Firefox", "firefox")
|
, ("OpenArena", "openarena")
|
||||||
, ("Geany", "geany")
|
, ("Sauerbraten", "sauerbraten")
|
||||||
, ("Geary", "geary")
|
, ("Steam", "steam")
|
||||||
, ("Gimp", "gimp")
|
, ("Unvanquished", "unvanquished")
|
||||||
, ("Kdenlive", "kdenlive")
|
, ("Xonotic", "xonotic-glx")
|
||||||
, ("LibreOffice Impress", "loimpress")
|
|
||||||
, ("LibreOffice Writer", "lowriter")
|
|
||||||
, ("OBS", "obs")
|
|
||||||
, ("PCManFM", "pcmanfm")
|
|
||||||
]
|
]
|
||||||
|
|
||||||
myOffice = [ ("Audacity", "audacity")
|
gsInternet =
|
||||||
, ("Deadbeef", "deadbeef")
|
[ ("Brave", "brave")
|
||||||
, ("Emacs", "emacsclient -c -a emacs")
|
, ("Discord", "discord")
|
||||||
|
, ("Element", "element-desktop")
|
||||||
, ("Firefox", "firefox")
|
, ("Firefox", "firefox")
|
||||||
, ("Geany", "geany")
|
, ("LBRY App", "lbry")
|
||||||
, ("Geary", "geary")
|
, ("Mailspring", "mailspring")
|
||||||
, ("Gimp", "gimp")
|
, ("Nextcloud", "nextcloud")
|
||||||
|
, ("Qutebrowser", "qutebrowser")
|
||||||
|
, ("Transmission", "transmission-gtk")
|
||||||
|
, ("Zoom", "zoom")
|
||||||
|
]
|
||||||
|
|
||||||
|
gsMultimedia =
|
||||||
|
[ ("Audacity", "audacity")
|
||||||
|
, ("Blender", "blender")
|
||||||
|
, ("Deadbeef", "deadbeef")
|
||||||
, ("Kdenlive", "kdenlive")
|
, ("Kdenlive", "kdenlive")
|
||||||
, ("LibreOffice Impress", "loimpress")
|
, ("OBS Studio", "obs")
|
||||||
, ("LibreOffice Writer", "lowriter")
|
, ("VLC", "vlc")
|
||||||
, ("OBS", "obs")
|
]
|
||||||
|
|
||||||
|
gsOffice =
|
||||||
|
[ ("Document Viewer", "evince")
|
||||||
|
, ("LibreOffice", "libreoffice")
|
||||||
|
, ("LO Base", "lobase")
|
||||||
|
, ("LO Calc", "localc")
|
||||||
|
, ("LO Draw", "lodraw")
|
||||||
|
, ("LO Impress", "loimpress")
|
||||||
|
, ("LO Math", "lomath")
|
||||||
|
, ("LO Writer", "lowriter")
|
||||||
|
]
|
||||||
|
|
||||||
|
gsSettings =
|
||||||
|
[ ("ARandR", "arandr")
|
||||||
|
, ("ArchLinux Tweak Tool", "archlinux-tweak-tool")
|
||||||
|
, ("Customize Look and Feel", "lxappearance")
|
||||||
|
, ("Firewall Configuration", "sudo gufw")
|
||||||
|
]
|
||||||
|
|
||||||
|
gsSystem =
|
||||||
|
[ ("Alacritty", "alacritty")
|
||||||
|
, ("Bash", (myTerminal ++ " -e bash"))
|
||||||
|
, ("Htop", (myTerminal ++ " -e htop"))
|
||||||
|
, ("Fish", (myTerminal ++ " -e fish"))
|
||||||
, ("PCManFM", "pcmanfm")
|
, ("PCManFM", "pcmanfm")
|
||||||
|
, ("VirtualBox", "virtualbox")
|
||||||
|
, ("Virt-Manager", "virt-manager")
|
||||||
|
, ("Zsh", (myTerminal ++ " -e zsh"))
|
||||||
|
]
|
||||||
|
|
||||||
|
gsUtilities =
|
||||||
|
[ ("Emacs", "emacs")
|
||||||
|
, ("Emacsclient", "emacsclient -c -a 'emacs'")
|
||||||
|
, ("Nitrogen", "nitrogen")
|
||||||
|
, ("Vim", (myTerminal ++ " -e vim"))
|
||||||
]
|
]
|
||||||
|
|
||||||
myScratchPads :: [NamedScratchpad]
|
myScratchPads :: [NamedScratchpad]
|
||||||
|
@ -474,7 +533,7 @@ myKeys c = (subtitle "Custom Keys":) $ mkNamedKeymap c $
|
||||||
, ("C-M1-l", addName "Increase screen spacing" $ incScreenSpacing 4)
|
, ("C-M1-l", addName "Increase screen spacing" $ incScreenSpacing 4)
|
||||||
|
|
||||||
-- Grid Select (CTR-g followed by a key)
|
-- Grid Select (CTR-g followed by a key)
|
||||||
, ("C-g g", addName "Select favorite apps" $ runSelectedAction def myTestGrid)
|
, ("C-g g", addName "Select favorite apps" $ runSelectedAction def gsCategories)
|
||||||
, ("C-g t", addName "Goto selected window" $ goToSelected $ mygridConfig myColorizer)
|
, ("C-g t", addName "Goto selected window" $ goToSelected $ mygridConfig myColorizer)
|
||||||
, ("C-g b", addName "Bring selected window" $ bringSelected $ mygridConfig myColorizer)
|
, ("C-g b", addName "Bring selected window" $ bringSelected $ mygridConfig myColorizer)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue