xmonad-config/xmonad.hs

69 lines
2.5 KiB
Haskell
Raw Normal View History

2017-12-10 01:14:39 +01:00
-- My xmonad configuration, based on the example.hs of the xmonad project
-- including best practises.
-- https://github.com/xmonad/xmonad-contrib/blob/master/XMonad/Config/Example.hs
module Main (main) where
2017-12-08 19:32:06 +01:00
import XMonad
import XMonad.Actions.DynamicProjects
2017-12-08 19:32:06 +01:00
import XMonad.Config.Desktop
import XMonad.Hooks.DynamicLog
import XMonad.Hooks.ManageHelpers
2017-12-10 01:14:39 +01:00
import XMonad.Layout.NoBorders (noBorders, smartBorders)
import XMonad.Layout.ResizableTile (ResizableTall(..))
import XMonad.Layout.Spacing
2017-12-12 20:55:08 +01:00
import XMonad.Layout.ToggleLayouts (toggleLayouts)
2017-12-10 01:14:39 +01:00
import XMonad.Util.EZConfig
import qualified Solarized as S
2017-12-08 19:32:06 +01:00
-- Tidy modules
import KeyBindings as Keys (modify)
2017-12-12 20:55:08 +01:00
import MouseBindings as Mouse (modify)
2018-05-27 15:39:24 +02:00
import Projects (modify)
import Scratchpad (modify)
2017-12-10 01:14:39 +01:00
2017-12-12 20:55:08 +01:00
--------- toggle btw vvvvvvvvvv or vvvvv
layouts = toggleLayouts fullscreen tiled
2017-12-08 19:32:06 +01:00
where
2017-12-11 12:30:50 +01:00
fullscreen = (noBorders Full)
tiled = smarts $ resizableTall ||| (Mirror resizableTall)
smarts = (smartSpacingWithEdge 5) . smartBorders
resizableTall = ResizableTall 1 (5/100) (1/2) []
2017-12-10 01:14:39 +01:00
-- Use the `xprop' tool to get the info you need for these matches.
-- For className, use the second value that xprop gives you.
2017-12-12 20:55:08 +01:00
-------------- Here be the law of windows
2017-12-10 01:14:39 +01:00
myManageHook = composeOne
2018-05-29 08:20:58 +02:00
[ className =? "Pavucontrol" -?> doShift "music"
, className =? "Pinentry" -?> doFloat
, className =? "Steam" -?> doShift "steam"
, className =? "VirtualBox" -?> doFloat
, className =? "csgo_linux64" -?> doShift "csgo"
, className =? "mpv" -?> doFullFloat <+> (doShift "flims")
, className =? "qemu-system-x86_64" -?> doFloat
, className =? "qutebrowser" -?> doShift "web"
, isDialog -?> doCenterFloat
, isDialog -?> doCenterFloat
2017-12-10 01:14:39 +01:00
-- Move transient windows to their parent:
, transience
]
2017-12-12 20:55:08 +01:00
------------ build the full config
withConfig =
2018-05-27 15:39:24 +02:00
Projects.modify -- Apply projects config
$ Keys.modify -- Apply keybindings config
$ Mouse.modify -- Apply mouse bindings config
$ Scratchpad.modify -- Apply scratchpad managehook config
$ desktopConfig -- on a default desktop config
2017-12-12 20:55:08 +01:00
{ manageHook = myManageHook <+> manageHook desktopConfig
, layoutHook = desktopLayoutModifiers layouts
2018-04-02 19:39:04 +02:00
, terminal = "/run/current-system/sw/bin/alacritty"
2017-12-12 20:55:08 +01:00
, normalBorderColor = S.base03
, focusedBorderColor = S.violet
, borderWidth = 5
}
2017-12-10 01:14:39 +01:00
2017-12-12 20:55:08 +01:00
------ and pass it to xmonad:
main = xmonad withConfig