-
Notifications
You must be signed in to change notification settings - Fork 0
/
xmonad.hs.bk
223 lines (200 loc) · 8.6 KB
/
xmonad.hs.bk
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
--------------------------------------------------------------------------------
-- file: ~/.xmonads/xmonads.hs
-- author: Abdi Dahir - I have no website :(
-- modified: December 2011
-- vim: set fenc=utf-8:nu:ai:si:et:ts=4:sw=4:ft=haskell:
--
-- Shity haskel config file
-- Most of these settings were "Inspired" by online resources, mostly arch wiki
-- Knowing haskell in no way helps with this. Well maybe reading it but
-- god so much setting specific attributes and commands!
--
-- TODO: Pump aptana to code workspace
-- TODO: Pump minecraft to games workspace
-- TODO: Create a second status bar
-- TODO: Replace XXX: with bitmaps found online
-- TODO: Main "startmenu" link Arch icon should be clickable and list avalible commands
--
--------------------------------------------------------------------------------
import XMonad
import XMonad.Actions.CycleWS
import XMonad.Actions.MouseGestures
import XMonad.Actions.MouseResize
import XMonad.Actions.GridSelect
import XMonad.Hooks.DynamicLog
import XMonad.Hooks.ManageDocks
import XMonad.Hooks.SetWMName
import XMonad.Hooks.UrgencyHook
import XMonad.Hooks.ManageHelpers
import XMonad.Hooks.FadeInactive
import XMonad.ManageHook
import XMonad.Util.Loggers
import XMonad.Util.Run
import XMonad.Util.EZConfig
import XMonad.Util.Font
import XMonad.Prompt
import XMonad.Prompt.Shell
import XMonad.Prompt.Man
import XMonad.Layout.WindowArranger
import XMonad.Layout.NoBorders
import XMonad.Layout.Spacing
import XMonad.Layout.Named
import XMonad.Layout.Spiral
import XMonad.Layout.Accordion
import XMonad.Layout.Mosaic
import XMonad.Layout.ToggleLayouts
import XMonad.Layout.PerWorkspace
import XMonad.Layout.Tabbed
import qualified Data.Map as M
import qualified XMonad.StackSet as W
main = do
-- spawn first dzen bar, displays default dzen stuff
statusbar <- spawnPipe (workbar)
spawn (conkybar)
spawn (scroller)
spawn (secondstatus)
spawn ("./scripts/menu.sh")
--spawn (bbar)
-- override the following xmonad settings and run. Use the specified urgency hook.
-- layoutHook = avoidStruts $ myLayout
-- layoutHook = smartBorders $ avoidStruts $ layoutHook defaultConfig
-- $ myUrgencyHook
xmonad $ withUrgencyHook NoUrgencyHook defaultConfig
{ borderWidth = 3
, layoutHook = avoidStruts $ mouseResize $ windowArrange $ myLayout
, workspaces = ["main", "web", "code", "ssh"] ++ map show [5..7] ++ ["mcabber", "irc"]
, startupHook = setWMName "LG3D"
, manageHook = manageDocks <+> myManageHook <+> manageHook defaultConfig
-- Did not fix mtpaint <+> (fmap not isDialog --> doF avoidMaster)
-- Did not fix mtpaint <+> (isDialog --> doF W.shiftMaster <+> doF W.swapDown)
, logHook = (dynamicLogWithPP $ myPPsettings statusbar) >> (fadeLogHook)
} `additionalKeysP` myKeys
-- Format: [... ("key bind", functionality) ...]
myKeys = [
-- Launch programs
("M-f", spawn "firefox")
, ("M-p", shellPrompt myXPConfig)
, ("M-m", spawn "./scripts/minecraft.sh")
, ("M-c", spawn "chromium")
, ("M-S-c", spawn "conky")
, ("M-S-i", spawn "xterm -title irssi -name irssi -e irssi")
, ("M-i", spawn "irssi")
-- Fontsize control
--, ("M-S-8", spawn "xtermcontrol --font terminus:pixelsize=18")
-- Close focused program
, ("M-S-k", kill)
-- Screenies
, ("<Print>", spawn "scrot -q 100 -e 'mv $f ~/images/screenshot'")
-- Return to tilespace
, ("M-S-t", withFocused $ windows . W.sink)
-- Lock Screen
, ("M-S-l", spawn "slock")
-- Restart xmonad
, ("M-q", spawn "killall conky; killall xargs; killall dzen2; xmonad --recompile; xmonad --restart")
-- Kill X
, ("M-S-q", spawn "killall conky; killall xargs; killall dzen2; killall xinit;")
-- Audio Control
, ("<XF86AudioLowerVolume>", spawn "amixer -q set Master 3%- unmute")
, ("<XF86AudioRaiseVolume>", spawn "amixer -q set Master 3%+ unmute")
, ("<XF86AudioMute>", spawn "amixer -q set Master toggle")
-- Workspace control
, ("M-<Left>", prevWS)
, ("M-<Right>", nextWS)
, ("M-z", toggleWS)
, ("M-S-<Left>", shiftToPrev)
, ("M-S-<Right>", shiftToNext)
, ("M-S-z", moveTo Next EmptyWS)
-- Grid Controls
, ("M-g", goToSelected defaultGSConfig)
]
-- The regular status bar
workbar = "dzen2 -fn '" ++ terminus ++ "' -bg black -fg white -ta l -w 1000 -h 24"
-- Icons, not in use
arch = "^bg()^fg(blue)^i(confs/xbm8x8/arch_10x10.xbm)"
firefox = "^bg(black)^fg(red)^p(+10)^i(confs/xbm8x8/fox.xbm) Fire ^p(+62)"
info = "^bg(black)^fg(yellow)^p(+10)^i(confs/xbm8x8/info_01.xbm) Info ^p(+62)"
power = "^bg(black)^fg(white)^p(+10)^i(confs/xbm8x8/half.xbm) Power ^p(+62)"
-- Conky stats
conkybar = "conky -c './scripts/conky_statsrc' | dzen2 -p -fn '" ++ terminus ++ "' -bg black -fg white -ta r -x 1000 -w 1880 -h 24"
-- Useless Welcome thingy
scroller = "echo \"^fg(white)Welcome to ^fg(lightblue)Skyloft^fg()\" | dzen2 -p -fn '" ++ terminus ++ "' -bg black -x 80 -y $((`xrandr --current | grep '*' | awk '{print $1}' | cut -d 'x' -f2` - 24)) -ta r -w 970 -h 24 & transset .9";
-- Bottom status stuff
secondstatus = "conky -c './scripts/conky_weather' | dzen2 -fn '" ++ terminus ++ "' -bg black -fg white -x 1050 -y $((`xrandr --current | grep '*' | awk '{print $1}' | cut -d 'x' -f2` - 24)) -ta r -w 1870 -h 24"
-- How dzen bar will appear
myPPsettings bar = defaultPP
{ ppCurrent = dzenColor "#FFFFFF" "#000000" . wrap ">" ""
, ppOutput = hPutStrLn bar
, ppVisible = dzenColor "#000000" "#FFFFFF" . wrap "^i(confs/xbm8x8/full,xbm)" ""
, ppHidden = dzenColor "#FFFFFF" "" . wrap "^i(confs/xbm8x8/full,xbm)" ""
, ppHiddenNoWindows = dzenColor "#4A4459" "" . wrap "^i(confs/xbm8x8/empty,xbm)" ""
, ppSep = " ^fg(grey60) = ^fg() "
, ppWsSep = " "
, ppUrgent = dzenColor "yellow" "black" . dzenStrip
--, ppTitle = dzenColor "#FFFFFF" "" . wrap ":: " " ::"
, ppTitle = dzenColor "#FFFFFF" ""
, ppLayout = dzenColor "#FFFFF" "" . (\mode -> case mode of
"Tiled" -> "|[]"
"Mirror Tiled" -> "[_]"
"Full" -> "[-]"
"Tab" -> "[=]"
"Spiral" -> "[@]"
"Accordion" -> "[#]"
"Mosaic" -> "[+]"
_ -> "[?]" )
}
-- Layout hook of awesome, found on xmonad wiki mostly with a few tweaks
myLayout = full ||| tiled ||| Mirror tiled ||| spiraly ||| mos
--myLayout = Full ||| mos ||| acc ||| tiled ||| tabs ||| Mirror tiled ||| spiraly
where
-- default lol
nmaster = 1
-- lol props golden bro
ratio = (2 / (1 + (toRational(sqrt(5)::Double))))
-- percent of screen to increment and shit
delta = 5/100
-- something about partitioning
tiled = named "Tiled" $ spacing 4 $ Tall nmaster delta ratio
-- the coolest one ever
spiraly = named "Spiral" $ spacing 1 $ avoidStrutsOn [U] (spiral (6/7))
-- TABS BRAH
tabs = named "Tab" $ simpleTabbed
-- Accordian BRO
acc = named "Accordion" $ Mirror Accordion
-- MOSI B
mos = named "Mosaic" $ Mosaic 3 [4,1]
-- regular old full
full = smartBorders $ Full
-- Fading bro, found online
fadeLogHook = fadeInactiveLogHook 0.9
-- layout for specified programs.
myManageHook = composeAll
[ className =? "mtpaint" --> doFloat
, isFullscreen --> (doF W.focusDown <+> doFullFloat)
, className =? "info" --> doFloat
, appName =? "irssi" --> doShift "irc"
, appName =? "mcabber" --> doShift "mcabber"
]
-- what xmonad will do when a window calls for my attention
-- myUrgencyHook = withUrgencyHook dzenUrgencyHook
-- { args = [ "-fn", "smoothansi-10"
-- , "-bg", "yellow"]
-- }
-- oh pretty terminus
terminus = "-*-terminus-*-*-*-*-16-*-*-*-*-*-iso8859-*"
-- New windows will never be put on the master window!
-- I swear this is how the param'd it, I can't rename things I dont know!!
-- It also doesn't work as intended!
avoidMaster = W.modify' $ (\c -> case c of
W.Stack t [] (r:rs) -> W.Stack t [r] rs
otherwise -> c)
-- Settings for the terminal thinng below , shows all avalible shell commands
myXPConfig = defaultXPConfig
{ position = Bottom
, promptBorderWidth = 0
--, borderColor = "grey"
, height = 24
, bgColor = "black"
, fgColor = "gray"
, fgHLight = "white"
, bgHLight = "black"
}