xorg

Is there a simple way to detect mouse or keyboard activity in Linux/Xorg/Qt4/Kde4?

左心房为你撑大大i 提交于 2019-12-10 06:15:10
问题 Is there a simple way to detect mouse or keyboard activity in Linux or Xorg or Qt4 or Kde4 environment? Obviously not only on a particular window but in the entire Xorg desktop. 回答1: You can use the XScreenSaver extension ( man Xss ). It can provide you with values into this struct using the function XScreenSaverQueryInfo : typedef struct { Window window; /∗ screen saver window */ int state; /∗ ScreenSaver{Off,On,Disabled} */ int kind; /∗ ScreenSaver{Blanked,Internal,External} */ unsigned

Setting color brightness on Linux/Xorg

我怕爱的太早我们不能终老 提交于 2019-12-10 05:16:56
问题 Is there any command (or API) to set X.Org/Linux color brightness? In other words, I need something as handy as the xgamma command but for changing RGB brightness real-time . Is this possibile? 回答1: Use the XF86VidMode* family of functions. #include <X11/Xlib.h> #include <X11/extensions/xf86vmode.h> #include <math.h> #include <stdio.h> #include <stdlib.h> #include <unistd.h> int main() { Display *display; int screen; int major, minor; int i; XF86VidModeGamma orig; display = XOpenDisplay(NULL)

How to monitor changes to an arbitrary widget?

限于喜欢 提交于 2019-12-09 23:14:45
问题 I am starting a QT5 application with a rather complex design based on Qt Widgets. It runs on Beagleboard with a touchscreen. I will have a rather weird local invention instead of the LCD display. It's a laser painting on acrylic plate. It has no driver yet. To actually update a screen I must create a screenshot of the window as bitmap, turn it to grayscale and feed to a proprietary library, which will handle the laser. It should look cute, when ready. Unfortunately, the laser blinks on update

How to start linux with gui without monitor? [closed]

冷暖自知 提交于 2019-12-08 13:52:35
Closed. This question is off-topic . It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 7 years ago . I met a problem. I had a server which is installed redhat enterprise 5.5. And one Qt program was running on this server. So what I should do is to turn on my server, the server will start automaticly with Gui and that Qt program will start automaticly. I finished all on my desktop. But while I start this server without monitor, we know server was running without monitor,the X server go bad.God, what should I do?

Get X window id from process in bash

做~自己de王妃 提交于 2019-12-08 01:14:21
问题 Is there any bash tool/warper that could tell which x window(s) has been created by specific process ? 回答1: wmctrl -lp gives me the windows and their PIDs. Sample output: 0x04c00022 0 2168 ciro ciro.santilli - Skype™ 0x03c00014 0 2154 ciro Krusader 0x03200022 0 2181 ciro Guake! ... 回答2: As mentioned, you can use command line tools like wmctrl or xprop . Well behaved clients should set _NET_WM_PID property to be pid of the process which created main window (all popular toolkits do this for you

Why are some setxkbmap options ignored?

丶灬走出姿态 提交于 2019-12-06 13:28:58
in share/X11/xkb/rules/evdev/lst, I find this set of options for ctrl ctrl Ctrl key position ctrl:nocaps Caps Lock as Ctrl ctrl:lctrl_meta Left Ctrl as Meta ctrl:swapcaps Swap Ctrl and Caps Lock ctrl:ac_ctrl At left of 'A' ctrl:aa_ctrl At bottom left ctrl:rctrl_ralt Right Ctrl as Right Alt ctrl:menu_rctrl Menu as Right Ctrl ctrl:ctrl_ralt Right Alt as Right Ctrl ctrl:swap_lalt_lctl Swap Left Alt key with Left Ctrl key ctrl:swap_lwin_lctl Swap Left Win key with Left Ctrl key ctrl:swap_lalt_lctl_lwin Left Alt as Ctrl, Left Ctrl as Win, Left Win as Alt Some of them work - if I run setxkbmap

X11 modal dialog

霸气de小男生 提交于 2019-12-06 11:53:35
How can I create a modal dialog in X11 using Xlib? A modal dialog is a a window that stays on top of other windows of the app (like transient windows do) and also refuses to give focus to other windows of the app. In Windows, modality is also signaled by flashing the titlebar of the modal window when trying to steal the focus from it. Thanks. You need to set _NET_WM_STATE property (which is of type "atom list") to include _NET_WM_STATE, see references to _NET_WM_STATE in EWMP spec (also need to set WM_TRANSIENT_FOR correctly) 来源: https://stackoverflow.com/questions/31779316/x11-modal-dialog

What is the fastest way to draw a 2D array of color triplets on screen?

柔情痞子 提交于 2019-12-05 18:56:32
问题 The target language is C/C++ and the program has only to work on Linux, but platform independent solutions are preferred obviously. I run Xorg, XVideo and OpenGL are available. How many FPS can I expect on 1024x768 on an Intel Core 2 Duo with Intel graphics? (ONLY drawing counts, consider the arrays to be ready in RAM; no precise prognosis needed) 回答1: The fastest way to draw a 2D array of color triplets: Use float ( not byte, not double) storage. Each triplet consists of 3 floats from 0.0 to

Draw on top of the screen using xlib

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-05 10:54:21
I want to draw some primitives on top of all windows on the screen. I've found some code in C and tried to port it to use python's xlib: from Xlib.display import Display from Xlib import X from Xlib import protocol display = Display(':0') root = display.screen().root gc = root.create_gc() root.fill_rectangle(gc, 100, 100, 500, 500) But nothing appears on the screen (however, the root window is assigned: grabbing keyboard after it works). How to do this correctly? Andrey Sidorov You can draw on root window - your code probably works, but root window may be obscured by some kind of desktop