Added new layouts and cleaned up startup

This commit is contained in:
Craige McWhirter 2020-05-23 00:30:00 +10:00
parent f895e95df2
commit c580745feb
Signed by: sercanto
GPG key ID: 7DBA9F5689EFB6AA

View file

@ -6,38 +6,83 @@ import Graphics.X11.Xlib
import Graphics.X11.Xlib.Extras import Graphics.X11.Xlib.Extras
import XMonad.Hooks.DynamicLog import XMonad.Hooks.DynamicLog
import XMonad.Hooks.ManageDocks import XMonad.Hooks.ManageDocks
import XMonad.Layout.Accordion
import XMonad.Layout.Circle
import XMonad.Layout.Grid
import XMonad.Layout.Spiral
import XMonad.Layout.Tabbed
import XMonad.Layout.ThreeColumns
import XMonad.Prompt
import XMonad.Prompt.Shell ( shellPrompt )
import XMonad.Util.Run(spawnPipe) import XMonad.Util.Run(spawnPipe)
import XMonad.Util.EZConfig(additionalKeys) import XMonad.Util.EZConfig(additionalKeys)
--import XMonad.Util.SpawnOnce import XMonad.Util.SpawnOnce
import System.IO import System.IO
colourBackground :: String
colourBackground = "#073642"
colourForeground :: String
colourForeground = "#93a1a1"
highlightBackground :: String
highlightBackground = "#002b36"
highlightForeground :: String
highlightForeground = "#859900"
-- Set xmobar as my task bar.
myWsBar :: String
myWsBar = "xmobar -v $HOME/.xmobarrc"
myXPConfig = def -- Configure the prompt's appearance
{ alwaysHighlight = True
, bgColor = colourBackground
, bgHLight = highlightBackground
, fgColor = colourForeground
, fgHLight = highlightForeground
, font = "xft:Open Sans:size=9"
, position = Top
, promptBorderWidth = 0
}
backgroundCmd = "feh --bg-scale ~/Documents/Images/Posters/FuegoMilkyWay.jpg"
compositeMgr = "xcompmgr -f -C -n -D 3"
musicCmd = "mpd"
nextcloudCmd = "nextcloud"
notificationCmd = "lxqt-notificationd"
screensaverCmd = "xscreensaver -no-splash"
settingsDaemon = "xsettingsd"
terminalCmd = "termonad"
trayerCmd = "trayer --edge top --align right --SetDockType true --SetPartialStrut false --expand true --width 7 --transparent true --alpha 0 --tint 0x073642 --height 20 --monitor primary"
main = do main = do
-- Make sure that HDMI is turned off by default -- Make sure that HDMI is turned off by default
spawn "xrandr --output eDP-1 --primary --output HDMI1 --off" spawn "xrandr --output eDP-1 --primary --output HDMI1 --off"
-- Launch the composite manager wsbar <- spawnPipe myWsBar
spawn "xcompmgr -f -C -n -D 3"
-- Launch xmobar as my task bar.
xmproc <- spawnPipe "xmobar /home/craige/.xmobarrc"
-- Launch the system tray, configured to work correctly with dual monitors
spawn "trayer --edge top --align right --SetDockType true --SetPartialStrut false --expand true --width 5 --transparent true --alpha 0 --tint 0x073642 --height 20 --monitor primary"
-- 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
spawn "feh --bg-scale ~/Documents/Images/Posters/FuegoMilkyWay.jpg"
spawn "lxqt-notificationd"
xmonad $ desktopConfig xmonad $ desktopConfig
{ focusFollowsMouse = False { focusFollowsMouse = False
, terminal = "termonad" -- Set the default terminal , terminal = terminalCmd -- Set the default terminal
, startupHook = do
spawnOnce screensaverCmd -- Launch the screen saver
spawnOnce backgroundCmd -- Set the background wallpaper
spawnOnce compositeMgr -- Launch the composite manager
spawnOnce settingsDaemon -- Launch the settings daemon
spawnOnce trayerCmd -- Launch the system tray, configured to work correctly with dual monitors
spawnOnce notificationCmd -- Launch the notification service
spawnOnce musicCmd -- Launch the music playing daemon
spawnOnce nextcloudCmd -- Launch the cloud service
, manageHook = manageDocks <+> manageHook desktopConfig , manageHook = manageDocks <+> manageHook desktopConfig
, layoutHook = avoidStruts $ layoutHook desktopConfig , layoutHook = avoidStruts $ layoutHook desktopConfig
||| spiral (6/7)
||| Grid
||| Circle
||| ThreeCol 1 (3/100) (1/2)
||| simpleTabbed
||| Accordion
, handleEventHook = handleEventHook desktopConfig <+> docksEventHook
, logHook = dynamicLogWithPP $ xmobarPP , logHook = dynamicLogWithPP $ xmobarPP
{ ppOutput = hPutStrLn xmproc { ppOutput = hPutStrLn wsbar
, ppCurrent = xmobarColor "#859900" "" . wrap "[" "]" , ppCurrent = xmobarColor "#859900" "" . wrap "[" "]"
, ppVisible = xmobarColor "#2aa198" "" . wrap "(" ")" , ppVisible = xmobarColor "#2aa198" "" . wrap "(" ")"
, ppLayout = xmobarColor "#2aa198" "" , ppLayout = xmobarColor "#2aa198" ""
@ -46,12 +91,8 @@ main = do
, modMask = mod4Mask -- Rebind Mod to the Windows key , modMask = mod4Mask -- Rebind Mod to the Windows key
--, borderWidth = 1 --, borderWidth = 1
} `additionalKeys` } `additionalKeys`
-- Custom dmenu launcher -- Use Xmonad's built-in launcher
[ ((mod4Mask, xK_p ), spawn [ ((mod4Mask, xK_p), shellPrompt myXPConfig)
" exe=`dmenu_path | dmenu -fn \"Open Sans-10\" -p \"λ:\" \
\ -nb \"#073642\" -nf \"#93a1a1\" -sb \"#002b36\" -sf \
\ \"#859900\"` && eval \"exec $exe\""
)
-- Lock the screen -- Lock the screen
, ((0, 0x1008ff2d), spawn "xscreensaver-command -lock") , ((0, 0x1008ff2d), spawn "xscreensaver-command -lock")
-- XF86ScreenSaver -- XF86ScreenSaver