x11

pyplot while using X11 forwarding

被刻印的时光 ゝ 提交于 2019-12-04 19:38:23
I'm trying to setup my remote working environment so that I can use matplotlib.pyplot under ipython. My local machine and remote machine are both MAC OSX Mavericks. I've tried xeyes and it works properly so I think my X11 forwarding works fine. However, when I try functions in matplotlib.pyplot it didn't show any error message but I didn't see any figure either. I know it's about which backend to use and I've tried using ipython --pylab=tk but didn't work. Tried to install pygtk but can't manage to install a dependency py2cairo (seems to be an open issue ). Any other thoughts? Thanks. How did

Releasing all keys after disabling the keyboard in X11/Linux using xinput?

两盒软妹~` 提交于 2019-12-04 18:23:20
On Linux when using X11/Xorg, when you use xinput to disable they keyboard (e.g. xinput set-prop $ID "Device Enabled" 0 ) the 'key-up' event is not send (because you've disabled the keyboard). This is noticable if you enter that command on the command line, it'll act like you're holding 'enter' down. This is because the command (which disables the keyboard) runs before you lift your finger off the enter key. This is discussed in this bug ( https://bugs.launchpad.net/ubuntu/+source/xserver-xorg-input-evdev/+bug/724280 ) and this blog post ( http://blog.yjl.im/2010/12/using-xinput-to-disable

Change X11 window title after emacs started

夙愿已清 提交于 2019-12-04 18:16:41
问题 When I start emacs, I can use the --title= option to control the title of the x-window that holds the emacs application. Is it possible to change the title after emacs starts from elisp? 回答1: M-x set-frame-name NewName RET and from elisp (set-frame-name "NewName") 回答2: I use (setq frame-title-format "%b - emacs") to include the current buffer name in the frame title. 回答3: The following worked for me (GNU EMACS 24.3.1 on cygwin multiwindow X11): (set-frame-parameter frame 'title arg) which I

What does (~0L) mean?

强颜欢笑 提交于 2019-12-04 17:23:34
问题 I'm doing some X11 ctypes coding, I don't know C but need some help understanding this. In the C code below (might be C++ im not sure) we see (~0L) what does that mean? In Javascript and Python ~0 means -1 . 812 int result = GetProperty(window, property_name, 813 (~0L), // (all of them) 814 &type, &format, &num_items, &properties); Thanks 回答1: 0L is a long integer value with all the bits set to zero - that's generally the definition of 0 . The ~ means to invert all the bits, which leaves you

Using ghostscript as x11 viewer (gs x11 viewport positioning)?

非 Y 不嫁゛ 提交于 2019-12-04 16:06:07
I already know about Ghostscript front end viewers; but I was wondering how gs itself could be used for viewing PDF documents? The closest I could get to, is to specify explicitly x11 window as output device, specify width and height of the window via -g , and specify rasterization resolution via -r ; or, a command line like this: gs -sDevice=x11 -g500x500 -r150x150 -dFirstPage=3 fontspec.pdf ... which results with something like: ... which is, in fact, all good - except, it starts at lower left corner; and there are no keyboard shortcuts (as far as I can see) here to move the viewport, or to

Xkb: How to increase the number of KeySyms in the client map of an XkbDescRec keyboard description?

别来无恙 提交于 2019-12-04 15:10:12
I'm trying to programmatically modify some of the properties of my xkb keyboard mapping in X11. In the XkbClientMapRec struct map member of the XkbDescRec struct, we have the following members: typedef struct { /* Client Map */ unsigned char size_types; /* # occupied entries in types */ unsigned char num_types; /* # entries in types */ XkbKeyTypePtr types; /* vector of key types used by this keymap */ unsigned short size_syms; /* length of the syms array */ unsigned short num_syms; /* # entries in syms */ KeySym * syms; /* linear 2d tables of keysyms, 1 per key */ XkbSymMapPtr key_sym_map; /*

Sending Keystrokes to a X Window

可紊 提交于 2019-12-04 13:59:02
I am currently experimenting with xdotool to send keys to a process (I understand that it may not work for all processes that does not set _NET_WM_PID). I have trouble sending keystrokes to windows other from the focus. It does work if you are sending keystrokes to the CURRENTWINDOW . Below is the snippet that I used to test xdotool's functionality. extern "C"{ #include <xdo.h> } //extern "C" xdo_window_search #include <iostream> #include <string.h> using namespace std; int main(){ xdo_t* p_xdo = xdo_new(NULL); // Allocate memory for search query. xdo_search_t s; // Clear the allocated memory.

Why does XGrabKey return BadRequest?

ⅰ亾dé卋堺 提交于 2019-12-04 12:19:11
So I'm working on a Gtk/X11/Linux app that does screen capture to .gif and one of the methods of stopping the capture is a key press (Esc, Space or End). You can also use a timeout. However to implement the key press to end capture I have to be able to grab the key such that I can get an event even though my window doesn't have focus (it's actually invisible during capture). I believe XGrabKey is the right X11 function for this task: Window w = Gtk::gdk_x11_drawable_get_xid(Gtk::gtk_widget_get_window(Handle())); KeyCode kc = XKeysymToKeycode(Gtk::gdk_display, HotKeyCode); int r = XGrabKey( Gtk

How can I change the taskbar icon using XIconifyWindow?

好久不见. 提交于 2019-12-04 11:43:13
I am programming in Linux and am using X11 for my desktop. I would like to change the images of a minimized window in the task bar. I am using Fluxbox. I am currently using XIconifyWindow when the user clicks to minimize a window. How can I control the little square icon in the taskbar when the user minimized it? Thanks. Thank you for your help. The code I'm using to minimize looks something like this: void minWin(Window window, bool yes) const { if(yes) { XIconifyWindow(display, window, DefaultScreen(display)); }else{ XMapWindow(display, window); } } So how would I put in some code to set the

Cannot get XCreateSimpleWindow to open window at the right position

房东的猫 提交于 2019-12-04 11:41:47
The following code opens a window of the right size, w,h, but not at the correct position, x,y. #include <iostream> #include <X11/Xlib.h> #include <X11/Xutil.h> #include <X11/Xresource.h> using namespace std; int main(int argc, char* argv[]){ Display *display; // A connection to X server int screen_number; Window canvas_window; unsigned long white_pixel; unsigned long black_pixel; display = XOpenDisplay(NULL); // Connect X server by opening a display if(!display){ cerr<<"Unable to connect X server\n"; return 1; } screen_number = DefaultScreen(display); white_pixel = WhitePixel(display, screen