https://wiki.archlinux.org/api.php?action=feedcontributions&user=Beini&feedformat=atomArchWiki - User contributions [en]2024-03-29T13:57:46ZUser contributionsMediaWiki 1.41.0https://wiki.archlinux.org/index.php?title=CPU_frequency_scaling&diff=245035CPU frequency scaling2013-01-25T07:19:47Z<p>Beini: Configure file moved to /etc/default/</p>
<hr />
<div>[[Category:Power management]]<br />
[[Category:CPU]]<br />
[[cs:CPU Frequency Scaling]]<br />
[[de:Cpufrequtils]]<br />
[[el:CPU Frequency Scaling]]<br />
[[es:CPU Frequency Scaling]]<br />
[[fr:Cpufreq]]<br />
[[it:CPU Frequency Scaling]]<br />
[[pt:CPU Frequency Scaling]]<br />
[[ru:CPU Frequency Scaling]]<br />
[[sk:CPU Frequency Scaling]]<br />
[[tr:Işlemci_frekansını_ölçekleme]]<br />
[[zh-CN:CPU Frequency Scaling]]<br />
{{Article summary start}}<br />
{{Article summary text|An overview of the popular userspace tools for the kernel [http://www.kernel.org/pub/linux/utils/kernel/cpufreq/cpufreq-info.html CPUfreq] subsystem.}}<br />
{{Article summary heading|Related}}<br />
{{Article summary wiki|Laptop Mode Tools|Laptop_Mode_Tools}}<br />
{{Article summary wiki|pm-utils}}<br />
{{Article summary wiki|PHC}}<br />
{{Article summary end}}<br />
<br />
{{Accuracy|This article needs cleanup in sections: acpid, laptop-mode-tools, and bios limitations.}}<br />
<br />
cpufreq refers to the kernel infrastructure that implements CPU frequency scaling. This technology enables the operating system to scale the CPU speed up or down in order to save power. CPU frequencies can be scaled automatically depending on the system load, in response to ACPI events, or manually by userspace programs.<br />
<br />
Since kernel 3.4 the necessary modules are loaded automatically and the recommended [[CPU_Frequency_Scaling#Scaling_governors|ondemand governor]] is enabled by default. However, userspace applications like [[#cpupower|cpupower]], [[acpid]], [[laptop-mode-tools]], or GUI tools provided for your desktop environment, may still be used for advanced configuration. <br />
<br />
== Userspace tools (cpupower) ==<br />
{{Pkg|cpupower}} is a set of userspace utilities designed to assist with ''CPU frequency scaling''. The package is not required to use scaling, but is highly recommended because it provides useful command-line utilities and a service to change the governor at boot.<br />
The configuration file for {{Pkg|cpupower}} is located in {{ic|/etc/default/cpupower}}. This configuration file is read by a bash script in {{ic|/usr/lib/systemd/scripts/cpupower}} which is activated by {{ic|systemd}} with {{ic|cpupower.service}}. To enable {{Pkg|cpupower}} on boot with {{Pkg|systemd}}, run<br />
<br />
# systemctl enable cpupower.service<br />
<br />
A frontend for gnome-shell can be found at [https://extensions.gnome.org/extension/444/cpu-freq/ CPU Freq].<br />
<br />
=== CPU frequency driver ===<br />
{{Note|As of kernel 3.4; the native cpu module is loaded automatically}}<br />
<br />
{{Pkg|cpupower}} requires modules (see table below) to know the limits of the native cpu. To see a full list of available modules, run<br />
<br />
$ ls /lib/modules/$(uname -r)/kernel/drivers/cpufreq/<br />
<br />
{{Tip|To load the module at boot, run<br />
{{bc|<nowiki><br />
# echo <module> >/etc/modules-load.d/<module><br />
</nowiki>}}}}<br />
{{Note|Loading the wrong module will result in an error "No such device"}}<br />
Load the appropriate module with<br />
<br />
# modprobe <module><br />
<br />
{| border="1"<br />
!Module!!Description<br />
|-<br />
| acpi_cpufreq || CPUFreq driver which utilizes the ACPI Processor Performance States. This driver also supports Intel Enhanced SpeedStep (previously supported by the deprecated speedstep-centrino module).<br />
|-<br />
| speedstep-lib || CPUFreq drive for Intel speedstep enabled processors (mostly atoms and older pentiums (< 3)) <br />
|-<br />
| powernow-k8 || CPUFreq driver for K8/K10 Athlon64/Opteron/Phenom processors.<br />
|-<br />
| pcc-cpufreq || This driver supports Processor Clocking Control interface by Hewlett-Packard and Microsoft Corporation which is useful on some Proliant servers.<br />
|-<br />
| p4_clockmod || CPUFreq driver for Intel Pentium 4 / Xeon / Celeron processors. When enabled it will lower CPU temperature by skipping clocks.<br>You probably want to use a Speedstep driver instead.<br />
|}<br />
<br><br />
<br />
Once the appropriate cpufreq driver is loaded, detailed information about the CPU(s) can be displayed by running<br />
<br />
$ cpupower frequency-info<br />
<br />
=== Scaling governors ===<br />
<br />
Governors (see table below) are power schemes for the cpu. Only one may be active at a time.<br />
<br />
{{Note|The kernel loads {{ic|on_demand}} by default.}}<br />
{| border="1"<br />
!Module!!Description<br />
|-<br />
| cpufreq_ondemand || Dynamically switch between CPU(s) available if at 95% cpu load<br />
|-<br />
| cpufreq_performance || Run the cpu at max frequency<br />
|-<br />
| cpufreq_conservative || Dynamically switch between CPU(s) available if at 75% load<br />
|-<br />
| cpufreq_powersave|| Run the cpu at the minimum frequency<br />
|-<br />
| cpufreq_userspace || Run the cpu at user specified frequencies<br />
|}<br />
<br><br />
<br />
{{Tip| To monitor cpu speed in real time, run:<br />
{{bc|<nowiki><br />
$ watch grep \"cpu MHz\" /proc/cpuinfo<br />
</nowiki>}}}}<br />
<br />
==== With cpupower ====<br />
To load and activate a particular governor, one should run <br />
<br />
# cpupower frequency-set -g <governor_without cpufreq_><br />
<br />
==== Without cpupower ====<br />
{{Tip|To load a governor at boot, run <br />
{{bc|<nowiki><br />
# echo <module> > /etc/modules-load.d/<module><br />
</nowiki>}}}}<br />
<br />
To load a particular governor, one should run<br />
<br />
# modprobe <governor><br />
<br />
=== Tuning governors (with cpupower) ===<br />
{{Tip|Add the following commands below to {{ic|/etc/default/cpupower}}. <percent> is the percentage of cpu load; <governor> is the cpupower governor}}<br />
To set the threshold for stepping up to another frequency<br />
<br />
# echo -n <percent> > /sys/devices/system/cpu/cpufreq/<governor>/up_threshold<br />
<br />
To set the threshold for stepping down to another frequency<br />
<br />
# echo -n <percent> > /sys/devices/system/cpu/cpufreq/<governor>/down_threshold<br />
<br />
===== Sampling rate =====<br />
The sampling rate determines how frequently the governor checks to tune the cpu<br />
Setting {{ic|sampling_down_factor}} greater than 1 improves performance by reducing the overhead of load evaluation and keeping the CPU at its highest clock frequency due to high load. This tunable has no effect on behavior at lower CPU frequencies/loads.<br />
<br />
To read the value (default = 1), run<br />
<br />
$ cat /sys/devices/system/cpu/cpufreq/ondemand/sampling_down_factor<br />
<br />
To set the value, run <br />
<br />
# echo -n <value> > /sys/devices/system/cpu/cpufreq/ondemand/sampling_down_factor<br />
<br />
=== Setting Maximum and Minimum Frequencies ===<br />
<br />
{{Note|The governor, maximum, and minimum frequencies can be set in {{ic|/etc/default/cpupower}}. To adjust for only a single cpu core: {{ic| -c <core #>}}. <clock_freq> is a clock frequency with units : GHz,MHz}}<br />
To set the maximum clock frequency<br />
<br />
# cpupower frequency-set -u <clock_freq><br />
<br />
To set the minimum clock frequency<br />
<br />
# cpupower frequency-set -d <clock_freq><br />
<br />
To set the cpu to run at a specified frequency<br />
<br />
# cpupower frequency-set -f <clock_freq><br />
<br />
== Interaction with ACPI events ==<br />
<br />
Users may configure scaling governors to switch automatically based on different ACPI events such as connecting the AC adapter or closing a laptop lid. A quick example is given below, however it may be worth reading full article on [[acpid]].<br />
<br />
Events are defined in {{ic|/etc/acpi/handler.sh}}. If the {{Pkg|acpid}} package is installed, the file should already exist and be executable. For example, to change the scaling governor from {{ic|performance}} to {{ic|conservative}} when the AC adapter is disconnected and change it back if reconnected:<br />
<br />
{{hc<br />
|/etc/acpi/handler.sh<br />
|<nowiki><br />
[...]<br />
<br />
ac_adapter)<br />
case "$2" in<br />
AC*)<br />
case "$4" in<br />
00000000)<br />
echo "conservative" >/sys/devices/system/cpu/cpu0/cpufreq/scaling_governor <br />
echo -n $minspeed >$setspeed<br />
#/etc/laptop-mode/laptop-mode start<br />
;;<br />
00000001)<br />
echo "performance" >/sys/devices/system/cpu/cpu0/cpufreq/scaling_governor<br />
echo -n $maxspeed >$setspeed<br />
#/etc/laptop-mode/laptop-mode stop<br />
;;<br />
esac<br />
;;<br />
*) logger "ACPI action undefined: $2" ;;<br />
esac<br />
;;<br />
<br />
[...]<br />
</nowiki>}}<br />
<br />
<br />
== Privilege Granting Under GNOME ==<br />
{{Note|Systemd introduced logind which handles consolekit and policykit actions. The following code below does not work}}<br />
<br />
[[GNOME]] has a nice applet to change the governor on the fly. To use it without the need to enter the root password, simply create {{ic|/var/lib/polkit-1/localauthority/50-local.d/org.gnome.cpufreqselector.pkla}} and populate it with the following:<br />
<br />
{{bc|<nowiki>[org.gnome.cpufreqselector]<br />
Identity=unix-user:USER<br />
Action=org.gnome.cpufreqselector<br />
ResultAny=no<br />
ResultInactive=no<br />
ResultActive=yes</nowiki>}}0<br />
<br />
Where the word {{ic|USER}} is replaced with the username of interest.<br />
<br />
The {{AUR|desktop-privileges}} package in the [[Arch User Repository|AUR]] contains a similar {{ic|.pkla}} file for authorizing all users of the {{ic|power}} [[Users and Groups|group]] to change the governor.<br />
<br />
== Laptop Mode Tools ==<br />
If you are already using or plan to use [[Laptop Mode Tools]] for other power saving solutions, then you may want to let it also manage CPU frequency scaling. To do so, you just have to insert the appropriate frequency driver to the {{ic|/etc/modules.d/}} directory. (see [[#CPU frequency driver]] above) and then go through the {{ic|/etc/laptop-mode/conf.d/cpufreq.conf}} file to define governors, frequencies and policies. You will not need to load other modules and daemons or to set up scaling governors and interaction with ACPI events. Please refer to [[Laptop Mode Tools]] for more details.<br />
<br />
== Troubleshooting ==<br />
{{accuracy}}<br />
* Some applications, like [[ntop]], do not respond well to automatic frequency scaling. In the case of ntop it can result in segmentation faults and lots of lost information as even the {{ic|on-demand}} governor cannot change the frequency quickly enough when a lot of packets suddenly arrive at the monitored network interface that cannot be handled by the current processor speed.<br />
<br />
* Some CPU's may suffer from poor performance with the default settings of the {{ic|on-demand}} governor (e.g. flash videos not playing smoothly or stuttering window animations). Instead of completely disabling frequency scaling to resolve these issues, the aggressiveness of frequency scaling can be increased by lowering the ''up_threshold'' [[sysctl]] variable for each CPU. See [[#Changing the on-demand governor's threshold]].<br />
<br />
* Sometimes the on-demand governor may not throttle to the maximum frequency but one step below. This can be solved by setting max_freq value slightly higher than the real maximum. For example, if frequency range of the CPU is from 2.00 GHz to 3.00 GHz, setting max_freq to 3.01 GHz can be a good idea.<br />
<br />
* Some combinations of [[ALSA]] drivers and sound chips may cause audio skipping as the governor changes between frequencies, switching back to a non-changing governor seems to stop the audio skipping.<br />
<br />
=== BIOS frequency limitation ===<br />
Some CPU/BIOS configurations may have difficulties to scale to the maximum frequency or scale to higher frequencies at all. This is most likely caused by BIOS events telling the OS to limit the frequency resulting in {{ic|/sys/devices/system/cpu/cpu0/cpufreq/bios_limit}} set to a lower value.<br />
<br />
Either you just made a specific Setting in the BIOS Setup Utility, (Frequency, Thermal Management, etc.) you can blame a buggy/outdated BIOS or the BIOS might have a serious reason for throttling the CPU on it's own.<br />
<br />
Reasons like that can be (assuming your machine's a notebook) that the battery is removed (or near death) so you're on AC-power only. In this case a weak AC-source might not supply enough electricity to fulfill extreme peak demands by the overall system and as there is no battery to assist this could lead to data loss, data corruption or in worst case even hardware damage!<br />
<br />
Not all BIOS'es limit the CPU-Frequency in this case, but for example most IBM/Lenove Thinkpads do. Refer to thinkwiki for more [http://www.thinkwiki.org/wiki/Problem_with_CPU_frequency_scaling thinkpad related info on this topic].<br />
<br />
If you checked there's not just an odd BIOS setting and you know what you're doing you can make the Kernel ignore these BIOS-limitations.<br />
<br />
{{Warning|Make sure you read and understood the section above. CPU frequency limitation is a safety feature of your BIOS and you should not need to work around it.}}<br />
<br />
A special parameter has to be passed to the processor module.<br />
<br />
For trying this temporarily change the value in {{ic|/sys/module/processor/parameters/ignore_ppc}} from {{ic|0}} to {{ic|1}}.<br />
<br />
For setting it permanent refer to [[Kernel_modules#Configuration|Kernel modules]] or just read on.<br />
Add {{ic|1=processor.ignore_ppc=1}} to your kernel boot line or create<br />
{{hc|/etc/modprobe.d/ignore_ppc.conf|2=# If the frequency of your machine gets wrongly limited by BIOS, this should help<br />
options processor ignore_ppc=1}}</div>Beinihttps://wiki.archlinux.org/index.php?title=Rxvt-unicode&diff=241950Rxvt-unicode2012-12-28T12:30:40Z<p>Beini: Latest release changes urlLauncher to url-launcher</p>
<hr />
<div>[[Category:Terminal emulators]]<br />
{{DISPLAYTITLE:rxvt-unicode}}<br />
[[de:urxvt]]<br />
[[es:Rxvt-unicode]]<br />
[[fr:urxvt]]<br />
[[sr:Rxvt-unicode]]<br />
[http://software.schmorp.de/pkg/rxvt-unicode.html rxvt-unicode] is a highly customizable [[Wikipedia:Terminal emulator|terminal emulator]] forked from [[Wikipedia:Rxvt|rxvt]]. Commonly known as {{Ic|urxvt}}, rxvt-unicode can be [[daemon]]ized to run clients within a single [[Wikipedia:Process (computing)|process]] in order to minimize the use of system resources. Developed by Marc Lehmann, some of the more outstanding features of rxvt-unicode include international language support through [[Wikipedia:Unicode|Unicode]], the ability to display multiple font types and support for [[Wikipedia:Perl|Perl]] extensions.<br />
<br />
==Installation==<br />
<br />
{{Pkg|rxvt-unicode}} is available in the [[Official Repositories|official repositories]] and includes 256 color support.<br />
<br />
{{AUR|rxvt-unicode-patched}} is available in the [[AUR]] and includes a fix for the font width bug.<br />
<br />
==Configuration==<br />
See the [http://pod.tst.eu/http://cvs.schmorp.de/rxvt-unicode/doc/rxvt.1.pod rxvt-unicode reference page] for the complete list of available setting and values.<br />
<br />
===Creating ~/.Xresources===<br />
The look, feel, and function of rxvt-unicode is controlled by command-line arguments and/or [[X resources]]. X resources can be set using {{ic|~/.Xresources}} and xrdb ({{Pkg|xorg-xrdb}}), see the [[X_resources|wiki page]] for details.<br />
<br />
{{Note|Command-line arguments override, and take precedence over resource settings}}<br />
<br />
===True transparency===<br />
<br />
To use true transparency, you need to be using a [[Window_Manager|window manager]] that supports compositing or a separate compositor.<br />
<br />
From the command-line:<br />
<br />
$ urxvt -depth 32 -bg rgba:3f00/3f00/3f00/dddd<br />
<br />
Using the configuration file:<br />
<br />
{{hc|~/.Xresources|<br />
URxvt.depth: 32<br />
URxvt.background: rgba:1111/1111/1111/dddd<br />
}}<br />
<br />
or<br />
<br />
{{hc|~/.Xresources|<br />
URxvt.depth: 32<br />
URxvt.background: [95]#000000<br />
}}<br />
<br />
where '95' is the opacity level in percentage and '#000000' is the background color.<br />
{{Note|To make these settings universal for all forms of URxvt, you may add a wildcard. For example, {{ic|URxvt.depth}} would become {{ic|URxvt*.depth}}.}}<br />
<br />
===Native transparency===<br />
<br />
If there is no need for true transparency, or if compositing uses too many resources on your system, you can get transparency working in the following way:<br />
{{hc|~/.Xresources|<nowiki><br />
! Xresources file<br />
<br />
URxvt*.transparent: true<br />
! URxvt*.shading: 0 to 99 darkens, 101 to 200 lightens<br />
URxvt*.shading: 110<br />
</nowiki>}}<br />
Using the URxvt*background setting exemplified above instead of URxvt*.shading will also work.<br />
{{Note|Avoid using shading if you have a {{ic|URxvt.tintColor}} set. Use a different {{ic|tintColor}} instead.}}<br />
<br />
===Scrollbar===<br />
The look of the scrollbar can be chosen through this entry in {{ic|~/.Xresources}}:<br />
! scrollbar style - rxvt (default), plain (most compact), next, or xterm<br />
URxvt.scrollstyle: rxvt<br />
<br />
The scrollbar can also be completely deactivated like so:<br />
URxvt.scrollBar: false<br />
<br />
===Font Declaration Methods===<br />
URxvt.font: 9x15<br />
is the same as:<br />
URxvt.font: -misc-fixed-medium-r-normal--15-140-75-75-c-90-iso8859-1<br />
<br />
And, for the same font in bold:<br />
URxvt.font: 9x15bold<br />
is the same as:<br />
URxvt.font: -misc-fixed-bold-r-normal--15-140-75-75-c-90-iso8859-1<br />
<br />
The complete list of short names for X core fonts can be found in {{ic|/usr/share/fonts/misc/fonts.alias}} (there's also some fonts.alias files in some of the other subdirectories of {{ic|/usr/share/fonts/}}, but as they are packaged separately from the actual fonts, they may list fonts you do not actually have installed). It is worth noting that these short aliases select for ISO-8859-1 versions of the fonts rather than ISO-10646-1 (Unicode) versions, and 75 DPI rather than 100 DPI versions, so you're probably better off avoiding them and choosing fonts by their full long names instead.<br />
<br />
{{Note|The above paragraph is only for bitmap fonts. Xft fonts can be specified using the following format:}}<br />
URxvt.font: xft:monaco:size=10<br />
<br />
Or<br />
URxvt.font: xft:monaco:bold:size=10<br />
<br />
===Set icon===<br />
By default URxvt does not feature a taskbar icon. However, this can be easily changed by adding the following line to {{ic|~/.Xresources}} and pointing to the desired icon:<br />
URxvt.iconFile: /usr/share/icons/Clarity/scalable/apps/terminal.svg<br />
<br />
===Set as Login Shell===<br />
This will cause the shell to be started as a login shell, like the option {{ic|-ls}}.<br />
URxvt*loginShell: true<br />
<br />
===Set TERM===<br />
Sets $TERM to a specific terminal, like the option {{ic|-tn}}.<br />
URxvt*termName:screen-256color<br />
<br />
==Perl extensions==<br />
===Clickable URLs===<br />
You can make URLs in the terminal clickable using the matcher extension. For example, to open links in [[Firefox]] add the following to {{ic|.Xresources}}:<br />
URxvt.perl-ext-common: default,matcher<br />
URxvt.url-launcher: /usr/bin/firefox<br />
URxvt.matcher.button: 1<br />
<br />
Since rxvt-unicode 9.14, it's also possible to use matcher to open and list recent (currently limited to 10) URLs via keyboard:<br />
URxvt.keysym.C-Delete: perl:matcher:last<br />
URxvt.keysym.M-Delete: perl:matcher:list<br />
<br />
To color all matching text in a blue color for quickly finding links, use the following setting or any color in the form of #RRGGBB you like instead.<br />
URxvt.colorUL: #4682B4<br />
<br />
===Yankable URLs (No Mouse)===<br />
In addition, you can select and open URLs in your web browser without using the mouse.<br />
<br />
Install the {{Pkg|urxvt-perls}} package from the [[Official Repositories|official repositories]] and adjust your {{ic|.Xresources}} as necessary. An example is shown below:<br />
URxvt.perl-ext: default,url-select<br />
URxvt.keysym.M-u: perl:url-select:select_next<br />
URxvt.url-select.launcher: /usr/bin/firefox -new-tab<br />
URxvt.url-select.underline: true<br />
<br />
{{Note|This extension replaces the Clickable URLs extension mentioned above, so {{Ic|matcher}} can be removed from the {{Ic|URxvt.perl-ext}} list.}}<br />
<br />
'''Key commands:'''<br />
<br />
{{Keypress|Alt+U}} Enter selection mode. The last URL on your screen will be selected. You can repeat {{Keypress|Alt+U}} to select the next upward URL.<br />
<br />
{{Keypress|K}} Select next upward URL<br />
<br />
{{Keypress|J}} Select next downward URL<br />
<br />
{{Keypress|Return}} Open selected URL in browser and quit selection mode<br />
<br />
{{Keypress|O}} Open selected URL in browser without quitting selection mode<br />
<br />
{{Keypress|Y}} Copy (yank) selected URL and quit selection mode<br />
<br />
{{Keypress|Esc}} Cancel URL selection mode<br />
<br />
===Tabs===<br />
To add tabs to urxvt, add the following to your {{ic|~/.Xresources}}:<br />
URxvt.perl-ext-common: default,tabbed<br />
<br />
To control tabs use:<br />
<br />
{{Keypress|Shift+ ↓}} new tab<br />
<br />
{{Keypress|Shift+ ←}} go to left tab<br />
<br />
{{Keypress|Shift+ →}} go to right tab<br />
<br />
{{Keypress|Ctrl+ ←}} move tab to the left<br />
<br />
{{Keypress|Ctrl+ →}} move tab to the right<br />
<br />
{{Keypress|Ctrl+D}}: close tab <br />
<br />
You can change the colors of tabs with the following:<br />
URxvt.tabbed.tabbar-fg: 2<br />
URxvt.tabbed.tabbar-bg: 0<br />
URxvt.tabbed.tab-fg: 3<br />
URxvt.tabbed.tab-bg: 0<br />
<br />
For named tabs, see {{AUR|urxvt-tabbedex}}, ({{Keypress|Shift+ ↑}}: names a tab).<br />
<br />
===Fullscreen===<br />
<br />
You can install the [[AUR]] package {{AUR|urxvt-fullscreen}}, and then set a key binding to put urxvt fullscreen.<br />
<br />
{{hc|~/.Xresources|<br />
...<br />
URxvt.perl-ext-common: ..., fullscreen, ...<br />
URxvt.keysym.F11: perl:fullscreen:switch<br />
...<br />
}}<br />
<br />
===Scrollwheel Support===<br />
<br />
Install {{AUR|urxvt-vtwheel}} from the [[AUR]] and add it to your Perl extensions within {{ic|~/.Xresources}}:<br />
<br />
URxvt.perl-ext-common: ...,vtwheel,...<br />
<br />
===Disabling Perl extensions===<br />
If you do not use the Perl extension features, you can improve the security and speed by disabling Perl extensions completely.<br />
URxvt.perl-ext:<br />
URxvt.perl-ext-common:<br />
<br />
==Colors==<br />
Colors must be specified using color indexes: 0 to 15 correspond with the colors from the rxvt manual "Colors and Graphics" Section.<br />
{{bc|1=COLORS AND GRAPHICS<br />
<br />
If graphics support was enabled at compile-time, rxvt can be queried with ANSI escape sequences and can address individual pixels instead of text<br />
characters. Note the graphics support is still considered beta code.<br />
<br />
In addition to the default foreground and background colours, rxvt can display up to 16 colours (8 ANSI colours plus high-intensity bold/blink<br />
versions of the same). Here is a list of the colours with their rgb.txt names.<br />
<br />
color0 (black) = Black<br />
color1 (red) = Red3<br />
color2 (green) = Green3<br />
color3 (yellow) = Yellow3<br />
color4 (blue) = Blue3<br />
color5 (magenta) = Magenta3<br />
color6 (cyan) = Cyan3<br />
color7 (white) = AntiqueWhite<br />
color8 (bright black) = Grey25<br />
color9 (bright red) = Red<br />
color10 (bright green) = Green<br />
color11 (bright yellow) = Yellow<br />
color12 (bright blue) = Blue<br />
color13 (bright magenta)= Magenta<br />
color14 (bright cyan) = Cyan<br />
color15 (bright white) = White<br />
foreground = Black<br />
background = White<br />
<br />
It is also possible to specify the colour values of foreground, background, cursorColor, cursorColor2, colorBD, colorUL as a number 0-15, as a<br />
convenient shorthand to reference the colour name of color0-color15.<br />
<br />
Note that -rv ("reverseVideo: True") simulates reverse video by always swapping the foreground/background colours. This is in contrast to xterm(1)<br />
where the colours are only swapped if they have not otherwise been specified. For example,<br />
<br />
rxvt -fg Black -bg White -rv<br />
would yield White on Black, while on xterm(1) it would yield Black on White. <br />
}}<br />
<br />
==Improving Performance==<br />
*Avoid the use of Xft fonts. If Xft fonts must be used, append {{Ic|<nowiki>:antialias=false</nowiki>}} to the setting value.<sup>[http://pod.tst.eu/http://cvs.schmorp.de/rxvt-unicode/doc/rxvt.7.pod#Can_I_speed_up_Xft_rendering_somehow]</sup><br />
<br />
*Build rxvt-unicode with disabled support for unnecessary features, {{Ic|--disable-xft}} and {{Ic|--disable-unicode3}} in particular.<sup>[http://pod.tst.eu/http://cvs.schmorp.de/rxvt-unicode/doc/rxvt.7.pod#Rxvt_unicode_uses_gobs_of_memory_how]</sup><br />
<br />
*Limit the number of {{Ic|saveLines}} (option {{Ic|-sl}}) in the scrollback buffer to reduce memory usage.<sup>[http://pod.tst.eu/http://cvs.schmorp.de/rxvt-unicode/doc/rxvt.7.pod#Isn_t_rxvt_unicode_supposed_to_be_sm]</sup><br />
<br />
*Consider running {{Ic|urxvtd}} as a daemon accepting connections from {{Ic|urxvtc}} clients.<br />
<br />
==Cut and Paste==<br />
{{Note|With the use of a VDT multiplexer, urxvt (or any VDT emulator) {{Ic|CLIPBOARD}} integration will not be effective, since it will not be possible to select all of the desired text in a straightforward fashion or at all, in some cases (e.g., when the active multiplexed terminal is changed to another one and then back to the original one, and one selects text beyond what is visible, which causes text from the other terminal to be displayed). Obviously this is due to the fact that the VDT emulator lacks the ability to distinguish between multiplexed terminals. Therefore, it would be effectively redundant for one who always uses a VDT multiplexer capable of maintaining a scrollback buffer and integrating with {{Ic|CLIPBOARD}} (e.g., [[tmux]] with [[tmux#ICCCM Selection Integration|customized key bindings]]) to integrate {{Ic|CLIPBOARD}} with urxvt.}}<br />
<br />
For users unfamiliar with [[Xorg]] data transfer methods, the exchange of information to and from rxvt-unicode can become a burden. Suffice to say that rxvt-unicode uses cut buffers which are typically loaded into the current {{Ic|PRIMARY}} selection by default.<sup>[http://pod.tst.eu/http://cvs.schmorp.de/rxvt-unicode/doc/rxvt.1.pod#THE_SELECTION_SELECTING_AND_PASTING_]</sup> Users are urged to review [[Wikipedia:X Window selection]] for additional information.<br />
<br />
====Clipboard Management====<br />
* [http://parcellite.sourceforge.net/ Parcellite] is a GTK+ clipboard manager which can also run in the background as a daemon.<br />
<br />
* [http://www.nongnu.org/autocutsel/ autocutsel] provides command line and daemon interfaces to synchronize PRIMARY, {{Ic|CLIPBOARD}} and cut buffer selections.<br />
<br />
* [http://glipper.sourceforge.net/ Glipper] is a [[GNOME]] panel applet with older versions available for use in environments other than GNOME.<br />
<br />
* [http://goodies.xfce.org/projects/panel-plugins/xfce4-clipman-plugin Clipman] (xfce-clipman-plugin) is a GUI clipboard manager plugin for the [[Xfce]] panel (xfpanel).<br />
<br />
* [http://sourceforge.net/projects/xclip/ xclip] is a lightweight, command-line based interface to the clipboard.<br />
<br />
====Automatic Script Management====<br />
Skottish[https://bbs.archlinux.org/viewtopic.php?pid=506845#p506845] created a Perl script to automatically copy any selection in rxvt-unicode to the X clipboard. Save the following as {{ic|/usr/lib/urxvt/perl/clipboard}}:<br />
{{bc|<nowiki><br />
#! /usr/bin/perl<br />
<br />
sub on_sel_grab {<br />
my $query=quotemeta $_[0]->selection;<br />
$query=~ s/\n/\\n/g;<br />
$query=~ s/\r/\\r/g;<br />
system( "echo -en " . $query . " | xsel -i -b -p" );<br />
}<br />
</nowiki>}}<br />
<br />
Xyne has also created his own variation of Skottish's script named {{AUR|urxvt-clipboard}} which is available in the [[AUR]] that allows the user to paste the selection with {{Keypress|Ctrl+V}} instead of only with a middle mouse click:<br />
{{bc|<nowiki><br />
#! /usr/bin/perl<br />
<br />
sub on_sel_grab<br />
{<br />
my $query = $_[0]->selection;<br />
open (my $pipe,'|-','xsel -ib') or die;<br />
print $pipe $query;<br />
close $pipe;<br />
open (my $pipe,'|-','xsel -ip') or die;<br />
print $pipe $query;<br />
close $pipe;<br />
}<br />
</nowiki>}}<br />
<br />
It also requires {{Pkg|xsel}} and needs to be enabled in the {{Ic|*perl-ext-common}} or {{Ic|*perl-ext}} field in {{ic|~/.Xresources}}. For example:<br />
URxvt.perl-ext-common: default,clipboard<br />
<br />
The [[AUR]] package {{AUR|urxvt-perls-git}} is another option one can use. {{AUR|urxvt-perls-git}} includes the same functionality as {{AUR|urxvt-clipboard}}, in addition to the keyboard-select and url-select Perl extensions.<br />
<br />
==Improved Kuake-like Behavior in Openbox==<br />
This was originally posted on the forum by Xyne<sup>[https://bbs.archlinux.org/viewtopic.php?pid=550380]</sup>, and it relies on the {{Pkg|xdotool}} found in the [[Official Repositories|official repositories]].<br />
<br />
===Scriptlets===<br />
Save this scriptlet from the {{Ic|urxvtc}} man page somewhere on your system as {{ic|urxvtc}} (e.g., in {{ic|~/.config/openbox}}):<br />
{{bc|<br />
#!/bin/sh<br />
urxvtc "$@"<br />
if [ $? -eq 2 ]; then<br />
urxvtd -q -o -f<br />
urxvtc "$@"<br />
fi<br />
}}<br />
<br />
and save this one as {{ic|urxvtq}}:<br />
{{bc|<nowiki><br />
#!/bin/bash<br />
<br />
wid=$(xdotool search --classname urxvtq)<br />
if [ -z "$wid" ]; then<br />
/path/to/urxvtc -name urxvtq -geometry 80x28<br />
wid=$(xdotool search --classname urxvtq | head -1)<br />
xdotool windowfocus "$wid"<br />
xdotool key Control_L+l<br />
else<br />
if [ -z "$(xdotool search --onlyvisible --classname urxvtq 2>/dev/null)" ]; then<br />
xdotool windowmap "$wid"<br />
xdotool windowfocus "$wid"<br />
else<br />
xdotool windowunmap "$wid"<br />
fi<br />
fi<br />
</nowiki>}}<br />
<br />
A previous version of {{Pkg|xdotool}} introduced a bug which disabled recognition of visible windows and thus led some users to use the following scriptlet in place of the previous one. This is no longer necessary as of {{Pkg|xdotool}} >= 1.20100416.2809, but it has been left here for future reference.<br />
{{bc|<nowiki><br />
#!/bin/bash<br />
<br />
wid=$(xprop -name urxvtq | grep 'WM_COMMAND' | awk -F ',' '{print $3}' | awk -F '"' '{print $2}')<br />
if [ -z "$wid" ]; then<br />
/path/to/urxvtc -name urxvtq -geometry 200x28<br />
wid=$(xprop -name urxvtq | grep 'WM_COMMAND' | awk -F ',' '{print $3}' | awk -F '"' '{print $2}')<br />
xdotool windowfocus "$wid"<br />
xdotool key Control_L+l<br />
else<br />
if [ -z "$(xprop -id "$wid" | grep 'window state: Normal' 2>/dev/null)" ]; then<br />
xdotool windowmap "$wid"<br />
xdotool windowfocus "$wid"<br />
else<br />
xdotool windowunmap "$wid"<br />
fi<br />
fi<br />
</nowiki>}}<br />
<br />
Make sure that you change {{Ic|/path/to/urxvtc}} to the actual path to the {{ic|urxvtc}} scriptlet that you saved above. We will be using {{ic|urxvtc}} to launch both regular instances of {{Ic|urxvt}} and the kuake-like instance.<br />
<br />
===urxvtq with tabbing===<br />
If you want to have tabs in your kuake-like {{ic|urxvtc}} (here called {{ic|urxvtq}}) just replace the third line in your {{ic|urxvtq}}:<br />
wid=$(xdotool search --name urxvtq)<br />
with:<br />
wid=$(xdotool search --name urxvtq | grep -m 1 "" )<br />
<br />
To activate tab support, you can either replace the fifth line of your {{ic|urxvtq}}:<br />
/path/to/urxvtc -name urxvtq -geometry 80x28<br />
with:<br />
/path/to/urxvtc -name urxvtq -pe tabbed -geometry 80x28<br />
or replace this line of your {{ic|~/.Xresources}} file:<br />
URxvt.perl-ext-common: default,matcher<br />
with<br />
URxvt.perl-ext-common: default,matcher,tabbed<br />
<br />
====Tab control====<br />
{{Keypress|Shift+ ←}}: Switch to the tab left of the current one<br />
<br />
{{Keypress|Shift+ →}}: Switch to the tab right of the current one<br />
<br />
{{Keypress|Shift+ ↓}}: Create a new tab<br />
<br />
You can also use your mouse to switch the tabs by clicking the wished one and create a new tab by clicking on ''[NEW].\\''<br />
<br />
To close a tab just enter {{Ic|exit}} like you would to normally close a terminal.<br />
<br />
===Openbox configuration===<br />
Now add the following lines to the {{Ic|<applications>}} section of {{ic|~/.config/openbox/rc.xml}}:<br />
{{bc|1=<br />
<application name="urxvtq"><br />
<decor>no</decor><br />
<position force="yes"><br />
<x>center</x><br />
<y>0</y><br />
</position><br />
<desktop>all</desktop><br />
<layer>above</layer><br />
<skip_pager>yes</skip_pager><br />
<skip_taskbar>yes</skip_taskbar><br />
<maximized>Horizontal</maximized><br />
</application><br />
}}<br />
<br />
and add these lines to the {{Ic|<keyboard>}} section:<br />
{{bc|1=<br />
<keybind key="W-t"><br />
<action name="Execute"><br />
<command>/path/to/urxvtc</command><br />
</action><br />
</keybind><br />
<keybind key="W-grave"><br />
<action name="Execute"><br />
<execute>/path/to/urxvtq</execute><br />
</action><br />
</keybind><br />
}}<br />
<br />
Here too you need to change the {{Ic|/path/to/*}} lines to point to the scripts that you saved above. Save the file and then reconfigure Openbox. You should now be able to launch regular instances of urxvt with {{keypress|Super+T}}, and toggle the kuake-like console with {{keypress|Super+'''`'''}} (the grave key also known as the backtick).<br />
<br />
===Further configuration===<br />
The advantage of this configuration over the urxvt kuake Perl script is that Openbox provides more keybinding options such as modifier keys. The kuake script hijacks an entire physical key regardless of any modifier combination. Review the [http://icculus.org/openbox/index.php/Help:Bindings Openbox bindings documentation] for the full range or possibilities.<br />
<br />
The [http://icculus.org/openbox/index.php/Help:Applications Openbox per-app settings] can be used to further configure the behavior of the kuake-like console (e.g. screen position, layer, etc.). You may need to change the "geometry" parameter in the {{ic|urxvtq}} scriptlet to adjust the height of the console.<br />
<br />
===Related scripts===<br />
*hbekel has posted a generalized version of the {{ic|urxvtq}} [https://bbs.archlinux.org/viewtopic.php?pid=550380#p550380 here] which can be used to toggle any application using {{Pkg|xdotool}}.<br />
<br />
*http://www.jukie.net/~bart/blog/20070503013555 - A script for opening URLs with your keyboard instead of mouse with urxvt.<br />
<br />
==Troubleshooting==<br />
===Transparency not working after upgrade to v9.09===<br />
The rxvt-unicode developers removed compatibility code for a lot of non standard wallpaper setters with this update. Using a non compatible wallpaper setter will break transparency support. Recommended wallpaper setters:<br />
* [[feh]]<br />
* hsetroot<br />
* esetroot<br />
<br />
To make true transparency work, make sure to comment URxvt.tintColor and URxvt.inheritPixmap.<br />
<br />
===Remote Hosts===<br />
If you are logging into a remote host, you may encounter problems when running text-mode programs under rxvt-unicode. This can be fixed by copying {{ic|/usr/share/terminfo/r/rxvt-unicode}} from your local machine to your host at {{ic|~/.terminfo/r/rxvt-unicode}}.<br />
Same for rxvt-unicode-256color.<br />
<br />
Some remote systems do not change title automatically unless you specify TERM=xterm. To fix the issue add this line to .bashrc on the remote machine:<br />
PROMPT_COMMAND='echo -ne "\033]0;${USER}@${HOSTNAME}:${PWD}\007"'<br />
<br />
===Using rxvt-unicode as gmrun terminal===<br />
Unlike some other terminals, urxvt expects the arguments to {{Ic|-e}} to be given separately, rather than grouped together with quotes. This causes trouble with gmrun, which assumes the opposite behavior. This can be worked around by putting an "eval" in front of gmrun's "Terminal" variable in {{ic|.gmrunrc}}:<br />
<br />
Terminal = eval urxvt<br />
TermExec = ${Terminal} -e<br />
<br />
(gmrun uses {{ic|/bin/sh}} to execute commands, so the "eval" is understood here.) The "eval" has the side-effect of "breaking up" the argument to {{Ic|-e}} in the same way that {{Ic|$@}} does in [[Bash]], making the command intelligible to urxvt.<br />
<br />
=== My numerical keypad acts weird and generates differing output? (e.g. in vim) ===<br />
<br />
Some Debian GNU/Linux users seem to have this problem, although no specific details were reported so far. It is possible that this is caused by the wrong TERM setting, although the details of whether and how this can happen are unknown, as TERM=rxvt should offer a compatible keymap. See the answer to the previous question, and please report if that helped.<br />
<br />
However, using the ''xmodmap'' program ({{Pkg|xorg-xmodmap}}), you can re-map your number pad keys back.<br />
<br />
1. Check the keycode that your numerical keypad (numpad) generates using {{ic|xev}} program.<br />
:* Start the {{ic|xev}} program<br />
:* Press your number pad keys and look for ''... keycode xxx ...'' in {{ic|xev}}'s output. For example, numpad 1 in my keyboard is also "End" key, that have a ''''keycode 87''''.<br />
<br />
2. Create or modify your xmodmap file, usually {{ic|~/.Xmodmap}}, with the content representing your keycode.<br />
<br />
:Example of xmodmap file with number pad keycode,<br />
{{bc|1=<br />
keycode 63 = KP_Multiply<br />
keycode 79 = Home KP_7<br />
keycode 80 = Up KP_8<br />
keycode 81 = Prior KP_9<br />
keycode 82 = KP_Subtract<br />
keycode 83 = Left KP_4<br />
keycode 84 = KP_5<br />
keycode 85 = Right KP_6<br />
keycode 86 = KP_Add<br />
keycode 87 = End KP_1<br />
keycode 88 = Down KP_2<br />
keycode 89 = Next KP_3<br />
keycode 90 = Insert KP_0<br />
keycode 91 = Delete KP_Decimal<br />
keycode 112 = Prior<br />
keycode 117 = Next<br />
}}<br />
<br />
3. Load your xmodmap file at X session start-up.<br />
<br />
:For example, in {{ic|~/.xinitrc}} file add,<br />
...<br />
xmodmap ~/.Xmodmap<br />
...<br />
<br />
==External resources==<br />
*[http://software.schmorp.de/pkg/rxvt-unicode.html rxvt-unicode] - Official site<br />
*[http://cvs.schmorp.de/rxvt-unicode/ Source Code] - Browseable CVS<br />
*[http://pod.tst.eu/http://cvs.schmorp.de/rxvt-unicode/doc/rxvt.7.pod rxvt-unicode FAQ] - Official FAQ<br />
*[http://pod.tst.eu/http://cvs.schmorp.de/rxvt-unicode/doc/rxvt.1.pod rxvt-unicode Reference] - Official manual page<br />
*[http://pod.tst.eu/http://cvs.schmorp.de/rxvt-unicode/src/urxvt.pm urxvtperl] - Official Perl extension reference</div>Beini