mirror of
https://gitlab.com/dwt1/dotfiles.git
synced 2026-08-10 10:01:14 +10:00
Playing with gridSelect
This commit is contained in:
+47
-11
@@ -257,19 +257,37 @@ spawnSelected' lst = gridselect conf lst >>= flip whenJust spawn
|
|||||||
, gs_originFractY = 0.5
|
, gs_originFractY = 0.5
|
||||||
, gs_font = myFont
|
, gs_font = myFont
|
||||||
}
|
}
|
||||||
|
|
||||||
|
runSelectedAction' :: GSConfig (X ()) -> [(String, X ())] -> X ()
|
||||||
|
runSelectedAction' conf actions = do
|
||||||
|
selectedActionM <- gridselect conf actions
|
||||||
|
case selectedActionM of
|
||||||
|
Just selectedAction -> selectedAction
|
||||||
|
Nothing -> return ()
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
** Gridselect Menus
|
** Gridselect Menus
|
||||||
#+begin_src haskell
|
#+begin_src haskell
|
||||||
|
-- gsCategories =
|
||||||
|
-- [ ("Games", spawnSelected' gsGames)
|
||||||
|
-- --, ("Education", spawnSelected' gsEducation)
|
||||||
|
-- , ("Internet", spawnSelected' gsInternet)
|
||||||
|
-- , ("Multimedia", spawnSelected' gsMultimedia)
|
||||||
|
-- , ("Office", spawnSelected' gsOffice)
|
||||||
|
-- , ("Settings", spawnSelected' gsSettings)
|
||||||
|
-- , ("System", spawnSelected' gsSystem)
|
||||||
|
-- , ("Utilities", spawnSelected' gsUtilities)
|
||||||
|
-- ]
|
||||||
|
|
||||||
gsCategories =
|
gsCategories =
|
||||||
[ ("Games", spawnSelected' gsGames)
|
[ ("Games", "xdotool key super+alt+1")
|
||||||
--, ("Education", spawnSelected' gsEducation)
|
, ("Education", "xdotool key super+alt+2")
|
||||||
, ("Internet", spawnSelected' gsInternet)
|
, ("Internet", "xdotool key super+alt+3")
|
||||||
, ("Multimedia", spawnSelected' gsMultimedia)
|
, ("Multimedia", "xdotool key super+alt+4")
|
||||||
, ("Office", spawnSelected' gsOffice)
|
, ("Office", "xdotool key super+alt+5")
|
||||||
, ("Settings", spawnSelected' gsSettings)
|
, ("Settings", "xdotool key super+alt+6")
|
||||||
, ("System", spawnSelected' gsSystem)
|
, ("System", "xdotool key super+alt+7")
|
||||||
, ("Utilities", spawnSelected' gsUtilities)
|
, ("Utilities", "xdotool key super+alt+8")
|
||||||
]
|
]
|
||||||
|
|
||||||
gsAccessories =
|
gsAccessories =
|
||||||
@@ -282,6 +300,13 @@ gsAccessories =
|
|||||||
, ("Xonotic", "xonotic-glx")
|
, ("Xonotic", "xonotic-glx")
|
||||||
]
|
]
|
||||||
|
|
||||||
|
gsEducation =
|
||||||
|
[ ("GCompris", "gcompris-qt")
|
||||||
|
, ("Kstars", "kstars")
|
||||||
|
, ("Minuet", "minuet")
|
||||||
|
, ("Scratch", "scratch")
|
||||||
|
]
|
||||||
|
|
||||||
gsGames =
|
gsGames =
|
||||||
[ ("0 A.D.", "0ad")
|
[ ("0 A.D.", "0ad")
|
||||||
, ("Battle For Wesnoth", "wesnoth")
|
, ("Battle For Wesnoth", "wesnoth")
|
||||||
@@ -673,9 +698,20 @@ 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 gsCategories)
|
-- , ("C-g g", addName "Select favorite apps" $ runSelectedAction' defaultGSConfig gsCategories)
|
||||||
, ("C-g t", addName "Goto selected window" $ goToSelected $ mygridConfig myColorizer)
|
, ("M-M1-c", addName "Select favorite apps" $ spawnSelected' gsCategories)
|
||||||
, ("C-g b", addName "Bring selected window" $ bringSelected $ mygridConfig myColorizer)
|
, ("M-M1-<Return>", addName "Select favorite apps" $ spawnSelected'
|
||||||
|
$ gsGames ++ gsEducation ++ gsInternet ++ gsMultimedia ++ gsOffice ++ gsSettings ++ gsSystem ++ gsUtilities)
|
||||||
|
, ("M-M1-t", addName "Goto selected window" $ goToSelected $ mygridConfig myColorizer)
|
||||||
|
, ("M-M1-b", addName "Bring selected window" $ bringSelected $ mygridConfig myColorizer)
|
||||||
|
, ("M-M1-1", addName "Menu of games" $ spawnSelected' gsGames)
|
||||||
|
, ("M-M1-2", addName "Menu of education apps" $ spawnSelected' gsEducation)
|
||||||
|
, ("M-M1-3", addName "Menu of Internet apps" $ spawnSelected' gsInternet)
|
||||||
|
, ("M-M1-4", addName "Menu of multimedia apps" $ spawnSelected' gsMultimedia)
|
||||||
|
, ("M-M1-5", addName "Menu of office apps" $ spawnSelected' gsOffice)
|
||||||
|
, ("M-M1-6", addName "Menu of settings apps" $ spawnSelected' gsSettings)
|
||||||
|
, ("M-M1-7", addName "Menu of system apps" $ spawnSelected' gsSystem)
|
||||||
|
, ("M-M1-8", addName "Menu of utilities apps" $ spawnSelected' gsUtilities)
|
||||||
|
|
||||||
-- Windows navigation
|
-- Windows navigation
|
||||||
, ("M-m", addName "Move focus to master window" $ windows W.focusMaster)
|
, ("M-m", addName "Move focus to master window" $ windows W.focusMaster)
|
||||||
|
|||||||
+47
-11
@@ -189,15 +189,33 @@ spawnSelected' lst = gridselect conf lst >>= flip whenJust spawn
|
|||||||
, gs_font = myFont
|
, gs_font = myFont
|
||||||
}
|
}
|
||||||
|
|
||||||
|
runSelectedAction' :: GSConfig (X ()) -> [(String, X ())] -> X ()
|
||||||
|
runSelectedAction' conf actions = do
|
||||||
|
selectedActionM <- gridselect conf actions
|
||||||
|
case selectedActionM of
|
||||||
|
Just selectedAction -> selectedAction
|
||||||
|
Nothing -> return ()
|
||||||
|
|
||||||
|
-- gsCategories =
|
||||||
|
-- [ ("Games", spawnSelected' gsGames)
|
||||||
|
-- --, ("Education", spawnSelected' gsEducation)
|
||||||
|
-- , ("Internet", spawnSelected' gsInternet)
|
||||||
|
-- , ("Multimedia", spawnSelected' gsMultimedia)
|
||||||
|
-- , ("Office", spawnSelected' gsOffice)
|
||||||
|
-- , ("Settings", spawnSelected' gsSettings)
|
||||||
|
-- , ("System", spawnSelected' gsSystem)
|
||||||
|
-- , ("Utilities", spawnSelected' gsUtilities)
|
||||||
|
-- ]
|
||||||
|
|
||||||
gsCategories =
|
gsCategories =
|
||||||
[ ("Games", spawnSelected' gsGames)
|
[ ("Games", "xdotool key super+alt+1")
|
||||||
--, ("Education", spawnSelected' gsEducation)
|
, ("Education", "xdotool key super+alt+2")
|
||||||
, ("Internet", spawnSelected' gsInternet)
|
, ("Internet", "xdotool key super+alt+3")
|
||||||
, ("Multimedia", spawnSelected' gsMultimedia)
|
, ("Multimedia", "xdotool key super+alt+4")
|
||||||
, ("Office", spawnSelected' gsOffice)
|
, ("Office", "xdotool key super+alt+5")
|
||||||
, ("Settings", spawnSelected' gsSettings)
|
, ("Settings", "xdotool key super+alt+6")
|
||||||
, ("System", spawnSelected' gsSystem)
|
, ("System", "xdotool key super+alt+7")
|
||||||
, ("Utilities", spawnSelected' gsUtilities)
|
, ("Utilities", "xdotool key super+alt+8")
|
||||||
]
|
]
|
||||||
|
|
||||||
gsAccessories =
|
gsAccessories =
|
||||||
@@ -210,6 +228,13 @@ gsAccessories =
|
|||||||
, ("Xonotic", "xonotic-glx")
|
, ("Xonotic", "xonotic-glx")
|
||||||
]
|
]
|
||||||
|
|
||||||
|
gsEducation =
|
||||||
|
[ ("GCompris", "gcompris-qt")
|
||||||
|
, ("Kstars", "kstars")
|
||||||
|
, ("Minuet", "minuet")
|
||||||
|
, ("Scratch", "scratch")
|
||||||
|
]
|
||||||
|
|
||||||
gsGames =
|
gsGames =
|
||||||
[ ("0 A.D.", "0ad")
|
[ ("0 A.D.", "0ad")
|
||||||
, ("Battle For Wesnoth", "wesnoth")
|
, ("Battle For Wesnoth", "wesnoth")
|
||||||
@@ -533,9 +558,20 @@ 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 gsCategories)
|
-- , ("C-g g", addName "Select favorite apps" $ runSelectedAction' defaultGSConfig gsCategories)
|
||||||
, ("C-g t", addName "Goto selected window" $ goToSelected $ mygridConfig myColorizer)
|
, ("M-M1-c", addName "Select favorite apps" $ spawnSelected' gsCategories)
|
||||||
, ("C-g b", addName "Bring selected window" $ bringSelected $ mygridConfig myColorizer)
|
, ("M-M1-<Return>", addName "Select favorite apps" $ spawnSelected'
|
||||||
|
$ gsGames ++ gsEducation ++ gsInternet ++ gsMultimedia ++ gsOffice ++ gsSettings ++ gsSystem ++ gsUtilities)
|
||||||
|
, ("M-M1-t", addName "Goto selected window" $ goToSelected $ mygridConfig myColorizer)
|
||||||
|
, ("M-M1-b", addName "Bring selected window" $ bringSelected $ mygridConfig myColorizer)
|
||||||
|
, ("M-M1-1", addName "Menu of games" $ spawnSelected' gsGames)
|
||||||
|
, ("M-M1-2", addName "Menu of education apps" $ spawnSelected' gsEducation)
|
||||||
|
, ("M-M1-3", addName "Menu of Internet apps" $ spawnSelected' gsInternet)
|
||||||
|
, ("M-M1-4", addName "Menu of multimedia apps" $ spawnSelected' gsMultimedia)
|
||||||
|
, ("M-M1-5", addName "Menu of office apps" $ spawnSelected' gsOffice)
|
||||||
|
, ("M-M1-6", addName "Menu of settings apps" $ spawnSelected' gsSettings)
|
||||||
|
, ("M-M1-7", addName "Menu of system apps" $ spawnSelected' gsSystem)
|
||||||
|
, ("M-M1-8", addName "Menu of utilities apps" $ spawnSelected' gsUtilities)
|
||||||
|
|
||||||
-- Windows navigation
|
-- Windows navigation
|
||||||
, ("M-m", addName "Move focus to master window" $ windows W.focusMaster)
|
, ("M-m", addName "Move focus to master window" $ windows W.focusMaster)
|
||||||
|
|||||||
Reference in New Issue
Block a user