You are not logged in.

#26 2014-01-13 19:02:36

blubbb
Member
Registered: 2013-09-26
Posts: 59

Re: Xmonad: dynamicLogDzen

skottish wrote:

In the xmonad.hs file that you posted here:

https://bbs.archlinux.org/viewtopic.php … 1#p1370101

Simply delete one space from in front of "xmonad $ defaultConfig" so that it's lined up with the line above it. I can compile and run your version with this one change.


Oh my god, thanks you so much, it finally compiles. Now I understand what you meant by this:

skottish wrote:

I really hope that you enjoy xmonad. You've certainly worked hard to get this far! And the solution may give you a wee bit of a headache...

See the little indentation of space between the h and xmonad in the beginning of the do block? That's what's causing your problem right now. For real. Line up the "xmonad $ defaultConfig" with the "h <-" line above it all the way down to right above "`additionalKeysP`". Haskell is very peculiar in regards to whitespace.

**EDIT**

To put it less wordy, align the vertical indentation of the "xmonad $ defaultConfig" block with the line above it.




You're just awesome, thank you so much for your extensive help!!!!!!!
However when I now start the x server and xmonad it does the same as before, I don't see any changes. Could you perhaps lead me further and explain the configurations a bit?


Oh and to make it easier to talk about, here are the relevant(in my lousy opinion) config lines:


My xmonad.hs file:

, logHook               = dynamicLogWith$
                         { ppCurrent = xmobarColor "#ffffff" "#0$
                         , ppVisible = xmobarColor "#333333" "#0$
                         , ppLayout  = xmobarColor "#ffffff" "#0$
                         , ppTitle   = xmobarColor "#ffffff" "#0$
                         , ppSep     = ""
                         , ppWsSep   = ""
                         , ppOutput  = hPutStrLn h
                         }

and the basic xmobar config file:

Config { font = "xft:DejaVu
Sans:size=8:antialias=true"
       , bgColor = "black"
       , fgColor = "white"
       , position = Bottom
       , lowerOnStart = True
       , commands = [ Run Date "%a %b %d %Y %l:%M"
"date" 600
                    , Run StdinReader ]
       , sepChar = "%"
       , alignSep = "}{"
       , template = "%StdinReader% }{ %date%"
       } 

EDIT: Ok, I tried to start xmobar manually however that doesen't seem to work either. I used this command:

xmobar start .config/xmobar/xmobarrc 

strangly this was the output:

xmobar: /home/wolf/.xmobarrc: file not found!
Usage: xmobar [OPTION...] [FILE]

So this config file MUST be in the home directory? Ok then, lets retry:

[wolf@arch ~]$ xmobar start .xmobarrc 

Finally I got a usefull output:

