Re: dzen & xmobar Hacking Thread

Re: dzen & xmobar Hacking Thread

Here's the bar that I constructed. It's kind of weird in that the left part (workspaces) is a log hook and the right part (system information) is a script, but whatever. Here's what it looks like:

The icons are from Tango and the excellent Silk icon set, but I'll probably change them as they look too garish for my tastes (I just happened to have them handy). In fact, I'll probably change a lot of stuff as I continue customizing xmonad. I just started using it a few days ago, and couldn't live without a status bar. Credit goes to probably about 2/3 of the posts in this forum as I learned how to use dzen2. I didn't keep track of what exactly I pulled from whom.

Features:

Easily extensible

Click on workspace number to switch

Click on layout name to switch

Click on volume to toggle mute; mouse wheel to raise/lower volume

Highlighted hour/minute in date and time

Problems/TODO:

Have just one bar integrating everything, but I'm not really sure how to do that

Swap icons for whether we're on wireless or wired network

Like redbeard0531, my script doesn't exit cleanly. You can see it try to compensate for that at the end (right above where it creates the pipe) when it tries to kill other executions (I Mod-Q a LOT). If you don't like the fact that it just killalls tail, then you can take that out, but you'll have to clean up after it manually. Happily, the other bar exits cleanly.

Re: dzen & xmobar Hacking Thread

I hope this isn't too obvious: is it possible to specify the vertical position of dzen from the bottom of the screen rather than the top? I have bars at the top and bottom of my laptop screen, and would like the latter to shift to the bottom of an external screen when I switch to it, rather than remain stranded in the middle of the larger desktop. I'm using XMonad, if that's relevant, although the bottom bar is simply displaying an output from conky.

Re: dzen & xmobar Hacking Thread

owain wrote:

I hope this isn't too obvious: is it possible to specify the vertical position of dzen from the bottom of the screen rather than the top? I have bars at the top and bottom of my laptop screen, and would like the latter to shift to the bottom of an external screen when I switch to it, rather than remain stranded in the middle of the larger desktop. I'm using XMonad, if that's relevant, although the bottom bar is simply displaying an output from conky.

Re: dzen & xmobar Hacking Thread

Thanks - I found the negative option after posting that. It still doesn't quite do what I want, because it doesn't automatically adjust to the new resolution. However, as I'm using a small script to call xrandr, I can kill and restart the relevant processes.

Re: dzen & xmobar Hacking Thread

Here is the bar I made recently by using various ideas and parts from others. I tried to clean up the code and make it readable/easy to change/configure. In addition, I added some comments on what each piece does.

It utilizes dzen2 + dmplex for a more modular approach. Ideally I would like to use one while loop for everything but it ended up making the code less readable (not good!).

The big reason why I'm trying to make "readable" code is due to the pain I had to endure to get dzen to play nice. Anyway...

Re: dzen & xmobar Hacking Thread

Is it possible to have xmobar correctly restart when xmonad does (no duplicate processes) but NOT display output from stdinreader in the bar? I'd like a second instance of xmobar (such as the layout in this screenshot -- top and bottom) for displaying additional information, but if I leave out "%StdinReader%", it fails to be killed by an xmonad restart, and I get a new copy (in addition to the running copy) each time. I've read that spawning it through a shell script is not good practice, but I'm not familiar enough with Haskell to figure it out. What can I do to fix this?

Re: dzen & xmobar Hacking Thread

Is there a way to have 2 different high threshold values for reception and transmission rate?

My reception rate is significantly lower than my transmission rate, my reception rate will never reach the high threshold.If I lower the high threshold so my reception rate can reach it, then my transmission rate will exceed it too easily...

Re: dzen & xmobar Hacking Thread

hello,i have a question about dzen2:i can't find documentation on all possible commands that can be piped into dzen, like ^ca(1, command to execute) for interactive areas (i found that in a script), and then i'd think there'd be a way to change the font... i think i read the whole wiki on github... no manpage either...did i miss something?

Re: dzen & xmobar Hacking Thread

Hi, I'm trying out dzen2 with Ubuntu 13.10 (using default Unity, not Xmonad or anything), how can I get dzen2 not to sit on top of other parts of the screen? Can I get the rest of my screen to move down and make room for this bar at the top, for example? I tried the -dock flag but that didn't change anything.

Re: dzen & xmobar Hacking Thread

Hi guys

Do you know if it is possible to "to import variables" into the xmobar config file (xmobarrc). By import I mean that I keep a set of colors in both a Haskell module (for use in xmonad config) and the same colors in a shell script and I would like to import either one of them into xmobarrc so I can do specify base02 instead of #00a244. This would allow me to keep all xmobar+trayer+xmonad colors located a central place (I change color schemes on the fly).

The syntax of xmobarrc looks like Haskell, but that doesn't mean I can import a Haskell module. And if it is a text file with custom syntax (and a custom parser) it will of course not allow me to source a file like in a shell script.

Re: dzen & xmobar Hacking Thread

Yeah cool dzen, i haz it!

Once I looked for a (simple) weather script to pipe icons to dzen. "shaman" was not my taste, and I couldn't find any other. So I thought, it mustn't be too difficult to write one myself. And that’s now, what has come out of it – the mws (mito’s wx scripts) collection!

Finally they became four, from simple to complex, hope you don’t mind. Also that I became pretty garrulous by spending much effort on comments. But NP, I know all of you guys cope with Bash. Hence the first you would probably do is to eridicate half of the code, or even rewrite it.

Anyway for those who find the scripts useful, help yourself and adapt them to your needs. Yet there’re cases for parsing weather data from NWS, OMW, and yr.no, feel free to add another service. Or to localize a script for your language. – If there aren’t icons that can’t be downloaded as a whole set, one of the scripts shows how to download and convert the current icon on the fly (however I wished dzen supports PNG).

Re: dzen & xmobar Hacking Thread

Those scripts would be much much less resource intensive if you just made one call to curl the needed url, then parse the result locally. Currently it grabs the exact same full web resource 4 times just to get 4 different bits of information out of it. Also grep + tr + awk + tr = awk.