You are not logged in.

#1 2018-10-03 06:50:58

Dragomundo
Member
Registered: 2018-10-02
Posts: 4

Cannot get xmobar to show/work with XMonad

Heres my ~/.xmonad/xmonad.hs file

import XMonad
import XMonad.Hooks.DynamicLog
import XMonad.Hooks.ManageDocks
import XMonad.Util.Run(spawnPipe)
import XMonad.Util.EZConfig(additionalKeys)
import System.IO

main = do
    xmproc <- spawnPipe "xmobar"
    xmonad $ defaultConfig
           { terminal = "terminator"
	   , modMask = mod4Mask
	   , layoutHook = avoidStruts  $  layoutHook defaultConfig
	   , manageHook = manageDocks <+> manageHook defaultConfig
	   , handleEventHook = handleEventHook defaultConfig <+> docksEventHook
	   , logHook    = dynamicLogWithPP xmobarPP
	                      { ppTitle  = xmobarColor "green" "" . shorten 50
			      , ppOutput = hPutStrLn xmproc
			      }	   
	   } `additionalKeys`
	   [ ((controlMask, xK_Print), spawn "sleep 0.2; scrot -s"),
	     ((0, xK_Print), spawn "scrot")
	   ]

and heres my ~/.xmobarrc file

Config { font = "-*-Fixed-Bold-R-Normal-*-13-*-*-*-*-*-*-*"
       , bgColor = "#78a1cf"
       , fgColor = "grey"
       , position = TopW L 100
       , sepChar = "%"
       , alignSep = "}{"
       , commands = [ Run Weather "EGPF" ["-t"," <tempF>F","-L","64","-H","77","--normal","green,"--high","red","--low","lightblue"] 36000
                    , Run Cpu ["-L","3","-H","50","--normal","green","--high","red"] 10
                    , Run Memory ["-t","Mem: <usedratio>%"] 10
                    , Run Swap [] 10
                    , Run Date "%a %b %_d %l:%M" "date" 10
                    , Run StdinReader
                    ]
       , template = "%StdinReader% }{ %cpu% | %memory% * %swap%    <fc=#ee9a00>%date%</fc> | %EGPF%"
       , lowerOnStart = True
       , hideOnStart = False
       , persistent = True
       }

and my ~/.xinitrc file

#!/bin/sh

userresources=$HOME/.Xresources
usermodmap=$HOME/.Xmodmap
sysresources=/etc/X11/xinit/.Xresources
sysmodmap=/etc/X11/xinit/.Xmodmap

# merge in defaults and keymaps

if [ -f $sysresources ]; then







    xrdb -merge $sysresources

fi

if [ -f $sysmodmap ]; then
    xmodmap $sysmodmap
fi

if [ -f "$userresources" ]; then







    xrdb -merge "$userresources"

fi

if [ -f "$usermodmap" ]; then
    xmodmap "$usermodmap"
fi

# start some nice programs

if [ -d /etc/X11/xinit/xinitrc.d ] ; then
 for f in /etc/X11/xinit/xinitrc.d/?*.sh ; do
  [ -x "$f" ] && . "$f"
 done
 unset f
fi

compton &
exec xmonad

So Ive tried and looked for hours and hours and still cannot get the bar to show.

Offline

#2 2018-10-03 08:28:05

Raynman
Member
Registered: 2011-10-22
Posts: 1,539

Re: Cannot get xmobar to show/work with XMonad

Just run xmobar from a terminal and look at the error message it prints before exiting. And maybe view/edit your config with Haskell syntax highlighting.

Last edited by Raynman (2018-10-03 08:30:43)

Offline

Board footer

Powered by FluxBB