X Window
跳转到导航
跳转到搜索
获取 X Window 信息
- 用什么抓图?答: import (ImageMagick). 没有就用 xwd。
- 用什么得知一个窗口的 id 和其它信息?答: xwininfo.
- 用什么程序监测一个窗口发生的事件?怎么知道按键的 modifier 符号?答: xev
- 怎样看到一个窗口的 property?答: xprop
- 怎样知道剪贴板里的内容?答: xsel
- 怎样知道当前 display 的信息?答: xdpyinfo
- 怎样刷新所有窗口的屏幕?答: xrefresh
- AutoHotKey? 答: xdotool
- X11 connection rejected because of wrong authentication? 答:xauth
- 正在运行的窗口管理器是哪个?答: root 窗口的
_NET_SUPPORTING_WM_CHECK
属性所指的窗口的_NET_WM_NAME
属性[1] - 谁在使用 X 的内存?答:xrestop
配置文件
/etc/X11/Xwrapper.config
中 allowed_users=console
指定只允许从控制台启动X。改为anybody允许任何人启动X。
文件 /etc/gdm/custom.conf
包含了一些对gdm的设置,在其中 [security]
段加入 DisallowTCP=false
可使 X server 监听 TCP 端口。
各种配置
mousekeys
从2011年3月左右开始,mousekeys 默认被禁用。要启用之,使用如下 xorg.conf
配置[2]
Section "InputClass" Identifier "Keyboard" MatchIsKeyboard "yes" Option "XkbOptions" "keypad:pointerkeys" EndSection
使用方法参见 Wikipedia: Mouse keys。
也可以使用 xkbset 命令来启用/禁用。
TrackPoint 滚动
通常,使用以下配置即可[3]
Section "InputClass" Identifier "Trackpoint Wheel Emulation" MatchProduct "TPPS/2 IBM TrackPoint|DualPoint Stick|Synaptics Inc. Composite TouchPad / TrackPoint|ThinkPad USB Keyboard with TrackPoint|USB Trackpoint pointing device|Composite TouchPad / TrackPoint" MatchDevicePath "/dev/input/event*" Option "EmulateWheel" "true" Option "EmulateWheelButton" "2" Option "Emulate3Buttons" "false" Option "XAxisMapping" "6 7" Option "YAxisMapping" "4 5" EndSection
如果 MatchProduct
不对,使用如下命令来查询:
find /dev/input/event* -exec udevadm info --attribute-walk --name={} \; | grep -e product -e name | sort -u
此配置将导致无法使用中键拖动。
给指定键盘指定布局
Section "InputClass" Identifier "KBTalking Race Keyboard" MatchIsKeyboard "on" MatchUSBID "04d9:0132" Option "XkbLayout" "us2" EndSection
授权
XAUTHORITY
环境变量用于指定授权文件。gdm启动时会指定,ssh使用X11转发时会使用不同的授权文件,因此从gdm会话中无法使用在ssh会话中的 X Display。改变此环境变量即可。
参见 xauth。
参见
- xhost
- Xlib
- xinput
- Xephyr
- xmove,虚拟 X server,如同screen那样支持移动窗口到不同的 X server。不过并不好用,测试发现移动后的程序会无响应
- Wayland
外部链接
- 多头多尾的Linux | K.I.S.S
- Linux 和 Xdmx 的分布式多线程支持
- 王垠: 理解 Xwindow
- Inter-Client Communication Conventions Manual
- Chris's Wiki :: The old-fashioned and modern ways to remap keys in X (some notes)
- X Selections, X Cut Buffers, and Emacs Kill Rings
- X11: How does “the” clipboard work?
- Chris's Wiki :: Understanding X mouse cursors (and their several layers of history)
- How X Window Managers Work, And How To Write One (Part I), Part II, Part III
- Explanations
- 桌面系統的混成器簡史 - Farseerfc的小窩, X 中的混成器與 Composite 擴展 - Farseerfc的小窩
- Hector Martin: "A bit of (simplified) X history and how we got here." - Treehouse Mastodon: Asahi Linux 开发者谈 X11 图形驱动的历史包袱。