[openbox] Workspace Title

Andreas Fink andreas.fink85 at googlemail.com
Sat Feb 11 15:29:41 EST 2012


On Sat, 11 Feb 2012 18:52:22 +0000
Paul <openboxml023478 at rainslide.net> wrote:

> On Saturday, 11 February, 2012 at 05:16:33 GMT, Andrew Gallant wrote:
> >I wrote something up for you [1].
> 
> Wow. Thanks. I have only Python 2.6 here, so I changed the shebang line accordingly and of course, like every other Python program bar one (Terminator) I've downloaded over the years, it gave an error:
> 
> Traceback (most recent call last):
>    File "./workspace_change", line 3, in <module>
>      import argparse
> ImportError: No module named argparse
> 
> I am a programmer but not of Python. I've given up on even trying anything written in Python, because 99% of them give a similar error. Having said that, I gave yours a whirl because of the effort you went to. Thanks again.
> 


Hi,

as a programmer it will probably be not very hard for you to write a program yourself. It actually is very easy to set the desktop names.
The only thing you need to do is to update the variable _NET_DESKTOP_NAMES on the root window. Can be done for static names in approx 8 lines of code.
See http://pastebin.com/W5VF4icw for a C++ example.
Compile it with "g++ $(pkg-config --cflags --libs x11) -o static_desktop_names filename.cpp"
If you do not change the source code, it will set your first and second desktop names to "as" and "df".

If you can code in c++ it shouldn't be very hard to take all input arguments and concatenate them in a \0 separated string.
It will be a bit more complicated if you want to change just one desktop names, Then you first need to get the property from the root window, seperate it into the single names, exchange the one name you're interested in and concatenate it altogether again...

If you wonder what this _NET_DESKTOP_NAMES is, then you can read in the EWMH standard about it.

Cheers and have fun coding
Andreas


More information about the openbox mailing list