xset (更改 X 窗口系统的用户设置)

瑞兹 发表于 2020-12-27 01:14
浏览次数:
在手机上阅读

在类似 Unix 一样操作系统上,xset命令将更改 X 窗口系统的用户设置。您可以使用xset 更改GUI 的基本特征,包括鼠标和键盘的行为方式,以及用于 X 会话的显示方式。

查看英文版

目录

1 xset 运行系统环境

2 xset 语法

3 xset 例子

xset 运行系统环境

Unix&Linux

xset 语法

xset [-display display] [-b] [b {on|off}] [b [volume [pitch [duration]]]] 
     [-bc] [bc] [-c] [c {on|off}] [c [volume]] [+dpms] [-dpms] 
     [dpms standby [ suspend [ off]]] [dpms force {standby|suspend|off|on}] 
     [fp=pathlist] [-fp=pathlist] [+fp=pathlist] [fp-pathlist] [fp+pathlist] 
     [fp default] [fp rehash] [-led [integer|named indicator]] 
     [led [integer|named indicator]] [led {on|off}] 
     [mouse [accel_mult[/accel_div] [threshold]]] [mouse default] 
     [p pixel color] [-r [keycode]] [r [keycode]] [r {on|off}] 
     [r rate delay [rate]] [s [length [period]]] [s {blank|noblank}] 
     [s {expose|noexpose}] [s {on|off}] [s default] [s activate] [s reset] [q]

选项

-display display 此选项指定要使用的服务器;请参阅X命令。
b b选项控制钟音量、音调和持续时间。此选项接受最多三个数值参数,前一个破折号("-"),或"on/off"标志如果未给出任何参数,或者使用"on"标志,则将使用系统默认值。如果给出破折号或"off",钟将关闭。如果只给出一个数值参数,则钟音量将设置为该值,占其最大值的百分比。同样,第二个数值参数以赫兹为单位指定钟音高,第三个数值参数指定持续时间(以毫秒为单位)。请注意,并非所有硬件都可以更改铃形特征。X 服务器将尽可能密切地根据用户的规格设置铃的特性。
bc 如果可能,bc选项控制服务器中的 Bug 兼容性模式;前面的破折号("-") 禁用模式,否则模式已启用。各种预发布 4 客户端在某些协议请求中传递非法值,并且 R4 前服务器在这些情况下未正确生成错误。此类客户端在针对 R4 服务器运行时,将异常终止或以其他方式无法正常运行。Bug 兼容性模式显式将某些 Bug 重新引入 X 服务器,以便仍然可以运行许多此类客户端。应小心使用此模式;新的应用程序开发应该使用禁用此模式完成。服务器必须支持 MIT-SUNDRY-非标准协议扩展才能使此选项正常工作。
C c选项控制键单击。此选项可以包含可选值、前面的破折号("-"),或"on/off"标志。如果未给出任何参数或"on"标志,则将使用系统默认值。如果使用破折号或"off"标志,则将禁用键单击。如果给出从0100的值,则它用于指示卷,作为最大值的百分比。X 服务器将卷设置为硬件可以支持的最近值。
- dpms -dpms 选项禁用 DPMS (能量星) 功能.
\dpms +dpms 选项启用 DPMS(能源之星)功能。
dpms flags... dpms选项允许设置 DPMS(能量星)参数。该选项最多可以采用三个数值,或"force"标志后跟 DPMS 状态。"force"标志强制服务器立即切换到指定的 DPMS 状态。DPMS 状态可以是 "standby","suspend", "off" 或 "on "给出数值时,它们在激活三种模式之前设置非活动周期(以秒为单位)。给出的第一个值用于"待机"模式,第二个值用于"挂起"模式,第三个值用于"关闭"模式。隐式设置这些值可启用 DPMS 功能。值为 0 将禁用特定模式。
fp =path... 设置路径参数中给出的条目的字体路径。条目由服务器解释,而不是由客户端解释。它们通常是目录名称或字体服务器名称,但解释与服务器相关。
fp default 默认参数会导致字体路径重置为服务器的默认值。
fp rehash rehash参数将字体路径重置为当前值,导致服务器重新读取当前字体路径中的字体数据库。此选项通常仅在向字体目录添加新字体时使用(在运行mkfontdir 重新创建字体数据库后)。
- fp or fp - -fp 和 fp -选项从当前字体路径中删除元素。它们后面必须跟一个逗号分隔的条目列表。
[fp or fp] [fpfp]选项分别预附和追加元素到当前字体路径。它们后面必须跟一个逗号分隔的条目列表。
led 选项控制键盘LEDs。这将控制一个或所有 LED 的打开或关闭。它接受一个可选的整数,一个前面的破折号("-")或一个"on/off"标志。如果未给出任何参数或"on"标志,则所有 LED 指示灯都已打开。如果给出前面的破折号或标志 "off",则所有 LED 指示灯都已关闭。如果给出介于132之间的值,则该 LED 将打开或关闭,具体取决于是否存在前面的破折号。[xset led 3]将#3打开。[xset - led 3]会关闭它。特定的 LED 值可能是指不同硬件上的不同 LED。如果 X 服务器支持 XKEYBOARD (XKB) 扩展,则 XKB 指标名称可以通过指定"named"关键字和指示器名称来引用前置。例如,要打开滚动锁定指示灯:

