xmonad.hs-2018layoutexperiment2-001-borkydev 13 KB

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