how can i set widgets on the bottom on desktop?
not on top, under all other windows. on linux
and if it somebody knows, how can i get the desktop wallet?
or how can i grab a virtual Desktop, which only has the desktop wallet?
how can i set widgets on the bottom on desktop?
not on top, under all other windows. on linux
and if it somebody knows, how can i get the desktop wallet?
or how can i grab a virtual Desktop, which only has the desktop wallet?
Last edited by kernel_panic; 18th August 2007 at 21:36.
how can i use this with Qt? with python.
I can't say about Python but in C++ you could do something like this:
Qt Code:
#include <QApplication> #include <QWidget> #include <QX11Info> #include <X11/Xatom.h> #include <X11/Xlib.h> int main(int argc, char* argv[]) { QWidget widget; widget.setWindowTitle("Bottom"); widget.show(); Atom state = XInternAtom(display, "_NET_WM_STATE", True); Atom below = XInternAtom(display, "_NET_WM_STATE_BELOW", True); XEvent event; event.xclient.type = ClientMessage; event.xclient.message_type = state; event.xclient.display = display; event.xclient.window = widget.winId(); event.xclient.format = 32; event.xclient.data.l[0] = 1; // turn on event.xclient.data.l[1] = below; event.xclient.data.l[2] = 0l; event.xclient.data.l[3] = 0l; event.xclient.data.l[4] = 0l; (SubstructureRedirectMask | SubstructureNotifyMask), &event); return a.exec(); }To copy to clipboard, switch view to plain text mode
J-P Nurmi
Hi!
Could someone translate this to PyQt?
Thanks in advance.
Cheers.
Gustavo A. DÃ*az
artistic.gdnet.com.ar
I'm no python-xlib export but here's something that should get you pretty close
Qt Code:
import sys from PyQt4 import QtGui from Xlib import X, display, protocol widget.setWindowTitle("Bottom") widget.show() disp = display.Display() state = disp.intern_atom("_NET_WM_STATE") below = disp.intern_atom("_NET_WM_STATE_BELOW") data = [1, below, 0, 0, 0] event = protocol.event.ClientMessage( window = widget.winId(), client_type = state, data = (32, data)) disp.send_event(disp.screen().root, event, (X.SubstructureRedirectMask | X.SubstructureNotifyMask)) sys.exit(app.exec_())To copy to clipboard, switch view to plain text mode
Last edited by jpn; 15th September 2007 at 10:30. Reason: spelling error
J-P Nurmi
kernel_panic (4th October 2007)
Hi!!
First thanks to translate it to Python language.
Second, this code does absolutely nothing, but if i change the import Xlib line as:
from Xlib import X
from Xlib.protocol import display
from Xlib.protocol.request import *
I get this error:
state = display.intern_atom("_NET_WM_STATE")
AttributeError: Display instance has no attribute 'intern_atom'
My code:
Just in case, the full code is in here: http://opencoffee.lnxteam.org/trac/b...ncoffee-clientif __name__ == "__main__":
app = QtGui.QApplication(sys.argv)
app.setQuitOnLastWindowClosed(False)
mainApp = OpenCoffee_Client()
mainApp.show()
## Colocamos la aplicación por debajo de las demás ventanas y eliminamos la entrada en el taskbar.
## Para esto es necesario usar las caracterÃ*sticas del servidor X, importando la librerÃ*a xlib de python.
## TODO: seguir trabajando en esto
display = display.Display(":0")
state = display.intern_atom("_NET_WM_STATE")
placeBelow = display.intern_atom("_NET_WM_STATE_BELOW")
hideTaskbar = display.intern_atom("_NET_WM_STATE_SKIP_TASKBAR")
data = [1, placeBelow, hideTaskbar, 0, 0]
event = protocol.event.ClientMessage(window = mainApp.winId(), client_type = state, data = (32, data))
disp.send_event(disp.screen().root, event, (X.SubstructureRedirectMask | X.SubstructureNotifyMask))
sys.exit(app.exec_())
Gustavo A. DÃ*az
artistic.gdnet.com.ar
Bookmarks