You are not logged in.

#1 2014-04-13 22:06:19

billodwyer
Member
Registered: 2013-06-15
Posts: 18

[Solved] Having trouble with dzen2 in openbox

I'm setting up a dzen2 panel for Openbox and I've almost got it to the point where I'm happiest with it. The problem is that fullscreen video (VLC, mplayer) doesn't cover up the bar and what was once useful is now really annoying.
I've tried putting the -dock option into my /bin/dzconky file, but for some bizarre reason that causes dzen to jump to the bottom of the screen, and no amount of using -x and -y options seems to change that.
Can anybody help me out?

Last edited by billodwyer (2014-04-19 02:50:40)

Offline

#2 2014-04-19 03:01:59

billodwyer
Member
Registered: 2013-06-15
Posts: 18

Re: [Solved] Having trouble with dzen2 in openbox

I think I've worked out what the problem was.
Basically, dzen2 wasn't playing nicely with the margins in openbox; I have a 16px margin at the top of the screen so that maximised applications aren't covered by the panel. When the margin is set to 0, dzen behaves and the panels appear in the correct place (they have to be launched in the autostart file though, from the terminal they appear to be positioned based upon the terminal's own position).

So what I have is a script set up in my .xinitrc that uses sed to change the margin from 16 to 0 before openbox starts, and then in openbox's autostart file I have dzen and this script again, which will set the margin back to 16. This is probably the hackiest and least elegant way of fixing this problem ever conceived, but if it helps, below is the script.

#!/bin/bash

margin=$(cat $HOME/.config/openbox/rc.xml | grep "<top>")

if [[ $margin == *16* ]]
then
  sed -i "s_<top>16</top>_<top>0</top>_" $HOME/.config/openbox/rc.xml
elif [[ $margin == *16* ]]
then
  sed -i "s_<top>0</top>_<top>16</top>_" $HOME/.config/openbox/rc.xml
fi

Offline

#3 2014-04-19 03:43:51

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,426
Website

Re: [Solved] Having trouble with dzen2 in openbox

A couple of tangentially related bash pointers: UUOC in $margin, you can just use redirection with

margin=$(<$HOME/.config/...

and instead of pattern matching on the value of $margin, you could test if the integers match with `-eq`. See Wooledge for details.


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

Board footer

Powered by FluxBB