-
-
Save potatowire/74eb42b5913f36ca30140cece96c49a7 to your computer and use it in GitHub Desktop.
Dirty XMonad config WIP
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--------------------------------------------------------------------------- | |
-- -- | |
-- _| _| _| _| _| -- | |
-- _| _| _|_| _|_| _|_| _|_|_| _|_|_| _|_|_| -- | |
-- _| _| _| _| _| _| _| _| _| _| _| _| -- | |
-- _| _| _| _| _| _| _| _| _| _| _| _| -- | |
-- _| _| _| _| _|_| _| _| _|_|_| _|_|_| -- | |
-- -- | |
--------------------------------------------------------------------------- | |
-- Ethan Schoonover <[email protected]> @ethanschoonover -- | |
-- https://github.com/altercation -- | |
--------------------------------------------------------------------------- | |
-- current as of XMonad 0.12 | |
------------------------------------------------------------------------}}} | |
-- Modules {{{ | |
--------------------------------------------------------------------------- | |
import Control.Monad (liftM2) -- myManageHookShift | |
import Data.List | |
import qualified Data.Map as M | |
import Data.Monoid | |
import System.Exit | |
import System.IO -- for xmonbar | |
import System.Posix.Process(executeFile) | |
import XMonad | |
import qualified XMonad.StackSet as W -- myManageHookShift | |
-- to get my old keys working | |
import XMonad.Prompt | |
--import XMonad.Actions.SinkAll -- why did I have this here? x.a.withall has sinkall | |
import XMonad.Actions.WithAll | |
--import XMonad.Layout.LayoutCombinators | |
import XMonad.Actions.Commands | |
import XMonad.Actions.CopyWindow | |
import XMonad.Actions.DynamicWorkspaces | |
import XMonad.Actions.Navigation2D | |
import XMonad.Actions.WindowGo | |
import XMonad.Hooks.DynamicLog -- for xmobar | |
import XMonad.Hooks.EwmhDesktops | |
import XMonad.Hooks.FadeWindows | |
import XMonad.Hooks.UrgencyHook | |
import XMonad.Hooks.ManageDocks -- avoid xmobar | |
import XMonad.Hooks.ManageHelpers | |
import XMonad.Layout | |
import XMonad.Layout.Accordion | |
import XMonad.Layout.BinarySpacePartition | |
import XMonad.Layout.BorderResize | |
import XMonad.Layout.ComboP | |
import XMonad.Layout.Dishes | |
import XMonad.Layout.DragPane -- see only two window | |
import XMonad.Layout.Drawer -- see only two window | |
import XMonad.Layout.Gaps | |
import XMonad.Layout.Gaps | |
--import XMonad.Layout.IndependentScreens | |
import XMonad.Layout.LayoutScreens | |
import XMonad.Layout.OneBig | |
import XMonad.Layout.NoBorders | |
import XMonad.Layout.NoBorders -- In Full mode, border is no use | |
import XMonad.Layout.NoFrillsDecoration | |
import XMonad.Layout.PerWorkspace -- Configure layouts on a per-workspace | |
import XMonad.Layout.Renamed | |
import XMonad.Layout.ResizableTile -- Resizable Horizontal border | |
import XMonad.Layout.Simplest | |
import XMonad.Layout.SimplestFloat | |
import XMonad.Layout.Spacing -- this makes smart space around windows | |
import XMonad.Layout.ThreeColumns | |
import XMonad.Layout.ToggleLayouts -- Full window at any time | |
import XMonad.Layout.TwoPane | |
import XMonad.Layout.WindowNavigation | |
import XMonad.Layout.ShowWName | |
import XMonad.Layout.Master | |
import XMonad.Layout.Reflect | |
-- experimenting with tripane | |
import XMonad.Layout.Decoration | |
import XMonad.Layout.ResizableTile | |
import XMonad.Layout.Tabbed | |
import XMonad.Layout.Maximize | |
import XMonad.Layout.SimplestFloat | |
import XMonad.Layout.Fullscreen | |
import XMonad.Layout.NoBorders | |
import XMonad.Util.Cursor | |
import XMonad.Util.EZConfig -- removeKeys, additionalKeys | |
import XMonad.Util.Loggers | |
import XMonad.Util.NamedActions | |
import XMonad.Util.NamedScratchpad | |
import XMonad.Util.Run -- for spawnPipe and hPutStrLn | |
import XMonad.Util.SpawnOnce | |
-- taffybar specific | |
-- import System.Taffybar.Hooks.PagerHints (pagerHints) | |
------------------------------------------------------------------------}}} | |
-- Colors, Fonts, & Themes {{{ | |
--------------------------------------------------------------------------- | |
myFocusFollowsMouse = False | |
myClickJustFocuses = True | |
base03 = "#002b36" | |
base02 = "#073642" | |
base01 = "#586e75" | |
base00 = "#657b83" | |
base0 = "#839496" | |
base1 = "#93a1a1" | |
base2 = "#eee8d5" | |
base3 = "#fdf6e3" | |
yellow = "#b58900" | |
orange = "#cb4b16" | |
red = "#dc322f" | |
magenta = "#d33682" | |
violet = "#6c71c4" | |
blue = "#268bd2" | |
cyan = "#2aa198" | |
green = "#859900" | |
gap = 9 | |
border = 0 | |
myNormalBorderColor = base03 | |
myFocusedBorderColor = active | |
active = cyan | |
activeWarn = red | |
inactive = base02 | |
focusColor = blue | |
unfocusColor = base02 | |
myFont = "-*-terminus-medium-*-*-*-*-160-*-*-*-*-*-*" | |
myBigFont = "-*-terminus-medium-*-*-*-*-240-*-*-*-*-*-*" | |
-- this is a "fake title" used as a highlight bar in lieu of full borders | |
-- (I find this a cleaner and less visually intrusive solution) | |
--topBarTheme= defaultTheme | |
topBarTheme= def | |
{ fontName = myFont | |
, inactiveBorderColor = base03 | |
, inactiveColor = base03 | |
, inactiveTextColor = base03 | |
, activeBorderColor = active | |
, activeColor = active | |
, activeTextColor = active | |
, urgentBorderColor = red | |
, urgentTextColor = yellow | |
, decoHeight = 5 | |
} | |
--myTabTheme = defaultTheme | |
myTabTheme = def | |
{ fontName = myFont | |
, activeColor = active | |
, inactiveColor = base02 | |
, activeBorderColor = active | |
, inactiveBorderColor = base02 | |
, activeTextColor = base01 | |
, inactiveTextColor = base1 | |
} | |
--myShowWNameTheme = defaultSWNConfig | |
myShowWNameTheme = def | |
--{ swn_font = "xft:Monospace:pixelsize=120:regular:antialias=true:hinting=true" | |
{ swn_font = "xft:Roboto:pixelsize=120:regular:antialias=true:hinting=true" | |
--{ swn_font = myBigFont | |
, swn_fade = 0.25 | |
, swn_bgcolor = base03 | |
, swn_color = active | |
} | |
------------------------------------------------------------------------}}} | |
-- Applications & Utilities {{{ | |
--------------------------------------------------------------------------- | |
myTerminal = "terminator" | |
myConsole = "terminator -T console -p console" | |
myAltTerminal = "cool-retro-term" | |
myBrowser = "google-chrome-beta" | |
-- cribbed this idea from | |
-- https://github.com/openprivacy/dotfen/blob/master/home/.xmonad/xmonad.hs | |
-- for multiple screens, but there are better ways | |
--myStatusBar = "bash -c \"tee >(xmobar -x0 $HOME/.xmonad/xmobarrc) " | |
-- ++ "| xmobar -x1 $HOME/.xmonad/xmobarrc\"" | |
myStatusBar = "xmobar -x0 $HOME/.xmonad/xmobarrc" | |
--myStatusBar = "polybar primary" | |
------------------------------------------------------------------------}}} | |
-- Startup {{{ | |
--------------------------------------------------------------------------- | |
myStartupHook = do | |
setDefaultCursor xC_left_ptr | |
spawnOnce "/usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1" | |
spawnOnce "dex -a" | |
spawnOnce "dunst -config ~/.i3/dunstrc" | |
spawnOnce "unclutter -root" | |
spawnOnce "feh --bg-fill ~/tmp/lowpoly6.jpg" | |
--spawnOnce "compton -b --config ~/.i3/compton.conf" | |
spawnOnce "compton -b --config ~/.i3/compton.conf --xrender-sync-fence" -- test as per https://github.com/chjj/compton/wiki/perf-guide | |
spawnOnce "spacefm -d" | |
spawn "$HOME/bin/init-tray" | |
spawn "nvidia-settings --load-config-only" | |
--spawn "killall stalonetray && stalonetray -c $HOME/.xmonad/stalonetrayrc" | |
--spawn "$HOME/bin/init-polybars" | |
--spawn "$HOME/bin/init-taffybars" | |
quitXmonad :: X () | |
quitXmonad = io (exitWith ExitSuccess) | |
rebuildXmonad :: X () | |
rebuildXmonad = do | |
spawn "xmonad --recompile && xmonad --restart" | |
restartXmonad :: X () | |
restartXmonad = do | |
spawn "xmonad --restart" | |
unspawn :: String -> X () | |
unspawn p = spawn $ "for pid in $(pgrep " ++ p ++ "); do kill -9 $pid; done" | |
flash :: String -> X () | |
flash s = spawn $ "flash "++ s | |
notify :: String -> X () | |
notify s = spawn $ "notify "++ s | |
alert :: String -> X () | |
alert s = spawn $ "alert "++ s | |
warn :: String -> X () | |
warn s = spawn $ "warn "++ s | |
------------------------------------------------------------------------}}} | |
-- Main {{{ | |
--------------------------------------------------------------------------- | |
main = do | |
xmproc <- spawnPipe myStatusBar | |
-- for independent screens | |
-- nScreens <- countScreens | |
xmonad | |
-- for taffybar, add pagerHints | |
-- $ withNavigation2DConfig defaultNavigation2DConfig | |
$ withNavigation2DConfig myNav2DConf | |
$ withUrgencyHook NoUrgencyHook | |
$ ewmh | |
-- $ addDescrKeys ((mod4Mask, xK_9), gXmessage) myKeys | |
$ addDescrKeys ((mod4Mask, xK_F1), showKeybindings) myKeys | |
$ myConfig xmproc | |
--myConfig p = defaultConfig | |
myConfig p = def | |
{ borderWidth = border | |
, clickJustFocuses = myClickJustFocuses | |
, focusFollowsMouse = myFocusFollowsMouse | |
, focusedBorderColor = myFocusedBorderColor | |
, handleEventHook = myHandleEventHook | |
, layoutHook = myLayoutHook | |
, logHook = myLogHook p | |
, manageHook = myManageHook | |
, modMask = myModMask | |
, mouseBindings = myMouseBindings | |
, normalBorderColor = myNormalBorderColor | |
, startupHook = myStartupHook | |
, terminal = myTerminal | |
, workspaces = myWorkspaces | |
-- for independent screens | |
--, workspaces = withScreens nScreens myWorkspaces | |
} | |
-- `removeKeysP` myRemoveKeysP | |
-- `additionalKeysP` myAdditionalKeysP | |
-- | |
------------------------------------------------------------------------}}} | |
-- Key & Mouse Bindings {{{ | |
--------------------------------------------------------------------------- | |
-- zenity helper from:https://github.com/thomasf/dotfiles-thomasf-xmonad/blob/master/.xmonad/lib/XMonad/Config/A00001.hs | |
-- | Display keyboard mappings using zenity | |
showKeybindings :: [((KeyMask, KeySym), NamedAction)] -> NamedAction | |
showKeybindings x = addName "Show Keybindings" $ io $ do | |
h <- spawnPipe "zenity --text-info --font=terminus" | |
hPutStr h (unlines $ showKm x) | |
hClose h | |
return () | |
-- cf https://github.com/paul-axe/dotfiles/blob/master/.xmonad/xmonad.hs | |
-- cleverness and structure of following cribbed from | |
-- https://github.com/SimSaladin/configs/blob/master/.xmonad/xmonad.hs | |
-- wsKeys = map (\x -> "; " ++ [x]) ['a'..'z'] | |
wsKeys = map (\x -> "; " ++ [x]) ['1'..'9'] | |
myKeys conf = let | |
subKeys str ks = subtitle str : mkNamedKeymap conf ks | |
screenKeys = ["w","v","z"] | |
directionKeys = ["j","k","h","l"] | |
directions = [ D, U, L, R ] | |
--screenAction f = screenWorkspace >=> flip whenJust (windows . f) | |
zipMod nm ks as m f = zipWith (\k d -> (m ++ k, addName nm $ f d)) ks as | |
zipMod' nm ks as m f b = zipWith (\k d -> (m ++ k, addName nm $ f d b)) ks as | |
in | |
subKeys "Window Management" | |
[ ("C-S-<Backspace>" , addName "Kill" kill1) | |
, ("M-!" , addName "Focus urgent" focusUrgent) | |
, ("M-m" , addName "(Un)maximize temporarily" $ withFocused (sendMessage . maximizeRestore)) | |
] ^++^ | |
subKeys "Window Movement" ( | |
[ ("M-s M-m" , addName "Focus master" $ windows W.focusMaster) | |
, ("M-p" , addName "Focus up" $ windows W.focusUp) | |
, ("M-n" , addName "Focus down" $ windows W.focusDown) | |
, ("M-t" , addName "Focus next" $ windows W.focusDown) | |
, ("M-d" , addName "Focus prev" $ windows W.focusUp) | |
, ("M-s m" , addName "Swap master" $ windows W.swapMaster) | |
, ("M-s p" , addName "Swap next" $ windows W.swapUp) | |
, ("M-s n" , addName "Swap prev" $ windows W.swapDown) | |
, ("M4-m" , addName "Combo swap" $ sendMessage $ SwapWindow) | |
] | |
++ zipMod' "FOCUS Window" directionKeys directions "M-" windowGo True | |
++ zipMod' "SWAP Window " directionKeys directions "M-S-" windowSwap True | |
-- ++ zipMod "Focus direction" directionKeys directions "M-" (sendMessage . Go) | |
-- ++ zipMod "Swap direction" directionKeys directions "M-S-" (sendMessage . Swap) | |
) ^++^ | |
subKeys "{a,o,e,u,i,d,...} focus and move window between workspaces" | |
( zipMod "View ws" wsKeys [0..] "M-" (withNthWorkspace W.greedyView) | |
++ zipMod "Move w to ws" wsKeys [0..] "M-S-" (withNthWorkspace W.shift) | |
++ zipMod "Copy w to ws" wsKeys [0..] "M-S-C-" (withNthWorkspace copy) | |
) ^++^ | |
subKeys "BinarySpacePartition Specific" ( | |
[ ("M-C-r" , addName "Rotate" $ sendMessage Rotate) | |
, ("M-C-s" , addName "Swap" $ sendMessage XMonad.Layout.BinarySpacePartition.Swap) | |
, ("M-C-p" , addName "Focus Parent" $ sendMessage FocusParent) | |
, ("M-C-n" , addName "Select Node" $ sendMessage SelectNode) | |
, ("M-C-m" , addName "Move Node" $ sendMessage MoveNode) | |
] | |
++ zipMod "BSP Expand Towards" directionKeys directions "M-C-" (sendMessage . ExpandTowards) | |
++ zipMod "BSP Shrink From" directionKeys directions "M-S-C-" (sendMessage . ShrinkFrom) | |
) ^++^ | |
subKeys "Applications & Utilities" | |
[ ("C-<Return>" , addName "Terminal" $ spawn myTerminal) | |
, ("C-S-<Return>" , addName "Console Terminal" $ runOrCopy myConsole (title =? "console")) | |
, ("C-\\" , addName "Browser" $ spawn myBrowser) | |
] ^++^ | |
------------------------------------------------------------------------ | |
subKeys "System Commands" | |
[("<XF86Sleep>", addName "System sleep" $ spawn "notify-send system sleep") | |
,("<XF86PowerOff>", addName "System power off" $ spawn "notify-send system off") | |
,("S-<XF86PowerOff>", addName "System reboot" $ spawn "notify-send system reboot") | |
,("<XF86ScreenSaver>", addName "Lock screen" $ spawn "notify-send displays lock") | |
,("<XF86Display>", addName "Cycle display mode" $ spawn "notify-send displays toggle") | |
,("S-<XF86Display>", addName "Mirror display mode" $ spawn "notify-send displays mirror") | |
,("M-<XF86Display>", addName "Span display mode" $ spawn "notify-send displays span") | |
,("<XF86Launch1>", addName "Bluetooth toggle" $ spawn "notify-send wireless bluetooth toggle") | |
,("<XF86TouchpadOn>", addName "Trackpad toggle" $ spawn "notify-send trackpad toggle") | |
,("<Print>", addName "Screendraw start/stop" $ spawn "notify-send screendraw") | |
,("S-<Print>", addName "Screendraw force stop" $ spawn "notify-send screendraw finish") | |
,("M-<Print>", addName "Screendraw cancel" $ spawn "notify-send screendraw cancel") | |
,("<XF86RotateWindows>", addName "Screendraw clear" $ spawn "notify-send screendraw clear") | |
] ^++^ | |
subKeys "Media Controls" | |
[("<XF86AudioRaiseVolume>", addName "Volume Up" $ spawn "notify-send volume up") | |
,("<XF86AudioLowerVolume>", addName "Volume Down" $ spawn "notify-send volume down") | |
,("<XF86AudioMute>", addName "Volume Mute" $ spawn "notify-send volume mute") | |
,("<XF86AudioMicMute>", addName "Mic Mute" $ spawn "notify-send mic mute") | |
] | |
myModMask = mod1Mask -- alt key | |
-- Mouse bindings: default actions bound to mouse events | |
-- mod-button1, Set the window to floating mode and move by dragging | |
-- mod-button2, Raise the window to the top of the stack | |
-- mod-button3, Set the window to floating mode and resize by dragging | |
-- you may also bind events to the mouse scroll wheel (button4 and button5) | |
myMouseBindings (XConfig {XMonad.modMask = modm}) = M.fromList $ | |
[ ((myModMask, button1), (\w -> focus w >> mouseMoveWindow w >> windows W.shiftMaster)) | |
, ((myModMask, button2), (\w -> focus w >> windows W.shiftMaster)) | |
, ((myModMask, button3), (\w -> focus w >> mouseResizeWindow w >> windows W.shiftMaster)) | |
] | |
------------------------------------------------------------------------}}} | |
-- Logging {{{ | |
--------------------------------------------------------------------------- | |
myLogHook h = do | |
-- following block for copy windows marking | |
copies <- wsContainingCopies | |
let check ws | ws `elem` copies = | |
pad . xmobarColor yellow red . wrap "*" " " $ ws | |
| otherwise = pad ws | |
fadeWindowsLogHook myFadeHook | |
ewmhDesktopsLogHook | |
--dynamicLogWithPP $ defaultPP | |
dynamicLogWithPP $ def | |
{ ppCurrent = xmobarColor active "" . wrap "[" "]" | |
, ppTitle = xmobarColor active "" . shorten 100 | |
, ppVisible = wrap "(" ")" | |
, ppUrgent = xmobarColor red "" . wrap " " " " | |
, ppHidden = check | |
, ppHiddenNoWindows = const "" | |
, ppSep = xmobarColor red blue " : " | |
, ppWsSep = " " | |
, ppLayout = xmobarColor yellow "" | |
, ppOrder = id | |
, ppOutput = hPutStrLn h | |
, ppSort = fmap | |
(namedScratchpadFilterOutWorkspace.) | |
(ppSort def) | |
--(ppSort defaultPP) | |
, ppExtras = [] } | |
------------------------------------------------------------------------}}} | |
-- Workspaces, Layouts, Navigation {{{ | |
--------------------------------------------------------------------------- | |
-- myWorkspaces = map show [1..9] | |
myWorkspaces = ["www:1", "wrk:2", "dev:3", "sys:4", "com:5", ":6", ":7", ":8", ":9"] | |
-- default of lineNavigation gets stuck on gaps sometimes | |
--myNav2DConf = defaultNavigation2DConfig | |
myNav2DConf = def | |
{ defaultTiledNavigation = centerNavigation | |
, floatNavigation = centerNavigation | |
, screenNavigation = lineNavigation | |
, layoutNavigation = [("Full", centerNavigation) | |
,("TABBED", lineNavigation) | |
,("MULTIPASS", lineNavigation)] | |
, unmappedWindowRect = [("Full", singleWindowRect) | |
,("TABBED", singleWindowRect) | |
,("MULTIPASS", singleWindowRect)] | |
} | |
myLayoutHook = showWS | |
( tiledP | |
||| bordercrossing | |
||| masterTabbedP | |
||| tabbedP | |
||| bsp | |
||| multipassA | |
||| OneBig (3/4) (3/4) | |
||| oneBig | |
||| threeColP | |
||| mirrorP | |
-- ||| tabbedP | |
||| simplestFloat | |
||| fullscreenFull Full | |
) | |
-- ||| (myBigGaps myTabbed) | |
-- ||| (fullscreenFull Full) | |
-- ||| (maximize $ TriPaneTall 1 (1/3) 1 (1/2)) | |
where | |
showWS = showWName' myShowWNameTheme | |
consoleOn i = simpleDrawer 0 0.5 (Title "console") `onBottom` i | |
testLayout = consoleOn (Tall 1 0.03 0.5) | |
nmaster = 1 | |
delta = 1/300 | |
ratio = 1/2 | |
tiled' = maximize $ ResizableTall nmaster delta ratio [] | |
masterTabbedP = named "MASTER TABBED" | |
$ avoidStruts | |
$ addTopBar | |
$ mySpacing | |
$ myGaps | |
$ mastered (1/100) (1/2) $ tabbed shrinkText myTabTheme | |
bsp = named "BSP" | |
$ borderResize (avoidStruts | |
$ addTopBar | |
$ mySpacing | |
$ myGaps | |
$ emptyBSP ) | |
-- $ borderResize (emptyBSP) | |
oneBig = named "1BG" | |
$ avoidStruts | |
$ addTopBar | |
$ mySpacing | |
$ myGaps | |
$ OneBig (3/4) (3/4) | |
tiledP = named "TILED" | |
$ avoidStruts | |
$ addTopBar | |
$ mySpacing | |
$ myGaps | |
$ consoleOn | |
$ tiled' | |
oneUp = named "1UP" | |
$ avoidStruts | |
$ myGaps | |
$ combineTwoP (ThreeCol 1 (3/100) (1/2)) | |
(Simplest) | |
(Tall 1 0.03 0.5) | |
(ClassName "Google-chrome-beta") | |
bordercrossing = named "Border Crossing" | |
$ avoidStruts | |
$ combineTwoP (TwoPane 0.03 (3/4)) | |
(refTall) | |
(tabbedR) | |
(ClassName "Google-chrome-beta") | |
tabbedR = named "TABBEDR" | |
$ avoidStruts | |
$ addTopBar | |
$ myCustomGaps | |
$ tabbed shrinkText myTabTheme | |
refTall = named "refTall" | |
$ avoidStruts | |
$ addTopBar | |
$ mySpacing | |
$ myGaps | |
$ reflectHoriz | |
$ Tall 1 0.03 (2/3) | |
-- bordercrossing = named "Border Crossing" | |
-- $ avoidStruts | |
-- $ mySpacing | |
-- $ myGaps | |
-- $ combineTwoP (TwoPane 0.03 (3/4)) | |
-- (reflectHoriz $ Tall 1 0.03 (2/3)) | |
-- (tabbed shrinkText myTabTheme) | |
-- (ClassName "Google-chrome-beta") | |
multipass = named "MULTIPASS" | |
$ avoidStruts | |
$ myGaps | |
$ combineTwoP (TwoPane 0.03 0.5) | |
(Dishes 2 (1/6)) | |
(Dishes 2 (1/6)) | |
(ClassName "Google-chrome-beta") | |
multipassA = named "MULTIPASSA" | |
$ avoidStruts | |
$ myGaps | |
$ combineTwoP (TwoPane 0.03 0.5) | |
(Simplest) | |
(Accordion) | |
(ClassName "Google-chrome-beta") | |
--threeColP = renamed [Replace "THREECOL" ] $ avoidStruts $ addTopBar $ mySpacing $ myGaps $ ThreeCol 1 (3/100) (1/2) | |
threeColP = named "THREECOL" | |
$ avoidStruts | |
$ addTopBar | |
$ mySpacing | |
$ myGaps | |
$ ThreeColMid 1 (3/100) (1/2) | |
mirrorP = named "MIRROR" | |
$ avoidStruts | |
$ addTopBar | |
$ mySpacing | |
$ myGaps | |
$ Mirror tiled' | |
-- X.A.Navigation2D doesn't work well with tabs. I was able to get to function | |
-- but it tore up the tab decorations | |
tabbedP = named "TABBED" | |
$ avoidStruts | |
$ addTopBar | |
$ myBigGaps | |
$ tabbed shrinkText myTabTheme | |
-- variation on tabs to be used inside multipass | |
-- tabbedQ = named "TABBED" | |
-- $ addTopBar | |
-- $ myGaps | |
-- $ tabbed shrinkText myTabTheme | |
--multipassP = combineTwoP (TwoPane 0.03 0.5) (tabbed shrinkText myTabTheme) (tabbed shrinkText myTabTheme) (ClassName "Terminator") | |
--(Title "mutt" `Or` Title "newsbeuter") | |
-- $ avoidStruts $ addTopBar $ mySpacing $ myGaps $ | |
named n = renamed [Replace n ] | |
addTopBar = noFrillsDeco shrinkText topBarTheme | |
mySpacing = spacing gap | |
sGap = quot gap 2 | |
myGaps = gaps [(U, gap),(D, gap),(L, gap),(R, gap)] | |
mySmallGaps = gaps [(U, sGap),(D, sGap),(L, sGap),(R, sGap)] | |
myBigGaps = gaps [(U, gap*2),(D, gap*2),(L, gap*2),(R, gap*2)] | |
myCustomGaps = gaps [(U, gap*2),(D, gap*2),(L, 0),(R, gap*2)] | |
------------------------------------------------------------------------}}} | |
-- General Hooks (event, fade, window management) {{{ | |
--------------------------------------------------------------------------- | |
myHandleEventHook = | |
docksEventHook | |
<+> fadeWindowsEventHook | |
<+> handleEventHook def --aultConfig | |
-- <+> handleEventHook defaultConfig | |
<+> XMonad.Hooks.EwmhDesktops.fullscreenEventHook | |
<+> ewmhDesktopsEventHook | |
myFadeHook = composeAll | |
[ opaque -- default to opaque | |
, isUnfocused --> opacity 0.85 | |
, isFloating --> opacity 0.75 | |
, (className =? "Terminator") <&&> (isUnfocused) --> opacity 0.9 | |
, fmap ("Google" `isPrefixOf`) className --> opaque | |
, isDialog --> opaque | |
] | |
--isTermScratchPad = (className =? "Gnome-terminal") <&&> (stringProperty "WM_WINDOW_ROLE" =? "Scratchpad") | |
myManageHook = composeAll | |
[ className =? "MPlayer" --> doFloat | |
, className =? "Gimp" --> doFloat | |
, resource =? "desktop_window" --> doIgnore | |
, resource =? "kdesktop" --> doIgnore | |
, resource =? "stalonetray" --> doIgnore | |
] <+> manageDocks | |
-- myManageHookShift = composeAll | |
-- myManageHookFloat = composeAll | |
-- --------------------------------------------------------------------------- }}} | |
-- -- myManageHookFloat: new window will created in Float mode {{{ | |
-- ------------------------------------------------------------------------------- | |
-- | |
-- myManageHookFloat = composeAll | |
-- [ className =? "Gimp" --> doFloat | |
-- , className =? "Tk" --> doFloat | |
-- , className =? "mplayer2" --> doCenterFloat | |
-- , className =? "mpv" --> doCenterFloat | |
-- , className =? "feh" --> doCenterFloat | |
-- , className =? "Display.im6" --> doCenterFloat | |
-- , className =? "Shutter" --> doCenterFloat | |
-- , className =? "Thunar" --> doCenterFloat | |
-- , className =? "Nautilus" --> doCenterFloat | |
-- , className =? "Plugin-container" --> doCenterFloat | |
-- , className =? "Screenkey" --> (doRectFloat $ W.RationalRect 0.7 0.9 0.3 0.1) | |
-- , className =? "Websearch" --> doCenterFloat | |
-- , className =? "XClock" --> doSideFloat NE | |
-- , title =? "Speedbar" --> doCenterFloat | |
-- , title =? "urxvt_float" --> doSideFloat SC | |
-- , isFullscreen --> doFullFloat | |
-- , isDialog --> doCenterFloat | |
-- , stringProperty "WM_NAME" =? "LINE" --> (doRectFloat $ W.RationalRect 0.60 0.1 0.39 0.82) | |
-- , stringProperty "WM_NAME" =? "Google Keep" --> (doRectFloat $ W.RationalRect 0.3 0.1 0.4 0.82) | |
-- , stringProperty "WM_NAME" =? "tmptex.pdf - 1/1 (96 dpi)" --> (doRectFloat $ W.RationalRect 0.29 0.25 0.42 0.5) | |
-- , stringProperty "WM_NAME" =? "Figure 1" --> doCenterFloat | |
-- ] | |
-- | |
-- --------------------------------------------------------------------------- }}} | |
-- -- newMouse: Right click is used for resizing window {{{ | |
-- ------------------------------------------------------------------------------- | |
-- | |
-- myMouse x = [ ((modm, button3), (\w -> focus w >> Flex.mouseResizeWindow w)) ] | |
-- newMouse x = M.union (mouseBindings defaultConfig x) (M.fromList (myMouse x)) | |
-- | |
-- --------------------------------------------------------------------------- }}} | |
-- vim: ft=haskell:foldmethod=marker |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment