xmonad.hs-tabularboonad 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178
  1. -- Welcome to Digit's Nice Minimal Tabular Boonad
  2. -- takes some cues from clfswm and i3
  3. -- Digit can usually be found in #witchlinux on irc.libera.chat
  4. -- GNU GPL, yo!
  5. -- comments should help keep things clear. for example, "-- artistgamer" refers to the keybind layout suited to one hand on the mouse, using wsad instead of hjkl. other comments are mostly self explanitory, or explained elsewhere. some will point you to xmonad.org for more information.
  6. -- this is still in development, but the general jist is in place. there are still MANY features intended to be added at this stage. - 2013-03-25
  7. {-# LANGUAGE NoMonomorphismRestriction #-} -- for gridselect customisation
  8. import XMonad hiding ( (|||) )
  9. --import XMonad.Core -- as XMonad hiding ( (|||) )
  10. -- (workspaces,manageHook,keys,logHook,startupHook,borderWidth,mouseBindings
  11. -- ,layoutHook,modMask,terminal,normalBorderColor,focusedBorderColor,focusFollowsMouse
  12. -- ,handleEventHook,clickJustFocuses)
  13. import XMonad.Layout.LayoutCombinators -- hiding ( (|||) )
  14. import XMonad.Util.EZConfig -- allows all kinds, like automated emacs submaps
  15. import XMonad.Actions.Submap -- allows emacs-like keys
  16. import XMonad.Layout.Tabbed -- obvious integral for the TabularBoonad
  17. --import XMonad.Layout.Grid -- yus
  18. --import XMonad.Layout.HintedGrid --trying to get a better alt grid for more 4:3 ratio
  19. import XMonad.Layout.GridVariants --2nd attempt at better grid layout. fingers crossed no more vert-letter-boxes.
  20. import XMonad.Layout.OneBig -- yus
  21. import qualified XMonad.StackSet as W -- does something important i'm sure.
  22. import XMonad.Actions.CycleWS -- gets around
  23. import XMonad.Layout.NoBorders -- prettier when fullscreen
  24. import XMonad.Layout.MultiToggle -- allows fullscreen toggle, without Full layout
  25. import XMonad.Layout.MultiToggle.Instances --
  26. import XMonad.Actions.DynamicWorkspaces -- hrmm, is this where withNthWorkspace came from... curious.
  27. import XMonad.Actions.CopyWindow(copy) --this too?
  28. --sublayoutstuff http://xmonad.org/xmonad-docs/xmonad-contrib/XMonad-Layout-SubLayouts.html
  29. import XMonad.Layout.SubLayouts -- oh this makes it oh so sexy.
  30. import qualified XMonad.Layout.WindowNavigation as WN -- hrmm kinda essential, it seems.
  31. import XMonad.Layout.BoringWindows -- not so boring, proves handy. make it so.
  32. -- http://xmonad.org/xmonad-docs/xmonad-contrib/XMonad-Actions-GridSelect.html
  33. import XMonad.Actions.GridSelect -- adds that gui selection menu 2d map thingy
  34. --import XMonad.StackSet as W -- scratchpad (already got, above)
  35. import XMonad.ManageHook -- scratchpad
  36. import XMonad.Util.NamedScratchpad -- scratchpad
  37. main = xmonad $ defaultConfig
  38. { modMask = mod4Mask -- use tux instead of alt, which is M1(/mod1)
  39. , terminal = "rxvt-unicode" -- was "xterm"
  40. , normalBorderColor = "#487855" --487855 mk1 of "inteligent green"
  41. , focusedBorderColor = "#ff6900"
  42. , keys = djtemacsKeys
  43. , layoutHook = djtslayoutHook
  44. , workspaces = djtWorktops
  45. , manageHook = namedScratchpadManageHook scratchpads
  46. -- , XMonad.clickJustFocuses = djtsclickJustFocuses
  47. } -- `additionalKeysP` djtemacsKeys
  48. --djtsclickJustFocuses :: Bool
  49. --djtsclickJustFocuses = False
  50. djtsTabConfig = defaultTheme { inactiveBorderColor = "#FF0000"
  51. , activeTextColor = "#00FF00"}
  52. djtslayoutHook = smartBorders
  53. $ WN.windowNavigation
  54. $ subTabbed
  55. $ boringWindows
  56. $
  57. mkToggle (MIRROR ?? NOBORDERS ?? FULL ?? EOT) (Grid (55/34) ||| OneBig (5/8) (3/5) ||| OneBig (3/4) (3/4))
  58. djtWorktops = ["1","2","3","4","5","6","7","8","9"]
  59. -- http://xmonad.org/xmonad-docs/xmonad-contrib/XMonad-Actions-GridSelect.html
  60. --gsconfig1 = defaultGSConfig { gs_cellheight = 19, gs_cellwidth = 144 }
  61. gsconfig2 colorizer = (buildDefaultGSConfig colorizer) { gs_cellheight = 42, gs_cellwidth = 180 }
  62. {-gsconfig3 = defaultGSConfig
  63. { gs_cellheight = 30
  64. , gs_cellwidth = 100
  65. , gs_navigate = myNavigation
  66. }
  67. -}
  68. -- http://xmonad.org/xmonad-docs/xmonad-contrib/XMonad-Util-NamedScratchpad.html
  69. scratchpads = [
  70. -- run htop in term, top half, perfect fit.
  71. NS "ttyload" "xterm -e ttyload" (title =? "ttyload")
  72. (customFloating $ W.RationalRect (0/1) (0/1) (1/1) (1/2)) ,
  73. -- run htop in term, top half, perfect fit.
  74. NS "htop" "xterm -e htop" (title =? "htop")
  75. (customFloating $ W.RationalRect (0/1) (0/1) (1/1) (1/2)) ,
  76. -- run alsamixer in term, bottom half of screen space around edge.
  77. NS "alsamixer" "xterm -e alsamixer" (title =? "alsamixer")
  78. (customFloating $ W.RationalRect (1/100) (49/100) (98/100) (1/2)) ,
  79. -- run emacs bottom half of screen space around edge.
  80. NS "emacs" "emacs" (className =? "Emacs")
  81. (customFloating $ W.RationalRect (1/100) (49/100) (98/100) (1/2)) ,
  82. -- drop-down terminal like yeahconsole/tilda/guake/yakuake
  83. NS "xterm" "xterm -e tmux" (title =? "tmux")
  84. (customFloating $ W.RationalRect (0/1) (0/1) (1/1) (1/2)) ,
  85. -- drop-down terminalMK2
  86. -- NS "tmux" "terminology -e tmux" (className =? "terminology")
  87. -- (customFloating $ W.RationalRect (0/1) (0/1) (1/1) (1/2)) ,
  88. -- pop bigbrowser
  89. -- NS "firefox" "firefox" (className =? "Firefox")
  90. NS "icecat" "icecat" (className =? "IceCat")
  91. (customFloating $ W.RationalRect (0/1) (0/1) (1/1) (1/2)) ,
  92. -- pop-in terminal chat like above, but one for chat.
  93. NS "chat" "iirc" (title =? "chat")
  94. (customFloating $ W.RationalRect (0/1) (0/1) (1/2) (1/2))
  95. ] where role = stringProperty "WM_WINDOW_ROLE"
  96. djtemacsKeys = \c -> mkKeymap c $
  97. [ ("M-S-<Return>", spawn $ terminal c) --but why bother with yeahconsole or scratchpads ;)
  98. --some conventional focus changing keybinds are still here, but de-emphasised, as focus would nominally be changed with mouse using this setup
  99. -- , ("M-S-<Space>", setLayout djtslayoutHook) -- %! Reset the layouts on the current workspace to default
  100. , ("M-S-<Space>", refresh) -- incase stuff gets messy. ^and cos i cant get reset to work. tried ways.
  101. -- , ("M-x o", spawn "xteddy") -- type mod+x then o. y it no work?
  102. , ("M-<F11>", sendMessage $ Toggle FULL) --fullscreen toggle. yus.
  103. , ("M-S-<F11>", sendMessage $ Toggle MIRROR) --mirror toggle. yus yus.
  104. , ("M-g", sendMessage $ Toggle FULL) --artistgamer --fullscreen toggle. yus.
  105. , ("M-S-g", sendMessage $ Toggle MIRROR) --artistgamer --mirror toggle. yus yus.
  106. , ("M-<F4>", kill) --close a window
  107. , ("M-<F6>", spawn "xkill") -- no, srsly, close it! (click window to kill)
  108. , ("M-q", spawn "xmonad --recompile && xmonad --restart") --try config changes
  109. -- , ("M-S-q", io (exitWith ExitSuccess)) --meh, dont need, myt slip n press.
  110. , ("M-C-<Tab>", goToSelected defaultGSConfig) --artistgamer gridselect open windows
  111. -- , ("M-r", spawn "dmenu_run")
  112. , ("M-r", spawn "dmenu-bind.sh")
  113. -- , ("M-r", spawn "~/.config/dmenu/dmenu-bind.sh") --artistgamer
  114. , ("M-C-r", spawnSelected defaultGSConfig ["gimp","mypaint","inkscape","blender","freecad","iceape","lmms","hydrogen","audacity","pitivi","synfigstudio","minitube","clementine","transmission-gtk","gcolor2","fontforge","openshot","pitivi","avidemux","aemenu", "smplayer2", "vlc"]) --artistgamer gridselect launcher
  115. -- , ("M-<F2>", spawn "~/.config/dmenu/dmenu-bind.sh") --oldskool
  116. -- , ("M-A-r", spawn "gmrun") --artistgamer
  117. -- , ("M-<F3>", spawn "gmrun") --oldskool
  118. -- , ("<Menu>", spawn "8menu")
  119. -- , ("M-<Menu>", spawn "dmenu-bind.sh")
  120. -- , ("M-x", spawn "aemenu") --artistgamer
  121. -- , ("M-x", spawn "qmenu") --artistgamer -- points to script starting a menu
  122. , ("M-<Space>", sendMessage NextLayout) --cycle between layouts
  123. , ("M-e", windows W.focusUp) --artistgamer
  124. , ("M-d", windows W.focusDown) --artistgamer
  125. , ("M-C-s", sendMessage $ pullGroup WN.L) --sublayout --artistgamer --merge left to tab stack
  126. , ("M-C-f", sendMessage $ pullGroup WN.R) --sublayout --artistgamer --merge right to tab stack
  127. , ("M-C-e", sendMessage $ pullGroup WN.U) --sublayout --artistgamer --merge up to tab stack
  128. , ("M-C-d", sendMessage $ pullGroup WN.D) --sublayout --artistgamer --merge down to tab stack
  129. , ("S-M-e", windows W.swapUp) --artstgamer
  130. , ("S-M-d", windows W.swapDown) --artstgamer
  131. , ("M-w", windows W.swapMaster) -- move focused window to master pane --exhibit/enter
  132. , ("M-C-w", withFocused (sendMessage . UnMerge)) --sublayout --artistgamer --exit/escape
  133. , ("M-C-S-w", withFocused (sendMessage . MergeAll)) --sublayout --artstgamer --entanglement
  134. , ("M-c", prevWS) --artstgamer previous workspace
  135. , ("M-v", nextWS) --artstgamer next workspace
  136. , ("S-M-c", shiftToPrev) --artstgamer move focussed window to previous workspace
  137. , ("S-M-v", shiftToNext) --artstgamer move focussed window to next workspace
  138. , ("M-<Tab>", windows W.focusDown) -- focus next window --or use mouse
  139. , ("M-S-<Tab>", windows W.focusUp ) -- focus previous window --or use mouse
  140. , ("M-t", withFocused $ windows . W.sink) -- re-tile floated window
  141. -- , ("M-C-<Period>", onGroup W.focusUp') --sublayout --not sure wtf anymore
  142. -- , ("M-C-<Comma>", onGroup W.focusDown') --sublayout --not sure wtf anymore
  143. -- and the boring windows:, ((modm, xK_j), focusDown) -- wtf to implement?
  144. -- and the boring windows:, ((modm, xK_k), focusUp) -- wtf to implement?
  145. -- , ("M-S-<space>", setLayout $ XMonad.layoutHook conf) --rly need dat?
  146. -- namedscratchpad keybinds
  147. , ("<F12>", namedScratchpadAction scratchpads "xterm") -- xmoake scratchpad
  148. -- , ("M-<F12>", namedScratchpadAction scratchpads "") --mk2
  149. , ("M-<F1>", namedScratchpadAction scratchpads "emacs") --emacs
  150. , ("M-<F2>", namedScratchpadAction scratchpads "icecat") --firefox
  151. -- , ("M-<F2>", namedScratchpadAction scratchpads "firefox") --firefox
  152. , ("M-<F7>", namedScratchpadAction scratchpads "ttyload") -- scratchpad
  153. , ("M-<F8>", namedScratchpadAction scratchpads "htop") -- scratchpad
  154. , ("M-<F9>", namedScratchpadAction scratchpads "alsamixer") -- scratchpad
  155. , ("M-<F11>", namedScratchpadAction scratchpads "iirc") --scratchpad
  156. ]
  157. ++
  158. -- (2012-09-29 15:14:37) dr_bs:
  159. zip (map (\x -> fst x++[snd x]) ((zip (repeat "M-") (['1'..'9'])))) (map (withNthWorkspace W.greedyView) [0..])
  160. ++
  161. -- so i extrapolate from dr_bs's above, and from
  162. -- http://xmonad.org/xmonad-docs/xmonad-contrib/XMonad-Actions-DynamicWorkspaces.html
  163. zip (map (\x -> fst x++[snd x]) ((zip (repeat "M-S-") (['1'..'9'])))) (map (withNthWorkspace W.shift) [0..])