Files
dtos-dotfiles/.xmonad/lib/Custom/MyGridMenu.hs
2020-07-14 20:08:47 -05:00

56 lines
2.0 KiB
Haskell

module Custom.MyGridMenu where
-- imports
import XMonad
import XMonad.Actions.GridSelect
import Custom.MyVariables
------------------------------------------------------------------------
-- 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.
myColorizer :: Window -> Bool -> X (String, String)
myColorizer = colorRangeFromClassName
(0x29,0x2d,0x3e) -- lowest inactive bg
(0x29,0x2d,0x3e) -- highest inactive bg
(0xc7,0x92,0xea) -- active bg
(0xc0,0xa7,0x9a) -- inactive fg
(0x29,0x2d,0x3e) -- active fg
-- gridSelect menu layout
mygridConfig :: p -> GSConfig Window
mygridConfig colorizer = (buildDefaultGSConfig myColorizer)
{ gs_cellheight = 40
, gs_cellwidth = 200
, gs_cellpadding = 6
, gs_originFractX = 0.5
, gs_originFractY = 0.5
, gs_font = myFont
}
spawnSelected' :: [(String, String)] -> X ()
spawnSelected' lst = gridselect conf lst >>= flip whenJust spawn
where conf = def
{ gs_cellheight = 40
, gs_cellwidth = 200
, gs_cellpadding = 6
, gs_originFractX = 0.5
, gs_originFractY = 0.5
, gs_font = myFont
}
myAppGrid = [ ("Audacity", "audacity")
, ("Deadbeef", "deadbeef")
, ("Emacs", "emacsclient -c -a emacs")
, ("Firefox", "firefox")
, ("Geany", "geany")
, ("Geary", "geary")
, ("Gimp", "gimp")
, ("Kdenlive", "kdenlive")
, ("LibreOffice Impress", "loimpress")
, ("LibreOffice Writer", "lowriter")
, ("OBS", "obs")
, ("PCManFM", "pcmanfm")
]