dotfiles/xmonad/xmonad.hs

104 lines
3.5 KiB
Haskell
Raw Normal View History

2017-05-15 20:47:47 -04:00
-- Old Imports saved so I don't loose them
-- import qualified XMonad.StackSet as W
-- Also random comments for future reference:
-- https://gist.github.com/BinRoot/8154650
2017-05-16 21:53:37 -04:00
-- Fullscreen video hax Imports
-- https://www.reddit.com/r/xmonad/comments/4cnjhi/fullscreen_video_in_firefox/d1juwkl/
2017-05-15 20:47:47 -04:00
2017-05-16 21:53:37 -04:00
-- imports {{{
2017-05-15 20:47:47 -04:00
import XMonad
import XMonad.Wallpaper
import XMonad.Config.Desktop
2017-05-16 21:53:37 -04:00
import XMonad.Hooks.DynamicLog
import XMonad.Hooks.FadeInactive
import XMonad.Hooks.ManageDocks
2017-05-15 20:47:47 -04:00
import XMonad.Hooks.ManageHelpers
2017-05-16 21:53:37 -04:00
import XMonad.Layout.Fullscreen
import XMonad.Layout.NoBorders ( smartBorders )
2017-05-15 20:47:47 -04:00
import XMonad.Layout.Spacing (smartSpacing)
import XMonad.Util.EZConfig ( additionalKeys )
2017-05-16 21:53:37 -04:00
import XMonad.Util.Run
2017-05-15 20:47:47 -04:00
2017-05-16 21:53:37 -04:00
import System.IO
2017-05-15 20:47:47 -04:00
import System.Exit
2017-05-16 21:53:37 -04:00
--}}}
2017-05-15 20:47:47 -04:00
2017-05-16 21:53:37 -04:00
-- fields {{{
2017-05-15 20:47:47 -04:00
-- set mod key (alt)
myModMask = mod1Mask
-- set terminal
myTerminal = "urxvt"
-- border spacing
myLayoutHook = smartSpacing 4 $ smartBorders ( avoidStruts $ layoutHook defaultConfig )
-- border sie
myBorderWidth = 0
2017-05-16 21:53:37 -04:00
-- status bar
myXmonadBar = "dzen2 -x '0' -y '0' -h '24' -w '1690' -ta 'l' -fg '#FFFFFF' -bg '#1B1D1E'"
myStatusBar = "conky -c $HOME/.xmonad/.conky_dzen | dzen2 -x '1690' -w '2560' -h '24' -ta 'r' -bg '#1B1D1E' -fg '#FFFFFF' -y '0'"
myBitmapsDir = "$HOME/.xmonad/dzen2"
--}}}
-- main-config {{{
2017-05-15 20:47:47 -04:00
main = do
2017-05-16 21:53:37 -04:00
dzenLeftBar <- spawnPipe myXmonadBar
dzenRightBar <- spawnPipe myStatusBar
2017-05-15 20:47:47 -04:00
setRandomWallpaper ["$HOME/images/wallpaper"]
xmonad $ fullscreenSupport defaultConfig
2017-05-15 20:47:47 -04:00
{ terminal = myTerminal
, layoutHook = myLayoutHook
, borderWidth = myBorderWidth
, logHook = myLogHook dzenLeftBar >> fadeInactiveLogHook 0xdddddddd
2017-05-16 21:53:37 -04:00
, handleEventHook = mconcat
[ docksEventHook
, handleEventHook defaultConfig]
2017-05-15 20:47:47 -04:00
} `additionalKeys` myAdditionalKeys
2017-05-16 21:53:37 -04:00
--}}}
2017-05-15 20:47:47 -04:00
2017-05-16 21:53:37 -04:00
-- key-bindings {{{
2017-05-15 20:47:47 -04:00
myAdditionalKeys =
[ ((myModMask, xK_q), spawn "i3lock -i $HOME/images/lock.png")
] ++
[ ((myModMask .|. shiftMask, xK_q), kill)
] ++
[ ((myModMask, xK_c), spawn "xmonad --recompile; xmonad --restart")
] ++
[ ((myModMask .|. shiftMask, xK_c), io (exitWith ExitSuccess))
]
2017-05-16 21:53:37 -04:00
--}}}
2017-05-15 20:47:47 -04:00
2017-05-16 21:53:37 -04:00
-- video-hax {{{
2017-05-15 20:47:47 -04:00
myManageHooks = composeAll
[ isFullscreen --> doFullFloat
]
2017-05-16 21:53:37 -04:00
--}}}
-- Hooks {{{
--Bar
myLogHook :: Handle -> X ()
myLogHook h = dynamicLogWithPP $ defaultPP
{
ppCurrent = dzenColor "#ebac54" "#1B1D1E" . pad
, ppVisible = dzenColor "white" "#1B1D1E" . pad
, ppHidden = dzenColor "white" "#1B1D1E" . pad
, ppHiddenNoWindows = dzenColor "#7b7b7b" "#1B1D1E" . pad
, ppUrgent = dzenColor "#ff0000" "#1B1D1E" . pad
, ppWsSep = " "
, ppSep = " | "
, ppLayout = dzenColor "#ebac54" "#1B1D1E" .
(\x -> case x of
"ResizableTall" -> "^i(" ++ myBitmapsDir ++ "/tall.xbm)"
"Mirror ResizableTall" -> "^i(" ++ myBitmapsDir ++ "/mtall.xbm)"
"Full" -> "^i(" ++ myBitmapsDir ++ "/full.xbm)"
"Simple Float" -> "~"
_ -> x
)
, ppTitle = (" " ++) . dzenColor "white" "#1B1D1E" . dzenEscape
, ppOutput = hPutStrLn h
}
--}}}