You are not logged in.

#1 2009-03-19 08:44:28

the.armageddon
Member
From: germany
Registered: 2009-02-10
Posts: 13

No panel, just current deskname

Hello Boys and Girls..


I'm still in progress theming my system. At the time, I'm using a pypanel, cause of its simplicity.
But it is far too much information for me. I only want a little text at the bottom-rigth of the desktop (the windows in fullscreen gaps this area, so it is definitly seen) which displays the current desktopname.

This is the only information I wan't and need to have on the screen.

I searched for aDesklets wich shows this information, but didnt find any. I also searched for a way to get the current desk via some bash-hacks. I'm using openboxWM.

The fastest thing would be a little C-App which pastes the name to stdout. This can then be used by conky or a similiar application.

Is it heavy to get this information via C or bash? Or is there even a proper solution made allready?

Hope someone knows.   wink


Sincerely, arma

Offline

#2 2009-03-19 08:57:36

bavardage
Member
Registered: 2008-02-17
Posts: 160

Re: No panel, just current deskname

You'd need xlib and read the value of
_NET_WM_CURRENT_DESKTOP and _NET_WM_DESKTOP_NAMES from the root window
http://standards.freedesktop.org/wm-spe … #id2506278

Offline

#3 2009-03-19 09:01:23

the.armageddon
Member
From: germany
Registered: 2009-02-10
Posts: 13

Re: No panel, just current deskname

Hmm, thank you.

Is the usage of the given lib simple, did you ever use it?

I've currently no time to test the code, perhaps in the evening (I'm @ work).


Thank you for reply, arma..

Offline

#4 2009-03-19 13:01:58

Joe_Arch
Member
Registered: 2008-11-27
Posts: 67

Re: No panel, just current deskname

2 thoughts.

1) Conky may be able to do that. Might want to look it up in Conky's list of variables.

2) I may be getting my config files confused, but doesn't pypanel let you order the appearance of the clock, taskbar, etc, by having a section where you put a 1 by what you want at the leftmost, and a 5 at the rightmost? If so, have you tried putting a 0 for every element you don't want, leaving just the desktop name?


That's all I got.

Offline

#5 2009-03-19 19:47:53

bavardage
Member
Registered: 2008-02-17
Posts: 160

Re: No panel, just current deskname

I have used the python bindings for xlib - it's not too tricky but just may take a little getting used to.. I'll see if I can bodge up a script now quickly.

Offline

#6 2009-03-19 19:48:08

Tenken
Member
Registered: 2008-02-01
Posts: 126

Re: No panel, just current deskname

Visibility is an app that you might want to take a look at.

Offline

#7 2009-03-19 20:03:55

bavardage
Member
Registered: 2008-02-17
Posts: 160

Re: No panel, just current deskname

Script made - just prints current desktop name to stdout.

#!/usr/bin/env python
from Xlib import display, Xatom
dsp = display.Display()
rootwin = dsp.screen().root

DESKTOP_NAMES = dsp.intern_atom("_NET_DESKTOP_NAMES")
CURRENT_DESKTOP = dsp.intern_atom("_NET_CURRENT_DESKTOP")

def get_names():
    names = rootwin.get_full_property(DESKTOP_NAMES, 0)
    names = names.value.split("\x00")
    return names

def current_desktop():
    return rootwin.get_full_property(CURRENT_DESKTOP, 
                                     Xatom.CARDINAL
                                     ).value[0]

try:
    print get_names()[current_desktop()]
except:
    print "error getting name"

Offline

Board footer

Powered by FluxBB