ADD workspace for xsane (since it has really weird window behavior)

This commit is contained in:
Nathan Dwarshuis 2020-03-27 20:27:26 -04:00
parent afdd950dd4
commit 2531dbf1cd
1 changed files with 15 additions and 4 deletions

View File

@ -104,6 +104,7 @@ runWorkspaceMon' :: IO ()
runWorkspaceMon' = runWorkspaceMon runWorkspaceMon' = runWorkspaceMon
$ fromList [ (myGimpClass, myGimpWorkspace) $ fromList [ (myGimpClass, myGimpWorkspace)
, (myVMClass, myVMWorkspace) , (myVMClass, myVMWorkspace)
, (myXSaneClass, myXSaneWorkspace)
] ]
spawnPipe' :: MonadIO m => String -> m (ProcessID, Handle) spawnPipe' :: MonadIO m => String -> m (ProcessID, Handle)
@ -202,19 +203,20 @@ moveBottom = W.modify' $ \(W.Stack f t b) -> W.Stack f (reverse b ++ t) []
myManageHook :: ManageHook myManageHook :: ManageHook
myManageHook = composeOne myManageHook = composeOne
[ isDialog -?> doCenterFloat
-- VM window -- VM window
[ className =? myVMClass -?> appendViewShift myVMWorkspace , className =? myVMClass -?> appendViewShift myVMWorkspace
-- GIMP -- GIMP
, matchGimpRole "gimp-image-window" -?> appendViewShift myGimpWorkspace , matchGimpRole "gimp-image-window" -?> appendViewShift myGimpWorkspace
, matchGimpRole "gimp-dock" -?> doF (moveBottom . W.focusMaster) , matchGimpRole "gimp-dock" -?> doF (moveBottom . W.focusMaster)
, matchGimpRole "gimp-toolbox" -?> doF (moveBottom . W.focusMaster) , matchGimpRole "gimp-toolbox" -?> doF (moveBottom . W.focusMaster)
, className =? myGimpClass -?> appendViewShift myGimpWorkspace , className =? myGimpClass -?> appendViewShift myGimpWorkspace
-- XSane
, className =? myXSaneClass -?> appendViewShift myXSaneWorkspace >> doFloat
-- the seafile applet -- the seafile applet
, className =? "Seafile Client" -?> doFloat , className =? "Seafile Client" -?> doFloat
-- gnucash -- gnucash
, (className =? "Gnucash" <&&> title =? "Transaction Import Assistant") -?> doFloat , (className =? "Gnucash" <&&> title =? "Transaction Import Assistant") -?> doFloat
-- xsane
, className =? "Xsane" -?> doFloat
-- plots and graphics created by R -- plots and graphics created by R
, className =? "R_x11" -?> doFloat , className =? "R_x11" -?> doFloat
, className =? "mpv" -?> doFloat , className =? "mpv" -?> doFloat
@ -224,7 +226,6 @@ myManageHook = composeOne
<&&> className =? "Brave-browser") -?> doFloat <&&> className =? "Brave-browser") -?> doFloat
-- the dialog windows created by the zotero addon in Google Docs -- the dialog windows created by the zotero addon in Google Docs
, (className =? "Zotero" <&&> resource =? "Toplevel") -?> doFloat , (className =? "Zotero" <&&> resource =? "Toplevel") -?> doFloat
, isDialog -?> doCenterFloat
] ]
myEventHook :: Event -> X All myEventHook :: Event -> X All
@ -549,6 +550,12 @@ myGimpWorkspace = "GIMP"
myGimpClass :: String myGimpClass :: String
myGimpClass = "Gimp-2.10" myGimpClass = "Gimp-2.10"
myXSaneWorkspace :: String
myXSaneWorkspace = "XSANE"
myXSaneClass :: String
myXSaneClass = "Xsane"
wsOccupied :: Eq a1 => a1 -> W.StackSet a1 l a2 sid sd -> Bool wsOccupied :: Eq a1 => a1 -> W.StackSet a1 l a2 sid sd -> Bool
wsOccupied tag ws = elem tag $ map W.tag $ filter (isJust . W.stack) wsOccupied tag ws = elem tag $ map W.tag $ filter (isJust . W.stack)
-- list of all workspaces with windows on them -- list of all workspaces with windows on them
@ -566,6 +573,9 @@ runVBox = spawnOrSwitch myVMWorkspace $ spawnCmd "vbox-start" ["win8raw"]
runGimp :: X () runGimp :: X ()
runGimp = spawnOrSwitch myGimpWorkspace $ spawnCmd "gimp-2.10" [] runGimp = spawnOrSwitch myGimpWorkspace $ spawnCmd "gimp-2.10" []
runXSane :: X ()
runXSane = spawnOrSwitch myXSaneWorkspace $ spawnCmd "xsane" []
myModMask :: KeyMask myModMask :: KeyMask
myModMask = mod4Mask myModMask = mod4Mask
@ -643,6 +653,7 @@ mkKeys hs client c =
, ("M-C-f", "launch file manager", runFileManager) , ("M-C-f", "launch file manager", runFileManager)
, ("M-C-v", "launch windows VM", runVBox) , ("M-C-v", "launch windows VM", runVBox)
, ("M-C-g", "launch GIMP", runGimp) , ("M-C-g", "launch GIMP", runGimp)
, ("M-C-x", "launch XSane", runXSane)
] ++ ] ++
mkNamedSubmap c "Multimedia" mkNamedSubmap c "Multimedia"