.xmobarrc

Config {
        font = "-misc-fixed-*-*-*-*-14-*-*-*-*-*-*-*"
       , bgColor = "black"
       , fgColor = "grey"
        , position = TopW L 100
        , commands = [ Run Weather "EHRD" ["-t","<tempC>C","-L","15","-H","25","--normal","gray","--high","red","--low","lightblue"] 36000
                    , Run Network "enp0s3" ["-L","0","-H","32","--normal","grey","--high","yellow","-t","e:<rx>/<tx>"] 10
                    , Run Cpu ["-L","3","-H","50","--normal","grey","--high","red"] 10
                    , Run CpuFreq [ "-t", "(<cpu0>,<cpu1>,<cpu2>,<cpu3>,<cpu4>)" ] 50
                    , Run Memory ["-t","m <free>/<total>"] 10
                    , Run Date "%a %b %_d %Y %H:%M:%S" "date" 10
                    , Run Battery ["-t","b <left>% (<timeleft>) <acstatus>","-L","15","-H","65","-l","red","-n","yellow","-h","green","--","-f","ACAD/online","-O","<fc=green
+>+</fc>","-i","<fc=yellow>+</fc>","-o","-"] 10

                    , Run StdinReader
                    ]
        , template = "%StdinReader% }{ %cpu% %cpufreq% | %memory% | %enp0s3% | %EHRD% | %battery% | <fc=#ee9a00>%date%</fc>  "
}

xmonad.hs

import XMonad
import XMonad.Hooks.DynamicLog
import XMonad.Hooks.ManageDocks
import XMonad.Util.Run(spawnPipe)
import XMonad.Util.EZConfig(additionalKeys)
import System.IO
import XMonad.Hooks.EwmhDesktops
import XMonad.Hooks.SetWMName
import Graphics.X11.ExtraTypes.XF86

myManageHook = composeAll
   [ className =? "Gimp"      --> doFloat,
     className =? "stalonetray" --> doIgnore,
     className =? "trayer"      --> doIgnore
   ]

main = do
   xmproc <- spawnPipe "xmobar -x 0"
   xmonad  $ defaultConfig
       { terminal = "gnome-terminal"
       , modMask  = mod4Mask
       , borderWidth = 1
       , normalBorderColor = "#008800"
       , focusedBorderColor = "#ffff00"
       , manageHook = manageDocks <+> myManageHook <+> manageHook defaultConfig
       , layoutHook = avoidStruts $ layoutHook defaultConfig
       , handleEventHook = handleEventHook defaultConfig <+> docksEventHook
       , startupHook = ewmhDesktopsStartup >> setWMName "LG3D"
       , logHook = dynamicLogWithPP $ xmobarPP
                       { ppOutput = hPutStrLn xmproc
                       , ppTitle = xmobarColor "green" "" . shorten 50
                       }
       } `additionalKeys`
       [ ((mod4Mask, xK_backslash), spawn "~/bin/xkb.sh")
       , ((mod4Mask, xK_semicolon), sendMessage $ Expand)
       , ((controlMask, xK_Print), spawn "sleep 0.2; scrot -s")
       , ((0, xF86XK_MonBrightnessUp), spawn "xbacklight -inc 5%")
       , ((0, xF86XK_MonBrightnessDown), spawn "xbacklight -dec 5%")
       , ((0, xF86XK_AudioRaiseVolume), spawn "amixer -c 1 set Master 1%+")
       , ((0, xF86XK_AudioLowerVolume), spawn "amixer -c 1 set Master 1%-")
       , ((0, xK_Print), spawn "scrot")

       ]

-- KoenMartens - 10 Jun 2019
Topic revision: r1 - 10 Jun 2019, KoenMartens
This site is powered by FoswikiCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding Foswiki? Send feedback