x11

How to use xmonad in portrait mode/orientation?

谁说我不能喝 提交于 2019-12-11 12:49:31
问题 How does one use xmonad with the physical screens in portrait orientation? I have two physical displays and they are both rotated 90 degrees to the right (clockwise with original bottom edges on the left) I'm on Fedora 21 (3.19.3-200.fc21.x86_64) I don't know how to tell what window manager is running, but there's a gnome-shell process running... When I sudo telinit 3 and then startx , xmonad comes up with everything in landscape orientation. I don't know how to change it at that point and I

I want to determine the cause of a sigsegv

谁说我不能喝 提交于 2019-12-11 12:37:41
问题 I'm writing an applicaiton for gentoo linux and redhat linux, one of the funciton always crashes on the redhat machine usleep(100000); Display *display; display = XOpenDisplay(NULL); Window w; int x,y,i; unsigned m; Window root = XDefaultRootWindow(display); XQueryPointer(display,root,&root,&w,&x,&y,&i,&i,&m); XImage *image; sleep(1); image = XGetImage(display,root,0,0,1366,768,AllPlanes,XYPixmap); int pixel = XGetPixel(image,x,y); printf("\\clr(%i,%i,%i){}\n",x,y,pixel); XCloseDisplay

Linux X11 C Want to know pointer motion anywhere on screen

可紊 提交于 2019-12-11 12:35:51
问题 I want to write a small window program that will display the pointer position (and other info) anywhere on the screen. I do not want to disrupt the normal use of the mouse in all the other programs running. Is there a way to "hook" pointer motion events, or how can I set up a timer event for polling the pointer position in my event loop? 回答1: I'd like to point you at the Xautolock code queryPointer function, which figures out the mouse position. If you dig around in main.c and diy.c , you

libX11: XPutImage first call

不羁岁月 提交于 2019-12-11 12:33:43
问题 I've created XImage using XCreateImage and use XPutImage to display it on window, but XPutImage shows this picture only on second call of it. Why this happens? #include <stdio.h> #include <stdlib.h> #include <unistd.h> #include <X11/Xlib.h> #include <X11/Xutil.h> void draw(char *rgb_out, int w, int h) { int i = 0; for (i = 0;i < w*h;i += 4) { rgb_out[i + 1] = 0; rgb_out[i + 2] = 0; rgb_out[i + 3] = 0; } return; } XImage *create_ximage(Display *display, Visual *visual, int width, int height) {

How to use Skype Desktop API on a server without a display?

两盒软妹~` 提交于 2019-12-11 12:09:55
问题 I own a vServer and want to run a Skype bot on it. Obviously skype can't start without a display. Is there maybe a command line option for skype to disable the GUI and only use the Desktop API? Or do I have to simulate a X11 display, and if thats the case how could I do that? 回答1: It is easy to set up a virtual X11 display ('server') with Xvfb, like so: Xvfb :1 -screen 0 1280x1024x24 & sleep 3 skype -display :1 & You can even use VNC to see what's happening on the virtual buffer. Note that

During XGrabKey(board), discover which window had been focused

回眸只為那壹抹淺笑 提交于 2019-12-11 11:39:24
问题 A program has called XGrabKey() to make a hotkey. The user presses that key combination (while another window is focused). The program receives control to do something in response to the key combination. Meanwhile, the program has been temporarily focused (because of the effects of XGrabKey (see man XGrabKey , man XGrabKeyboard )). I want the program to create a synthetic X event (a keypress or mouse click) to the originally focused window. In some cases this means I need to focus that window

Retrieve Ubuntu launcher icon

大兔子大兔子 提交于 2019-12-11 11:28:30
问题 Is there a way to retrieve application launcher icon. I tried xprop _NET_WM_ICON command but it returns with _NET_WM_ICON: Not found error. But I can see the icon in System Tray(Launcher). How can we retrieve that icon. Any other method ? 回答1: In Ubuntu/Unity it's defined in application .desktop file, not _NET_WM_ICON. See my related answer and desktop file specification You can associate your window with desktop file by setting _NET_WM_DESKTOP_FILE property 来源: https://stackoverflow.com

How to run R on a server without X11, and avoid broken dependencies

て烟熏妆下的殇ゞ 提交于 2019-12-11 10:23:37
问题 I'm running R 2.9 on a large EC2 Ubuntu instance, loaded with RAM, but without a terminal. When I load a library that has display dependencies, such as the sqldf package, I receive the following error: library(sqldf) ... Loading required package: tcltk Loading Tcl/Tk interface ... Error in fun(...) : couldn't connect to display "localhost:11.0" Error : .onLoad failed in 'loadNamespace' for 'tcltk' Error: package 'tcltk' could not be loaded This seems to be a general problem, and I'm wondering

Does Java work with PCF fonts?

霸气de小男生 提交于 2019-12-11 07:48:52
问题 I am trying to make IBM jre to use PCF fonts from default X11 installation on my linux box. In particular adobe-helvetica font. I have toyed to modify fontconfig.properties in jre/lib folder but no matter what I do Java seams to use some other fonts. I guess there is some algorithm how java VM tries to link java logical fonts to actual physical fonts in the system even in case when font specified in config could not be used. On Windows it is pretty straight forward, but on Linux I was unable