You are not logged in.

#1 2012-09-13 15:47:07

darkfeline
Member
Registered: 2012-02-14
Posts: 94

[Solved] Toggle conky bar?

I'm using i3 with conky as statusbar, but having two bars really takes up a lot of precious precious screen real estate.  I want to be able to have a key combination to toggle conky bar enable/disable.  The simple crude way I came up with is with a script that killall conky if conky is running and conky & otherwise, but it seems like a very kludgy solution.  I'm sure a lot of you have run into similar problems, so I wonder what solutions everyone came up with?

Last edited by darkfeline (2012-09-15 18:14:57)

Offline

#2 2012-09-13 16:09:45

ibrunton
Member
From: Canada
Registered: 2011-05-05
Posts: 270

Re: [Solved] Toggle conky bar?

You can use conky's ${if_existing file}...${endif} directive in your conkyrc; just put the contents of your conky bar in between.  And then bind your key combination to a script like this one.  That's what I use.  It probably doesn't actually hide conky, though---just the text; my conky background is transparent, so without text it's invisible.

Offline

#3 2012-09-13 16:30:52

darkfeline
Member
Registered: 2012-02-14
Posts: 94

Re: [Solved] Toggle conky bar?

How do you have conky set up?

Currently I have conky with own_window and own_window_type_dock, so your solution would just leave a blank bar at the top of the screen.  If I don't have conky as a dock window, then it'll only appear under windows on the wallpaper level (so I wouldn't need a toggle in the first place).  If I could have conky appear over windows then your solution would work but I haven't been able to configure conky to do so with i3.

Offline

#4 2012-09-13 18:47:06

ibrunton
Member
From: Canada
Registered: 2011-05-05
Posts: 270

Re: [Solved] Toggle conky bar?

I'm using herbstluftwm, so I have its monitor padding set to leave space at the top for conky.  The toggle_conky.sh script changes that setting.

Offline

#5 2012-09-14 19:07:26

darkfeline
Member
Registered: 2012-02-14
Posts: 94

Re: [Solved] Toggle conky bar?

Sigh.  I haven't found a way to toggle conky (at least with i3).  In the end, I just reduced the font size a little and settling for the fact that gnome/kde has more UI wasted space as consolation.

Offline

#6 2012-09-14 21:30:52

Wibjarm
Member
Registered: 2012-05-04
Posts: 43

Re: [Solved] Toggle conky bar?

If you have conky as it's own window still and still haven't had any luck doing it through your WM, you might want to try using xdotool to windowmap/windowunmap it.  Something along the lines of

xdotool search --onlyvisible --name 'conky' windowunmap %@ || xdotool search --name 'conky' windowmap %@

should work, you just might need to check what conky actually names its windows.

Offline

#7 2012-09-15 18:14:35

darkfeline
Member
Registered: 2012-02-14
Posts: 94

Re: [Solved] Toggle conky bar?

Yes, thank you Wibjarm!  It works perfectly!

#!/bin/bash

xdotool search --onlyvisible --class 'Conky' windowunmap %@ \
    || xdotool search --class 'Conky' windowmap %@

Offline

Board footer

Powered by FluxBB