2016-05-29 12:06:32 +00:00
|
|
|
import XMonad
|
2017-08-29 10:26:56 +00:00
|
|
|
import XMonad.Config.Desktop
|
2016-05-29 12:06:32 +00:00
|
|
|
import XMonad.Hooks.DynamicLog
|
|
|
|
import XMonad.Hooks.ManageDocks
|
|
|
|
import XMonad.Util.Run(spawnPipe)
|
|
|
|
import XMonad.Util.EZConfig(additionalKeys)
|
2019-06-12 01:43:58 +00:00
|
|
|
--import XMonad.Util.SpawnOnce
|
2016-05-29 12:06:32 +00:00
|
|
|
import System.IO
|
|
|
|
|
|
|
|
main = do
|
2019-01-05 07:06:54 +00:00
|
|
|
-- Make sure that HDMI is turned off by default
|
|
|
|
spawn "xrandr --output HDMI1 --off"
|
|
|
|
-- Launch the composite manager
|
|
|
|
spawn "xcompmgr -f -C -n -D 3"
|
2017-03-30 03:59:51 +00:00
|
|
|
-- Launch xmobar as my task bar.
|
2019-01-05 07:06:54 +00:00
|
|
|
xmproc <- spawnPipe "xmobar /home/craige/.xmobarrc"
|
|
|
|
-- Launch the system tray
|
2019-06-12 01:43:58 +00:00
|
|
|
spawn "trayer --edge top --align right --SetDockType true --SetPartialStrut true --expand false --width 5 --transparent true --alpha 0 --tint 0x073642 --height 20 --monitor 0"
|
2019-01-05 07:06:54 +00:00
|
|
|
--xmproc <- spawnPipe "notification-daemon"
|
|
|
|
-- Launch the settings daemon
|
|
|
|
spawn "xsettingsd"
|
|
|
|
-- Launch the screen saver
|
|
|
|
spawn "xscreensaver -no-splash"
|
|
|
|
spawn "nm-applet"
|
|
|
|
spawn "owncloud"
|
|
|
|
-- Launch the music playing daemon
|
|
|
|
spawn "mpd"
|
|
|
|
-- Set the background wallpaper
|
2019-06-12 02:02:54 +00:00
|
|
|
spawn "feh --bg-scale ~/Documents/Images/Posters/FuegoMilkyWay.jpg"
|
2017-08-29 10:26:56 +00:00
|
|
|
xmonad $ desktopConfig
|
2017-03-30 03:59:51 +00:00
|
|
|
{ focusFollowsMouse = False
|
2019-01-05 07:06:54 +00:00
|
|
|
, terminal = "termonad"
|
|
|
|
-- , manageHook = manageDocks <+> manageHook desktopConfig
|
2017-08-29 10:26:56 +00:00
|
|
|
, layoutHook = avoidStruts $ layoutHook desktopConfig
|
2017-03-30 03:59:51 +00:00
|
|
|
, logHook = dynamicLogWithPP $ xmobarPP
|
|
|
|
{ ppOutput = hPutStrLn xmproc
|
|
|
|
, ppCurrent = xmobarColor "#859900" "" . wrap "[" "]"
|
|
|
|
, ppVisible = xmobarColor "#2aa198" "" . wrap "(" ")"
|
|
|
|
, ppLayout = xmobarColor "#2aa198" ""
|
|
|
|
, ppTitle = xmobarColor "#859900" "" . shorten 50
|
|
|
|
}
|
|
|
|
, modMask = mod4Mask -- Rebind Mod to the Windows key
|
|
|
|
--, borderWidth = 1
|
|
|
|
} `additionalKeys`
|
|
|
|
-- Custom dmenu launcher
|
|
|
|
[ ((mod4Mask, xK_p ), spawn
|
2017-03-30 04:41:28 +00:00
|
|
|
" exe=`dmenu_path | dmenu -fn \"Open Sans-10\" -p \"λ:\" \
|
|
|
|
\ -nb \"#073642\" -nf \"#93a1a1\" -sb \"#002b36\" -sf \
|
|
|
|
\ \"#859900\"` && eval \"exec $exe\""
|
2017-03-30 03:59:51 +00:00
|
|
|
)
|
|
|
|
-- Lock the screen
|
|
|
|
, ((0, 0x1008ff2d), spawn "xscreensaver-command -lock")
|
|
|
|
-- XF86ScreenSaver
|
2018-02-24 11:14:04 +00:00
|
|
|
, ((mod4Mask .|. controlMask, xK_l), spawn "xscreensaver-command -lock")
|
2017-03-30 03:59:51 +00:00
|
|
|
, ((controlMask, xK_Print), spawn "sleep 0.2; scrot -s")
|
|
|
|
, ((0, xK_Print), spawn "scrot")
|
2018-02-24 11:14:04 +00:00
|
|
|
-- Turn on the eDP-1 port and set it as the primary display
|
|
|
|
, ((mod4Mask .|. shiftMask, xK_e), spawn
|
2019-06-21 03:41:34 +00:00
|
|
|
"xrandr --output eDP-1 --primary --auto --output "
|
2017-03-30 03:59:51 +00:00
|
|
|
)
|
|
|
|
-- Turn off the HDMI port
|
|
|
|
, ((mod4Mask .|. controlMask, xK_h), spawn
|
2019-06-21 03:41:34 +00:00
|
|
|
"xrandr --output HDMI-1 --off"
|
2017-03-30 03:59:51 +00:00
|
|
|
)
|
2018-02-24 11:14:04 +00:00
|
|
|
-- Turn on the HDMI-1 port and set it as the secondary display
|
2017-03-30 03:59:51 +00:00
|
|
|
, ((mod4Mask .|. shiftMask, xK_h), spawn
|
2019-06-21 03:41:34 +00:00
|
|
|
"xrandr --output eDP-1 --primary --auto --output HDMI-1 --right-of eDP-1 --auto"
|
2017-03-30 03:59:51 +00:00
|
|
|
)
|
2019-01-05 07:06:54 +00:00
|
|
|
, ((0 , 0x1008FF11), spawn "amixer set Master 2%-") -- XF86AudioLowerVolume
|
|
|
|
-- , ((mod4Mask , xK_Down), spawn "amixer set Master 2%-")
|
|
|
|
, ((0 , 0x1008FF12), spawn "amixer set Master toggle") -- XF86AudioMute
|
|
|
|
, ((0 , 0x1008FF13), spawn "amixer set Master 2%+") -- XF86AudioRaiseVolume
|
|
|
|
-- , ((mod4Mask , xK_Up), spawn "amixer set Master 2%+")
|
2017-03-30 03:59:51 +00:00
|
|
|
, ((0 , 0x1008FF14), spawn "mpc toggle") -- Play/pause
|
2019-01-05 07:06:54 +00:00
|
|
|
-- , ((mod4Mask , xK_End), spawn "mpc toggle")
|
2018-03-20 23:28:50 +00:00
|
|
|
, ((mod4Mask .|. controlMask, xK_space), spawn "mpc toggle") -- Play/pause
|
2017-03-30 03:59:51 +00:00
|
|
|
, ((0 , 0x1008FF15), spawn "mpc stop") -- Stop
|
|
|
|
, ((0 , 0x1008FF16), spawn "mpc prev") -- XF86AudioPrevious
|
2019-01-05 07:06:54 +00:00
|
|
|
, ((mod4Mask , xK_Left), spawn "mpc prev") -- prev
|
2017-03-30 03:59:51 +00:00
|
|
|
, ((0 , 0x1008FF17), spawn "mpc next") -- XF86AudioNext
|
2019-01-05 07:06:54 +00:00
|
|
|
, ((mod4Mask , xK_Right), spawn "mpc next") -- Next
|
2018-02-24 11:14:04 +00:00
|
|
|
-- XF86MonBrightnessUp
|
2019-01-05 07:06:54 +00:00
|
|
|
, ((0 , 0x1008ff02), spawn "xbrightness +5000")
|
2018-02-24 11:14:04 +00:00
|
|
|
-- XF86MonBrightnessDown
|
2019-01-05 07:06:54 +00:00
|
|
|
, ((0 , 0x1008ff03), spawn "xbrightness -5000")
|
2017-03-30 03:59:51 +00:00
|
|
|
]
|