xmobar: /home/wolf/.xmobarrc: configuration file contains errors at:
"Config" (line 1, column 29):
unexpected "\n"
expecting the end of the string field font - a double quote (").

Finally an error message which make me need some more tips on how to solve:

Fields missing from config defaulted: border,borderColor,allDesktops,overrideRedirect,hideOnStart,persistent

I'd guess I need to define the demanded variables, however I'm not sure how to define them in a proper way.

WOW, just realized this: xmobar finally run on the button althrough there are still errors in my config files. However it runs in the backround, is this correct? Then there's on the left the test "updating" and on the right day and time, also how it should behave?

Another point, I tried start xmobar manually from .config/xmobar/xmobarrc why doesen't work this/is there a workaround for this, since it really much cleaner that way.



And one last thing I just wanted to repeat:
You're so awesome helped me so much further and I just can't say enough how much I appreciate your help. Thank you so much!!!

Last edited by blubbb (2014-01-13 19:18:38)

Offline

#27 2014-01-13 19:38:35

skottish
Forum Fellow
From: Here
Registered: 2006-06-16
Posts: 7,942

Re: Xmonad: dynamicLogDzen

With the xmonbarrc file, make sure that all of the lines are together.  The error is coming from the font line being split over two lines. So:

Config { font = "xft:DejaVu Sans:size=8:antialias=true"

I can't tell from the paste whether or not the 'commands' section is going to work correctly, so just make sure that it's:

, commands = [ Run Date "%a %b %d %Y %l:%M" "date" 600
             , Run StdinReader ]

Back to your xmonad.hs file. There's some bad values in your logHook. As well, it looks like some lines may have been cut off and I don't know if it's in your code  or not. So just make sure at least that starts like this:

, logHook = dynamicLogWithPP xmobarPP

Get things sorted and I'll look at your other questions.

Oh yeah, you're welcome.

Offline

#28 2014-01-16 13:12:14

blubbb
Member
Registered: 2013-09-26
Posts: 59

Re: Xmonad: dynamicLogDzen

So there are just a few things to go:
1. I'm not sure which config file xmobar uses. When I started it manually with the location it demanded a file in ~/ however I tried to start it from ~/.config/xmobar/.. which didn't work, so I copied it to the home directory.
2. Xmobar runs however it's in the background how can I adjust xmonad so that it doesen't spawn the window on the bar?
3. How could I add something to the bar(like acpi for the battery or a systray)?
4. When I shut the laptop down(with the poweroff command) directly from Xmonad, on restarting I sometimes get a black screen which doesen't take any command excepct mod-shift-q for shutting down xmonad. A reboot solves this. So do I have to always first shut down xmonad using mod-shift-q and then poweroff? Or should I take another shutdown command?

Xmobar conf:

Config { font = "xft:DejaVu Sans:size=8:antialias=true"
       , bgColor = "black"
       , fgColor = "white"
       , position = Bottom
       , lowerOnStart = True
       , commands = [ Run Date "%a %b %d %Y %l:%M" "date" 600
                    , Run StdinReader ]
       , sepChar = "%"
       , alignSep = "}{"
       , template = "%StdinReader% }{ %date%"
       }

.xmonad:

import XMonad  
import Graphics.X11.ExtraTypes.XF86  
import XMonad.Util.EZConfig  
import Data.Monoid
import System.Exit
import XMonad.Hooks.DynamicLog
import XMonad.Hooks.ManageDocks
import XMonad.Util.Dzen 
import qualified XMonad.StackSet as W
import qualified Data.Map        as M
import XMonad.Util.Run

main = do
   h <- spawnPipe "xmobar ~/.config/xmobar/xmobarrc" 
   xmonad $ defaultConfig
			{ terminal 		= myTerminal
			, focusFollowsMouse	= myFocusFollowsMouse 
			, borderWidth		= myBorderWidth
			, workspaces		= myWorkspaces
			, normalBorderColor	= myNormalBorderColor
			, focusedBorderColor	= myFocusedBorderColor
			, modMask 		= mod4Mask
			, layoutHook		= myLayout
			, manageHook		= myManageHook
			, logHook		= dynamicLogWithPP xmobarPP
                    	 { ppCurrent = xmobarColor "#ffffff" "#000000" . pad
                    	 , ppVisible = xmobarColor "#333333" "#000000" . pad
                   	 , ppLayout  = xmobarColor "#ffffff" "#000000" . pad . pad
                   	 , ppTitle   = xmobarColor "#ffffff" "#000000" . pad 
                  	 , ppSep     = ""
                    	 , ppWsSep   = ""
                    	 , ppOutput  = hPutStrLn h
                    	 }
			, startupHook		= myStartupHook
			}`additionalKeysP`
	[("<XF86MonBrightnessUp>", spawn "xbacklight +20")
	,("<XF86MonBrightnessDown>", spawn "xbacklight -20")
	,("<XF86AudioRaiseVolume>", spawn "amixer set Master 5%+")
	,("<XF86AudioLowerVolume>", spawn "amixer set Master 5%-")
	,("<XF86AudioMute>", spawn "amixer set Master toggle")
	,("<XF86Launch1>", spawn "xset dpms force off")
	]

myTerminal	= "urxvt"

--Width of the border in pixels:
myBorderWidth	= 1


--The default number of workspaces and their names. The names can also be strings like
--myWorkspaces=["irc", "2", "3", "programming"] + map show[4..9]
--the number of workspaces is determined by the lenght of this list-
myWorkspaces	= ["1", "2", "3", "4", "5", "6", "7", "8", "9"]


--Border color of focused and unfocused windows
myNormalBorderColor	= "#dddddd"
myFocusedBorderColor	= "#ff0000"

--Focus follows mouse pointer?
myFocusFollowsMouse :: Bool
myFocusFollowsMouse = True





--Layouts: You can specify and transform your layouts by modifying these
--Restart layout bindings with mod-short-space(with mod-q) as xmonad preserves your old layout settings by default

--The available layouts. Note that each layout is separated by ||| which denotes layout choice
myLayout = tiled ||| Mirror tiled ||| Full
	where
			--default tiling algorith partitions the screen into two panes
		tiled = Tall nmaster delta ratio
			--the default number of windows in the master pane
		nmaster = 1	

			--default proportion of screen occupied by master pane
		ratio = 1/2
			--percent of screen to increment by when resizing panes
		delta = 3/100

--window rules:
--when manageing new windows do always float this programms:
myManageHook = composeAll
	[ className =? "Gimp"	--> doFloat]

 
--Status bars and logging:
--Perform an arbitrary action on each internal state change or X event.
--See the 'DynamicLog' extension for examples.

--To emulate dwm's status bar
--myLogHook = dynamicLogWithPP xmobarPP
--               { ppCurrent = xmobarColor "#ffffff" "#000000" . pad
--               , ppVisible = xmobarColor "#333333" "#000000" . pad
--               , ppLayout  = xmobarColor "#ffffff" "#000000" . pad . pad
--               , ppTitle   = xmobarColor "#ffffff" "#000000" . pad 
--               , ppSep     = ""
--               , ppWsSep   = ""
--               , ppOutput  = hPutStrLn h
--               } 


--Startup hook
--Perform an arbitrary action each time xmonad starts or is restarted
--with mod-q. Used by, e.g. XMonad.Layout.PerWorkspace to initialize
--per-workspace layout choices.

--by default to nothing:
myStartupHook=return()

Offline

#29 2014-01-16 16:57:43

skottish
Forum Fellow
From: Here
Registered: 2006-06-16
Posts: 7,942

Re: Xmonad: dynamicLogDzen

1) I'm not sure. I'm guessing a typo of some sort.
2) Check out Arch's xmonad entry and search for avoidStruts. It's part of ManageHelpers which you're already importing.
3) xmobar's wiki has extensive documentation. The battery situation really depends on your setup.
4) Sounds like a X error and not an xmonad error. Check the journal and Xorg.0.log for errors.

Offline

Board footer

Powered by FluxBB