@@ -30,7 +30,7 @@ import XMonad.Actions.KeyRemap
30
30
31
31
-- my Imports
32
32
-- import Modules.MyTreeSelect (treeselectAction, sshTreeselectAction, myTreeNavigation)
33
- import Modules.Keys (emacsKeys , mouseKeys , clickables , confKeys , exclusiveSps )
33
+ import Modules.Keys (emacsKeys , mouseKeys , clickables , confKeys , exclusiveSps , strWorkspaces )
34
34
import Modules.Others (dtXPConfig , dtXPConfig' , tsDefaultConfig , pp , m )
35
35
import Modules.Layouts (myManageHook , myLayoutHook )
36
36
import XMonad.Hooks.RefocusLast
@@ -47,32 +47,12 @@ myBorderWidth = 3
47
47
------------------------------------------------------------------------
48
48
-- MAIN
49
49
------------------------------------------------------------------------
50
- -- main :: IO ()
51
- -- main = xmonad def
52
- -- { handleEventHook = refocusLastWhen myPred <+> handleEventHook def
53
- -- , logHook = refocusLastLogHook <+> logHook def
54
- ---- , layoutHook = refocusLastLayoutHook $ layoutHook def
55
- -- , keys = refocusLastKeys <+> keys def
56
- -- } where
57
- -- myPred = refocusingIsActive <||> isFloat
58
- -- refocusLastKeys cnf
59
- -- = M.fromList
60
- -- $ ((modMask cnf , xK_a), toggleFocus)
61
- -- : ((modMask cnf .|. shiftMask, xK_a), swapWithLast)
62
- -- : ((modMask cnf , xK_b), toggleRefocusing)
63
- -- : [ ( (modMask cnf .|. shiftMask, n)
64
- -- , windows =<< shiftRLWhen myPred wksp
65
- -- )
66
- -- | (n, wksp) <- zip [xK_1..xK_9] (workspaces cnf)
67
- -- ]
68
-
69
50
main :: IO ()
70
51
-- main = xmonad =<< xmobar def { modMask = mod4Mask }
71
-
52
+ --
72
53
main = do
73
54
nScreens <- countScreens
74
- -- let nScreens = 2
75
- handles <- mapM (spawnPipe . xmobarCommand) [0 .. nScreens- 1 ]
55
+ handles <- mapM (\ (x, y) -> spawnPipe (xmobarCommand x y)) [(s, nScreens) | s <- [0 .. nScreens- 1 ]]
76
56
77
57
xmonad $ ewmh def {
78
58
manageHook = myManageHook -- how windows are opened
@@ -92,7 +72,7 @@ main = do
92
72
93
73
, focusFollowsMouse = False
94
74
, clickJustFocuses = False
95
- , workspaces = withScreens nScreens clickables
75
+ , workspaces = withScreens nScreens strWorkspaces
96
76
, modMask = mod4Mask
97
77
, keys = confKeys -- Workspaces
98
78
@@ -107,17 +87,23 @@ main = do
107
87
where myPred = refocusingIsActive <||> isFloat
108
88
109
89
-- TODO Refactor
110
- xmobarCommand (S screen) = unwords [" xmobar" , " -x" , show screen, myConfig screen]
90
+ xmobarCommand (S screen) nScreens = unwords [" xmobar" , " -x" , show screen, myConfig screen nScreens ]
111
91
where
112
- myConfig 2 = " $HOME/.config/xmobar/xmobarrc_mid.hs"
113
- myConfig 0 = " $HOME/.config/xmobar/xmobarrc_left.hs"
114
- myConfig 1 = " $HOME/.config/xmobar/xmobarrc_right.hs"
92
+ myConfig screen nScreens
93
+ | nScreens == 1 = " $HOME/.config/xmobar/laptop/mono.hs"
94
+ | nScreens == 2 && screen == 1 = " $HOME/.config/xmobar/laptop/docked_right.hs"
95
+ | nScreens == 2 && screen == 0 = " $HOME/.config/xmobar/laptop/docked_laptop.hs"
96
+ | nScreens == 3 && screen == 1 = " $HOME/.config/xmobar/laptop/left.hs"
97
+ | nScreens == 3 && screen == 1 = " $HOME/.config/xmobar/desktop/center.hs"
98
+ | nScreens == 3 && screen == 2 = " $HOME/.config/xmobar/desktop/right.hs"
99
+ | otherwise = " $HOME/.config/xmobar/xmobarrc_laptop.hs"
100
+ ++ " --additional-logger=StdinReader"
115
101
116
102
addNETSupported :: Atom -> X ()
117
103
addNETSupported x = withDisplay $ \ dpy -> do
118
104
r <- asks theRoot
119
105
a_NET_SUPPORTED <- getAtom " _NET_SUPPORTED"
120
- a <- getAtom " ATOM "
106
+ a <- getAtom " ATOMOSINT "
121
107
liftIO $ do
122
108
sup <- join . maybeToList <$> getWindowProperty32 dpy a_NET_SUPPORTED r
123
109
when (fromIntegral x `notElem` sup) $
@@ -135,4 +121,4 @@ myStartupHook :: X ()
135
121
myStartupHook = do
136
122
spawnOnce " $HOME/system/etc/autostart.sh"
137
123
setWMName " xmonad"
138
- -- setWMName "LG3D" --for the JVM
124
+ setWMName " LG3D" -- for the JVM
0 commit comments