x11

Is there a linux command to determine the window IDs associated with a given process ID?

喜欢而已 提交于 2019-11-29 19:33:21
Given a process iD of XX, I'd like to have a list of any window id's where _NET_WM_PID = XX. Even better would be the oldest still active window id if possible. I'm very new to linux, but what I'm trying to do is create a script that would take a command line, and see if there's a windows already open belonging to a process invoked with that same command line. If so, just set focus to that window, otherwise execute the command line to get a new process going. My intention is to use this in my ubuntu desktop, where I'll hook this script into my easystroke mouse gesture commands, so that, for

Building a Window Manager [closed]

╄→尐↘猪︶ㄣ 提交于 2019-11-29 18:47:37
One of my new home projects will be a simple Window Manager, but before start I need to know some things: Which is the best language to do this? Where to get some resources to learn? One important decision is how you're going to talk to the X server. You can use the Xlib bindings for your language of choice, or you can use the higher-level XCB bindings. (If you're insane , you might open a socket to the X server directly.) To know how a window manager ought to behave, there are two documents that specify the conventions and policies: EWMH and ICCCM 1 . Conforming to these means your window

Intercept WM_DELETE_WINDOW on X11?

亡梦爱人 提交于 2019-11-29 17:23:34
问题 I'd like to intercept the WM_DELETE_WINDOW message that is posted to a certain selection of windows that an application I'm writing (AllTray), so that I can act on it instead of the application receiving it. I'm currently looking at trying this at the GDK level via gdk_display_add_client_message_filter if possible, but I'd be happy with an Xlib solution if there is one as well; it seems to be possible, but I just don't seem to be understanding how I am to do it successfully. Currently, I have

Run Java AWT/Swing GUI app in headless server

核能气质少年 提交于 2019-11-29 16:15:20
I have a gateway application that comes up with a login dialog and then a GUI window. I will be running this app on a co-located server without a display. I need to interact with the dialog only when logging in and perhaps to check out the main GUI occasionally. The server is Debian 5.0. The only ideas I have so far are: Tunnel an X session to my desktop for logging in but I'm not sure what will happen if the X session disconnected (ie, I reboot my desktop, etc..) Try to instantiate/launch the app from a wrapper Java application that can hopefully fill out the login dialog or login directly

UBUNTU: XOpenDisplay(NULL) fails when program run in boot sequence via rc.local

房东的猫 提交于 2019-11-29 15:54:16
I have written a program that runs with ROOT permission in Terminal following login but fails when XOpenDisplay(NULL) call is made following reboot. The program is started up via rc.local but doesn't appear to be able to see X11. I need ROOT because I make LibUSB calls and these fail if not ROOT. I can see the program is running with ROOT permission but inspection of environment variables shows DISPLAY not set. I have a delay loop running and checks are made after user login and user can see DISPLAY set in environment variables but program cannot. If program is terminated and run in Terminal

DBus Finch/Pidgin without X11

半腔热情 提交于 2019-11-29 15:42:49
问题 I want to do some Python scripting on my server where I can communicate with finch (A console interface of pidgin , with the interface looking like links2 ) through the DBus Python library to send messages or check for buddy online status. This works if you do it in X. Run finch in an X terminal and run the Python script in another terminal with no errors/exceptions. But if you do it without X , you have to run finch in TTY1 (ctrl+alt+f1) and the python script in TTY2 (ctrl+alt+f2) but the

Screenshots in X11

风格不统一 提交于 2019-11-29 15:32:31
问题 What functions would one use to take a screenshot of an X11 desktop, using the Xlib library? I would prefer a method that's more efficient than getting individual pixels. Thanks. 回答1: The standard tool for taking screenshots in X11 is to use xwd -root > myscreen.xwd Then, convert to .pnm with xwd2pnm myscreen.xwd > myscreen.pnm Therefore, you can locate the source code of xwd and see how it is implemented, http://cvsweb.xfree86.org/cvsweb/xc/programs/xwd/xwd.c?rev=HEAD&content-type=text/vnd

How to create a game loop with xlib

不羁岁月 提交于 2019-11-29 15:31:57
I am trying to create a game loop for an xlib window, but I cannot manage to paint the window correctly. Right now I am creating a window with XCreateSimpleWindow(...), and using a for loop to paint all pixels one at a time. (The color of these pixels is read from a large integer array, for now I've set all pixels to be blue.) The actual game loop right now is the following: void loop() { while (true) { // Clear the window (the background color is set to white) XClearWindow(dsp, win); // Loop through all pixels of the 800*600 window for (int j = 0; j < 600; j++) { for (int i = 0; i < 800; i++)

X11/Xlib: Window always on top

我怕爱的太早我们不能终老 提交于 2019-11-29 15:28:50
问题 A window should stay on top of all other windows. Is this somehow possible with plain x11/xlib? Googling for "Always on top" and "x11" / "xlib" didn't return anything useful. I'd avoid toolkits like GTK+, if somehow possible. I'm using Ubuntu with gnome desktop. In the window menu, there's an option "Always On Top". Is this provided by the X server or the window manager? If the second is the case, is there a general function that can be called for nearly any wm? Or how to do this in an "X11

X11/Xlib: Create “GlassPane”-Window

喜夏-厌秋 提交于 2019-11-29 15:06:03
问题 I've tried to create a fully transparent window using C++ & X11. It should not consume any events and simply forwards them to the windows below. Some kind of GlassPane as it's known for Java-Windows, but full screen. Then I'd like to draw on this window. Is this somehow possible with X11? My first attempt was ignoring all events, simply copy the image from the root window using XGetImage() ... But first of all, this is quite slow as the window would need to be full screen. XShmGetImage