X Window

来自百合仙子's Wiki
跳转到导航 跳转到搜索

获取 X Window 信息

  1. 用什么抓图?答: import (ImageMagick). 没有就用 xwd。
  2. 用什么得知一个窗口的 id 和其它信息?答: xwininfo.
  3. 用什么程序监测一个窗口发生的事件?怎么知道按键的 modifier 符号?答: xev
  4. 怎样看到一个窗口的 property?答: xprop
  5. 怎样知道剪贴板里的内容?答: xsel
  6. 怎样知道当前 display 的信息?答: xdpyinfo
  7. 怎样刷新所有窗口的屏幕?答: xrefresh
  8. AutoHotKey? 答: xdotool
  9. X11 connection rejected because of wrong authentication? 答:xauth
  10. 正在运行的窗口管理器是哪个?答: root 窗口的 _NET_SUPPORTING_WM_CHECK 属性所指的窗口的 _NET_WM_NAME 属性[1]
  11. 谁在使用 X 的内存?答:xrestop

配置文件

/etc/X11/Xwrapper.configallowed_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

参见

外部链接

参考资料