xset led named "Scroll Lock"
mouse m 选项控制鼠标参数;它可以缩写为[m]。当然,它适用于大多数指针设备,而不仅仅是鼠标。指针装置的参数是"加速"和"阈"。加速度可以指定为整数,也可以指定为简单分数。阈值只是一个整数。该设置将应用于所有连接的指针设备。如果您需要特定于设备的设置,应使用xinput。

默认情况下,指针(指向设备的屏幕表示形式)在 10 ms内传输速度超过"""mickey"(即指定像素)时,速度将"加速"速度,包括一个小过渡范围。这样,指向设备在移动缓慢时可用于精确对齐,但可以根据需要设置为轻拂手腕在屏幕上移动。可以省略 m 选项的个或两个参数,但如果只给出一个参数,则该参数将被解释为加速度。如果未使用任何参数或标志"默认",则将设置系统默认值。

如果提供"threshold"参数且为0,"acceleration"参数将用于更自然、更连续的公式的指数,对慢动作的精确控制,但对快动作的覆盖范围大,以及两者之间运动的渐进过渡。在这种情况下,建议的"acceleration"值为 3/2 or 3,但不限于该范围。

在 X Server 1.6 及更上面,到目前为止描述的行为链接到默认配置文件。还有其他配置文件(即从设备速度确定指针加速的函数)和其他设置,因此上述描述可能不适用于非默认情况。在 X 服务器 1.7 中,这些属性可用作输入设备属性。

p p选项控制像素颜色值。参数是十进制中的颜色映射条目编号和颜色规格。根背景颜色可以通过更改黑像素和白像素的条目来更改某些服务器上的根背景颜色。虽然这些通常是01,但它们不一定是。此外,服务器可以选择私下分配这些颜色,在这种情况下将生成错误。地图条目不能是只读的颜色,否则将导致错误。
r 选项控制自动重复。调用[-r],[r off], 将禁用自动重复, 而[r],[r on]将启用自动重新回复。在"-r""r"选项之后,整数键码介于 0255之间,将分别禁用或启用该键上的自动重复,但仅对特定键码有意义时。低于8 的密钥码通常不适用于此命令。示例:"xset -r 10"将禁用 IBM PC 键盘顶行"1"键的自动重复。如果服务器支持 XFree86-Misc 扩展或 XKB 扩展,则接受"速率"参数,后跟零、一个或两个数值。

第一个指定自动重复开始前的延迟,第二个指定重复速率。如果服务器支持 XKB 扩展,则延迟是自动重复开始前的毫秒数,速率是秒重复数。如果未给出速率或延迟,则将设置为默认值。
s s选项允许您设置屏幕保护程序参数。此选项最多接受两个数值参数,一个"blank/noblank"标志,一个"expose/noexpose"标志,一个"on/off"标志,一个"activate/reset"标志,或"default"标志。如果未使用任何参数或"默认"标志,系统将设置为其默认屏幕保护程序特征。"on/off"标志打开或关闭屏幕保护程序功能。即使屏幕保护程序已关闭,"激活"标志也强制激活屏幕保护程序。如果"reset"标志处于活动状态,则强制停用屏幕保护程序。"blank"标志将首选项设置为空白视频(如果硬件可以这样做),而不是显示背景模式,而"noblank"将首选项设置为显示模式而不是空白视频。"expose"标志设置首选项以允许窗口曝光(服务器可以自由丢弃窗口内容),而"noexpose"设置首选项以禁用屏幕保护程序,除非服务器可以在不导致曝光事件的情况下重新生成屏幕。屏幕保护程序功能的长度和周期参数确定服务器必须处于非活动状态以激活屏幕的时间长度,以及更改背景模式以避免在屏幕上刻录的时间段。参数以秒为单位指定。如果只给出一个数值参数,则它将用于长度。
q 选项提供有关当前设置的信息。

当您注销时,这些设置将重置为默认值。

xset [-display display] [-b] [b {on|off}] [b [volume [pitch [duration]]]] 
     [-bc] [bc] [-c] [c {on|off}] [c [volume]] [+dpms] [-dpms] 
     [dpms standby [ suspend [ off]]] [dpms force {standby|suspend|off|on}] 
     [fp=pathlist] [-fp=pathlist] [+fp=pathlist] [fp-pathlist] [fp+pathlist] 
     [fp default] [fp rehash] [-led [integer|named indicator]] 
     [led [integer|named indicator]] [led {on|off}] 
     [mouse [accel_mult[/accel_div] [threshold]]] [mouse default] 
     [p pixel color] [-r [keycode]] [r [keycode]] [r {on|off}] 
     [r rate delay [rate]] [s [length [period]]] [s {blank|noblank}] 
     [s {expose|noexpose}] [s {on|off}] [s default] [s activate] [s reset] [q]

Options

-display display This option specifies the server to use; see the X command.
b The b option controls bell volume, pitch and duration. This option accepts up to three numerical parameters, a preceding dash("-"), or a "on/offflag. If no parameters are given, or the "on" flag is used, the system defaults will be used. If the dash or "off" are given, the bell will be turned off. If only one numerical parameter is given, the bell volume will be set to that value, as a percentage of its maximum. Likewise, the second numerical parameter specifies the bell pitch, in hertz, and the third numerical parameter specifies the duration in milliseconds. Note that not all hardware can vary the bell characteristics. The X server will set the characteristics of the bell as closely as it can to the user's specifications.
bc The bc option controls bug compatibility mode in the server, if possible; a preceding dash("-") disables the mode, otherwise the mode is enabled. Various pre-Release 4 clients pass illegal values in some protocol requests, and pre-R4 servers did not correctly generate errors in these cases. Such clients, when run against an R4 server, will terminate abnormally or otherwise fail to operate correctly. Bug compatibility mode explicitly reintroduces certain bugs into the X server, so that many such clients can still be run. This mode should be used with care; new application development should be done with this mode disabled. The server must support the MIT-SUNDRY-NONSTANDARD protocol extension for this option to work.
c The c option controls key click. This option can take an optional value, a preceding dash("-"), or an "on/off" flag. If no parameter or the "on" flag is given, the system defaults will be used. If the dash or "off" flag is used, keyclick will be disabled. If a value from 0 to 100 is given, it is used to indicate volume, as a percentage of the maximum. The X server will set the volume to the nearest value that the hardware can support.
-dpms The -dpms option disables DPMS (Energy Star) features.
+dpms The +dpms option enables DPMS (Energy Star) features.
dpms flags... The dpms option allows the DPMS (Energy Star) parameters to be set. The option can take up to three numerical values, or the "force" flag followed by a DPMS state. The "force" flags forces the server to immediately switch to the DPMS state specified. The DPMS state can be one of "standby", "suspend", "off", or "on". When numerical values are given, they set the inactivity period (in units of seconds) before the three modes are activated. The first value given is for the "standby" mode, the second is for the "suspend" mode, and the third is for the "off" mode. Setting these values implicitly enables the DPMS features. A value of zero disables a particular mode.
fp=path,... Sets the font path to the entries given in the path argument. The entries are interpreted by the server, not by the client. Typically they are directory names or font server names, but the interpretation is server-dependent.
fp default The default argument causes the font path to be reset to the server's default.
fp rehash The rehash argument resets the font path to its current value, causing the server to reread the font databases in the current font path. This option is generally only used when adding new fonts to a font directory (after running mkfontdir to recreate the font database).
-fp or fp- The -fp and fp- options remove elements from the current font path. They must be followed by a comma-separated list of entries.
+fp or fp+ This +fp and fp+ options prepend and append elements to the current font path, respectively. They must be followed by a comma-separated list of entries.
led The led option controls the keyboard LEDs. This controls the turning on or off of one or all of the LEDs. It accepts an optional integer, a preceding dash("-") or an "on/off" flag. If no parameter or the "on" flag is given, all LEDs are turned on. If a preceding dash or the flag "off" is given, all LEDs are turned off. If a value between 1 and 32 is given, that LED will be turned on or off depending on the existence of a preceding dash. The "xset led 3" would turn led #3 on. The "xset -led 3" would turn it off. The particular LED values may refer to different LEDs on different hardware. If the X server supports the XKEYBOARD (XKB) extension, leds may be referenced by the XKB indicator name by specifying the "named" keyword and the indicator name. For example, to turn on the Scroll Lock LED:

xset led named "Scroll Lock"
mouse The m option controls the mouse parameters; it may be abbreviated to "m". Of course, it applies to most pointing devices, not just mice. The parameters for the pointing device are "acceleration" and "threshold". The acceleration can be specified as an integer, or as a simple fraction. Threshold is just an integer. The setting is applied to all connected pointing devices. xinput should be used if you need device-specific settings.

By default, the pointer (the on-screen representation of the pointing device) will go "acceleration" times as fast when the device travels more than "threshold" "mickeys" (i.e. would-be pixels) in 10 ms, including a small transition range. This way, the pointing device can be used for precise alignment when it is moved slowly, yet it can be set to travel across the screen in a flick of the wrist when desired. One or both parameters for the m option can be omitted, but if only one is given, it will be interpreted as the acceleration. If no parameters or the flag 'default' is used, the system defaults will be set.

If the "threshold" parameter is provided and is 0, the "acceleration" parameter will be used in the exponent of a more natural and continuous formula, giving precise control for slow motion but big reach for fast motion, and a progressive transition for motions in between. Recommended "acceleration" value in this case is 3/2 to 3, but not limited to that range.

In X Server 1.6 and above, the behaviour described so far is linked to the default profile. There are other profiles (i.e. functions determining pointer acceleration from device velocity) and additional settings, so the above description may not apply to non-default cases. In the X Server 1.7, these are available as input device properties.

p The p option controls pixel color values. The parameters are the color map entry number in decimal, and a color specification. The root background colors may be changed on some servers by altering the entries for BlackPixel and WhitePixel. Although these are often 0 and 1, they need not be. Also, a server may choose to allocate those colors privately, in which case an error will be generated. The map entry must not be a read-only color, or an error will result.
r The r option controls the autorepeat. Invoking with "-r", or "r off", will disable autorepeat, whereas "r", or "r on" will enable autorepeat. Following the "-r" or "r" option with an integer keycode between 0 and 255 will disable or enable autorepeat on that key respectively, but only if it makes sense for the particular keycode. Keycodes below 8 are not typically valid for this command. Example: "xset -r 10" will disable autorepeat for the "1" key on the top row of an IBM PC keyboard.

If the server supports the XFree86-Misc extension, or the XKB extension, then a parameter of "rate" is accepted and should be followed by zero, one or two numeric values. The first specifies the delay before autorepeat starts and the second specifies the repeat rate. In the case that the server supports the XKB extension, the delay is the number of milliseconds before autorepeat starts, and the rate is the number of repeats per second. If the rate or delay is not given, it will be set to the default value.
s The s option lets you set the screen saver parameters. This option accepts up to two numerical parameters, a "blank/noblank" flag, an "expose/noexpose" flag, an "on/off" flag, an "activate/reset" flag, or the "default" flag. If no parameters or the "default" flag is used, the system will be set to its default screen saver characteristics. The "on/off" flags turn the screen saver functions on or off. The "activate" flag forces activation of screen saver even if the screen saver had been turned off. The "reset" flag forces deactivation of screen saver if it is active. The "blank" flag sets the preference to blank the video (if the hardware can do so) rather than display a background pattern, while "noblank" sets the preference to display a pattern rather than blank the video. The "expose" flag sets the preference to allow window exposures (the server can freely discard window contents), while "noexpose" sets the preference to disable screen saver unless the server can regenerate the screens without causing exposure events. The length and period parameters for the screen saver function determines how long the server must be inactive for screen saving to activate, and the period to change the background pattern to avoid burn in on the screen. The arguments are specified in seconds. If only one numerical parameter is given, it will be used for the length.
q The q option gives you information on the current settings.

These settings will be reset to default values when you log out.

查看英文版

查看中文版

xset 例子

xset q

显示所有当前 X 窗口系统首选项的值。

xset q

Display the values of all current X Window System preferences. 

查看英文版

查看中文版

其他命令行

xfd | xargs | xhost | xinit | xlsfonts | xrdb |

如此好文,分享给朋友
发表评论
验证码:
评论列表
共0条