x11

How to set up working X11 forwarding on WSL2

隐身守侯 提交于 2020-07-04 06:54:06
问题 When moving from WSL1 to WSL2 many things change; apparently this applies to X11 forwarding as well. What steps do I need to make in order to use X11 forwarding with WSL2 on Windows 10 as I did with WSL1? 回答1: TL;DR: Add the following to your ~/.bashrc : export DISPLAY=$(awk '/nameserver / {print $2; exit}' /etc/resolv.conf 2>/dev/null):0 export LIBGL_ALWAYS_INDIRECT=1 Enable Public Access on your X11 server for Windows.* Add a separate inbound rule for TCP port 6000 to the windows firewall

Is it possible to get active window & executable names in X11/Xlib?

房东的猫 提交于 2020-06-24 14:00:26
问题 After looking at RescueTime for windows/mac, it seems that there's a version for linux but doesn't seem up to date. Also, it's the weekends and I want to spend time playing with X11.. I'm thinking of making a simple productivity-polling app, that every short interval polls the active windows, and intercepts (and passes along) mouse and keyboard presses to measure productivity. Is this possible at all? After checking Xlib I'm at a loss on where to find the binary name of an executable. etc.

x11vnc xopendisplay failed

房东的猫 提交于 2020-06-14 06:34:28
问题 I installed x11vnc and then execute x11vnc but failed following is the error message $x11vnc -display :0 08/05/2017 19:18:22 x11vnc version: 0.9.13 lastmod: 2011-08-10 pid: 7572 08/05/2017 19:18:22 XOpenDisplay(":0") failed. 08/05/2017 19:18:22 Trying again with XAUTHLOCALHOSTNAME=localhost ... 08/05/2017 19:18:22 *************************************** 08/05/2017 19:18:22 *** XOpenDisplay failed (:0) *** x11vnc was unable to open the X DISPLAY: ":0", it cannot continue. *** There may be

X session in Git Bash on Windows?

可紊 提交于 2020-06-10 08:03:12
问题 I'm using Git Bash on Windows. I have used Git Bash to SSH into a UNIX machine and tried to run a program with a GUI. I got the message: LINUX/UNIX system detected, but unable to access X11 display. I have X-Win 32 (commercial). I've also used Xming which is like a free version of X-Win 32 but has problems with certain graphics. Is there a way I can get this remote system to access my X11 display through X-Win 32 or Xming or through any way ? I'd just like to run programs like MATLAB, with a

Linux get notification on focused gui window change

社会主义新天地 提交于 2020-05-10 06:18:48
问题 In linux, is it possible to get notifications when the currently focused GUI app changes? I'm writing an app that tracks how long a user stays on each GUI app(per process, not within one process), and need some way to access this information. I'm doing this in c++. Here is what I have found so far: xprop -id $(xprop -root | awk '/_NET_ACTIVE_WINDOW\(WINDOW\)/{print $NF}') | awk '/_NET_WM_PID\(CARDINAL\)/{print $NF}' This prints out the pid of the currently focused app, but would require me to

Invert the colors of a region in Xlib

不问归期 提交于 2020-04-30 07:34:50
问题 I want to know if it is possible to invert the colors of a region using Xlib. A region may be a rectangular area defined by two co-ordinates (x1, y1 to x2, y2). Below code is the latest modified version of the script that is used to invert a portion of active window, as per suggestions by JvO import Xlib from Xlib import X, display, Xutil d = display.Display() screen = d.screen() bgsize = 20 act_win = d.get_input_focus().focus wmname = act_win.get_wm_name() wmclass = act_win.get_wm_class() if

How can I connect to a Google Compute Engine virtual server with a GUI?

扶醉桌前 提交于 2020-04-09 17:55:21
问题 I am testing a Google Compute Engine, and I created a VM with Ubuntu OS. When I connect to it, by clicking this Connect SSH button, it opens a console window. Is that the connection you get? How do I open a real screen with a GUI on it? I don't want the console. 回答1: Much better solution from Google themselves: https://medium.com/google-cloud/linux-gui-on-the-google-cloud-platform-800719ab27c5 回答2: You need to forward the X11 session from the VM to your local machine. This has been covered in

X Window

好久不见. 提交于 2020-04-03 10:06:26
组成元件 X Server 管理用户端输入输出硬件设备 由Xorg管理 X11等 X Client 应用程序 接收处理X Server传来的信息,产生出图像数据,返回给X Server(响应事件) 图形界面各类应用软件 X Window Manager X Client 管理所有的X Client软件 管理虚拟桌面 提供Window大小,层次,移动等 GNOME KDE XFCE等 Display Manager 提供图形化的登录界面,载入选择的Window Manager gdm 相关命令 startx :找出用户X Server/X Client设定文件,执行xinit 命令行后接参数 使用者设定参数 ~/.xserverrc(X Server),~/.xinitrc(X Client) 系统默认参数 /etc/X11/xinit/xserverrc, /etc/X11/xinit/xinitrc 以获取参数启动xinit xinit :以传入参数实际启动X(Xorg)和X Client(如Xterm) /usr/bin/X(/usr/bin/Xorg) 设定文件:/etc/X11/xorg.conf X Client设定文件 /etc/sysconfig/desktop /etc/X11/xinit/xinitrc* startked gnome-session fc

How can I check in xlib if window exists?

允我心安 提交于 2020-03-22 09:51:26
问题 I am writing c++ library in Linux using gcc. Program opens web pages in new browser windows with system("firefox https://www.webpage.com"); After that I use xlib to determine identifiers of each opened browser window. Then program raises firefox windows one by one using XRaiseWindow(display, window) in order to make a screenshot of each window and OCR. But if I close browser window manually and try to use XRaiseWindow with the corresponding identifier it generates BadWindow error and

Centos 7 X11 Forwarding及X协议组件

情到浓时终转凉″ 提交于 2020-03-09 11:49:51
配置开启sshd的X11 forwarding vi /etc/ssh/sshd_config X11Forwarding yes #开启X11 forwarding X11需要的X协议组件 xorg-x11-xauth #安装x11组件包 wqy-zenhei-fonts #安装中文字库 ibus-libpinyin #安装中文输入法 安装 yum install -y xorg-x11-xauth xorg-x11-utils xorg-x11-fonts-* tab命令补齐组件 bash-completion bash-completion-extras 来源: 51CTO 作者: tankangyue 链接: https://blog.51cto.com/1548269/2476459