https://wiki.archlinux.org/api.php?action=feedcontributions&user=Cirrus&feedformat=atomArchWiki - User contributions [en]2024-03-29T01:54:37ZUser contributionsMediaWiki 1.41.0https://wiki.archlinux.org/index.php?title=Acer_Aspire_E11_Series&diff=764783Acer Aspire E11 Series2023-01-22T08:56:52Z<p>Cirrus: /* Wireless */ syntax error</p>
<hr />
<div>[[Category:Acer]]<br />
[[ja:Acer Aspire E11 シリーズ]]<br />
{{Laptop style|Missing some sections, hardware table needs adjustments}}<br />
{| class="wikitable" style="float: right;"<br />
| '''Device''' || '''Working'''<br />
|-<br />
| [[Intel graphics]] || {{Yes}}<br />
|-<br />
| [[Network]] || {{Yes}}<br />
|-<br />
| [[Broadcom wireless]] || {{Y|Manual}}<br />
|-<br />
| Atheros Wireless || {{Yes}}<br />
|-<br />
| [[ALSA]] || {{Yes}}<br />
|-<br />
| [[Touchpad]] || {{Y|Manual}}<br />
|-<br />
| [[Webcam]] || {{Yes}}<br />
|-<br />
| Card Reader || {{Yes}}<br />
|-<br />
| [[Power management]] || {{No}}<br />
|}<br />
[https://us.acer.com/ac/en/US/content/models/laptops/aspire-e11 Aspire E11 Series]<br />
<br />
== Installation ==<br />
<br />
{{Warning|<br />
* Should you wish to return to ''Windows 8.1 with Bing'', it is imperative to [[#Create a recovery drive]]. The correct installation medium is only available to system manufacturers, and you will have to either use this recovery drive, or send the device back for repair to return to the original state.<br />
* The BIOS firmware in Legacy mode (including latest versions) has several bugs (inability to turn off or suspend the computer, kernel panics, etc). Use UEFI instead.}}<br />
<br />
Prior to installation, download and install the latest firmware update from [https://us.acer.com/ac/en/US/content/drivers Acer] under Windows. Older versions of the firmware can only boot from the (black) USB 2.0 port.<br />
<br />
To recover the Windows key at a later stage, run:<br />
<br />
$ hexdump -C /sys/firmware/acpi/tables/MSDM<br />
<br />
Note that this key is tied to the particular laptop model and [https://arstechnica.com/civis/viewtopic.php?p=26623117#p26623117 unusable elsewhere]. See also [https://msdn.microsoft.com/en-us/library/windows/hardware/dn653305%28v=vs.85%29.aspx].<br />
<br />
=== Create a recovery drive ===<br />
<br />
A recovery drive can made with the preinstalled ''Acer eRecovery Management'' application. This requires a USB-attached flash drive or hard disk with at least 16 GB free space available, and presence of the {{ic|C:/OEM}} directory. All present data on the target drive will be lost.<br />
<br />
Choose the option ''Create Factory Default Backup'', select the partition Windows is installed on, and click ''start''. Remove the drive afterwards - booting from the device will now start the recovery software. See [https://web.archive.org/web/20141201061449/http://acer--uk.custhelp.com/app/answers/detail/a_id/14303/~/create-a-recovery-usb-flash-drive-with-acer-erecovery-management-5.x] for more information.<br />
<br />
=== Booting ===<br />
<br />
The Acer E3-111 does not have an optical drive. <br />
<br />
Both [[UEFI]] and Legacy (BIOS) boot are supported. To switch modes, press {{ic|F2}} at the boot splash screen to enter the EFI setup, then select the ''Boot'' tab. Alternatively, access the EFI setup by [https://web.archive.org/web/20140815080244/http://acer-au.custhelp.com/app/answers/detail/a_id/32048/~/accessing-uefi-in-windows-8.1 rebooting in Windows].<br />
<br />
Disable [[Secure Boot]], then follow the [[installation guide]]. An Ethernet connection is recommended, as the needed [[#Wireless|wireless drivers]] are not included in the installation medium. <br />
<br />
{{Note|<br />
* eMMC device names start with {{ic|/dev/mmcblk}} instead of the typical {{ic|/dev/sda}}.<br />
* Use the {{ic|rootwait}} [[kernel parameter]] since the integrated flash storage is not available instantly after kernel startup. <br />
* Due to limited RAM, it is recommended to create a [[swap]] partition of at least 2 GB in size.<br />
* A UEFI boot entry may not appear upon booting the device. The solution is to copy the {{ic|.efi}} file to the location Windows uses. See [[UEFI#UEFI boot loader does not show up in firmware menu]] for details.<br />
}}<br />
<br />
== Configuration ==<br />
<br />
=== Wireless ===<br />
<br />
To use the Broadcom BCM43142 chipset is, install {{Pkg|broadcom-wl}} from the Community repo, and load the module:<br />
<br />
# modprobe wl<br />
<br />
The system will now recognize the interface as {{ic|wlp2s0}}. See [[Broadcom wireless]] and [[Wireless]] for details.<br />
<br />
=== Touchpad ===<br />
<br />
The E11 series include a [https://windows.microsoft.com/en-us/windows-8/touchpad Precision Touchpad], which supports a variety of touch gestures. To enable the touchpad, append the {{ic|i8042.nopnp}} [[kernel parameter]]. See [[Touchpad Synaptics]] for configuration details.<br />
<br />
=== Power Management ===<br />
<br />
You may need to use the linux-lst kernel for full support.<br />
<br />
==== Suspend and Hibernate ====<br />
<br />
Suspend and Hibernate should work after following [[Power management/Suspend and hibernate]].<br />
<br />
== Troubleshooting ==<br />
<br />
=== GPU ===<br />
<br />
See [[Intel graphics#AccelMethod]].<br />
<br />
=== Start up and shutdown freeze ===<br />
<br />
If you have an issue where the computer freezes during start up and shutdown, requiring multiple reboots, try adding the following to <br />
{{ic|/etc/modprobe.d/blacklist.conf}}<br />
<br />
blacklist dw_dmac<br />
blacklist dw_dmac_core<br />
<br />
See also [https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1341925] [https://bugzilla.redhat.com/show_bug.cgi?id=1213216]<br />
<br />
== See also ==<br />
<br />
* [https://www.youtube.com/watch?v=5OT_RnjMess Disassembly Acer E11 (RAM, HDD upgrade)]<br />
* [https://web.archive.org/web/20190911015438/http://blog.mdda.net/oss/2014/11/16/acer-e11-es1-111-c3nt-linux Installing Linux on Acer E11-111 (ES1-111-C3NT) ]</div>Cirrushttps://wiki.archlinux.org/index.php?title=Acer_Aspire_E11_Series&diff=764782Acer Aspire E11 Series2023-01-22T08:55:39Z<p>Cirrus: /* Wireless */ no lomger in AUR</p>
<hr />
<div>[[Category:Acer]]<br />
[[ja:Acer Aspire E11 シリーズ]]<br />
{{Laptop style|Missing some sections, hardware table needs adjustments}}<br />
{| class="wikitable" style="float: right;"<br />
| '''Device''' || '''Working'''<br />
|-<br />
| [[Intel graphics]] || {{Yes}}<br />
|-<br />
| [[Network]] || {{Yes}}<br />
|-<br />
| [[Broadcom wireless]] || {{Y|Manual}}<br />
|-<br />
| Atheros Wireless || {{Yes}}<br />
|-<br />
| [[ALSA]] || {{Yes}}<br />
|-<br />
| [[Touchpad]] || {{Y|Manual}}<br />
|-<br />
| [[Webcam]] || {{Yes}}<br />
|-<br />
| Card Reader || {{Yes}}<br />
|-<br />
| [[Power management]] || {{No}}<br />
|}<br />
[https://us.acer.com/ac/en/US/content/models/laptops/aspire-e11 Aspire E11 Series]<br />
<br />
== Installation ==<br />
<br />
{{Warning|<br />
* Should you wish to return to ''Windows 8.1 with Bing'', it is imperative to [[#Create a recovery drive]]. The correct installation medium is only available to system manufacturers, and you will have to either use this recovery drive, or send the device back for repair to return to the original state.<br />
* The BIOS firmware in Legacy mode (including latest versions) has several bugs (inability to turn off or suspend the computer, kernel panics, etc). Use UEFI instead.}}<br />
<br />
Prior to installation, download and install the latest firmware update from [https://us.acer.com/ac/en/US/content/drivers Acer] under Windows. Older versions of the firmware can only boot from the (black) USB 2.0 port.<br />
<br />
To recover the Windows key at a later stage, run:<br />
<br />
$ hexdump -C /sys/firmware/acpi/tables/MSDM<br />
<br />
Note that this key is tied to the particular laptop model and [https://arstechnica.com/civis/viewtopic.php?p=26623117#p26623117 unusable elsewhere]. See also [https://msdn.microsoft.com/en-us/library/windows/hardware/dn653305%28v=vs.85%29.aspx].<br />
<br />
=== Create a recovery drive ===<br />
<br />
A recovery drive can made with the preinstalled ''Acer eRecovery Management'' application. This requires a USB-attached flash drive or hard disk with at least 16 GB free space available, and presence of the {{ic|C:/OEM}} directory. All present data on the target drive will be lost.<br />
<br />
Choose the option ''Create Factory Default Backup'', select the partition Windows is installed on, and click ''start''. Remove the drive afterwards - booting from the device will now start the recovery software. See [https://web.archive.org/web/20141201061449/http://acer--uk.custhelp.com/app/answers/detail/a_id/14303/~/create-a-recovery-usb-flash-drive-with-acer-erecovery-management-5.x] for more information.<br />
<br />
=== Booting ===<br />
<br />
The Acer E3-111 does not have an optical drive. <br />
<br />
Both [[UEFI]] and Legacy (BIOS) boot are supported. To switch modes, press {{ic|F2}} at the boot splash screen to enter the EFI setup, then select the ''Boot'' tab. Alternatively, access the EFI setup by [https://web.archive.org/web/20140815080244/http://acer-au.custhelp.com/app/answers/detail/a_id/32048/~/accessing-uefi-in-windows-8.1 rebooting in Windows].<br />
<br />
Disable [[Secure Boot]], then follow the [[installation guide]]. An Ethernet connection is recommended, as the needed [[#Wireless|wireless drivers]] are not included in the installation medium. <br />
<br />
{{Note|<br />
* eMMC device names start with {{ic|/dev/mmcblk}} instead of the typical {{ic|/dev/sda}}.<br />
* Use the {{ic|rootwait}} [[kernel parameter]] since the integrated flash storage is not available instantly after kernel startup. <br />
* Due to limited RAM, it is recommended to create a [[swap]] partition of at least 2 GB in size.<br />
* A UEFI boot entry may not appear upon booting the device. The solution is to copy the {{ic|.efi}} file to the location Windows uses. See [[UEFI#UEFI boot loader does not show up in firmware menu]] for details.<br />
}}<br />
<br />
== Configuration ==<br />
<br />
=== Wireless ===<br />
<br />
To use the Broadcom BCM43142 chipset is, install {{Pkg|broadcom-wl}} from the [CommunityR]], and load the module:<br />
<br />
# modprobe wl<br />
<br />
The system will now recognize the interface as {{ic|wlp2s0}}. See [[Broadcom wireless]] and [[Wireless]] for details.<br />
<br />
=== Touchpad ===<br />
<br />
The E11 series include a [https://windows.microsoft.com/en-us/windows-8/touchpad Precision Touchpad], which supports a variety of touch gestures. To enable the touchpad, append the {{ic|i8042.nopnp}} [[kernel parameter]]. See [[Touchpad Synaptics]] for configuration details.<br />
<br />
=== Power Management ===<br />
<br />
You may need to use the linux-lst kernel for full support.<br />
<br />
==== Suspend and Hibernate ====<br />
<br />
Suspend and Hibernate should work after following [[Power management/Suspend and hibernate]].<br />
<br />
== Troubleshooting ==<br />
<br />
=== GPU ===<br />
<br />
See [[Intel graphics#AccelMethod]].<br />
<br />
=== Start up and shutdown freeze ===<br />
<br />
If you have an issue where the computer freezes during start up and shutdown, requiring multiple reboots, try adding the following to <br />
{{ic|/etc/modprobe.d/blacklist.conf}}<br />
<br />
blacklist dw_dmac<br />
blacklist dw_dmac_core<br />
<br />
See also [https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1341925] [https://bugzilla.redhat.com/show_bug.cgi?id=1213216]<br />
<br />
== See also ==<br />
<br />
* [https://www.youtube.com/watch?v=5OT_RnjMess Disassembly Acer E11 (RAM, HDD upgrade)]<br />
* [https://web.archive.org/web/20190911015438/http://blog.mdda.net/oss/2014/11/16/acer-e11-es1-111-c3nt-linux Installing Linux on Acer E11-111 (ES1-111-C3NT) ]</div>Cirrushttps://wiki.archlinux.org/index.php?title=Dwm&diff=647703Dwm2020-12-30T21:56:07Z<p>Cirrus: /* Using Tilda with dwm */ fixed a misinformation regarding the firefox rule</p>
<hr />
<div>{{lowercase title}}<br />
[[Category:Dynamic WMs]]<br />
[[Category:Suckless]]<br />
[[de:Dwm]]<br />
[[es:Dwm]]<br />
[[fr:DWM]]<br />
[[ja:Dwm]]<br />
[[pt:Dwm]]<br />
[[ru:Dwm]]<br />
[[zh-hans:Dwm]]<br />
{{Related articles start}}<br />
{{Related|dmenu}}<br />
{{Related|Window manager}}<br />
{{Related articles end}}<br />
[https://dwm.suckless.org/ dwm] is a dynamic window manager for [[Xorg]]. It manages windows in tiled, stacked, and full-screen layouts, as well as many others with the help of optional patches. Layouts can be applied dynamically, optimizing the environment for the application in use and the task being performed. dwm is extremely lightweight and fast, written in C and with a stated design goal of remaining under 2000 source lines of code. It provides [[multihead]] support for [[xrandr]] and Xinerama.<br />
<br />
== Installation ==<br />
<br />
The prescribed way to install dwm is to clone the [https://git.suckless.org/dwm/ official git repo], run {{ic|make}}, and then {{ic|make install}}. dwm can also be installed with the AUR packages {{AUR|dwm}} or {{AUR|dwm-git}}. Make any required [[#Configuration]] changes '''before''' building and installing, see [[makepkg]].<br />
<br />
=== Configuration ===<br />
<br />
dwm is configured at compile-time by editing some of its source files, specifically {{ic|config.h}}. For detailed information on these settings see the included, well-commented {{ic|config.def.h}} as well as the [https://dwm.suckless.org/customisation/ customisation section] on the dwm website.<br />
<br />
The official website has a number of [http://dwm.suckless.org/patches/ patches] that can add extra functionality to dwm. These patches primarily make changes to the {{ic|dwm.c}} file but also make changes to the {{ic|config.h}} file where appropriate. For information on applying patches, see the [[Patching packages]] article.<br />
<br />
== Starting ==<br />
<br />
Select ''Dwm'' from the menu in a [[display manager]] of choice. Alternatively, to start dwm with [[startx]] append {{ic|exec dwm}} to {{ic|~/.xinitrc}} and prepend other programs to execute them as well, for example:<br />
<br />
redshift -O3500; xset r rate 300 50; exec dwm<br />
<br />
== Usage ==<br />
<br />
See the [https://dwm.suckless.org/tutorial dwm tutorial] for information on basic dwm usage.<br />
<br />
== Tips and tricks ==<br />
<br />
=== Statusbar configuration ===<br />
<br />
For more examples of status bars see [https://dwm.suckless.org/status_monitor/].<br />
<br />
{{Note|The following requires the {{Pkg|xorg-xsetroot}} package to be installed.}}<br />
<br />
dwm reads the name of the root window and redirects it to the statusbar. The root window is the window within which all other windows are drawn and arranged by the window manager. Like any other window, the root window has a title/name, but it is usually undefined because the root window always runs in the background. <br />
<br />
The information that you want dwm to show in the statusbar should be defined with {{ic|xsetroot -name ""}} command in {{ic|~/.xinitrc}} or {{ic|~/.xprofile}} (if you are using a [[display manager]]). For example: <br />
{{bc|xsetroot -name "Thanks for all the fish!"}}<br />
<br />
Dynamically updated information should be put in a loop which is forked to background - see the example below:<br />
{{bc|<br />
# Statusbar loop<br />
while true; do<br />
xsetroot -name "$( date +"%F %R" )"<br />
sleep 1m # Update time every minute<br />
done &<br />
<br />
# Autostart section<br />
pcmanfm & <br />
<br />
exec dwm<br />
}}<br />
In this case the date is shown in [[wikipedia:ISO_8601|ISO 8601]] format and [[PCManFM]] is launched at startup. <br />
<br />
{{note|It is not recommended to set the update interval equal to zero or remove the "sleep" line entirely since this will cause CPU usage to rise substantially (you can assess the effect with ''top'' and [[powertop]]).}}<br />
<br />
==== Conky statusbar ====<br />
<br />
[[Conky]] can be printed to the statusbar with {{Ic|xsetroot -name}}:<br />
(conky | while read LINE; do xsetroot -name "$LINE"; done) &<br />
exec dwm<br />
<br />
If you do not want to spawn too many PIDs by 'xsetroot' command, you can compile this C program:<br />
#include <string.h><br />
#include <stdlib.h><br />
#include <stdio.h><br />
#include <X11/Xlib.h><br />
<br />
int main(int argc, char * argv[])<br />
{<br />
Display * dpy = NULL;<br />
Window win = 0;<br />
size_t length = 0;<br />
ssize_t bytes_read = 0;<br />
char * input = NULL;<br />
<br />
dpy = XOpenDisplay(getenv("DISPLAY"));<br />
if (dpy == NULL)<br />
{<br />
fprintf(stderr, "Can't open display, exiting.\n");<br />
exit(1);<br />
}<br />
win = DefaultRootWindow(dpy);<br />
<br />
while ((bytes_read = getline(&input, &length, stdin)) != EOF)<br />
{<br />
input[strlen(input) - 1] = '\0';<br />
XStoreName(dpy, win, input);<br />
XFlush(dpy);<br />
fprintf(stderr, "Input: %s", input);<br />
fprintf(stderr, "\nbytes read: %ld\n", bytes_read);<br />
}<br />
free(input);<br />
return 0;<br />
}<br />
<br />
Save this code to file dwm-setstatus.c, compile:<br />
$ gcc dwm-setstatus.c -lX11 -o dwm-setstatus<br />
move 'dwm-setstatus' within your $PATH (/usr/local/bin, for example)<br />
# mv dwm-setstatus /usr/local/bin<br />
and run:<br />
$ conky | dwm-setstatus<br />
<br />
To do this, conky needs to be told to output text to the console only. The following is a sample conkyrc for a dual core CPU, displaying several usage statistics:<br />
{{bc|<br />
<nowiki>conky.config = {<br />
out_to_console = true,<br />
out_to_x = false,<br />
background = false,<br />
update_interval = 2,<br />
total_run_times = 0,<br />
use_spacer = 'none',<br />
};<br />
conky.text = [[<br />
$mpd_smart :: ${cpu cpu1}% / ${cpu cpu2}% ${loadavg 1} ${loadavg 2 3} :: ${acpitemp}c :: $memperc% ($mem) :: ${downspeed eth0}K/s ${upspeed eth0}K/s :: ${time %a %b %d %I:%M%P}<br />
]];</nowiki><br />
}}<br />
<br />
For icons and color options, see [[dzen]].<br />
<br />
=== Restart dwm ===<br />
<br />
To restart dwm without logging out or closing applications, change or add a startup script so that it loads dwm in a ''while'' loop, for example:<br />
{{bc|<br />
while true; do<br />
# Log stderror to a file <br />
dwm 2> ~/.dwm.log<br />
# No error logging<br />
#dwm >/dev/null 2>&1<br />
done<br />
}}<br />
<br />
dwm can now be restarted without destroying other X windows by pressing the usual Mod-Shift-Q combination.<br />
<br />
It is a good idea to place the above startup script into a separate file, {{ic|~/bin/startdwm}} for instance, and execute it through {{ic|~/.xinitrc}}. From this point on, when you wish to end the X session, simply execute {{Ic|killall xinit}}, or bind it to a convenient keybind. Alternatively, you could setup your dwm session script so that it relaunches dwm only if the binary changes. This could be useful in the case where you change a setting or update the dwm code base.<br />
<br />
{{bc|1=<br />
# relaunch DWM if the binary changes, otherwise bail<br />
csum=""<br />
new_csum=$(sha1sum $(which dwm))<br />
while true<br />
do<br />
if [ "$csum" != "$new_csum" ]<br />
then<br />
csum=$new_csum<br />
dwm<br />
else<br />
exit 0<br />
fi<br />
new_csum=$(sha1sum $(which dwm))<br />
sleep 0.5<br />
done<br />
}}<br />
<br />
=== Bind the right Alt key to Mod4 ===<br />
<br />
When using Mod4 (the Super/Windows Key) as the {{Ic|MODKEY}}, it may be equally convenient to have the right {{ic|Alt}} key ({{ic|Alt_R}}) act as {{ic|Mod4}}. This will allow you to perform otherwise awkward keystrokes one-handed, such as zooming with {{ic|Alt_R}}+{{ic|Enter}}. <br />
<br />
First, find out which keycode is assigned to {{ic|Alt_R}}:<br />
xmodmap -pke | grep Alt_R<br />
<br />
Then simply add the following to the startup script (e.g. {{ic|~/.xinitrc}}), changing the keycode ''113'' if necessary to the result gathered by the previous {{Ic|xmodmap}} command:<br />
xmodmap -e "keycode 113 = Super_L" # reassign Alt_R to Super_L<br />
xmodmap -e "remove mod1 = Super_L" # make sure X keeps it out of the mod1 group<br />
<br />
After doing so, any functions that are triggered by the {{ic|Super_L}} key press will also be triggered by an {{ic|Alt_R}} key press.<br />
<br />
{{note|There is a {{ic|#define}} option in [[#Configuration|config.h]] which also allows you to switch the modkey.}}<br />
<br />
=== Use both Alt keys as Meta in DWM ===<br />
<br />
:Use xmodmap to assign Alt_L as a secondary meta key in DWM (provided already using Mod1Mask (Alt_R))<br />
<br />
{{hc|~/.xinitrc|<nowiki><br />
/usr/bin/xmodmap -e "clear mod5"<br />
/usr/bin/xmodmap -e "keycode 108 = Alt_L"<br />
</nowiki>}}<br />
{{User:cirrus|00:25, 24 November 2020 (GMT)}}<br />
<br />
=== Space around font in dwm's bar ===<br />
<br />
By default, dwm's bar adds 2px around the size of the font. To change this, modify the following line in {{ic|dwm.c}}:<br />
{{bc|1=bh = dc.h = dc.font.height + 2;}}<br />
<br />
=== Disable focus follows mouse ===<br />
<br />
To disable focus follows mouse behaviour comment out the following line in definiton of struct handler in {{ic|dwm.c}} <br />
{{bc|1=[EnterNotify] = enternotify, }}<br />
Note that this change can cause some difficulties; the first click on an inactive window will only bring the focus to it. To interact with window contents (buttons, fields etc) you need to click again. Also, if you have several monitors, you may notice that the keyboard focus does not switch to another monitor activated by clicking.<br />
<br />
=== Floating layout for some windows ===<br />
<br />
For some windows, such as preferences dialogs, it does not make sense for these windows to be tiled - they should be free-floating instead. For example, to make Firefox's preferences dialog float, add the following to your rules array in {{ic|config.h}}:<br />
<br />
{ "Firefox", NULL, "Firefox Preferences", 1 << 8, True, -1 },<br />
<br />
=== Using Tilda with dwm ===<br />
<br />
dwm can manages placement of windows automatically, so it takes some configuration to make [[Tilda]] work properly.<br />
<br />
You have to edit dwm's {{ic|config.h}} and recompile/reinstall dwm to properly account for Tilda.<br />
<br />
Get the latest [[PKGBUILD]] for dwm:<br />
# asp export community/dwm<br />
<br />
Copy newest sources to your working directory, I am using {{ic|~/sources}}:<br />
$ cp -r /var/abs/community/dwm ~/sources<br />
<br />
Get into working directory to start config:<br />
$ cd ~/sources/dwm<br />
<br />
Edit config.h:<br />
{{bc|1=static const Rule rules[] = {<br />
/* class instance title tags mask isfloating monitor */<br />
{ "Gimp", NULL, NULL, 0, True, -1 },<br />
{ "firefox", NULL, NULL, 1 << 8, False, -1 },<br />
//add the line below<br />
{ "Tilda", NULL, NULL, 0, True, -1 },<br />
{ "Volumeicon", NULL, NULL, 0, True, -1 },<br />
};}}<br />
<br />
The above makes all windows with the WM_CLASS "Tilda" floating. The word "Tilda" has to be uppercase (firefox needs lowercase), as shown by<br />
<br />
$ xprop |grep WM_CLASS<br />
<br />
Save {{ic|config.h}}, then compile and install dwm:<br />
<br />
$ makepkg -g >> PKGBUILD && makepkg -efi<br />
<br />
Start dwm or restart dwm if it is already active, either by MOD+SHIFT+Q or killing dwm and restarting it.<br />
<br />
Launch tilda with -C option:<br />
<br />
$ tilda -C<br />
<br />
Now you can configure Tilda, the following options are provided as a recommendation:<br />
<br />
{{bc|Font: Clean 9<br />
Appearance: Height: 50%, Width: 70%, Centered Horizontally<br />
Extras: Enable Transparency Level 15<br />
Animated Pulldown: 1500 usec, Orientation: Top<br />
Colors: Built-in Scheme "Green on Black"<br />
Scrolling: Scrollbar is on the left, 2000 lines scrollback<br />
Key Binding: F9<br />
}}<br />
<br />
Here is what the configuration looks like after those settings in {{ic|~/.config/tilda/config_0}}:<br />
<br />
{{bc|1=<br />
tilda_config_version = "0.9.6"<br />
# image = ""<br />
# command = ""<br />
font = "Clean 9"<br />
key = "F9"<br />
title = "Tilda"<br />
background_color = "white"<br />
# working_dir = ""<br />
web_browser = "firefox"<br />
lines = 2000<br />
max_width = 956<br />
max_height = 384<br />
min_width = 1<br />
min_height = 1<br />
transparency = 15<br />
x_pos = 205<br />
y_pos = 1<br />
tab_pos = 0<br />
backspace_key = 0<br />
delete_key = 1<br />
d_set_title = 3<br />
command_exit = 2<br />
scheme = 1<br />
slide_sleep_usec = 1500<br />
animation_orientation = 0<br />
scrollbar_pos = 0<br />
back_red = 0<br />
back_green = 0<br />
back_blue = 0<br />
text_red = 0<br />
text_green = 65535<br />
text_blue = 0<br />
scroll_background = true<br />
scroll_on_output = false<br />
notebook_border = false<br />
antialias = true<br />
scrollbar = false<br />
use_image = false<br />
grab_focus = true<br />
above = true<br />
notaskbar = true<br />
bold = true<br />
blinks = true<br />
scroll_on_key = true<br />
bell = false<br />
run_command = false<br />
pinned = true<br />
animation = true<br />
hidden = true<br />
centered_horizontally = true<br />
centered_vertically = false<br />
enable_transparency = true<br />
double_buffer = false<br />
}}<br />
<br />
It is important you enable the pulldown-animation, otherwise Tilda will keep jumping down each time you unhide it, must be a dwm issue.<br />
<br />
== Troubleshooting ==<br />
<br />
=== Fixing misbehaving Java applications ===<br />
<br />
Try setting <code>export _JAVA_AWT_WM_NONREPARENTING=1</code>. Also see the [[Java#Gray window, applications not resizing with WM, menus immediately closing|Java]] page.<br />
<br />
=== Fixing gaps around terminal windows ===<br />
<br />
If there are empty gaps of desktop space outside terminal windows, it is likely due to the terminal's font size. Either adjust the size until finding the ideal scale that closes the gap, or toggle {{Ic|resizehints}} to ''0'' in {{ic|config.h}}.<br />
<br />
This will cause dwm to ignore resize requests from all client windows, not just terminals. The downside to this workaround is that some terminals may suffer redraw anomalies, such as ghost lines and premature line wraps, among others.<br />
<br />
Alternatively, if you use the [[st]] terminal emulator, you can apply the [https://st.suckless.org/patches/anysize/ anysize] patch and recompile st.<br />
<br />
== Known issues ==<br />
<br />
=== Crashes due to Emojis in some fonts ===<br />
<br />
Emojis in title bars may cause dwm to crash with an error similar to the following:<br />
<br />
dwm: fatal error: request code=140, error code=16<br />
X Error of failed request: BadLength (poly request too large or internal Xlib length error)<br />
Major opcode of failed request: 140 (RENDER)<br />
Minor opcode of failed request: 20 (RenderAddGlyphs)<br />
Serial number of failed request: 4319<br />
Current serial number in output stream: 4331<br />
<br />
This only occurs with some fonts, such as {{pkg|noto-fonts-emoji}} and {{pkg|bdf-unifont}}. See [https://lists.suckless.org/dev/1608/30245.html], [https://lists.suckless.org/dev/1610/30710.html], [https://bbs.archlinux.org/viewtopic.php?id=226928], [https://www.reddit.com/r/archlinux/comments/703ayu/anyone_with_dwm_and_notofontsemoji/], and the upstream bug report [https://gitlab.freedesktop.org/xorg/lib/libxft/issues/6]. Possible workarounds are using a different font or the patch in [https://lists.suckless.org/dev/1610/30720.html].<br />
<br />
An upstream fix has been proposed [https://gitlab.freedesktop.org/xorg/lib/libxft/merge_requests/1], but as of writing has not been merged. See {{AUR|libxft-bgra}} and {{AUR|lib32-libxft-bgra}} for patched versions of libXft, properly displaying emoji without crashing.<br />
<br />
== See also ==<br />
<br />
* [https://dwm.suckless.org/ dwm's official website]<br />
* [http://www.youtube.com/watch?v=GQ5s6T25jCc Introduction to dwm video]<br />
* [[dmenu]] - Simple application launcher from the developers of dwm<br />
* The [https://bbs.archlinux.org/viewtopic.php?id=57549/ dwm thread] on the forums<br />
* [https://bbs.archlinux.org/viewtopic.php?id=92895/ Hacking dwm thread]<br />
* Check out the forums' [https://bbs.archlinux.org/viewtopic.php?id=57768/ wallpaper thread] for a selection of dwm wallpapers<br />
*[https://bbs.archlinux.org/viewtopic.php?id=74599 Show off your dwm configuration forum thread]</div>Cirrushttps://wiki.archlinux.org/index.php?title=Talk:NVIDIA&diff=643196Talk:NVIDIA2020-12-04T00:01:42Z<p>Cirrus: /* GPU at 0000:0X:00.0 has fallen off the bus. */</p>
<hr />
<div>== TV-Out ==<br />
<br />
NVoption Online Version - great tool to make tv-out easy and fast <br />
<br />
[I'm using gmplayer with gl and twinview]<br />
[http://www.sorgonet.com/linux/nv-online/]http://www.sorgonet.com/linux/nv-online/ {{Unsigned|01:23, 23 March 2006|Suw}}<br />
<br />
:A user found this useful to get TV-Out working with an old Geforce 2 MX: {{AUR|nvtv}} -- [[User:Alad|Alad]] ([[User talk:Alad|talk]]) 13:56, 3 March 2016 (UTC)<br />
<br />
== '/dev/nvidia0' Input/Output error... suggested fixes ==<br />
<br />
Can anyone verify that the BIOS related suggestions work and are not coincidentally set (either automatically when changing the IRQ or turning off ACPI) while troubleshooting? I have found little information that confirms any of the suggestions would work. The file permissions thing seems to be completely unfounded and never works (as noted in the article) that I could find. It would probably be a good idea if we cleaned out items that have not been verified to work. For my setup I was having this error and none of the items in the wiki nor the many file permission search results worked. -- [[User:Clickthem|click, them so hard]] 19:16, 4 March 2012 (EST)<br />
:I've added an Accuracy template, please next time add it yourself so that discussions like this are more visible. -- [[User:Kynikos|Kynikos]] 05:40, 6 March 2012 (EST)<br />
<br />
== Run a test ==<br />
<br />
There is confusing paragraph saying ''You can run a test to see if the Xorg server will function correctly without a configuration file.''. IMHO, it should be clarified what kind of test the author has in mind, an exact command would be helpful. Currently, this suggestion is simply confusing, especially to less experienced users. --[[User:Mloskot|Mloskot]] ([[User talk:Mloskot|talk]]) 19:52, 26 November 2012 (UTC)<br />
<br />
: It's strange. I agree. The link goes to the section for running X. After a beat, I realized you simply try to launch X. And in my case the screen was black. So the "test" failed. A better instruction might say to try launching launching X, and then provide the link which describes all the ways this is done--depending on your configuration. [[User:Xtian|Xtian]] ([[User talk:Xtian|talk]]) 22:05, 21 October 2017 (UTC)<br />
<br />
: Over 7 years after the original comment (with which I agree), I've amended the labelling of that link to remove the suggestion that the reader will find a test described there. --[[User:Ghepardo|Ghepardo]] ([[User talk:Ghepardo|talk]]) 17:44, 29 March 2020 (UTC)<br />
<br />
== nvidia-xconfig ==<br />
<br />
Several of the commands which are suggested to be run with nvidia-xconfig (such as nvidia-xconfig --twinview) don't work with the current nvidia packages in the repository. I just went through setting mine up so I intend to clean up the ones that I can from my experience. Some don't seem to have a 1:1 replacement (there is a --dynamic-twinview argument now; is that the same as --twinview was?). [[User:Techprophet|Teh]] ([[User talk:Techprophet|talk]]) 13:10, 20 June 2013 (UTC)<br />
<br />
While it shouldn't be necessary to use xconfig to get nvidia working on X, creating a 20-nvidia.conf file is an integral step to fix screen tearing for people that suffer from that issue. Perhaps this section should have this explained and include a link to the nvidia troubleshooting article which contains the section about fixing screen tearing? --[[User:TheChickenMan|TheChickenMan]] ([[User talk:TheChickenMan|talk]]) 21:54, 22 December 2016 (UTC)<br />
<br />
:Troubleshooting sections link to the main documentation, not vice versa. Otherwise there would be no point in having separate troubleshooting sections. -- [[User:Lahwaacz|Lahwaacz]] ([[User talk:Lahwaacz|talk]]) 22:03, 22 December 2016 (UTC)<br />
<br />
== Accuracy of driver selection ==<br />
<br />
[https://bbs.archlinux.org/viewtopic.php?id=189859 A thread on the forums] revealed that nvidia is more conservative in their suggestion than needed and checking their website tells you to use an older driver (nvidia-340xx) while the latest 'nvidia' one will do just fine. [https://bbs.archlinux.org/viewtopic.php?pid=1475567#p1475567 Gusar suggested] the removal of the second point in [https://wiki.archlinux.org/index.php/NVIDIA#Installation the 'Installing' section]. Do we want to get rid of this potentially useful, although somewhat confusing info? -- [[User:Karol|Karol]] ([[User talk:Karol|talk]]) 02:52, 15 November 2014 (UTC)<br />
<br />
:Well, I've [https://wiki.archlinux.org/index.php?title=NVIDIA&diff=344863&oldid=344745 rewritten] the second point to make it clearer, I hope I got it correctly. However steps 2 and 3 there should probably merged into one, because they deal with the same problem, i.e. finding the correct driver to install. Maybe we could use a table? (just brainstorming). -- [[User:Kynikos|Kynikos]] ([[User talk:Kynikos|talk]]) 03:47, 16 November 2014 (UTC)<br />
<br />
== Compositing ==<br />
<br />
I think it could be helpful for anyone that's still using X server to be guided on setting up compositing.<br />
<br />
One way to update the Xorg.conf file to enable composition is to use the nvidia command line tool:<br />
# nvidia-xconfig --composite<br />
<br />
The other is to edit the file manually, as per the example below adding the Composite Option to the Extensions section of /etc/X11/xorg.conf:<br />
<br />
Section "Extensions"<br />
Option "Composite" "Enable"<br />
EndSection<br />
<br />
For those running KDE, to check if compositing is enabled they can run the following command, compositing information is at the end of the output:<br />
$ qdbus org.kde.KWin /KWin supportInformation<br />
[[User:Esdaniel|Esdaniel]] ([[User talk:Esdaniel|talk]]) 06:25, 16 October 2017 (UTC)<br />
<br />
<br />
== xorg-server 1.20 ==<br />
Seems with xorg 1.20 some nvidia packages are not supported anymore e.g. nvidia-340xx - no matiching ABI.<br />
Should we insert a warning?<br />
[[User:Ua4000|Ua4000]] ([[User talk:Ua4000|talk]]) 07:03, 20 May 2018 (UTC)<br />
<br />
== PRIME Render Offload in closed-source drivers ==<br />
<br />
Is offload is supported now in these drivers?<br />
https://download.nvidia.com/XFree86/Linux-x86_64/435.21/README/primerenderoffload.html<br />
[[User:DragonX256|DragonX256]] ([[User talk:DragonX256|talk]]) 05:01, 30 August 2019 (UTC)<br />
<br />
== Experimental Power Management features (for preserving video memory across suspension) ==<br />
<br />
[[User:Lahwaacz]]:<br />
<br />
=== "Power Management" - misleading ===<br />
How is this ''misleading''? It is a descriptive term, the ''official'' term that NVIDIA uses, and also the term used by maintainers of the nvidia-utils package (see [https://github.com/archlinux/svntogit-packages/commit/1b11f516479c2a101c3a5855f26ac71a90fafb69]). Sure, it's confusing that ''Power Management'' and ''Dynamic Power Management'' are quite different beasts, but it's even more confusing to censor the phrase "Power Management" altogether from the section. We should really mention "Power Management" or "Power Management Support" somewhere in that section.<br />
<br />
In case it's not clear, power management refers to suspend-to-RAM and suspend-to-disk computer features, this isn't an NVIDIA specific thing, or anything new ... [[User:Neven|Neven]] ([[User talk:Neven|talk]]) 22:00, 8 September 2020 (UTC)<br />
<br />
:The purpose of this wiki is to make things clearer, not to copy-paste from official manuals. If nvidia uses misleading wording, there is no reason to follow that. -- [[User:Lahwaacz|Lahwaacz]] ([[User talk:Lahwaacz|talk]]) 08:09, 9 September 2020 (UTC)<br />
:: Again, how is it misleading? As I clearly said in my above comment, which it appears you couldn't bother reading in its entirety, the fact that ''power management'' includes system sleep is long established semantics, common throughout the computing world (not NVIDIA specific). [[User:Neven|Neven]] ([[User talk:Neven|talk]]) 10:21, 9 September 2020 (UTC)<br />
<br />
:::I agree that the fact that "power management" includes system sleep is long established semantics when you talk about ''system'' power management, but I disagree that "power management" is the best term to describe what is going on here. The nvidia driver connects to the suspend pipeline to save the GPU state, including (part of) the video memory. The purpose of the "new" method is to save full video memory, which is purely a visual convenience thing, and some "advanced" CUDA state. There is nothing related to saving or otherwise managing power of the GPU, which is why I find the term "power management" inappropriate for this section. The section should use terms which clearly describe what is going on. -- [[User:Lahwaacz|Lahwaacz]] ([[User talk:Lahwaacz|talk]]) 14:42, 9 September 2020 (UTC)<br />
<br />
=== Common configuration ===<br />
Well, it's new, of course not everybody is using it; but, at least on my system, chromium (and other heavy GPU users, too, I assume) is currently unusable (more correctly - unviewable) after resuming from system sleep without this feature. Surely this is will become a very common configuration for NVIDIA users soon, at least those that also need to suspend their system. [[User:Neven|Neven]] ([[User talk:Neven|talk]]) 22:00, 8 September 2020 (UTC)<br />
<br />
:It might be new because nvidia added it in a recent driver version, not because few people use it. The fact that your system needs it does not make it common. -- [[User:Lahwaacz|Lahwaacz]] ([[User talk:Lahwaacz|talk]]) 08:09, 9 September 2020 (UTC)<br />
<br />
=== Experimental ===<br />
I'm not sure what are you asking exactly, it seems like it's a question directed more at NVIDIA than at me; but I can say that it seems like it's not perfect yet, as I had some worrying messages in dmesg after resuming with the new features enabled and Chromium running. Everything seemed to be OK apart from the messages, though, so clearly a great improvement. [[User:Neven|Neven]] ([[User talk:Neven|talk]]) 22:00, 8 September 2020 (UTC)<br />
<br />
=== Upstream documentation ===<br />
Linked in the second sentence of the section, also available in nvidia-utils package (powermanagement.html). Titled "Chapter 21. Configuring Power Management Support". [[User:Neven|Neven]] ([[User talk:Neven|talk]]) 22:00, 8 September 2020 (UTC)<br />
<br />
== Update #Unsupported drivers (390xx) for GF117M ==<br />
<br />
3. Install the appropriate driver for your card:<br />
For GeForce 400/500/600 series cards [NVCx and NVDx] from around 2010-2011, install the nvidia-390xx-dkmsAUR package.<br />
<br />
change to:<br />
For GeForce 400/500/600/710M/720M/810M/820M series cards [NVCx, NVDx and GF117M] from around 2010-2014, install the nvidia-390xx-dkmsAUR package.<br />
<br />
{{Unsigned|00:59, 28 September 2020 (UTC)|Nullstric}}<br />
<br />
== <s>Kernel 5.9 and Nvidia</s> ==<br />
<br />
Update: It seems that more parts, like Vulkan Raytracing, NVENC etc. are also affected.<br />
<br />
It seems that "only" CUDA and OpenCL are affected.<br />
Other functionalities seem to work.<br />
<br />
Look at Bugreport for details: https://bugs.archlinux.org/task/68312<br />
<br />
[[User:G3ro|G3ro]] ([[User talk:G3ro|talk]]) 15:13, 20 October 2020 (UTC) G3ro<br />
<br />
:The bug report is already closed. -- [[User:Lahwaacz|Lahwaacz]] ([[User talk:Lahwaacz|talk]]) 19:27, 25 November 2020 (UTC)<br />
<br />
== GPU at 0000:0X:00.0 has fallen off the bus. ==<br />
<br />
:Whilst using the nvidia driver with linux and linux-ck my machine randomly freezes with only this in journal, currently using Geforce GTS 450 with the 390xx driver, similar thread on [https://bbs.archlinux.org/viewtopic.php?id=229353/see BBS]<br />
<br />
{{C|<br />
Nov 24 15:55:56 archlinux kernel: NVRM: loading NVIDIA UNIX x86_64 Kernel Module 390.138 Thu May 14 01:01:53 PDT 2020 (using threaded interrupts)<br />
Nov 24 16:04:49 hawker64 kernel: NVRM: GPU at PCI:0000:02:00: GPU-feeae056-097a-fe32-3f56-3732296882d2<br />
Nov 24 16:04:49 hawker64 kernel: NVRM: Xid (PCI:0000:02:00): 79, GPU has fallen off the bus.<br />
Nov 24 16:04:49 hawker64 kernel: NVRM: GPU at 0000:02:00.0 has fallen off the bus.<br />
Nov 24 16:04:49 hawker64 kernel: NVRM: A GPU crash dump has been created. If possible, please run<br />
NVRM: nvidia-bug-report.sh as root to collect this data before<br />
NVRM: the NVIDIA kernel module is unloaded. <br />
}}<br />
<br />
:A search on [https://bbs.archlinux.org/viewtopic.php?id=217540/see BBS]shows that its a known common issue and apparently the error message is somewhat generic and could be down to faulty hardware or a regression in driver or other software, reseating card in PCI slot is advised, i have removed the nvidia-drm.modeset=1 parameter and all is well for now. putting the graphics card into persistent mode: sudo nvidia-smi -pm 1 apparently works for some.<br />
:[edit] Further testing results in same errors even without the nvidia-drm.modeset=1 parameter, perusing nvidia forums suggests parameter pcie_aspm=off works for some users, so im now trying this.<br />
:[update] pcie_aspm=off did not rectify maters, however since updating to kernel 5.9.12-2-ck-nehalem yesterday i've been freeze free. It would appear im not alone,according to this [https://www.reddit.com/r/linux/comments/k4r6nh/have_you_been_experiencing_unrecoverable_hard/ reddit thread]<br />
{{unsigned|16:17, 25 November 2020|Cirrus}}</div>Cirrushttps://wiki.archlinux.org/index.php?title=Talk:NVIDIA&diff=643195Talk:NVIDIA2020-12-03T23:59:30Z<p>Cirrus: /* GPU at 0000:0X:00.0 has fallen off the bus. */</p>
<hr />
<div>== TV-Out ==<br />
<br />
NVoption Online Version - great tool to make tv-out easy and fast <br />
<br />
[I'm using gmplayer with gl and twinview]<br />
[http://www.sorgonet.com/linux/nv-online/]http://www.sorgonet.com/linux/nv-online/ {{Unsigned|01:23, 23 March 2006|Suw}}<br />
<br />
:A user found this useful to get TV-Out working with an old Geforce 2 MX: {{AUR|nvtv}} -- [[User:Alad|Alad]] ([[User talk:Alad|talk]]) 13:56, 3 March 2016 (UTC)<br />
<br />
== '/dev/nvidia0' Input/Output error... suggested fixes ==<br />
<br />
Can anyone verify that the BIOS related suggestions work and are not coincidentally set (either automatically when changing the IRQ or turning off ACPI) while troubleshooting? I have found little information that confirms any of the suggestions would work. The file permissions thing seems to be completely unfounded and never works (as noted in the article) that I could find. It would probably be a good idea if we cleaned out items that have not been verified to work. For my setup I was having this error and none of the items in the wiki nor the many file permission search results worked. -- [[User:Clickthem|click, them so hard]] 19:16, 4 March 2012 (EST)<br />
:I've added an Accuracy template, please next time add it yourself so that discussions like this are more visible. -- [[User:Kynikos|Kynikos]] 05:40, 6 March 2012 (EST)<br />
<br />
== Run a test ==<br />
<br />
There is confusing paragraph saying ''You can run a test to see if the Xorg server will function correctly without a configuration file.''. IMHO, it should be clarified what kind of test the author has in mind, an exact command would be helpful. Currently, this suggestion is simply confusing, especially to less experienced users. --[[User:Mloskot|Mloskot]] ([[User talk:Mloskot|talk]]) 19:52, 26 November 2012 (UTC)<br />
<br />
: It's strange. I agree. The link goes to the section for running X. After a beat, I realized you simply try to launch X. And in my case the screen was black. So the "test" failed. A better instruction might say to try launching launching X, and then provide the link which describes all the ways this is done--depending on your configuration. [[User:Xtian|Xtian]] ([[User talk:Xtian|talk]]) 22:05, 21 October 2017 (UTC)<br />
<br />
: Over 7 years after the original comment (with which I agree), I've amended the labelling of that link to remove the suggestion that the reader will find a test described there. --[[User:Ghepardo|Ghepardo]] ([[User talk:Ghepardo|talk]]) 17:44, 29 March 2020 (UTC)<br />
<br />
== nvidia-xconfig ==<br />
<br />
Several of the commands which are suggested to be run with nvidia-xconfig (such as nvidia-xconfig --twinview) don't work with the current nvidia packages in the repository. I just went through setting mine up so I intend to clean up the ones that I can from my experience. Some don't seem to have a 1:1 replacement (there is a --dynamic-twinview argument now; is that the same as --twinview was?). [[User:Techprophet|Teh]] ([[User talk:Techprophet|talk]]) 13:10, 20 June 2013 (UTC)<br />
<br />
While it shouldn't be necessary to use xconfig to get nvidia working on X, creating a 20-nvidia.conf file is an integral step to fix screen tearing for people that suffer from that issue. Perhaps this section should have this explained and include a link to the nvidia troubleshooting article which contains the section about fixing screen tearing? --[[User:TheChickenMan|TheChickenMan]] ([[User talk:TheChickenMan|talk]]) 21:54, 22 December 2016 (UTC)<br />
<br />
:Troubleshooting sections link to the main documentation, not vice versa. Otherwise there would be no point in having separate troubleshooting sections. -- [[User:Lahwaacz|Lahwaacz]] ([[User talk:Lahwaacz|talk]]) 22:03, 22 December 2016 (UTC)<br />
<br />
== Accuracy of driver selection ==<br />
<br />
[https://bbs.archlinux.org/viewtopic.php?id=189859 A thread on the forums] revealed that nvidia is more conservative in their suggestion than needed and checking their website tells you to use an older driver (nvidia-340xx) while the latest 'nvidia' one will do just fine. [https://bbs.archlinux.org/viewtopic.php?pid=1475567#p1475567 Gusar suggested] the removal of the second point in [https://wiki.archlinux.org/index.php/NVIDIA#Installation the 'Installing' section]. Do we want to get rid of this potentially useful, although somewhat confusing info? -- [[User:Karol|Karol]] ([[User talk:Karol|talk]]) 02:52, 15 November 2014 (UTC)<br />
<br />
:Well, I've [https://wiki.archlinux.org/index.php?title=NVIDIA&diff=344863&oldid=344745 rewritten] the second point to make it clearer, I hope I got it correctly. However steps 2 and 3 there should probably merged into one, because they deal with the same problem, i.e. finding the correct driver to install. Maybe we could use a table? (just brainstorming). -- [[User:Kynikos|Kynikos]] ([[User talk:Kynikos|talk]]) 03:47, 16 November 2014 (UTC)<br />
<br />
== Compositing ==<br />
<br />
I think it could be helpful for anyone that's still using X server to be guided on setting up compositing.<br />
<br />
One way to update the Xorg.conf file to enable composition is to use the nvidia command line tool:<br />
# nvidia-xconfig --composite<br />
<br />
The other is to edit the file manually, as per the example below adding the Composite Option to the Extensions section of /etc/X11/xorg.conf:<br />
<br />
Section "Extensions"<br />
Option "Composite" "Enable"<br />
EndSection<br />
<br />
For those running KDE, to check if compositing is enabled they can run the following command, compositing information is at the end of the output:<br />
$ qdbus org.kde.KWin /KWin supportInformation<br />
[[User:Esdaniel|Esdaniel]] ([[User talk:Esdaniel|talk]]) 06:25, 16 October 2017 (UTC)<br />
<br />
<br />
== xorg-server 1.20 ==<br />
Seems with xorg 1.20 some nvidia packages are not supported anymore e.g. nvidia-340xx - no matiching ABI.<br />
Should we insert a warning?<br />
[[User:Ua4000|Ua4000]] ([[User talk:Ua4000|talk]]) 07:03, 20 May 2018 (UTC)<br />
<br />
== PRIME Render Offload in closed-source drivers ==<br />
<br />
Is offload is supported now in these drivers?<br />
https://download.nvidia.com/XFree86/Linux-x86_64/435.21/README/primerenderoffload.html<br />
[[User:DragonX256|DragonX256]] ([[User talk:DragonX256|talk]]) 05:01, 30 August 2019 (UTC)<br />
<br />
== Experimental Power Management features (for preserving video memory across suspension) ==<br />
<br />
[[User:Lahwaacz]]:<br />
<br />
=== "Power Management" - misleading ===<br />
How is this ''misleading''? It is a descriptive term, the ''official'' term that NVIDIA uses, and also the term used by maintainers of the nvidia-utils package (see [https://github.com/archlinux/svntogit-packages/commit/1b11f516479c2a101c3a5855f26ac71a90fafb69]). Sure, it's confusing that ''Power Management'' and ''Dynamic Power Management'' are quite different beasts, but it's even more confusing to censor the phrase "Power Management" altogether from the section. We should really mention "Power Management" or "Power Management Support" somewhere in that section.<br />
<br />
In case it's not clear, power management refers to suspend-to-RAM and suspend-to-disk computer features, this isn't an NVIDIA specific thing, or anything new ... [[User:Neven|Neven]] ([[User talk:Neven|talk]]) 22:00, 8 September 2020 (UTC)<br />
<br />
:The purpose of this wiki is to make things clearer, not to copy-paste from official manuals. If nvidia uses misleading wording, there is no reason to follow that. -- [[User:Lahwaacz|Lahwaacz]] ([[User talk:Lahwaacz|talk]]) 08:09, 9 September 2020 (UTC)<br />
:: Again, how is it misleading? As I clearly said in my above comment, which it appears you couldn't bother reading in its entirety, the fact that ''power management'' includes system sleep is long established semantics, common throughout the computing world (not NVIDIA specific). [[User:Neven|Neven]] ([[User talk:Neven|talk]]) 10:21, 9 September 2020 (UTC)<br />
<br />
:::I agree that the fact that "power management" includes system sleep is long established semantics when you talk about ''system'' power management, but I disagree that "power management" is the best term to describe what is going on here. The nvidia driver connects to the suspend pipeline to save the GPU state, including (part of) the video memory. The purpose of the "new" method is to save full video memory, which is purely a visual convenience thing, and some "advanced" CUDA state. There is nothing related to saving or otherwise managing power of the GPU, which is why I find the term "power management" inappropriate for this section. The section should use terms which clearly describe what is going on. -- [[User:Lahwaacz|Lahwaacz]] ([[User talk:Lahwaacz|talk]]) 14:42, 9 September 2020 (UTC)<br />
<br />
=== Common configuration ===<br />
Well, it's new, of course not everybody is using it; but, at least on my system, chromium (and other heavy GPU users, too, I assume) is currently unusable (more correctly - unviewable) after resuming from system sleep without this feature. Surely this is will become a very common configuration for NVIDIA users soon, at least those that also need to suspend their system. [[User:Neven|Neven]] ([[User talk:Neven|talk]]) 22:00, 8 September 2020 (UTC)<br />
<br />
:It might be new because nvidia added it in a recent driver version, not because few people use it. The fact that your system needs it does not make it common. -- [[User:Lahwaacz|Lahwaacz]] ([[User talk:Lahwaacz|talk]]) 08:09, 9 September 2020 (UTC)<br />
<br />
=== Experimental ===<br />
I'm not sure what are you asking exactly, it seems like it's a question directed more at NVIDIA than at me; but I can say that it seems like it's not perfect yet, as I had some worrying messages in dmesg after resuming with the new features enabled and Chromium running. Everything seemed to be OK apart from the messages, though, so clearly a great improvement. [[User:Neven|Neven]] ([[User talk:Neven|talk]]) 22:00, 8 September 2020 (UTC)<br />
<br />
=== Upstream documentation ===<br />
Linked in the second sentence of the section, also available in nvidia-utils package (powermanagement.html). Titled "Chapter 21. Configuring Power Management Support". [[User:Neven|Neven]] ([[User talk:Neven|talk]]) 22:00, 8 September 2020 (UTC)<br />
<br />
== Update #Unsupported drivers (390xx) for GF117M ==<br />
<br />
3. Install the appropriate driver for your card:<br />
For GeForce 400/500/600 series cards [NVCx and NVDx] from around 2010-2011, install the nvidia-390xx-dkmsAUR package.<br />
<br />
change to:<br />
For GeForce 400/500/600/710M/720M/810M/820M series cards [NVCx, NVDx and GF117M] from around 2010-2014, install the nvidia-390xx-dkmsAUR package.<br />
<br />
{{Unsigned|00:59, 28 September 2020 (UTC)|Nullstric}}<br />
<br />
== <s>Kernel 5.9 and Nvidia</s> ==<br />
<br />
Update: It seems that more parts, like Vulkan Raytracing, NVENC etc. are also affected.<br />
<br />
It seems that "only" CUDA and OpenCL are affected.<br />
Other functionalities seem to work.<br />
<br />
Look at Bugreport for details: https://bugs.archlinux.org/task/68312<br />
<br />
[[User:G3ro|G3ro]] ([[User talk:G3ro|talk]]) 15:13, 20 October 2020 (UTC) G3ro<br />
<br />
:The bug report is already closed. -- [[User:Lahwaacz|Lahwaacz]] ([[User talk:Lahwaacz|talk]]) 19:27, 25 November 2020 (UTC)<br />
<br />
== GPU at 0000:0X:00.0 has fallen off the bus. ==<br />
<br />
:Whilst using the nvidia driver with linux and linux-ck my machine randomly freezes with only this in journal, currently using Geforce GTS 450 with the 390xx driver, similar thread on [https://bbs.archlinux.org/viewtopic.php?id=229353/see BBS]<br />
<br />
{{C|<br />
Nov 24 15:55:56 archlinux kernel: NVRM: loading NVIDIA UNIX x86_64 Kernel Module 390.138 Thu May 14 01:01:53 PDT 2020 (using threaded interrupts)<br />
Nov 24 16:04:49 hawker64 kernel: NVRM: GPU at PCI:0000:02:00: GPU-feeae056-097a-fe32-3f56-3732296882d2<br />
Nov 24 16:04:49 hawker64 kernel: NVRM: Xid (PCI:0000:02:00): 79, GPU has fallen off the bus.<br />
Nov 24 16:04:49 hawker64 kernel: NVRM: GPU at 0000:02:00.0 has fallen off the bus.<br />
Nov 24 16:04:49 hawker64 kernel: NVRM: A GPU crash dump has been created. If possible, please run<br />
NVRM: nvidia-bug-report.sh as root to collect this data before<br />
NVRM: the NVIDIA kernel module is unloaded. <br />
}}<br />
<br />
:A search on [https://bbs.archlinux.org/viewtopic.php?id=217540/see BBS]shows that its a known common issue and apparently the error message is somewhat generic and could be down to faulty hardware or a regression in driver or other software, reseating card in PCI slot is advised, i have removed the nvidia-drm.modeset=1 parameter and all is well for now. putting the graphics card into persistent mode: sudo nvidia-smi -pm 1 apparently works for some.<br />
:[edit] Further testing results in same errors even without the nvidia-drm.modeset=1 parameter, perusing nvidia forums suggests parameter pcie_aspm=off works for some users, so im now trying this.<br />
:{update] pcie_aspm=off did not rectify maters, however since updating to kernel 5.9.12-2-ck-nehalem yesterday i've been freeze free. It would appear im not alone,according to this [https://www.reddit.com/r/linux/comments/k4r6nh/have_you_been_experiencing_unrecoverable_hard/ reddit thread]<br />
{{unsigned|16:17, 25 November 2020|Cirrus}}</div>Cirrushttps://wiki.archlinux.org/index.php?title=Talk:NVIDIA&diff=642616Talk:NVIDIA2020-11-28T00:46:23Z<p>Cirrus: /* GPU at 0000:0X:00.0 has fallen off the bus. */</p>
<hr />
<div>== TV-Out ==<br />
<br />
NVoption Online Version - great tool to make tv-out easy and fast <br />
<br />
[I'm using gmplayer with gl and twinview]<br />
[http://www.sorgonet.com/linux/nv-online/]http://www.sorgonet.com/linux/nv-online/ {{Unsigned|01:23, 23 March 2006|Suw}}<br />
<br />
:A user found this useful to get TV-Out working with an old Geforce 2 MX: {{AUR|nvtv}} -- [[User:Alad|Alad]] ([[User talk:Alad|talk]]) 13:56, 3 March 2016 (UTC)<br />
<br />
== '/dev/nvidia0' Input/Output error... suggested fixes ==<br />
<br />
Can anyone verify that the BIOS related suggestions work and are not coincidentally set (either automatically when changing the IRQ or turning off ACPI) while troubleshooting? I have found little information that confirms any of the suggestions would work. The file permissions thing seems to be completely unfounded and never works (as noted in the article) that I could find. It would probably be a good idea if we cleaned out items that have not been verified to work. For my setup I was having this error and none of the items in the wiki nor the many file permission search results worked. -- [[User:Clickthem|click, them so hard]] 19:16, 4 March 2012 (EST)<br />
:I've added an Accuracy template, please next time add it yourself so that discussions like this are more visible. -- [[User:Kynikos|Kynikos]] 05:40, 6 March 2012 (EST)<br />
<br />
== Run a test ==<br />
<br />
There is confusing paragraph saying ''You can run a test to see if the Xorg server will function correctly without a configuration file.''. IMHO, it should be clarified what kind of test the author has in mind, an exact command would be helpful. Currently, this suggestion is simply confusing, especially to less experienced users. --[[User:Mloskot|Mloskot]] ([[User talk:Mloskot|talk]]) 19:52, 26 November 2012 (UTC)<br />
<br />
: It's strange. I agree. The link goes to the section for running X. After a beat, I realized you simply try to launch X. And in my case the screen was black. So the "test" failed. A better instruction might say to try launching launching X, and then provide the link which describes all the ways this is done--depending on your configuration. [[User:Xtian|Xtian]] ([[User talk:Xtian|talk]]) 22:05, 21 October 2017 (UTC)<br />
<br />
: Over 7 years after the original comment (with which I agree), I've amended the labelling of that link to remove the suggestion that the reader will find a test described there. --[[User:Ghepardo|Ghepardo]] ([[User talk:Ghepardo|talk]]) 17:44, 29 March 2020 (UTC)<br />
<br />
== nvidia-xconfig ==<br />
<br />
Several of the commands which are suggested to be run with nvidia-xconfig (such as nvidia-xconfig --twinview) don't work with the current nvidia packages in the repository. I just went through setting mine up so I intend to clean up the ones that I can from my experience. Some don't seem to have a 1:1 replacement (there is a --dynamic-twinview argument now; is that the same as --twinview was?). [[User:Techprophet|Teh]] ([[User talk:Techprophet|talk]]) 13:10, 20 June 2013 (UTC)<br />
<br />
While it shouldn't be necessary to use xconfig to get nvidia working on X, creating a 20-nvidia.conf file is an integral step to fix screen tearing for people that suffer from that issue. Perhaps this section should have this explained and include a link to the nvidia troubleshooting article which contains the section about fixing screen tearing? --[[User:TheChickenMan|TheChickenMan]] ([[User talk:TheChickenMan|talk]]) 21:54, 22 December 2016 (UTC)<br />
<br />
:Troubleshooting sections link to the main documentation, not vice versa. Otherwise there would be no point in having separate troubleshooting sections. -- [[User:Lahwaacz|Lahwaacz]] ([[User talk:Lahwaacz|talk]]) 22:03, 22 December 2016 (UTC)<br />
<br />
== Accuracy of driver selection ==<br />
<br />
[https://bbs.archlinux.org/viewtopic.php?id=189859 A thread on the forums] revealed that nvidia is more conservative in their suggestion than needed and checking their website tells you to use an older driver (nvidia-340xx) while the latest 'nvidia' one will do just fine. [https://bbs.archlinux.org/viewtopic.php?pid=1475567#p1475567 Gusar suggested] the removal of the second point in [https://wiki.archlinux.org/index.php/NVIDIA#Installation the 'Installing' section]. Do we want to get rid of this potentially useful, although somewhat confusing info? -- [[User:Karol|Karol]] ([[User talk:Karol|talk]]) 02:52, 15 November 2014 (UTC)<br />
<br />
:Well, I've [https://wiki.archlinux.org/index.php?title=NVIDIA&diff=344863&oldid=344745 rewritten] the second point to make it clearer, I hope I got it correctly. However steps 2 and 3 there should probably merged into one, because they deal with the same problem, i.e. finding the correct driver to install. Maybe we could use a table? (just brainstorming). -- [[User:Kynikos|Kynikos]] ([[User talk:Kynikos|talk]]) 03:47, 16 November 2014 (UTC)<br />
<br />
== Compositing ==<br />
<br />
I think it could be helpful for anyone that's still using X server to be guided on setting up compositing.<br />
<br />
One way to update the Xorg.conf file to enable composition is to use the nvidia command line tool:<br />
# nvidia-xconfig --composite<br />
<br />
The other is to edit the file manually, as per the example below adding the Composite Option to the Extensions section of /etc/X11/xorg.conf:<br />
<br />
Section "Extensions"<br />
Option "Composite" "Enable"<br />
EndSection<br />
<br />
For those running KDE, to check if compositing is enabled they can run the following command, compositing information is at the end of the output:<br />
$ qdbus org.kde.KWin /KWin supportInformation<br />
[[User:Esdaniel|Esdaniel]] ([[User talk:Esdaniel|talk]]) 06:25, 16 October 2017 (UTC)<br />
<br />
<br />
== xorg-server 1.20 ==<br />
Seems with xorg 1.20 some nvidia packages are not supported anymore e.g. nvidia-340xx - no matiching ABI.<br />
Should we insert a warning?<br />
[[User:Ua4000|Ua4000]] ([[User talk:Ua4000|talk]]) 07:03, 20 May 2018 (UTC)<br />
<br />
== PRIME Render Offload in closed-source drivers ==<br />
<br />
Is offload is supported now in these drivers?<br />
https://download.nvidia.com/XFree86/Linux-x86_64/435.21/README/primerenderoffload.html<br />
[[User:DragonX256|DragonX256]] ([[User talk:DragonX256|talk]]) 05:01, 30 August 2019 (UTC)<br />
<br />
== Experimental Power Management features (for preserving video memory across suspension) ==<br />
<br />
[[User:Lahwaacz]]:<br />
<br />
=== "Power Management" - misleading ===<br />
How is this ''misleading''? It is a descriptive term, the ''official'' term that NVIDIA uses, and also the term used by maintainers of the nvidia-utils package (see [https://github.com/archlinux/svntogit-packages/commit/1b11f516479c2a101c3a5855f26ac71a90fafb69]). Sure, it's confusing that ''Power Management'' and ''Dynamic Power Management'' are quite different beasts, but it's even more confusing to censor the phrase "Power Management" altogether from the section. We should really mention "Power Management" or "Power Management Support" somewhere in that section.<br />
<br />
In case it's not clear, power management refers to suspend-to-RAM and suspend-to-disk computer features, this isn't an NVIDIA specific thing, or anything new ... [[User:Neven|Neven]] ([[User talk:Neven|talk]]) 22:00, 8 September 2020 (UTC)<br />
<br />
:The purpose of this wiki is to make things clearer, not to copy-paste from official manuals. If nvidia uses misleading wording, there is no reason to follow that. -- [[User:Lahwaacz|Lahwaacz]] ([[User talk:Lahwaacz|talk]]) 08:09, 9 September 2020 (UTC)<br />
:: Again, how is it misleading? As I clearly said in my above comment, which it appears you couldn't bother reading in its entirety, the fact that ''power management'' includes system sleep is long established semantics, common throughout the computing world (not NVIDIA specific). [[User:Neven|Neven]] ([[User talk:Neven|talk]]) 10:21, 9 September 2020 (UTC)<br />
<br />
:::I agree that the fact that "power management" includes system sleep is long established semantics when you talk about ''system'' power management, but I disagree that "power management" is the best term to describe what is going on here. The nvidia driver connects to the suspend pipeline to save the GPU state, including (part of) the video memory. The purpose of the "new" method is to save full video memory, which is purely a visual convenience thing, and some "advanced" CUDA state. There is nothing related to saving or otherwise managing power of the GPU, which is why I find the term "power management" inappropriate for this section. The section should use terms which clearly describe what is going on. -- [[User:Lahwaacz|Lahwaacz]] ([[User talk:Lahwaacz|talk]]) 14:42, 9 September 2020 (UTC)<br />
<br />
=== Common configuration ===<br />
Well, it's new, of course not everybody is using it; but, at least on my system, chromium (and other heavy GPU users, too, I assume) is currently unusable (more correctly - unviewable) after resuming from system sleep without this feature. Surely this is will become a very common configuration for NVIDIA users soon, at least those that also need to suspend their system. [[User:Neven|Neven]] ([[User talk:Neven|talk]]) 22:00, 8 September 2020 (UTC)<br />
<br />
:It might be new because nvidia added it in a recent driver version, not because few people use it. The fact that your system needs it does not make it common. -- [[User:Lahwaacz|Lahwaacz]] ([[User talk:Lahwaacz|talk]]) 08:09, 9 September 2020 (UTC)<br />
<br />
=== Experimental ===<br />
I'm not sure what are you asking exactly, it seems like it's a question directed more at NVIDIA than at me; but I can say that it seems like it's not perfect yet, as I had some worrying messages in dmesg after resuming with the new features enabled and Chromium running. Everything seemed to be OK apart from the messages, though, so clearly a great improvement. [[User:Neven|Neven]] ([[User talk:Neven|talk]]) 22:00, 8 September 2020 (UTC)<br />
<br />
=== Upstream documentation ===<br />
Linked in the second sentence of the section, also available in nvidia-utils package (powermanagement.html). Titled "Chapter 21. Configuring Power Management Support". [[User:Neven|Neven]] ([[User talk:Neven|talk]]) 22:00, 8 September 2020 (UTC)<br />
<br />
== Update #Unsupported drivers (390xx) for GF117M ==<br />
<br />
3. Install the appropriate driver for your card:<br />
For GeForce 400/500/600 series cards [NVCx and NVDx] from around 2010-2011, install the nvidia-390xx-dkmsAUR package.<br />
<br />
change to:<br />
For GeForce 400/500/600/710M/720M/810M/820M series cards [NVCx, NVDx and GF117M] from around 2010-2014, install the nvidia-390xx-dkmsAUR package.<br />
<br />
{{Unsigned|00:59, 28 September 2020 (UTC)|Nullstric}}<br />
<br />
== <s>Kernel 5.9 and Nvidia</s> ==<br />
<br />
Update: It seems that more parts, like Vulkan Raytracing, NVENC etc. are also affected.<br />
<br />
It seems that "only" CUDA and OpenCL are affected.<br />
Other functionalities seem to work.<br />
<br />
Look at Bugreport for details: https://bugs.archlinux.org/task/68312<br />
<br />
[[User:G3ro|G3ro]] ([[User talk:G3ro|talk]]) 15:13, 20 October 2020 (UTC) G3ro<br />
<br />
:The bug report is already closed. -- [[User:Lahwaacz|Lahwaacz]] ([[User talk:Lahwaacz|talk]]) 19:27, 25 November 2020 (UTC)<br />
<br />
== GPU at 0000:0X:00.0 has fallen off the bus. ==<br />
<br />
:Whilst using the kermel parameter nvidia-drm.modeset=1 with linux and linux-ck my machine randomly freezes with only this in journal, currently using Geforce GTS 450 with the 390xx driver, similar thread on [https://bbs.archlinux.org/viewtopic.php?id=229353/see BBS]<br />
<br />
{{C|<br />
Nov 24 15:55:56 archlinux kernel: NVRM: loading NVIDIA UNIX x86_64 Kernel Module 390.138 Thu May 14 01:01:53 PDT 2020 (using threaded interrupts)<br />
Nov 24 16:04:49 hawker64 kernel: NVRM: GPU at PCI:0000:02:00: GPU-feeae056-097a-fe32-3f56-3732296882d2<br />
Nov 24 16:04:49 hawker64 kernel: NVRM: Xid (PCI:0000:02:00): 79, GPU has fallen off the bus.<br />
Nov 24 16:04:49 hawker64 kernel: NVRM: GPU at 0000:02:00.0 has fallen off the bus.<br />
Nov 24 16:04:49 hawker64 kernel: NVRM: A GPU crash dump has been created. If possible, please run<br />
NVRM: nvidia-bug-report.sh as root to collect this data before<br />
NVRM: the NVIDIA kernel module is unloaded. <br />
}}<br />
<br />
:A search on [https://bbs.archlinux.org/viewtopic.php?id=217540/see BBS]shows that its a known common issue and apparently the error message is somewhat generic and could be down to faulty hardware or a regression in driver or other software, reseating card in PCI slot is advised, i have removed the parameter and all is well for now. putting the graphics card into persistent mode: sudo nvidia-smi -pm 1 works for some.<br />
:[edit] Further testing results in same errors even without the nvidia-drm.modeset=1 parameter, perusing nvidia forums suggests parameter pcie_aspm=off works for some users, so im now trying this.<br />
{{unsigned|16:17, 25 November 2020|Cirrus}}</div>Cirrushttps://wiki.archlinux.org/index.php?title=Talk:NVIDIA&diff=642615Talk:NVIDIA2020-11-28T00:42:33Z<p>Cirrus: /* GPU at 0000:0X:00.0 has fallen off the bus. */</p>
<hr />
<div>== TV-Out ==<br />
<br />
NVoption Online Version - great tool to make tv-out easy and fast <br />
<br />
[I'm using gmplayer with gl and twinview]<br />
[http://www.sorgonet.com/linux/nv-online/]http://www.sorgonet.com/linux/nv-online/ {{Unsigned|01:23, 23 March 2006|Suw}}<br />
<br />
:A user found this useful to get TV-Out working with an old Geforce 2 MX: {{AUR|nvtv}} -- [[User:Alad|Alad]] ([[User talk:Alad|talk]]) 13:56, 3 March 2016 (UTC)<br />
<br />
== '/dev/nvidia0' Input/Output error... suggested fixes ==<br />
<br />
Can anyone verify that the BIOS related suggestions work and are not coincidentally set (either automatically when changing the IRQ or turning off ACPI) while troubleshooting? I have found little information that confirms any of the suggestions would work. The file permissions thing seems to be completely unfounded and never works (as noted in the article) that I could find. It would probably be a good idea if we cleaned out items that have not been verified to work. For my setup I was having this error and none of the items in the wiki nor the many file permission search results worked. -- [[User:Clickthem|click, them so hard]] 19:16, 4 March 2012 (EST)<br />
:I've added an Accuracy template, please next time add it yourself so that discussions like this are more visible. -- [[User:Kynikos|Kynikos]] 05:40, 6 March 2012 (EST)<br />
<br />
== Run a test ==<br />
<br />
There is confusing paragraph saying ''You can run a test to see if the Xorg server will function correctly without a configuration file.''. IMHO, it should be clarified what kind of test the author has in mind, an exact command would be helpful. Currently, this suggestion is simply confusing, especially to less experienced users. --[[User:Mloskot|Mloskot]] ([[User talk:Mloskot|talk]]) 19:52, 26 November 2012 (UTC)<br />
<br />
: It's strange. I agree. The link goes to the section for running X. After a beat, I realized you simply try to launch X. And in my case the screen was black. So the "test" failed. A better instruction might say to try launching launching X, and then provide the link which describes all the ways this is done--depending on your configuration. [[User:Xtian|Xtian]] ([[User talk:Xtian|talk]]) 22:05, 21 October 2017 (UTC)<br />
<br />
: Over 7 years after the original comment (with which I agree), I've amended the labelling of that link to remove the suggestion that the reader will find a test described there. --[[User:Ghepardo|Ghepardo]] ([[User talk:Ghepardo|talk]]) 17:44, 29 March 2020 (UTC)<br />
<br />
== nvidia-xconfig ==<br />
<br />
Several of the commands which are suggested to be run with nvidia-xconfig (such as nvidia-xconfig --twinview) don't work with the current nvidia packages in the repository. I just went through setting mine up so I intend to clean up the ones that I can from my experience. Some don't seem to have a 1:1 replacement (there is a --dynamic-twinview argument now; is that the same as --twinview was?). [[User:Techprophet|Teh]] ([[User talk:Techprophet|talk]]) 13:10, 20 June 2013 (UTC)<br />
<br />
While it shouldn't be necessary to use xconfig to get nvidia working on X, creating a 20-nvidia.conf file is an integral step to fix screen tearing for people that suffer from that issue. Perhaps this section should have this explained and include a link to the nvidia troubleshooting article which contains the section about fixing screen tearing? --[[User:TheChickenMan|TheChickenMan]] ([[User talk:TheChickenMan|talk]]) 21:54, 22 December 2016 (UTC)<br />
<br />
:Troubleshooting sections link to the main documentation, not vice versa. Otherwise there would be no point in having separate troubleshooting sections. -- [[User:Lahwaacz|Lahwaacz]] ([[User talk:Lahwaacz|talk]]) 22:03, 22 December 2016 (UTC)<br />
<br />
== Accuracy of driver selection ==<br />
<br />
[https://bbs.archlinux.org/viewtopic.php?id=189859 A thread on the forums] revealed that nvidia is more conservative in their suggestion than needed and checking their website tells you to use an older driver (nvidia-340xx) while the latest 'nvidia' one will do just fine. [https://bbs.archlinux.org/viewtopic.php?pid=1475567#p1475567 Gusar suggested] the removal of the second point in [https://wiki.archlinux.org/index.php/NVIDIA#Installation the 'Installing' section]. Do we want to get rid of this potentially useful, although somewhat confusing info? -- [[User:Karol|Karol]] ([[User talk:Karol|talk]]) 02:52, 15 November 2014 (UTC)<br />
<br />
:Well, I've [https://wiki.archlinux.org/index.php?title=NVIDIA&diff=344863&oldid=344745 rewritten] the second point to make it clearer, I hope I got it correctly. However steps 2 and 3 there should probably merged into one, because they deal with the same problem, i.e. finding the correct driver to install. Maybe we could use a table? (just brainstorming). -- [[User:Kynikos|Kynikos]] ([[User talk:Kynikos|talk]]) 03:47, 16 November 2014 (UTC)<br />
<br />
== Compositing ==<br />
<br />
I think it could be helpful for anyone that's still using X server to be guided on setting up compositing.<br />
<br />
One way to update the Xorg.conf file to enable composition is to use the nvidia command line tool:<br />
# nvidia-xconfig --composite<br />
<br />
The other is to edit the file manually, as per the example below adding the Composite Option to the Extensions section of /etc/X11/xorg.conf:<br />
<br />
Section "Extensions"<br />
Option "Composite" "Enable"<br />
EndSection<br />
<br />
For those running KDE, to check if compositing is enabled they can run the following command, compositing information is at the end of the output:<br />
$ qdbus org.kde.KWin /KWin supportInformation<br />
[[User:Esdaniel|Esdaniel]] ([[User talk:Esdaniel|talk]]) 06:25, 16 October 2017 (UTC)<br />
<br />
<br />
== xorg-server 1.20 ==<br />
Seems with xorg 1.20 some nvidia packages are not supported anymore e.g. nvidia-340xx - no matiching ABI.<br />
Should we insert a warning?<br />
[[User:Ua4000|Ua4000]] ([[User talk:Ua4000|talk]]) 07:03, 20 May 2018 (UTC)<br />
<br />
== PRIME Render Offload in closed-source drivers ==<br />
<br />
Is offload is supported now in these drivers?<br />
https://download.nvidia.com/XFree86/Linux-x86_64/435.21/README/primerenderoffload.html<br />
[[User:DragonX256|DragonX256]] ([[User talk:DragonX256|talk]]) 05:01, 30 August 2019 (UTC)<br />
<br />
== Experimental Power Management features (for preserving video memory across suspension) ==<br />
<br />
[[User:Lahwaacz]]:<br />
<br />
=== "Power Management" - misleading ===<br />
How is this ''misleading''? It is a descriptive term, the ''official'' term that NVIDIA uses, and also the term used by maintainers of the nvidia-utils package (see [https://github.com/archlinux/svntogit-packages/commit/1b11f516479c2a101c3a5855f26ac71a90fafb69]). Sure, it's confusing that ''Power Management'' and ''Dynamic Power Management'' are quite different beasts, but it's even more confusing to censor the phrase "Power Management" altogether from the section. We should really mention "Power Management" or "Power Management Support" somewhere in that section.<br />
<br />
In case it's not clear, power management refers to suspend-to-RAM and suspend-to-disk computer features, this isn't an NVIDIA specific thing, or anything new ... [[User:Neven|Neven]] ([[User talk:Neven|talk]]) 22:00, 8 September 2020 (UTC)<br />
<br />
:The purpose of this wiki is to make things clearer, not to copy-paste from official manuals. If nvidia uses misleading wording, there is no reason to follow that. -- [[User:Lahwaacz|Lahwaacz]] ([[User talk:Lahwaacz|talk]]) 08:09, 9 September 2020 (UTC)<br />
:: Again, how is it misleading? As I clearly said in my above comment, which it appears you couldn't bother reading in its entirety, the fact that ''power management'' includes system sleep is long established semantics, common throughout the computing world (not NVIDIA specific). [[User:Neven|Neven]] ([[User talk:Neven|talk]]) 10:21, 9 September 2020 (UTC)<br />
<br />
:::I agree that the fact that "power management" includes system sleep is long established semantics when you talk about ''system'' power management, but I disagree that "power management" is the best term to describe what is going on here. The nvidia driver connects to the suspend pipeline to save the GPU state, including (part of) the video memory. The purpose of the "new" method is to save full video memory, which is purely a visual convenience thing, and some "advanced" CUDA state. There is nothing related to saving or otherwise managing power of the GPU, which is why I find the term "power management" inappropriate for this section. The section should use terms which clearly describe what is going on. -- [[User:Lahwaacz|Lahwaacz]] ([[User talk:Lahwaacz|talk]]) 14:42, 9 September 2020 (UTC)<br />
<br />
=== Common configuration ===<br />
Well, it's new, of course not everybody is using it; but, at least on my system, chromium (and other heavy GPU users, too, I assume) is currently unusable (more correctly - unviewable) after resuming from system sleep without this feature. Surely this is will become a very common configuration for NVIDIA users soon, at least those that also need to suspend their system. [[User:Neven|Neven]] ([[User talk:Neven|talk]]) 22:00, 8 September 2020 (UTC)<br />
<br />
:It might be new because nvidia added it in a recent driver version, not because few people use it. The fact that your system needs it does not make it common. -- [[User:Lahwaacz|Lahwaacz]] ([[User talk:Lahwaacz|talk]]) 08:09, 9 September 2020 (UTC)<br />
<br />
=== Experimental ===<br />
I'm not sure what are you asking exactly, it seems like it's a question directed more at NVIDIA than at me; but I can say that it seems like it's not perfect yet, as I had some worrying messages in dmesg after resuming with the new features enabled and Chromium running. Everything seemed to be OK apart from the messages, though, so clearly a great improvement. [[User:Neven|Neven]] ([[User talk:Neven|talk]]) 22:00, 8 September 2020 (UTC)<br />
<br />
=== Upstream documentation ===<br />
Linked in the second sentence of the section, also available in nvidia-utils package (powermanagement.html). Titled "Chapter 21. Configuring Power Management Support". [[User:Neven|Neven]] ([[User talk:Neven|talk]]) 22:00, 8 September 2020 (UTC)<br />
<br />
== Update #Unsupported drivers (390xx) for GF117M ==<br />
<br />
3. Install the appropriate driver for your card:<br />
For GeForce 400/500/600 series cards [NVCx and NVDx] from around 2010-2011, install the nvidia-390xx-dkmsAUR package.<br />
<br />
change to:<br />
For GeForce 400/500/600/710M/720M/810M/820M series cards [NVCx, NVDx and GF117M] from around 2010-2014, install the nvidia-390xx-dkmsAUR package.<br />
<br />
{{Unsigned|00:59, 28 September 2020 (UTC)|Nullstric}}<br />
<br />
== <s>Kernel 5.9 and Nvidia</s> ==<br />
<br />
Update: It seems that more parts, like Vulkan Raytracing, NVENC etc. are also affected.<br />
<br />
It seems that "only" CUDA and OpenCL are affected.<br />
Other functionalities seem to work.<br />
<br />
Look at Bugreport for details: https://bugs.archlinux.org/task/68312<br />
<br />
[[User:G3ro|G3ro]] ([[User talk:G3ro|talk]]) 15:13, 20 October 2020 (UTC) G3ro<br />
<br />
:The bug report is already closed. -- [[User:Lahwaacz|Lahwaacz]] ([[User talk:Lahwaacz|talk]]) 19:27, 25 November 2020 (UTC)<br />
<br />
== GPU at 0000:0X:00.0 has fallen off the bus. ==<br />
<br />
:Whilst using the kermel parameter nvidia-drm.modeset=1 with linux and linux-ck my machine randomly freezes with only this in journal, currently using Geforce GTS 450 with the 390xx driver, similar thread on [https://bbs.archlinux.org/viewtopic.php?id=229353/see BBS]<br />
<br />
{{C|<br />
Nov 24 15:55:56 archlinux kernel: NVRM: loading NVIDIA UNIX x86_64 Kernel Module 390.138 Thu May 14 01:01:53 PDT 2020 (using threaded interrupts)<br />
Nov 24 16:04:49 hawker64 kernel: NVRM: GPU at PCI:0000:02:00: GPU-feeae056-097a-fe32-3f56-3732296882d2<br />
Nov 24 16:04:49 hawker64 kernel: NVRM: Xid (PCI:0000:02:00): 79, GPU has fallen off the bus.<br />
Nov 24 16:04:49 hawker64 kernel: NVRM: GPU at 0000:02:00.0 has fallen off the bus.<br />
Nov 24 16:04:49 hawker64 kernel: NVRM: A GPU crash dump has been created. If possible, please run<br />
NVRM: nvidia-bug-report.sh as root to collect this data before<br />
NVRM: the NVIDIA kernel module is unloaded. <br />
}}<br />
<br />
:A search on [https://bbs.archlinux.org/viewtopic.php?id=217540/see BBS]shows that its a known common issue and apparently the error message is somewhat generic and could be down to faulty hardware or a regression in driver or other software, reseating card in PCI slot is advised, i have removed the parameter and all is well for now.<br />
:[edit] Further testing results in same errors even without the nvidia-drm.modeset=1 parameter, perusing nvidia forums suggests parameter pcie_aspm=off works for some users, so im now trying this.<br />
{{unsigned|16:17, 25 November 2020|Cirrus}}</div>Cirrushttps://wiki.archlinux.org/index.php?title=Talk:NVIDIA&diff=642371Talk:NVIDIA2020-11-25T16:17:28Z<p>Cirrus: /* GPU at 0000:0X:00.0 has fallen off the bus. */</p>
<hr />
<div>== TV-Out ==<br />
<br />
NVoption Online Version - great tool to make tv-out easy and fast <br />
<br />
[I'm using gmplayer with gl and twinview]<br />
[http://www.sorgonet.com/linux/nv-online/]http://www.sorgonet.com/linux/nv-online/ {{Unsigned|01:23, 23 March 2006|Suw}}<br />
<br />
:A user found this useful to get TV-Out working with an old Geforce 2 MX: {{AUR|nvtv}} -- [[User:Alad|Alad]] ([[User talk:Alad|talk]]) 13:56, 3 March 2016 (UTC)<br />
<br />
== '/dev/nvidia0' Input/Output error... suggested fixes ==<br />
<br />
Can anyone verify that the BIOS related suggestions work and are not coincidentally set (either automatically when changing the IRQ or turning off ACPI) while troubleshooting? I have found little information that confirms any of the suggestions would work. The file permissions thing seems to be completely unfounded and never works (as noted in the article) that I could find. It would probably be a good idea if we cleaned out items that have not been verified to work. For my setup I was having this error and none of the items in the wiki nor the many file permission search results worked. -- [[User:Clickthem|click, them so hard]] 19:16, 4 March 2012 (EST)<br />
:I've added an Accuracy template, please next time add it yourself so that discussions like this are more visible. -- [[User:Kynikos|Kynikos]] 05:40, 6 March 2012 (EST)<br />
<br />
== Run a test ==<br />
<br />
There is confusing paragraph saying ''You can run a test to see if the Xorg server will function correctly without a configuration file.''. IMHO, it should be clarified what kind of test the author has in mind, an exact command would be helpful. Currently, this suggestion is simply confusing, especially to less experienced users. --[[User:Mloskot|Mloskot]] ([[User talk:Mloskot|talk]]) 19:52, 26 November 2012 (UTC)<br />
<br />
: It's strange. I agree. The link goes to the section for running X. After a beat, I realized you simply try to launch X. And in my case the screen was black. So the "test" failed. A better instruction might say to try launching launching X, and then provide the link which describes all the ways this is done--depending on your configuration. [[User:Xtian|Xtian]] ([[User talk:Xtian|talk]]) 22:05, 21 October 2017 (UTC)<br />
<br />
: Over 7 years after the original comment (with which I agree), I've amended the labelling of that link to remove the suggestion that the reader will find a test described there. --[[User:Ghepardo|Ghepardo]] ([[User talk:Ghepardo|talk]]) 17:44, 29 March 2020 (UTC)<br />
<br />
== nvidia-xconfig ==<br />
<br />
Several of the commands which are suggested to be run with nvidia-xconfig (such as nvidia-xconfig --twinview) don't work with the current nvidia packages in the repository. I just went through setting mine up so I intend to clean up the ones that I can from my experience. Some don't seem to have a 1:1 replacement (there is a --dynamic-twinview argument now; is that the same as --twinview was?). [[User:Techprophet|Teh]] ([[User talk:Techprophet|talk]]) 13:10, 20 June 2013 (UTC)<br />
<br />
While it shouldn't be necessary to use xconfig to get nvidia working on X, creating a 20-nvidia.conf file is an integral step to fix screen tearing for people that suffer from that issue. Perhaps this section should have this explained and include a link to the nvidia troubleshooting article which contains the section about fixing screen tearing? --[[User:TheChickenMan|TheChickenMan]] ([[User talk:TheChickenMan|talk]]) 21:54, 22 December 2016 (UTC)<br />
<br />
:Troubleshooting sections link to the main documentation, not vice versa. Otherwise there would be no point in having separate troubleshooting sections. -- [[User:Lahwaacz|Lahwaacz]] ([[User talk:Lahwaacz|talk]]) 22:03, 22 December 2016 (UTC)<br />
<br />
== Accuracy of driver selection ==<br />
<br />
[https://bbs.archlinux.org/viewtopic.php?id=189859 A thread on the forums] revealed that nvidia is more conservative in their suggestion than needed and checking their website tells you to use an older driver (nvidia-340xx) while the latest 'nvidia' one will do just fine. [https://bbs.archlinux.org/viewtopic.php?pid=1475567#p1475567 Gusar suggested] the removal of the second point in [https://wiki.archlinux.org/index.php/NVIDIA#Installation the 'Installing' section]. Do we want to get rid of this potentially useful, although somewhat confusing info? -- [[User:Karol|Karol]] ([[User talk:Karol|talk]]) 02:52, 15 November 2014 (UTC)<br />
<br />
:Well, I've [https://wiki.archlinux.org/index.php?title=NVIDIA&diff=344863&oldid=344745 rewritten] the second point to make it clearer, I hope I got it correctly. However steps 2 and 3 there should probably merged into one, because they deal with the same problem, i.e. finding the correct driver to install. Maybe we could use a table? (just brainstorming). -- [[User:Kynikos|Kynikos]] ([[User talk:Kynikos|talk]]) 03:47, 16 November 2014 (UTC)<br />
<br />
== Compositing ==<br />
<br />
I think it could be helpful for anyone that's still using X server to be guided on setting up compositing.<br />
<br />
One way to update the Xorg.conf file to enable composition is to use the nvidia command line tool:<br />
# nvidia-xconfig --composite<br />
<br />
The other is to edit the file manually, as per the example below adding the Composite Option to the Extensions section of /etc/X11/xorg.conf:<br />
<br />
Section "Extensions"<br />
Option "Composite" "Enable"<br />
EndSection<br />
<br />
For those running KDE, to check if compositing is enabled they can run the following command, compositing information is at the end of the output:<br />
$ qdbus org.kde.KWin /KWin supportInformation<br />
[[User:Esdaniel|Esdaniel]] ([[User talk:Esdaniel|talk]]) 06:25, 16 October 2017 (UTC)<br />
<br />
<br />
== xorg-server 1.20 ==<br />
Seems with xorg 1.20 some nvidia packages are not supported anymore e.g. nvidia-340xx - no matiching ABI.<br />
Should we insert a warning?<br />
[[User:Ua4000|Ua4000]] ([[User talk:Ua4000|talk]]) 07:03, 20 May 2018 (UTC)<br />
<br />
== PRIME Render Offload in closed-source drivers ==<br />
<br />
Is offload is supported now in these drivers?<br />
https://download.nvidia.com/XFree86/Linux-x86_64/435.21/README/primerenderoffload.html<br />
[[User:DragonX256|DragonX256]] ([[User talk:DragonX256|talk]]) 05:01, 30 August 2019 (UTC)<br />
<br />
== Experimental Power Management features (for preserving video memory across suspension) ==<br />
<br />
[[User:Lahwaacz]]:<br />
<br />
=== "Power Management" - misleading ===<br />
How is this ''misleading''? It is a descriptive term, the ''official'' term that NVIDIA uses, and also the term used by maintainers of the nvidia-utils package (see [https://github.com/archlinux/svntogit-packages/commit/1b11f516479c2a101c3a5855f26ac71a90fafb69]). Sure, it's confusing that ''Power Management'' and ''Dynamic Power Management'' are quite different beasts, but it's even more confusing to censor the phrase "Power Management" altogether from the section. We should really mention "Power Management" or "Power Management Support" somewhere in that section.<br />
<br />
In case it's not clear, power management refers to suspend-to-RAM and suspend-to-disk computer features, this isn't an NVIDIA specific thing, or anything new ... [[User:Neven|Neven]] ([[User talk:Neven|talk]]) 22:00, 8 September 2020 (UTC)<br />
<br />
:The purpose of this wiki is to make things clearer, not to copy-paste from official manuals. If nvidia uses misleading wording, there is no reason to follow that. -- [[User:Lahwaacz|Lahwaacz]] ([[User talk:Lahwaacz|talk]]) 08:09, 9 September 2020 (UTC)<br />
:: Again, how is it misleading? As I clearly said in my above comment, which it appears you couldn't bother reading in its entirety, the fact that ''power management'' includes system sleep is long established semantics, common throughout the computing world (not NVIDIA specific). [[User:Neven|Neven]] ([[User talk:Neven|talk]]) 10:21, 9 September 2020 (UTC)<br />
<br />
:::I agree that the fact that "power management" includes system sleep is long established semantics when you talk about ''system'' power management, but I disagree that "power management" is the best term to describe what is going on here. The nvidia driver connects to the suspend pipeline to save the GPU state, including (part of) the video memory. The purpose of the "new" method is to save full video memory, which is purely a visual convenience thing, and some "advanced" CUDA state. There is nothing related to saving or otherwise managing power of the GPU, which is why I find the term "power management" inappropriate for this section. The section should use terms which clearly describe what is going on. -- [[User:Lahwaacz|Lahwaacz]] ([[User talk:Lahwaacz|talk]]) 14:42, 9 September 2020 (UTC)<br />
<br />
=== Common configuration ===<br />
Well, it's new, of course not everybody is using it; but, at least on my system, chromium (and other heavy GPU users, too, I assume) is currently unusable (more correctly - unviewable) after resuming from system sleep without this feature. Surely this is will become a very common configuration for NVIDIA users soon, at least those that also need to suspend their system. [[User:Neven|Neven]] ([[User talk:Neven|talk]]) 22:00, 8 September 2020 (UTC)<br />
<br />
:It might be new because nvidia added it in a recent driver version, not because few people use it. The fact that your system needs it does not make it common. -- [[User:Lahwaacz|Lahwaacz]] ([[User talk:Lahwaacz|talk]]) 08:09, 9 September 2020 (UTC)<br />
<br />
=== Experimental ===<br />
I'm not sure what are you asking exactly, it seems like it's a question directed more at NVIDIA than at me; but I can say that it seems like it's not perfect yet, as I had some worrying messages in dmesg after resuming with the new features enabled and Chromium running. Everything seemed to be OK apart from the messages, though, so clearly a great improvement. [[User:Neven|Neven]] ([[User talk:Neven|talk]]) 22:00, 8 September 2020 (UTC)<br />
<br />
=== Upstream documentation ===<br />
Linked in the second sentence of the section, also available in nvidia-utils package (powermanagement.html). Titled "Chapter 21. Configuring Power Management Support". [[User:Neven|Neven]] ([[User talk:Neven|talk]]) 22:00, 8 September 2020 (UTC)<br />
<br />
== Update #Unsupported drivers (390xx) for GF117M ==<br />
<br />
3. Install the appropriate driver for your card:<br />
For GeForce 400/500/600 series cards [NVCx and NVDx] from around 2010-2011, install the nvidia-390xx-dkmsAUR package.<br />
<br />
change to:<br />
For GeForce 400/500/600/710M/720M/810M/820M series cards [NVCx, NVDx and GF117M] from around 2010-2014, install the nvidia-390xx-dkmsAUR package.<br />
<br />
{{Unsigned|00:59, 28 September 2020 (UTC)|Nullstric}}<br />
<br />
== Kernel 5.9 and Nvidia ==<br />
<br />
Update: It seems that more parts, like Vulkan Raytracing, NVENC etc. are also affected.<br />
<br />
It seems that "only" CUDA and OpenCL are affected.<br />
Other functionalities seem to work.<br />
<br />
Look at Bugreport for details: https://bugs.archlinux.org/task/68312<br />
<br />
[[User:G3ro|G3ro]] ([[User talk:G3ro|talk]]) 15:13, 20 October 2020 (UTC) G3ro<br />
<br />
== GPU at 0000:0X:00.0 has fallen off the bus. ==<br />
<br />
:Whilst using the kermel parameter nvidia-drm.modeset=1 with linux and linux-ck my machine randomly freezes with only this in journal, currently using Geforce GTS 450 with the 390xx driver, similar thread on [https://bbs.archlinux.org/viewtopic.php?id=229353/see BBS]<br />
<br />
{{C|<br />
Nov 24 15:55:56 archlinux kernel: NVRM: loading NVIDIA UNIX x86_64 Kernel Module 390.138 Thu May 14 01:01:53 PDT 2020 (using threaded interrupts)<br />
Nov 24 16:04:49 hawker64 kernel: NVRM: GPU at PCI:0000:02:00: GPU-feeae056-097a-fe32-3f56-3732296882d2<br />
Nov 24 16:04:49 hawker64 kernel: NVRM: Xid (PCI:0000:02:00): 79, GPU has fallen off the bus.<br />
Nov 24 16:04:49 hawker64 kernel: NVRM: GPU at 0000:02:00.0 has fallen off the bus.<br />
Nov 24 16:04:49 hawker64 kernel: NVRM: A GPU crash dump has been created. If possible, please run<br />
NVRM: nvidia-bug-report.sh as root to collect this data before<br />
NVRM: the NVIDIA kernel module is unloaded. <br />
}}<br />
<br />
:A search on [https://bbs.archlinux.org/viewtopic.php?id=217540/see BBS]shows that its a known common issue and apparently the error message is somewhat generic and could be down to faulty hardware or a regression in driver or other software, reseating card in PCI slot is advised, i have removed the parameter and all is well for now.</div>Cirrushttps://wiki.archlinux.org/index.php?title=Talk:NVIDIA&diff=642351Talk:NVIDIA2020-11-25T15:30:04Z<p>Cirrus: /* GPU at 0000:0X:00.0 has fallen off the bus. */</p>
<hr />
<div>== TV-Out ==<br />
<br />
NVoption Online Version - great tool to make tv-out easy and fast <br />
<br />
[I'm using gmplayer with gl and twinview]<br />
[http://www.sorgonet.com/linux/nv-online/]http://www.sorgonet.com/linux/nv-online/ {{Unsigned|01:23, 23 March 2006|Suw}}<br />
<br />
:A user found this useful to get TV-Out working with an old Geforce 2 MX: {{AUR|nvtv}} -- [[User:Alad|Alad]] ([[User talk:Alad|talk]]) 13:56, 3 March 2016 (UTC)<br />
<br />
== '/dev/nvidia0' Input/Output error... suggested fixes ==<br />
<br />
Can anyone verify that the BIOS related suggestions work and are not coincidentally set (either automatically when changing the IRQ or turning off ACPI) while troubleshooting? I have found little information that confirms any of the suggestions would work. The file permissions thing seems to be completely unfounded and never works (as noted in the article) that I could find. It would probably be a good idea if we cleaned out items that have not been verified to work. For my setup I was having this error and none of the items in the wiki nor the many file permission search results worked. -- [[User:Clickthem|click, them so hard]] 19:16, 4 March 2012 (EST)<br />
:I've added an Accuracy template, please next time add it yourself so that discussions like this are more visible. -- [[User:Kynikos|Kynikos]] 05:40, 6 March 2012 (EST)<br />
<br />
== Run a test ==<br />
<br />
There is confusing paragraph saying ''You can run a test to see if the Xorg server will function correctly without a configuration file.''. IMHO, it should be clarified what kind of test the author has in mind, an exact command would be helpful. Currently, this suggestion is simply confusing, especially to less experienced users. --[[User:Mloskot|Mloskot]] ([[User talk:Mloskot|talk]]) 19:52, 26 November 2012 (UTC)<br />
<br />
: It's strange. I agree. The link goes to the section for running X. After a beat, I realized you simply try to launch X. And in my case the screen was black. So the "test" failed. A better instruction might say to try launching launching X, and then provide the link which describes all the ways this is done--depending on your configuration. [[User:Xtian|Xtian]] ([[User talk:Xtian|talk]]) 22:05, 21 October 2017 (UTC)<br />
<br />
: Over 7 years after the original comment (with which I agree), I've amended the labelling of that link to remove the suggestion that the reader will find a test described there. --[[User:Ghepardo|Ghepardo]] ([[User talk:Ghepardo|talk]]) 17:44, 29 March 2020 (UTC)<br />
<br />
== nvidia-xconfig ==<br />
<br />
Several of the commands which are suggested to be run with nvidia-xconfig (such as nvidia-xconfig --twinview) don't work with the current nvidia packages in the repository. I just went through setting mine up so I intend to clean up the ones that I can from my experience. Some don't seem to have a 1:1 replacement (there is a --dynamic-twinview argument now; is that the same as --twinview was?). [[User:Techprophet|Teh]] ([[User talk:Techprophet|talk]]) 13:10, 20 June 2013 (UTC)<br />
<br />
While it shouldn't be necessary to use xconfig to get nvidia working on X, creating a 20-nvidia.conf file is an integral step to fix screen tearing for people that suffer from that issue. Perhaps this section should have this explained and include a link to the nvidia troubleshooting article which contains the section about fixing screen tearing? --[[User:TheChickenMan|TheChickenMan]] ([[User talk:TheChickenMan|talk]]) 21:54, 22 December 2016 (UTC)<br />
<br />
:Troubleshooting sections link to the main documentation, not vice versa. Otherwise there would be no point in having separate troubleshooting sections. -- [[User:Lahwaacz|Lahwaacz]] ([[User talk:Lahwaacz|talk]]) 22:03, 22 December 2016 (UTC)<br />
<br />
== Accuracy of driver selection ==<br />
<br />
[https://bbs.archlinux.org/viewtopic.php?id=189859 A thread on the forums] revealed that nvidia is more conservative in their suggestion than needed and checking their website tells you to use an older driver (nvidia-340xx) while the latest 'nvidia' one will do just fine. [https://bbs.archlinux.org/viewtopic.php?pid=1475567#p1475567 Gusar suggested] the removal of the second point in [https://wiki.archlinux.org/index.php/NVIDIA#Installation the 'Installing' section]. Do we want to get rid of this potentially useful, although somewhat confusing info? -- [[User:Karol|Karol]] ([[User talk:Karol|talk]]) 02:52, 15 November 2014 (UTC)<br />
<br />
:Well, I've [https://wiki.archlinux.org/index.php?title=NVIDIA&diff=344863&oldid=344745 rewritten] the second point to make it clearer, I hope I got it correctly. However steps 2 and 3 there should probably merged into one, because they deal with the same problem, i.e. finding the correct driver to install. Maybe we could use a table? (just brainstorming). -- [[User:Kynikos|Kynikos]] ([[User talk:Kynikos|talk]]) 03:47, 16 November 2014 (UTC)<br />
<br />
== Compositing ==<br />
<br />
I think it could be helpful for anyone that's still using X server to be guided on setting up compositing.<br />
<br />
One way to update the Xorg.conf file to enable composition is to use the nvidia command line tool:<br />
# nvidia-xconfig --composite<br />
<br />
The other is to edit the file manually, as per the example below adding the Composite Option to the Extensions section of /etc/X11/xorg.conf:<br />
<br />
Section "Extensions"<br />
Option "Composite" "Enable"<br />
EndSection<br />
<br />
For those running KDE, to check if compositing is enabled they can run the following command, compositing information is at the end of the output:<br />
$ qdbus org.kde.KWin /KWin supportInformation<br />
[[User:Esdaniel|Esdaniel]] ([[User talk:Esdaniel|talk]]) 06:25, 16 October 2017 (UTC)<br />
<br />
<br />
== xorg-server 1.20 ==<br />
Seems with xorg 1.20 some nvidia packages are not supported anymore e.g. nvidia-340xx - no matiching ABI.<br />
Should we insert a warning?<br />
[[User:Ua4000|Ua4000]] ([[User talk:Ua4000|talk]]) 07:03, 20 May 2018 (UTC)<br />
<br />
== PRIME Render Offload in closed-source drivers ==<br />
<br />
Is offload is supported now in these drivers?<br />
https://download.nvidia.com/XFree86/Linux-x86_64/435.21/README/primerenderoffload.html<br />
[[User:DragonX256|DragonX256]] ([[User talk:DragonX256|talk]]) 05:01, 30 August 2019 (UTC)<br />
<br />
== Experimental Power Management features (for preserving video memory across suspension) ==<br />
<br />
[[User:Lahwaacz]]:<br />
<br />
=== "Power Management" - misleading ===<br />
How is this ''misleading''? It is a descriptive term, the ''official'' term that NVIDIA uses, and also the term used by maintainers of the nvidia-utils package (see [https://github.com/archlinux/svntogit-packages/commit/1b11f516479c2a101c3a5855f26ac71a90fafb69]). Sure, it's confusing that ''Power Management'' and ''Dynamic Power Management'' are quite different beasts, but it's even more confusing to censor the phrase "Power Management" altogether from the section. We should really mention "Power Management" or "Power Management Support" somewhere in that section.<br />
<br />
In case it's not clear, power management refers to suspend-to-RAM and suspend-to-disk computer features, this isn't an NVIDIA specific thing, or anything new ... [[User:Neven|Neven]] ([[User talk:Neven|talk]]) 22:00, 8 September 2020 (UTC)<br />
<br />
:The purpose of this wiki is to make things clearer, not to copy-paste from official manuals. If nvidia uses misleading wording, there is no reason to follow that. -- [[User:Lahwaacz|Lahwaacz]] ([[User talk:Lahwaacz|talk]]) 08:09, 9 September 2020 (UTC)<br />
:: Again, how is it misleading? As I clearly said in my above comment, which it appears you couldn't bother reading in its entirety, the fact that ''power management'' includes system sleep is long established semantics, common throughout the computing world (not NVIDIA specific). [[User:Neven|Neven]] ([[User talk:Neven|talk]]) 10:21, 9 September 2020 (UTC)<br />
<br />
:::I agree that the fact that "power management" includes system sleep is long established semantics when you talk about ''system'' power management, but I disagree that "power management" is the best term to describe what is going on here. The nvidia driver connects to the suspend pipeline to save the GPU state, including (part of) the video memory. The purpose of the "new" method is to save full video memory, which is purely a visual convenience thing, and some "advanced" CUDA state. There is nothing related to saving or otherwise managing power of the GPU, which is why I find the term "power management" inappropriate for this section. The section should use terms which clearly describe what is going on. -- [[User:Lahwaacz|Lahwaacz]] ([[User talk:Lahwaacz|talk]]) 14:42, 9 September 2020 (UTC)<br />
<br />
=== Common configuration ===<br />
Well, it's new, of course not everybody is using it; but, at least on my system, chromium (and other heavy GPU users, too, I assume) is currently unusable (more correctly - unviewable) after resuming from system sleep without this feature. Surely this is will become a very common configuration for NVIDIA users soon, at least those that also need to suspend their system. [[User:Neven|Neven]] ([[User talk:Neven|talk]]) 22:00, 8 September 2020 (UTC)<br />
<br />
:It might be new because nvidia added it in a recent driver version, not because few people use it. The fact that your system needs it does not make it common. -- [[User:Lahwaacz|Lahwaacz]] ([[User talk:Lahwaacz|talk]]) 08:09, 9 September 2020 (UTC)<br />
<br />
=== Experimental ===<br />
I'm not sure what are you asking exactly, it seems like it's a question directed more at NVIDIA than at me; but I can say that it seems like it's not perfect yet, as I had some worrying messages in dmesg after resuming with the new features enabled and Chromium running. Everything seemed to be OK apart from the messages, though, so clearly a great improvement. [[User:Neven|Neven]] ([[User talk:Neven|talk]]) 22:00, 8 September 2020 (UTC)<br />
<br />
=== Upstream documentation ===<br />
Linked in the second sentence of the section, also available in nvidia-utils package (powermanagement.html). Titled "Chapter 21. Configuring Power Management Support". [[User:Neven|Neven]] ([[User talk:Neven|talk]]) 22:00, 8 September 2020 (UTC)<br />
<br />
== Update #Unsupported drivers (390xx) for GF117M ==<br />
<br />
3. Install the appropriate driver for your card:<br />
For GeForce 400/500/600 series cards [NVCx and NVDx] from around 2010-2011, install the nvidia-390xx-dkmsAUR package.<br />
<br />
change to:<br />
For GeForce 400/500/600/710M/720M/810M/820M series cards [NVCx, NVDx and GF117M] from around 2010-2014, install the nvidia-390xx-dkmsAUR package.<br />
<br />
{{Unsigned|00:59, 28 September 2020 (UTC)|Nullstric}}<br />
<br />
== Kernel 5.9 and Nvidia ==<br />
<br />
Update: It seems that more parts, like Vulkan Raytracing, NVENC etc. are also affected.<br />
<br />
It seems that "only" CUDA and OpenCL are affected.<br />
Other functionalities seem to work.<br />
<br />
Look at Bugreport for details: https://bugs.archlinux.org/task/68312<br />
<br />
[[User:G3ro|G3ro]] ([[User talk:G3ro|talk]]) 15:13, 20 October 2020 (UTC) G3ro<br />
<br />
== GPU at 0000:0X:00.0 has fallen off the bus. ==<br />
<br />
:Whilst using the kermel parameter nvidia-drm.modeset=1 with linux and linux-ck my machine randomly freezes with only this in journal, currently using Geforce GTS 450 with the 390xx driver<br />
<br />
{{C|<br />
Nov 24 15:55:56 archlinux kernel: NVRM: loading NVIDIA UNIX x86_64 Kernel Module 390.138 Thu May 14 01:01:53 PDT 2020 (using threaded interrupts)<br />
Nov 24 16:04:49 hawker64 kernel: NVRM: GPU at PCI:0000:02:00: GPU-feeae056-097a-fe32-3f56-3732296882d2<br />
Nov 24 16:04:49 hawker64 kernel: NVRM: Xid (PCI:0000:02:00): 79, GPU has fallen off the bus.<br />
Nov 24 16:04:49 hawker64 kernel: NVRM: GPU at 0000:02:00.0 has fallen off the bus.<br />
Nov 24 16:04:49 hawker64 kernel: NVRM: A GPU crash dump has been created. If possible, please run<br />
NVRM: nvidia-bug-report.sh as root to collect this data before<br />
NVRM: the NVIDIA kernel module is unloaded. <br />
}}<br />
<br />
:A search on BBS shows that its a known common issue and apparently the error message is somewhat generic and could be down to faulty hardware or a regression in driver or other software, i have removed the parameter and all is well for now.</div>Cirrushttps://wiki.archlinux.org/index.php?title=Talk:NVIDIA&diff=642330Talk:NVIDIA2020-11-25T13:26:45Z<p>Cirrus: /* GPU at 0000:0X:00.0 has fallen off the bus. */ new section</p>
<hr />
<div>== TV-Out ==<br />
<br />
NVoption Online Version - great tool to make tv-out easy and fast <br />
<br />
[I'm using gmplayer with gl and twinview]<br />
[http://www.sorgonet.com/linux/nv-online/]http://www.sorgonet.com/linux/nv-online/ {{Unsigned|01:23, 23 March 2006|Suw}}<br />
<br />
:A user found this useful to get TV-Out working with an old Geforce 2 MX: {{AUR|nvtv}} -- [[User:Alad|Alad]] ([[User talk:Alad|talk]]) 13:56, 3 March 2016 (UTC)<br />
<br />
== '/dev/nvidia0' Input/Output error... suggested fixes ==<br />
<br />
Can anyone verify that the BIOS related suggestions work and are not coincidentally set (either automatically when changing the IRQ or turning off ACPI) while troubleshooting? I have found little information that confirms any of the suggestions would work. The file permissions thing seems to be completely unfounded and never works (as noted in the article) that I could find. It would probably be a good idea if we cleaned out items that have not been verified to work. For my setup I was having this error and none of the items in the wiki nor the many file permission search results worked. -- [[User:Clickthem|click, them so hard]] 19:16, 4 March 2012 (EST)<br />
:I've added an Accuracy template, please next time add it yourself so that discussions like this are more visible. -- [[User:Kynikos|Kynikos]] 05:40, 6 March 2012 (EST)<br />
<br />
== Run a test ==<br />
<br />
There is confusing paragraph saying ''You can run a test to see if the Xorg server will function correctly without a configuration file.''. IMHO, it should be clarified what kind of test the author has in mind, an exact command would be helpful. Currently, this suggestion is simply confusing, especially to less experienced users. --[[User:Mloskot|Mloskot]] ([[User talk:Mloskot|talk]]) 19:52, 26 November 2012 (UTC)<br />
<br />
: It's strange. I agree. The link goes to the section for running X. After a beat, I realized you simply try to launch X. And in my case the screen was black. So the "test" failed. A better instruction might say to try launching launching X, and then provide the link which describes all the ways this is done--depending on your configuration. [[User:Xtian|Xtian]] ([[User talk:Xtian|talk]]) 22:05, 21 October 2017 (UTC)<br />
<br />
: Over 7 years after the original comment (with which I agree), I've amended the labelling of that link to remove the suggestion that the reader will find a test described there. --[[User:Ghepardo|Ghepardo]] ([[User talk:Ghepardo|talk]]) 17:44, 29 March 2020 (UTC)<br />
<br />
== nvidia-xconfig ==<br />
<br />
Several of the commands which are suggested to be run with nvidia-xconfig (such as nvidia-xconfig --twinview) don't work with the current nvidia packages in the repository. I just went through setting mine up so I intend to clean up the ones that I can from my experience. Some don't seem to have a 1:1 replacement (there is a --dynamic-twinview argument now; is that the same as --twinview was?). [[User:Techprophet|Teh]] ([[User talk:Techprophet|talk]]) 13:10, 20 June 2013 (UTC)<br />
<br />
While it shouldn't be necessary to use xconfig to get nvidia working on X, creating a 20-nvidia.conf file is an integral step to fix screen tearing for people that suffer from that issue. Perhaps this section should have this explained and include a link to the nvidia troubleshooting article which contains the section about fixing screen tearing? --[[User:TheChickenMan|TheChickenMan]] ([[User talk:TheChickenMan|talk]]) 21:54, 22 December 2016 (UTC)<br />
<br />
:Troubleshooting sections link to the main documentation, not vice versa. Otherwise there would be no point in having separate troubleshooting sections. -- [[User:Lahwaacz|Lahwaacz]] ([[User talk:Lahwaacz|talk]]) 22:03, 22 December 2016 (UTC)<br />
<br />
== Accuracy of driver selection ==<br />
<br />
[https://bbs.archlinux.org/viewtopic.php?id=189859 A thread on the forums] revealed that nvidia is more conservative in their suggestion than needed and checking their website tells you to use an older driver (nvidia-340xx) while the latest 'nvidia' one will do just fine. [https://bbs.archlinux.org/viewtopic.php?pid=1475567#p1475567 Gusar suggested] the removal of the second point in [https://wiki.archlinux.org/index.php/NVIDIA#Installation the 'Installing' section]. Do we want to get rid of this potentially useful, although somewhat confusing info? -- [[User:Karol|Karol]] ([[User talk:Karol|talk]]) 02:52, 15 November 2014 (UTC)<br />
<br />
:Well, I've [https://wiki.archlinux.org/index.php?title=NVIDIA&diff=344863&oldid=344745 rewritten] the second point to make it clearer, I hope I got it correctly. However steps 2 and 3 there should probably merged into one, because they deal with the same problem, i.e. finding the correct driver to install. Maybe we could use a table? (just brainstorming). -- [[User:Kynikos|Kynikos]] ([[User talk:Kynikos|talk]]) 03:47, 16 November 2014 (UTC)<br />
<br />
== Compositing ==<br />
<br />
I think it could be helpful for anyone that's still using X server to be guided on setting up compositing.<br />
<br />
One way to update the Xorg.conf file to enable composition is to use the nvidia command line tool:<br />
# nvidia-xconfig --composite<br />
<br />
The other is to edit the file manually, as per the example below adding the Composite Option to the Extensions section of /etc/X11/xorg.conf:<br />
<br />
Section "Extensions"<br />
Option "Composite" "Enable"<br />
EndSection<br />
<br />
For those running KDE, to check if compositing is enabled they can run the following command, compositing information is at the end of the output:<br />
$ qdbus org.kde.KWin /KWin supportInformation<br />
[[User:Esdaniel|Esdaniel]] ([[User talk:Esdaniel|talk]]) 06:25, 16 October 2017 (UTC)<br />
<br />
<br />
== xorg-server 1.20 ==<br />
Seems with xorg 1.20 some nvidia packages are not supported anymore e.g. nvidia-340xx - no matiching ABI.<br />
Should we insert a warning?<br />
[[User:Ua4000|Ua4000]] ([[User talk:Ua4000|talk]]) 07:03, 20 May 2018 (UTC)<br />
<br />
== PRIME Render Offload in closed-source drivers ==<br />
<br />
Is offload is supported now in these drivers?<br />
https://download.nvidia.com/XFree86/Linux-x86_64/435.21/README/primerenderoffload.html<br />
[[User:DragonX256|DragonX256]] ([[User talk:DragonX256|talk]]) 05:01, 30 August 2019 (UTC)<br />
<br />
== Experimental Power Management features (for preserving video memory across suspension) ==<br />
<br />
[[User:Lahwaacz]]:<br />
<br />
=== "Power Management" - misleading ===<br />
How is this ''misleading''? It is a descriptive term, the ''official'' term that NVIDIA uses, and also the term used by maintainers of the nvidia-utils package (see [https://github.com/archlinux/svntogit-packages/commit/1b11f516479c2a101c3a5855f26ac71a90fafb69]). Sure, it's confusing that ''Power Management'' and ''Dynamic Power Management'' are quite different beasts, but it's even more confusing to censor the phrase "Power Management" altogether from the section. We should really mention "Power Management" or "Power Management Support" somewhere in that section.<br />
<br />
In case it's not clear, power management refers to suspend-to-RAM and suspend-to-disk computer features, this isn't an NVIDIA specific thing, or anything new ... [[User:Neven|Neven]] ([[User talk:Neven|talk]]) 22:00, 8 September 2020 (UTC)<br />
<br />
:The purpose of this wiki is to make things clearer, not to copy-paste from official manuals. If nvidia uses misleading wording, there is no reason to follow that. -- [[User:Lahwaacz|Lahwaacz]] ([[User talk:Lahwaacz|talk]]) 08:09, 9 September 2020 (UTC)<br />
:: Again, how is it misleading? As I clearly said in my above comment, which it appears you couldn't bother reading in its entirety, the fact that ''power management'' includes system sleep is long established semantics, common throughout the computing world (not NVIDIA specific). [[User:Neven|Neven]] ([[User talk:Neven|talk]]) 10:21, 9 September 2020 (UTC)<br />
<br />
:::I agree that the fact that "power management" includes system sleep is long established semantics when you talk about ''system'' power management, but I disagree that "power management" is the best term to describe what is going on here. The nvidia driver connects to the suspend pipeline to save the GPU state, including (part of) the video memory. The purpose of the "new" method is to save full video memory, which is purely a visual convenience thing, and some "advanced" CUDA state. There is nothing related to saving or otherwise managing power of the GPU, which is why I find the term "power management" inappropriate for this section. The section should use terms which clearly describe what is going on. -- [[User:Lahwaacz|Lahwaacz]] ([[User talk:Lahwaacz|talk]]) 14:42, 9 September 2020 (UTC)<br />
<br />
=== Common configuration ===<br />
Well, it's new, of course not everybody is using it; but, at least on my system, chromium (and other heavy GPU users, too, I assume) is currently unusable (more correctly - unviewable) after resuming from system sleep without this feature. Surely this is will become a very common configuration for NVIDIA users soon, at least those that also need to suspend their system. [[User:Neven|Neven]] ([[User talk:Neven|talk]]) 22:00, 8 September 2020 (UTC)<br />
<br />
:It might be new because nvidia added it in a recent driver version, not because few people use it. The fact that your system needs it does not make it common. -- [[User:Lahwaacz|Lahwaacz]] ([[User talk:Lahwaacz|talk]]) 08:09, 9 September 2020 (UTC)<br />
<br />
=== Experimental ===<br />
I'm not sure what are you asking exactly, it seems like it's a question directed more at NVIDIA than at me; but I can say that it seems like it's not perfect yet, as I had some worrying messages in dmesg after resuming with the new features enabled and Chromium running. Everything seemed to be OK apart from the messages, though, so clearly a great improvement. [[User:Neven|Neven]] ([[User talk:Neven|talk]]) 22:00, 8 September 2020 (UTC)<br />
<br />
=== Upstream documentation ===<br />
Linked in the second sentence of the section, also available in nvidia-utils package (powermanagement.html). Titled "Chapter 21. Configuring Power Management Support". [[User:Neven|Neven]] ([[User talk:Neven|talk]]) 22:00, 8 September 2020 (UTC)<br />
<br />
== Update #Unsupported drivers (390xx) for GF117M ==<br />
<br />
3. Install the appropriate driver for your card:<br />
For GeForce 400/500/600 series cards [NVCx and NVDx] from around 2010-2011, install the nvidia-390xx-dkmsAUR package.<br />
<br />
change to:<br />
For GeForce 400/500/600/710M/720M/810M/820M series cards [NVCx, NVDx and GF117M] from around 2010-2014, install the nvidia-390xx-dkmsAUR package.<br />
<br />
{{Unsigned|00:59, 28 September 2020 (UTC)|Nullstric}}<br />
<br />
== Kernel 5.9 and Nvidia ==<br />
<br />
Update: It seems that more parts, like Vulkan Raytracing, NVENC etc. are also affected.<br />
<br />
It seems that "only" CUDA and OpenCL are affected.<br />
Other functionalities seem to work.<br />
<br />
Look at Bugreport for details: https://bugs.archlinux.org/task/68312<br />
<br />
[[User:G3ro|G3ro]] ([[User talk:G3ro|talk]]) 15:13, 20 October 2020 (UTC) G3ro<br />
<br />
== GPU at 0000:0X:00.0 has fallen off the bus. ==<br />
<br />
:Whilst using the kermel parameter nvidia-drm.modeset=1 with linux and linux-ck my machine randomly freezes with only this in journal,<br />
<br />
{{C|<br />
Nov 24 15:55:56 archlinux kernel: NVRM: loading NVIDIA UNIX x86_64 Kernel Module 390.138 Thu May 14 01:01:53 PDT 2020 (using threaded interrupts)<br />
Nov 24 16:04:49 hawker64 kernel: NVRM: GPU at PCI:0000:02:00: GPU-feeae056-097a-fe32-3f56-3732296882d2<br />
Nov 24 16:04:49 hawker64 kernel: NVRM: Xid (PCI:0000:02:00): 79, GPU has fallen off the bus.<br />
Nov 24 16:04:49 hawker64 kernel: NVRM: GPU at 0000:02:00.0 has fallen off the bus.<br />
Nov 24 16:04:49 hawker64 kernel: NVRM: A GPU crash dump has been created. If possible, please run<br />
NVRM: nvidia-bug-report.sh as root to collect this data before<br />
NVRM: the NVIDIA kernel module is unloaded. <br />
}}<br />
<br />
:A search on BBS shows that its a known common issue and apparently the error message is somewhat generic and could be down to faulty hardware or a regression in driver or other software, i have removed the parameter and all is well for now.</div>Cirrushttps://wiki.archlinux.org/index.php?title=Dwm&diff=642259Dwm2020-11-24T16:13:15Z<p>Cirrus: added info on how to map both alt keys as meta</p>
<hr />
<div>{{lowercase title}}<br />
[[Category:Dynamic WMs]]<br />
[[Category:Suckless]]<br />
[[de:Dwm]]<br />
[[es:Dwm]]<br />
[[fr:DWM]]<br />
[[ja:Dwm]]<br />
[[pt:Dwm]]<br />
[[ru:Dwm]]<br />
[[zh-hans:Dwm]]<br />
{{Related articles start}}<br />
{{Related|dmenu}}<br />
{{Related|Window manager}}<br />
{{Related articles end}}<br />
[https://dwm.suckless.org/ dwm] is a dynamic window manager for [[Xorg]]. It manages windows in tiled, stacked, and full-screen layouts, as well as many others with the help of optional patches. Layouts can be applied dynamically, optimizing the environment for the application in use and the task being performed. dwm is extremely lightweight and fast, written in C and with a stated design goal of remaining under 2000 source lines of code. It provides [[multihead]] support for [[xrandr]] and Xinerama.<br />
<br />
== Installation ==<br />
<br />
The prescribed way to install dwm is to clone the [https://git.suckless.org/dwm/ official git repo], run {{ic|make}}, and then {{ic|make install}}. dwm can also be installed with the AUR packages {{AUR|dwm}} or {{AUR|dwm-git}}. Make any required [[#Configuration]] changes '''before''' building and installing, see [[makepkg]].<br />
<br />
=== Configuration ===<br />
<br />
dwm is configured at compile-time by editing some of its source files, specifically {{ic|config.h}}. For detailed information on these settings see the included, well-commented {{ic|config.def.h}} as well as the [https://dwm.suckless.org/customisation/ customisation section] on the dwm website.<br />
<br />
The official website has a number of [http://dwm.suckless.org/patches/ patches] that can add extra functionality to dwm. These patches primarily make changes to the {{ic|dwm.c}} file but also make changes to the {{ic|config.h}} file where appropriate. For information on applying patches, see the [[Patching packages]] article.<br />
<br />
== Starting ==<br />
<br />
Select ''Dwm'' from the menu in a [[display manager]] of choice. Alternatively, to start dwm with [[startx]] append {{ic|exec dwm}} to {{ic|~/.xinitrc}} and prepend other programs to execute them as well, for example:<br />
<br />
redshift -O3500; xset r rate 300 50; exec dwm<br />
<br />
== Usage ==<br />
<br />
See the [https://dwm.suckless.org/tutorial dwm tutorial] for information on basic dwm usage.<br />
<br />
== Tips and tricks ==<br />
<br />
=== Statusbar configuration ===<br />
<br />
For more examples of status bars see [https://dwm.suckless.org/status_monitor/].<br />
<br />
{{Note|The following requires the {{Pkg|xorg-xsetroot}} package to be installed.}}<br />
<br />
dwm reads the name of the root window and redirects it to the statusbar. The root window is the window within which all other windows are drawn and arranged by the window manager. Like any other window, the root window has a title/name, but it is usually undefined because the root window always runs in the background. <br />
<br />
The information that you want dwm to show in the statusbar should be defined with {{ic|xsetroot -name ""}} command in {{ic|~/.xinitrc}} or {{ic|~/.xprofile}} (if you are using a [[display manager]]). For example: <br />
{{bc|xsetroot -name "Thanks for all the fish!"}}<br />
<br />
Dynamically updated information should be put in a loop which is forked to background - see the example below:<br />
{{bc|<br />
# Statusbar loop<br />
while true; do<br />
xsetroot -name "$( date +"%F %R" )"<br />
sleep 1m # Update time every minute<br />
done &<br />
<br />
# Autostart section<br />
pcmanfm & <br />
<br />
exec dwm<br />
}}<br />
In this case the date is shown in [[wikipedia:ISO_8601|ISO 8601]] format and [[PCManFM]] is launched at startup. <br />
<br />
{{note|It is not recommended to set the update interval equal to zero or remove the "sleep" line entirely since this will cause CPU usage to rise substantially (you can assess the effect with ''top'' and [[powertop]]).}}<br />
<br />
==== Conky statusbar ====<br />
<br />
[[Conky]] can be printed to the statusbar with {{Ic|xsetroot -name}}:<br />
(conky | while read LINE; do xsetroot -name "$LINE"; done) &<br />
exec dwm<br />
<br />
If you do not want to spawn too many PIDs by 'xsetroot' command, you can compile this C program:<br />
#include <string.h><br />
#include <stdlib.h><br />
#include <stdio.h><br />
#include <X11/Xlib.h><br />
<br />
int main(int argc, char * argv[])<br />
{<br />
Display * dpy = NULL;<br />
Window win = 0;<br />
size_t length = 0;<br />
ssize_t bytes_read = 0;<br />
char * input = NULL;<br />
<br />
dpy = XOpenDisplay(getenv("DISPLAY"));<br />
if (dpy == NULL)<br />
{<br />
fprintf(stderr, "Can't open display, exiting.\n");<br />
exit(1);<br />
}<br />
win = DefaultRootWindow(dpy);<br />
<br />
while ((bytes_read = getline(&input, &length, stdin)) != EOF)<br />
{<br />
input[strlen(input) - 1] = '\0';<br />
XStoreName(dpy, win, input);<br />
XFlush(dpy);<br />
fprintf(stderr, "Input: %s", input);<br />
fprintf(stderr, "\nbytes read: %ld\n", bytes_read);<br />
}<br />
free(input);<br />
return 0;<br />
}<br />
<br />
Save this code to file dwm-setstatus.c, compile:<br />
$ gcc dwm-setstatus.c -lX11 -o dwm-setstatus<br />
move 'dwm-setstatus' within your $PATH (/usr/local/bin, for example)<br />
# mv dwm-setstatus /usr/local/bin<br />
and run:<br />
$ conky | dwm-setstatus<br />
<br />
To do this, conky needs to be told to output text to the console only. The following is a sample conkyrc for a dual core CPU, displaying several usage statistics:<br />
{{bc|<br />
<nowiki>conky.config = {<br />
out_to_console = true,<br />
out_to_x = false,<br />
background = false,<br />
update_interval = 2,<br />
total_run_times = 0,<br />
use_spacer = 'none',<br />
};<br />
conky.text = [[<br />
$mpd_smart :: ${cpu cpu1}% / ${cpu cpu2}% ${loadavg 1} ${loadavg 2 3} :: ${acpitemp}c :: $memperc% ($mem) :: ${downspeed eth0}K/s ${upspeed eth0}K/s :: ${time %a %b %d %I:%M%P}<br />
]];</nowiki><br />
}}<br />
<br />
For icons and color options, see [[dzen]].<br />
<br />
=== Restart dwm ===<br />
<br />
To restart dwm without logging out or closing applications, change or add a startup script so that it loads dwm in a ''while'' loop, for example:<br />
{{bc|<br />
while true; do<br />
# Log stderror to a file <br />
dwm 2> ~/.dwm.log<br />
# No error logging<br />
#dwm >/dev/null 2>&1<br />
done<br />
}}<br />
<br />
dwm can now be restarted without destroying other X windows by pressing the usual Mod-Shift-Q combination.<br />
<br />
It is a good idea to place the above startup script into a separate file, {{ic|~/bin/startdwm}} for instance, and execute it through {{ic|~/.xinitrc}}. From this point on, when you wish to end the X session, simply execute {{Ic|killall xinit}}, or bind it to a convenient keybind. Alternatively, you could setup your dwm session script so that it relaunches dwm only if the binary changes. This could be useful in the case where you change a setting or update the dwm code base.<br />
<br />
{{bc|1=<br />
# relaunch DWM if the binary changes, otherwise bail<br />
csum=""<br />
new_csum=$(sha1sum $(which dwm))<br />
while true<br />
do<br />
if [ "$csum" != "$new_csum" ]<br />
then<br />
csum=$new_csum<br />
dwm<br />
else<br />
exit 0<br />
fi<br />
new_csum=$(sha1sum $(which dwm))<br />
sleep 0.5<br />
done<br />
}}<br />
<br />
=== Bind the right Alt key to Mod4 ===<br />
<br />
When using Mod4 (the Super/Windows Key) as the {{Ic|MODKEY}}, it may be equally convenient to have the right {{ic|Alt}} key ({{ic|Alt_R}}) act as {{ic|Mod4}}. This will allow you to perform otherwise awkward keystrokes one-handed, such as zooming with {{ic|Alt_R}}+{{ic|Enter}}. <br />
<br />
First, find out which keycode is assigned to {{ic|Alt_R}}:<br />
xmodmap -pke | grep Alt_R<br />
<br />
Then simply add the following to the startup script (e.g. {{ic|~/.xinitrc}}), changing the keycode ''113'' if necessary to the result gathered by the previous {{Ic|xmodmap}} command:<br />
xmodmap -e "keycode 113 = Super_L" # reassign Alt_R to Super_L<br />
xmodmap -e "remove mod1 = Super_L" # make sure X keeps it out of the mod1 group<br />
<br />
After doing so, any functions that are triggered by the {{ic|Super_L}} key press will also be triggered by an {{ic|Alt_R}} key press.<br />
<br />
{{note|There is a {{ic|#define}} option in [[#Configuration|config.h]] which also allows you to switch the modkey.}}<br />
<br />
=== Use both Alt keys as Meta in DWM ===<br />
<br />
:Use xmodmap to assign Alt_L as a secondary meta key in DWM (provided already using Mod1Mask (Alt_R))<br />
<br />
{{hc|~/.xinitrc|<nowiki><br />
/usr/bin/xmodmap -e "clear mod5"<br />
/usr/bin/xmodmap -e "keycode 108 = Alt_L"<br />
</nowiki>}}<br />
{{User:cirrus|00:25, 24 November 2020 (GMT)}}<br />
<br />
=== Space around font in dwm's bar ===<br />
<br />
By default, dwm's bar adds 2px around the size of the font. To change this, modify the following line in {{ic|dwm.c}}:<br />
{{bc|1=bh = dc.h = dc.font.height + 2;}}<br />
<br />
=== Disable focus follows mouse ===<br />
<br />
To disable focus follows mouse behaviour comment out the following line in definiton of struct handler in {{ic|dwm.c}} <br />
{{bc|1=[EnterNotify] = enternotify, }}<br />
Note that this change can cause some difficulties; the first click on an inactive window will only bring the focus to it. To interact with window contents (buttons, fields etc) you need to click again. Also, if you have several monitors, you may notice that the keyboard focus does not switch to another monitor activated by clicking.<br />
<br />
=== Floating layout for some windows ===<br />
<br />
For some windows, such as preferences dialogs, it does not make sense for these windows to be tiled - they should be free-floating instead. For example, to make Firefox's preferences dialog float, add the following to your rules array in {{ic|config.h}}:<br />
<br />
{ "Firefox", NULL, "Firefox Preferences", 1 << 8, True, -1 },<br />
<br />
=== Using Tilda with dwm ===<br />
<br />
dwm can manages placement of windows automatically, so it takes some configuration to make [[Tilda]] work properly.<br />
<br />
You have to edit dwm's {{ic|config.h}} and recompile/reinstall dwm to properly account for Tilda.<br />
<br />
Get the latest [[PKGBUILD]] for dwm:<br />
# asp export community/dwm<br />
<br />
Copy newest sources to your working directory, I am using {{ic|~/sources}}:<br />
$ cp -r /var/abs/community/dwm ~/sources<br />
<br />
Get into working directory to start config:<br />
$ cd ~/sources/dwm<br />
<br />
Edit config.h:<br />
{{bc|1=static const Rule rules[] = {<br />
/* class instance title tags mask isfloating monitor */<br />
{ "Gimp", NULL, NULL, 0, True, -1 },<br />
{ "Firefox", NULL, NULL, 1 << 8, False, -1 },<br />
//add the line below<br />
{ "Tilda", NULL, NULL, 0, True, -1 },<br />
{ "Volumeicon", NULL, NULL, 0, True, -1 },<br />
};}}<br />
<br />
The above makes all windows with the WM_CLASS "Tilda" floating. The word "Tilda" has to be uppercase, as shown by<br />
<br />
$ xprop |grep WM_CLASS<br />
<br />
Save {{ic|config.h}}, then compile and install dwm:<br />
<br />
$ makepkg -g >> PKGBUILD && makepkg -efi<br />
<br />
Start dwm or restart dwm if it is already active, either by MOD+SHIFT+Q or killing dwm and restarting it.<br />
<br />
Launch tilda with -C option:<br />
<br />
$ tilda -C<br />
<br />
Now you can configure Tilda, the following options are provided as a recommendation:<br />
<br />
{{bc|Font: Clean 9<br />
Appearance: Height: 50%, Width: 70%, Centered Horizontally<br />
Extras: Enable Transparency Level 15<br />
Animated Pulldown: 1500 usec, Orientation: Top<br />
Colors: Built-in Scheme "Green on Black"<br />
Scrolling: Scrollbar is on the left, 2000 lines scrollback<br />
Key Binding: F9<br />
}}<br />
<br />
Here is what the configuration looks like after those settings in {{ic|~/.config/tilda/config_0}}:<br />
<br />
{{bc|1=<br />
tilda_config_version = "0.9.6"<br />
# image = ""<br />
# command = ""<br />
font = "Clean 9"<br />
key = "F9"<br />
title = "Tilda"<br />
background_color = "white"<br />
# working_dir = ""<br />
web_browser = "firefox"<br />
lines = 2000<br />
max_width = 956<br />
max_height = 384<br />
min_width = 1<br />
min_height = 1<br />
transparency = 15<br />
x_pos = 205<br />
y_pos = 1<br />
tab_pos = 0<br />
backspace_key = 0<br />
delete_key = 1<br />
d_set_title = 3<br />
command_exit = 2<br />
scheme = 1<br />
slide_sleep_usec = 1500<br />
animation_orientation = 0<br />
scrollbar_pos = 0<br />
back_red = 0<br />
back_green = 0<br />
back_blue = 0<br />
text_red = 0<br />
text_green = 65535<br />
text_blue = 0<br />
scroll_background = true<br />
scroll_on_output = false<br />
notebook_border = false<br />
antialias = true<br />
scrollbar = false<br />
use_image = false<br />
grab_focus = true<br />
above = true<br />
notaskbar = true<br />
bold = true<br />
blinks = true<br />
scroll_on_key = true<br />
bell = false<br />
run_command = false<br />
pinned = true<br />
animation = true<br />
hidden = true<br />
centered_horizontally = true<br />
centered_vertically = false<br />
enable_transparency = true<br />
double_buffer = false<br />
}}<br />
<br />
It is important you enable the pulldown-animation, otherwise Tilda will keep jumping down each time you unhide it, must be a dwm issue.<br />
<br />
== Troubleshooting ==<br />
<br />
=== Fixing misbehaving Java applications ===<br />
<br />
Try setting <code>export _JAVA_AWT_WM_NONREPARENTING=1</code>. Also see the [[Java#Gray window, applications not resizing with WM, menus immediately closing|Java]] page.<br />
<br />
=== Fixing gaps around terminal windows ===<br />
<br />
If there are empty gaps of desktop space outside terminal windows, it is likely due to the terminal's font size. Either adjust the size until finding the ideal scale that closes the gap, or toggle {{Ic|resizehints}} to ''0'' in {{ic|config.h}}.<br />
<br />
This will cause dwm to ignore resize requests from all client windows, not just terminals. The downside to this workaround is that some terminals may suffer redraw anomalies, such as ghost lines and premature line wraps, among others.<br />
<br />
Alternatively, if you use the [[st]] terminal emulator, you can apply the [https://st.suckless.org/patches/anysize/ anysize] patch and recompile st.<br />
<br />
== Known issues ==<br />
<br />
=== Crashes due to Emojis in some fonts ===<br />
<br />
Emojis in title bars may cause dwm to crash with an error similar to the following:<br />
<br />
dwm: fatal error: request code=140, error code=16<br />
X Error of failed request: BadLength (poly request too large or internal Xlib length error)<br />
Major opcode of failed request: 140 (RENDER)<br />
Minor opcode of failed request: 20 (RenderAddGlyphs)<br />
Serial number of failed request: 4319<br />
Current serial number in output stream: 4331<br />
<br />
This only occurs with some fonts, such as {{pkg|noto-fonts-emoji}} and {{pkg|bdf-unifont}}. See [https://lists.suckless.org/dev/1608/30245.html], [https://lists.suckless.org/dev/1610/30710.html], [https://bbs.archlinux.org/viewtopic.php?id=226928], [https://www.reddit.com/r/archlinux/comments/703ayu/anyone_with_dwm_and_notofontsemoji/], and the upstream bug report [https://gitlab.freedesktop.org/xorg/lib/libxft/issues/6]. Possible workarounds are using a different font or the patch in [https://lists.suckless.org/dev/1610/30720.html].<br />
<br />
An upstream fix has been proposed [https://gitlab.freedesktop.org/xorg/lib/libxft/merge_requests/1], but as of writing has not been merged. See {{AUR|libxft-bgra}} and {{AUR|lib32-libxft-bgra}} for patched versions of libXft, properly displaying emoji without crashing.<br />
<br />
== See also ==<br />
<br />
* [https://dwm.suckless.org/ dwm's official website]<br />
* [http://www.youtube.com/watch?v=GQ5s6T25jCc Introduction to dwm video]<br />
* [[dmenu]] - Simple application launcher from the developers of dwm<br />
* The [https://bbs.archlinux.org/viewtopic.php?id=57549/ dwm thread] on the forums<br />
* [https://bbs.archlinux.org/viewtopic.php?id=92895/ Hacking dwm thread]<br />
* Check out the forums' [https://bbs.archlinux.org/viewtopic.php?id=57768/ wallpaper thread] for a selection of dwm wallpapers<br />
*[https://bbs.archlinux.org/viewtopic.php?id=74599 Show off your dwm configuration forum thread]</div>Cirrushttps://wiki.archlinux.org/index.php?title=Dwm&diff=642216Dwm2020-11-24T00:42:26Z<p>Cirrus: /* Use both Alt keys as Meta in DWM */</p>
<hr />
<div>{{lowercase title}}<br />
[[Category:Dynamic WMs]]<br />
[[Category:Suckless]]<br />
[[de:Dwm]]<br />
[[es:Dwm]]<br />
[[fr:DWM]]<br />
[[ja:Dwm]]<br />
[[pt:Dwm]]<br />
[[ru:Dwm]]<br />
[[zh-hans:Dwm]]<br />
{{Related articles start}}<br />
{{Related|dmenu}}<br />
{{Related|Window manager}}<br />
{{Related articles end}}<br />
[https://dwm.suckless.org/ dwm] is a dynamic window manager for [[Xorg]]. It manages windows in tiled, stacked, and full-screen layouts, as well as many others with the help of optional patches. Layouts can be applied dynamically, optimizing the environment for the application in use and the task being performed. dwm is extremely lightweight and fast, written in C and with a stated design goal of remaining under 2000 source lines of code. It provides [[multihead]] support for [[xrandr]] and Xinerama.<br />
<br />
== Installation ==<br />
<br />
The prescribed way to install dwm is to clone the [https://git.suckless.org/dwm/ official git repo], run {{ic|make}}, and then {{ic|make install}}. dwm can also be installed with the AUR packages {{AUR|dwm}} or {{AUR|dwm-git}}. Make any required [[#Configuration]] changes '''before''' building and installing, see [[makepkg]].<br />
<br />
=== Configuration ===<br />
<br />
dwm is configured at compile-time by editing some of its source files, specifically {{ic|config.h}}. For detailed information on these settings see the included, well-commented {{ic|config.def.h}} as well as the [https://dwm.suckless.org/customisation/ customisation section] on the dwm website.<br />
<br />
The official website has a number of [http://dwm.suckless.org/patches/ patches] that can add extra functionality to dwm. These patches primarily make changes to the {{ic|dwm.c}} file but also make changes to the {{ic|config.h}} file where appropriate. For information on applying patches, see the [[Patching packages]] article.<br />
<br />
== Starting ==<br />
<br />
Select ''Dwm'' from the menu in a [[display manager]] of choice. Alternatively, to start dwm with [[startx]] append {{ic|exec dwm}} to {{ic|~/.xinitrc}} and prepend other programs to execute them as well, for example:<br />
<br />
redshift -O3500; xset r rate 300 50; exec dwm<br />
<br />
== Usage ==<br />
<br />
See the [https://dwm.suckless.org/tutorial dwm tutorial] for information on basic dwm usage.<br />
<br />
== Tips and tricks ==<br />
<br />
=== Statusbar configuration ===<br />
<br />
For more examples of status bars see [https://dwm.suckless.org/status_monitor/].<br />
<br />
{{Note|The following requires the {{Pkg|xorg-xsetroot}} package to be installed.}}<br />
<br />
dwm reads the name of the root window and redirects it to the statusbar. The root window is the window within which all other windows are drawn and arranged by the window manager. Like any other window, the root window has a title/name, but it is usually undefined because the root window always runs in the background. <br />
<br />
The information that you want dwm to show in the statusbar should be defined with {{ic|xsetroot -name ""}} command in {{ic|~/.xinitrc}} or {{ic|~/.xprofile}} (if you are using a [[display manager]]). For example: <br />
{{bc|xsetroot -name "Thanks for all the fish!"}}<br />
<br />
Dynamically updated information should be put in a loop which is forked to background - see the example below:<br />
{{bc|<br />
# Statusbar loop<br />
while true; do<br />
xsetroot -name "$( date +"%F %R" )"<br />
sleep 1m # Update time every minute<br />
done &<br />
<br />
# Autostart section<br />
pcmanfm & <br />
<br />
exec dwm<br />
}}<br />
In this case the date is shown in [[wikipedia:ISO_8601|ISO 8601]] format and [[PCManFM]] is launched at startup. <br />
<br />
{{note|It is not recommended to set the update interval equal to zero or remove the "sleep" line entirely since this will cause CPU usage to rise substantially (you can assess the effect with ''top'' and [[powertop]]).}}<br />
<br />
==== Conky statusbar ====<br />
<br />
[[Conky]] can be printed to the statusbar with {{Ic|xsetroot -name}}:<br />
(conky | while read LINE; do xsetroot -name "$LINE"; done) &<br />
exec dwm<br />
<br />
If you do not want to spawn too many PIDs by 'xsetroot' command, you can compile this C program:<br />
#include <string.h><br />
#include <stdlib.h><br />
#include <stdio.h><br />
#include <X11/Xlib.h><br />
<br />
int main(int argc, char * argv[])<br />
{<br />
Display * dpy = NULL;<br />
Window win = 0;<br />
size_t length = 0;<br />
ssize_t bytes_read = 0;<br />
char * input = NULL;<br />
<br />
dpy = XOpenDisplay(getenv("DISPLAY"));<br />
if (dpy == NULL)<br />
{<br />
fprintf(stderr, "Can't open display, exiting.\n");<br />
exit(1);<br />
}<br />
win = DefaultRootWindow(dpy);<br />
<br />
while ((bytes_read = getline(&input, &length, stdin)) != EOF)<br />
{<br />
input[strlen(input) - 1] = '\0';<br />
XStoreName(dpy, win, input);<br />
XFlush(dpy);<br />
fprintf(stderr, "Input: %s", input);<br />
fprintf(stderr, "\nbytes read: %ld\n", bytes_read);<br />
}<br />
free(input);<br />
return 0;<br />
}<br />
<br />
Save this code to file dwm-setstatus.c, compile:<br />
$ gcc dwm-setstatus.c -lX11 -o dwm-setstatus<br />
move 'dwm-setstatus' within your $PATH (/usr/local/bin, for example)<br />
# mv dwm-setstatus /usr/local/bin<br />
and run:<br />
$ conky | dwm-setstatus<br />
<br />
To do this, conky needs to be told to output text to the console only. The following is a sample conkyrc for a dual core CPU, displaying several usage statistics:<br />
{{bc|<br />
<nowiki>conky.config = {<br />
out_to_console = true,<br />
out_to_x = false,<br />
background = false,<br />
update_interval = 2,<br />
total_run_times = 0,<br />
use_spacer = 'none',<br />
};<br />
conky.text = [[<br />
$mpd_smart :: ${cpu cpu1}% / ${cpu cpu2}% ${loadavg 1} ${loadavg 2 3} :: ${acpitemp}c :: $memperc% ($mem) :: ${downspeed eth0}K/s ${upspeed eth0}K/s :: ${time %a %b %d %I:%M%P}<br />
]];</nowiki><br />
}}<br />
<br />
For icons and color options, see [[dzen]].<br />
<br />
=== Restart dwm ===<br />
<br />
To restart dwm without logging out or closing applications, change or add a startup script so that it loads dwm in a ''while'' loop, for example:<br />
{{bc|<br />
while true; do<br />
# Log stderror to a file <br />
dwm 2> ~/.dwm.log<br />
# No error logging<br />
#dwm >/dev/null 2>&1<br />
done<br />
}}<br />
<br />
dwm can now be restarted without destroying other X windows by pressing the usual Mod-Shift-Q combination.<br />
<br />
It is a good idea to place the above startup script into a separate file, {{ic|~/bin/startdwm}} for instance, and execute it through {{ic|~/.xinitrc}}. From this point on, when you wish to end the X session, simply execute {{Ic|killall xinit}}, or bind it to a convenient keybind. Alternatively, you could setup your dwm session script so that it relaunches dwm only if the binary changes. This could be useful in the case where you change a setting or update the dwm code base.<br />
<br />
{{bc|1=<br />
# relaunch DWM if the binary changes, otherwise bail<br />
csum=""<br />
new_csum=$(sha1sum $(which dwm))<br />
while true<br />
do<br />
if [ "$csum" != "$new_csum" ]<br />
then<br />
csum=$new_csum<br />
dwm<br />
else<br />
exit 0<br />
fi<br />
new_csum=$(sha1sum $(which dwm))<br />
sleep 0.5<br />
done<br />
}}<br />
<br />
=== Bind the right Alt key to Mod4 ===<br />
<br />
When using Mod4 (the Super/Windows Key) as the {{Ic|MODKEY}}, it may be equally convenient to have the right {{ic|Alt}} key ({{ic|Alt_R}}) act as {{ic|Mod4}}. This will allow you to perform otherwise awkward keystrokes one-handed, such as zooming with {{ic|Alt_R}}+{{ic|Enter}}. <br />
<br />
First, find out which keycode is assigned to {{ic|Alt_R}}:<br />
xmodmap -pke | grep Alt_R<br />
<br />
Then simply add the following to the startup script (e.g. {{ic|~/.xinitrc}}), changing the keycode ''113'' if necessary to the result gathered by the previous {{Ic|xmodmap}} command:<br />
xmodmap -e "keycode 113 = Super_L" # reassign Alt_R to Super_L<br />
xmodmap -e "remove mod1 = Super_L" # make sure X keeps it out of the mod1 group<br />
<br />
After doing so, any functions that are triggered by the {{ic|Super_L}} key press will also be triggered by an {{ic|Alt_R}} key press.<br />
<br />
{{note|There is a {{ic|#define}} option in [[#Configuration|config.h]] which also allows you to switch the modkey.}}<br />
<br />
== Use both Alt keys as Meta in DWM ==<br />
:<br />
:Use xmodmap to assign Alt_L as a secondary meta key in DWM (provided already using Mod1Mask (Alt_R))<br />
:<br />
:{{hc|~/.xinitrc|<nowiki><br />
/usr/bin/xmodmap -e "clear mod5"<br />
/usr/bin/xmodmap -e "keycode 108 = Alt_L"<br />
</nowiki>}}<br />
[[User:Cirrus|Cirrus]] ([[User talk:Cirrus|talk]]) 00:42, 24 November 2020 (UTC)<br />
{{User:cirrus|00:25, 24 November 2020 (GMT)}}<br />
<br />
=== Space around font in dwm's bar ===<br />
<br />
By default, dwm's bar adds 2px around the size of the font. To change this, modify the following line in {{ic|dwm.c}}:<br />
{{bc|1=bh = dc.h = dc.font.height + 2;}}<br />
<br />
=== Disable focus follows mouse ===<br />
<br />
To disable focus follows mouse behaviour comment out the following line in definiton of struct handler in {{ic|dwm.c}} <br />
{{bc|1=[EnterNotify] = enternotify, }}<br />
Note that this change can cause some difficulties; the first click on an inactive window will only bring the focus to it. To interact with window contents (buttons, fields etc) you need to click again. Also, if you have several monitors, you may notice that the keyboard focus does not switch to another monitor activated by clicking.<br />
<br />
=== Floating layout for some windows ===<br />
<br />
For some windows, such as preferences dialogs, it does not make sense for these windows to be tiled - they should be free-floating instead. For example, to make Firefox's preferences dialog float, add the following to your rules array in {{ic|config.h}}:<br />
<br />
{ "Firefox", NULL, "Firefox Preferences", 1 << 8, True, -1 },<br />
<br />
=== Using Tilda with dwm ===<br />
<br />
dwm can manages placement of windows automatically, so it takes some configuration to make [[Tilda]] work properly.<br />
<br />
You have to edit dwm's {{ic|config.h}} and recompile/reinstall dwm to properly account for Tilda.<br />
<br />
Get the latest [[PKGBUILD]] for dwm:<br />
# asp export community/dwm<br />
<br />
Copy newest sources to your working directory, I am using {{ic|~/sources}}:<br />
$ cp -r /var/abs/community/dwm ~/sources<br />
<br />
Get into working directory to start config:<br />
$ cd ~/sources/dwm<br />
<br />
Edit config.h:<br />
{{bc|1=static const Rule rules[] = {<br />
/* class instance title tags mask isfloating monitor */<br />
{ "Gimp", NULL, NULL, 0, True, -1 },<br />
{ "Firefox", NULL, NULL, 1 << 8, False, -1 },<br />
//add the line below<br />
{ "Tilda", NULL, NULL, 0, True, -1 },<br />
{ "Volumeicon", NULL, NULL, 0, True, -1 },<br />
};}}<br />
<br />
The above makes all windows with the WM_CLASS "Tilda" floating. The word "Tilda" has to be uppercase, as shown by<br />
<br />
$ xprop |grep WM_CLASS<br />
<br />
Save {{ic|config.h}}, then compile and install dwm:<br />
<br />
$ makepkg -g >> PKGBUILD && makepkg -efi<br />
<br />
Start dwm or restart dwm if it is already active, either by MOD+SHIFT+Q or killing dwm and restarting it.<br />
<br />
Launch tilda with -C option:<br />
<br />
$ tilda -C<br />
<br />
Now you can configure Tilda, the following options are provided as a recommendation:<br />
<br />
{{bc|Font: Clean 9<br />
Appearance: Height: 50%, Width: 70%, Centered Horizontally<br />
Extras: Enable Transparency Level 15<br />
Animated Pulldown: 1500 usec, Orientation: Top<br />
Colors: Built-in Scheme "Green on Black"<br />
Scrolling: Scrollbar is on the left, 2000 lines scrollback<br />
Key Binding: F9<br />
}}<br />
<br />
Here is what the configuration looks like after those settings in {{ic|~/.config/tilda/config_0}}:<br />
<br />
{{bc|1=<br />
tilda_config_version = "0.9.6"<br />
# image = ""<br />
# command = ""<br />
font = "Clean 9"<br />
key = "F9"<br />
title = "Tilda"<br />
background_color = "white"<br />
# working_dir = ""<br />
web_browser = "firefox"<br />
lines = 2000<br />
max_width = 956<br />
max_height = 384<br />
min_width = 1<br />
min_height = 1<br />
transparency = 15<br />
x_pos = 205<br />
y_pos = 1<br />
tab_pos = 0<br />
backspace_key = 0<br />
delete_key = 1<br />
d_set_title = 3<br />
command_exit = 2<br />
scheme = 1<br />
slide_sleep_usec = 1500<br />
animation_orientation = 0<br />
scrollbar_pos = 0<br />
back_red = 0<br />
back_green = 0<br />
back_blue = 0<br />
text_red = 0<br />
text_green = 65535<br />
text_blue = 0<br />
scroll_background = true<br />
scroll_on_output = false<br />
notebook_border = false<br />
antialias = true<br />
scrollbar = false<br />
use_image = false<br />
grab_focus = true<br />
above = true<br />
notaskbar = true<br />
bold = true<br />
blinks = true<br />
scroll_on_key = true<br />
bell = false<br />
run_command = false<br />
pinned = true<br />
animation = true<br />
hidden = true<br />
centered_horizontally = true<br />
centered_vertically = false<br />
enable_transparency = true<br />
double_buffer = false<br />
}}<br />
<br />
It is important you enable the pulldown-animation, otherwise Tilda will keep jumping down each time you unhide it, must be a dwm issue.<br />
<br />
== Troubleshooting ==<br />
<br />
=== Fixing misbehaving Java applications ===<br />
<br />
Try setting <code>export _JAVA_AWT_WM_NONREPARENTING=1</code>. Also see the [[Java#Gray window, applications not resizing with WM, menus immediately closing|Java]] page.<br />
<br />
=== Fixing gaps around terminal windows ===<br />
<br />
If there are empty gaps of desktop space outside terminal windows, it is likely due to the terminal's font size. Either adjust the size until finding the ideal scale that closes the gap, or toggle {{Ic|resizehints}} to ''0'' in {{ic|config.h}}.<br />
<br />
This will cause dwm to ignore resize requests from all client windows, not just terminals. The downside to this workaround is that some terminals may suffer redraw anomalies, such as ghost lines and premature line wraps, among others.<br />
<br />
Alternatively, if you use the [[st]] terminal emulator, you can apply the [https://st.suckless.org/patches/anysize/ anysize] patch and recompile st.<br />
<br />
== Known issues ==<br />
<br />
=== Crashes due to Emojis in some fonts ===<br />
<br />
Emojis in title bars may cause dwm to crash with an error similar to the following:<br />
<br />
dwm: fatal error: request code=140, error code=16<br />
X Error of failed request: BadLength (poly request too large or internal Xlib length error)<br />
Major opcode of failed request: 140 (RENDER)<br />
Minor opcode of failed request: 20 (RenderAddGlyphs)<br />
Serial number of failed request: 4319<br />
Current serial number in output stream: 4331<br />
<br />
This only occurs with some fonts, such as {{pkg|noto-fonts-emoji}} and {{pkg|bdf-unifont}}. See [https://lists.suckless.org/dev/1608/30245.html], [https://lists.suckless.org/dev/1610/30710.html], [https://bbs.archlinux.org/viewtopic.php?id=226928], [https://www.reddit.com/r/archlinux/comments/703ayu/anyone_with_dwm_and_notofontsemoji/], and the upstream bug report [https://gitlab.freedesktop.org/xorg/lib/libxft/issues/6]. Possible workarounds are using a different font or the patch in [https://lists.suckless.org/dev/1610/30720.html].<br />
<br />
An upstream fix has been proposed [https://gitlab.freedesktop.org/xorg/lib/libxft/merge_requests/1], but as of writing has not been merged. See {{AUR|libxft-bgra}} and {{AUR|lib32-libxft-bgra}} for patched versions of libXft, properly displaying emoji without crashing.<br />
<br />
== See also ==<br />
<br />
* [https://dwm.suckless.org/ dwm's official website]<br />
* [http://www.youtube.com/watch?v=GQ5s6T25jCc Introduction to dwm video]<br />
* [[dmenu]] - Simple application launcher from the developers of dwm<br />
* The [https://bbs.archlinux.org/viewtopic.php?id=57549/ dwm thread] on the forums<br />
* [https://bbs.archlinux.org/viewtopic.php?id=92895/ Hacking dwm thread]<br />
* Check out the forums' [https://bbs.archlinux.org/viewtopic.php?id=57768/ wallpaper thread] for a selection of dwm wallpapers<br />
*[https://bbs.archlinux.org/viewtopic.php?id=74599 Show off your dwm configuration forum thread]</div>Cirrushttps://wiki.archlinux.org/index.php?title=Linux-ck&diff=636799Linux-ck2020-09-30T13:37:40Z<p>Cirrus: /* Check if MuQSS is enabled */ didnt show in dmesg on thinkpad x220 however did in journalctl</p>
<hr />
<div>[[Category:Kernel]]<br />
[[ja:Linux-ck]]<br />
[[ru:Linux-ck]]<br />
[[zh-hans:Linux-ck]]<br />
{{Related articles start}}<br />
{{Related|Unofficial user repositories/Repo-ck}}<br />
{{Related|Kernel}}<br />
{{Related|Modprobed-db}}<br />
{{Related articles end}}<br />
<br />
== General package details ==<br />
<br />
{{AUR|Linux-ck}} is a package available both in [[AUR]] and in the [[Unofficial user repositories/Repo-ck|User pre-compiled packages]] that allows users to run a kernel and headers setup patched with Con Kolivas' ck patchset[http://ck.kolivas.org/patches/], including a CPU scheduler named MuQSS (''Multiple Queue Skiplist Scheduler'', pronounced ''mux'') which replaces Brain Fuck Scheduler (BFS), his previous work. Many Arch Linux users choose this kernel for its excellent desktop interactivity and responsiveness under any load situation.<br />
<br />
CK patchset is designed for desktop/laptop use but not for servers. It provides low latency environment and works well for 16 CPUs or fewer. To be able to boot into kernels, the [[boot loader]] has to be configured appropriately.<br />
<br />
=== Release cycle ===<br />
<br />
Linux-ck roughly follows the release cycle of the official Arch kernel but not only. The following are requirements for a new package release:<br />
<br />
* CK patchset compatible with the current kernel version<br />
<br />
=== Long-Term Support (LTS) CK releases ===<br />
<br />
In addition to the {{AUR|linux-ck}} package, there are LTS kernel releases patched with the above patchsets as well and with the previously mentioned modifications:<br />
<br />
* {{AUR|linux-lts-ck}} - The current Arch Linux LTS kernel patched with the CK patchset<br />
<br />
{{Note|This package is maintained by vishwin, thus pre-compiled versions will not be present in the unofficial ck repo.}}<br />
<br />
== More about MuQSS ==<br />
<br />
See the [https://lkml.org/lkml/2016/10/29/4 LKML announcement] posted by CK.<br />
<br />
=== Check if MuQSS is enabled ===<br />
<br />
This start-up message should appear in the kernel ring buffer when MuQSS in enabled:<br />
$ dmesg | grep -i muqss<br />
$ journalctl | grep -i muqss <br />
...<br />
MuQSS CPU scheduler v0.120 by Con Kolivas.<br />
<br />
=== MuQSS patched kernels and systemd ===<br />
<br />
It is a common mistake to think that MuQSS does not support ''cgroups''. It does but not all the cgroup features (e.g. CPU limiting will not work).<br />
<br />
== Using out-of-tree modules with linux-ck ==<br />
<br />
Many out-of-tree modules (broadcom-wl, nvidia, virtualbox, etc.) can be easily compiled and managed by using [[DKMS]].<br />
<br />
== See also ==<br />
<br />
* [http://ck.kolivas.org/patches/ Kernel patch repository of Con Kolivas]<br />
* [http://ck-hack.blogspot.it/ Con Kolivas' Blog]<br />
* [http://lkml.org/lkml/2009/9/6/136 Con Kolivas' first BFS announcement on the Linux Kernel Mailing List]<br />
* [[wikipedia:Con_Kolivas|Wikipedia's Con Kolivas page]]<br />
* [[wikipedia:Brain_Fuck_Scheduler|Wikipedia's BFS article]]<br />
* [https://bbs.archlinux.org/viewtopic.php?pid=1869636 Arch ck Linux forum support thread]</div>Cirrushttps://wiki.archlinux.org/index.php?title=Laptop/Lenovo&diff=600752Laptop/Lenovo2020-03-08T16:24:19Z<p>Cirrus: added useful link for configuring arch on thinkpad x1 carbon</p>
<hr />
<div>[[Category:Lenovo]]<br />
[[ja:ノートパソコン/Lenovo]]<br />
{{Laptops navigation}}<br />
{{Related articles start}}<br />
{{Related|ThinkPad docks}}<br />
{{Related articles end}}<br />
<br />
== IBM/Lenovo ==<br />
<br />
=== ThinkPad ===<br />
<br />
==== Edge series ====<br />
<br />
{{HCL/Laptops table header}}<br />
| [[Lenovo ThinkPad Edge E330]] || NA || Yes || Yes || Yes || Yes || Yes || Yes || NA || ||<br />
|-<br />
| [[Lenovo ThinkPad Edge E335]] || NA || Yes || Yes || Yes || Yes || NA || Yes || NA || ||<br />
|-<br />
| Lenovo ThinkPad Edge E420s || Yes || Yes || Yes || Yes || Yes || Yes || NA || NA || SDcard (Yes), Webcam (Yes), Trackpoint (No) || <br />
|-<br />
| [[Lenovo ThinkPad Edge E430]] || Yes || Yes || Yes* || Yes* || Not tested || Yes || NA || NA || SD card (yes) || <br />
|-<br />
| [[Lenovo ThinkPad Edge E455]] || 2015.04.01 || Yes* || Yes || Yes || Yes || Yes || Yes || NA || ||<br />
|-<br />
| Lenovo ThinkPad Edge E470 || 2017.09.01 || Yes || Yes || Yes || Yes || Not tested || NA || NA || trackpoint (yes) ||<br />
|-<br />
| Lenovo ThinkPad Edge E530 || Yes || Yes || Yes* || Yes* || Yes || Yes || NA || NA || SD card (yes), Finger Print (yes) || E530 without fingerprint reader can be equipt with one.<br />
|-<br />
| Lenovo ThinkPad Edge E531 || Yes || Yes || Yes || Yes || Yes* || Yes || Yes || NA || SD card (yes), Touch Pad/Trackpoint (yes), Webcam (yes) || WiFi only works with {{Pkg|broadcom-wl-dkms}}<br />
|-<br />
| Lenovo ThinkPad Edge E540 || 2015.08.01 || Yes || Yes || Yes || Yes || Yes || Yes* || NA || SD card (yes), Finger Print (yes), touch pad and trackpoint (yes), Webcam (yes) || <br />
|-<br />
| Lenovo ThinkPad Edge E545 || NA || Yes || Yes || Yes || Yes* || Not tested || Yes || NA || SD card (yes), touch pad and trackpoint (yes) Webcam (yes) || wifi works only with {{Pkg|broadcom-wl-dkms}}<br />
|-<br />
| Lenovo ThinkPad Edge E580 || 2018.05.01 || Yes || Yes || Yes || Yes || Yes || Yes || NA || Fingerprint sensor doesn't work because of proprietary firmware || ||<br />
|-<br />
|}<br />
<br />
==== E series ====<br />
<br />
{{HCL/Laptops table header}}<br />
| Lenovo ThinkPad E485 || 2018-10-01 || Yes || Yes || Yes || Yes || Yes || Yes || N/A || || Missing IVRS map in ACPI Table, add <code>amd_iommu=pt ivrs_ioapic[32]=00:14.0</code> in [[kernel parameters]]. In order to get X to work correctly, add <code>iommu=soft</code> in [[kernel parameters]] (Linux 4.20 only). On Linux 5.2, add <code>iommu=pt</code> to prevent render artifacts on X. In order to get microsd (SDHCI) working, <code>echo 'options sdhci debug_quirks2="0x8000"' > /etc/modprobe.d/sdhci.conf</code> and change module load order <code>MODULES=(sdhci sdhci_pci)</code> in <code>/etc/mkinitcpio.conf</code> (line 7). Don't forget to run <code>mkinitcpio -p linux</code> afterwards. If WiFi doesn't work on RTL8822BE adapter models, create a file <code>/etc/modprobe.d/wifi.conf</code> and add the following lines: <code>blacklist rtw_pci<br />blacklist rtwpci</code>. Then, install {{aur|rtlwifi_new-extended-dkms}} and reboot.<br />
|-<br />
| Lenovo ThinkPad E585 || 2018-11-01 || Yes || Yes || Yes || Yes || Yes || Yes || N/A || || To solve all these issues mentioned here easier just install the latest BIOS update from Lenovo support website. Missing IVRS map in ACPI Table, add <code>amd_iommu=pt ivrs_ioapic[32]=00:14.0</code> in [[kernel parameters]]. In order to get X to work correctly, add <code>iommu=soft</code> in [[kernel parameters]] (Linux 4.20 only). In order to get microsd (SDHCI) working, <code>echo 'options sdhci debug_quirks2="0x8000"' > /etc/modprobe.d/sdhci.conf</code> and change module load order <code>MODULES=(sdhci sdhci_pci)</code> in <code>/etc/mkinitcpio.conf</code> (line 7). Don't forget to run <code>mkinitcpio -p linux</code> afterwards. Bluetooth doesn't work until a suspend/resume cycle occurs.<br />
|-<br />
| Lenovo ThinkPad E595 || 2020-02-29 || Yes || Yes || Yes || Yes || Yes || Yes || N/A || ||<br />
Wifi is terrible and depends on kernel version. If kernel 5.2>= then use [https://github.com/mid-kid/r8822be r8822be], if >4.14 then use the one in the kernel, else use [https://github.com/lwfinger/rtlwifi_new rtlfwifi_new]<br />
<br />
Update the bios, if missing IVRS map in ACPI Table.<br />
<br />
MicroSD not tested, see above if it doesn’t work.<br />
<br />
Wake up from suspend broken on X.Org with kernel >= 5.2<br />
|-<br />
|}<br />
<br />
==== L series ====<br />
<br />
{{HCL/Laptops table header}}<br />
| [[Lenovo ThinkPad L380 Yoga]] || Yes || Yes || Yes || Yes || Yes || Yes || Yes || NA || Trackpoint*, Fingerprint reader ||<br />
|-<br />
| Lenovo ThinkPad L390 || 2019.09.01 || Yes || Yes || Not tested || Yes || Yes || Yes || NA || Webcam, MicroSD card reader is working out of the box. Not working out of the box: Touchscreen, fingerprint reader, NFC ||<br />
|-<br />
| Lenovo ThinkPad L420 || Yes || Yes || Yes || Yes || Yes || Not tested || Yes || NA || ||<br />
|-<br />
| Lenovo ThinkPad L430 || Yes || Yes || Yes || Yes || Yes || Yes || Yes || NA || Trackpoint* ||<br />
|-<br />
| Lenovo ThinkPad L440 || Yes || Yes || Yes || Yes || Yes || Yes || Yes || NA || Trackpoint (Touchpad cannot be disabled, as mouse buttons are shared with Trackpoint), Fingerprint reader, SD Card Reader ||<br />
|-<br />
| Lenovo ThinkPad L450 || 2019.11.01 || Yes || Yes || Yes || Yes || Yes || Yes || NA || Trackpoint, Fingerprint reader, SD Card Reader ||<br />
|-<br />
| Lenovo ThinkPad L460 || Yes || Yes || Yes || Yes || Yes || Yes || Yes || Not tested || Trackpoint, Fingerprint reader, SD Card Reader ||<br />
|-<br />
| Lenovo ThinkPad L520 || 2018.09.01-x86_64|| Yes || Yes || Yes || Yes || Not tested|| Not tested|| Not tested|| Not tested ||<br />
|-<br />
| Lenovo ThinkPad L530 || Yes || Yes || Yes || Yes || Yes || Yes || Yes || NA || Trackpoint*, Fingerprint reader ||<br />
|-<br />
| Lenovo ThinkPad L560 || Yes || Yes || Yes || Yes || Yes || Not tested || Not tested || NA || Trackpoint ||<br />
|-<br />
| Lenovo ThinkPad L590 || No || Not tested || Not tested || Not tested || Not tested || Not tested || Not tested || NA || || Kernels >= 5 won't boot at all and freezes at different stages of startup.<br />
|-<br />
|}<br />
<br />
==== A series ====<br />
<br />
{{HCL/Laptops table header}}<br />
| Lenovo ThinkPad A485 || 2018.12 || Yes || Yes || Yes || Yes || Yes || Yes || NA || Touch Pad/Trackpoint (yes), Webcam (yes) || bluetooth does not work when activating [[Laptop Mode Tools]] <code>runtime-pm</code> module<br />
|}<br />
<br />
==== P series ====<br />
<br />
{{HCL/Laptops table header}}<br />
| [[Lenovo ThinkPad P50]] || 2016.04 || Yes || Yes || Yes || Yes || Yes || Yes || NA || SD card (Yes), Webcam (Yes), Fingerprint Reader ({{AUR|libfprint-vfs0090-git}}), || Wifi requires Kernel 4.3.3+ <br />
|-<br />
| [[Lenovo ThinkPad P70]] || 2016.04 || Yes || Yes || Yes || Yes || Yes || Suspend working, hibernate not tested || NA || SD card (Yes), Webcam (Yes), Fingerprint Reader ({{AUR|libfprint-vfs0090-git}}), || Wifi requires Kernel 4.3.3+ <br />
|-<br />
| Lenovo ThinkPad P51 || Unknown || Yes || Yes || Yes || Yes || Yes || Yes || Yes (No GNSS/GPS) ||<br />
* Working: SD card, Webcam, Express card, Smartcard reader, Fingerprint Reader ({{AUR|libfprint-vfs0097-git}})<br />
* Not working: TPM, Color calibrator, UEFI flash <br />
|| HDMI audio requires nvhda module<br />
|-<br />
| [[Lenovo ThinkPad P52]] || 2018.09 || Yes || Yes || Yes || Yes || Yes || Suspend working, hibernate not tested || NA || Webcam (yes), IR camera (yes), Touchpad (yes), Card Reader (not tested) Smartcard Reader (yes), Fingerprint (no) ||<br />
|-<br />
| [[Lenovo ThinkPad P1]] || 2018.12 || Yes || Yes || Yes || Yes || Yes || Suspend working, hibernate not tested || NA || Webcam (Yes), multi-monitor (yes)|| <br />
|-<br />
| [[Lenovo ThinkPad P1 (Gen 2)]] || 2019.09.01 || Yes || Yes || Yes || Yes || Yes || Suspend working, hibernate working || NA || Webcam (not tested), multi-monitor (yes)|| <br />
|-<br />
| [[Lenovo ThinkPad P52s]] || 2019.02 || Yes* (See Remarks) || Yes || Yes || Yes || Yes || Suspend (Yes), Hibernate (Yes) || Not tested || Webcam (Yes), Multi-monitor (Yes), Card Reader (Yes), Smartcard Reader (Yes), NFC (No, [https://github.com/nfc-tools/libnfc/issues/455 see this]), Fingerprint (No, [https://forums.lenovo.com/t5/Linux-Discussion/Thinkpad-T580-Synaptics-Metallica-MIS-Touch-Fingerprint-Reader/m-p/4057745 see this])|| *Intel graphics needs to be specified in the Xorg config for Xorg to work, see [[Lenovo ThinkPad P52s]]<br />
|-<br />
| [[Lenovo ThinkPad P53]] || 2019.12 || Yes || Yes || Yes || Yes || Yes || Suspend working, hibernate not tested || NA || Webcam (Yes), Multi-monitor (Yes), Hybrid nvidia/intel (Yes), Card Reader (Not tested), Smartcard Reader (Not tested), Fingerprint (Missing driver support)|| Use nvidia-prime to switch between cards. <br />
|-<br />
| [[Lenovo ThinkPad P53s]] || 2019.10 || Yes || Yes || Yes || Yes || Not tested || Not tested || Not tested || Webcam (Yes), Multi-monitor (Not testes), Card Reader (Not tested), Smartcard Reader (Not tested), Fingerprint (Not tested)|| Trackpad is really bad compared to the Thinkpad T480.<br />
|}<br />
<br />
==== T series ====<br />
<br />
{{HCL/Laptops table header}}<br />
| IBM ThinkPad T60 || Yes || Yes || Yes || Yes || Yes || Yes || ? || NA || ||<br />
|-<br />
| IBM ThinkPad T60p || Yes || Yes || Yes || Yes || Yes || Yes || ? || NA || ThinkFinger ||<br />
|-<br />
| [[IBM ThinkPad T61]] || Yes || Yes || Yes || Yes || Yes || Yes || NA || || ||<br />
|-<br />
| IBM ThinkPad T61p || Yes || Yes || Yes || Yes || Yes || Yes || NA || || ||<br />
|-<br />
| [[Lenovo ThinkPad T400]] || Yes || Yes || Yes || Yes || Yes || Yes || NA || NA || ||<br />
|-<br />
| [[Lenovo ThinkPad T400s]] || Yes || Yes || Yes || Yes || Yes || Yes || NA || NA || ||<br />
|-<br />
| Lenovo ThinkPad T410 || Yes || Yes || Yes || Yes || Yes || Yes || NA || NA || ||<br />
|-<br />
| [[Lenovo ThinkPad T420]] || Yes || Yes || Yes || Yes || Yes || Yes || Yes || NA || Card reader tested, no Fingerprint scanner||<br />
|-<br />
| [[Lenovo ThinkPad T420s]] || Yes || Yes || Yes || Yes || Yes || Yes || NA || NA || Card Reader ||<br />
|-<br />
| [[Lenovo ThinkPad T430]] || Yes || Yes || Yes || Yes || Yes || Yes* || Yes* || Not tested || ||<br />
|-<br />
| [[#Lenovo ThinkPad T440p|Lenovo ThinkPad T440p]] || Yes || Yes || Yes || Yes || Yes || Yes* || NA || NA || Card Reader || See below<br />
|-<br />
| [[Lenovo ThinkPad T440s]] || Yes || Yes || Yes || Yes || Yes* || ? || Yes || ? || || See wiki page for more details about wireless<br />
|-<br />
| [[Lenovo ThinkPad T450s]] || 2015.10.01 || Yes || Yes || Yes || Yes || Yes || ? || NA || SD Card reader; fingerprint scanner|| <br />
|-<br />
| [[Lenovo ThinkPad T460s]] || Yes || Yes || no beep || Yes || Yes || Yes || ? || NA || SD Card reader|| <br />
|-<br />
| [[Lenovo ThinkPad T25]] || Yes || Yes || Yes || Yes || Yes || Yes || Yes || NA || SD Card reader; fingerprint scanner; Touchscreen|| <br />
|-<br />
| [[Lenovo ThinkPad T470]] || Yes || Yes || Yes || Yes || Yes || Yes || Yes || NA || SD Card reader; fingerprint scanner|| <br />
|-<br />
| [[Lenovo ThinkPad T470s]] || Yes || Yes || Yes || Yes || Yes || Yes || Yes || NA || SD Card reader; fingerprint scanner|| <br />
|-<br />
| [[Lenovo ThinkPad T480]] || 2018.07.01 || Yes || Yes || Yes || Yes || Yes || ? || NA || Thunderbolt 3 (USB-C); SD Card reader; fingerprint scanner|| <br />
|-<br />
| [[Lenovo ThinkPad T480s]] || ? || Yes || no beep || Yes || Yes || Yes || ? || NA || Thunderbolt 3 (USB-C); SD Card reader|| <br />
|-<br />
| [[Lenovo ThinkPad T490]] || Yes || Yes || Yes || ? || Yes || Yes || Yes || NA || Thunderbolt 3 (USB-C); SD Card reader || Some problems with touchpad<br />
|-<br />
| [[Lenovo ThinkPad T495]] || Yes || Yes || Yes || Yes || Yes || Yes || Yes || NA || SD Card reader ||<br />
|-<br />
| [[Lenovo ThinkPad T495s]] || Yes || Yes || Yes || Yes || Yes || Yes || Yes || NA || ||<br />
|-<br />
| Lenovo ThinkPad T500 || Yes || Yes || Yes || Yes || Yes || Yes || NA || NA || ||<br />
|-<br />
| [[Lenovo ThinkPad T520]] || Yes || Yes || Yes || Yes || Yes || Yes || NA || NA || ||<br />
|-<br />
| [[Lenovo ThinkPad T530]] || Yes || Yes || Yes || Yes || Yes || Yes || Yes || NA || ||<br />
|-<br />
| [[Lenovo ThinkPad T550]] || Yes || Yes || Yes || Yes || Yes || Yes || Yes || NA || DisplayPort ||<br />
|-<br />
| Lenovo ThinkPad T560 || Yes || Yes || Yes || Yes || Yes || Yes || Yes* || NA || MiniDP; Fingerprint scanner; Intel + Nvidia GPU; Card Reader || See special notes for the hardware specifications of this test device<br />
|-<br />
| [[Lenovo ThinkPad T570]] || Yes || Yes || Yes || Yes || Yes || ? || Yes* || NA || not yet fully tested || <br />
|-<br />
| Lenovo ThinkPad T580 || Yes || Yes || Yes || Yes || Yes || Yes || Yes || NA || SD Card Reader is supported; [https://forums.lenovo.com/t5/Linux-Discussion/Thinkpad-T580-Synaptics-Metallica-MIS-Touch-Fingerprint-Reader/m-p/4057745 Fingerprint reader is not supported] || Tested on ''2 May 2018'' (with ''Linux 4.16.5'')<br />
|}<br />
<br />
==== W series ====<br />
{{HCL/Laptops table header}}<br />
|-<br />
| Lenovo ThinkPad W500 || 2019.12 || Yes || Yes || Yes || Yes || Yes || Yes || Not tested || SD card (Yes), Webcam (Yes), Fingerprint Reader (Yes) || Tested January 2020 / Linux 5.4.11<br />
|-<br />
| Lenovo ThinkPad W510 || Yes || Yes || Yes || Yes || Yes || Yes || Yes || NA || SD card (Yes), Webcam (Yes), Touchscreen (Yes), Fingerprint Reader (Not tested) || Tested April 2017 / Linux 4.10.8<br />
|-<br />
| Lenovo ThinkPad W530 || 2016.03 || Yes || Yes || Yes || Yes || Yes || Yes || NA || SD card (Yes), Webcam (Yes), Fingerprint Reader (Yes) || Tested April 2018 / Linux 4.15.15<br />
|-<br />
| Lenovo ThinkPad W540 || Yes || Yes || Yes || Yes || Yes || Yes || Yes || NA || SD card (Yes), Webcam (Yes), Fingerprint Reader (Yes) || Tested April 2017 / Linux 4.10.8<br />
|-<br />
| Lenovo ThinkPad W541 || Yes || Yes || Yes || Yes || Yes || Yes || Yes || Not tested || SD card (Yes), Webcam (Yes), Fingerprint Reader (Not tested) || Tested August 2018 / Linux 4.17.12<br />
|-<br />
| Lenovo ThinkPad W550s || Yes || Yes || Yes || Yes || Yes || Yes || Yes || NA || SD card (Yes), Webcam (Yes), Fingerprint Reader (Yes) || Tested April 2018 / Linux 4.15.15<br />
|-<br />
|}<br />
<br />
==== X series ====<br />
<br />
{{HCL/Laptops table header}}<br />
| [[IBM ThinkPad X60s]] || Yes|| Yes || Yes || Yes || Yes || Yes || NA || NA || ||<br />
|-<br />
| Lenovo ThinkPad X61s || Yes || Yes || Yes || Yes || Yes || Yes || Yes || NA || SD slot ||<br />
|-<br />
| [[Lenovo ThinkPad X100e]] || Yes|| Yes || Yes || Yes || Yes || Yes || Not tested || NA || SD card (Yes), Webcam (Yes) ||<br />
|-<br />
| Lenovo ThinkPad X131e || Yes|| Yes || Yes || Yes || Yes || Yes || Yes || Not tested || SD card (Yes), Webcam (Yes), [https://bbs.archlinux.org/viewtopic.php?id=159014 WLAN Led seems not controlled] ||<br />
|-<br />
| [[Lenovo ThinkPad X200]] || Yes || Yes || Yes || Yes || Yes || Yes || NA || Yes || ||<br />
|-<br />
| [[Lenovo ThinkPad X200S]] || Yes || Yes || Yes || Yes || Yes || Yes || NA || Yes || Everything worked out of the box. However, fingerprint, SD card and webcam were not tested. Modem needs reset after sleep (sometimes). ||<br />
|-<br />
| [[Lenovo ThinkPad X201]] || Yes || Yes || Yes || Yes || Yes || Yes || Yes || Not tested || ||<br />
|-<br />
| [[Lenovo ThinkPad X220]] || Yes || Yes || Yes || Yes || Yes || Yes || Yes || NA || SD card (Yes), Webcam (Yes) || Intel Centrino Advanced-N 6205 [Taylor Peak] requires {{Pkg|linux-firmware}} <br />
|-<br />
| [[Lenovo ThinkPad X230]] || Yes || Yes || Yes || Yes || Yes || Yes || Yes || NA || SD card (Yes), Webcam (Yes), UMTS Modem (Yes), Accelerometer (No) ||<br />
|-<br />
| [[Lenovo ThinkPad X240]] || Yes || Yes || Yes || Yes || Yes || Yes || Yes || WWAN LTE (yes) || SD card (Yes), Webcam (Yes), Fingerprint (Yes) ||<br />
|-<br />
| [[Lenovo ThinkPad X250]] || Yes || Yes || Yes || Yes || Yes || Yes || Yes || NA || SD card (Yes), Webcam (Yes), Fingerprint (Yes) ||<br />
|-<br />
| [[Lenovo ThinkPad X260]] || Yes || Yes || Yes || Yes || Yes || Yes || Yes || NA || SD card (Yes), Webcam (Yes), Fingerprint (Yes) ||<br />
|-<br />
| [[Lenovo ThinkPad X270]] || Yes || Yes || Yes || Yes || Yes || Not tested || Yes || NA || Webcam (Yes) ||<br />
|-<br />
| Lenovo ThinkPad X280 || Yes || Yes || Yes || Yes || Yes || Yes || Yes || Yes (Fibcom L830-EB-00) || Webcam (Yes) ||<br />
|-<br />
| Lenovo ThinkPad X390 || 2019.08.01 || Yes || Yes || Yes || Yes || Yes || Yes || Yes (Fibocom L830-EB) || Webcam (Yes) ||<br />
|-<br />
| [[Lenovo ThinkPad X390 Yoga]] || 2020.02.01 || Yes || Yes || Yes || Yes || Yes || Yes || Yes (Fibocom L830-EB) || Webcam (Yes) ||<br />
|-<br />
| Lenovo ThinkPad X395 || Yes || Yes || Yes || Yes || Yes || Yes || Yes || NA || Webcam (Yes), Fingerprint reader requires installing Synaptics drivers with fwupd, refer to [[Lenovo_ThinkPad_X1_Carbon_(Gen_7)#Fingerprint_sensor|here]].<!--No, WIP[https://forums.lenovo.com/t5/Other-Linux-Discussions/Linux-on-T495/m-p/4474320#M13440])--> || Prevent amdgpu issues by updating to latest BIOS [https://support.lenovo.com/us/en/downloads/ds540046]<br />
|-<br />
| [[Lenovo ThinkPad X1 Carbon]] || NA || Yes || Yes || Yes || Yes || Proprietary/nonfree || Yes || NA || ||<br />
|-<br />
| [[Lenovo ThinkPad X1 Carbon (Gen 2)]] || NA || Yes || Yes || Yes || Yes || Yes || Yes || NA || ||<br />
|-<br />
| [[Lenovo ThinkPad X1 Carbon (Gen 3)]] || NA || Yes || Yes || Yes || Yes || Yes || Yes || NA || ||<br />
|-<br />
| [[Lenovo ThinkPad X1 Carbon (Gen 4)]] || NA || Yes || Yes || Yes || Yes || Yes || Yes || NA || ||<br />
|-<br />
| [[Lenovo ThinkPad X1 Carbon (Gen 5)]] || NA || Yes || Yes || Yes || Yes || Yes || Yes || Yes || ||<br />
|-<br />
| [[Lenovo ThinkPad X1 Carbon (Gen 6)]] || NA || Yes || Yes || Yes || Yes || Yes || Yes || Yes || ||<br />
|-<br />
| [[Lenovo ThinkPad X1 Carbon (Gen 7)]] || NA || Yes || Yes || Yes || Yes || Yes || Yes || Yes || Internal Mic not working out of the box || <br />
|-<br />
| [[Lenovo ThinkPad X1 Extreme]] || NA || Yes || Yes || Yes || Yes || Yes || Yes || NA || Fingerprint reader not supported, Thunderbolt ports not tested || Graphics requires some configuration to work correctly<br />
|-<br />
| [[Lenovo ThinkPad X1 Extreme (Gen 2)]] || NA || Yes || Yes || Unknown || Yes || Yes || Yes || NA || Fingerprint reader not supported [https://github.com/nmikhailov/Validity90/issues/72 yet], Thunderbolt ports not tested ||<br />
|-<br />
| [[Lenovo ThinkPad X1 Yoga (Gen 3)]] || NA || Yes || Yes || Yes || Yes || Yes || Partial || NA || SD card (Yes), Webcam (Yes), Fingerprint (No), Touchscreen (Yes), Accelerometer (Yes) ||<br />
|-<br />
| [[Lenovo ThinkPad X1 Yoga (Gen 4)]] || NA || Yes || Yes || Yes || Yes || Yes || Yes || Not tested || Webcam (Yes), Microphone (No), Fingerprint (No), Touchscreen (Yes), Accelerometer (Yes) ||<br />
|}<br />
<br />
==== Yoga Series ====<br />
<br />
{{HCL/Laptops table header}}<br />
| Lenovo ThinkPad Yoga 14 || || || || || || || || || || The Lenovo ThinkPad Yoga 14 (20FY) is a convertible 14-inch Ultrabook developed by Lenovo in 2015. It is one of many iterations in the ThinkPad line. It's also known as P40 Yoga (type 20GR, 20GQ), S3 (20G0, 20G1) and Yoga 460 (20EM, 20EL). A [https://download.lenovo.com/pccbbs/mobiles_pdf/p40_yoga14_mt20fy_yoga460_hmm_en_sp40j47499_01.pdf hardware maintenance manual is provided online].<br />
|-<br />
| [[Lenovo ThinkPad Yoga 260]] || USB || Yes || Yes || Yes || Yes || Yes || Unknown || Yes || SD card (Yes), Webcam (Yes), Fingerprint Reader (Unknown), Touchscreen (Yes), Tablet (Partial), Accelerometer (No) || Wifi requires Kernel 4.3.3+<br />
|-<br />
| Lenovo Yoga 530 || 2019.09.01 || Yes || Yes || Not tested || Yes || Not tested || Not tested || Not tested || SD card (Not tested), Webcam (Yes), Fingerprint Reader (Not tested), Touchscreen (Yes), Tablet (Partial) || Trouble with touchpad, but worked with kernel parameters "i8042.noloop i8042.nomux i8042.nopnp i8042.reset" and xf86-input-synaptics<br />
|-<br />
| Lenovo Yoga 710 || NA || Yes || Yes || Yes || Yes || Not tested || Yes || Not tested || SD card (Yes), Webcam (Yes), Touchscreen || Everything works<br />
|-<br />
| Lenovo Yoga c930 || 2019.09.01 || Yes || Partially (Fix needed for hinge soundbar, bottom speakers not working. Microphone not working) || N/A || Yes || Not tested || Yes || N/A || Webcam (Yes), Touchscreen || See https://github.com/droserasprout/lenovo-yoga-c930-linux for more information and fixes<br />
|}<br />
<br />
==== Helix Series ====<br />
{{HCL/Laptops table header}}<br />
| [[Lenovo ThinkPad Helix]] || Unknown || YES || YES || NA || YES || YES || NA || Touchscreen (yes), Pen (yes), Sensors (yes) || ||<br />
|-<br />
| [[Lenovo ThinkPad Helix 2nd Gen]] || 2018.04.01 (USB) || YES || YES || NA || YES || Not tested || Yes* (with updated BIOS) || Touchscreen (yes), Pen (not tested), Sensors (w/ patched kernel) || NA || Only suspend-to-idle ("freeze") is supported<br />
|-<br />
|}<br />
<br />
== Lenovo ==<br />
<br />
=== IdeaPad ===<br />
<br />
{{HCL/Laptops table header}}<br />
| Lenovo IdeaPad 120S || 2018-04-26 || Yes || Yes || NA || Yes || Yes || Yes || NA || Everything works ||<br />
|-<br />
| [[Lenovo IdeaPad Flex 10]] || Yes || Yes* || Yes || NA || Yes || Yes || Yes || NA || Touchscreen* ||<br />
|-<br />
| [[Lenovo IdeaPad S10]] || Yes || Yes || Yes || Yes || Yes || Yes || NA || NA || ||<br />
|-<br />
| [[Lenovo IdeaPad S400 Touch]] || Yes || Yes || Yes || Yes || Yes || Yes || Not tested || NA || ||<br />
|-<br />
| Lenovo IdeaPad U430p || Yes || Yes || Yes || Yes || Yes || Yes || Not tested || NA || ||<br />
|-<br />
| Lenovo IdeaPad Y700 || 2015.12.01 || Yes || Yes* || Yes || Yes || Yes || Not tested || NA || Trackpad - [https://unix.stackexchange.com/questions/362165/lenovo-y700-elantech-touchpad-query-0x01-failed buggy] || [https://bugzilla.kernel.org/show_bug.cgi?id=151681 Trackpad requires pata_legacy to be blacklisted]<br />
|-<br />
| [[Lenovo IdeaPad Z580]] || Yes || Yes || Yes || Yes || Yes || Yes || Yes || NA || ||<br />
|-<br />
| [[Lenovo IdeaPad 720s]] || 2018.03.01 || Yes || Yes || NA* || Yes || Yes || Yes || NA || Fingerprint reader not working || *requires USB or USB C dongle<br />
|-<br />
| [[Lenovo IdeaPad 720s (Ryzen)]] || 2018.02.01 || Not tested || Not tested || Yes* || No || Not tested || Not tested || NA || Fingerprint reader not tested but most likely not working || *requires USB or USB C dongle<br />
|-<br />
| Lenovo Ideapad 320 || 2018.03.01 || Yes || Yes || Yes || Yes || Yes || Not tested || NA || To stop constant annoying messages by AMD-Vi, use 'iommu=soft' & 'amd_iommu=off' in kernel arguments || <br />
|-<br />
| Lenovo Ideapad 330S-14IKB || 2019.10.01 || Yes || Yes || Yes || Yes || Not tested || NA || NA || {{ic|Firmware Error (ACPI): Could not resolve [^^^GFX0.AFN2], AE_NOT_FOUND (20181213/psargs-503)}} is raised every few seconds, and can only be turned off by disabling the ACPI ({{ic|1=acpi=off}}) or by connecting the laptop to a charger. Tried with both the stock BIOS and the latest update (7SCN34WW) to no avail. || <br />
|-<br />
| Lenovo Ideapad N24 || 2018.04.01 || Yes || Yes || NA || Yes || Not tested || Not tested || NA || Touchscreen || <br />
|-<br />
|}<br />
<br />
====== Battery Conservation Mode on IdeaPad laptops ======<br />
<br />
Battery Conservation Mode is a feature that limits battery charging to 55-60% of its capacity to improve battery life, being most useful when the laptop tends to run on external power much of the time. If your particular laptop model supports it, it can be enabled or disabled in the following manner:<br />
<br />
:First make sure the '''ideapad_laptop''' kernel module is loaded, with the {{ic|lsmod}} command.<br />
:If it is, run the following command as root to enable Battery Conservation Mode:<br />
<br />
# echo 1 >/sys/bus/platform/drivers/ideapad_acpi/VPC2004:00/conservation_mode<br />
<br />
:A 0 will in turn disable the feature.<br />
<br />
{{Note|1=<br><br />
* Both the presence and implementation of this feature vary by model. Particularly, the name of the folder '''VPC2004:00''' could differ.<br />
* If the above doesn't work on your laptop, you can try a different method described [https://forums.linuxmint.com/viewtopic.php?f=49&t=286237#p1583578 here], which may require some (further) trial and error.}}<br />
<br />
=== B series ===<br />
<br />
{{HCL/Laptops table header}}<br />
| Lenovo B50 || NA || Yes || Yes || Yes || Yes || Not tested || Not tested || Not tested || ||<br />
|-<br />
| Lenovo B50-70 || Yes || Yes* ||Yes || Yes || Yes || Yes || Not tested || NA || See below* ||<br />
|-<br />
| Lenovo B450 || Yes || Yes ||Yes || Yes || Yes || NA || Not tested || NA || ||<br />
|-<br />
|}<br />
<br />
=== K series ===<br />
<br />
{{HCL/Laptops table header}}<br />
| Lenovo K450e || NA || Yes || Yes || Yes || Yes || Not tested || Yes || Not tested || ||<br />
|-<br />
|}<br />
<br />
=== N series ===<br />
<br />
{{HCL/Laptops table header}}<br />
| Lenovo N200 (3000) || Yes || Yes* || Yes || Yes || Yes || Yes* || NA || NA || See below ||<br />
|-<br />
|}<br />
<br />
=== S series ===<br />
<br />
{{HCL/Laptops table header}}<br />
| Lenovo S21e-20 || 2015.07.01 || Yes || Yes || NA || Yes* || ? || Yes || NA || SD Card (Yes), USB 3.0 (Yes), HDMI Out (?), Touchpad (Yes*) ||<br />
|-<br />
|}<br />
<br />
=== U Series ===<br />
<br />
{{HCL/Laptops table header}}<br />
| Lenovo U31-70 || 2015.10.01 || Yes || Yes || Yes || Yes* || Yes || Yes || NA || SD Card (Yes), USB 3.0 (Yes), HDMI Out (Yes), Touchpad (Yes), Webcam (Yes) ||<br />
|-<br />
|}<br />
<br />
=== V Series ===<br />
<br />
{{HCL/Laptops table header}}<br />
| Lenovo V110-15ISK || ??? || Yes || Yes || Yes || Yes || Not Tested || Yes || NA || SD Card (Not Tested), USB 3.0 (Not Tested), HDMI Out (Not Tested), Touchpad (Yes), Webcam (Yes) ||<br />
|-<br />
| Lenovo V130-15IKB || ??? || Yes || Yes || Yes || Yes || Yes || Yes || NA || SD Card (Yes), USB 3.0 (Yes), HDMI Out (Yes), Touchpad (Yes), Webcam (Yes) ||<br />
|-<br />
| Lenovo V330-15IKB || 2018.10.01 || Yes || Yes || Yes || Yes || Not Tested || Yes || NA || Fingerprint (No, no driver exists for the Validity/Synaptics 06cb:0081 Fingerprint Reader), Touchpad (Yes), Webcam (Yes) ||<br />
|-<br />
| Lenovo V330-14ARR || 2019.06.15 || Yes || Yes || Yes || Yes[[#Lenovo IdeaPad V330-14ARR|*]] || Yes || Yes || NA || SD-Card Reader (Yes) HDMI Out (Yes), USB 3.0 (Yes), Touchpad (Yes), Webcam (Yes) || DOS installable BIOS available[[#Lenovo IdeaPad V330-14ARR|*]] ||<br />
|-<br />
|}<br />
<br />
=== Y series ===<br />
{{HCL/Laptops table header}}<br />
| Lenovo Legion Y520 || 2019.06.01 || Yes || Yes || Yes || Yes || Yes || Yes || Yes || SD card (Not working properly), Webcam (Yes), USB & USB 3.0 (Yes), HDMI (Yes), USB-C (Not tested), Touchpad (Yes), NVMe M.2 SSD (Yes), GeForce GTX 1050 Ti (Yes) || Tested Feb 2020 / Linux 5.5.4. Must change SATA configuration in BIOS from RAID to AHCI in order to recognize SSD.<br />
|-<br />
| Lenovo Legion Y520 || ??? || Yes || Yes || Yes || Yes || Yes || Yes || Yes || SD card (Not tested), Webcam (Yes), USB & USB 3.0 (Yes), HDMI (Yes), USB-C (Not tested), Touchpad (Yes), NVMe M.2 SSD (Yes), GeForce GTX 1050 (Yes) || Tested June 2019 / Linux 5.1.5. Must change SATA configuration in BIOS from RAID to AHCI in order to recognize SSD. Some CPU throttling is possible [https://unix.stackexchange.com/questions/491944/cpu-temperatures-in-linux-throttling-or-wrong-reading]. Fan control does not seem to work [https://unix.stackexchange.com/questions/523899/laptop-fan-always-says-its-running-at-8-rpm]<br />
|-<br />
| Lenovo Legion Y730 || ??? || Yes || Yes || Yes || Yes || Yes || Yes || Yes || Webcam (Yes), USB & USB 3.0 (Yes), HDMI (Yes), USB-C (Not tested), Touchpad (Yes), NVMe M.2 SSD (Yes), GeForce GTX 1050 Ti (Yes) || Tested September 2019 / Linux 5.2.13. Must change SATA configuration in BIOS from RAID to AHCI in order to recognize SSD. Disable nouveau at kernel command line with module_blacklist=nouveau or nouveau.modeset=0<br />
|-<br />
| Lenovo Legion Y7000P-1060 || 2019.03.01 || Yes || Yes || Yes || Yes || Yes || Yes || No || Webcam (Yes), USB & USB 3.0 (Yes), HDMI (Yes), USB-C (Yes), Mini DisplayPort (Not tested), Touchpad (Yes), NVMe SSD (Yes), GeForce GTX 1060 Mobile (Yes) || First tested Aug 2019 / Linux 5.2.9.<br />
<br />
https://linux-hardware.org/index.php?computer=af3a4bc1494f<br />
|-<br />
| Lenovo Legion Y540 || 2020.02.01 || Yes || Yes || Yes || Yes || Yes || Yes || No || Webcam (Yes) USB & USB C (Yes) HDMI (Yes) TouchPad (Yes) NVMe SSD (Yes with AHCI in UEFI) Geforce GTX 1650 (Yes, with nvidia and nvidia-prime, with or without switchable/discrete graphics in UEFI) Mini Display Port || Tested on 8 February 2020 with Linux 5.5.1<br />
|}<br />
<br />
== Special Notes (*): ==<br />
<br />
{{Accuracy|Lots of vague or unproven bugs/workarounds, poor writing}}<br />
<br />
=== Lenovo U31-70 ===<br />
Wireless needs {{Pkg|linux}} >= 4.3 and latest {{Pkg|linux-firmware}}, both packages are currently in testing. Copy one of the firmware blobs {{ic|eeprom_ar6320_2p1_NFA345i.bin}} or {{ic|eeprom_ar6320_2p1_NFA345i_highTX.bin}} from the windows driver to {{ic|/usr/lib/firmware/ath10k/QCA6174/hw2.1/board-pci-168c:0041:17aa:3545.bin}}.<br />
<br />
Wireless with firmware blobs from windows driver may no longer work on {{Pkg|linux}} >= 4.4. Download firmware blob https://github.com/kvalo/ath10k-firmware/blob/f428f53b36b144971c9c4c3d2ebd5fa8cae86c89/QCA6174/hw2.1/board-2.bin and copy it to {{ic|/usr/lib/firmware/ath10k/QCA6174/hw2.1/board-2.bin}}. Tested with {{Pkg|linux}} 4.4.5-1 and {{Pkg|linux-firmware}} 20160113.40e9ae8-1nu<br />
<br />
With packages {{Pkg|linux}} 4.6.1-2 and {{Pkg|linux-firmware}} 20160516.80d463b-1 being in stable, wireless works without any additional steps needed.<br />
<br />
=== Lenovo B50-70 ===<br />
* UEFI:<br />
** to be able to disable Secure Boot (necessary for dual boot, not needed for Linux only), you have to switch from "UEFI first" to "UEFI only" (or something like this) in UEFI setup menu; the Secure Boot option appears then on the Security tab<br />
** after UEFI update having Linux and Windows installed, the Linux bootloader ceased to be the default one, UEFI started to load Windows by default and it was impossible to select the Linux one in the UEFI boot menu and in the UEFI setup - reinstalling the bootloader helped; having no access to a boot media that supports UEFI, a solution might be also replacing the Windows EFI bootloader file with a Linux one temporalily, in order to be able to boot Linux from HDD<br />
** for the UEFI update, a Windows OS is needed<br />
* Touchpad:<br />
** Synaptics - works after installing Synaptics drivers from repo, possible to change behaviour (like reaction for double tap) according to your wish<br />
* Video:<br />
** in laptops with dual video card (Intel and ATI) - detects both, Intel is active as a default, not checked if it's possible at all to switch between them<br />
<br />
==== Operation with a HDD caddy ====<br />
When you install an SSD in the place of the plate HDD drive and you want to have your HDD still inside the laptop, it is possible to install it in the place of the optical drive in a special "HDD caddy". The optical drive is of 9 mm height, but a 9,5 mm caddy (ultra slim) fits in the slot. A caddy with a SATA interface is needed. It is difficult to separate the front bezel from the original optical drive (and opening its case does not help, but brings a danger of making a mess in the opening mechanism; the only option is just to pull the bezel using a bit of force, but you risk breaking the latches).<br />
<br />
While the HDD installed instead of the optical drive operates flawlessly in Windows, it was not going to work out of the box in Linux, at least in one case. The kernel tries to establish a connection with the disk, but fails to do it (''SATA link down'' entry in /var/log/messages). The solution is to force a 1.5 Gbps transfer speed (instead of 6 Gbps) by adding a ''libata.force='' kernel parameter. See [https://www.kernel.org/doc/Documentation/kernel-parameters.txt]{{Dead link|2020|02|25}} for details.<br />
<br />
=== Lenovo K450e ===<br />
<br />
After installing Arch Linux and booting, a single beep may be heard. To disable this beep, press F1 during startup, then change Boot Priority to 'UEFI First', as well as enabling 'CSM'.<br />
<br />
=== ThinkPad X1 Carbon 3rd ===<br />
<br />
* http://natalian.org/archives/2015/02/18/Archlinux_on_a_Lenovo_X1C3/<br />
<br />
=== Lenovo 3000 N200 ===<br />
<br />
* Sound:<br />
** You may have to append {{ic|1=options snd_hda_intel model=lenovo}} to {{ic|/etc/modprobe.d/modprobe.conf}} for sound to work.<br />
<br />
=== Lenovo ThinkPad T430 ===<br />
{{Accuracy | I was not able to reproduce this bug as of September 2017 }}<br />
<br />
* Bluetooth (0a5c:21e6 Broadcom Corp. BCM20702 Bluetooth 4.0 [ThinkPad]) appears to be functional, even during standby or hibernation.<br />
<br />
=== Lenovo ThinkPad T440p ===<br />
<br />
* ClickPad: the whole trackpad clicks, and disabling the trackpad using older versions of synclient makes the trackpoint essentially unusable. This has been resolved in newer versions of {{Pkg|xf86-input-synaptics}}.<br />
** See [http://who-t.blogspot.com.au/2014/03/xorg-synaptics-support-for-lenovo-t440.html this article] and [http://who-t.blogspot.com.au/2013/12/lenovo-t440-touchpad-button.html previous version].<br />
** Install {{AUR|xf86-input-mtrack}} for alternative drivers.<br />
* Audio:<br />
** HDMI audio is the default audio output device. Consult the [[ALSA]] page for details on changing the default.<br />
** As the X100e/Mini10, it's possible to mute the headset and speaker outputs separately to the master. Muting the speaker output improves bass output on the headset port.<br />
** If the system fails to wake from sleep, it can lose sync with the internal audio card and speakers/headphones may fail to work. In this case, put the system to sleep, and wake it again and audio functionality should be restored. <br />
* The fingerprint sensor is a Validity VFS5011, which requires [https://github.com/abbradar/fprint_vfs5011 a patched fprintd] and is apparently highly unreliable.<br />
* thinkpad_acpi:<br />
** To toggle Fn-Lock, press Fn + Esc, this will toggle the LED on the keyboard. While the Fn LED is on all Fn functionalities work as intended out of the box. <br />
** Controlling the 'glowing I' LED is apparently not possible.<br />
** fan control does not seem to work.<br />
* Graphics and Video:<br />
** With the integrated GPU, [[xrandr]] can crash while attaching or detaching displays connected via the dock.<br />
** The built-in miniDisplayPort will sometimes spew I²C issues into the kernel log.<br />
** [[Hardware video acceleration]] is highly recommended as it performs significantly better than CPU decoding of large media files.<br />
** '''The BIOS should not be upgraded past version 1.14, as newer BIOSes cause memory corruption when used with Bumblebee.''' See [https://github.com/Bumblebee-Project/bbswitch/issues/78#issuecomment-42741698 Bumblebee GitHub]<br />
* Connectivity:<br />
** Bluetooth is ''extremely'' fragile. The controller works fine most of the time, but can cause the system to wedge totally on sleep/wake cycles, especially if a connection was active at sleep. Disable the controller using {{ic|bluetoothctl}} before sleeping.<br />
<br />
=== Lenovo ThinkPad T560 ===<br />
* No automatic brightness adjusting when switching power supply battery <-> AC<br />
<br />
* Hardware specifications of test device<br />
** CPU: Intel CORE i7-6600U @ 2.60GHz or Intel CORE i5-6200U @ 2.30GHz or Intel CORE i5-6300U @ 2.40GHz<br />
** GPU Primary: Intel HD 520<br />
** GPU Secondary: Nvidia GeForce 940MX or None<br />
** WiFi: Intel 8260<br />
** Ethernet: Intel I219-LM<br />
** Card reader: Realtek RTS522A<br />
<br />
=== Lenovo S21e-20 ===<br />
* Tested with {{Pkg|broadcom-wl-dkms}} 802.11 wireless driver<br />
* Synaptics touchpad required 3 patches to {{Pkg|linux}}:drivers/hid/hid-rmi.c on 2015-07-26 ([https://bugs.freedesktop.org/show_bug.cgi?id=91102 bug report], [https://github.com/harisokanovic/archlinux-packages/commit/f4550c211ca7809ecf926f8074c7b7250a74bd92 kernel recipe patch]). The current 4.3 kernel includes these patches. You will also need to install the xf86_64-input-synaptics package([https://www.archlinux.org/packages/?name=xf86-input-synaptics]) <br />
<br />
==== tpacpi-bat ====<br />
<br />
There is an issue with tpacpi-bat not reporting the right value for the stop threshold. This seems to be related to a buggy BIOS and can not be fixed application wise. <br />
<br />
See https://github.com/teleshoes/tpacpi-bat/issues/44<br />
<br />
==== ThinkPad Edge E420s Delay with Space Bar====<br />
Solution: Update BIOS (at least 1.08).<br />
<br />
=== Lenovo IdeaPad Y700 ===<br />
* The subwoofer does not work out of the box.<br />
** Updating to Kernel 4.15 or later seems to fix the subwoofer.<br />
<br />
=== Lenovo IdeaPad V330-14ARR ===<br />
* Lenovo only provide BIOS updates as a WinX64 package. The 3.08 release has been extracted and can be installed in DOS (installation has been confirmed using freeDOS) using H2OFFT-D.EXE and is available [https://drive.google.com/drive/folders/1IgwALJ_LLHY1nRbl3naNJU1QQ7l33Vrv?usp=sharing online], ensure you have an arch install media on hand to reset your bootloader.<br />
* The installed wireless card (atheros based) has shown itself to be troublesome with many pci errors, most caught and corrected but very occasionally the card would fail to come up on boot or drop out during use. intel-9260 works with no errors (tested with bios 3.05) intel-9560 was not initialised by the bios.<br />
<br />
== See also ==<br />
* [http://www.thinkwiki.org/wiki Think wiki]<br />
* [https://kozikow.com/2016/06/03/installing-and-configuring-arch-linux-on-thinkpad-x1-carbon/Blog Arch on Thinkpad X1 Carbon]</div>Cirrushttps://wiki.archlinux.org/index.php?title=Laptop/Lenovo&diff=597388Laptop/Lenovo2020-02-13T17:53:36Z<p>Cirrus: /* X series */</p>
<hr />
<div>[[Category:Lenovo]]<br />
[[ja:ノートパソコン/Lenovo]]<br />
{{Laptops navigation}}<br />
{{Related articles start}}<br />
{{Related|ThinkPad docks}}<br />
{{Related articles end}}<br />
<br />
== IBM/Lenovo ==<br />
<br />
=== ThinkPad ===<br />
<br />
==== Edge series ====<br />
<br />
{{HCL/Laptops table header}}<br />
| [[Lenovo ThinkPad Edge E330]] || NA || Yes || Yes || Yes || Yes || Yes || Yes || NA || ||<br />
|-<br />
| [[Lenovo ThinkPad Edge E335]] || NA || Yes || Yes || Yes || Yes || NA || Yes || NA || ||<br />
|-<br />
| Lenovo ThinkPad Edge E420s || Yes || Yes || Yes || Yes || Yes || Yes || NA || NA || SDcard (Yes), Webcam (Yes), Trackpoint (No) || <br />
|-<br />
| [[Lenovo ThinkPad Edge E430]] || Yes || Yes || Yes* || Yes* || Not tested || Yes || NA || NA || SD card (yes) || <br />
|-<br />
| [[Lenovo ThinkPad Edge E455]] || 2015.04.01 || Yes* || Yes || Yes || Yes || Yes || Yes || NA || ||<br />
|-<br />
| Lenovo ThinkPad Edge E470 || 2017.09.01 || Yes || Yes || Yes || Yes || Not tested || NA || NA || trackpoint (yes) ||<br />
|-<br />
| Lenovo ThinkPad Edge E530 || Yes || Yes || Yes* || Yes* || Yes || Yes || NA || NA || SD card (yes), Finger Print (yes) || E530 without fingerprint reader can be equipt with one.<br />
|-<br />
| Lenovo ThinkPad Edge E531 || Yes || Yes || Yes || Yes || Yes* || Yes || Yes || NA || SD card (yes), Touch Pad/Trackpoint (yes), Webcam (yes) || WiFi only works with {{Pkg|broadcom-wl-dkms}}<br />
|-<br />
| Lenovo ThinkPad Edge E540 || 2015.08.01 || Yes || Yes || Yes || Yes || Yes || Yes* || NA || SD card (yes), Finger Print (yes), touch pad and trackpoint (yes), Webcam (yes) || <br />
|-<br />
| Lenovo ThinkPad Edge E545 || NA || Yes || Yes || Yes || Yes* || Not tested || Yes || NA || SD card (yes), touch pad and trackpoint (yes) Webcam (yes) || wifi works only with {{Pkg|broadcom-wl-dkms}}<br />
|-<br />
| Lenovo ThinkPad Edge E580 || 2018.05.01 || Yes || Yes || Yes || Yes || Yes || Yes || NA || Fingerprint sensor doesn't work because of proprietary firmware || ||<br />
|-<br />
|}<br />
<br />
==== E series ====<br />
<br />
{{HCL/Laptops table header}}<br />
| Lenovo ThinkPad E485 || 2018-10-01 || Yes || Yes || Yes || Yes || Yes || Yes || N/A || || Missing IVRS map in ACPI Table, add <code>amd_iommu=pt ivrs_ioapic[32]=00:14.0</code> in [[kernel parameters]]. In order to get X to work correctly, add <code>iommu=soft</code> in [[kernel parameters]] (Linux 4.20 only). On Linux 5.2, add <code>iommu=pt</code> to prevent render artifacts on X. In order to get microsd (SDHCI) working, <code>echo 'options sdhci debug_quirks2="0x8000"' > /etc/modprobe.d/sdhci.conf</code> and change module load order <code>MODULES=(sdhci sdhci_pci)</code> in <code>/etc/mkinitcpio.conf</code> (line 7). Don't forget to run <code>mkinitcpio -p linux</code> afterwards. If WiFi doesn't work on RTL8822BE adapter models, create a file <code>/etc/modprobe.d/wifi.conf</code> and add the following lines: <code>blacklist rtw_pci<br />blacklist rtwpci</code>. Then, install {{aur|rtlwifi_new-extended-dkms}} and reboot.<br />
|-<br />
| Lenovo ThinkPad E585 || 2018-11-01 || Yes || Yes || Yes || Yes || Yes || Yes || N/A || || To solve all these issues mentioned here easier just install the latest BIOS update from Lenovo support website. Missing IVRS map in ACPI Table, add <code>amd_iommu=pt ivrs_ioapic[32]=00:14.0</code> in [[kernel parameters]]. In order to get X to work correctly, add <code>iommu=soft</code> in [[kernel parameters]] (Linux 4.20 only). In order to get microsd (SDHCI) working, <code>echo 'options sdhci debug_quirks2="0x8000"' > /etc/modprobe.d/sdhci.conf</code> and change module load order <code>MODULES=(sdhci sdhci_pci)</code> in <code>/etc/mkinitcpio.conf</code> (line 7). Don't forget to run <code>mkinitcpio -p linux</code> afterwards. Bluetooth doesn't work until a suspend/resume cycle occurs.<br />
|-<br />
| Lenovo ThinkPad E595 || 2019-07-01 || Yes || Yes || Yes || Yes || Yes || Yes || N/A || ||<br />
Wifi is slow and unstable with default driver, but it works using {{aur|rtlwifi_new-dkms}}.<br />
<br />
To make sound work properly, add `intel_iommu=igfx_off` in [[kernel parameters]].<br />
<br />
Missing IVRS map in ACPI Table, add <code>amd_iommu=pt ivrs_ioapic[32]=00:14.0</code> in [[kernel parameters]] (copied from above, the fan stopped making noise all the time afterwards).<br />
<br />
MicroSD not tested, see above if it doesn’t work.<br />
<br />
Wake up from suspend broken on X.Org with kernel >= 5.2<br />
|-<br />
|}<br />
<br />
==== L series ====<br />
<br />
{{HCL/Laptops table header}}<br />
| [[Lenovo ThinkPad L380 Yoga]] || Yes || Yes || Yes || Yes || Yes || Yes || Yes || NA || Trackpoint*, Fingerprint reader ||<br />
|-<br />
| Lenovo ThinkPad L390 || 2019.09.01 || Yes || Yes || Not tested || Yes || Yes || Yes || NA || Webcam, MicroSD card reader is working out of the box. Not working out of the box: Touchscreen, fingerprint reader, NFC ||<br />
|-<br />
| Lenovo ThinkPad L420 || Yes || Yes || Yes || Yes || Yes || Not tested || Yes || NA || ||<br />
|-<br />
| Lenovo ThinkPad L430 || Yes || Yes || Yes || Yes || Yes || Yes || Yes || NA || Trackpoint* ||<br />
|-<br />
| Lenovo ThinkPad L440 || Yes || Yes || Yes || Yes || Yes || Yes || Yes || NA || Trackpoint (Touchpad cannot be disabled, as mouse buttons are shared with Trackpoint), Fingerprint reader, SD Card Reader ||<br />
|-<br />
| Lenovo ThinkPad L450 || 2019.11.01 || Yes || Yes || Yes || Yes || Yes || Yes || NA || Trackpoint, Fingerprint reader, SD Card Reader ||<br />
|-<br />
| Lenovo ThinkPad L460 || Yes || Yes || Yes || Yes || Yes || Yes || Yes || Not tested || Trackpoint, Fingerprint reader, SD Card Reader ||<br />
|-<br />
| Lenovo ThinkPad L520 || 2018.09.01-x86_64|| Yes || Yes || Yes || Yes || Not tested|| Not tested|| Not tested|| Not tested ||<br />
|-<br />
| Lenovo ThinkPad L530 || Yes || Yes || Yes || Yes || Yes || Yes || Yes || NA || Trackpoint*, Fingerprint reader ||<br />
|-<br />
| Lenovo ThinkPad L560 || Yes || Yes || Yes || Yes || Yes || Not tested || Not tested || NA || Trackpoint ||<br />
|-<br />
| Lenovo ThinkPad L590 || No || Not tested || Not tested || Not tested || Not tested || Not tested || Not tested || NA || || Kernels >= 5 won't boot at all and freezes at different stages of startup.<br />
|-<br />
|}<br />
<br />
==== A series ====<br />
<br />
{{HCL/Laptops table header}}<br />
| Lenovo ThinkPad A485 || 2018.12 || Yes || Yes || Yes || Yes || Yes || Yes || NA || Touch Pad/Trackpoint (yes), Webcam (yes) || bluetooth does not work when activating [[Laptop Mode Tools]] <code>runtime-pm</code> module<br />
|}<br />
<br />
==== P series ====<br />
<br />
{{HCL/Laptops table header}}<br />
| [[Lenovo ThinkPad P50]] || 2016.04 || Yes || Yes || Yes || Yes || Yes || Yes || NA || SD card (Yes), Webcam (Yes), Fingerprint Reader ({{AUR|libfprint-vfs0090-git}}), || Wifi requires Kernel 4.3.3+ <br />
|-<br />
| [[Lenovo ThinkPad P70]] || 2016.04 || Yes || Yes || Yes || Yes || Yes || Suspend working, hibernate not tested || NA || SD card (Yes), Webcam (Yes), Fingerprint Reader ({{AUR|libfprint-vfs0090-git}}), || Wifi requires Kernel 4.3.3+ <br />
|-<br />
| Lenovo ThinkPad P51 || Unknown || Yes || Yes || Yes || Yes || Yes || Yes || Yes (No GNSS/GPS) ||<br />
* Working: SD card, Webcam, Express card, Smartcard reader, Fingerprint Reader ({{AUR|libfprint-vfs0097-git}})<br />
* Not working: TPM, Color calibrator, UEFI flash <br />
|| HDMI audio requires nvhda module<br />
|-<br />
| [[Lenovo ThinkPad P52]] || 2018.09 || Yes || Yes || Yes || Yes || Yes || Suspend working, hibernate not tested || NA || Webcam (yes), IR camera (yes), Touchpad (yes), Card Reader (not tested) Smartcard Reader (yes), Fingerprint (no) ||<br />
|-<br />
| [[Lenovo ThinkPad P1]] || 2018.12 || Yes || Yes || Yes || Yes || Yes || Suspend working, hibernate not tested || NA || Webcam (Yes), multi-monitor (yes)|| <br />
|-<br />
| [[Lenovo ThinkPad P1 (Gen 2)]] || 2019.09.01 || Yes || Yes || Yes || Yes || Yes || Suspend working, hibernate working || NA || Webcam (not tested), multi-monitor (yes)|| <br />
|-<br />
| [[Lenovo ThinkPad P52s]] || 2019.02 || Yes* (See Remarks) || Yes || Yes || Yes || Yes || Suspend (Yes), Hibernate (Yes) || Not tested || Webcam (Yes), Multi-monitor (Yes), Card Reader (Yes), Smartcard Reader (Yes), NFC (No, [https://github.com/nfc-tools/libnfc/issues/455 see this]), Fingerprint (No, [https://forums.lenovo.com/t5/Linux-Discussion/Thinkpad-T580-Synaptics-Metallica-MIS-Touch-Fingerprint-Reader/m-p/4057745 see this])|| *Intel graphics needs to be specified in the Xorg config for Xorg to work, see [[Lenovo ThinkPad P52s]]<br />
|-<br />
| [[Lenovo ThinkPad P53]] || 2019.12 || Yes || Yes || Yes || Yes || Yes || Suspend working, hibernate not tested || NA || Webcam (Yes), Multi-monitor (Yes), Hybrid nvidia/intel (Yes), Card Reader (Not tested), Smartcard Reader (Not tested), Fingerprint (Missing driver support)|| Use nvidia-prime to switch between cards. <br />
|-<br />
| [[Lenovo ThinkPad P53s]] || 2019.10 || Yes || Yes || Yes || Yes || Not tested || Not tested || Not tested || Webcam (Yes), Multi-monitor (Not testes), Card Reader (Not tested), Smartcard Reader (Not tested), Fingerprint (Not tested)|| Trackpad is really bad compared to the Thinkpad T480.<br />
|}<br />
<br />
==== T series ====<br />
<br />
{{HCL/Laptops table header}}<br />
| IBM ThinkPad T60 || Yes || Yes || Yes || Yes || Yes || Yes || ? || NA || ||<br />
|-<br />
| IBM ThinkPad T60p || Yes || Yes || Yes || Yes || Yes || Yes || ? || NA || ThinkFinger ||<br />
|-<br />
| [[IBM ThinkPad T61]] || Yes || Yes || Yes || Yes || Yes || Yes || NA || || ||<br />
|-<br />
| IBM ThinkPad T61p || Yes || Yes || Yes || Yes || Yes || Yes || NA || || ||<br />
|-<br />
| [[Lenovo ThinkPad T400]] || Yes || Yes || Yes || Yes || Yes || Yes || NA || NA || ||<br />
|-<br />
| [[Lenovo ThinkPad T400s]] || Yes || Yes || Yes || Yes || Yes || Yes || NA || NA || ||<br />
|-<br />
| Lenovo ThinkPad T410 || Yes || Yes || Yes || Yes || Yes || Yes || NA || NA || ||<br />
|-<br />
| [[Lenovo ThinkPad T420]] || Yes || Yes || Yes || Yes || Yes || Yes || Yes || NA || Card reader tested, no Fingerprint scanner||<br />
|-<br />
| [[Lenovo ThinkPad T420s]] || Yes || Yes || Yes || Yes || Yes || Yes || NA || NA || Card Reader ||<br />
|-<br />
| [[Lenovo ThinkPad T430]] || Yes || Yes || Yes || Yes || Yes || Yes* || Yes* || Not tested || ||<br />
|-<br />
| [[#Lenovo ThinkPad T440p|Lenovo ThinkPad T440p]] || Yes || Yes || Yes || Yes || Yes || Yes* || NA || NA || Card Reader || See below<br />
|-<br />
| [[Lenovo ThinkPad T440s]] || Yes || Yes || Yes || Yes || Yes* || ? || Yes || ? || || See wiki page for more details about wireless<br />
|-<br />
| [[Lenovo ThinkPad T450s]] || 2015.10.01 || Yes || Yes || Yes || Yes || Yes || ? || NA || SD Card reader; fingerprint scanner|| <br />
|-<br />
| [[Lenovo ThinkPad T460s]] || Yes || Yes || no beep || Yes || Yes || Yes || ? || NA || SD Card reader|| <br />
|-<br />
| [[Lenovo ThinkPad T25]] || Yes || Yes || Yes || Yes || Yes || Yes || Yes || NA || SD Card reader; fingerprint scanner; Touchscreen|| <br />
|-<br />
| [[Lenovo ThinkPad T470]] || Yes || Yes || Yes || Yes || Yes || Yes || Yes || NA || SD Card reader; fingerprint scanner|| <br />
|-<br />
| [[Lenovo ThinkPad T470s]] || Yes || Yes || Yes || Yes || Yes || Yes || Yes || NA || SD Card reader; fingerprint scanner|| <br />
|-<br />
| [[Lenovo ThinkPad T480]] || 2018.07.01 || Yes || Yes || Yes || Yes || Yes || ? || NA || Thunderbolt 3 (USB-C); SD Card reader; fingerprint scanner|| <br />
|-<br />
| [[Lenovo ThinkPad T480s]] || ? || Yes || no beep || Yes || Yes || Yes || ? || NA || Thunderbolt 3 (USB-C); SD Card reader|| <br />
|-<br />
| [[Lenovo ThinkPad T490]] || Yes || Yes || Yes || ? || Yes || Yes || Yes || NA || Thunderbolt 3 (USB-C); SD Card reader || Some problems with touchpad<br />
|-<br />
| [[Lenovo ThinkPad T495]] || Yes || Yes || Yes || Yes || Yes || Yes || Yes || NA || SD Card reader ||<br />
|-<br />
| [[Lenovo ThinkPad T495s]] || Yes || Yes || Yes || Yes || Yes || Yes || Yes || NA || ||<br />
|-<br />
| Lenovo ThinkPad T500 || Yes || Yes || Yes || Yes || Yes || Yes || NA || NA || ||<br />
|-<br />
| [[Lenovo ThinkPad T520]] || Yes || Yes || Yes || Yes || Yes || Yes || NA || NA || ||<br />
|-<br />
| [[Lenovo ThinkPad T530]] || Yes || Yes || Yes || Yes || Yes || Yes || Yes || NA || ||<br />
|-<br />
| [[Lenovo ThinkPad T550]] || Yes || Yes || Yes || Yes || Yes || Yes || Yes || NA || DisplayPort ||<br />
|-<br />
| Lenovo ThinkPad T560 || Yes || Yes || Yes || Yes || Yes || Yes || Yes* || NA || MiniDP; Fingerprint scanner; Intel + Nvidia GPU; Card Reader || See special notes for the hardware specifications of this test device<br />
|-<br />
| [[Lenovo ThinkPad T570]] || Yes || Yes || Yes || Yes || Yes || ? || Yes* || NA || not yet fully tested || <br />
|-<br />
| Lenovo ThinkPad T580 || Yes || Yes || Yes || Yes || Yes || Yes || Yes || NA || SD Card Reader is supported; [https://forums.lenovo.com/t5/Linux-Discussion/Thinkpad-T580-Synaptics-Metallica-MIS-Touch-Fingerprint-Reader/m-p/4057745 Fingerprint reader is not supported] || Tested on ''2 May 2018'' (with ''Linux 4.16.5'')<br />
|}<br />
<br />
==== W series ====<br />
{{HCL/Laptops table header}}<br />
|-<br />
| Lenovo ThinkPad W500 || 2019.12 || Yes || Yes || Yes || Yes || Yes || Yes || Not tested || SD card (Yes), Webcam (Yes), Fingerprint Reader (Yes) || Tested January 2020 / Linux 5.4.11<br />
|-<br />
| Lenovo ThinkPad W510 || Yes || Yes || Yes || Yes || Yes || Yes || Yes || NA || SD card (Yes), Webcam (Yes), Touchscreen (Yes), Fingerprint Reader (Not tested) || Tested April 2017 / Linux 4.10.8<br />
|-<br />
| Lenovo ThinkPad W530 || 2016.03 || Yes || Yes || Yes || Yes || Yes || Yes || NA || SD card (Yes), Webcam (Yes), Fingerprint Reader (Yes) || Tested April 2018 / Linux 4.15.15<br />
|-<br />
| Lenovo ThinkPad W540 || Yes || Yes || Yes || Yes || Yes || Yes || Yes || NA || SD card (Yes), Webcam (Yes), Fingerprint Reader (Yes) || Tested April 2017 / Linux 4.10.8<br />
|-<br />
| Lenovo ThinkPad W541 || Yes || Yes || Yes || Yes || Yes || Yes || Yes || Not tested || SD card (Yes), Webcam (Yes), Fingerprint Reader (Not tested) || Tested August 2018 / Linux 4.17.12<br />
|-<br />
| Lenovo ThinkPad W550s || Yes || Yes || Yes || Yes || Yes || Yes || Yes || NA || SD card (Yes), Webcam (Yes), Fingerprint Reader (Yes) || Tested April 2018 / Linux 4.15.15<br />
|-<br />
|}<br />
<br />
==== X series ====<br />
<br />
{{HCL/Laptops table header}}<br />
| [[IBM ThinkPad X60s]] || Yes|| Yes || Yes || Yes || Yes || Yes || NA || NA || ||<br />
|-<br />
| Lenovo ThinkPad X61s || Yes || Yes || Yes || Yes || Yes || Yes || Yes || NA || SD slot ||<br />
|-<br />
| [[Lenovo ThinkPad X100e]] || Yes|| Yes || Yes || Yes || Yes || Yes || Not tested || NA || SD card (Yes), Webcam (Yes) ||<br />
|-<br />
| Lenovo ThinkPad X131e || Yes|| Yes || Yes || Yes || Yes || Yes || Yes || Not tested || SD card (Yes), Webcam (Yes), [https://bbs.archlinux.org/viewtopic.php?id=159014 WLAN Led seems not controlled] ||<br />
|-<br />
| [[Lenovo ThinkPad X200]] || Yes || Yes || Yes || Yes || Yes || Yes || NA || Yes || ||<br />
|-<br />
| [[Lenovo ThinkPad X200S]] || Yes || Yes || Yes || Yes || Yes || Yes || NA || Yes || Everything worked out of the box. However, fingerprint, SD card and webcam were not tested. Modem needs reset after sleep (sometimes). ||<br />
|-<br />
| [[Lenovo ThinkPad X201]] || Yes || Yes || Yes || Yes || Yes || Yes || Yes || Not tested || ||<br />
|-<br />
| [[Lenovo ThinkPad X220]] || Yes || Yes || Yes || Yes || Yes || Yes || Yes || NA || SD card (Yes), Webcam (Yes) || Intel Centrino Advanced-N 6205 [Taylor Peak] requires {{Pkg|linux-firmware}} <br />
|-<br />
| [[Lenovo ThinkPad X230]] || Yes || Yes || Yes || Yes || Yes || Yes || Yes || NA || SD card (Yes), Webcam (Yes), UMTS Modem (Yes), Accelerometer (No) ||<br />
|-<br />
| [[Lenovo ThinkPad X240]] || Yes || Yes || Yes || Yes || Yes || Yes || Yes || WWAN LTE (yes) || SD card (Yes), Webcam (Yes), Fingerprint (Yes) ||<br />
|-<br />
| [[Lenovo ThinkPad X250]] || Yes || Yes || Yes || Yes || Yes || Yes || Yes || NA || SD card (Yes), Webcam (Yes), Fingerprint (Yes) ||<br />
|-<br />
| [[Lenovo ThinkPad X260]] || Yes || Yes || Yes || Yes || Yes || Yes || Yes || NA || SD card (Yes), Webcam (Yes), Fingerprint (Yes) ||<br />
|-<br />
| [[Lenovo ThinkPad X270]] || Yes || Yes || Yes || Yes || Yes || Not tested || Yes || NA || Webcam (Yes) ||<br />
|-<br />
| Lenovo ThinkPad X280 || Yes || Yes || Yes || Yes || Yes || Yes || Yes || Yes (Fibcom L830-EB-00) || Webcam (Yes) ||<br />
|-<br />
| Lenovo ThinkPad X390 || 2019.08.01 || Yes || Yes || Yes || Yes || Yes || Yes || Yes (Fibocom L830-EB) || Webcam (Yes) ||<br />
|-<br />
| Lenovo ThinkPad X395 || Yes || Yes || Yes || Yes || Yes || Yes || Yes || NA || Webcam (Yes), Fingerprint(No, WIP[https://forums.lenovo.com/t5/Other-Linux-Discussions/Linux-on-T495/m-p/4474320#M13440]) || Prevent amdgpu issues by updating to latest BIOS [https://support.lenovo.com/us/en/downloads/ds540046]<br />
|-<br />
| [[Lenovo ThinkPad X1 Carbon]] || NA || Yes || Yes || Yes || Yes || Proprietary/nonfree || Yes || NA || ||<br />
|-<br />
| [[Lenovo ThinkPad X1 Carbon (Gen 2)]] || NA || Yes || Yes || Yes || Yes || Yes || Yes || NA || ||<br />
|-<br />
| [[Lenovo ThinkPad X1 Carbon (Gen 3)]] || NA || Yes || Yes || Yes || Yes || Yes || Yes || NA || ||<br />
|-<br />
| [[Lenovo ThinkPad X1 Carbon (Gen 4)]] || NA || Yes || Yes || Yes || Yes || Yes || Yes || NA || ||<br />
|-<br />
| [[Lenovo ThinkPad X1 Carbon (Gen 5)]] || NA || Yes || Yes || Yes || Yes || Yes || Yes || Yes || ||<br />
|-<br />
| [[Lenovo ThinkPad X1 Carbon (Gen 6)]] || NA || Yes || Yes || Yes || Yes || Yes || Yes || Yes || ||<br />
|-<br />
| [[Lenovo ThinkPad X1 Carbon (Gen 7)]] || NA || Yes || Yes || Yes || Yes || Yes || Yes || Yes || Internal Mic not working out of the box || <br />
|-<br />
| [[Lenovo ThinkPad X1 Extreme]] || NA || Yes || Yes || Yes || Yes || Yes || Yes || NA || Fingerprint reader not supported, Thunderbolt ports not tested || Graphics requires some configuration to work correctly<br />
|-<br />
| [[Lenovo ThinkPad X1 Extreme (Gen 2)]] || NA || Yes || Yes || Unknown || Yes || Yes || Yes || NA || Fingerprint reader not supported [https://github.com/nmikhailov/Validity90/issues/72 yet], Thunderbolt ports not tested ||<br />
|-<br />
| [[Lenovo ThinkPad X1 Yoga (Gen 3)]] || NA || Yes || Yes || Yes || Yes || Yes || Partial || NA || SD card (Yes), Webcam (Yes), Fingerprint (No), Touchscreen (Yes), Accelerometer (Yes) ||<br />
|-<br />
| [[Lenovo ThinkPad X1 Yoga (Gen 4)]] || NA || Yes || Yes || Yes || Yes || Yes || Yes || Not tested || Webcam (Yes), Microphone (No), Fingerprint (No), Touchscreen (Yes), Accelerometer (Yes) ||<br />
|}<br />
<br />
==== Yoga Series ====<br />
<br />
{{HCL/Laptops table header}}<br />
| Lenovo ThinkPad Yoga 14 || || || || || || || || || || The Lenovo ThinkPad Yoga 14 (20FY) is a convertible 14-inch Ultrabook developed by Lenovo in 2015. It is one of many iterations in the ThinkPad line. It's also known as P40 Yoga (type 20GR, 20GQ), S3 (20G0, 20G1) and Yoga 460 (20EM, 20EL). A [https://download.lenovo.com/pccbbs/mobiles_pdf/p40_yoga14_mt20fy_yoga460_hmm_en_sp40j47499_01.pdf hardware maintenance manual is provided online].<br />
|-<br />
| [[Lenovo ThinkPad Yoga 260]] || USB || Yes || Yes || Yes || Yes || Yes || Unknown || Yes || SD card (Yes), Webcam (Yes), Fingerprint Reader (Unknown), Touchscreen (Yes), Tablet (Partial), Accelerometer (No) || Wifi requires Kernel 4.3.3+<br />
|-<br />
| Lenovo Yoga 530 || 2019.09.01 || Yes || Yes || Not tested || Yes || Not tested || Not tested || Not tested || SD card (Not tested), Webcam (Yes), Fingerprint Reader (Not tested), Touchscreen (Yes), Tablet (Partial) || Trouble with touchpad, but worked with kernel parameters "i8042.noloop i8042.nomux i8042.nopnp i8042.reset" and xf86-input-synaptics<br />
|-<br />
| Lenovo Yoga 710 || NA || Yes || Yes || Yes || Yes || Not tested || Yes || Not tested || SD card (Yes), Webcam (Yes), Touchscreen || Everything works<br />
|-<br />
| Lenovo Yoga c930 || 2019.09.01 || Yes || Partially (Fix needed for hinge soundbar, bottom speakers not working. Microphone not working) || N/A || Yes || Not tested || Yes || N/A || Webcam (Yes), Touchscreen || See https://github.com/droserasprout/lenovo-yoga-c930-linux for more information and fixes<br />
|}<br />
<br />
==== Helix Series ====<br />
{{HCL/Laptops table header}}<br />
| [[Lenovo ThinkPad Helix]] || Unknown || YES || YES || NA || YES || YES || NA || Touchscreen (yes), Pen (yes), Sensors (yes) || ||<br />
|-<br />
| [[Lenovo ThinkPad Helix 2nd Gen]] || 2018.04.01 (USB) || YES || YES || NA || YES || Not tested || Yes* (with updated BIOS) || Touchscreen (yes), Pen (not tested), Sensors (w/ patched kernel) || NA || Only suspend-to-idle ("freeze") is supported<br />
|-<br />
|}<br />
<br />
== Lenovo ==<br />
<br />
=== IdeaPad ===<br />
<br />
{{HCL/Laptops table header}}<br />
| Lenovo IdeaPad 120S || 2018-04-26 || Yes || Yes || NA || Yes || Yes || Yes || NA || Everything works ||<br />
|-<br />
| [[Lenovo IdeaPad Flex 10]] || Yes || Yes* || Yes || NA || Yes || Yes || Yes || NA || Touchscreen* ||<br />
|-<br />
| [[Lenovo IdeaPad S10]] || Yes || Yes || Yes || Yes || Yes || Yes || NA || NA || ||<br />
|-<br />
| [[Lenovo IdeaPad S400 Touch]] || Yes || Yes || Yes || Yes || Yes || Yes || Not tested || NA || ||<br />
|-<br />
| Lenovo IdeaPad U430p || Yes || Yes || Yes || Yes || Yes || Yes || Not tested || NA || ||<br />
|-<br />
| Lenovo IdeaPad Y700 || 2015.12.01 || Yes || Yes* || Yes || Yes || Yes || Not tested || NA || Trackpad - [https://unix.stackexchange.com/questions/362165/lenovo-y700-elantech-touchpad-query-0x01-failed buggy] || [https://bugzilla.kernel.org/show_bug.cgi?id=151681 Trackpad requires pata_legacy to be blacklisted]<br />
|-<br />
| [[Lenovo IdeaPad Z580]] || Yes || Yes || Yes || Yes || Yes || Yes || Yes || NA || ||<br />
|-<br />
| [[Lenovo IdeaPad 720s]] || 2018.03.01 || Yes || Yes || NA* || Yes || Yes || Yes || NA || Fingerprint reader not working || *requires USB or USB C dongle<br />
|-<br />
| [[Lenovo IdeaPad 720s (Ryzen)]] || 2018.02.01 || Not tested || Not tested || Yes* || No || Not tested || Not tested || NA || Fingerprint reader not tested but most likely not working || *requires USB or USB C dongle<br />
|-<br />
| Lenovo Ideapad 320 || 2018.03.01 || Yes || Yes || Yes || Yes || Yes || Not tested || NA || To stop constant annoying messages by AMD-Vi, use 'iommu=soft' & 'amd_iommu=off' in kernel arguments || <br />
|-<br />
| Lenovo Ideapad 330S-14IKB || 2019.10.01 || Yes || Yes || Yes || Yes || Not tested || NA || NA || {{ic|Firmware Error (ACPI): Could not resolve [^^^GFX0.AFN2], AE_NOT_FOUND (20181213/psargs-503)}} is raised every few seconds, and can only be turned off by disabling the ACPI ({{ic|1=acpi=off}}) or by connecting the laptop to a charger. Tried with both the stock BIOS and the latest update (7SCN34WW) to no avail. || <br />
|-<br />
| Lenovo Ideapad N24 || 2018.04.01 || Yes || Yes || NA || Yes || Not tested || Not tested || NA || Touchscreen || <br />
|-<br />
|}<br />
<br />
====== Battery Conservation Mode on IdeaPad laptops ======<br />
<br />
Battery Conservation Mode is a feature that limits battery charging to 55-60% of its capacity to improve battery life, being most useful when the laptop tends to run on external power much of the time. If your particular laptop model supports it, it can be enabled or disabled in the following manner:<br />
<br />
:First make sure the '''ideapad_laptop''' kernel module is loaded, with the {{ic|lsmod}} command.<br />
:If it is, run the following command as root to enable Battery Conservation Mode:<br />
<br />
# echo 1 >/sys/bus/platform/drivers/ideapad_acpi/VPC2004:00/conservation_mode<br />
<br />
:A 0 will in turn disable the feature.<br />
<br />
{{Note|1=<br><br />
* Both the presence and implementation of this feature vary by model. Particularly, the name of the folder '''VPC2004:00''' could differ.<br />
* If the above doesn't work on your laptop, you can try a different method described [https://forums.linuxmint.com/viewtopic.php?f=49&t=286237#p1583578 here], which may require some (further) trial and error.}}<br />
<br />
=== B series ===<br />
<br />
{{HCL/Laptops table header}}<br />
| Lenovo B50 || NA || Yes || Yes || Yes || Yes || Not tested || Not tested || Not tested || ||<br />
|-<br />
| Lenovo B50-70 || Yes || Yes* ||Yes || Yes || Yes || Yes || Not tested || NA || See below* ||<br />
|-<br />
| Lenovo B450 || Yes || Yes ||Yes || Yes || Yes || NA || Not tested || NA || ||<br />
|-<br />
|}<br />
<br />
=== K series ===<br />
<br />
{{HCL/Laptops table header}}<br />
| Lenovo K450e || NA || Yes || Yes || Yes || Yes || Not tested || Yes || Not tested || ||<br />
|-<br />
|}<br />
<br />
=== N series ===<br />
<br />
{{HCL/Laptops table header}}<br />
| Lenovo N200 (3000) || Yes || Yes* || Yes || Yes || Yes || Yes* || NA || NA || See below ||<br />
|-<br />
|}<br />
<br />
=== S series ===<br />
<br />
{{HCL/Laptops table header}}<br />
| Lenovo S21e-20 || 2015.07.01 || Yes || Yes || NA || Yes* || ? || Yes || NA || SD Card (Yes), USB 3.0 (Yes), HDMI Out (?), Touchpad (Yes*) ||<br />
|-<br />
|}<br />
<br />
=== U Series ===<br />
<br />
{{HCL/Laptops table header}}<br />
| Lenovo U31-70 || 2015.10.01 || Yes || Yes || Yes || Yes* || Yes || Yes || NA || SD Card (Yes), USB 3.0 (Yes), HDMI Out (Yes), Touchpad (Yes), Webcam (Yes) ||<br />
|-<br />
|}<br />
<br />
=== V Series ===<br />
<br />
{{HCL/Laptops table header}}<br />
| Lenovo V110-15ISK || ??? || Yes || Yes || Yes || Yes || Not Tested || Yes || NA || SD Card (Not Tested), USB 3.0 (Not Tested), HDMI Out (Not Tested), Touchpad (Yes), Webcam (Yes) ||<br />
|-<br />
| Lenovo V130-15IKB || ??? || Yes || Yes || Yes || Yes || Yes || Yes || NA || SD Card (Yes), USB 3.0 (Yes), HDMI Out (Yes), Touchpad (Yes), Webcam (Yes) ||<br />
|-<br />
| Lenovo V330-15IKB || 2018.10.01 || Yes || Yes || Yes || Yes || Not Tested || Yes || NA || Fingerprint (No, no driver exists for the Validity/Synaptics 06cb:0081 Fingerprint Reader), Touchpad (Yes), Webcam (Yes) ||<br />
|-<br />
| Lenovo V330-14ARR || 2019.06.15 || Yes || Yes || Yes || Yes[[#Lenovo IdeaPad V330-14ARR|*]] || Yes || Yes || NA || SD-Card Reader (Yes) HDMI Out (Yes), USB 3.0 (Yes), Touchpad (Yes), Webcam (Yes) || DOS installable BIOS available[[#Lenovo IdeaPad V330-14ARR|*]] ||<br />
|-<br />
|}<br />
<br />
=== Y series ===<br />
{{HCL/Laptops table header}}<br />
| Lenovo Legion Y520 || 2019.06.01 || Yes || Yes || Yes || Yes || Yes || Yes || Yes || SD card (Not working properly), Webcam (Yes), USB & USB 3.0 (Yes), HDMI (Yes), USB-C (Not tested), Touchpad (Yes), NVMe M.2 SSD (Yes), GeForce GTX 1050 Ti (Yes) || Tested June 2019 / Linux 5.1.9. Must change SATA configuration in BIOS from RAID to AHCI in order to recognize SSD.<br />
|-<br />
| Lenovo Legion Y520 || ??? || Yes || Yes || Yes || Yes || Yes || Yes || Yes || SD card (Not tested), Webcam (Yes), USB & USB 3.0 (Yes), HDMI (Yes), USB-C (Not tested), Touchpad (Yes), NVMe M.2 SSD (Yes), GeForce GTX 1050 (Yes) || Tested June 2019 / Linux 5.1.5. Must change SATA configuration in BIOS from RAID to AHCI in order to recognize SSD. Some CPU throttling is possible [https://unix.stackexchange.com/questions/491944/cpu-temperatures-in-linux-throttling-or-wrong-reading]. Fan control does not seem to work [https://unix.stackexchange.com/questions/523899/laptop-fan-always-says-its-running-at-8-rpm]<br />
|-<br />
| Lenovo Legion Y730 || ??? || Yes || Yes || Yes || Yes || Yes || Yes || Yes || Webcam (Yes), USB & USB 3.0 (Yes), HDMI (Yes), USB-C (Not tested), Touchpad (Yes), NVMe M.2 SSD (Yes), GeForce GTX 1050 Ti (Yes) || Tested September 2019 / Linux 5.2.13. Must change SATA configuration in BIOS from RAID to AHCI in order to recognize SSD. Disable nouveau at kernel command line with module_blacklist=nouveau or nouveau.modeset=0<br />
|-<br />
| Lenovo Legion Y7000P-1060 || 2019.03.01 || Yes || Yes || Yes || Yes || Yes || Yes || No || Webcam (Yes), USB & USB 3.0 (Yes), HDMI (Yes), USB-C (Yes), Mini DisplayPort (Not tested), Touchpad (Yes), NVMe SSD (Yes), GeForce GTX 1060 Mobile (Yes) || First tested Aug 2019 / Linux 5.2.9.<br />
<br />
https://linux-hardware.org/index.php?computer=af3a4bc1494f<br />
|-<br />
| Lenovo Legion Y530 || 2020.02.01 || Yes || Yes || Yes || Yes || Yes || Yes || Yes || Webcam (Yes) USB & USB C (Yes) HDMI (Yes) TouchPad (Yes) NVMe SSD (Yes with AHCI in UEFI) Geforce GTX 1650 (Yes, with nvidia and nvidia-prime, with or without switchable/discrete graphics in UEFI) Mini Display Port (not tested) || Tested on 8 February 2020 with Linux 5.5.1<br />
|}<br />
<br />
== Special Notes (*): ==<br />
<br />
{{Accuracy|Lots of vague or unproven bugs/workarounds, poor writing}}<br />
<br />
=== Lenovo U31-70 ===<br />
Wireless needs {{Pkg|linux}} >= 4.3 and latest {{Pkg|linux-firmware}}, both packages are currently in testing. Copy one of the firmware blobs {{ic|eeprom_ar6320_2p1_NFA345i.bin}} or {{ic|eeprom_ar6320_2p1_NFA345i_highTX.bin}} from the windows driver to {{ic|/usr/lib/firmware/ath10k/QCA6174/hw2.1/board-pci-168c:0041:17aa:3545.bin}}.<br />
<br />
Wireless with firmware blobs from windows driver may no longer work on {{Pkg|linux}} >= 4.4. Download firmware blob https://github.com/kvalo/ath10k-firmware/blob/f428f53b36b144971c9c4c3d2ebd5fa8cae86c89/QCA6174/hw2.1/board-2.bin and copy it to {{ic|/usr/lib/firmware/ath10k/QCA6174/hw2.1/board-2.bin}}. Tested with {{Pkg|linux}} 4.4.5-1 and {{Pkg|linux-firmware}} 20160113.40e9ae8-1nu<br />
<br />
With packages {{Pkg|linux}} 4.6.1-2 and {{Pkg|linux-firmware}} 20160516.80d463b-1 being in stable, wireless works without any additional steps needed.<br />
<br />
=== Lenovo B50-70 ===<br />
* UEFI:<br />
** to be able to disable Secure Boot (necessary for dual boot, not needed for Linux only), you have to switch from "UEFI first" to "UEFI only" (or something like this) in UEFI setup menu; the Secure Boot option appears then on the Security tab<br />
** after UEFI update having Linux and Windows installed, the Linux bootloader ceased to be the default one, UEFI started to load Windows by default and it was impossible to select the Linux one in the UEFI boot menu and in the UEFI setup - reinstalling the bootloader helped; having no access to a boot media that supports UEFI, a solution might be also replacing the Windows EFI bootloader file with a Linux one temporalily, in order to be able to boot Linux from HDD<br />
** for the UEFI update, a Windows OS is needed<br />
* Touchpad:<br />
** Synaptics - works after installing Synaptics drivers from repo, possible to change behaviour (like reaction for double tap) according to your wish<br />
* Video:<br />
** in laptops with dual video card (Intel and ATI) - detects both, Intel is active as a default, not checked if it's possible at all to switch between them<br />
<br />
==== Operation with a HDD caddy ====<br />
When you install an SSD in the place of the plate HDD drive and you want to have your HDD still inside the laptop, it is possible to install it in the place of the optical drive in a special "HDD caddy". The optical drive is of 9 mm height, but a 9,5 mm caddy (ultra slim) fits in the slot. A caddy with a SATA interface is needed. It is difficult to separate the front bezel from the original optical drive (and opening its case does not help, but brings a danger of making a mess in the opening mechanism; the only option is just to pull the bezel using a bit of force, but you risk breaking the latches).<br />
<br />
While the HDD installed instead of the optical drive operates flawlessly in Windows, it was not going to work out of the box in Linux, at least in one case. The kernel tries to establish a connection with the disk, but fails to do it (''SATA link down'' entry in /var/log/messages). The solution is to force a 1.5 Gbps transfer speed (instead of 6 Gbps) by adding a ''libata.force='' kernel parameter. See [https://www.kernel.org/doc/Documentation/kernel-parameters.txt] for details.<br />
<br />
=== Lenovo K450e ===<br />
<br />
After installing Arch Linux and booting, a single beep may be heard. To disable this beep, press F1 during startup, then change Boot Priority to 'UEFI First', as well as enabling 'CSM'.<br />
<br />
=== ThinkPad X1 Carbon 3rd ===<br />
<br />
* http://natalian.org/archives/2015/02/18/Archlinux_on_a_Lenovo_X1C3/<br />
<br />
=== Lenovo 3000 N200 ===<br />
<br />
* Sound:<br />
** You may have to append {{ic|1=options snd_hda_intel model=lenovo}} to {{ic|/etc/modprobe.d/modprobe.conf}} for sound to work.<br />
<br />
=== Lenovo ThinkPad T430 ===<br />
{{Accuracy | I was not able to reproduce this bug as of September 2017 }}<br />
<br />
* Bluetooth (0a5c:21e6 Broadcom Corp. BCM20702 Bluetooth 4.0 [ThinkPad]) appears to be functional, even during standby or hibernation.<br />
<br />
=== Lenovo ThinkPad T440p ===<br />
<br />
* ClickPad: the whole trackpad clicks, and disabling the trackpad using older versions of synclient makes the trackpoint essentially unusable. This has been resolved in newer versions of {{Pkg|xf86-input-synaptics}}.<br />
** See [http://who-t.blogspot.com.au/2014/03/xorg-synaptics-support-for-lenovo-t440.html this article] and [http://who-t.blogspot.com.au/2013/12/lenovo-t440-touchpad-button.html previous version].<br />
** Install {{AUR|xf86-input-mtrack}} for alternative drivers.<br />
* Audio:<br />
** HDMI audio is the default audio output device. Consult the [[ALSA]] page for details on changing the default.<br />
** As the X100e/Mini10, it's possible to mute the headset and speaker outputs separately to the master. Muting the speaker output improves bass output on the headset port.<br />
** If the system fails to wake from sleep, it can lose sync with the internal audio card and speakers/headphones may fail to work. In this case, put the system to sleep, and wake it again and audio functionality should be restored. <br />
* The fingerprint sensor is a Validity VFS5011, which requires [https://github.com/abbradar/fprint_vfs5011 a patched fprintd] and is apparently highly unreliable.<br />
* thinkpad_acpi:<br />
** To toggle Fn-Lock, press Fn + Esc, this will toggle the LED on the keyboard. While the Fn LED is on all Fn functionalities work as intended out of the box. <br />
** Controlling the 'glowing I' LED is apparently not possible.<br />
** fan control does not seem to work.<br />
* Graphics and Video:<br />
** With the integrated GPU, [[xrandr]] can crash while attaching or detaching displays connected via the dock.<br />
** The built-in miniDisplayPort will sometimes spew I²C issues into the kernel log.<br />
** [[Hardware video acceleration]] is highly recommended as it performs significantly better than CPU decoding of large media files.<br />
** '''The BIOS should not be upgraded past version 1.14, as newer BIOSes cause memory corruption when used with Bumblebee.''' See [https://github.com/Bumblebee-Project/bbswitch/issues/78#issuecomment-42741698 Bumblebee GitHub]<br />
* Connectivity:<br />
** Bluetooth is ''extremely'' fragile. The controller works fine most of the time, but can cause the system to wedge totally on sleep/wake cycles, especially if a connection was active at sleep. Disable the controller using {{ic|bluetoothctl}} before sleeping.<br />
<br />
=== Lenovo ThinkPad T560 ===<br />
* No automatic brightness adjusting when switching power supply battery <-> AC<br />
<br />
* Hardware specifications of test device<br />
** CPU: Intel CORE i7-6600U @ 2.60GHz or Intel CORE i5-6200U @ 2.30GHz or Intel CORE i5-6300U @ 2.40GHz<br />
** GPU Primary: Intel HD 520<br />
** GPU Secondary: Nvidia GeForce 940MX or None<br />
** WiFi: Intel 8260<br />
** Ethernet: Intel I219-LM<br />
** Card reader: Realtek RTS522A<br />
<br />
=== Lenovo S21e-20 ===<br />
* Tested with {{Pkg|broadcom-wl-dkms}} 802.11 wireless driver<br />
* Synaptics touchpad required 3 patches to {{Pkg|linux}}:drivers/hid/hid-rmi.c on 2015-07-26 ([https://bugs.freedesktop.org/show_bug.cgi?id=91102 bug report], [https://github.com/harisokanovic/archlinux-packages/commit/f4550c211ca7809ecf926f8074c7b7250a74bd92 kernel recipe patch]). The current 4.3 kernel includes these patches. You will also need to install the xf86_64-input-synaptics package([https://www.archlinux.org/packages/?name=xf86-input-synaptics]) <br />
<br />
==== tpacpi-bat ====<br />
<br />
There is an issue with tpacpi-bat not reporting the right value for the stop threshold. This seems to be related to a buggy BIOS and can not be fixed application wise. <br />
<br />
See https://github.com/teleshoes/tpacpi-bat/issues/44<br />
<br />
==== ThinkPad Edge E420s Delay with Space Bar====<br />
Solution: Update BIOS (at least 1.08).<br />
<br />
=== Lenovo IdeaPad Y700 ===<br />
* The subwoofer does not work out of the box.<br />
** Updating to Kernel 4.15 or later seems to fix the subwoofer.<br />
<br />
=== Lenovo IdeaPad V330-14ARR ===<br />
* Lenovo only provide BIOS updates as a WinX64 package. The 3.08 release has been extracted and can be installed in DOS (installation has been confirmed using freeDOS) using H2OFFT-D.EXE and is available [https://drive.google.com/drive/folders/1IgwALJ_LLHY1nRbl3naNJU1QQ7l33Vrv?usp=sharing online], ensure you have an arch install media on hand to reset your bootloader.<br />
* The installed wireless card (atheros based) has shown itself to be troublesome with many pci errors, most caught and corrected but very occasionally the card would fail to come up on boot or drop out during use. intel-9260 works with no errors (tested with bios 3.05) intel-9560 was not initialised by the bios.<br />
<br />
== See also ==<br />
* [http://www.thinkwiki.org/wiki Think wiki]</div>Cirrushttps://wiki.archlinux.org/index.php?title=Color_output_in_console&diff=596726Color output in console2020-02-03T14:58:28Z<p>Cirrus: /* Universal wrappers */</p>
<hr />
<div>[[Category:Linux console]]<br />
[[Category:Eye candy]]<br />
[[ja:コンソールのカラー出力]]<br />
[[zh-hans:Color output in console]]<br />
{{Expansion|And maybe create something bigger. Please take active approach if you can add some valuable information. Mention {{Pkg|python-pywal}}.|Talk:Color output in console#Why and what this page is about}}<br />
{{Style|Page is partly a collection of information on different applications, partly begin to lay theory to color output process. Please contribute your knowledge, if you can.}}<br />
{{Related articles start}}<br />
{{Related|Emacs#Custom colors and theme}}<br />
{{Related|nano#Syntax highlighting}}<br />
{{Related articles end}}<br />
This page was created to consolidate colorization of CLI outputs.<br />
<br />
== Applications ==<br />
<br />
=== diff ===<br />
<br />
diffutils from version 3.4 includes the {{ic|--color}} option ([https://lists.gnu.org/archive/html/info-gnu/2016-08/msg00004.html GNU mailing list]).<br />
<br />
$ alias diff='diff --color=auto'<br />
<br />
=== grep ===<br />
<br />
The {{ic|1=--color=auto}} option enables color highlighting. Color codes are emitted only on standard output; not in pipes or redirection.<br />
<br />
Color output in ''grep'' is also useful with [[Wikipedia:regexp|regexp]] tasks.<br />
<br />
Use an [[alias]] to permanently enable this option:<br />
<br />
alias grep='grep --color=auto'<br />
<br />
The {{ic|GREP_COLORS}} variable is used to define colors, and it configures various parts of highlighting.<br />
<br />
See {{man|1|grep}} for more information.<br />
<br />
{{Out of date|GREP_COLOR is deprecated in favor of GREP_COLORS.}}<br />
<br />
The {{ic|GREP_COLOR}} environment variable can be used to define the default highlight color (the default is red). To change the color, find the needed [http://www.tldp.org/HOWTO/Bash-Prompt-HOWTO/x329.html ANSI escape sequence] and apply it with:<br />
<br />
export GREP_COLOR="1;32"<br />
<br />
The {{ic|-n}} option includes file line numbers in the output.<br />
<br />
=== less ===<br />
<br />
==== Environment variables ====<br />
<br />
Add the following lines to your shell configuration file:<br />
<br />
export LESS=-R<br />
export LESS_TERMCAP_mb=$'\E[1;31m' # begin blink<br />
export LESS_TERMCAP_md=$'\E[1;36m' # begin bold<br />
export LESS_TERMCAP_me=$'\E[0m' # reset bold/blink<br />
export LESS_TERMCAP_so=$'\E[01;44;33m' # begin reverse video<br />
export LESS_TERMCAP_se=$'\E[0m' # reset reverse video<br />
export LESS_TERMCAP_us=$'\E[1;32m' # begin underline<br />
export LESS_TERMCAP_ue=$'\E[0m' # reset underline<br />
# and so on<br />
<br />
Change the values ([[Wikipedia:ANSI escape code#Colors|ANSI escape code]]) as you like. [http://boredzo.org/blog/archives/2016-08-15/colorized-man-pages-understood-and-customized This blog post] and the page [[Bash/Prompt customization]] also help.<br />
<br />
{{note|The {{ic|LESS_TERMCAP_''xx''}} variables are currently undocumented in {{man|1|less}}. For a detailed explanation, see [http://unix.stackexchange.com/questions/108699/documentation-on-less-termcap-variables/108840#108840 this answer].}}<br />
<br />
==== Reading from stdin ====<br />
<br />
{{Note|It is recommended to add colored output through [[#Environment variables]] to your {{ic|~/.bashrc}} or {{ic|~/.zshrc}}, as the below is based on {{ic|1=export LESS=R}}}}<br />
<br />
When you run a command and pipe its [[Wikipedia:Standard output|standard output]] (''stdout'') to ''less'' for a paged view (e.g. {{ic|<nowiki>pacman -Qe | less</nowiki>}}), you may find that the output is no longer colored. This is usually because the program tries to detect if its ''stdout'' is an interactive terminal, in which case it prints colored text, and otherwise prints uncolored text. This is good behaviour when you want to redirect ''stdout'' to a file, e.g. {{ic|<nowiki>pacman -Qe > pkglst-backup.txt</nowiki>}}, but less suited when you want to view output in {{ic|less}}.<br />
<br />
Some programs provide an option to disable the interactive tty detection:<br />
<br />
# dmesg --color=always | less<br />
<br />
In case that the program does not provide any similar option, it is possible to trick the program into thinking its ''stdout'' is an interactive terminal with the following utilities:<br />
<br />
* {{App|ColorThis|Force colored output of a program by running it within a (group of) pty, support forwarding stdin.|https://github.com/Sasasu/ColorThis}}<br />
* {{App|stdoutisatty|A small program which catches the {{ic|isatty}} function call.|https://github.com/lilydjwg/stdoutisatty.|{{AUR|stdoutisatty-git}}}}<br />
:Example: {{ic|stdoutisatty ''program'' <nowiki>| less</nowiki>}}<br />
* {{App|unbuffer|A tclsh script comes with expect, it invokes desired program within a pty.|http://expect.sourceforge.net/example/unbuffer.man.html|{{Pkg|expect}}}}<br />
:Example: {{ic|unbuffer ''program'' <nowiki>| less</nowiki>}}<br />
<br />
Alternatively, using [http://zsh.sourceforge.net/Doc/Release/Zsh-Modules.html#The-zsh_002fzpty-Module zpty] module from [[zsh]]: [http://lilydjwg.is-programmer.com/2011/6/29/using-zpty-module-of-zsh.27677.html]<br />
<br />
{{hc|~/.zshrc|<nowiki><br />
zmodload zsh/zpty<br />
<br />
pty() {<br />
zpty pty-${UID} ${1+$@}<br />
if [[ ! -t 1 ]];then<br />
setopt local_traps<br />
trap '' INT<br />
fi<br />
zpty -r pty-${UID}<br />
zpty -d pty-${UID}<br />
}<br />
<br />
ptyless() {<br />
pty $@ | less<br />
}<br />
</nowiki>}}<br />
<br />
Usage:<br />
<br />
$ ptyless ''program''<br />
<br />
To pipe it to other pager (less in this example):<br />
<br />
$ pty ''program'' | less<br />
<br />
=== ls ===<br />
<br />
The {{ic|1=--color=auto}} option enables color highlighting. Color codes are emitted only on standard output; not in pipes or redirection.<br />
<br />
Use an [[alias]] to permanently enable this option:<br />
<br />
alias ls='ls --color=auto'<br />
<br />
The {{ic|LS_COLORS}} variable is used to define colors, and it configures various parts of highlighting. Use the {{man|1|dircolors}} command to set it.<br />
<br />
{{Note|Using the {{ic|--color}} option may incur a noticeable performance penalty when ''ls'' is run in a directory with very many entries. The default settings require ''ls'' to {{man|1|stat}} every single file it lists. However, if you would like most of the file-type coloring but can live without the other coloring options (e.g. executable, orphan, sticky, other-writable, capability), use ''dircolors'' to set the {{ic|LS_COLORS}} environment variable like this:<br />
<br />
<nowiki>eval $(dircolors -p | perl -pe 's/^((CAP|S[ET]|O[TR]|M|E)\w+).*/$1 00/' | dircolors -)</nowiki><br />
<br />
}}<br />
<br />
See {{man|1|ls}} for more information.<br />
<br />
=== man ===<br />
<br />
To enable colored {{Ic|man}}, two main pagers, {{Ic|less}} and {{Ic|most}}, are hacked here.<br />
<br />
==== Using less ====<br />
<br />
See [[#less]] for a more detailed description.<br />
<br />
For bash or zsh, add the following {{Ic|less}} wrapper function to {{ic|~/.bashrc}} or {{ic|~/.zshrc}}:<br />
<br />
{{bc|<nowiki><br />
man() {<br />
LESS_TERMCAP_md=$'\e[01;31m' \<br />
LESS_TERMCAP_me=$'\e[0m' \<br />
LESS_TERMCAP_se=$'\e[0m' \<br />
LESS_TERMCAP_so=$'\e[01;44;33m' \<br />
LESS_TERMCAP_ue=$'\e[0m' \<br />
LESS_TERMCAP_us=$'\e[01;32m' \<br />
command man "$@"<br />
}<br />
</nowiki>}}<br />
<br />
For [[Fish]] you could accomplish this with:<br />
<br />
{{hc|~/.config/fish/config.fish|<nowiki><br />
set -xU LESS_TERMCAP_md (printf "\e[01;31m")<br />
set -xU LESS_TERMCAP_me (printf "\e[0m")<br />
set -xU LESS_TERMCAP_se (printf "\e[0m")<br />
set -xU LESS_TERMCAP_so (printf "\e[01;44;33m")<br />
set -xU LESS_TERMCAP_ue (printf "\e[0m")<br />
set -xU LESS_TERMCAP_us (printf "\e[01;32m")<br />
</nowiki>}}<br />
<br />
Remember to source your config or restart your shell to make the changes take effect.<br />
<br />
==== Using most ====<br />
<br />
The basic function of 'most' is similar to {{Ic|less}} and {{Ic|more}}, but it has a smaller feature set. Configuring most to use colors is easier than using less, but additional configuration is necessary to make most behave like less.<br />
Install the {{Pkg|most}} package.<br />
<br />
Edit {{ic|/etc/man_db.conf}}, uncomment the pager definition and change it to:<br />
<br />
DEFINE pager most -s<br />
<br />
Test the new setup by typing:<br />
<br />
$ man whatever_man_page<br />
<br />
Modifying the color values requires editing {{ic|~/.mostrc}} (creating the file if it is not present) or editing {{ic|/etc/most.conf}} for system-wide changes. Example {{ic|~/.mostrc}}:<br />
<br />
% Color settings<br />
color normal lightgray black<br />
color status yellow blue<br />
color underline yellow black<br />
color overstrike brightblue black<br />
<br />
A list of all keybindings may be found at {{ic|/usr/share/doc/most/most-fun.txt}}. To get a basic {{ic|less}}/{{ic|vim}}-like configuration, you can copy {{ic|/usr/share/doc/most/lesskeys.rc}} to {{ic|~/.mostrc}}. The lesskeys rc included with most does not include 'g' or 'G', so you will also have to add these lines to {{ic|~/.mostrc}}:<br />
<br />
setkey bob "g"<br />
setkey eob "G"<br />
setkey page_down "d"<br />
setkey page_up "u"<br />
<br />
You may also want to set the {{ic|goto_line}} keybinding in the rc if you don't like the default of 'J'.<br />
<br />
Another example showing keybindings similar to {{Ic|less}} (jump to line is set to 'J'):<br />
<br />
% less-like keybindings<br />
unsetkey "^K"<br />
unsetkey "g"<br />
unsetkey "G"<br />
unsetkey ":"<br />
<br />
setkey next_file ":n"<br />
setkey find_file ":e"<br />
setkey next_file ":p"<br />
setkey toggle_options ":o"<br />
setkey toggle_case ":c"<br />
setkey delete_file ":d"<br />
setkey exit ":q"<br />
<br />
setkey bob "g"<br />
setkey eob "G"<br />
setkey down "e"<br />
setkey down "E"<br />
setkey down "j"<br />
setkey down "^N"<br />
setkey up "y"<br />
setkey up "^Y"<br />
setkey up "k"<br />
setkey up "^P"<br />
setkey up "^K"<br />
setkey page_down "f"<br />
setkey page_down "^F"<br />
setkey page_up "b"<br />
setkey page_up "^B"<br />
setkey other_window "z"<br />
setkey other_window "w"<br />
setkey search_backward "?"<br />
setkey bob "p"<br />
setkey goto_mark "'"<br />
setkey find_file "E"<br />
setkey edit "v"<br />
<br />
==== Using X resources ====<br />
<br />
A quick way to add color to manual pages viewed on {{Pkg|xterm}}/{{Ic|uxterm}} or {{Pkg|rxvt-unicode}} is to modify {{ic|~/.Xresources}}.<br />
<br />
===== xterm =====<br />
<br />
*VT100.colorBDMode: true<br />
*VT100.colorBD: red<br />
*VT100.colorULMode: true<br />
*VT100.colorUL: cyan<br />
<br />
which ''replaces'' the decorations with the colors. Also add:<br />
<br />
*VT100.veryBoldColors: 6<br />
<br />
if you want colors and decorations (bold or underline) ''at the same time''. See {{man|1|xterm}} for a description of the {{ic|veryBoldColors}} resource.<br />
<br />
===== rxvt-unicode =====<br />
<br />
URxvt.colorIT: #87af5f<br />
URxvt.colorBD: #d7d7d7<br />
URxvt.colorUL: #87afd7<br />
<br />
Run:<br />
<br />
$ xrdb -load ~/.Xresources<br />
<br />
Launch a new {{Ic|xterm/uxterm}} or {{Ic|rxvt-unicode}} and you should see colorful man pages.<br />
<br />
This combination puts colors to '''bold''' and <u>underlined</u> words in {{Ic|xterm/uxterm}} or to '''bold''', <u>underlined</u>, and ''italicized'' text in {{Ic|rxvt-unicode}}. You can play with different combinations of these attributes (see the [http://pub.ligatura.org/fs/xfree86/xresources/xterm sources]{{Dead link|2013|09|10}} of this item).<br />
<br />
=== pacman ===<br />
<br />
[[Pacman]] has a color option. Uncomment the {{ic|Color}} line in {{ic|/etc/pacman.conf}}.<br />
<br />
== Wrappers ==<br />
<br />
{{move||Some of these could be made into sections of their own, or moved to existing sections such as [[#diff]]}}<br />
<br />
=== Universal wrappers ===<br />
<br />
(most of them outdated but still functioning)<br />
<br />
They go with multiple preconfigured presets that can be changed, and new can be created/contributed.<br />
<br />
{{Warning|Wrappers replace output of commands with escape sequences. Some shell scripts and programs which use the output of standard shell utilities may work wrong. }}<br />
<br />
* {{App|rainbow|Colorize commands output or STDIN using patterns.<br>Presets: df, diff, env, host, ifconfig, java-stack-trace, jboss, jonas, md5sum, mvn2, mvn3, ping, tomcat, top, traceroute.|https://github.com/nicoulaj/rainbow|{{AUR|rainbow}}}}<br />
* {{App|grc|Yet another colouriser for beautifying your logfiles or output of commands.<br>Presets: cat, cvs, df, digg, gcc, g++, ls, ifconfig, make, mount, mtr, netstat, ping, ps, tail, traceroute, wdiff, blkid, du, dnf, docker, docker-machine, env, id, ip, iostat, last, lsattr, lsblk, lspci, lsmod, lsof, getfacl, getsebool, ulimit, uptime, nmap, fdisk, findmnt, free, semanage, sar, ss, sysctl, systemctl, stat, showmount, tune2fs and tcpdump.|https://github.com/pengwynn/grc|{{Pkg|grc}}}}<br />
* {{App|colorlogs|Colorize commands output or STDIN using patterns.<br>Presets: logs, git status, ant, maven.|https://github.com/memorius/colorlogs}}<br />
* {{App|cope|A colourful wrapper for terminal programs.<br>Presets: acpi, arp, cc, df, dprofpp, fdisk, free, g++, gcc, id, ifconfig, ls, lspci, lsusb, make, md5sum, mpc, netstat, nm, nmap, nocope, ping, pmap, ps, readelf, route, screen, sha1sum, sha224sum, sha256sum, sha384sum, sha512sum, shasum, socklist, stat, strace, tcpdump, tracepath, traceroute, w, wget, who, xrandr.|https://github.com/yogan/cope|{{AUR|cope-git}}}}<br />
* {{App|cw|A non-intrusive real-time ANSI color wrapper for common unix-based commands. Wraps {{Pkg|file}} which can cause issues,<br>Presets: arp, arping, auth.log@, blockdev, cal, cksum, clock, configure, cpuinfo@, crontab@, cw-pipe, cw-test.cgi, date, df, diff, dig, dmesg, du, env, figlet, file, find, finger, free, fstab@, fuser, g++, gcc, group@, groups, hdparm, hexdump, host, hosts@, id, ifconfig, inittab@, iptables, last, lastlog, lsattr, lsmod, lsof, ltrace-color, make, md5sum, meminfo@, messages@, mount, mpg123, netstat, nfsstat, nmap, nslookup, objdump, passwd@, ping, pmap, pmap_dump, praliases, profile@, protocols@, ps, pstree, quota, quotastats, resolv.conf@, route, routel, sdiff, services@, showmount, smbstatus, stat, strace-color, sysctl, syslog, tar, tcpdump, tracepath, traceroute, umount, uname, uptime, users, vmstat, w, wc, whereis, who, xferlog.|http://cwrapper.sourceforge.net/|{{AUR|cw}}}}<br />
* {{App|ccze|A fast log colorizer written in C, intended to be a drop-in replacement for colorize|https://github.com/cornet/ccze/|{{Pkg|ccze}}}}<br />
<br />
=== Libraries for colorizing an output ===<br />
<br />
* {{App|libtextstyle|A C library for styling text output to terminals|https://ftp.gnu.org/gnu/gettext/gettext-0.20.1.tar.gz}}<br />
* {{App|ruby-rainbow|Rainbow is extension to ruby's String class adding support for colorizing text on ANSI terminal|https://rubygems.org/gems/rainbow/|{{Pkg|ruby-rainbow}}}}<br />
* {{App|python-blessings|A thin, practical wrapper around terminal coloring, styling, and positioning|https://github.com/erikrose/blessings|{{Pkg|python-blessings}}, {{Pkg|python2-blessings}}}}<br />
* {{App|lolcat|Ruby program that makes the output colorful like a rainbow|https://github.com/busyloop/lolcat/|{{Pkg|lolcat}}}}<br />
<br />
=== Application specific ===<br />
<br />
==== Compilers ====<br />
<br />
* {{App|colorgcc|A Perl wrapper to colorize the output of compilers with warning/error messages matching the gcc output format|https://schlueters.de/colorgcc.html|{{Pkg|colorgcc}}}}<br />
<br />
==== diff ====<br />
<br />
Diff has [[#diff|built-in color output]], which is reasonable to use. But the following wrappers can be used:<br />
<br />
* {{App|colordiff|Perl script for ''diff'' highlighting.|http://www.colordiff.org/|{{Pkg|colordiff}}}}<br />
* {{App|cwdiff|''(w)diff'' wrapper with directories support and highlighting.|https://github.com/junghans/cwdiff|{{AUR|cwdiff}}, {{AUR|cwdiff-git}}}}<br />
<br />
==== less ====<br />
<br />
===== source-highlight =====<br />
<br />
You can enable code syntax coloring in ''less''. First, [[install]] {{Pkg|source-highlight}}, then add these lines to your shell configuration file:<br />
<br />
{{hc|~/.bashrc|<nowiki><br />
export LESSOPEN="| /usr/bin/source-highlight-esc.sh %s"<br />
export LESS='-R '<br />
</nowiki>}}<br />
<br />
===== lesspipe =====<br />
<br />
Frequent users of the command line interface might want to install {{Pkg|lesspipe}}.<br />
<br />
Users may now list the compressed files inside of an archive using their pager:<br />
<br />
{{hc|$ less ''compressed_file''.tar.gz|2=<br />
==> use tar_file:contained_file to view a file in the archive<br />
-rw------- ''username''/''group'' 695 2008-01-04 19:24 ''compressed_file''/''content1''<br />
-rw------- ''username''/''group'' 43 2007-11-07 11:17 ''compressed_file''/''content2''<br />
''compressed_file''.tar.gz (END)<br />
}}<br />
<br />
''lesspipe'' also grants ''less'' the ability of interfacing with files other than archives, serving as an alternative for the specific command associated for that file-type (such as viewing HTML via {{Pkg|python-html2text}}).<br />
<br />
Re-login after installing ''lesspipe'' in order to activate it, or source {{ic|/etc/profile.d/lesspipe.sh}}.<br />
<br />
==== Make ====<br />
<br />
* {{App|colormake|A simple wrapper around make to make its output more readable.|http://bre.klaki.net/programs/colormake/|{{AUR|colormake}}, {{AUR|colormake-git}}}}<br />
<br />
==== Ping ====<br />
<br />
* {{App|prettyping|Add some great features to ping monitoring. A wrapper around the standard ping tool with the objective of making the output prettier, more colorful, more compact, and easier to read.|http://denilson.sa.nom.br/prettyping/|{{Pkg|prettyping}}}}<br />
<br />
== Shells ==<br />
<br />
=== bash ===<br />
<br />
See [[Bash/Prompt customization#Colors]].<br />
<br />
=== zsh ===<br />
<br />
See [[Zsh#Colors]].<br />
<br />
=== Fish ===<br />
<br />
See [[Fish#Web interface]].<br />
<br />
== Terminal emulators ==<br />
<br />
=== Virtual console ===<br />
<br />
{{Style|Lacks clarity on what "the colors" are, i.e. in [[#Virtual console]] they are about the ''representations'' of the 16 base colors (RGB values for yellow, red, blue, etc.), while in [[#Login screen]] they are about the base colors themselves. See also {{man|4|console_codes}} and [[User:Isacdaavid/Linux_Console]]}}<br />
<br />
The colors in the [[w:Virtual console|Linux virtual console]] running on the framebuffer can be changed. This is done by writing the escape code {{ic|\\e]PXRRGGBB}}, where {{ic|X}} is the hexadecimal index of the color from 0-F, and {{ic|RRGGBB}} is a traditional hexadecimal RGB code. <br />
<br />
For example, to reuse existing colors defined in {{ic|~/.Xresources}}, add the following to the shell initialization file (such as {{ic|~/.bashrc}}):<br />
<br />
if [ "$TERM" = "linux" ]; then<br />
_SEDCMD='s/.*\*color\([0-9]\{1,\}\).*#\([0-9a-fA-F]\{6\}\).*/\1 \2/p'<br />
for i in $(sed -n "$_SEDCMD" $HOME/.Xresources | awk '$1 < 16 {printf "\\e]P%X%s", $1, $2}'); do<br />
echo -en "$i"<br />
done<br />
clear<br />
fi<br />
<br />
==== Login screen ====<br />
<br />
The below is a colored example of the virtual console login screen in {{ic|/etc/issue}}. Create a backup of the original file with {{ic|mv /etc/issue /etc/issue.bak}} as root, and create a new {{ic|/etc/issue}}:<br />
<br />
\e[H\e[2J<br />
\e[1;30m| \e[34m\r \s<br />
\e[36;1m/\\\\ \e[37m|| \e[36m| = \e[30m|<br />
\e[36m/ \\\\ \e[37m|| \e[36m| \e[30m| \e[32m\t<br />
\e[1;36m/ \e[0;36m.. \e[1m\\\\ \e[37m//==\\\\\\ ||/= /==\\\\ ||/=\\\\ \e[36m| | |/\\\\ | | \\\\ / \e[30m| \e[32m\d<br />
\e[0;36m/ . . \\\\ \e[37m|| || || || || || \e[36m| | | | | | X \e[1;30m|<br />
\e[0;36m/ . . \\\\ \e[37m\\\\\\==/| || \\\\==/ || || \e[36m| | | |\ \\/| / \\\\ \e[1;30m| \e[31m\U<br />
\e[0;36m/ .. .. \\\\ \e[0;37mA simple, lightweight linux distribution. \e[1;30m|<br />
\e[0;36m/_' `_\\\\ \e[1;30m| \e[35m\l \e[0mon \e[1;33m\n<br />
\e[0m <br />
<br />
<br />
See also:<br />
<br />
* https://bbs.archlinux.org/viewtopic.php?pid=386429#p386429<br />
* http://www.linuxfromscratch.org/blfs/view/svn/postlfs/logon.html<br />
<br />
=== X window system ===<br />
<br />
Most [[Xorg]] terminals, including [[xterm]] and [[urxvt]], support at least 16 basic colors. The colors 0-7 are the 'normal' colors. Colors 8-15 are their 'bright' counterparts, used for highlighting. These colors can be modified through [[X resources]], or through specific terminal settings. For example:<br />
<br />
{{hc|1=~/.Xresources|2=<br />
! Black + DarkGrey<br />
*color0: #000000<br />
*color8: #555753<br />
! DarkRed + Red<br />
*color1: #ff6565<br />
*color9: #ff8d8d<br />
! DarkGreen + Green<br />
*color2: #93d44f<br />
*color10: #c8e7a8<br />
! DarkYellow + Yellow<br />
*color3: #eab93d<br />
*color11: #ffc123<br />
! DarkBlue + Blue<br />
*color4: #204a87<br />
*color12: #3465a4<br />
! DarkMagenta + Magenta<br />
*color5: #ce5c00<br />
*color13: #f57900<br />
!DarkCyan + Cyan (both not tango)<br />
*color6: #89b6e2<br />
*color14: #46a4ff<br />
! LightGrey + White<br />
*color7: #cccccc<br />
*color15: #ffffff<br />
}}<br />
<br />
{{Warning|Color resources such as {{ic|foreground}} and {{ic|background}} can be read by other applications (such as [https://www.gnu.org/software/emacs/manual/html_node/emacs/Table-of-Resources.html emacs]). This can be avoided by specifiying the class name, for example {{ic|XTerm.foreground}}.}}<br />
<br />
See also:<br />
<br />
* [[#Using X resources]] for how to color bold and underlined text automatically.<br />
* [https://web.archive.org/web/20090130061234/http://phraktured.net/terminal-colors/ Color Themes] - Extensive list of terminal color themes by Phraktured.<br />
* [http://beta.andrewrcraig.us/index.php?page=xcolors Xcolors by dkeg]<br />
<br />
* [https://github.com/chriskempson/base16 base16 color schemes]<br />
<br />
=== Display all 256 colors ===<br />
<br />
Prints all 256 colors across the screen.<br />
<br />
$ (x=`tput op` y=`printf %76s`;for i in {0..256};do o=00$i;echo -e ${o:${#o}-3:3} `tput setaf $i;tput setab $i`${y// /=}$x;done)<br />
<br />
=== Display tput escape codes ===<br />
<br />
{{Merge|Bash/Prompt_customization|More context on ''tput'' is provided in that article}}<br />
<br />
Replace {{ic|tput op}} with whatever tput you want to trace. {{ic|op}} is the default foreground and background color.<br />
<br />
{{hc|<nowiki>$ ( strace -s5000 -e write tput op 2>&2 2>&1 ) | tee -a /dev/stderr | grep -o '"[^"]*"'</nowiki>|<br />
033[\033[1;34m"\33[39;49m"\033[00m<br />
}}<br />
<br />
=== Enumerate supported colors ===<br />
<br />
The following command will let you discover all the terminals you have terminfo support for, and the number of colors each terminal supports. The possible values are: 8, 15, 16, 52, 64, 88 and 256.<br />
<br />
{{hc|<nowiki>$ for T in `find /usr/share/terminfo -type f -printf '%f '`;do echo "$T `tput -T $T colors`";done|sort -nk2</nowiki>|<br />
Eterm-88color 88<br />
rxvt-88color 88<br />
xterm+88color 88<br />
xterm-88color 88<br />
Eterm-256color 256<br />
gnome-256color 256<br />
konsole-256color 256<br />
putty-256color 256<br />
rxvt-256color 256<br />
screen-256color 256<br />
screen-256color-bce 256<br />
screen-256color-bce-s 256<br />
screen-256color-s 256<br />
xterm+256color 256<br />
xterm-256color 256<br />
}}<br />
<br />
=== Enumerate terminal capabilities ===<br />
<br />
{{Merge|Bash/Prompt_customization|More context on ''tput'' is provided in that article}}<br />
<br />
This command is useful to see what features that are supported by your terminal.<br />
<br />
{{hc|<nowiki>$ infocmp -1 | tr -d '\0\t,' | cut -f1 -d'=' | grep -v "$TERM" | sort | column -c80</nowiki>|<br />
acsc ed kcuu1 kich1 rmso<br />
am el kDC kLFT rmul<br />
bce el1 kdch1 km rs1<br />
bel enacs kel kmous rs2<br />
blink eo kend knp s0ds<br />
bold flash kEND kNXT s1ds<br />
btns#5 fsl kent kpp s2ds<br />
bw home kf1 kPRV s3ds<br />
ccc hpa kf10 kRIT sc<br />
civis hs kf11 kslt setab<br />
clear ht kf12 lines#24 setaf<br />
cnorm hts kf13 lm#0 setb<br />
colors#0x100 ich kf14 mc0 setf<br />
cols#80 ich1 kf15 mc4 sgr<br />
cr il kf16 mc5 sgr0<br />
csr il1 kf17 mc5i sitm<br />
cub ind kf18 mir smacs<br />
cub1 indn kf19 msgr smam<br />
cud initc kf2 ncv#0 smcup<br />
cud1 is1 kf20 npc smir<br />
cuf is2 kf3 op smkx<br />
cuf1 it#8 kf4 pairs#0x7fff smso<br />
cup ka1 kf5 rc smul<br />
cuu ka3 kf6 rev tbc<br />
cuu1 kb2 kf7 ri tsl<br />
cvvis kbs kf8 rin u6<br />
dch kc1 kf9 ritm u7<br />
dch1 kc3 kfnd rmacs u8<br />
dl kcbt kFND rmam u9<br />
dl1 kcub1 kHOM rmcup vpa<br />
dsl kcud1 khome rmir xenl<br />
ech kcuf1 kIC rmkx xon<br />
<br />
}}<br />
<br />
=== Color scheme scripts ===<br />
<br />
See [https://paste.xinu.at/m-dAiJ/] for scripts which display a chart of your current terminal scheme.<br />
<br />
=== True color support ===<br />
<br />
Some terminals support the full range of 16 million colors (RGB, each with 8 bit resolution): xterm, konsole, st, etc. The corresponding TERM values {{ic|xterm-direct}}, {{ic|konsole-direct}}, {{ic|st-direct}}, etc. are supported starting with ncurses version 6.1 [http://lists.gnu.org/archive/html/bug-ncurses/2018-01/msg00045.html]. For more info about terminal emulators and applications that support true color, see [https://gist.github.com/XVilka/8346728].<br />
<br />
Note that the Linux kernel supports the SGR escape sequences for true-color, but it is pointless to use it, because the driver maps the 24-bit color specifications to a 256-colors color map in the kernel (see the functions {{ic|rgb_foreground}}, {{ic|rgb_background}}). For this reason, there is no terminfo entry {{ic|linux-direct}}.<br />
<br />
== See also ==<br />
<br />
* [https://gkbrk.com/2016/07/lolcat-clone-in-x64-assembly/ lolcat clone in x64 assembly]<br />
* [http://unix.stackexchange.com/a/147 Setting colors for less] and [http://unix.stackexchange.com/a/6357 solving related problems] (threads on StackExchange)</div>Cirrushttps://wiki.archlinux.org/index.php?title=Color_output_in_console&diff=596725Color output in console2020-02-03T14:50:13Z<p>Cirrus: added info to cw as i#ve experienced problems (as have others on BBS ) with cw wrapping file in colour codes,</p>
<hr />
<div>[[Category:Linux console]]<br />
[[Category:Eye candy]]<br />
[[ja:コンソールのカラー出力]]<br />
[[zh-hans:Color output in console]]<br />
{{Expansion|And maybe create something bigger. Please take active approach if you can add some valuable information. Mention {{Pkg|python-pywal}}.|Talk:Color output in console#Why and what this page is about}}<br />
{{Style|Page is partly a collection of information on different applications, partly begin to lay theory to color output process. Please contribute your knowledge, if you can.}}<br />
{{Related articles start}}<br />
{{Related|Emacs#Custom colors and theme}}<br />
{{Related|nano#Syntax highlighting}}<br />
{{Related articles end}}<br />
This page was created to consolidate colorization of CLI outputs.<br />
<br />
== Applications ==<br />
<br />
=== diff ===<br />
<br />
diffutils from version 3.4 includes the {{ic|--color}} option ([https://lists.gnu.org/archive/html/info-gnu/2016-08/msg00004.html GNU mailing list]).<br />
<br />
$ alias diff='diff --color=auto'<br />
<br />
=== grep ===<br />
<br />
The {{ic|1=--color=auto}} option enables color highlighting. Color codes are emitted only on standard output; not in pipes or redirection.<br />
<br />
Color output in ''grep'' is also useful with [[Wikipedia:regexp|regexp]] tasks.<br />
<br />
Use an [[alias]] to permanently enable this option:<br />
<br />
alias grep='grep --color=auto'<br />
<br />
The {{ic|GREP_COLORS}} variable is used to define colors, and it configures various parts of highlighting.<br />
<br />
See {{man|1|grep}} for more information.<br />
<br />
{{Out of date|GREP_COLOR is deprecated in favor of GREP_COLORS.}}<br />
<br />
The {{ic|GREP_COLOR}} environment variable can be used to define the default highlight color (the default is red). To change the color, find the needed [http://www.tldp.org/HOWTO/Bash-Prompt-HOWTO/x329.html ANSI escape sequence] and apply it with:<br />
<br />
export GREP_COLOR="1;32"<br />
<br />
The {{ic|-n}} option includes file line numbers in the output.<br />
<br />
=== less ===<br />
<br />
==== Environment variables ====<br />
<br />
Add the following lines to your shell configuration file:<br />
<br />
export LESS=-R<br />
export LESS_TERMCAP_mb=$'\E[1;31m' # begin blink<br />
export LESS_TERMCAP_md=$'\E[1;36m' # begin bold<br />
export LESS_TERMCAP_me=$'\E[0m' # reset bold/blink<br />
export LESS_TERMCAP_so=$'\E[01;44;33m' # begin reverse video<br />
export LESS_TERMCAP_se=$'\E[0m' # reset reverse video<br />
export LESS_TERMCAP_us=$'\E[1;32m' # begin underline<br />
export LESS_TERMCAP_ue=$'\E[0m' # reset underline<br />
# and so on<br />
<br />
Change the values ([[Wikipedia:ANSI escape code#Colors|ANSI escape code]]) as you like. [http://boredzo.org/blog/archives/2016-08-15/colorized-man-pages-understood-and-customized This blog post] and the page [[Bash/Prompt customization]] also help.<br />
<br />
{{note|The {{ic|LESS_TERMCAP_''xx''}} variables are currently undocumented in {{man|1|less}}. For a detailed explanation, see [http://unix.stackexchange.com/questions/108699/documentation-on-less-termcap-variables/108840#108840 this answer].}}<br />
<br />
==== Reading from stdin ====<br />
<br />
{{Note|It is recommended to add colored output through [[#Environment variables]] to your {{ic|~/.bashrc}} or {{ic|~/.zshrc}}, as the below is based on {{ic|1=export LESS=R}}}}<br />
<br />
When you run a command and pipe its [[Wikipedia:Standard output|standard output]] (''stdout'') to ''less'' for a paged view (e.g. {{ic|<nowiki>pacman -Qe | less</nowiki>}}), you may find that the output is no longer colored. This is usually because the program tries to detect if its ''stdout'' is an interactive terminal, in which case it prints colored text, and otherwise prints uncolored text. This is good behaviour when you want to redirect ''stdout'' to a file, e.g. {{ic|<nowiki>pacman -Qe > pkglst-backup.txt</nowiki>}}, but less suited when you want to view output in {{ic|less}}.<br />
<br />
Some programs provide an option to disable the interactive tty detection:<br />
<br />
# dmesg --color=always | less<br />
<br />
In case that the program does not provide any similar option, it is possible to trick the program into thinking its ''stdout'' is an interactive terminal with the following utilities:<br />
<br />
* {{App|ColorThis|Force colored output of a program by running it within a (group of) pty, support forwarding stdin.|https://github.com/Sasasu/ColorThis}}<br />
* {{App|stdoutisatty|A small program which catches the {{ic|isatty}} function call.|https://github.com/lilydjwg/stdoutisatty.|{{AUR|stdoutisatty-git}}}}<br />
:Example: {{ic|stdoutisatty ''program'' <nowiki>| less</nowiki>}}<br />
* {{App|unbuffer|A tclsh script comes with expect, it invokes desired program within a pty.|http://expect.sourceforge.net/example/unbuffer.man.html|{{Pkg|expect}}}}<br />
:Example: {{ic|unbuffer ''program'' <nowiki>| less</nowiki>}}<br />
<br />
Alternatively, using [http://zsh.sourceforge.net/Doc/Release/Zsh-Modules.html#The-zsh_002fzpty-Module zpty] module from [[zsh]]: [http://lilydjwg.is-programmer.com/2011/6/29/using-zpty-module-of-zsh.27677.html]<br />
<br />
{{hc|~/.zshrc|<nowiki><br />
zmodload zsh/zpty<br />
<br />
pty() {<br />
zpty pty-${UID} ${1+$@}<br />
if [[ ! -t 1 ]];then<br />
setopt local_traps<br />
trap '' INT<br />
fi<br />
zpty -r pty-${UID}<br />
zpty -d pty-${UID}<br />
}<br />
<br />
ptyless() {<br />
pty $@ | less<br />
}<br />
</nowiki>}}<br />
<br />
Usage:<br />
<br />
$ ptyless ''program''<br />
<br />
To pipe it to other pager (less in this example):<br />
<br />
$ pty ''program'' | less<br />
<br />
=== ls ===<br />
<br />
The {{ic|1=--color=auto}} option enables color highlighting. Color codes are emitted only on standard output; not in pipes or redirection.<br />
<br />
Use an [[alias]] to permanently enable this option:<br />
<br />
alias ls='ls --color=auto'<br />
<br />
The {{ic|LS_COLORS}} variable is used to define colors, and it configures various parts of highlighting. Use the {{man|1|dircolors}} command to set it.<br />
<br />
{{Note|Using the {{ic|--color}} option may incur a noticeable performance penalty when ''ls'' is run in a directory with very many entries. The default settings require ''ls'' to {{man|1|stat}} every single file it lists. However, if you would like most of the file-type coloring but can live without the other coloring options (e.g. executable, orphan, sticky, other-writable, capability), use ''dircolors'' to set the {{ic|LS_COLORS}} environment variable like this:<br />
<br />
<nowiki>eval $(dircolors -p | perl -pe 's/^((CAP|S[ET]|O[TR]|M|E)\w+).*/$1 00/' | dircolors -)</nowiki><br />
<br />
}}<br />
<br />
See {{man|1|ls}} for more information.<br />
<br />
=== man ===<br />
<br />
To enable colored {{Ic|man}}, two main pagers, {{Ic|less}} and {{Ic|most}}, are hacked here.<br />
<br />
==== Using less ====<br />
<br />
See [[#less]] for a more detailed description.<br />
<br />
For bash or zsh, add the following {{Ic|less}} wrapper function to {{ic|~/.bashrc}} or {{ic|~/.zshrc}}:<br />
<br />
{{bc|<nowiki><br />
man() {<br />
LESS_TERMCAP_md=$'\e[01;31m' \<br />
LESS_TERMCAP_me=$'\e[0m' \<br />
LESS_TERMCAP_se=$'\e[0m' \<br />
LESS_TERMCAP_so=$'\e[01;44;33m' \<br />
LESS_TERMCAP_ue=$'\e[0m' \<br />
LESS_TERMCAP_us=$'\e[01;32m' \<br />
command man "$@"<br />
}<br />
</nowiki>}}<br />
<br />
For [[Fish]] you could accomplish this with:<br />
<br />
{{hc|~/.config/fish/config.fish|<nowiki><br />
set -xU LESS_TERMCAP_md (printf "\e[01;31m")<br />
set -xU LESS_TERMCAP_me (printf "\e[0m")<br />
set -xU LESS_TERMCAP_se (printf "\e[0m")<br />
set -xU LESS_TERMCAP_so (printf "\e[01;44;33m")<br />
set -xU LESS_TERMCAP_ue (printf "\e[0m")<br />
set -xU LESS_TERMCAP_us (printf "\e[01;32m")<br />
</nowiki>}}<br />
<br />
Remember to source your config or restart your shell to make the changes take effect.<br />
<br />
==== Using most ====<br />
<br />
The basic function of 'most' is similar to {{Ic|less}} and {{Ic|more}}, but it has a smaller feature set. Configuring most to use colors is easier than using less, but additional configuration is necessary to make most behave like less.<br />
Install the {{Pkg|most}} package.<br />
<br />
Edit {{ic|/etc/man_db.conf}}, uncomment the pager definition and change it to:<br />
<br />
DEFINE pager most -s<br />
<br />
Test the new setup by typing:<br />
<br />
$ man whatever_man_page<br />
<br />
Modifying the color values requires editing {{ic|~/.mostrc}} (creating the file if it is not present) or editing {{ic|/etc/most.conf}} for system-wide changes. Example {{ic|~/.mostrc}}:<br />
<br />
% Color settings<br />
color normal lightgray black<br />
color status yellow blue<br />
color underline yellow black<br />
color overstrike brightblue black<br />
<br />
A list of all keybindings may be found at {{ic|/usr/share/doc/most/most-fun.txt}}. To get a basic {{ic|less}}/{{ic|vim}}-like configuration, you can copy {{ic|/usr/share/doc/most/lesskeys.rc}} to {{ic|~/.mostrc}}. The lesskeys rc included with most does not include 'g' or 'G', so you will also have to add these lines to {{ic|~/.mostrc}}:<br />
<br />
setkey bob "g"<br />
setkey eob "G"<br />
setkey page_down "d"<br />
setkey page_up "u"<br />
<br />
You may also want to set the {{ic|goto_line}} keybinding in the rc if you don't like the default of 'J'.<br />
<br />
Another example showing keybindings similar to {{Ic|less}} (jump to line is set to 'J'):<br />
<br />
% less-like keybindings<br />
unsetkey "^K"<br />
unsetkey "g"<br />
unsetkey "G"<br />
unsetkey ":"<br />
<br />
setkey next_file ":n"<br />
setkey find_file ":e"<br />
setkey next_file ":p"<br />
setkey toggle_options ":o"<br />
setkey toggle_case ":c"<br />
setkey delete_file ":d"<br />
setkey exit ":q"<br />
<br />
setkey bob "g"<br />
setkey eob "G"<br />
setkey down "e"<br />
setkey down "E"<br />
setkey down "j"<br />
setkey down "^N"<br />
setkey up "y"<br />
setkey up "^Y"<br />
setkey up "k"<br />
setkey up "^P"<br />
setkey up "^K"<br />
setkey page_down "f"<br />
setkey page_down "^F"<br />
setkey page_up "b"<br />
setkey page_up "^B"<br />
setkey other_window "z"<br />
setkey other_window "w"<br />
setkey search_backward "?"<br />
setkey bob "p"<br />
setkey goto_mark "'"<br />
setkey find_file "E"<br />
setkey edit "v"<br />
<br />
==== Using X resources ====<br />
<br />
A quick way to add color to manual pages viewed on {{Pkg|xterm}}/{{Ic|uxterm}} or {{Pkg|rxvt-unicode}} is to modify {{ic|~/.Xresources}}.<br />
<br />
===== xterm =====<br />
<br />
*VT100.colorBDMode: true<br />
*VT100.colorBD: red<br />
*VT100.colorULMode: true<br />
*VT100.colorUL: cyan<br />
<br />
which ''replaces'' the decorations with the colors. Also add:<br />
<br />
*VT100.veryBoldColors: 6<br />
<br />
if you want colors and decorations (bold or underline) ''at the same time''. See {{man|1|xterm}} for a description of the {{ic|veryBoldColors}} resource.<br />
<br />
===== rxvt-unicode =====<br />
<br />
URxvt.colorIT: #87af5f<br />
URxvt.colorBD: #d7d7d7<br />
URxvt.colorUL: #87afd7<br />
<br />
Run:<br />
<br />
$ xrdb -load ~/.Xresources<br />
<br />
Launch a new {{Ic|xterm/uxterm}} or {{Ic|rxvt-unicode}} and you should see colorful man pages.<br />
<br />
This combination puts colors to '''bold''' and <u>underlined</u> words in {{Ic|xterm/uxterm}} or to '''bold''', <u>underlined</u>, and ''italicized'' text in {{Ic|rxvt-unicode}}. You can play with different combinations of these attributes (see the [http://pub.ligatura.org/fs/xfree86/xresources/xterm sources]{{Dead link|2013|09|10}} of this item).<br />
<br />
=== pacman ===<br />
<br />
[[Pacman]] has a color option. Uncomment the {{ic|Color}} line in {{ic|/etc/pacman.conf}}.<br />
<br />
== Wrappers ==<br />
<br />
{{move||Some of these could be made into sections of their own, or moved to existing sections such as [[#diff]]}}<br />
<br />
=== Universal wrappers ===<br />
<br />
(most of them outdated but still functioning)<br />
<br />
They go with multiple preconfigured presets that can be changed, and new can be created/contributed.<br />
<br />
{{Warning|Wrappers replace output of commands with escape sequences. Some shell scripts and programs which use the output of standard shell utilities may work wrong. }}<br />
<br />
* {{App|rainbow|Colorize commands output or STDIN using patterns.<br>Presets: df, diff, env, host, ifconfig, java-stack-trace, jboss, jonas, md5sum, mvn2, mvn3, ping, tomcat, top, traceroute.|https://github.com/nicoulaj/rainbow|{{AUR|rainbow}}}}<br />
* {{App|grc|Yet another colouriser for beautifying your logfiles or output of commands.<br>Presets: cat, cvs, df, digg, gcc, g++, ls, ifconfig, make, mount, mtr, netstat, ping, ps, tail, traceroute, wdiff, blkid, du, dnf, docker, docker-machine, env, id, ip, iostat, last, lsattr, lsblk, lspci, lsmod, lsof, getfacl, getsebool, ulimit, uptime, nmap, fdisk, findmnt, free, semanage, sar, ss, sysctl, systemctl, stat, showmount, tune2fs and tcpdump.|https://github.com/pengwynn/grc|{{Pkg|grc}}}}<br />
* {{App|colorlogs|Colorize commands output or STDIN using patterns.<br>Presets: logs, git status, ant, maven.|https://github.com/memorius/colorlogs}}<br />
* {{App|cope|A colourful wrapper for terminal programs.<br>Presets: acpi, arp, cc, df, dprofpp, fdisk, free, g++, gcc, id, ifconfig, ls, lspci, lsusb, make, md5sum, mpc, netstat, nm, nmap, nocope, ping, pmap, ps, readelf, route, screen, sha1sum, sha224sum, sha256sum, sha384sum, sha512sum, shasum, socklist, stat, strace, tcpdump, tracepath, traceroute, w, wget, who, xrandr.|https://github.com/yogan/cope|{{AUR|cope-git}}}}<br />
* {{App|cw|A non-intrusive real-time ANSI color wrapper for common unix-based commands. wraps {{Pkg|file}} which can cause issues,<br>Presets: arp, arping, auth.log@, blockdev, cal, cksum, clock, configure, cpuinfo@, crontab@, cw-pipe, cw-test.cgi, date, df, diff, dig, dmesg, du, env, figlet, file, find, finger, free, fstab@, fuser, g++, gcc, group@, groups, hdparm, hexdump, host, hosts@, id, ifconfig, inittab@, iptables, last, lastlog, lsattr, lsmod, lsof, ltrace-color, make, md5sum, meminfo@, messages@, mount, mpg123, netstat, nfsstat, nmap, nslookup, objdump, passwd@, ping, pmap, pmap_dump, praliases, profile@, protocols@, ps, pstree, quota, quotastats, resolv.conf@, route, routel, sdiff, services@, showmount, smbstatus, stat, strace-color, sysctl, syslog, tar, tcpdump, tracepath, traceroute, umount, uname, uptime, users, vmstat, w, wc, whereis, who, xferlog.|http://cwrapper.sourceforge.net/|{{AUR|cw}}}}<br />
* {{App|ccze|A fast log colorizer written in C, intended to be a drop-in replacement for colorize|https://github.com/cornet/ccze/|{{Pkg|ccze}}}}<br />
<br />
=== Libraries for colorizing an output ===<br />
<br />
* {{App|libtextstyle|A C library for styling text output to terminals|https://ftp.gnu.org/gnu/gettext/gettext-0.20.1.tar.gz}}<br />
* {{App|ruby-rainbow|Rainbow is extension to ruby's String class adding support for colorizing text on ANSI terminal|https://rubygems.org/gems/rainbow/|{{Pkg|ruby-rainbow}}}}<br />
* {{App|python-blessings|A thin, practical wrapper around terminal coloring, styling, and positioning|https://github.com/erikrose/blessings|{{Pkg|python-blessings}}, {{Pkg|python2-blessings}}}}<br />
* {{App|lolcat|Ruby program that makes the output colorful like a rainbow|https://github.com/busyloop/lolcat/|{{Pkg|lolcat}}}}<br />
<br />
=== Application specific ===<br />
<br />
==== Compilers ====<br />
<br />
* {{App|colorgcc|A Perl wrapper to colorize the output of compilers with warning/error messages matching the gcc output format|https://schlueters.de/colorgcc.html|{{Pkg|colorgcc}}}}<br />
<br />
==== diff ====<br />
<br />
Diff has [[#diff|built-in color output]], which is reasonable to use. But the following wrappers can be used:<br />
<br />
* {{App|colordiff|Perl script for ''diff'' highlighting.|http://www.colordiff.org/|{{Pkg|colordiff}}}}<br />
* {{App|cwdiff|''(w)diff'' wrapper with directories support and highlighting.|https://github.com/junghans/cwdiff|{{AUR|cwdiff}}, {{AUR|cwdiff-git}}}}<br />
<br />
==== less ====<br />
<br />
===== source-highlight =====<br />
<br />
You can enable code syntax coloring in ''less''. First, [[install]] {{Pkg|source-highlight}}, then add these lines to your shell configuration file:<br />
<br />
{{hc|~/.bashrc|<nowiki><br />
export LESSOPEN="| /usr/bin/source-highlight-esc.sh %s"<br />
export LESS='-R '<br />
</nowiki>}}<br />
<br />
===== lesspipe =====<br />
<br />
Frequent users of the command line interface might want to install {{Pkg|lesspipe}}.<br />
<br />
Users may now list the compressed files inside of an archive using their pager:<br />
<br />
{{hc|$ less ''compressed_file''.tar.gz|2=<br />
==> use tar_file:contained_file to view a file in the archive<br />
-rw------- ''username''/''group'' 695 2008-01-04 19:24 ''compressed_file''/''content1''<br />
-rw------- ''username''/''group'' 43 2007-11-07 11:17 ''compressed_file''/''content2''<br />
''compressed_file''.tar.gz (END)<br />
}}<br />
<br />
''lesspipe'' also grants ''less'' the ability of interfacing with files other than archives, serving as an alternative for the specific command associated for that file-type (such as viewing HTML via {{Pkg|python-html2text}}).<br />
<br />
Re-login after installing ''lesspipe'' in order to activate it, or source {{ic|/etc/profile.d/lesspipe.sh}}.<br />
<br />
==== Make ====<br />
<br />
* {{App|colormake|A simple wrapper around make to make its output more readable.|http://bre.klaki.net/programs/colormake/|{{AUR|colormake}}, {{AUR|colormake-git}}}}<br />
<br />
==== Ping ====<br />
<br />
* {{App|prettyping|Add some great features to ping monitoring. A wrapper around the standard ping tool with the objective of making the output prettier, more colorful, more compact, and easier to read.|http://denilson.sa.nom.br/prettyping/|{{Pkg|prettyping}}}}<br />
<br />
== Shells ==<br />
<br />
=== bash ===<br />
<br />
See [[Bash/Prompt customization#Colors]].<br />
<br />
=== zsh ===<br />
<br />
See [[Zsh#Colors]].<br />
<br />
=== Fish ===<br />
<br />
See [[Fish#Web interface]].<br />
<br />
== Terminal emulators ==<br />
<br />
=== Virtual console ===<br />
<br />
{{Style|Lacks clarity on what "the colors" are, i.e. in [[#Virtual console]] they are about the ''representations'' of the 16 base colors (RGB values for yellow, red, blue, etc.), while in [[#Login screen]] they are about the base colors themselves. See also {{man|4|console_codes}} and [[User:Isacdaavid/Linux_Console]]}}<br />
<br />
The colors in the [[w:Virtual console|Linux virtual console]] running on the framebuffer can be changed. This is done by writing the escape code {{ic|\\e]PXRRGGBB}}, where {{ic|X}} is the hexadecimal index of the color from 0-F, and {{ic|RRGGBB}} is a traditional hexadecimal RGB code. <br />
<br />
For example, to reuse existing colors defined in {{ic|~/.Xresources}}, add the following to the shell initialization file (such as {{ic|~/.bashrc}}):<br />
<br />
if [ "$TERM" = "linux" ]; then<br />
_SEDCMD='s/.*\*color\([0-9]\{1,\}\).*#\([0-9a-fA-F]\{6\}\).*/\1 \2/p'<br />
for i in $(sed -n "$_SEDCMD" $HOME/.Xresources | awk '$1 < 16 {printf "\\e]P%X%s", $1, $2}'); do<br />
echo -en "$i"<br />
done<br />
clear<br />
fi<br />
<br />
==== Login screen ====<br />
<br />
The below is a colored example of the virtual console login screen in {{ic|/etc/issue}}. Create a backup of the original file with {{ic|mv /etc/issue /etc/issue.bak}} as root, and create a new {{ic|/etc/issue}}:<br />
<br />
\e[H\e[2J<br />
\e[1;30m| \e[34m\r \s<br />
\e[36;1m/\\\\ \e[37m|| \e[36m| = \e[30m|<br />
\e[36m/ \\\\ \e[37m|| \e[36m| \e[30m| \e[32m\t<br />
\e[1;36m/ \e[0;36m.. \e[1m\\\\ \e[37m//==\\\\\\ ||/= /==\\\\ ||/=\\\\ \e[36m| | |/\\\\ | | \\\\ / \e[30m| \e[32m\d<br />
\e[0;36m/ . . \\\\ \e[37m|| || || || || || \e[36m| | | | | | X \e[1;30m|<br />
\e[0;36m/ . . \\\\ \e[37m\\\\\\==/| || \\\\==/ || || \e[36m| | | |\ \\/| / \\\\ \e[1;30m| \e[31m\U<br />
\e[0;36m/ .. .. \\\\ \e[0;37mA simple, lightweight linux distribution. \e[1;30m|<br />
\e[0;36m/_' `_\\\\ \e[1;30m| \e[35m\l \e[0mon \e[1;33m\n<br />
\e[0m <br />
<br />
<br />
See also:<br />
<br />
* https://bbs.archlinux.org/viewtopic.php?pid=386429#p386429<br />
* http://www.linuxfromscratch.org/blfs/view/svn/postlfs/logon.html<br />
<br />
=== X window system ===<br />
<br />
Most [[Xorg]] terminals, including [[xterm]] and [[urxvt]], support at least 16 basic colors. The colors 0-7 are the 'normal' colors. Colors 8-15 are their 'bright' counterparts, used for highlighting. These colors can be modified through [[X resources]], or through specific terminal settings. For example:<br />
<br />
{{hc|1=~/.Xresources|2=<br />
! Black + DarkGrey<br />
*color0: #000000<br />
*color8: #555753<br />
! DarkRed + Red<br />
*color1: #ff6565<br />
*color9: #ff8d8d<br />
! DarkGreen + Green<br />
*color2: #93d44f<br />
*color10: #c8e7a8<br />
! DarkYellow + Yellow<br />
*color3: #eab93d<br />
*color11: #ffc123<br />
! DarkBlue + Blue<br />
*color4: #204a87<br />
*color12: #3465a4<br />
! DarkMagenta + Magenta<br />
*color5: #ce5c00<br />
*color13: #f57900<br />
!DarkCyan + Cyan (both not tango)<br />
*color6: #89b6e2<br />
*color14: #46a4ff<br />
! LightGrey + White<br />
*color7: #cccccc<br />
*color15: #ffffff<br />
}}<br />
<br />
{{Warning|Color resources such as {{ic|foreground}} and {{ic|background}} can be read by other applications (such as [https://www.gnu.org/software/emacs/manual/html_node/emacs/Table-of-Resources.html emacs]). This can be avoided by specifiying the class name, for example {{ic|XTerm.foreground}}.}}<br />
<br />
See also:<br />
<br />
* [[#Using X resources]] for how to color bold and underlined text automatically.<br />
* [https://web.archive.org/web/20090130061234/http://phraktured.net/terminal-colors/ Color Themes] - Extensive list of terminal color themes by Phraktured.<br />
* [http://beta.andrewrcraig.us/index.php?page=xcolors Xcolors by dkeg]<br />
<br />
* [https://github.com/chriskempson/base16 base16 color schemes]<br />
<br />
=== Display all 256 colors ===<br />
<br />
Prints all 256 colors across the screen.<br />
<br />
$ (x=`tput op` y=`printf %76s`;for i in {0..256};do o=00$i;echo -e ${o:${#o}-3:3} `tput setaf $i;tput setab $i`${y// /=}$x;done)<br />
<br />
=== Display tput escape codes ===<br />
<br />
{{Merge|Bash/Prompt_customization|More context on ''tput'' is provided in that article}}<br />
<br />
Replace {{ic|tput op}} with whatever tput you want to trace. {{ic|op}} is the default foreground and background color.<br />
<br />
{{hc|<nowiki>$ ( strace -s5000 -e write tput op 2>&2 2>&1 ) | tee -a /dev/stderr | grep -o '"[^"]*"'</nowiki>|<br />
033[\033[1;34m"\33[39;49m"\033[00m<br />
}}<br />
<br />
=== Enumerate supported colors ===<br />
<br />
The following command will let you discover all the terminals you have terminfo support for, and the number of colors each terminal supports. The possible values are: 8, 15, 16, 52, 64, 88 and 256.<br />
<br />
{{hc|<nowiki>$ for T in `find /usr/share/terminfo -type f -printf '%f '`;do echo "$T `tput -T $T colors`";done|sort -nk2</nowiki>|<br />
Eterm-88color 88<br />
rxvt-88color 88<br />
xterm+88color 88<br />
xterm-88color 88<br />
Eterm-256color 256<br />
gnome-256color 256<br />
konsole-256color 256<br />
putty-256color 256<br />
rxvt-256color 256<br />
screen-256color 256<br />
screen-256color-bce 256<br />
screen-256color-bce-s 256<br />
screen-256color-s 256<br />
xterm+256color 256<br />
xterm-256color 256<br />
}}<br />
<br />
=== Enumerate terminal capabilities ===<br />
<br />
{{Merge|Bash/Prompt_customization|More context on ''tput'' is provided in that article}}<br />
<br />
This command is useful to see what features that are supported by your terminal.<br />
<br />
{{hc|<nowiki>$ infocmp -1 | tr -d '\0\t,' | cut -f1 -d'=' | grep -v "$TERM" | sort | column -c80</nowiki>|<br />
acsc ed kcuu1 kich1 rmso<br />
am el kDC kLFT rmul<br />
bce el1 kdch1 km rs1<br />
bel enacs kel kmous rs2<br />
blink eo kend knp s0ds<br />
bold flash kEND kNXT s1ds<br />
btns#5 fsl kent kpp s2ds<br />
bw home kf1 kPRV s3ds<br />
ccc hpa kf10 kRIT sc<br />
civis hs kf11 kslt setab<br />
clear ht kf12 lines#24 setaf<br />
cnorm hts kf13 lm#0 setb<br />
colors#0x100 ich kf14 mc0 setf<br />
cols#80 ich1 kf15 mc4 sgr<br />
cr il kf16 mc5 sgr0<br />
csr il1 kf17 mc5i sitm<br />
cub ind kf18 mir smacs<br />
cub1 indn kf19 msgr smam<br />
cud initc kf2 ncv#0 smcup<br />
cud1 is1 kf20 npc smir<br />
cuf is2 kf3 op smkx<br />
cuf1 it#8 kf4 pairs#0x7fff smso<br />
cup ka1 kf5 rc smul<br />
cuu ka3 kf6 rev tbc<br />
cuu1 kb2 kf7 ri tsl<br />
cvvis kbs kf8 rin u6<br />
dch kc1 kf9 ritm u7<br />
dch1 kc3 kfnd rmacs u8<br />
dl kcbt kFND rmam u9<br />
dl1 kcub1 kHOM rmcup vpa<br />
dsl kcud1 khome rmir xenl<br />
ech kcuf1 kIC rmkx xon<br />
<br />
}}<br />
<br />
=== Color scheme scripts ===<br />
<br />
See [https://paste.xinu.at/m-dAiJ/] for scripts which display a chart of your current terminal scheme.<br />
<br />
=== True color support ===<br />
<br />
Some terminals support the full range of 16 million colors (RGB, each with 8 bit resolution): xterm, konsole, st, etc. The corresponding TERM values {{ic|xterm-direct}}, {{ic|konsole-direct}}, {{ic|st-direct}}, etc. are supported starting with ncurses version 6.1 [http://lists.gnu.org/archive/html/bug-ncurses/2018-01/msg00045.html]. For more info about terminal emulators and applications that support true color, see [https://gist.github.com/XVilka/8346728].<br />
<br />
Note that the Linux kernel supports the SGR escape sequences for true-color, but it is pointless to use it, because the driver maps the 24-bit color specifications to a 256-colors color map in the kernel (see the functions {{ic|rgb_foreground}}, {{ic|rgb_background}}). For this reason, there is no terminfo entry {{ic|linux-direct}}.<br />
<br />
== See also ==<br />
<br />
* [https://gkbrk.com/2016/07/lolcat-clone-in-x64-assembly/ lolcat clone in x64 assembly]<br />
* [http://unix.stackexchange.com/a/147 Setting colors for less] and [http://unix.stackexchange.com/a/6357 solving related problems] (threads on StackExchange)</div>Cirrushttps://wiki.archlinux.org/index.php?title=Streamlink&diff=596554Streamlink2020-02-01T13:39:46Z<p>Cirrus: </p>
<hr />
<div>[[Category:Streaming]]<br />
[[Category:Download utilities]]<br />
[[ja:Streamlink]]<br />
[https://github.com/streamlink/streamlink Streamlink] is a command-line utility written in [[Python]] which allows you to watch online video streams in popular video players, such as [[VLC]], [[MPlayer]] or [[mpv]]; see [https://streamlink.github.io/players.html#player-compatibility Player compatibility] for the full list.<br />
<br />
This project was forked from [https://github.com/chrippa/livestreamer Livestreamer], which is no longer maintained.<br />
<br />
Support for various streaming services is provided by plugins, which can be easily added if needed. A lot of popular video streaming services are supported out of the box, including Dailymotion, Livestream, Twitch, UStream, YouTube Live and many more; see [https://streamlink.github.io/plugin_matrix.html Plugins] for the full list.<br />
<br />
== Installation ==<br />
<br />
[[Install]] the {{Pkg|streamlink}} package or {{AUR|streamlink-git}}.<br />
<br />
== Usage ==<br />
<br />
The package provides a ''streamlink'' command-line utility, which is quite easy to use:<br />
<br />
$ streamlink -p ''your_player'' ''url'' ''stream''<br />
<br />
* {{ic|your_player}} — name of executable of your media player, for example, {{ic|vlc}}. You can also specify a full path if needed: {{ic|/usr/bin/vlc}}. By default, VLC will be used if it can be found in its default location.<br />
* {{ic|url}} — URL address of a stream. You can omit protocol ({{ic|http://}}) for HTTP URLs.<br />
* {{ic|stream}} — stream to play by given URL. Primarily, you can select the video quality with this option. Use {{ic|best}} for highest and {{ic|worst}} for lowest quality available. Specific plugins may have additional quality options.<br />
<br />
For example:<br />
<br />
$ streamlink -p mpv dailymotion.com/embed/video/x1b1h6o worst<br />
<br />
See the {{ic|streamlink (1)}} [[man page]] for the full list of available options.<br />
<br />
<br />
To save a stream to your HDD<br />
<br />
$ streamlink -o ~/$current_time.m2t "STREAM URL" best,high<br />
<br />
=== Twitch ===<br />
<br />
$ streamlink -p ''player'' twitch.tv/''name_of_channel'' ''quality''<br />
<br />
For example:<br />
<br />
$ streamlink -p vlc twitch.tv/archlinux medium<br />
<br />
Available stream qualities are: {{ic|source}}, {{ic|high}}, {{ic|medium}}, {{ic|low}} and {{ic|mobile}}.<br />
<br />
<br />
==== Authenticating With OAuth ====<br />
<br />
$ streamlink --twitch-oauth-authenticate<br />
<br />
This command will open a web browser with further instructions on authenticating with twitch.<br />
<br />
The instructions only offer documentation for a configuration file, if you prefer not to use a configuration file, you can use:<br />
<br />
$ streamlink twitch.tv/''channel'' --twitch-oauth-token ''YourOAuthToken''<br />
<br />
Where ''YourOAuthToken'' is the OAuth token you received in the previous step.<br />
<br />
== See also ==<br />
<br />
* [https://github.com/streamlink/streamlink Streamlink repository on GitHub]<br />
* [https://streamlink.github.io/ Streamlink documentation]</div>Cirrushttps://wiki.archlinux.org/index.php?title=Streamlink&diff=596552Streamlink2020-02-01T13:36:52Z<p>Cirrus: </p>
<hr />
<div>[[Category:Streaming]]<br />
[[Category:Download utilities]]<br />
[[ja:Streamlink]]<br />
[https://github.com/streamlink/streamlink Streamlink] is a command-line utility written in [[Python]] which allows you to watch online video streams in popular video players, such as [[VLC]], [[MPlayer]] or [[mpv]]; see [https://streamlink.github.io/players.html#player-compatibility Player compatibility] for the full list.<br />
<br />
This project was forked from [https://github.com/chrippa/livestreamer Livestreamer], which is no longer maintained.<br />
<br />
Support for various streaming services is provided by plugins, which can be easily added if needed. A lot of popular video streaming services are supported out of the box, including Dailymotion, Livestream, Twitch, UStream, YouTube Live and many more; see [https://streamlink.github.io/plugin_matrix.html Plugins] for the full list.<br />
<br />
== Installation ==<br />
<br />
[[Install]] the {{Pkg|streamlink}} package or {{AUR|streamlink-git}}.<br />
<br />
== Usage ==<br />
<br />
The package provides a ''streamlink'' command-line utility, which is quite easy to use:<br />
<br />
$ streamlink -p ''your_player'' ''url'' ''stream''<br />
<br />
* {{ic|your_player}} — name of executable of your media player, for example, {{ic|vlc}}. You can also specify a full path if needed: {{ic|/usr/bin/vlc}}. By default, VLC will be used if it can be found in its default location.<br />
* {{ic|url}} — URL address of a stream. You can omit protocol ({{ic|http://}}) for HTTP URLs.<br />
* {{ic|stream}} — stream to play by given URL. Primarily, you can select the video quality with this option. Use {{ic|best}} for highest and {{ic|worst}} for lowest quality available. Specific plugins may have additional quality options.<br />
<br />
For example:<br />
<br />
$ streamlink -p mpv dailymotion.com/embed/video/x1b1h6o worst<br />
<br />
See the {{ic|streamlink (1)}} [[man page]] for the full list of available options.<br />
<br />
<br />
To save a stream to your HDD<br />
<br />
$ streamlink -o ~/$current_time.m2t "STREAM URL" best,high<br />
<br />
=== Twitch ===<br />
<br />
$ streamlink -p ''player'' twitch.tv/''name_of_channel'' ''quality''<br />
<br />
For example:<br />
<br />
$ streamlink -p vlc twitch.tv/archlinux medium<br />
<br />
Available stream qualities are: {{ic|source}}, {{ic|high}}, {{ic|medium}}, {{ic|low}} and {{ic|mobile}}.<br />
<br />
<br />
==== Authenticating With OAuth ====<br />
<br />
$ streamlink --twitch-oauth-authenticate<br />
<br />
This command will open a web browser with further instructions on authenticating with twitch.<br />
<br />
The instructions only offer documentation for a configuration file, if you prefer not to use a configuration file, you can use:<br />
<br />
$ streamlink twitch.tv/''channel'' --twitch-oauth-token ''YourOAuthToken''<br />
<br />
Where ''YourOAuthToken'' is the OAuth token you received in the previous step.<br />
<br />
== See also ==<br />
<br />
* [https://github.com/streamlink/streamlink Streamlink repository on GitHub]<br />
* [https://streamlink.github.io/ Streamlink documentation]</div>Cirrushttps://wiki.archlinux.org/index.php?title=Streamlink&diff=596551Streamlink2020-02-01T13:32:33Z<p>Cirrus: just added info on how to save stream locally</p>
<hr />
<div>[[Category:Streaming]]<br />
[[Category:Download utilities]]<br />
[[ja:Streamlink]]<br />
[https://github.com/streamlink/streamlink Streamlink] is a command-line utility written in [[Python]] which allows you to watch online video streams in popular video players, such as [[VLC]], [[MPlayer]] or [[mpv]]; see [https://streamlink.github.io/players.html#player-compatibility Player compatibility] for the full list.<br />
<br />
This project was forked from [https://github.com/chrippa/livestreamer Livestreamer], which is no longer maintained.<br />
<br />
Support for various streaming services is provided by plugins, which can be easily added if needed. A lot of popular video streaming services are supported out of the box, including Dailymotion, Livestream, Twitch, UStream, YouTube Live and many more; see [https://streamlink.github.io/plugin_matrix.html Plugins] for the full list.<br />
<br />
== Installation ==<br />
<br />
[[Install]] the {{Pkg|streamlink}} package or {{AUR|streamlink-git}}.<br />
<br />
== Usage ==<br />
<br />
The package provides a ''streamlink'' command-line utility, which is quite easy to use:<br />
<br />
$ streamlink -p ''your_player'' ''url'' ''stream''<br />
<br />
* {{ic|your_player}} — name of executable of your media player, for example, {{ic|vlc}}. You can also specify a full path if needed: {{ic|/usr/bin/vlc}}. By default, VLC will be used if it can be found in its default location.<br />
* {{ic|url}} — URL address of a stream. You can omit protocol ({{ic|http://}}) for HTTP URLs.<br />
* {{ic|stream}} — stream to play by given URL. Primarily, you can select the video quality with this option. Use {{ic|best}} for highest and {{ic|worst}} for lowest quality available. Specific plugins may have additional quality options.<br />
<br />
For example:<br />
<br />
$ streamlink -p mpv dailymotion.com/embed/video/x1b1h6o worst<br />
<br />
See the {{ic|streamlink (1)}} [[man page]] for the full list of available options.<br />
<br />
=== Twitch ===<br />
<br />
$ streamlink -p ''player'' twitch.tv/''name_of_channel'' ''quality''<br />
<br />
For example:<br />
<br />
$ streamlink -p vlc twitch.tv/archlinux medium<br />
<br />
Available stream qualities are: {{ic|source}}, {{ic|high}}, {{ic|medium}}, {{ic|low}} and {{ic|mobile}}.<br />
<br />
<br />
To save a stream to your HDD<br />
<br />
$ streamlink -o ~/$current_time.m2t "STREAM URL" best,high<br />
<br />
==== Authenticating With OAuth ====<br />
<br />
$ streamlink --twitch-oauth-authenticate<br />
<br />
This command will open a web browser with further instructions on authenticating with twitch.<br />
<br />
The instructions only offer documentation for a configuration file, if you prefer not to use a configuration file, you can use:<br />
<br />
$ streamlink twitch.tv/''channel'' --twitch-oauth-token ''YourOAuthToken''<br />
<br />
Where ''YourOAuthToken'' is the OAuth token you received in the previous step.<br />
<br />
== See also ==<br />
<br />
* [https://github.com/streamlink/streamlink Streamlink repository on GitHub]<br />
* [https://streamlink.github.io/ Streamlink documentation]</div>Cirrushttps://wiki.archlinux.org/index.php?title=Talk:Kernel_mode_setting&diff=590470Talk:Kernel mode setting2019-11-29T15:31:17Z<p>Cirrus: /* Modesetting Driver Flips Off Atomic By Default */</p>
<hr />
<div>== Modesetting Driver Flips Off Atomic By Default ==<br />
<br />
Users switching from {{Pkg|xf86-video-intel}} to modesetting driver may experience random xorg crashes due to this.<br />
see Phoronix article [https://www.phoronix.com/scan.php?page=news_item&px=Modesetting-Disable-Atomic] -- [[User:cirrusl|cirrus]] ([[User talk:cirrus|talk]]) 19:43, 7 November 2019 (GMT)<br />
<br />
:Thank you for the reference, I can confirm the crashes. Is there a way to work around them? (Appart from switching back to xf86-video-intel) -- [[User:Pogojotz|Pogojotz]] ([[User talk:Pogojotz|talk]]) 12:29, 21 November 2019 (UTC)<br />
<br />
Not that im aware of, sorry, though you could try Option "AccelMethod" "none" -- [[User:cirrusl|cirrus]] ([[User talk:cirrus|talk]]) 15:23, 29 November 2019 (GMT)<br />
<br />
== xorg-server 1.16 ==<br />
<br />
Wrt [https://wiki.archlinux.org/index.php?title=Init&diff=327637&oldid=327565], AFAIK you need root rights if you're not using KMS too. -- [[User:Karol|Karol]] ([[User talk:Karol|talk]]) 17:58, 2 August 2014 (UTC)<br />
<br />
== Early KMS start for GMA500 chip set ==<br />
<br />
My computer is a Poulsbo. intel_agp and i915 didn't work for me. I finally solved the problem by MODULES="gma500_gfx". Shall we mention this on this page? [[User:Haochen|Haochen]] ([[User talk:Haochen|talk]]) 19:33, 26 February 2015 (UTC)<br />
<br />
== My fonts are too tiny ==<br />
<br />
This is an issue for HiDPI laptops. The solution to changing TTY font is very vague, and the link "See [[Fonts#Changing the default font]]" is broken. Can someone clarify how to do this, the right way. [[User:Jadelord|Jadelord]] ([[User talk:Jadelord|talk]]) 10:34, 11 February 2016 (UTC)<br />
<br />
:I think the link should be to [[Fonts#Console fonts]]. So for instance you could install {{Pkg|terminus-font}} and run {{ic|setfont ter-c32n}}. That should make the fonts a lot larger. See [[Fonts#Console fonts]] for how to list all available fonts and how to make it permanent. [[User:Lonaowna|Lonaowna]] ([[User talk:Lonaowna|talk]]) 11:19, 11 February 2016 (UTC)<br />
<br />
::Thanks! I managed to change it permanently by adding a consolefont hook in mkinitcpio.conf. The {{ic|setfont}} command was not working for me, since I was trying it on a terminal emulator instead on TTY!<br />
<br />
:::Good you managed to change it! In a terminal emulator it should be really simple.. For instance in GNOME Terminal you can simply do {{ic|Edit}}->{{ic|Profile Preferences}}->{{ic|Custom font}}. But of course this is different for each one. [[User:Lonaowna|Lonaowna]] ([[User talk:Lonaowna|talk]]) 12:58, 11 February 2016 (UTC)<br />
<br />
== Is the advise to always disable "video=..." really a good one? ==<br />
<br />
The advise:<br />
At first, note that for any method you use, you should always disable:<br />
Any vga= options in your bootloader as these will conflict with the native resolution enabled by KMS.<br />
Any video= lines that enable a framebuffer that conflicts with the driver.<br />
got me into trouble when I recently installed Arch for the first time.<br />
My monitor (a 4k TV) simply displays "Invalid Format" if I do not use any "video=" statement to set a compatible mode, and I wondered whether ''"that enable a framebuffer that conflicts with the driver"'' was a statement that was valid for the amdgpu KMS driver that I use.<br />
<br />
Is there any more detailed information available on what "video=..." parameters could cause conflicts?<br />
--[[User:Lvml|Lvml]] ([[User talk:Lvml|talk]]) 19:13, 18 March 2017 (UTC)<br />
<br />
== question ==<br />
<br />
> At first, note that for any method you use, you should always disable:<br />
><br />
> Any vga= options in your bootloader as these will conflict with the native resolution enabled by KMS.<br />
> Any video= lines that enable a framebuffer that conflicts with the driver.<br />
> Any other framebuffer drivers (such as uvesafb).<br />
<br />
Does "disable" here mean, disable in my kernel config, or just in the grub boot parameters? It's very common to have framebuffer drivers built in to the kernel. Does that conflict with KMS?<br />
<br />
--[[User:Njn|Njn]] ([[User talk:Njn|talk]]) 00:56, 29 September 2017 (UTC)<br />
<br />
:It's just about removing the parameters from the bootloader configuration etc. -- [[User:Lahwaacz|Lahwaacz]] ([[User talk:Lahwaacz|talk]]) 06:32, 29 September 2017 (UTC)<br />
<br />
== Calculating GTF VESA Modelines for xorg.conf using gtf & xvidtune ==<br />
<br />
Why is there no discussion on this page about the use of '''gtf''' to create modelines for xorg.conf for monitors from the manufacturer's documentation? (e.g. from the published [h][w][hsync][vsync] information) It is provided with the '''xorg-server''' package for that purpose. For older monitors that do not provide EDID (or correct EDID) information, that is the only way to configure the display correctly. There are still many high res/high frequency CRT's working away. In many cases there is no EDID reporting.<br />
<br />
Arch provides both '''gtf''' (in xorg-server) and '''xvidtune''' (in the xorg-xvidtune package) that are used to precisely tune the graphics mode for older monitors. It would be nice to include discussion in this article. (or at least on the xorg page)<br />
<br />
[[User:Drankinatty|David C. Rankin, J.D.,P.E. -- Rankin Law Firm, PLLC]] ([[User talk:Drankinatty|talk]]) 21:17, 2 March 2018 (UTC)<br />
<br />
:The ArchWiki is a colaborative effort. There probably is no section on this topic because no one either had the necessary knowledge or put in the effort. Please feel free to add whatever you see fit. -- [[User:Edh|Edh]] ([[User talk:Edh|talk]]) 22:30, 2 March 2018 (UTC)</div>Cirrushttps://wiki.archlinux.org/index.php?title=Talk:Kernel_mode_setting&diff=590469Talk:Kernel mode setting2019-11-29T15:25:24Z<p>Cirrus: /* Modesetting Driver Flips Off Atomic By Default */</p>
<hr />
<div>== Modesetting Driver Flips Off Atomic By Default ==<br />
<br />
Users switching from {{Pkg|xf86-video-intel}} to modesetting driver may experience random xorg crashes due to this.<br />
see Phoronix article [https://www.phoronix.com/scan.php?page=news_item&px=Modesetting-Disable-Atomic] -- [[User:cirrusl|cirrus]] ([[User talk:cirrus|talk]]) 19:43, 7 November 2019 (GMT)<br />
<br />
:Thank you for the reference, I can confirm the crashes. Is there a way to work around them? (Appart from switching back to xf86-video-intel) -- [[User:Pogojotz|Pogojotz]] ([[User talk:Pogojotz|talk]]) 12:29, 21 November 2019 (UTC)<br />
<br />
Not that im aware of, sorry -- [[User:cirrusl|cirrus]] ([[User talk:cirrus|talk]]) 15:23, 29 November 2019 (GMT)<br />
<br />
== xorg-server 1.16 ==<br />
<br />
Wrt [https://wiki.archlinux.org/index.php?title=Init&diff=327637&oldid=327565], AFAIK you need root rights if you're not using KMS too. -- [[User:Karol|Karol]] ([[User talk:Karol|talk]]) 17:58, 2 August 2014 (UTC)<br />
<br />
== Early KMS start for GMA500 chip set ==<br />
<br />
My computer is a Poulsbo. intel_agp and i915 didn't work for me. I finally solved the problem by MODULES="gma500_gfx". Shall we mention this on this page? [[User:Haochen|Haochen]] ([[User talk:Haochen|talk]]) 19:33, 26 February 2015 (UTC)<br />
<br />
== My fonts are too tiny ==<br />
<br />
This is an issue for HiDPI laptops. The solution to changing TTY font is very vague, and the link "See [[Fonts#Changing the default font]]" is broken. Can someone clarify how to do this, the right way. [[User:Jadelord|Jadelord]] ([[User talk:Jadelord|talk]]) 10:34, 11 February 2016 (UTC)<br />
<br />
:I think the link should be to [[Fonts#Console fonts]]. So for instance you could install {{Pkg|terminus-font}} and run {{ic|setfont ter-c32n}}. That should make the fonts a lot larger. See [[Fonts#Console fonts]] for how to list all available fonts and how to make it permanent. [[User:Lonaowna|Lonaowna]] ([[User talk:Lonaowna|talk]]) 11:19, 11 February 2016 (UTC)<br />
<br />
::Thanks! I managed to change it permanently by adding a consolefont hook in mkinitcpio.conf. The {{ic|setfont}} command was not working for me, since I was trying it on a terminal emulator instead on TTY!<br />
<br />
:::Good you managed to change it! In a terminal emulator it should be really simple.. For instance in GNOME Terminal you can simply do {{ic|Edit}}->{{ic|Profile Preferences}}->{{ic|Custom font}}. But of course this is different for each one. [[User:Lonaowna|Lonaowna]] ([[User talk:Lonaowna|talk]]) 12:58, 11 February 2016 (UTC)<br />
<br />
== Is the advise to always disable "video=..." really a good one? ==<br />
<br />
The advise:<br />
At first, note that for any method you use, you should always disable:<br />
Any vga= options in your bootloader as these will conflict with the native resolution enabled by KMS.<br />
Any video= lines that enable a framebuffer that conflicts with the driver.<br />
got me into trouble when I recently installed Arch for the first time.<br />
My monitor (a 4k TV) simply displays "Invalid Format" if I do not use any "video=" statement to set a compatible mode, and I wondered whether ''"that enable a framebuffer that conflicts with the driver"'' was a statement that was valid for the amdgpu KMS driver that I use.<br />
<br />
Is there any more detailed information available on what "video=..." parameters could cause conflicts?<br />
--[[User:Lvml|Lvml]] ([[User talk:Lvml|talk]]) 19:13, 18 March 2017 (UTC)<br />
<br />
== question ==<br />
<br />
> At first, note that for any method you use, you should always disable:<br />
><br />
> Any vga= options in your bootloader as these will conflict with the native resolution enabled by KMS.<br />
> Any video= lines that enable a framebuffer that conflicts with the driver.<br />
> Any other framebuffer drivers (such as uvesafb).<br />
<br />
Does "disable" here mean, disable in my kernel config, or just in the grub boot parameters? It's very common to have framebuffer drivers built in to the kernel. Does that conflict with KMS?<br />
<br />
--[[User:Njn|Njn]] ([[User talk:Njn|talk]]) 00:56, 29 September 2017 (UTC)<br />
<br />
:It's just about removing the parameters from the bootloader configuration etc. -- [[User:Lahwaacz|Lahwaacz]] ([[User talk:Lahwaacz|talk]]) 06:32, 29 September 2017 (UTC)<br />
<br />
== Calculating GTF VESA Modelines for xorg.conf using gtf & xvidtune ==<br />
<br />
Why is there no discussion on this page about the use of '''gtf''' to create modelines for xorg.conf for monitors from the manufacturer's documentation? (e.g. from the published [h][w][hsync][vsync] information) It is provided with the '''xorg-server''' package for that purpose. For older monitors that do not provide EDID (or correct EDID) information, that is the only way to configure the display correctly. There are still many high res/high frequency CRT's working away. In many cases there is no EDID reporting.<br />
<br />
Arch provides both '''gtf''' (in xorg-server) and '''xvidtune''' (in the xorg-xvidtune package) that are used to precisely tune the graphics mode for older monitors. It would be nice to include discussion in this article. (or at least on the xorg page)<br />
<br />
[[User:Drankinatty|David C. Rankin, J.D.,P.E. -- Rankin Law Firm, PLLC]] ([[User talk:Drankinatty|talk]]) 21:17, 2 March 2018 (UTC)<br />
<br />
:The ArchWiki is a colaborative effort. There probably is no section on this topic because no one either had the necessary knowledge or put in the effort. Please feel free to add whatever you see fit. -- [[User:Edh|Edh]] ([[User talk:Edh|talk]]) 22:30, 2 March 2018 (UTC)</div>Cirrushttps://wiki.archlinux.org/index.php?title=User:Cirrus&diff=588222User:Cirrus2019-11-08T20:25:56Z<p>Cirrus: </p>
<hr />
<div>[https://cirrusuk.wordpress.com/ link blog]</div>Cirrushttps://wiki.archlinux.org/index.php?title=Talk:Kernel_mode_setting&diff=588123Talk:Kernel mode setting2019-11-07T19:47:19Z<p>Cirrus: I added information about this as i experience issue on thinkpad x220, as its common hardware i thought it best to forewarn those who consider switching GPU drivers.</p>
<hr />
<div>== Modesetting Driver Flips Off Atomic By Default ==<br />
<br />
Users switching from {{Pkg|xf86-video-intel}} to modesetting driver may experience random xorg crashes due to this.<br />
see Phoronix article [https://www.phoronix.com/scan.php?page=news_item&px=Modesetting-Disable-Atomic] -- [[User:cirrusl|cirrus]] ([[User talk:cirrus|talk]]) 19:43, 7 November 2019 (BST)<br />
<br />
== xorg-server 1.16 ==<br />
<br />
Wrt [https://wiki.archlinux.org/index.php?title=Init&diff=327637&oldid=327565], AFAIK you need root rights if you're not using KMS too. -- [[User:Karol|Karol]] ([[User talk:Karol|talk]]) 17:58, 2 August 2014 (UTC)<br />
<br />
== Early KMS start for GMA500 chip set ==<br />
<br />
My computer is a Poulsbo. intel_agp and i915 didn't work for me. I finally solved the problem by MODULES="gma500_gfx". Shall we mention this on this page? [[User:Haochen|Haochen]] ([[User talk:Haochen|talk]]) 19:33, 26 February 2015 (UTC)<br />
<br />
== My fonts are too tiny ==<br />
<br />
This is an issue for HiDPI laptops. The solution to changing TTY font is very vague, and the link "See [[Fonts#Changing the default font]]" is broken. Can someone clarify how to do this, the right way. [[User:Jadelord|Jadelord]] ([[User talk:Jadelord|talk]]) 10:34, 11 February 2016 (UTC)<br />
<br />
:I think the link should be to [[Fonts#Console fonts]]. So for instance you could install {{Pkg|terminus-font}} and run {{ic|setfont ter-c32n}}. That should make the fonts a lot larger. See [[Fonts#Console fonts]] for how to list all available fonts and how to make it permanent. [[User:Lonaowna|Lonaowna]] ([[User talk:Lonaowna|talk]]) 11:19, 11 February 2016 (UTC)<br />
<br />
::Thanks! I managed to change it permanently by adding a consolefont hook in mkinitcpio.conf. The {{ic|setfont}} command was not working for me, since I was trying it on a terminal emulator instead on TTY!<br />
<br />
:::Good you managed to change it! In a terminal emulator it should be really simple.. For instance in GNOME Terminal you can simply do {{ic|Edit}}->{{ic|Profile Preferences}}->{{ic|Custom font}}. But of course this is different for each one. [[User:Lonaowna|Lonaowna]] ([[User talk:Lonaowna|talk]]) 12:58, 11 February 2016 (UTC)<br />
<br />
== Is the advise to always disable "video=..." really a good one? ==<br />
<br />
The advise:<br />
At first, note that for any method you use, you should always disable:<br />
Any vga= options in your bootloader as these will conflict with the native resolution enabled by KMS.<br />
Any video= lines that enable a framebuffer that conflicts with the driver.<br />
got me into trouble when I recently installed Arch for the first time.<br />
My monitor (a 4k TV) simply displays "Invalid Format" if I do not use any "video=" statement to set a compatible mode, and I wondered whether ''"that enable a framebuffer that conflicts with the driver"'' was a statement that was valid for the amdgpu KMS driver that I use.<br />
<br />
Is there any more detailed information available on what "video=..." parameters could cause conflicts?<br />
--[[User:Lvml|Lvml]] ([[User talk:Lvml|talk]]) 19:13, 18 March 2017 (UTC)<br />
<br />
== question ==<br />
<br />
> At first, note that for any method you use, you should always disable:<br />
><br />
> Any vga= options in your bootloader as these will conflict with the native resolution enabled by KMS.<br />
> Any video= lines that enable a framebuffer that conflicts with the driver.<br />
> Any other framebuffer drivers (such as uvesafb).<br />
<br />
Does "disable" here mean, disable in my kernel config, or just in the grub boot parameters? It's very common to have framebuffer drivers built in to the kernel. Does that conflict with KMS?<br />
<br />
--[[User:Njn|Njn]] ([[User talk:Njn|talk]]) 00:56, 29 September 2017 (UTC)<br />
<br />
:It's just about removing the parameters from the bootloader configuration etc. -- [[User:Lahwaacz|Lahwaacz]] ([[User talk:Lahwaacz|talk]]) 06:32, 29 September 2017 (UTC)<br />
<br />
== Calculating GTF VESA Modelines for xorg.conf using gtf & xvidtune ==<br />
<br />
Why is there no discussion on this page about the use of '''gtf''' to create modelines for xorg.conf for monitors from the manufacturer's documentation? (e.g. from the published [h][w][hsync][vsync] information) It is provided with the '''xorg-server''' package for that purpose. For older monitors that do not provide EDID (or correct EDID) information, that is the only way to configure the display correctly. There are still many high res/high frequency CRT's working away. In many cases there is no EDID reporting.<br />
<br />
Arch provides both '''gtf''' (in xorg-server) and '''xvidtune''' (in the xorg-xvidtune package) that are used to precisely tune the graphics mode for older monitors. It would be nice to include discussion in this article. (or at least on the xorg page)<br />
<br />
[[User:Drankinatty|David C. Rankin, J.D.,P.E. -- Rankin Law Firm, PLLC]] ([[User talk:Drankinatty|talk]]) 21:17, 2 March 2018 (UTC)<br />
<br />
:The ArchWiki is a colaborative effort. There probably is no section on this topic because no one either had the necessary knowledge or put in the effort. Please feel free to add whatever you see fit. -- [[User:Edh|Edh]] ([[User talk:Edh|talk]]) 22:30, 2 March 2018 (UTC)</div>Cirrushttps://wiki.archlinux.org/index.php?title=WeeChat&diff=480535WeeChat2017-06-26T21:35:37Z<p>Cirrus: /* Guides */ english</p>
<hr />
<div>[[Category:Internet Relay Chat]]<br />
[[ja:WeeChat]]<br />
{{Style|See [[Help:Style]] and related.}}<br />
<br />
{{Related articles start}}<br />
{{Related|IRC channels}}<br />
{{Related|IRC}}<br />
{{Related|irssi}}<br />
{{Related|HexChat}}<br />
{{Related articles end}}<br />
'''WeeChat''' is a highly extendable and feature rich [[wikipedia:Internet Relay Chat|IRC]] Client currently under heavy development.<br />
<br />
== Installing ==<br />
<br />
[[Install]] the {{Pkg|weechat}} package, or {{AUR|weechat-git}} for the development version.<br />
<br />
== Running WeeChat==<br />
<br />
WeeChat is going to have multiple interfaces at some point, run '''weechat-[interface]''' to start WeeChat. <br />
<br />
As WeeChat currently only has an Ncurses interface. The command to start WeeChat is:<br />
<br />
$ weechat<br />
<br />
== Configuration ==<br />
<br />
You can configure WeeChat in 3 ways: using WeeChat's internal commands; using '''iset'''; or by editing the .conf files directly. WeeChat will automatically save settings on exit or when you run {{ic|/save}}, so if you are editing a .conf file in an editor, be sure to run {{ic|/reload}} from the console before exiting, otherwise your changes will be lost.<br />
<br />
=== Internal commands ===<br />
<br />
The {{ic|/set}} command follows this structure:<br />
{{ic|/set [file.name].[section].[directive]}}<br />
<br />
You can get a list of all configurable options by typing {{ic|/set}} in the '''weechat''' buffer window. Since there are nearly 600 default configurable options, you can search through them with a wildcard syntax: {{ic|/set irc.server.*}} or {{ic|/set *server*}} as an example. You can get help on each option with the {{ic|/help}} command: <br />
<br />
/help irc.server.freenode.autoconnect<br />
<br />
=== Internal menu-based ===<br />
<br />
For a more convenient method, install the '''iset''' script. If you have weechat 0.3.9 or newer, run:<br />
<br />
/script install iset.pl<br />
<br />
In older versions, use {{ic|/weeget install iset}}, or download [https://www.weechat.org/scripts/source/stable/iset.pl.html/ iset.pl] into your {{ic|~/.weechat/perl/autoload}} directory manually.<br />
<br />
Afterwards, run<br />
<br />
/iset<br />
<br />
to get a buffer with all configuration options.<br />
<br />
=== Configuration Files ===<br />
<br />
The .conf files for WeeChat are saved to {{ic|~/.weechat}}. These files are not commented. Detailed information can be found within the program itself (see '''Internally''' above), or WeeChat's [https://www.weechat.org/files/doc/stable/weechat_user.en.html user guide].<br />
<br />
{{Tip|in case you want to move {{ic|.weechat}} directory somewhere else (like in your '''$XDG_CONFIG_HOME'''), use this option: {{ic|$weechat -d $XDG_CONFIG_HOME/weechat}} or set the environment variable {{ic|WEECHAT_HOME}}.}}<br />
<br />
== Connecting to a server ==<br />
<br />
{{Note| Using '''/connect''' to connect to a temporary server is disabled by default if you're using 1.1+ [https://weechat.org/files/releasenotes/ReleaseNotes-devel.html#_temporary_servers_disabled_by_default_with_connect Release Note]<br />
<br />
Enable by '''/set irc.look.temporary_servers on'''<br />
<br />
}}<br />
<br />
You can connect to a IRC server by using '''/connect'''.<br />
<br />
/connect chat.freenode.net<br />
<br />
Or if there is already a '''Server''' setup you can use:<br />
<br />
/connect freenode<br />
<br />
== Creating a Server profile ==<br />
<br />
If you plan on connecting to a server more than once it may be beneficial to create a '''Server'''.<br />
<br />
/server add example irc.example.net/6667<br />
<br />
Would create the server '''example''' which would connect to '''irc.example.net''' on port '''6667'''<br />
<br />
See the WeeChat documentation and '''/help server''' for more information.<br />
<br />
== Configuring SSL ==<br />
<br />
Many IRC servers, including [https://freenode.net/ freenode] where [[IRC channel|#archlinux]] is, support SSL.<br />
<br />
If you're making a server with '''/server''', add the SSL port (usually 6697) and '''-ssl''' to the end of the line. For example:<br />
<br />
/server add freenode chat.freenode.net/6697 -ssl<br />
<br />
You can do the same thing if using '''/connect'''.<br />
<br />
/connect chat.freenode.net/6697 -ssl<br />
<br />
{{Warning|Some servers need the '''ssl_dhkey_size''' value changed to something lower. For example, if you're using freenode you'll need to set '''/set irc.server.freenode.ssl_dhkey_size 1024''' or '''/set irc.server.chat.freenode.net.ssl_dhkey_size 1024''' (see the server log)}}<br />
<br />
{{Note|Different servers may have a different port than 6697 - this is server specific.}}<br />
<br />
You may also want to change the location where WeeChat looks for trusted authorities (the default value is {{ic|%h/ssl/CAs.pem}} which translates to {{ic|~/.weechat/ssl/CAs.pem)}}:<br />
<br />
/set weechat.network.gnutls_ca_file "/etc/ssl/certs/ca-certificates.crt"<br />
<br />
== Tips and Tricks ==<br />
<br />
=== Upgrading ===<br />
<br />
WeeChat can be upgraded without disconnecting from the IRC servers (non-SSL connections only):<br />
<br />
/upgrade<br />
<br />
This will load the new WeeChat binary and reload the current configuration.<br />
<br />
=== Aliases ===<br />
<br />
Aliases can be created to simplify commonly executed commands. A nice example is Wraithan's '''smart filter''' alias:<br />
<br />
'''Smart Filter'''<br />
<br />
First, we need to enable smart filters:<br />
<br />
/set irc.look.smart_filter "on"<br />
<br />
Next, we will create the '''sfilter''' alias:<br />
<br />
/alias add sfilter filter add irc_smart_$server_$channel irc.$server.$channel irc_smart_filter *<br />
<br />
We can now type<br />
<br />
/sfilter<br />
<br />
in any buffer, and the smart filter will only be enabled for that buffer.<br />
<br />
The following alias will remove a previously enabled smart filter in the current buffer. Add the alias:<br />
<br />
/alias add rmsfilter filter del irc_smart_$server_$channel<br />
<br />
and execute it by<br />
<br />
/rmsfilter<br />
<br />
=== Exec command ===<br />
A new plugin called "exec" has been added, with command {{ic|/exec}}. It will execute external command and can display output to the current buffer with the '''-o''' option or locally (default).<br />
<br />
=== Key Bindings ===<br />
<br />
Some helpful bindings:<br />
<br />
To use ctrl-left/right arrow keys to jump to next/previous words on the input line:<br />
<br />
/key bind meta2-1;5D /input move_previous_word<br />
/key bind meta2-1;5C /input move_next_word<br />
<br />
=== SSH connection lost when idle ===<br />
<br />
If you're connecting to your WeeChat through a remote shell using SSH, for example running it in [[screen]] or [[tmux]] you might experience getting disconnected after a while when idle. There are multiple factors in play why this might happen, but the easiest way to change this is to force the connection to be kept alive by appending this to your SSH-configuration on the remote shell.<br />
<br />
This has nothing to do with WeeChat itself, but losing connection when idle won't happen with it's alternative [[irssi]] by default, and thus is a common situation for those converting to WeeChat. <br />
<br />
{{hc|# /etc/ssh/sshd_config|2=<br />
ClientAliveInterval 300}}<br />
<br />
Or have a look at [https://mosh.org Mosh].<br />
<br />
=== OTR ===<br />
<br />
Install {{AUR|python2-potr}} and enable the script '''otr.py'''. Then:<br />
<br />
/query <nick><br />
/otr start<br />
<br />
Get help on the plugin with:<br />
<br />
/help otr<br />
<br />
=== Slack ===<br />
<br />
[https://slack.com/ Slack] is a platform for team communication; an IRC on steroids. Thanks to its open API, it is possible to connect to your slack team using weechat.<br />
<br />
==== IRC gateway ====<br />
<br />
Once weechat is running, all you have to is add a new server this way:<br />
<br />
{{ic|<nowiki>/server add NAME HOST/6667 -autoconnect -ssl -ssl_dhkey_size=512 -password=PASSWORD -username=USERNAME -nicks=NICK</nowiki>}}<br />
<br />
where:<br />
<br />
* '''NAME''' is the name you want to give to the server<br />
* '''HOST''' is the the Host as provided on the Gateways page of your slack team<br />
* '''PASSWORD''' is the Pass as provided on the Gateways page of your slack team<br />
* '''USERNAME''' is the User as provided on the Gateways page of your slack team<br />
* '''NICK''' is your Slack username.<br />
<br />
===== Upload file =====<br />
<br />
To upload a file, run this following command from your shell :<br />
<br />
{{ic|<nowiki>curl -F file=@/path/to/file -F channels=CHAN -F token=XXX https://slack.com/api/files.upload</nowiki>}}<br />
<br />
where:<br />
<br />
* '''CHAN''' is the channel ID as provided on the Gateways page of your slack team<br />
* '''XXX''' is the team token as provided on the Gateways page of your slack team<br />
<br />
==== Native client ====<br />
<br />
There is a native client for slack: [https://github.com/rawdigits/wee-slack wee-slack]<br />
<br />
You need to install the python2 librairy websocket-client:<br />
<br />
{{ic|<nowiki>pacman -S python2-websocket-client</nowiki>}}<br />
<br />
Then install the wee-chat plugin into the weechat configuration folder<br />
<br />
{{ic|<nowiki>curl -o ~/.weechat/python/autoload/wee_slack.py https://raw.githubusercontent.com/rawdigits/wee-slack/master/wee_slack.py</nowiki>}}<br />
<br />
Run {{ic|<nowiki>/python reload</nowiki>}} to load the new plugin<br />
<br />
You will need an access token. You can grab one at [https://api.slack.com/docs/oauth-test-tokens here]<br />
<br />
Once weechat is running, register your token into weechat:<br />
<br />
{{ic|<nowiki>/set plugins.var.python.slack_extension.slack_api_token [YOUR_SLACK_TOKEN]</nowiki>}}<br />
<br />
And finally:<br />
<br />
{{ic|<nowiki>/save</nowiki>}}<br />
<br />
{{ic|<nowiki>/python reload</nowiki>}}<br />
<br />
===== Upload file =====<br />
<br />
To upload a file enter the following command into weechat:<br />
<br />
{{ic|<nowiki>/slack upload [file_path]</nowiki>}}<br />
<br />
=== Desktop notifications ===<br />
<br />
To receive desktop notifications for mentions or private messages, the [https://github.com/s3rvac/weechat-notify-send weechat-notify-send] script by Petr Zemek can be used.<br />
<br />
To install, use:<br />
<br />
cd ~/.weechat/python<br />
curl -O <nowiki>https://raw.githubusercontent.com/s3rvac/weechat-notify-send/master/notify_send.py</nowiki><br />
ln -s ../notify_send.py autoload/<br />
<br />
The script uses {{Pkg|libnotify}} and is known to work with both KDE and Gnome.<br />
<br />
=== Mobile device notifications ===<br />
<br />
To receive notifications for mentions or private messages to an Android mobile device, you can use the [https://irssinotifier.appspot.com/ IrssiNotifier] port to WeeChat from [https://www.weechat.org/files/scripts/irssinotifier.py here]. This script requires a Google Account, and a registration step with the service provider to obtain an API key. Then, install the plugin<br />
<br />
cd ~/.weechat/python<br />
curl -O <nowiki>https://www.weechat.org/files/scripts/irssinotifier.py</nowiki><br />
ln -s ../irssinotifier.py autoload/<br />
<br />
and intialize the API token and end-to-end encryption password in WeeChat<br />
<br />
/set plugins.var.python.irssinotifier.api_token your-api-token-from-website<br />
/set plugins.var.python.irssinotifier.encryption_password your-password-same-as-in-andoid-app<br />
/save<br />
<br />
An alternative that does not require a Google Account is a Ruby script for [https://www.notifymyandroid.com NotifyMyAndroid.com] from [https://github.com/jamtur01/nma-weechat here], with a similar installation procedure to the above, but into {{ic|~/.weechat/ruby}}.<br />
<br />
== Troubleshooting ==<br />
<br />
=== Errors loading plugins ===<br />
<br />
You may see output like the following in the main window after starting '''weechat''':<br />
<br />
{{bc|<nowiki>13:26:10 =!= | Error: unable to load plugin "/usr/lib/weechat/plugins/ruby.so": libruby.so.2.4: cannot open shared object file: No such file or directory<br />
13:26:10 =!= | If you're trying to load a script and not a C plugin, try command to load scripts (/perl, /python, ...)<br />
13:26:10 =!= | Error: unable to load plugin "/usr/lib/weechat/plugins/lua.so": liblua.so.5.3: cannot open shared object file: No such file or directory<br />
13:26:10 =!= | If you're trying to load a script and not a C plugin, try command to load scripts (/perl, /python, ...)<br />
13:26:10 =!= | Error: unable to load plugin "/usr/lib/weechat/plugins/aspell.so": libaspell.so.15: cannot open shared object file: No such file or directory<br />
13:26:10 =!= | If you're trying to load a script and not a C plugin, try command to load scripts (/perl, /python, ...)<br />
13:26:10 =!= | Error: unable to load plugin "/usr/lib/weechat/plugins/tcl.so": libtcl8.6.so: cannot open shared object file: No such file or directory<br />
13:26:10 =!= | If you're trying to load a script and not a C plugin, try command to load scripts (/perl, /python, ...)</nowiki>|bc}}<br />
<br />
The default configuration for weechat attempts to load all plugins found in /usr/lib/weechat/plugins which in this case includes ruby, lua, aspell and tcl. These packages are not required by the weechat package and may not be installed on your machine. There are two options if these errors bother you:<br />
<br />
# [[Packages|Install]] [https://www.archlinux.org/packages/?name=ruby ruby], [https://www.archlinux.org/packages/?name=lua lua], [https://www.archlinux.org/packages/?name=aspell aspell] and/or [https://www.archlinux.org/packages/?name=tcl tcl] from the [[official repositories]].<br />
# Or, run {{ic|/set weechat.plugin.autoload "*,!ruby,!lua,!aspell,!tcl"}} which will prevent loading those plugins with a bang (!) prefix.<br />
<br />
== Getting Help ==<br />
<br />
To access WeeChat's built-in help, simply type<br />
<br />
/help<br />
<br />
and the help will be displayed in the main buffer (usually buffer 1).<br />
<br />
== See also ==<br />
<br />
* [https://www.weechat.org Home Page]<br />
* [https://www.weechat.org/doc/ WeeChat Documentation]<br />
* [https://www.weechat.org/scripts/ WeeChat Scripts]<br />
* [https://weechat.org/blog/ WeeChat Development Blog]<br />
<br />
=== Guides ===<br />
* [https://weechat.org/files/doc/stable/weechat_quickstart.en.html Official WeeChat quick start guide] - a good place to start<br />
* [https://guides.fixato.org/weechat FiXato's guide to WeeChat] - A Weechat Contributers Guide<br />
* [https://gist.github.com/pascalpoitras/8406501 My always up-to-date WeeChat configuration] - r3m (weechat-dev) <br />
* [https://robots.thoughtbot.com/weechat-for-slacks-irc-gateway Thoughtbot article on weechat and slack]</div>Cirrushttps://wiki.archlinux.org/index.php?title=WeeChat&diff=480534WeeChat2017-06-26T21:32:30Z<p>Cirrus: /* Guides */ english</p>
<hr />
<div>[[Category:Internet Relay Chat]]<br />
[[ja:WeeChat]]<br />
{{Style|See [[Help:Style]] and related.}}<br />
<br />
{{Related articles start}}<br />
{{Related|IRC channels}}<br />
{{Related|IRC}}<br />
{{Related|irssi}}<br />
{{Related|HexChat}}<br />
{{Related articles end}}<br />
'''WeeChat''' is a highly extendable and feature rich [[wikipedia:Internet Relay Chat|IRC]] Client currently under heavy development.<br />
<br />
== Installing ==<br />
<br />
[[Install]] the {{Pkg|weechat}} package, or {{AUR|weechat-git}} for the development version.<br />
<br />
== Running WeeChat==<br />
<br />
WeeChat is going to have multiple interfaces at some point, run '''weechat-[interface]''' to start WeeChat. <br />
<br />
As WeeChat currently only has an Ncurses interface. The command to start WeeChat is:<br />
<br />
$ weechat<br />
<br />
== Configuration ==<br />
<br />
You can configure WeeChat in 3 ways: using WeeChat's internal commands; using '''iset'''; or by editing the .conf files directly. WeeChat will automatically save settings on exit or when you run {{ic|/save}}, so if you are editing a .conf file in an editor, be sure to run {{ic|/reload}} from the console before exiting, otherwise your changes will be lost.<br />
<br />
=== Internal commands ===<br />
<br />
The {{ic|/set}} command follows this structure:<br />
{{ic|/set [file.name].[section].[directive]}}<br />
<br />
You can get a list of all configurable options by typing {{ic|/set}} in the '''weechat''' buffer window. Since there are nearly 600 default configurable options, you can search through them with a wildcard syntax: {{ic|/set irc.server.*}} or {{ic|/set *server*}} as an example. You can get help on each option with the {{ic|/help}} command: <br />
<br />
/help irc.server.freenode.autoconnect<br />
<br />
=== Internal menu-based ===<br />
<br />
For a more convenient method, install the '''iset''' script. If you have weechat 0.3.9 or newer, run:<br />
<br />
/script install iset.pl<br />
<br />
In older versions, use {{ic|/weeget install iset}}, or download [https://www.weechat.org/scripts/source/stable/iset.pl.html/ iset.pl] into your {{ic|~/.weechat/perl/autoload}} directory manually.<br />
<br />
Afterwards, run<br />
<br />
/iset<br />
<br />
to get a buffer with all configuration options.<br />
<br />
=== Configuration Files ===<br />
<br />
The .conf files for WeeChat are saved to {{ic|~/.weechat}}. These files are not commented. Detailed information can be found within the program itself (see '''Internally''' above), or WeeChat's [https://www.weechat.org/files/doc/stable/weechat_user.en.html user guide].<br />
<br />
{{Tip|in case you want to move {{ic|.weechat}} directory somewhere else (like in your '''$XDG_CONFIG_HOME'''), use this option: {{ic|$weechat -d $XDG_CONFIG_HOME/weechat}} or set the environment variable {{ic|WEECHAT_HOME}}.}}<br />
<br />
== Connecting to a server ==<br />
<br />
{{Note| Using '''/connect''' to connect to a temporary server is disabled by default if you're using 1.1+ [https://weechat.org/files/releasenotes/ReleaseNotes-devel.html#_temporary_servers_disabled_by_default_with_connect Release Note]<br />
<br />
Enable by '''/set irc.look.temporary_servers on'''<br />
<br />
}}<br />
<br />
You can connect to a IRC server by using '''/connect'''.<br />
<br />
/connect chat.freenode.net<br />
<br />
Or if there is already a '''Server''' setup you can use:<br />
<br />
/connect freenode<br />
<br />
== Creating a Server profile ==<br />
<br />
If you plan on connecting to a server more than once it may be beneficial to create a '''Server'''.<br />
<br />
/server add example irc.example.net/6667<br />
<br />
Would create the server '''example''' which would connect to '''irc.example.net''' on port '''6667'''<br />
<br />
See the WeeChat documentation and '''/help server''' for more information.<br />
<br />
== Configuring SSL ==<br />
<br />
Many IRC servers, including [https://freenode.net/ freenode] where [[IRC channel|#archlinux]] is, support SSL.<br />
<br />
If you're making a server with '''/server''', add the SSL port (usually 6697) and '''-ssl''' to the end of the line. For example:<br />
<br />
/server add freenode chat.freenode.net/6697 -ssl<br />
<br />
You can do the same thing if using '''/connect'''.<br />
<br />
/connect chat.freenode.net/6697 -ssl<br />
<br />
{{Warning|Some servers need the '''ssl_dhkey_size''' value changed to something lower. For example, if you're using freenode you'll need to set '''/set irc.server.freenode.ssl_dhkey_size 1024''' or '''/set irc.server.chat.freenode.net.ssl_dhkey_size 1024''' (see the server log)}}<br />
<br />
{{Note|Different servers may have a different port than 6697 - this is server specific.}}<br />
<br />
You may also want to change the location where WeeChat looks for trusted authorities (the default value is {{ic|%h/ssl/CAs.pem}} which translates to {{ic|~/.weechat/ssl/CAs.pem)}}:<br />
<br />
/set weechat.network.gnutls_ca_file "/etc/ssl/certs/ca-certificates.crt"<br />
<br />
== Tips and Tricks ==<br />
<br />
=== Upgrading ===<br />
<br />
WeeChat can be upgraded without disconnecting from the IRC servers (non-SSL connections only):<br />
<br />
/upgrade<br />
<br />
This will load the new WeeChat binary and reload the current configuration.<br />
<br />
=== Aliases ===<br />
<br />
Aliases can be created to simplify commonly executed commands. A nice example is Wraithan's '''smart filter''' alias:<br />
<br />
'''Smart Filter'''<br />
<br />
First, we need to enable smart filters:<br />
<br />
/set irc.look.smart_filter "on"<br />
<br />
Next, we will create the '''sfilter''' alias:<br />
<br />
/alias add sfilter filter add irc_smart_$server_$channel irc.$server.$channel irc_smart_filter *<br />
<br />
We can now type<br />
<br />
/sfilter<br />
<br />
in any buffer, and the smart filter will only be enabled for that buffer.<br />
<br />
The following alias will remove a previously enabled smart filter in the current buffer. Add the alias:<br />
<br />
/alias add rmsfilter filter del irc_smart_$server_$channel<br />
<br />
and execute it by<br />
<br />
/rmsfilter<br />
<br />
=== Exec command ===<br />
A new plugin called "exec" has been added, with command {{ic|/exec}}. It will execute external command and can display output to the current buffer with the '''-o''' option or locally (default).<br />
<br />
=== Key Bindings ===<br />
<br />
Some helpful bindings:<br />
<br />
To use ctrl-left/right arrow keys to jump to next/previous words on the input line:<br />
<br />
/key bind meta2-1;5D /input move_previous_word<br />
/key bind meta2-1;5C /input move_next_word<br />
<br />
=== SSH connection lost when idle ===<br />
<br />
If you're connecting to your WeeChat through a remote shell using SSH, for example running it in [[screen]] or [[tmux]] you might experience getting disconnected after a while when idle. There are multiple factors in play why this might happen, but the easiest way to change this is to force the connection to be kept alive by appending this to your SSH-configuration on the remote shell.<br />
<br />
This has nothing to do with WeeChat itself, but losing connection when idle won't happen with it's alternative [[irssi]] by default, and thus is a common situation for those converting to WeeChat. <br />
<br />
{{hc|# /etc/ssh/sshd_config|2=<br />
ClientAliveInterval 300}}<br />
<br />
Or have a look at [https://mosh.org Mosh].<br />
<br />
=== OTR ===<br />
<br />
Install {{AUR|python2-potr}} and enable the script '''otr.py'''. Then:<br />
<br />
/query <nick><br />
/otr start<br />
<br />
Get help on the plugin with:<br />
<br />
/help otr<br />
<br />
=== Slack ===<br />
<br />
[https://slack.com/ Slack] is a platform for team communication; an IRC on steroids. Thanks to its open API, it is possible to connect to your slack team using weechat.<br />
<br />
==== IRC gateway ====<br />
<br />
Once weechat is running, all you have to is add a new server this way:<br />
<br />
{{ic|<nowiki>/server add NAME HOST/6667 -autoconnect -ssl -ssl_dhkey_size=512 -password=PASSWORD -username=USERNAME -nicks=NICK</nowiki>}}<br />
<br />
where:<br />
<br />
* '''NAME''' is the name you want to give to the server<br />
* '''HOST''' is the the Host as provided on the Gateways page of your slack team<br />
* '''PASSWORD''' is the Pass as provided on the Gateways page of your slack team<br />
* '''USERNAME''' is the User as provided on the Gateways page of your slack team<br />
* '''NICK''' is your Slack username.<br />
<br />
===== Upload file =====<br />
<br />
To upload a file, run this following command from your shell :<br />
<br />
{{ic|<nowiki>curl -F file=@/path/to/file -F channels=CHAN -F token=XXX https://slack.com/api/files.upload</nowiki>}}<br />
<br />
where:<br />
<br />
* '''CHAN''' is the channel ID as provided on the Gateways page of your slack team<br />
* '''XXX''' is the team token as provided on the Gateways page of your slack team<br />
<br />
==== Native client ====<br />
<br />
There is a native client for slack: [https://github.com/rawdigits/wee-slack wee-slack]<br />
<br />
You need to install the python2 librairy websocket-client:<br />
<br />
{{ic|<nowiki>pacman -S python2-websocket-client</nowiki>}}<br />
<br />
Then install the wee-chat plugin into the weechat configuration folder<br />
<br />
{{ic|<nowiki>curl -o ~/.weechat/python/autoload/wee_slack.py https://raw.githubusercontent.com/rawdigits/wee-slack/master/wee_slack.py</nowiki>}}<br />
<br />
Run {{ic|<nowiki>/python reload</nowiki>}} to load the new plugin<br />
<br />
You will need an access token. You can grab one at [https://api.slack.com/docs/oauth-test-tokens here]<br />
<br />
Once weechat is running, register your token into weechat:<br />
<br />
{{ic|<nowiki>/set plugins.var.python.slack_extension.slack_api_token [YOUR_SLACK_TOKEN]</nowiki>}}<br />
<br />
And finally:<br />
<br />
{{ic|<nowiki>/save</nowiki>}}<br />
<br />
{{ic|<nowiki>/python reload</nowiki>}}<br />
<br />
===== Upload file =====<br />
<br />
To upload a file enter the following command into weechat:<br />
<br />
{{ic|<nowiki>/slack upload [file_path]</nowiki>}}<br />
<br />
=== Desktop notifications ===<br />
<br />
To receive desktop notifications for mentions or private messages, the [https://github.com/s3rvac/weechat-notify-send weechat-notify-send] script by Petr Zemek can be used.<br />
<br />
To install, use:<br />
<br />
cd ~/.weechat/python<br />
curl -O <nowiki>https://raw.githubusercontent.com/s3rvac/weechat-notify-send/master/notify_send.py</nowiki><br />
ln -s ../notify_send.py autoload/<br />
<br />
The script uses {{Pkg|libnotify}} and is known to work with both KDE and Gnome.<br />
<br />
=== Mobile device notifications ===<br />
<br />
To receive notifications for mentions or private messages to an Android mobile device, you can use the [https://irssinotifier.appspot.com/ IrssiNotifier] port to WeeChat from [https://www.weechat.org/files/scripts/irssinotifier.py here]. This script requires a Google Account, and a registration step with the service provider to obtain an API key. Then, install the plugin<br />
<br />
cd ~/.weechat/python<br />
curl -O <nowiki>https://www.weechat.org/files/scripts/irssinotifier.py</nowiki><br />
ln -s ../irssinotifier.py autoload/<br />
<br />
and intialize the API token and end-to-end encryption password in WeeChat<br />
<br />
/set plugins.var.python.irssinotifier.api_token your-api-token-from-website<br />
/set plugins.var.python.irssinotifier.encryption_password your-password-same-as-in-andoid-app<br />
/save<br />
<br />
An alternative that does not require a Google Account is a Ruby script for [https://www.notifymyandroid.com NotifyMyAndroid.com] from [https://github.com/jamtur01/nma-weechat here], with a similar installation procedure to the above, but into {{ic|~/.weechat/ruby}}.<br />
<br />
== Troubleshooting ==<br />
<br />
=== Errors loading plugins ===<br />
<br />
You may see output like the following in the main window after starting '''weechat''':<br />
<br />
{{bc|<nowiki>13:26:10 =!= | Error: unable to load plugin "/usr/lib/weechat/plugins/ruby.so": libruby.so.2.4: cannot open shared object file: No such file or directory<br />
13:26:10 =!= | If you're trying to load a script and not a C plugin, try command to load scripts (/perl, /python, ...)<br />
13:26:10 =!= | Error: unable to load plugin "/usr/lib/weechat/plugins/lua.so": liblua.so.5.3: cannot open shared object file: No such file or directory<br />
13:26:10 =!= | If you're trying to load a script and not a C plugin, try command to load scripts (/perl, /python, ...)<br />
13:26:10 =!= | Error: unable to load plugin "/usr/lib/weechat/plugins/aspell.so": libaspell.so.15: cannot open shared object file: No such file or directory<br />
13:26:10 =!= | If you're trying to load a script and not a C plugin, try command to load scripts (/perl, /python, ...)<br />
13:26:10 =!= | Error: unable to load plugin "/usr/lib/weechat/plugins/tcl.so": libtcl8.6.so: cannot open shared object file: No such file or directory<br />
13:26:10 =!= | If you're trying to load a script and not a C plugin, try command to load scripts (/perl, /python, ...)</nowiki>|bc}}<br />
<br />
The default configuration for weechat attempts to load all plugins found in /usr/lib/weechat/plugins which in this case includes ruby, lua, aspell and tcl. These packages are not required by the weechat package and may not be installed on your machine. There are two options if these errors bother you:<br />
<br />
# [[Packages|Install]] [https://www.archlinux.org/packages/?name=ruby ruby], [https://www.archlinux.org/packages/?name=lua lua], [https://www.archlinux.org/packages/?name=aspell aspell] and/or [https://www.archlinux.org/packages/?name=tcl tcl] from the [[official repositories]].<br />
# Or, run {{ic|/set weechat.plugin.autoload "*,!ruby,!lua,!aspell,!tcl"}} which will prevent loading those plugins with a bang (!) prefix.<br />
<br />
== Getting Help ==<br />
<br />
To access WeeChat's built-in help, simply type<br />
<br />
/help<br />
<br />
and the help will be displayed in the main buffer (usually buffer 1).<br />
<br />
== See also ==<br />
<br />
* [https://www.weechat.org Home Page]<br />
* [https://www.weechat.org/doc/ WeeChat Documentation]<br />
* [https://www.weechat.org/scripts/ WeeChat Scripts]<br />
* [https://weechat.org/blog/ WeeChat Development Blog]<br />
<br />
=== Guides ===<br />
* [https://weechat.org/files/doc/stable/weechat_quickstart.en.html Official WeeChat quick start guide] - a good place to start<br />
* [https://guides.fixato.org/weechat FiXato's guide to WeeChat] - A Weechat Developer's Guide<br />
* [https://gist.github.com/pascalpoitras/8406501 My always up-to-date WeeChat configuration] - r3m (weechat-dev) <br />
* [https://robots.thoughtbot.com/weechat-for-slacks-irc-gateway Thoughtbot article on weechat and slack]</div>Cirrushttps://wiki.archlinux.org/index.php?title=WeeChat&diff=480532WeeChat2017-06-26T21:30:27Z<p>Cirrus: /* Guides */</p>
<hr />
<div>[[Category:Internet Relay Chat]]<br />
[[ja:WeeChat]]<br />
{{Style|See [[Help:Style]] and related.}}<br />
<br />
{{Related articles start}}<br />
{{Related|IRC channels}}<br />
{{Related|IRC}}<br />
{{Related|irssi}}<br />
{{Related|HexChat}}<br />
{{Related articles end}}<br />
'''WeeChat''' is a highly extendable and feature rich [[wikipedia:Internet Relay Chat|IRC]] Client currently under heavy development.<br />
<br />
== Installing ==<br />
<br />
[[Install]] the {{Pkg|weechat}} package, or {{AUR|weechat-git}} for the development version.<br />
<br />
== Running WeeChat==<br />
<br />
WeeChat is going to have multiple interfaces at some point, run '''weechat-[interface]''' to start WeeChat. <br />
<br />
As WeeChat currently only has an Ncurses interface. The command to start WeeChat is:<br />
<br />
$ weechat<br />
<br />
== Configuration ==<br />
<br />
You can configure WeeChat in 3 ways: using WeeChat's internal commands; using '''iset'''; or by editing the .conf files directly. WeeChat will automatically save settings on exit or when you run {{ic|/save}}, so if you are editing a .conf file in an editor, be sure to run {{ic|/reload}} from the console before exiting, otherwise your changes will be lost.<br />
<br />
=== Internal commands ===<br />
<br />
The {{ic|/set}} command follows this structure:<br />
{{ic|/set [file.name].[section].[directive]}}<br />
<br />
You can get a list of all configurable options by typing {{ic|/set}} in the '''weechat''' buffer window. Since there are nearly 600 default configurable options, you can search through them with a wildcard syntax: {{ic|/set irc.server.*}} or {{ic|/set *server*}} as an example. You can get help on each option with the {{ic|/help}} command: <br />
<br />
/help irc.server.freenode.autoconnect<br />
<br />
=== Internal menu-based ===<br />
<br />
For a more convenient method, install the '''iset''' script. If you have weechat 0.3.9 or newer, run:<br />
<br />
/script install iset.pl<br />
<br />
In older versions, use {{ic|/weeget install iset}}, or download [https://www.weechat.org/scripts/source/stable/iset.pl.html/ iset.pl] into your {{ic|~/.weechat/perl/autoload}} directory manually.<br />
<br />
Afterwards, run<br />
<br />
/iset<br />
<br />
to get a buffer with all configuration options.<br />
<br />
=== Configuration Files ===<br />
<br />
The .conf files for WeeChat are saved to {{ic|~/.weechat}}. These files are not commented. Detailed information can be found within the program itself (see '''Internally''' above), or WeeChat's [https://www.weechat.org/files/doc/stable/weechat_user.en.html user guide].<br />
<br />
{{Tip|in case you want to move {{ic|.weechat}} directory somewhere else (like in your '''$XDG_CONFIG_HOME'''), use this option: {{ic|$weechat -d $XDG_CONFIG_HOME/weechat}} or set the environment variable {{ic|WEECHAT_HOME}}.}}<br />
<br />
== Connecting to a server ==<br />
<br />
{{Note| Using '''/connect''' to connect to a temporary server is disabled by default if you're using 1.1+ [https://weechat.org/files/releasenotes/ReleaseNotes-devel.html#_temporary_servers_disabled_by_default_with_connect Release Note]<br />
<br />
Enable by '''/set irc.look.temporary_servers on'''<br />
<br />
}}<br />
<br />
You can connect to a IRC server by using '''/connect'''.<br />
<br />
/connect chat.freenode.net<br />
<br />
Or if there is already a '''Server''' setup you can use:<br />
<br />
/connect freenode<br />
<br />
== Creating a Server profile ==<br />
<br />
If you plan on connecting to a server more than once it may be beneficial to create a '''Server'''.<br />
<br />
/server add example irc.example.net/6667<br />
<br />
Would create the server '''example''' which would connect to '''irc.example.net''' on port '''6667'''<br />
<br />
See the WeeChat documentation and '''/help server''' for more information.<br />
<br />
== Configuring SSL ==<br />
<br />
Many IRC servers, including [https://freenode.net/ freenode] where [[IRC channel|#archlinux]] is, support SSL.<br />
<br />
If you're making a server with '''/server''', add the SSL port (usually 6697) and '''-ssl''' to the end of the line. For example:<br />
<br />
/server add freenode chat.freenode.net/6697 -ssl<br />
<br />
You can do the same thing if using '''/connect'''.<br />
<br />
/connect chat.freenode.net/6697 -ssl<br />
<br />
{{Warning|Some servers need the '''ssl_dhkey_size''' value changed to something lower. For example, if you're using freenode you'll need to set '''/set irc.server.freenode.ssl_dhkey_size 1024''' or '''/set irc.server.chat.freenode.net.ssl_dhkey_size 1024''' (see the server log)}}<br />
<br />
{{Note|Different servers may have a different port than 6697 - this is server specific.}}<br />
<br />
You may also want to change the location where WeeChat looks for trusted authorities (the default value is {{ic|%h/ssl/CAs.pem}} which translates to {{ic|~/.weechat/ssl/CAs.pem)}}:<br />
<br />
/set weechat.network.gnutls_ca_file "/etc/ssl/certs/ca-certificates.crt"<br />
<br />
== Tips and Tricks ==<br />
<br />
=== Upgrading ===<br />
<br />
WeeChat can be upgraded without disconnecting from the IRC servers (non-SSL connections only):<br />
<br />
/upgrade<br />
<br />
This will load the new WeeChat binary and reload the current configuration.<br />
<br />
=== Aliases ===<br />
<br />
Aliases can be created to simplify commonly executed commands. A nice example is Wraithan's '''smart filter''' alias:<br />
<br />
'''Smart Filter'''<br />
<br />
First, we need to enable smart filters:<br />
<br />
/set irc.look.smart_filter "on"<br />
<br />
Next, we will create the '''sfilter''' alias:<br />
<br />
/alias add sfilter filter add irc_smart_$server_$channel irc.$server.$channel irc_smart_filter *<br />
<br />
We can now type<br />
<br />
/sfilter<br />
<br />
in any buffer, and the smart filter will only be enabled for that buffer.<br />
<br />
The following alias will remove a previously enabled smart filter in the current buffer. Add the alias:<br />
<br />
/alias add rmsfilter filter del irc_smart_$server_$channel<br />
<br />
and execute it by<br />
<br />
/rmsfilter<br />
<br />
=== Exec command ===<br />
A new plugin called "exec" has been added, with command {{ic|/exec}}. It will execute external command and can display output to the current buffer with the '''-o''' option or locally (default).<br />
<br />
=== Key Bindings ===<br />
<br />
Some helpful bindings:<br />
<br />
To use ctrl-left/right arrow keys to jump to next/previous words on the input line:<br />
<br />
/key bind meta2-1;5D /input move_previous_word<br />
/key bind meta2-1;5C /input move_next_word<br />
<br />
=== SSH connection lost when idle ===<br />
<br />
If you're connecting to your WeeChat through a remote shell using SSH, for example running it in [[screen]] or [[tmux]] you might experience getting disconnected after a while when idle. There are multiple factors in play why this might happen, but the easiest way to change this is to force the connection to be kept alive by appending this to your SSH-configuration on the remote shell.<br />
<br />
This has nothing to do with WeeChat itself, but losing connection when idle won't happen with it's alternative [[irssi]] by default, and thus is a common situation for those converting to WeeChat. <br />
<br />
{{hc|# /etc/ssh/sshd_config|2=<br />
ClientAliveInterval 300}}<br />
<br />
Or have a look at [https://mosh.org Mosh].<br />
<br />
=== OTR ===<br />
<br />
Install {{AUR|python2-potr}} and enable the script '''otr.py'''. Then:<br />
<br />
/query <nick><br />
/otr start<br />
<br />
Get help on the plugin with:<br />
<br />
/help otr<br />
<br />
=== Slack ===<br />
<br />
[https://slack.com/ Slack] is a platform for team communication; an IRC on steroids. Thanks to its open API, it is possible to connect to your slack team using weechat.<br />
<br />
==== IRC gateway ====<br />
<br />
Once weechat is running, all you have to is add a new server this way:<br />
<br />
{{ic|<nowiki>/server add NAME HOST/6667 -autoconnect -ssl -ssl_dhkey_size=512 -password=PASSWORD -username=USERNAME -nicks=NICK</nowiki>}}<br />
<br />
where:<br />
<br />
* '''NAME''' is the name you want to give to the server<br />
* '''HOST''' is the the Host as provided on the Gateways page of your slack team<br />
* '''PASSWORD''' is the Pass as provided on the Gateways page of your slack team<br />
* '''USERNAME''' is the User as provided on the Gateways page of your slack team<br />
* '''NICK''' is your Slack username.<br />
<br />
===== Upload file =====<br />
<br />
To upload a file, run this following command from your shell :<br />
<br />
{{ic|<nowiki>curl -F file=@/path/to/file -F channels=CHAN -F token=XXX https://slack.com/api/files.upload</nowiki>}}<br />
<br />
where:<br />
<br />
* '''CHAN''' is the channel ID as provided on the Gateways page of your slack team<br />
* '''XXX''' is the team token as provided on the Gateways page of your slack team<br />
<br />
==== Native client ====<br />
<br />
There is a native client for slack: [https://github.com/rawdigits/wee-slack wee-slack]<br />
<br />
You need to install the python2 librairy websocket-client:<br />
<br />
{{ic|<nowiki>pacman -S python2-websocket-client</nowiki>}}<br />
<br />
Then install the wee-chat plugin into the weechat configuration folder<br />
<br />
{{ic|<nowiki>curl -o ~/.weechat/python/autoload/wee_slack.py https://raw.githubusercontent.com/rawdigits/wee-slack/master/wee_slack.py</nowiki>}}<br />
<br />
Run {{ic|<nowiki>/python reload</nowiki>}} to load the new plugin<br />
<br />
You will need an access token. You can grab one at [https://api.slack.com/docs/oauth-test-tokens here]<br />
<br />
Once weechat is running, register your token into weechat:<br />
<br />
{{ic|<nowiki>/set plugins.var.python.slack_extension.slack_api_token [YOUR_SLACK_TOKEN]</nowiki>}}<br />
<br />
And finally:<br />
<br />
{{ic|<nowiki>/save</nowiki>}}<br />
<br />
{{ic|<nowiki>/python reload</nowiki>}}<br />
<br />
===== Upload file =====<br />
<br />
To upload a file enter the following command into weechat:<br />
<br />
{{ic|<nowiki>/slack upload [file_path]</nowiki>}}<br />
<br />
=== Desktop notifications ===<br />
<br />
To receive desktop notifications for mentions or private messages, the [https://github.com/s3rvac/weechat-notify-send weechat-notify-send] script by Petr Zemek can be used.<br />
<br />
To install, use:<br />
<br />
cd ~/.weechat/python<br />
curl -O <nowiki>https://raw.githubusercontent.com/s3rvac/weechat-notify-send/master/notify_send.py</nowiki><br />
ln -s ../notify_send.py autoload/<br />
<br />
The script uses {{Pkg|libnotify}} and is known to work with both KDE and Gnome.<br />
<br />
=== Mobile device notifications ===<br />
<br />
To receive notifications for mentions or private messages to an Android mobile device, you can use the [https://irssinotifier.appspot.com/ IrssiNotifier] port to WeeChat from [https://www.weechat.org/files/scripts/irssinotifier.py here]. This script requires a Google Account, and a registration step with the service provider to obtain an API key. Then, install the plugin<br />
<br />
cd ~/.weechat/python<br />
curl -O <nowiki>https://www.weechat.org/files/scripts/irssinotifier.py</nowiki><br />
ln -s ../irssinotifier.py autoload/<br />
<br />
and intialize the API token and end-to-end encryption password in WeeChat<br />
<br />
/set plugins.var.python.irssinotifier.api_token your-api-token-from-website<br />
/set plugins.var.python.irssinotifier.encryption_password your-password-same-as-in-andoid-app<br />
/save<br />
<br />
An alternative that does not require a Google Account is a Ruby script for [https://www.notifymyandroid.com NotifyMyAndroid.com] from [https://github.com/jamtur01/nma-weechat here], with a similar installation procedure to the above, but into {{ic|~/.weechat/ruby}}.<br />
<br />
== Troubleshooting ==<br />
<br />
=== Errors loading plugins ===<br />
<br />
You may see output like the following in the main window after starting '''weechat''':<br />
<br />
{{bc|<nowiki>13:26:10 =!= | Error: unable to load plugin "/usr/lib/weechat/plugins/ruby.so": libruby.so.2.4: cannot open shared object file: No such file or directory<br />
13:26:10 =!= | If you're trying to load a script and not a C plugin, try command to load scripts (/perl, /python, ...)<br />
13:26:10 =!= | Error: unable to load plugin "/usr/lib/weechat/plugins/lua.so": liblua.so.5.3: cannot open shared object file: No such file or directory<br />
13:26:10 =!= | If you're trying to load a script and not a C plugin, try command to load scripts (/perl, /python, ...)<br />
13:26:10 =!= | Error: unable to load plugin "/usr/lib/weechat/plugins/aspell.so": libaspell.so.15: cannot open shared object file: No such file or directory<br />
13:26:10 =!= | If you're trying to load a script and not a C plugin, try command to load scripts (/perl, /python, ...)<br />
13:26:10 =!= | Error: unable to load plugin "/usr/lib/weechat/plugins/tcl.so": libtcl8.6.so: cannot open shared object file: No such file or directory<br />
13:26:10 =!= | If you're trying to load a script and not a C plugin, try command to load scripts (/perl, /python, ...)</nowiki>|bc}}<br />
<br />
The default configuration for weechat attempts to load all plugins found in /usr/lib/weechat/plugins which in this case includes ruby, lua, aspell and tcl. These packages are not required by the weechat package and may not be installed on your machine. There are two options if these errors bother you:<br />
<br />
# [[Packages|Install]] [https://www.archlinux.org/packages/?name=ruby ruby], [https://www.archlinux.org/packages/?name=lua lua], [https://www.archlinux.org/packages/?name=aspell aspell] and/or [https://www.archlinux.org/packages/?name=tcl tcl] from the [[official repositories]].<br />
# Or, run {{ic|/set weechat.plugin.autoload "*,!ruby,!lua,!aspell,!tcl"}} which will prevent loading those plugins with a bang (!) prefix.<br />
<br />
== Getting Help ==<br />
<br />
To access WeeChat's built-in help, simply type<br />
<br />
/help<br />
<br />
and the help will be displayed in the main buffer (usually buffer 1).<br />
<br />
== See also ==<br />
<br />
* [https://www.weechat.org Home Page]<br />
* [https://www.weechat.org/doc/ WeeChat Documentation]<br />
* [https://www.weechat.org/scripts/ WeeChat Scripts]<br />
* [https://weechat.org/blog/ WeeChat Development Blog]<br />
<br />
=== Guides ===<br />
* [https://weechat.org/files/doc/stable/weechat_quickstart.en.html Official WeeChat quick start guide] - a good place to start<br />
* [https://guides.fixato.org/weechat] - FiXato's guide to WeeChat<br />
* [https://gist.github.com/pascalpoitras/8406501 My always up-to-date WeeChat configuration] - r3m (weechat-dev) <br />
* [https://robots.thoughtbot.com/weechat-for-slacks-irc-gateway Thoughtbot article on weechat and slack]</div>Cirrushttps://wiki.archlinux.org/index.php?title=WeeChat&diff=480531WeeChat2017-06-26T21:29:40Z<p>Cirrus: /* Guides */ Fixato had problem with his website, its sorted now, sorry for noise.</p>
<hr />
<div>[[Category:Internet Relay Chat]]<br />
[[ja:WeeChat]]<br />
{{Style|See [[Help:Style]] and related.}}<br />
<br />
{{Related articles start}}<br />
{{Related|IRC channels}}<br />
{{Related|IRC}}<br />
{{Related|irssi}}<br />
{{Related|HexChat}}<br />
{{Related articles end}}<br />
'''WeeChat''' is a highly extendable and feature rich [[wikipedia:Internet Relay Chat|IRC]] Client currently under heavy development.<br />
<br />
== Installing ==<br />
<br />
[[Install]] the {{Pkg|weechat}} package, or {{AUR|weechat-git}} for the development version.<br />
<br />
== Running WeeChat==<br />
<br />
WeeChat is going to have multiple interfaces at some point, run '''weechat-[interface]''' to start WeeChat. <br />
<br />
As WeeChat currently only has an Ncurses interface. The command to start WeeChat is:<br />
<br />
$ weechat<br />
<br />
== Configuration ==<br />
<br />
You can configure WeeChat in 3 ways: using WeeChat's internal commands; using '''iset'''; or by editing the .conf files directly. WeeChat will automatically save settings on exit or when you run {{ic|/save}}, so if you are editing a .conf file in an editor, be sure to run {{ic|/reload}} from the console before exiting, otherwise your changes will be lost.<br />
<br />
=== Internal commands ===<br />
<br />
The {{ic|/set}} command follows this structure:<br />
{{ic|/set [file.name].[section].[directive]}}<br />
<br />
You can get a list of all configurable options by typing {{ic|/set}} in the '''weechat''' buffer window. Since there are nearly 600 default configurable options, you can search through them with a wildcard syntax: {{ic|/set irc.server.*}} or {{ic|/set *server*}} as an example. You can get help on each option with the {{ic|/help}} command: <br />
<br />
/help irc.server.freenode.autoconnect<br />
<br />
=== Internal menu-based ===<br />
<br />
For a more convenient method, install the '''iset''' script. If you have weechat 0.3.9 or newer, run:<br />
<br />
/script install iset.pl<br />
<br />
In older versions, use {{ic|/weeget install iset}}, or download [https://www.weechat.org/scripts/source/stable/iset.pl.html/ iset.pl] into your {{ic|~/.weechat/perl/autoload}} directory manually.<br />
<br />
Afterwards, run<br />
<br />
/iset<br />
<br />
to get a buffer with all configuration options.<br />
<br />
=== Configuration Files ===<br />
<br />
The .conf files for WeeChat are saved to {{ic|~/.weechat}}. These files are not commented. Detailed information can be found within the program itself (see '''Internally''' above), or WeeChat's [https://www.weechat.org/files/doc/stable/weechat_user.en.html user guide].<br />
<br />
{{Tip|in case you want to move {{ic|.weechat}} directory somewhere else (like in your '''$XDG_CONFIG_HOME'''), use this option: {{ic|$weechat -d $XDG_CONFIG_HOME/weechat}} or set the environment variable {{ic|WEECHAT_HOME}}.}}<br />
<br />
== Connecting to a server ==<br />
<br />
{{Note| Using '''/connect''' to connect to a temporary server is disabled by default if you're using 1.1+ [https://weechat.org/files/releasenotes/ReleaseNotes-devel.html#_temporary_servers_disabled_by_default_with_connect Release Note]<br />
<br />
Enable by '''/set irc.look.temporary_servers on'''<br />
<br />
}}<br />
<br />
You can connect to a IRC server by using '''/connect'''.<br />
<br />
/connect chat.freenode.net<br />
<br />
Or if there is already a '''Server''' setup you can use:<br />
<br />
/connect freenode<br />
<br />
== Creating a Server profile ==<br />
<br />
If you plan on connecting to a server more than once it may be beneficial to create a '''Server'''.<br />
<br />
/server add example irc.example.net/6667<br />
<br />
Would create the server '''example''' which would connect to '''irc.example.net''' on port '''6667'''<br />
<br />
See the WeeChat documentation and '''/help server''' for more information.<br />
<br />
== Configuring SSL ==<br />
<br />
Many IRC servers, including [https://freenode.net/ freenode] where [[IRC channel|#archlinux]] is, support SSL.<br />
<br />
If you're making a server with '''/server''', add the SSL port (usually 6697) and '''-ssl''' to the end of the line. For example:<br />
<br />
/server add freenode chat.freenode.net/6697 -ssl<br />
<br />
You can do the same thing if using '''/connect'''.<br />
<br />
/connect chat.freenode.net/6697 -ssl<br />
<br />
{{Warning|Some servers need the '''ssl_dhkey_size''' value changed to something lower. For example, if you're using freenode you'll need to set '''/set irc.server.freenode.ssl_dhkey_size 1024''' or '''/set irc.server.chat.freenode.net.ssl_dhkey_size 1024''' (see the server log)}}<br />
<br />
{{Note|Different servers may have a different port than 6697 - this is server specific.}}<br />
<br />
You may also want to change the location where WeeChat looks for trusted authorities (the default value is {{ic|%h/ssl/CAs.pem}} which translates to {{ic|~/.weechat/ssl/CAs.pem)}}:<br />
<br />
/set weechat.network.gnutls_ca_file "/etc/ssl/certs/ca-certificates.crt"<br />
<br />
== Tips and Tricks ==<br />
<br />
=== Upgrading ===<br />
<br />
WeeChat can be upgraded without disconnecting from the IRC servers (non-SSL connections only):<br />
<br />
/upgrade<br />
<br />
This will load the new WeeChat binary and reload the current configuration.<br />
<br />
=== Aliases ===<br />
<br />
Aliases can be created to simplify commonly executed commands. A nice example is Wraithan's '''smart filter''' alias:<br />
<br />
'''Smart Filter'''<br />
<br />
First, we need to enable smart filters:<br />
<br />
/set irc.look.smart_filter "on"<br />
<br />
Next, we will create the '''sfilter''' alias:<br />
<br />
/alias add sfilter filter add irc_smart_$server_$channel irc.$server.$channel irc_smart_filter *<br />
<br />
We can now type<br />
<br />
/sfilter<br />
<br />
in any buffer, and the smart filter will only be enabled for that buffer.<br />
<br />
The following alias will remove a previously enabled smart filter in the current buffer. Add the alias:<br />
<br />
/alias add rmsfilter filter del irc_smart_$server_$channel<br />
<br />
and execute it by<br />
<br />
/rmsfilter<br />
<br />
=== Exec command ===<br />
A new plugin called "exec" has been added, with command {{ic|/exec}}. It will execute external command and can display output to the current buffer with the '''-o''' option or locally (default).<br />
<br />
=== Key Bindings ===<br />
<br />
Some helpful bindings:<br />
<br />
To use ctrl-left/right arrow keys to jump to next/previous words on the input line:<br />
<br />
/key bind meta2-1;5D /input move_previous_word<br />
/key bind meta2-1;5C /input move_next_word<br />
<br />
=== SSH connection lost when idle ===<br />
<br />
If you're connecting to your WeeChat through a remote shell using SSH, for example running it in [[screen]] or [[tmux]] you might experience getting disconnected after a while when idle. There are multiple factors in play why this might happen, but the easiest way to change this is to force the connection to be kept alive by appending this to your SSH-configuration on the remote shell.<br />
<br />
This has nothing to do with WeeChat itself, but losing connection when idle won't happen with it's alternative [[irssi]] by default, and thus is a common situation for those converting to WeeChat. <br />
<br />
{{hc|# /etc/ssh/sshd_config|2=<br />
ClientAliveInterval 300}}<br />
<br />
Or have a look at [https://mosh.org Mosh].<br />
<br />
=== OTR ===<br />
<br />
Install {{AUR|python2-potr}} and enable the script '''otr.py'''. Then:<br />
<br />
/query <nick><br />
/otr start<br />
<br />
Get help on the plugin with:<br />
<br />
/help otr<br />
<br />
=== Slack ===<br />
<br />
[https://slack.com/ Slack] is a platform for team communication; an IRC on steroids. Thanks to its open API, it is possible to connect to your slack team using weechat.<br />
<br />
==== IRC gateway ====<br />
<br />
Once weechat is running, all you have to is add a new server this way:<br />
<br />
{{ic|<nowiki>/server add NAME HOST/6667 -autoconnect -ssl -ssl_dhkey_size=512 -password=PASSWORD -username=USERNAME -nicks=NICK</nowiki>}}<br />
<br />
where:<br />
<br />
* '''NAME''' is the name you want to give to the server<br />
* '''HOST''' is the the Host as provided on the Gateways page of your slack team<br />
* '''PASSWORD''' is the Pass as provided on the Gateways page of your slack team<br />
* '''USERNAME''' is the User as provided on the Gateways page of your slack team<br />
* '''NICK''' is your Slack username.<br />
<br />
===== Upload file =====<br />
<br />
To upload a file, run this following command from your shell :<br />
<br />
{{ic|<nowiki>curl -F file=@/path/to/file -F channels=CHAN -F token=XXX https://slack.com/api/files.upload</nowiki>}}<br />
<br />
where:<br />
<br />
* '''CHAN''' is the channel ID as provided on the Gateways page of your slack team<br />
* '''XXX''' is the team token as provided on the Gateways page of your slack team<br />
<br />
==== Native client ====<br />
<br />
There is a native client for slack: [https://github.com/rawdigits/wee-slack wee-slack]<br />
<br />
You need to install the python2 librairy websocket-client:<br />
<br />
{{ic|<nowiki>pacman -S python2-websocket-client</nowiki>}}<br />
<br />
Then install the wee-chat plugin into the weechat configuration folder<br />
<br />
{{ic|<nowiki>curl -o ~/.weechat/python/autoload/wee_slack.py https://raw.githubusercontent.com/rawdigits/wee-slack/master/wee_slack.py</nowiki>}}<br />
<br />
Run {{ic|<nowiki>/python reload</nowiki>}} to load the new plugin<br />
<br />
You will need an access token. You can grab one at [https://api.slack.com/docs/oauth-test-tokens here]<br />
<br />
Once weechat is running, register your token into weechat:<br />
<br />
{{ic|<nowiki>/set plugins.var.python.slack_extension.slack_api_token [YOUR_SLACK_TOKEN]</nowiki>}}<br />
<br />
And finally:<br />
<br />
{{ic|<nowiki>/save</nowiki>}}<br />
<br />
{{ic|<nowiki>/python reload</nowiki>}}<br />
<br />
===== Upload file =====<br />
<br />
To upload a file enter the following command into weechat:<br />
<br />
{{ic|<nowiki>/slack upload [file_path]</nowiki>}}<br />
<br />
=== Desktop notifications ===<br />
<br />
To receive desktop notifications for mentions or private messages, the [https://github.com/s3rvac/weechat-notify-send weechat-notify-send] script by Petr Zemek can be used.<br />
<br />
To install, use:<br />
<br />
cd ~/.weechat/python<br />
curl -O <nowiki>https://raw.githubusercontent.com/s3rvac/weechat-notify-send/master/notify_send.py</nowiki><br />
ln -s ../notify_send.py autoload/<br />
<br />
The script uses {{Pkg|libnotify}} and is known to work with both KDE and Gnome.<br />
<br />
=== Mobile device notifications ===<br />
<br />
To receive notifications for mentions or private messages to an Android mobile device, you can use the [https://irssinotifier.appspot.com/ IrssiNotifier] port to WeeChat from [https://www.weechat.org/files/scripts/irssinotifier.py here]. This script requires a Google Account, and a registration step with the service provider to obtain an API key. Then, install the plugin<br />
<br />
cd ~/.weechat/python<br />
curl -O <nowiki>https://www.weechat.org/files/scripts/irssinotifier.py</nowiki><br />
ln -s ../irssinotifier.py autoload/<br />
<br />
and intialize the API token and end-to-end encryption password in WeeChat<br />
<br />
/set plugins.var.python.irssinotifier.api_token your-api-token-from-website<br />
/set plugins.var.python.irssinotifier.encryption_password your-password-same-as-in-andoid-app<br />
/save<br />
<br />
An alternative that does not require a Google Account is a Ruby script for [https://www.notifymyandroid.com NotifyMyAndroid.com] from [https://github.com/jamtur01/nma-weechat here], with a similar installation procedure to the above, but into {{ic|~/.weechat/ruby}}.<br />
<br />
== Troubleshooting ==<br />
<br />
=== Errors loading plugins ===<br />
<br />
You may see output like the following in the main window after starting '''weechat''':<br />
<br />
{{bc|<nowiki>13:26:10 =!= | Error: unable to load plugin "/usr/lib/weechat/plugins/ruby.so": libruby.so.2.4: cannot open shared object file: No such file or directory<br />
13:26:10 =!= | If you're trying to load a script and not a C plugin, try command to load scripts (/perl, /python, ...)<br />
13:26:10 =!= | Error: unable to load plugin "/usr/lib/weechat/plugins/lua.so": liblua.so.5.3: cannot open shared object file: No such file or directory<br />
13:26:10 =!= | If you're trying to load a script and not a C plugin, try command to load scripts (/perl, /python, ...)<br />
13:26:10 =!= | Error: unable to load plugin "/usr/lib/weechat/plugins/aspell.so": libaspell.so.15: cannot open shared object file: No such file or directory<br />
13:26:10 =!= | If you're trying to load a script and not a C plugin, try command to load scripts (/perl, /python, ...)<br />
13:26:10 =!= | Error: unable to load plugin "/usr/lib/weechat/plugins/tcl.so": libtcl8.6.so: cannot open shared object file: No such file or directory<br />
13:26:10 =!= | If you're trying to load a script and not a C plugin, try command to load scripts (/perl, /python, ...)</nowiki>|bc}}<br />
<br />
The default configuration for weechat attempts to load all plugins found in /usr/lib/weechat/plugins which in this case includes ruby, lua, aspell and tcl. These packages are not required by the weechat package and may not be installed on your machine. There are two options if these errors bother you:<br />
<br />
# [[Packages|Install]] [https://www.archlinux.org/packages/?name=ruby ruby], [https://www.archlinux.org/packages/?name=lua lua], [https://www.archlinux.org/packages/?name=aspell aspell] and/or [https://www.archlinux.org/packages/?name=tcl tcl] from the [[official repositories]].<br />
# Or, run {{ic|/set weechat.plugin.autoload "*,!ruby,!lua,!aspell,!tcl"}} which will prevent loading those plugins with a bang (!) prefix.<br />
<br />
== Getting Help ==<br />
<br />
To access WeeChat's built-in help, simply type<br />
<br />
/help<br />
<br />
and the help will be displayed in the main buffer (usually buffer 1).<br />
<br />
== See also ==<br />
<br />
* [https://www.weechat.org Home Page]<br />
* [https://www.weechat.org/doc/ WeeChat Documentation]<br />
* [https://www.weechat.org/scripts/ WeeChat Scripts]<br />
* [https://weechat.org/blog/ WeeChat Development Blog]<br />
<br />
=== Guides ===<br />
* [https://weechat.org/files/doc/stable/weechat_quickstart.en.html Official WeeChat quick start guide] - a good place to start<br />
* [https://guides.fixato.org/weechat/] - FiXato's guide to WeeChat<br />
* [https://gist.github.com/pascalpoitras/8406501 My always up-to-date WeeChat configuration] - r3m (weechat-dev) <br />
* [https://robots.thoughtbot.com/weechat-for-slacks-irc-gateway Thoughtbot article on weechat and slack]</div>Cirrushttps://wiki.archlinux.org/index.php?title=WeeChat&diff=480530WeeChat2017-06-26T21:13:37Z<p>Cirrus: /* See also */</p>
<hr />
<div>[[Category:Internet Relay Chat]]<br />
[[ja:WeeChat]]<br />
{{Style|See [[Help:Style]] and related.}}<br />
<br />
{{Related articles start}}<br />
{{Related|IRC channels}}<br />
{{Related|IRC}}<br />
{{Related|irssi}}<br />
{{Related|HexChat}}<br />
{{Related articles end}}<br />
'''WeeChat''' is a highly extendable and feature rich [[wikipedia:Internet Relay Chat|IRC]] Client currently under heavy development.<br />
<br />
== Installing ==<br />
<br />
[[Install]] the {{Pkg|weechat}} package, or {{AUR|weechat-git}} for the development version.<br />
<br />
== Running WeeChat==<br />
<br />
WeeChat is going to have multiple interfaces at some point, run '''weechat-[interface]''' to start WeeChat. <br />
<br />
As WeeChat currently only has an Ncurses interface. The command to start WeeChat is:<br />
<br />
$ weechat<br />
<br />
== Configuration ==<br />
<br />
You can configure WeeChat in 3 ways: using WeeChat's internal commands; using '''iset'''; or by editing the .conf files directly. WeeChat will automatically save settings on exit or when you run {{ic|/save}}, so if you are editing a .conf file in an editor, be sure to run {{ic|/reload}} from the console before exiting, otherwise your changes will be lost.<br />
<br />
=== Internal commands ===<br />
<br />
The {{ic|/set}} command follows this structure:<br />
{{ic|/set [file.name].[section].[directive]}}<br />
<br />
You can get a list of all configurable options by typing {{ic|/set}} in the '''weechat''' buffer window. Since there are nearly 600 default configurable options, you can search through them with a wildcard syntax: {{ic|/set irc.server.*}} or {{ic|/set *server*}} as an example. You can get help on each option with the {{ic|/help}} command: <br />
<br />
/help irc.server.freenode.autoconnect<br />
<br />
=== Internal menu-based ===<br />
<br />
For a more convenient method, install the '''iset''' script. If you have weechat 0.3.9 or newer, run:<br />
<br />
/script install iset.pl<br />
<br />
In older versions, use {{ic|/weeget install iset}}, or download [https://www.weechat.org/scripts/source/stable/iset.pl.html/ iset.pl] into your {{ic|~/.weechat/perl/autoload}} directory manually.<br />
<br />
Afterwards, run<br />
<br />
/iset<br />
<br />
to get a buffer with all configuration options.<br />
<br />
=== Configuration Files ===<br />
<br />
The .conf files for WeeChat are saved to {{ic|~/.weechat}}. These files are not commented. Detailed information can be found within the program itself (see '''Internally''' above), or WeeChat's [https://www.weechat.org/files/doc/stable/weechat_user.en.html user guide].<br />
<br />
{{Tip|in case you want to move {{ic|.weechat}} directory somewhere else (like in your '''$XDG_CONFIG_HOME'''), use this option: {{ic|$weechat -d $XDG_CONFIG_HOME/weechat}} or set the environment variable {{ic|WEECHAT_HOME}}.}}<br />
<br />
== Connecting to a server ==<br />
<br />
{{Note| Using '''/connect''' to connect to a temporary server is disabled by default if you're using 1.1+ [https://weechat.org/files/releasenotes/ReleaseNotes-devel.html#_temporary_servers_disabled_by_default_with_connect Release Note]<br />
<br />
Enable by '''/set irc.look.temporary_servers on'''<br />
<br />
}}<br />
<br />
You can connect to a IRC server by using '''/connect'''.<br />
<br />
/connect chat.freenode.net<br />
<br />
Or if there is already a '''Server''' setup you can use:<br />
<br />
/connect freenode<br />
<br />
== Creating a Server profile ==<br />
<br />
If you plan on connecting to a server more than once it may be beneficial to create a '''Server'''.<br />
<br />
/server add example irc.example.net/6667<br />
<br />
Would create the server '''example''' which would connect to '''irc.example.net''' on port '''6667'''<br />
<br />
See the WeeChat documentation and '''/help server''' for more information.<br />
<br />
== Configuring SSL ==<br />
<br />
Many IRC servers, including [https://freenode.net/ freenode] where [[IRC channel|#archlinux]] is, support SSL.<br />
<br />
If you're making a server with '''/server''', add the SSL port (usually 6697) and '''-ssl''' to the end of the line. For example:<br />
<br />
/server add freenode chat.freenode.net/6697 -ssl<br />
<br />
You can do the same thing if using '''/connect'''.<br />
<br />
/connect chat.freenode.net/6697 -ssl<br />
<br />
{{Warning|Some servers need the '''ssl_dhkey_size''' value changed to something lower. For example, if you're using freenode you'll need to set '''/set irc.server.freenode.ssl_dhkey_size 1024''' or '''/set irc.server.chat.freenode.net.ssl_dhkey_size 1024''' (see the server log)}}<br />
<br />
{{Note|Different servers may have a different port than 6697 - this is server specific.}}<br />
<br />
You may also want to change the location where WeeChat looks for trusted authorities (the default value is {{ic|%h/ssl/CAs.pem}} which translates to {{ic|~/.weechat/ssl/CAs.pem)}}:<br />
<br />
/set weechat.network.gnutls_ca_file "/etc/ssl/certs/ca-certificates.crt"<br />
<br />
== Tips and Tricks ==<br />
<br />
=== Upgrading ===<br />
<br />
WeeChat can be upgraded without disconnecting from the IRC servers (non-SSL connections only):<br />
<br />
/upgrade<br />
<br />
This will load the new WeeChat binary and reload the current configuration.<br />
<br />
=== Aliases ===<br />
<br />
Aliases can be created to simplify commonly executed commands. A nice example is Wraithan's '''smart filter''' alias:<br />
<br />
'''Smart Filter'''<br />
<br />
First, we need to enable smart filters:<br />
<br />
/set irc.look.smart_filter "on"<br />
<br />
Next, we will create the '''sfilter''' alias:<br />
<br />
/alias add sfilter filter add irc_smart_$server_$channel irc.$server.$channel irc_smart_filter *<br />
<br />
We can now type<br />
<br />
/sfilter<br />
<br />
in any buffer, and the smart filter will only be enabled for that buffer.<br />
<br />
The following alias will remove a previously enabled smart filter in the current buffer. Add the alias:<br />
<br />
/alias add rmsfilter filter del irc_smart_$server_$channel<br />
<br />
and execute it by<br />
<br />
/rmsfilter<br />
<br />
=== Exec command ===<br />
A new plugin called "exec" has been added, with command {{ic|/exec}}. It will execute external command and can display output to the current buffer with the '''-o''' option or locally (default).<br />
<br />
=== Key Bindings ===<br />
<br />
Some helpful bindings:<br />
<br />
To use ctrl-left/right arrow keys to jump to next/previous words on the input line:<br />
<br />
/key bind meta2-1;5D /input move_previous_word<br />
/key bind meta2-1;5C /input move_next_word<br />
<br />
=== SSH connection lost when idle ===<br />
<br />
If you're connecting to your WeeChat through a remote shell using SSH, for example running it in [[screen]] or [[tmux]] you might experience getting disconnected after a while when idle. There are multiple factors in play why this might happen, but the easiest way to change this is to force the connection to be kept alive by appending this to your SSH-configuration on the remote shell.<br />
<br />
This has nothing to do with WeeChat itself, but losing connection when idle won't happen with it's alternative [[irssi]] by default, and thus is a common situation for those converting to WeeChat. <br />
<br />
{{hc|# /etc/ssh/sshd_config|2=<br />
ClientAliveInterval 300}}<br />
<br />
Or have a look at [https://mosh.org Mosh].<br />
<br />
=== OTR ===<br />
<br />
Install {{AUR|python2-potr}} and enable the script '''otr.py'''. Then:<br />
<br />
/query <nick><br />
/otr start<br />
<br />
Get help on the plugin with:<br />
<br />
/help otr<br />
<br />
=== Slack ===<br />
<br />
[https://slack.com/ Slack] is a platform for team communication; an IRC on steroids. Thanks to its open API, it is possible to connect to your slack team using weechat.<br />
<br />
==== IRC gateway ====<br />
<br />
Once weechat is running, all you have to is add a new server this way:<br />
<br />
{{ic|<nowiki>/server add NAME HOST/6667 -autoconnect -ssl -ssl_dhkey_size=512 -password=PASSWORD -username=USERNAME -nicks=NICK</nowiki>}}<br />
<br />
where:<br />
<br />
* '''NAME''' is the name you want to give to the server<br />
* '''HOST''' is the the Host as provided on the Gateways page of your slack team<br />
* '''PASSWORD''' is the Pass as provided on the Gateways page of your slack team<br />
* '''USERNAME''' is the User as provided on the Gateways page of your slack team<br />
* '''NICK''' is your Slack username.<br />
<br />
===== Upload file =====<br />
<br />
To upload a file, run this following command from your shell :<br />
<br />
{{ic|<nowiki>curl -F file=@/path/to/file -F channels=CHAN -F token=XXX https://slack.com/api/files.upload</nowiki>}}<br />
<br />
where:<br />
<br />
* '''CHAN''' is the channel ID as provided on the Gateways page of your slack team<br />
* '''XXX''' is the team token as provided on the Gateways page of your slack team<br />
<br />
==== Native client ====<br />
<br />
There is a native client for slack: [https://github.com/rawdigits/wee-slack wee-slack]<br />
<br />
You need to install the python2 librairy websocket-client:<br />
<br />
{{ic|<nowiki>pacman -S python2-websocket-client</nowiki>}}<br />
<br />
Then install the wee-chat plugin into the weechat configuration folder<br />
<br />
{{ic|<nowiki>curl -o ~/.weechat/python/autoload/wee_slack.py https://raw.githubusercontent.com/rawdigits/wee-slack/master/wee_slack.py</nowiki>}}<br />
<br />
Run {{ic|<nowiki>/python reload</nowiki>}} to load the new plugin<br />
<br />
You will need an access token. You can grab one at [https://api.slack.com/docs/oauth-test-tokens here]<br />
<br />
Once weechat is running, register your token into weechat:<br />
<br />
{{ic|<nowiki>/set plugins.var.python.slack_extension.slack_api_token [YOUR_SLACK_TOKEN]</nowiki>}}<br />
<br />
And finally:<br />
<br />
{{ic|<nowiki>/save</nowiki>}}<br />
<br />
{{ic|<nowiki>/python reload</nowiki>}}<br />
<br />
===== Upload file =====<br />
<br />
To upload a file enter the following command into weechat:<br />
<br />
{{ic|<nowiki>/slack upload [file_path]</nowiki>}}<br />
<br />
=== Desktop notifications ===<br />
<br />
To receive desktop notifications for mentions or private messages, the [https://github.com/s3rvac/weechat-notify-send weechat-notify-send] script by Petr Zemek can be used.<br />
<br />
To install, use:<br />
<br />
cd ~/.weechat/python<br />
curl -O <nowiki>https://raw.githubusercontent.com/s3rvac/weechat-notify-send/master/notify_send.py</nowiki><br />
ln -s ../notify_send.py autoload/<br />
<br />
The script uses {{Pkg|libnotify}} and is known to work with both KDE and Gnome.<br />
<br />
=== Mobile device notifications ===<br />
<br />
To receive notifications for mentions or private messages to an Android mobile device, you can use the [https://irssinotifier.appspot.com/ IrssiNotifier] port to WeeChat from [https://www.weechat.org/files/scripts/irssinotifier.py here]. This script requires a Google Account, and a registration step with the service provider to obtain an API key. Then, install the plugin<br />
<br />
cd ~/.weechat/python<br />
curl -O <nowiki>https://www.weechat.org/files/scripts/irssinotifier.py</nowiki><br />
ln -s ../irssinotifier.py autoload/<br />
<br />
and intialize the API token and end-to-end encryption password in WeeChat<br />
<br />
/set plugins.var.python.irssinotifier.api_token your-api-token-from-website<br />
/set plugins.var.python.irssinotifier.encryption_password your-password-same-as-in-andoid-app<br />
/save<br />
<br />
An alternative that does not require a Google Account is a Ruby script for [https://www.notifymyandroid.com NotifyMyAndroid.com] from [https://github.com/jamtur01/nma-weechat here], with a similar installation procedure to the above, but into {{ic|~/.weechat/ruby}}.<br />
<br />
== Troubleshooting ==<br />
<br />
=== Errors loading plugins ===<br />
<br />
You may see output like the following in the main window after starting '''weechat''':<br />
<br />
{{bc|<nowiki>13:26:10 =!= | Error: unable to load plugin "/usr/lib/weechat/plugins/ruby.so": libruby.so.2.4: cannot open shared object file: No such file or directory<br />
13:26:10 =!= | If you're trying to load a script and not a C plugin, try command to load scripts (/perl, /python, ...)<br />
13:26:10 =!= | Error: unable to load plugin "/usr/lib/weechat/plugins/lua.so": liblua.so.5.3: cannot open shared object file: No such file or directory<br />
13:26:10 =!= | If you're trying to load a script and not a C plugin, try command to load scripts (/perl, /python, ...)<br />
13:26:10 =!= | Error: unable to load plugin "/usr/lib/weechat/plugins/aspell.so": libaspell.so.15: cannot open shared object file: No such file or directory<br />
13:26:10 =!= | If you're trying to load a script and not a C plugin, try command to load scripts (/perl, /python, ...)<br />
13:26:10 =!= | Error: unable to load plugin "/usr/lib/weechat/plugins/tcl.so": libtcl8.6.so: cannot open shared object file: No such file or directory<br />
13:26:10 =!= | If you're trying to load a script and not a C plugin, try command to load scripts (/perl, /python, ...)</nowiki>|bc}}<br />
<br />
The default configuration for weechat attempts to load all plugins found in /usr/lib/weechat/plugins which in this case includes ruby, lua, aspell and tcl. These packages are not required by the weechat package and may not be installed on your machine. There are two options if these errors bother you:<br />
<br />
# [[Packages|Install]] [https://www.archlinux.org/packages/?name=ruby ruby], [https://www.archlinux.org/packages/?name=lua lua], [https://www.archlinux.org/packages/?name=aspell aspell] and/or [https://www.archlinux.org/packages/?name=tcl tcl] from the [[official repositories]].<br />
# Or, run {{ic|/set weechat.plugin.autoload "*,!ruby,!lua,!aspell,!tcl"}} which will prevent loading those plugins with a bang (!) prefix.<br />
<br />
== Getting Help ==<br />
<br />
To access WeeChat's built-in help, simply type<br />
<br />
/help<br />
<br />
and the help will be displayed in the main buffer (usually buffer 1).<br />
<br />
== See also ==<br />
<br />
* [https://www.weechat.org Home Page]<br />
* [https://www.weechat.org/doc/ WeeChat Documentation]<br />
* [https://www.weechat.org/scripts/ WeeChat Scripts]<br />
* [https://weechat.org/blog/ WeeChat Development Blog]<br />
<br />
=== Guides ===<br />
* [https://weechat.org/files/doc/stable/weechat_quickstart.en.html Official WeeChat quick start guide] - a good place to start<br />
* [https://gist.github.com/pascalpoitras/8406501 My always up-to-date WeeChat configuration] - r3m (weechat-dev) <br />
* [https://robots.thoughtbot.com/weechat-for-slacks-irc-gateway Thoughtbot article on weechat and slack]</div>Cirrushttps://wiki.archlinux.org/index.php?title=WeeChat&diff=480529WeeChat2017-06-26T21:08:03Z<p>Cirrus: /* See also */</p>
<hr />
<div>[[Category:Internet Relay Chat]]<br />
[[ja:WeeChat]]<br />
{{Style|See [[Help:Style]] and related.}}<br />
<br />
{{Related articles start}}<br />
{{Related|IRC channels}}<br />
{{Related|IRC}}<br />
{{Related|irssi}}<br />
{{Related|HexChat}}<br />
{{Related articles end}}<br />
'''WeeChat''' is a highly extendable and feature rich [[wikipedia:Internet Relay Chat|IRC]] Client currently under heavy development.<br />
<br />
== Installing ==<br />
<br />
[[Install]] the {{Pkg|weechat}} package, or {{AUR|weechat-git}} for the development version.<br />
<br />
== Running WeeChat==<br />
<br />
WeeChat is going to have multiple interfaces at some point, run '''weechat-[interface]''' to start WeeChat. <br />
<br />
As WeeChat currently only has an Ncurses interface. The command to start WeeChat is:<br />
<br />
$ weechat<br />
<br />
== Configuration ==<br />
<br />
You can configure WeeChat in 3 ways: using WeeChat's internal commands; using '''iset'''; or by editing the .conf files directly. WeeChat will automatically save settings on exit or when you run {{ic|/save}}, so if you are editing a .conf file in an editor, be sure to run {{ic|/reload}} from the console before exiting, otherwise your changes will be lost.<br />
<br />
=== Internal commands ===<br />
<br />
The {{ic|/set}} command follows this structure:<br />
{{ic|/set [file.name].[section].[directive]}}<br />
<br />
You can get a list of all configurable options by typing {{ic|/set}} in the '''weechat''' buffer window. Since there are nearly 600 default configurable options, you can search through them with a wildcard syntax: {{ic|/set irc.server.*}} or {{ic|/set *server*}} as an example. You can get help on each option with the {{ic|/help}} command: <br />
<br />
/help irc.server.freenode.autoconnect<br />
<br />
=== Internal menu-based ===<br />
<br />
For a more convenient method, install the '''iset''' script. If you have weechat 0.3.9 or newer, run:<br />
<br />
/script install iset.pl<br />
<br />
In older versions, use {{ic|/weeget install iset}}, or download [https://www.weechat.org/scripts/source/stable/iset.pl.html/ iset.pl] into your {{ic|~/.weechat/perl/autoload}} directory manually.<br />
<br />
Afterwards, run<br />
<br />
/iset<br />
<br />
to get a buffer with all configuration options.<br />
<br />
=== Configuration Files ===<br />
<br />
The .conf files for WeeChat are saved to {{ic|~/.weechat}}. These files are not commented. Detailed information can be found within the program itself (see '''Internally''' above), or WeeChat's [https://www.weechat.org/files/doc/stable/weechat_user.en.html user guide].<br />
<br />
{{Tip|in case you want to move {{ic|.weechat}} directory somewhere else (like in your '''$XDG_CONFIG_HOME'''), use this option: {{ic|$weechat -d $XDG_CONFIG_HOME/weechat}} or set the environment variable {{ic|WEECHAT_HOME}}.}}<br />
<br />
== Connecting to a server ==<br />
<br />
{{Note| Using '''/connect''' to connect to a temporary server is disabled by default if you're using 1.1+ [https://weechat.org/files/releasenotes/ReleaseNotes-devel.html#_temporary_servers_disabled_by_default_with_connect Release Note]<br />
<br />
Enable by '''/set irc.look.temporary_servers on'''<br />
<br />
}}<br />
<br />
You can connect to a IRC server by using '''/connect'''.<br />
<br />
/connect chat.freenode.net<br />
<br />
Or if there is already a '''Server''' setup you can use:<br />
<br />
/connect freenode<br />
<br />
== Creating a Server profile ==<br />
<br />
If you plan on connecting to a server more than once it may be beneficial to create a '''Server'''.<br />
<br />
/server add example irc.example.net/6667<br />
<br />
Would create the server '''example''' which would connect to '''irc.example.net''' on port '''6667'''<br />
<br />
See the WeeChat documentation and '''/help server''' for more information.<br />
<br />
== Configuring SSL ==<br />
<br />
Many IRC servers, including [https://freenode.net/ freenode] where [[IRC channel|#archlinux]] is, support SSL.<br />
<br />
If you're making a server with '''/server''', add the SSL port (usually 6697) and '''-ssl''' to the end of the line. For example:<br />
<br />
/server add freenode chat.freenode.net/6697 -ssl<br />
<br />
You can do the same thing if using '''/connect'''.<br />
<br />
/connect chat.freenode.net/6697 -ssl<br />
<br />
{{Warning|Some servers need the '''ssl_dhkey_size''' value changed to something lower. For example, if you're using freenode you'll need to set '''/set irc.server.freenode.ssl_dhkey_size 1024''' or '''/set irc.server.chat.freenode.net.ssl_dhkey_size 1024''' (see the server log)}}<br />
<br />
{{Note|Different servers may have a different port than 6697 - this is server specific.}}<br />
<br />
You may also want to change the location where WeeChat looks for trusted authorities (the default value is {{ic|%h/ssl/CAs.pem}} which translates to {{ic|~/.weechat/ssl/CAs.pem)}}:<br />
<br />
/set weechat.network.gnutls_ca_file "/etc/ssl/certs/ca-certificates.crt"<br />
<br />
== Tips and Tricks ==<br />
<br />
=== Upgrading ===<br />
<br />
WeeChat can be upgraded without disconnecting from the IRC servers (non-SSL connections only):<br />
<br />
/upgrade<br />
<br />
This will load the new WeeChat binary and reload the current configuration.<br />
<br />
=== Aliases ===<br />
<br />
Aliases can be created to simplify commonly executed commands. A nice example is Wraithan's '''smart filter''' alias:<br />
<br />
'''Smart Filter'''<br />
<br />
First, we need to enable smart filters:<br />
<br />
/set irc.look.smart_filter "on"<br />
<br />
Next, we will create the '''sfilter''' alias:<br />
<br />
/alias add sfilter filter add irc_smart_$server_$channel irc.$server.$channel irc_smart_filter *<br />
<br />
We can now type<br />
<br />
/sfilter<br />
<br />
in any buffer, and the smart filter will only be enabled for that buffer.<br />
<br />
The following alias will remove a previously enabled smart filter in the current buffer. Add the alias:<br />
<br />
/alias add rmsfilter filter del irc_smart_$server_$channel<br />
<br />
and execute it by<br />
<br />
/rmsfilter<br />
<br />
=== Exec command ===<br />
A new plugin called "exec" has been added, with command {{ic|/exec}}. It will execute external command and can display output to the current buffer with the '''-o''' option or locally (default).<br />
<br />
=== Key Bindings ===<br />
<br />
Some helpful bindings:<br />
<br />
To use ctrl-left/right arrow keys to jump to next/previous words on the input line:<br />
<br />
/key bind meta2-1;5D /input move_previous_word<br />
/key bind meta2-1;5C /input move_next_word<br />
<br />
=== SSH connection lost when idle ===<br />
<br />
If you're connecting to your WeeChat through a remote shell using SSH, for example running it in [[screen]] or [[tmux]] you might experience getting disconnected after a while when idle. There are multiple factors in play why this might happen, but the easiest way to change this is to force the connection to be kept alive by appending this to your SSH-configuration on the remote shell.<br />
<br />
This has nothing to do with WeeChat itself, but losing connection when idle won't happen with it's alternative [[irssi]] by default, and thus is a common situation for those converting to WeeChat. <br />
<br />
{{hc|# /etc/ssh/sshd_config|2=<br />
ClientAliveInterval 300}}<br />
<br />
Or have a look at [https://mosh.org Mosh].<br />
<br />
=== OTR ===<br />
<br />
Install {{AUR|python2-potr}} and enable the script '''otr.py'''. Then:<br />
<br />
/query <nick><br />
/otr start<br />
<br />
Get help on the plugin with:<br />
<br />
/help otr<br />
<br />
=== Slack ===<br />
<br />
[https://slack.com/ Slack] is a platform for team communication; an IRC on steroids. Thanks to its open API, it is possible to connect to your slack team using weechat.<br />
<br />
==== IRC gateway ====<br />
<br />
Once weechat is running, all you have to is add a new server this way:<br />
<br />
{{ic|<nowiki>/server add NAME HOST/6667 -autoconnect -ssl -ssl_dhkey_size=512 -password=PASSWORD -username=USERNAME -nicks=NICK</nowiki>}}<br />
<br />
where:<br />
<br />
* '''NAME''' is the name you want to give to the server<br />
* '''HOST''' is the the Host as provided on the Gateways page of your slack team<br />
* '''PASSWORD''' is the Pass as provided on the Gateways page of your slack team<br />
* '''USERNAME''' is the User as provided on the Gateways page of your slack team<br />
* '''NICK''' is your Slack username.<br />
<br />
===== Upload file =====<br />
<br />
To upload a file, run this following command from your shell :<br />
<br />
{{ic|<nowiki>curl -F file=@/path/to/file -F channels=CHAN -F token=XXX https://slack.com/api/files.upload</nowiki>}}<br />
<br />
where:<br />
<br />
* '''CHAN''' is the channel ID as provided on the Gateways page of your slack team<br />
* '''XXX''' is the team token as provided on the Gateways page of your slack team<br />
<br />
==== Native client ====<br />
<br />
There is a native client for slack: [https://github.com/rawdigits/wee-slack wee-slack]<br />
<br />
You need to install the python2 librairy websocket-client:<br />
<br />
{{ic|<nowiki>pacman -S python2-websocket-client</nowiki>}}<br />
<br />
Then install the wee-chat plugin into the weechat configuration folder<br />
<br />
{{ic|<nowiki>curl -o ~/.weechat/python/autoload/wee_slack.py https://raw.githubusercontent.com/rawdigits/wee-slack/master/wee_slack.py</nowiki>}}<br />
<br />
Run {{ic|<nowiki>/python reload</nowiki>}} to load the new plugin<br />
<br />
You will need an access token. You can grab one at [https://api.slack.com/docs/oauth-test-tokens here]<br />
<br />
Once weechat is running, register your token into weechat:<br />
<br />
{{ic|<nowiki>/set plugins.var.python.slack_extension.slack_api_token [YOUR_SLACK_TOKEN]</nowiki>}}<br />
<br />
And finally:<br />
<br />
{{ic|<nowiki>/save</nowiki>}}<br />
<br />
{{ic|<nowiki>/python reload</nowiki>}}<br />
<br />
===== Upload file =====<br />
<br />
To upload a file enter the following command into weechat:<br />
<br />
{{ic|<nowiki>/slack upload [file_path]</nowiki>}}<br />
<br />
=== Desktop notifications ===<br />
<br />
To receive desktop notifications for mentions or private messages, the [https://github.com/s3rvac/weechat-notify-send weechat-notify-send] script by Petr Zemek can be used.<br />
<br />
To install, use:<br />
<br />
cd ~/.weechat/python<br />
curl -O <nowiki>https://raw.githubusercontent.com/s3rvac/weechat-notify-send/master/notify_send.py</nowiki><br />
ln -s ../notify_send.py autoload/<br />
<br />
The script uses {{Pkg|libnotify}} and is known to work with both KDE and Gnome.<br />
<br />
=== Mobile device notifications ===<br />
<br />
To receive notifications for mentions or private messages to an Android mobile device, you can use the [https://irssinotifier.appspot.com/ IrssiNotifier] port to WeeChat from [https://www.weechat.org/files/scripts/irssinotifier.py here]. This script requires a Google Account, and a registration step with the service provider to obtain an API key. Then, install the plugin<br />
<br />
cd ~/.weechat/python<br />
curl -O <nowiki>https://www.weechat.org/files/scripts/irssinotifier.py</nowiki><br />
ln -s ../irssinotifier.py autoload/<br />
<br />
and intialize the API token and end-to-end encryption password in WeeChat<br />
<br />
/set plugins.var.python.irssinotifier.api_token your-api-token-from-website<br />
/set plugins.var.python.irssinotifier.encryption_password your-password-same-as-in-andoid-app<br />
/save<br />
<br />
An alternative that does not require a Google Account is a Ruby script for [https://www.notifymyandroid.com NotifyMyAndroid.com] from [https://github.com/jamtur01/nma-weechat here], with a similar installation procedure to the above, but into {{ic|~/.weechat/ruby}}.<br />
<br />
== Troubleshooting ==<br />
<br />
=== Errors loading plugins ===<br />
<br />
You may see output like the following in the main window after starting '''weechat''':<br />
<br />
{{bc|<nowiki>13:26:10 =!= | Error: unable to load plugin "/usr/lib/weechat/plugins/ruby.so": libruby.so.2.4: cannot open shared object file: No such file or directory<br />
13:26:10 =!= | If you're trying to load a script and not a C plugin, try command to load scripts (/perl, /python, ...)<br />
13:26:10 =!= | Error: unable to load plugin "/usr/lib/weechat/plugins/lua.so": liblua.so.5.3: cannot open shared object file: No such file or directory<br />
13:26:10 =!= | If you're trying to load a script and not a C plugin, try command to load scripts (/perl, /python, ...)<br />
13:26:10 =!= | Error: unable to load plugin "/usr/lib/weechat/plugins/aspell.so": libaspell.so.15: cannot open shared object file: No such file or directory<br />
13:26:10 =!= | If you're trying to load a script and not a C plugin, try command to load scripts (/perl, /python, ...)<br />
13:26:10 =!= | Error: unable to load plugin "/usr/lib/weechat/plugins/tcl.so": libtcl8.6.so: cannot open shared object file: No such file or directory<br />
13:26:10 =!= | If you're trying to load a script and not a C plugin, try command to load scripts (/perl, /python, ...)</nowiki>|bc}}<br />
<br />
The default configuration for weechat attempts to load all plugins found in /usr/lib/weechat/plugins which in this case includes ruby, lua, aspell and tcl. These packages are not required by the weechat package and may not be installed on your machine. There are two options if these errors bother you:<br />
<br />
# [[Packages|Install]] [https://www.archlinux.org/packages/?name=ruby ruby], [https://www.archlinux.org/packages/?name=lua lua], [https://www.archlinux.org/packages/?name=aspell aspell] and/or [https://www.archlinux.org/packages/?name=tcl tcl] from the [[official repositories]].<br />
# Or, run {{ic|/set weechat.plugin.autoload "*,!ruby,!lua,!aspell,!tcl"}} which will prevent loading those plugins with a bang (!) prefix.<br />
<br />
== Getting Help ==<br />
<br />
To access WeeChat's built-in help, simply type<br />
<br />
/help<br />
<br />
and the help will be displayed in the main buffer (usually buffer 1).<br />
<br />
== See also ==<br />
<br />
* [https://www.weechat.org Home Page]<br />
* [https://www.weechat.org/doc/ WeeChat Documentation]<br />
* [https://www.weechat.org/scripts/ WeeChat Scripts]<br />
* [https://weechat.org/blog/ WeeChat Development Blog]<br />
<br />
=== Guides ===<br />
* [https://weechat.org/files/doc/stable/weechat_quickstart.en.html Official WeeChat quick start guide] - a good place to start<br />
* [https://gist.github.com/pascalpoitras/8406501 My always up-to-date WeeChat configuration] - FiXato (weechat-dev) <br />
* [https://robots.thoughtbot.com/weechat-for-slacks-irc-gateway Thoughtbot article on weechat and slack]</div>Cirrushttps://wiki.archlinux.org/index.php?title=WeeChat&diff=480528WeeChat2017-06-26T21:06:44Z<p>Cirrus: /* Guides */ the weechat dev asks i put this page as his blog is no more</p>
<hr />
<div>[[Category:Internet Relay Chat]]<br />
[[ja:WeeChat]]<br />
{{Style|See [[Help:Style]] and related.}}<br />
<br />
{{Related articles start}}<br />
{{Related|IRC channels}}<br />
{{Related|IRC}}<br />
{{Related|irssi}}<br />
{{Related|HexChat}}<br />
{{Related articles end}}<br />
'''WeeChat''' is a highly extendable and feature rich [[wikipedia:Internet Relay Chat|IRC]] Client currently under heavy development.<br />
<br />
== Installing ==<br />
<br />
[[Install]] the {{Pkg|weechat}} package, or {{AUR|weechat-git}} for the development version.<br />
<br />
== Running WeeChat==<br />
<br />
WeeChat is going to have multiple interfaces at some point, run '''weechat-[interface]''' to start WeeChat. <br />
<br />
As WeeChat currently only has an Ncurses interface. The command to start WeeChat is:<br />
<br />
$ weechat<br />
<br />
== Configuration ==<br />
<br />
You can configure WeeChat in 3 ways: using WeeChat's internal commands; using '''iset'''; or by editing the .conf files directly. WeeChat will automatically save settings on exit or when you run {{ic|/save}}, so if you are editing a .conf file in an editor, be sure to run {{ic|/reload}} from the console before exiting, otherwise your changes will be lost.<br />
<br />
=== Internal commands ===<br />
<br />
The {{ic|/set}} command follows this structure:<br />
{{ic|/set [file.name].[section].[directive]}}<br />
<br />
You can get a list of all configurable options by typing {{ic|/set}} in the '''weechat''' buffer window. Since there are nearly 600 default configurable options, you can search through them with a wildcard syntax: {{ic|/set irc.server.*}} or {{ic|/set *server*}} as an example. You can get help on each option with the {{ic|/help}} command: <br />
<br />
/help irc.server.freenode.autoconnect<br />
<br />
=== Internal menu-based ===<br />
<br />
For a more convenient method, install the '''iset''' script. If you have weechat 0.3.9 or newer, run:<br />
<br />
/script install iset.pl<br />
<br />
In older versions, use {{ic|/weeget install iset}}, or download [https://www.weechat.org/scripts/source/stable/iset.pl.html/ iset.pl] into your {{ic|~/.weechat/perl/autoload}} directory manually.<br />
<br />
Afterwards, run<br />
<br />
/iset<br />
<br />
to get a buffer with all configuration options.<br />
<br />
=== Configuration Files ===<br />
<br />
The .conf files for WeeChat are saved to {{ic|~/.weechat}}. These files are not commented. Detailed information can be found within the program itself (see '''Internally''' above), or WeeChat's [https://www.weechat.org/files/doc/stable/weechat_user.en.html user guide].<br />
<br />
{{Tip|in case you want to move {{ic|.weechat}} directory somewhere else (like in your '''$XDG_CONFIG_HOME'''), use this option: {{ic|$weechat -d $XDG_CONFIG_HOME/weechat}} or set the environment variable {{ic|WEECHAT_HOME}}.}}<br />
<br />
== Connecting to a server ==<br />
<br />
{{Note| Using '''/connect''' to connect to a temporary server is disabled by default if you're using 1.1+ [https://weechat.org/files/releasenotes/ReleaseNotes-devel.html#_temporary_servers_disabled_by_default_with_connect Release Note]<br />
<br />
Enable by '''/set irc.look.temporary_servers on'''<br />
<br />
}}<br />
<br />
You can connect to a IRC server by using '''/connect'''.<br />
<br />
/connect chat.freenode.net<br />
<br />
Or if there is already a '''Server''' setup you can use:<br />
<br />
/connect freenode<br />
<br />
== Creating a Server profile ==<br />
<br />
If you plan on connecting to a server more than once it may be beneficial to create a '''Server'''.<br />
<br />
/server add example irc.example.net/6667<br />
<br />
Would create the server '''example''' which would connect to '''irc.example.net''' on port '''6667'''<br />
<br />
See the WeeChat documentation and '''/help server''' for more information.<br />
<br />
== Configuring SSL ==<br />
<br />
Many IRC servers, including [https://freenode.net/ freenode] where [[IRC channel|#archlinux]] is, support SSL.<br />
<br />
If you're making a server with '''/server''', add the SSL port (usually 6697) and '''-ssl''' to the end of the line. For example:<br />
<br />
/server add freenode chat.freenode.net/6697 -ssl<br />
<br />
You can do the same thing if using '''/connect'''.<br />
<br />
/connect chat.freenode.net/6697 -ssl<br />
<br />
{{Warning|Some servers need the '''ssl_dhkey_size''' value changed to something lower. For example, if you're using freenode you'll need to set '''/set irc.server.freenode.ssl_dhkey_size 1024''' or '''/set irc.server.chat.freenode.net.ssl_dhkey_size 1024''' (see the server log)}}<br />
<br />
{{Note|Different servers may have a different port than 6697 - this is server specific.}}<br />
<br />
You may also want to change the location where WeeChat looks for trusted authorities (the default value is {{ic|%h/ssl/CAs.pem}} which translates to {{ic|~/.weechat/ssl/CAs.pem)}}:<br />
<br />
/set weechat.network.gnutls_ca_file "/etc/ssl/certs/ca-certificates.crt"<br />
<br />
== Tips and Tricks ==<br />
<br />
=== Upgrading ===<br />
<br />
WeeChat can be upgraded without disconnecting from the IRC servers (non-SSL connections only):<br />
<br />
/upgrade<br />
<br />
This will load the new WeeChat binary and reload the current configuration.<br />
<br />
=== Aliases ===<br />
<br />
Aliases can be created to simplify commonly executed commands. A nice example is Wraithan's '''smart filter''' alias:<br />
<br />
'''Smart Filter'''<br />
<br />
First, we need to enable smart filters:<br />
<br />
/set irc.look.smart_filter "on"<br />
<br />
Next, we will create the '''sfilter''' alias:<br />
<br />
/alias add sfilter filter add irc_smart_$server_$channel irc.$server.$channel irc_smart_filter *<br />
<br />
We can now type<br />
<br />
/sfilter<br />
<br />
in any buffer, and the smart filter will only be enabled for that buffer.<br />
<br />
The following alias will remove a previously enabled smart filter in the current buffer. Add the alias:<br />
<br />
/alias add rmsfilter filter del irc_smart_$server_$channel<br />
<br />
and execute it by<br />
<br />
/rmsfilter<br />
<br />
=== Exec command ===<br />
A new plugin called "exec" has been added, with command {{ic|/exec}}. It will execute external command and can display output to the current buffer with the '''-o''' option or locally (default).<br />
<br />
=== Key Bindings ===<br />
<br />
Some helpful bindings:<br />
<br />
To use ctrl-left/right arrow keys to jump to next/previous words on the input line:<br />
<br />
/key bind meta2-1;5D /input move_previous_word<br />
/key bind meta2-1;5C /input move_next_word<br />
<br />
=== SSH connection lost when idle ===<br />
<br />
If you're connecting to your WeeChat through a remote shell using SSH, for example running it in [[screen]] or [[tmux]] you might experience getting disconnected after a while when idle. There are multiple factors in play why this might happen, but the easiest way to change this is to force the connection to be kept alive by appending this to your SSH-configuration on the remote shell.<br />
<br />
This has nothing to do with WeeChat itself, but losing connection when idle won't happen with it's alternative [[irssi]] by default, and thus is a common situation for those converting to WeeChat. <br />
<br />
{{hc|# /etc/ssh/sshd_config|2=<br />
ClientAliveInterval 300}}<br />
<br />
Or have a look at [https://mosh.org Mosh].<br />
<br />
=== OTR ===<br />
<br />
Install {{AUR|python2-potr}} and enable the script '''otr.py'''. Then:<br />
<br />
/query <nick><br />
/otr start<br />
<br />
Get help on the plugin with:<br />
<br />
/help otr<br />
<br />
=== Slack ===<br />
<br />
[https://slack.com/ Slack] is a platform for team communication; an IRC on steroids. Thanks to its open API, it is possible to connect to your slack team using weechat.<br />
<br />
==== IRC gateway ====<br />
<br />
Once weechat is running, all you have to is add a new server this way:<br />
<br />
{{ic|<nowiki>/server add NAME HOST/6667 -autoconnect -ssl -ssl_dhkey_size=512 -password=PASSWORD -username=USERNAME -nicks=NICK</nowiki>}}<br />
<br />
where:<br />
<br />
* '''NAME''' is the name you want to give to the server<br />
* '''HOST''' is the the Host as provided on the Gateways page of your slack team<br />
* '''PASSWORD''' is the Pass as provided on the Gateways page of your slack team<br />
* '''USERNAME''' is the User as provided on the Gateways page of your slack team<br />
* '''NICK''' is your Slack username.<br />
<br />
===== Upload file =====<br />
<br />
To upload a file, run this following command from your shell :<br />
<br />
{{ic|<nowiki>curl -F file=@/path/to/file -F channels=CHAN -F token=XXX https://slack.com/api/files.upload</nowiki>}}<br />
<br />
where:<br />
<br />
* '''CHAN''' is the channel ID as provided on the Gateways page of your slack team<br />
* '''XXX''' is the team token as provided on the Gateways page of your slack team<br />
<br />
==== Native client ====<br />
<br />
There is a native client for slack: [https://github.com/rawdigits/wee-slack wee-slack]<br />
<br />
You need to install the python2 librairy websocket-client:<br />
<br />
{{ic|<nowiki>pacman -S python2-websocket-client</nowiki>}}<br />
<br />
Then install the wee-chat plugin into the weechat configuration folder<br />
<br />
{{ic|<nowiki>curl -o ~/.weechat/python/autoload/wee_slack.py https://raw.githubusercontent.com/rawdigits/wee-slack/master/wee_slack.py</nowiki>}}<br />
<br />
Run {{ic|<nowiki>/python reload</nowiki>}} to load the new plugin<br />
<br />
You will need an access token. You can grab one at [https://api.slack.com/docs/oauth-test-tokens here]<br />
<br />
Once weechat is running, register your token into weechat:<br />
<br />
{{ic|<nowiki>/set plugins.var.python.slack_extension.slack_api_token [YOUR_SLACK_TOKEN]</nowiki>}}<br />
<br />
And finally:<br />
<br />
{{ic|<nowiki>/save</nowiki>}}<br />
<br />
{{ic|<nowiki>/python reload</nowiki>}}<br />
<br />
===== Upload file =====<br />
<br />
To upload a file enter the following command into weechat:<br />
<br />
{{ic|<nowiki>/slack upload [file_path]</nowiki>}}<br />
<br />
=== Desktop notifications ===<br />
<br />
To receive desktop notifications for mentions or private messages, the [https://github.com/s3rvac/weechat-notify-send weechat-notify-send] script by Petr Zemek can be used.<br />
<br />
To install, use:<br />
<br />
cd ~/.weechat/python<br />
curl -O <nowiki>https://raw.githubusercontent.com/s3rvac/weechat-notify-send/master/notify_send.py</nowiki><br />
ln -s ../notify_send.py autoload/<br />
<br />
The script uses {{Pkg|libnotify}} and is known to work with both KDE and Gnome.<br />
<br />
=== Mobile device notifications ===<br />
<br />
To receive notifications for mentions or private messages to an Android mobile device, you can use the [https://irssinotifier.appspot.com/ IrssiNotifier] port to WeeChat from [https://www.weechat.org/files/scripts/irssinotifier.py here]. This script requires a Google Account, and a registration step with the service provider to obtain an API key. Then, install the plugin<br />
<br />
cd ~/.weechat/python<br />
curl -O <nowiki>https://www.weechat.org/files/scripts/irssinotifier.py</nowiki><br />
ln -s ../irssinotifier.py autoload/<br />
<br />
and intialize the API token and end-to-end encryption password in WeeChat<br />
<br />
/set plugins.var.python.irssinotifier.api_token your-api-token-from-website<br />
/set plugins.var.python.irssinotifier.encryption_password your-password-same-as-in-andoid-app<br />
/save<br />
<br />
An alternative that does not require a Google Account is a Ruby script for [https://www.notifymyandroid.com NotifyMyAndroid.com] from [https://github.com/jamtur01/nma-weechat here], with a similar installation procedure to the above, but into {{ic|~/.weechat/ruby}}.<br />
<br />
== Troubleshooting ==<br />
<br />
=== Errors loading plugins ===<br />
<br />
You may see output like the following in the main window after starting '''weechat''':<br />
<br />
{{bc|<nowiki>13:26:10 =!= | Error: unable to load plugin "/usr/lib/weechat/plugins/ruby.so": libruby.so.2.4: cannot open shared object file: No such file or directory<br />
13:26:10 =!= | If you're trying to load a script and not a C plugin, try command to load scripts (/perl, /python, ...)<br />
13:26:10 =!= | Error: unable to load plugin "/usr/lib/weechat/plugins/lua.so": liblua.so.5.3: cannot open shared object file: No such file or directory<br />
13:26:10 =!= | If you're trying to load a script and not a C plugin, try command to load scripts (/perl, /python, ...)<br />
13:26:10 =!= | Error: unable to load plugin "/usr/lib/weechat/plugins/aspell.so": libaspell.so.15: cannot open shared object file: No such file or directory<br />
13:26:10 =!= | If you're trying to load a script and not a C plugin, try command to load scripts (/perl, /python, ...)<br />
13:26:10 =!= | Error: unable to load plugin "/usr/lib/weechat/plugins/tcl.so": libtcl8.6.so: cannot open shared object file: No such file or directory<br />
13:26:10 =!= | If you're trying to load a script and not a C plugin, try command to load scripts (/perl, /python, ...)</nowiki>|bc}}<br />
<br />
The default configuration for weechat attempts to load all plugins found in /usr/lib/weechat/plugins which in this case includes ruby, lua, aspell and tcl. These packages are not required by the weechat package and may not be installed on your machine. There are two options if these errors bother you:<br />
<br />
# [[Packages|Install]] [https://www.archlinux.org/packages/?name=ruby ruby], [https://www.archlinux.org/packages/?name=lua lua], [https://www.archlinux.org/packages/?name=aspell aspell] and/or [https://www.archlinux.org/packages/?name=tcl tcl] from the [[official repositories]].<br />
# Or, run {{ic|/set weechat.plugin.autoload "*,!ruby,!lua,!aspell,!tcl"}} which will prevent loading those plugins with a bang (!) prefix.<br />
<br />
== Getting Help ==<br />
<br />
To access WeeChat's built-in help, simply type<br />
<br />
/help<br />
<br />
and the help will be displayed in the main buffer (usually buffer 1).<br />
<br />
== See also ==<br />
<br />
* [https://www.weechat.org Home Page]<br />
* [https://www.weechat.org/doc/ WeeChat Documentation]<br />
* [https://www.weechat.org/scripts/ WeeChat Scripts]<br />
* [https://weechat.org/blog/ WeeChat Development Blog]<br />
<br />
=== Guides ===<br />
* [https://weechat.org/files/doc/stable/weechat_quickstart.en.html Official WeeChat quick start guide] - a good place to start<br />
* [https://gist.github.com/pascalpoitras/8406501 My always up-to-date WeeChat configuration (weechat-dev) ]<br />
* [https://robots.thoughtbot.com/weechat-for-slacks-irc-gateway Thoughtbot article on weechat and slack]</div>Cirrushttps://wiki.archlinux.org/index.php?title=WeeChat&diff=480484WeeChat2017-06-26T00:09:14Z<p>Cirrus: /* Guides */ his site shows as insecure connection, i will have a word, so for now just pointing to archived</p>
<hr />
<div>[[Category:Internet Relay Chat]]<br />
[[ja:WeeChat]]<br />
{{Style|See [[Help:Style]] and related.}}<br />
<br />
{{Related articles start}}<br />
{{Related|IRC channels}}<br />
{{Related|IRC}}<br />
{{Related|irssi}}<br />
{{Related|HexChat}}<br />
{{Related articles end}}<br />
'''WeeChat''' is a highly extendable and feature rich [[wikipedia:Internet Relay Chat|IRC]] Client currently under heavy development.<br />
<br />
== Installing ==<br />
<br />
[[Install]] the {{Pkg|weechat}} package, or {{AUR|weechat-git}} for the development version.<br />
<br />
== Running WeeChat==<br />
<br />
WeeChat is going to have multiple interfaces at some point, run '''weechat-[interface]''' to start WeeChat. <br />
<br />
As WeeChat currently only has an Ncurses interface. The command to start WeeChat is:<br />
<br />
$ weechat<br />
<br />
== Configuration ==<br />
<br />
You can configure WeeChat in 3 ways: using WeeChat's internal commands; using '''iset'''; or by editing the .conf files directly. WeeChat will automatically save settings on exit or when you run {{ic|/save}}, so if you are editing a .conf file in an editor, be sure to run {{ic|/reload}} from the console before exiting, otherwise your changes will be lost.<br />
<br />
=== Internal commands ===<br />
<br />
The {{ic|/set}} command follows this structure:<br />
{{ic|/set [file.name].[section].[directive]}}<br />
<br />
You can get a list of all configurable options by typing {{ic|/set}} in the '''weechat''' buffer window. Since there are nearly 600 default configurable options, you can search through them with a wildcard syntax: {{ic|/set irc.server.*}} or {{ic|/set *server*}} as an example. You can get help on each option with the {{ic|/help}} command: <br />
<br />
/help irc.server.freenode.autoconnect<br />
<br />
=== Internal menu-based ===<br />
<br />
For a more convenient method, install the '''iset''' script. If you have weechat 0.3.9 or newer, run:<br />
<br />
/script install iset.pl<br />
<br />
In older versions, use {{ic|/weeget install iset}}, or download [https://www.weechat.org/scripts/source/stable/iset.pl.html/ iset.pl] into your {{ic|~/.weechat/perl/autoload}} directory manually.<br />
<br />
Afterwards, run<br />
<br />
/iset<br />
<br />
to get a buffer with all configuration options.<br />
<br />
=== Configuration Files ===<br />
<br />
The .conf files for WeeChat are saved to {{ic|~/.weechat}}. These files are not commented. Detailed information can be found within the program itself (see '''Internally''' above), or WeeChat's [https://www.weechat.org/files/doc/stable/weechat_user.en.html user guide].<br />
<br />
{{Tip|in case you want to move {{ic|.weechat}} directory somewhere else (like in your '''$XDG_CONFIG_HOME'''), use this option: {{ic|$weechat -d $XDG_CONFIG_HOME/weechat}} or set the environment variable {{ic|WEECHAT_HOME}}.}}<br />
<br />
== Connecting to a server ==<br />
<br />
{{Note| Using '''/connect''' to connect to a temporary server is disabled by default if you're using 1.1+ [https://weechat.org/files/releasenotes/ReleaseNotes-devel.html#_temporary_servers_disabled_by_default_with_connect Release Note]<br />
<br />
Enable by '''/set irc.look.temporary_servers on'''<br />
<br />
}}<br />
<br />
You can connect to a IRC server by using '''/connect'''.<br />
<br />
/connect chat.freenode.net<br />
<br />
Or if there is already a '''Server''' setup you can use:<br />
<br />
/connect freenode<br />
<br />
== Creating a Server profile ==<br />
<br />
If you plan on connecting to a server more than once it may be beneficial to create a '''Server'''.<br />
<br />
/server add example irc.example.net/6667<br />
<br />
Would create the server '''example''' which would connect to '''irc.example.net''' on port '''6667'''<br />
<br />
See the WeeChat documentation and '''/help server''' for more information.<br />
<br />
== Configuring SSL ==<br />
<br />
Many IRC servers, including [https://freenode.net/ freenode] where [[IRC channel|#archlinux]] is, support SSL.<br />
<br />
If you're making a server with '''/server''', add the SSL port (usually 6697) and '''-ssl''' to the end of the line. For example:<br />
<br />
/server add freenode chat.freenode.net/6697 -ssl<br />
<br />
You can do the same thing if using '''/connect'''.<br />
<br />
/connect chat.freenode.net/6697 -ssl<br />
<br />
{{Warning|Some servers need the '''ssl_dhkey_size''' value changed to something lower. For example, if you're using freenode you'll need to set '''/set irc.server.freenode.ssl_dhkey_size 1024''' or '''/set irc.server.chat.freenode.net.ssl_dhkey_size 1024''' (see the server log)}}<br />
<br />
{{Note|Different servers may have a different port than 6697 - this is server specific.}}<br />
<br />
You may also want to change the location where WeeChat looks for trusted authorities (the default value is {{ic|%h/ssl/CAs.pem}} which translates to {{ic|~/.weechat/ssl/CAs.pem)}}:<br />
<br />
/set weechat.network.gnutls_ca_file "/etc/ssl/certs/ca-certificates.crt"<br />
<br />
== Tips and Tricks ==<br />
<br />
=== Upgrading ===<br />
<br />
WeeChat can be upgraded without disconnecting from the IRC servers (non-SSL connections only):<br />
<br />
/upgrade<br />
<br />
This will load the new WeeChat binary and reload the current configuration.<br />
<br />
=== Aliases ===<br />
<br />
Aliases can be created to simplify commonly executed commands. A nice example is Wraithan's '''smart filter''' alias:<br />
<br />
'''Smart Filter'''<br />
<br />
First, we need to enable smart filters:<br />
<br />
/set irc.look.smart_filter "on"<br />
<br />
Next, we will create the '''sfilter''' alias:<br />
<br />
/alias add sfilter filter add irc_smart_$server_$channel irc.$server.$channel irc_smart_filter *<br />
<br />
We can now type<br />
<br />
/sfilter<br />
<br />
in any buffer, and the smart filter will only be enabled for that buffer.<br />
<br />
The following alias will remove a previously enabled smart filter in the current buffer. Add the alias:<br />
<br />
/alias add rmsfilter filter del irc_smart_$server_$channel<br />
<br />
and execute it by<br />
<br />
/rmsfilter<br />
<br />
=== Exec command ===<br />
A new plugin called "exec" has been added, with command {{ic|/exec}}. It will execute external command and can display output to the current buffer with the '''-o''' option or locally (default).<br />
<br />
=== Key Bindings ===<br />
<br />
Some helpful bindings:<br />
<br />
To use ctrl-left/right arrow keys to jump to next/previous words on the input line:<br />
<br />
/key bind meta2-1;5D /input move_previous_word<br />
/key bind meta2-1;5C /input move_next_word<br />
<br />
=== SSH connection lost when idle ===<br />
<br />
If you're connecting to your WeeChat through a remote shell using SSH, for example running it in [[screen]] or [[tmux]] you might experience getting disconnected after a while when idle. There are multiple factors in play why this might happen, but the easiest way to change this is to force the connection to be kept alive by appending this to your SSH-configuration on the remote shell.<br />
<br />
This has nothing to do with WeeChat itself, but losing connection when idle won't happen with it's alternative [[irssi]] by default, and thus is a common situation for those converting to WeeChat. <br />
<br />
{{hc|# /etc/ssh/sshd_config|2=<br />
ClientAliveInterval 300}}<br />
<br />
Or have a look at [https://mosh.org Mosh].<br />
<br />
=== OTR ===<br />
<br />
Install {{AUR|python2-potr}} and enable the script '''otr.py'''. Then:<br />
<br />
/query <nick><br />
/otr start<br />
<br />
Get help on the plugin with:<br />
<br />
/help otr<br />
<br />
=== Slack ===<br />
<br />
[https://slack.com/ Slack] is a platform for team communication; an IRC on steroids. Thanks to its open API, it is possible to connect to your slack team using weechat.<br />
<br />
==== IRC gateway ====<br />
<br />
Once weechat is running, all you have to is add a new server this way:<br />
<br />
{{ic|<nowiki>/server add NAME HOST/6667 -autoconnect -ssl -ssl_dhkey_size=512 -password=PASSWORD -username=USERNAME -nicks=NICK</nowiki>}}<br />
<br />
where:<br />
<br />
* '''NAME''' is the name you want to give to the server<br />
* '''HOST''' is the the Host as provided on the Gateways page of your slack team<br />
* '''PASSWORD''' is the Pass as provided on the Gateways page of your slack team<br />
* '''USERNAME''' is the User as provided on the Gateways page of your slack team<br />
* '''NICK''' is your Slack username.<br />
<br />
===== Upload file =====<br />
<br />
To upload a file, run this following command from your shell :<br />
<br />
{{ic|<nowiki>curl -F file=@/path/to/file -F channels=CHAN -F token=XXX https://slack.com/api/files.upload</nowiki>}}<br />
<br />
where:<br />
<br />
* '''CHAN''' is the channel ID as provided on the Gateways page of your slack team<br />
* '''XXX''' is the team token as provided on the Gateways page of your slack team<br />
<br />
==== Native client ====<br />
<br />
There is a native client for slack: [https://github.com/rawdigits/wee-slack wee-slack]<br />
<br />
You need to install the python2 librairy websocket-client:<br />
<br />
{{ic|<nowiki>pacman -S python2-websocket-client</nowiki>}}<br />
<br />
Then install the wee-chat plugin into the weechat configuration folder<br />
<br />
{{ic|<nowiki>curl -o ~/.weechat/python/autoload/wee_slack.py https://raw.githubusercontent.com/rawdigits/wee-slack/master/wee_slack.py</nowiki>}}<br />
<br />
Run {{ic|<nowiki>/python reload</nowiki>}} to load the new plugin<br />
<br />
You will need an access token. You can grab one at [https://api.slack.com/docs/oauth-test-tokens here]<br />
<br />
Once weechat is running, register your token into weechat:<br />
<br />
{{ic|<nowiki>/set plugins.var.python.slack_extension.slack_api_token [YOUR_SLACK_TOKEN]</nowiki>}}<br />
<br />
And finally:<br />
<br />
{{ic|<nowiki>/save</nowiki>}}<br />
<br />
{{ic|<nowiki>/python reload</nowiki>}}<br />
<br />
===== Upload file =====<br />
<br />
To upload a file enter the following command into weechat:<br />
<br />
{{ic|<nowiki>/slack upload [file_path]</nowiki>}}<br />
<br />
=== Desktop notifications ===<br />
<br />
To receive desktop notifications for mentions or private messages, the [https://github.com/s3rvac/weechat-notify-send weechat-notify-send] script by Petr Zemek can be used.<br />
<br />
To install, use:<br />
<br />
cd ~/.weechat/python<br />
curl -O <nowiki>https://raw.githubusercontent.com/s3rvac/weechat-notify-send/master/notify_send.py</nowiki><br />
ln -s ../notify_send.py autoload/<br />
<br />
The script uses {{Pkg|libnotify}} and is known to work with both KDE and Gnome.<br />
<br />
=== Mobile device notifications ===<br />
<br />
To receive notifications for mentions or private messages to an Android mobile device, you can use the [https://irssinotifier.appspot.com/ IrssiNotifier] port to WeeChat from [https://www.weechat.org/files/scripts/irssinotifier.py here]. This script requires a Google Account, and a registration step with the service provider to obtain an API key. Then, install the plugin<br />
<br />
cd ~/.weechat/python<br />
curl -O <nowiki>https://www.weechat.org/files/scripts/irssinotifier.py</nowiki><br />
ln -s ../irssinotifier.py autoload/<br />
<br />
and intialize the API token and end-to-end encryption password in WeeChat<br />
<br />
/set plugins.var.python.irssinotifier.api_token your-api-token-from-website<br />
/set plugins.var.python.irssinotifier.encryption_password your-password-same-as-in-andoid-app<br />
/save<br />
<br />
An alternative that does not require a Google Account is a Ruby script for [https://www.notifymyandroid.com NotifyMyAndroid.com] from [https://github.com/jamtur01/nma-weechat here], with a similar installation procedure to the above, but into {{ic|~/.weechat/ruby}}.<br />
<br />
== Troubleshooting ==<br />
<br />
=== Errors loading plugins ===<br />
<br />
You may see output like the following in the main window after starting '''weechat''':<br />
<br />
{{bc|<nowiki>13:26:10 =!= | Error: unable to load plugin "/usr/lib/weechat/plugins/ruby.so": libruby.so.2.4: cannot open shared object file: No such file or directory<br />
13:26:10 =!= | If you're trying to load a script and not a C plugin, try command to load scripts (/perl, /python, ...)<br />
13:26:10 =!= | Error: unable to load plugin "/usr/lib/weechat/plugins/lua.so": liblua.so.5.3: cannot open shared object file: No such file or directory<br />
13:26:10 =!= | If you're trying to load a script and not a C plugin, try command to load scripts (/perl, /python, ...)<br />
13:26:10 =!= | Error: unable to load plugin "/usr/lib/weechat/plugins/aspell.so": libaspell.so.15: cannot open shared object file: No such file or directory<br />
13:26:10 =!= | If you're trying to load a script and not a C plugin, try command to load scripts (/perl, /python, ...)<br />
13:26:10 =!= | Error: unable to load plugin "/usr/lib/weechat/plugins/tcl.so": libtcl8.6.so: cannot open shared object file: No such file or directory<br />
13:26:10 =!= | If you're trying to load a script and not a C plugin, try command to load scripts (/perl, /python, ...)</nowiki>|bc}}<br />
<br />
The default configuration for weechat attempts to load all plugins found in /usr/lib/weechat/plugins which in this case includes ruby, lua, aspell and tcl. These packages are not required by the weechat package and may not be installed on your machine. There are two options if these errors bother you:<br />
<br />
# [[Packages|Install]] [https://www.archlinux.org/packages/?name=ruby ruby], [https://www.archlinux.org/packages/?name=lua lua], [https://www.archlinux.org/packages/?name=aspell aspell] and/or [https://www.archlinux.org/packages/?name=tcl tcl] from the [[official repositories]].<br />
# Or, run {{ic|/set weechat.plugin.autoload "*,!ruby,!lua,!aspell,!tcl"}} which will prevent loading those plugins with a bang (!) prefix.<br />
<br />
== Getting Help ==<br />
<br />
To access WeeChat's built-in help, simply type<br />
<br />
/help<br />
<br />
and the help will be displayed in the main buffer (usually buffer 1).<br />
<br />
== See also ==<br />
<br />
* [https://www.weechat.org Home Page]<br />
* [https://www.weechat.org/doc/ WeeChat Documentation]<br />
* [https://www.weechat.org/scripts/ WeeChat Scripts]<br />
* [https://weechat.org/blog/ WeeChat Development Blog]<br />
<br />
=== Guides ===<br />
* [https://weechat.org/files/doc/stable/weechat_quickstart.en.html Official WeeChat quick start guide] - a good place to start<br />
* [https://archive.fo/4pRaI FiXato's guide to WeeChat]<br />
* [https://robots.thoughtbot.com/weechat-for-slacks-irc-gateway Thoughtbot article on weechat and slack]</div>Cirrushttps://wiki.archlinux.org/index.php?title=Python/Virtual_environment&diff=461754Python/Virtual environment2017-01-06T20:33:59Z<p>Cirrus: /* Python versions */</p>
<hr />
<div>[[Category:Development]]<br />
[[es:Python/Virtual environment]]<br />
[[ja:Python/仮想環境]]<br />
[[zh-cn:Python/Virtualenv]]<br />
''virtualenv'' is a tool used to create an isolated workspace for a [[Python]] application. It has various advantages such as the ability to install modules locally, export a working environment, and execute a [[Python]] program in that environment.<br />
<br />
== Overview ==<br />
<br />
A virtual environment is a directory into which some binaries and shell scripts are installed. The binaries include ''python'' for executing scripts and ''pip'' for installing other modules within the environment. There are also shell scripts (one for [[bash]], csh, and [[fish]]) to activate the environment. Essentially, a virtual environment mimics a full system install of [[Python]] and all of the desired modules without interfering with any system on which the application might run.<br />
<br />
== Installation==<br />
<br />
[[Python]] 3.3+ comes with a tool called ''pyvenv'' and an API called ''venv'' for extending the native implementation. For applications that require an older version of Python, ''virtualenv'' must be used.<br />
<br />
=== Packages ===<br />
<br />
[[Install]] one of these packages from the [[official repositories]] to use a Python virtual environment.<br />
* Python 3.3+: {{pkg|python}}<br />
* Python 3: {{pkg|python-virtualenv}}<br />
* Python 2: {{pkg|python2-virtualenv}}<br />
<br />
== Usage ==<br />
<br />
All three tools use a similar workflow.<br />
<br />
=== Creation ===<br />
<br />
Use ''pyvenv'' or ''virtualenv'' to create the virtual environment within your project directory. Be sure to exclude the venv directory from version control--a copy of {{ic|pip freeze}} will be enough to rebuild it.<br />
<br />
==== pyvenv ====<br />
<br />
This tool is provided by {{pkg|python}} (3.3+).<br />
$ pyvenv venv<br />
<br />
==== virtualenv ====<br />
<br />
Use ''virtualenv'' for Python 3, available in {{pkg|python-virtualenv}}.<br />
$ virtualenv venv<br />
<br />
And ''virtualenv2'' for Python 2, available in {{pkg|python2-virtualenv}}.<br />
$ virtualenv2 venv<br />
<br />
=== Activation ===<br />
<br />
Use one of the provided shell scripts to activate and deactivate the environment. This example assumes bash is used.<br />
<br />
$ source venv/bin/activate<br />
(venv) $<br />
<br />
Once inside the virtual environment, modules can be installed with ''pip'' and scripts can be run as normal.<br />
<br />
To exit the virtual environment, run the function provided by {{ic|bin/activate}}:<br />
<br />
(venv) $ deactivate<br />
<br />
== Python versions ==<br />
<br />
The binary versions depend on which virtual environment tool was used. For instance, the ''python'' command used in the Python 2 example points to {{ic|bin/python2.7}}, while the one in the ''pyvenv'' example points to {{ic|bin/python3.5}}.<br />
<br />
One major difference between ''pyvenv'' and ''virtualenv'' is that the former uses the system's Python binary by default:<br />
$ ls -l pyvenv/bin/python3.5<br />
lrwxrwxrwx 1 foo foo 7 Jun 3 19:57 pyvenv/bin/python3.5 -> /usr/bin/python3<br />
<br />
The ''virtualenv'' tool uses a separate Python binary in the environment directory:<br />
$ ls -l venv3/bin/python3.5<br />
lrwxrwxrwx 1 foo foo 7 Jun 3 19:58 venv3/bin/python3.5 -> python3<br />
<br />
If pacman has updated python and you get errors when using ''virtualenv'' and/or ''pip'' this command will create a virtual environment using the defined version of python, edit to suit:<br />
virtualenv -p /usr/bin/python3.6 <path/to/new/or/existing/virtualenv/><br />
<br />
== virtualenvwrapper ==<br />
<br />
''virtualenvwrapper'' allows more natural command line interaction with your virtual environemnts by exposing several useful commands to create, activate and remove virtual environments. This package is a wrapper for both {{Pkg|python-virtualenv}} and {{Pkg|python2-virtualenv}}.<br />
<br />
=== Installation ===<br />
<br />
[[Install]] the {{Pkg|python-virtualenvwrapper}} package from the [[official repositories]].<br />
<br />
Now add the following lines to your {{ic|~/.bashrc}}:<br />
<br />
$ export WORKON_HOME=~/.virtualenvs<br />
$ source /usr/bin/virtualenvwrapper.sh<br />
<br />
Since python3 is a system-wide default in Arch, in order to be able to create python2 environments, you need to set {{ic|VIRTUALENVWRAPPER_PYTHON}} and {{ic|VIRTUALENVWRAPPER_VIRTUALENV}} prior to sourcing {{ic|virtualenvwrapper.sh}} in your {{ic|~/.bashrc}}:<br />
<br />
export VIRTUALENVWRAPPER_PYTHON=/usr/bin/python2.7<br />
export VIRTUALENVWRAPPER_VIRTUALENV=/usr/bin/virtualenv2<br />
<br />
If you are not using python3 by default (check the output of {{ic|python --version}}) you need to add the following line to your {{ic|~/.bashrc}} prior sourcing the {{ic|virtualenvwrapper.sh}} script.<br />
<br />
export VIRTUALENVWRAPPER_PYTHON=/usr/bin/python3<br />
<br />
Re-open your console and create the {{ic|WORKON_HOME}} folder:<br />
$ mkdir $WORKON_HOME<br />
<br />
=== Basic usage ===<br />
<br />
The main information source on virtualenvwrapper usage (and extension capability) is Doug Hellmann's [http://www.doughellmann.com/docs/virtualenvwrapper/ page].<br />
<br />
Create the virtual environment:<br />
$ mkvirtualenv -p /usr/bin/python2.7 my_env<br />
<br />
Activate the virtual environment:<br />
$ workon my_env<br />
<br />
Install some package inside the virtual environment (say, Django):<br />
(my_env) $ pip install django<br />
<br />
After you have done your things, leave the virtual environment:<br />
(my_env) $ deactivate<br />
<br />
== See also ==<br />
<br />
* [https://docs.python.org/3/library/venv.html Python venv (pyvenv)]<br />
* [https://pypi.python.org/pypi/virtualenv virtualenv Pypi page]<br />
* [http://wiki.pylonshq.com/display/pylonscookbook/Using+a+Virtualenv+Sandbox Tutorial for virtualenv]<br />
* [http://www.doughellmann.com/docs/virtualenvwrapper/ virtualenvwrapper page at Doug Hellmann's]</div>Cirrushttps://wiki.archlinux.org/index.php?title=Python/Virtual_environment&diff=461753Python/Virtual environment2017-01-06T20:32:46Z<p>Cirrus: /* Python versions */</p>
<hr />
<div>[[Category:Development]]<br />
[[es:Python/Virtual environment]]<br />
[[ja:Python/仮想環境]]<br />
[[zh-cn:Python/Virtualenv]]<br />
''virtualenv'' is a tool used to create an isolated workspace for a [[Python]] application. It has various advantages such as the ability to install modules locally, export a working environment, and execute a [[Python]] program in that environment.<br />
<br />
== Overview ==<br />
<br />
A virtual environment is a directory into which some binaries and shell scripts are installed. The binaries include ''python'' for executing scripts and ''pip'' for installing other modules within the environment. There are also shell scripts (one for [[bash]], csh, and [[fish]]) to activate the environment. Essentially, a virtual environment mimics a full system install of [[Python]] and all of the desired modules without interfering with any system on which the application might run.<br />
<br />
== Installation==<br />
<br />
[[Python]] 3.3+ comes with a tool called ''pyvenv'' and an API called ''venv'' for extending the native implementation. For applications that require an older version of Python, ''virtualenv'' must be used.<br />
<br />
=== Packages ===<br />
<br />
[[Install]] one of these packages from the [[official repositories]] to use a Python virtual environment.<br />
* Python 3.3+: {{pkg|python}}<br />
* Python 3: {{pkg|python-virtualenv}}<br />
* Python 2: {{pkg|python2-virtualenv}}<br />
<br />
== Usage ==<br />
<br />
All three tools use a similar workflow.<br />
<br />
=== Creation ===<br />
<br />
Use ''pyvenv'' or ''virtualenv'' to create the virtual environment within your project directory. Be sure to exclude the venv directory from version control--a copy of {{ic|pip freeze}} will be enough to rebuild it.<br />
<br />
==== pyvenv ====<br />
<br />
This tool is provided by {{pkg|python}} (3.3+).<br />
$ pyvenv venv<br />
<br />
==== virtualenv ====<br />
<br />
Use ''virtualenv'' for Python 3, available in {{pkg|python-virtualenv}}.<br />
$ virtualenv venv<br />
<br />
And ''virtualenv2'' for Python 2, available in {{pkg|python2-virtualenv}}.<br />
$ virtualenv2 venv<br />
<br />
=== Activation ===<br />
<br />
Use one of the provided shell scripts to activate and deactivate the environment. This example assumes bash is used.<br />
<br />
$ source venv/bin/activate<br />
(venv) $<br />
<br />
Once inside the virtual environment, modules can be installed with ''pip'' and scripts can be run as normal.<br />
<br />
To exit the virtual environment, run the function provided by {{ic|bin/activate}}:<br />
<br />
(venv) $ deactivate<br />
<br />
== Python versions ==<br />
<br />
The binary versions depend on which virtual environment tool was used. For instance, the ''python'' command used in the Python 2 example points to {{ic|bin/python2.7}}, while the one in the ''pyvenv'' example points to {{ic|bin/python3.5}}.<br />
<br />
One major difference between ''pyvenv'' and ''virtualenv'' is that the former uses the system's Python binary by default:<br />
$ ls -l pyvenv/bin/python3.5<br />
lrwxrwxrwx 1 foo foo 7 Jun 3 19:57 pyvenv/bin/python3.5 -> /usr/bin/python3<br />
<br />
The ''virtualenv'' tool uses a separate Python binary in the environment directory:<br />
$ ls -l venv3/bin/python3.5<br />
lrwxrwxrwx 1 foo foo 7 Jun 3 19:58 venv3/bin/python3.5 -> python3<br />
<br />
If pacman has updated python and you get errors when using ''virtualenv'' and/or ''pip'' this command will create a virtual environment using the defined version python, edit to suit:<br />
virtualenv -p /usr/bin/python3.6 <path/to/new/virtualenv/><br />
<br />
== virtualenvwrapper ==<br />
<br />
''virtualenvwrapper'' allows more natural command line interaction with your virtual environemnts by exposing several useful commands to create, activate and remove virtual environments. This package is a wrapper for both {{Pkg|python-virtualenv}} and {{Pkg|python2-virtualenv}}.<br />
<br />
=== Installation ===<br />
<br />
[[Install]] the {{Pkg|python-virtualenvwrapper}} package from the [[official repositories]].<br />
<br />
Now add the following lines to your {{ic|~/.bashrc}}:<br />
<br />
$ export WORKON_HOME=~/.virtualenvs<br />
$ source /usr/bin/virtualenvwrapper.sh<br />
<br />
Since python3 is a system-wide default in Arch, in order to be able to create python2 environments, you need to set {{ic|VIRTUALENVWRAPPER_PYTHON}} and {{ic|VIRTUALENVWRAPPER_VIRTUALENV}} prior to sourcing {{ic|virtualenvwrapper.sh}} in your {{ic|~/.bashrc}}:<br />
<br />
export VIRTUALENVWRAPPER_PYTHON=/usr/bin/python2.7<br />
export VIRTUALENVWRAPPER_VIRTUALENV=/usr/bin/virtualenv2<br />
<br />
If you are not using python3 by default (check the output of {{ic|python --version}}) you need to add the following line to your {{ic|~/.bashrc}} prior sourcing the {{ic|virtualenvwrapper.sh}} script.<br />
<br />
export VIRTUALENVWRAPPER_PYTHON=/usr/bin/python3<br />
<br />
Re-open your console and create the {{ic|WORKON_HOME}} folder:<br />
$ mkdir $WORKON_HOME<br />
<br />
=== Basic usage ===<br />
<br />
The main information source on virtualenvwrapper usage (and extension capability) is Doug Hellmann's [http://www.doughellmann.com/docs/virtualenvwrapper/ page].<br />
<br />
Create the virtual environment:<br />
$ mkvirtualenv -p /usr/bin/python2.7 my_env<br />
<br />
Activate the virtual environment:<br />
$ workon my_env<br />
<br />
Install some package inside the virtual environment (say, Django):<br />
(my_env) $ pip install django<br />
<br />
After you have done your things, leave the virtual environment:<br />
(my_env) $ deactivate<br />
<br />
== See also ==<br />
<br />
* [https://docs.python.org/3/library/venv.html Python venv (pyvenv)]<br />
* [https://pypi.python.org/pypi/virtualenv virtualenv Pypi page]<br />
* [http://wiki.pylonshq.com/display/pylonscookbook/Using+a+Virtualenv+Sandbox Tutorial for virtualenv]<br />
* [http://www.doughellmann.com/docs/virtualenvwrapper/ virtualenvwrapper page at Doug Hellmann's]</div>Cirrushttps://wiki.archlinux.org/index.php?title=Python/Virtual_environment&diff=461752Python/Virtual environment2017-01-06T20:27:59Z<p>Cirrus: /* Python versions */</p>
<hr />
<div>[[Category:Development]]<br />
[[es:Python/Virtual environment]]<br />
[[ja:Python/仮想環境]]<br />
[[zh-cn:Python/Virtualenv]]<br />
''virtualenv'' is a tool used to create an isolated workspace for a [[Python]] application. It has various advantages such as the ability to install modules locally, export a working environment, and execute a [[Python]] program in that environment.<br />
<br />
== Overview ==<br />
<br />
A virtual environment is a directory into which some binaries and shell scripts are installed. The binaries include ''python'' for executing scripts and ''pip'' for installing other modules within the environment. There are also shell scripts (one for [[bash]], csh, and [[fish]]) to activate the environment. Essentially, a virtual environment mimics a full system install of [[Python]] and all of the desired modules without interfering with any system on which the application might run.<br />
<br />
== Installation==<br />
<br />
[[Python]] 3.3+ comes with a tool called ''pyvenv'' and an API called ''venv'' for extending the native implementation. For applications that require an older version of Python, ''virtualenv'' must be used.<br />
<br />
=== Packages ===<br />
<br />
[[Install]] one of these packages from the [[official repositories]] to use a Python virtual environment.<br />
* Python 3.3+: {{pkg|python}}<br />
* Python 3: {{pkg|python-virtualenv}}<br />
* Python 2: {{pkg|python2-virtualenv}}<br />
<br />
== Usage ==<br />
<br />
All three tools use a similar workflow.<br />
<br />
=== Creation ===<br />
<br />
Use ''pyvenv'' or ''virtualenv'' to create the virtual environment within your project directory. Be sure to exclude the venv directory from version control--a copy of {{ic|pip freeze}} will be enough to rebuild it.<br />
<br />
==== pyvenv ====<br />
<br />
This tool is provided by {{pkg|python}} (3.3+).<br />
$ pyvenv venv<br />
<br />
==== virtualenv ====<br />
<br />
Use ''virtualenv'' for Python 3, available in {{pkg|python-virtualenv}}.<br />
$ virtualenv venv<br />
<br />
And ''virtualenv2'' for Python 2, available in {{pkg|python2-virtualenv}}.<br />
$ virtualenv2 venv<br />
<br />
=== Activation ===<br />
<br />
Use one of the provided shell scripts to activate and deactivate the environment. This example assumes bash is used.<br />
<br />
$ source venv/bin/activate<br />
(venv) $<br />
<br />
Once inside the virtual environment, modules can be installed with ''pip'' and scripts can be run as normal.<br />
<br />
To exit the virtual environment, run the function provided by {{ic|bin/activate}}:<br />
<br />
(venv) $ deactivate<br />
<br />
== Python versions ==<br />
<br />
The binary versions depend on which virtual environment tool was used. For instance, the ''python'' command used in the Python 2 example points to {{ic|bin/python2.7}}, while the one in the ''pyvenv'' example points to {{ic|bin/python3.5}}.<br />
<br />
One major difference between ''pyvenv'' and ''virtualenv'' is that the former uses the system's Python binary by default:<br />
$ ls -l pyvenv/bin/python3.5<br />
lrwxrwxrwx 1 foo foo 7 Jun 3 19:57 pyvenv/bin/python3.5 -> /usr/bin/python3<br />
<br />
The ''virtualenv'' tool uses a separate Python binary in the environment directory:<br />
$ ls -l venv3/bin/python3.5<br />
lrwxrwxrwx 1 foo foo 7 Jun 3 19:58 venv3/bin/python3.5 -> python3<br />
<br />
If pacman has updated python and you get errors when using ''virtualenv'' and/or ''pip'' this command will create a new virtual environment using the most recent python, edit to suit:<br />
virtualenv -p /usr/bin/python3.6 <path/to/new/virtualenv/><br />
<br />
== virtualenvwrapper ==<br />
<br />
''virtualenvwrapper'' allows more natural command line interaction with your virtual environemnts by exposing several useful commands to create, activate and remove virtual environments. This package is a wrapper for both {{Pkg|python-virtualenv}} and {{Pkg|python2-virtualenv}}.<br />
<br />
=== Installation ===<br />
<br />
[[Install]] the {{Pkg|python-virtualenvwrapper}} package from the [[official repositories]].<br />
<br />
Now add the following lines to your {{ic|~/.bashrc}}:<br />
<br />
$ export WORKON_HOME=~/.virtualenvs<br />
$ source /usr/bin/virtualenvwrapper.sh<br />
<br />
Since python3 is a system-wide default in Arch, in order to be able to create python2 environments, you need to set {{ic|VIRTUALENVWRAPPER_PYTHON}} and {{ic|VIRTUALENVWRAPPER_VIRTUALENV}} prior to sourcing {{ic|virtualenvwrapper.sh}} in your {{ic|~/.bashrc}}:<br />
<br />
export VIRTUALENVWRAPPER_PYTHON=/usr/bin/python2.7<br />
export VIRTUALENVWRAPPER_VIRTUALENV=/usr/bin/virtualenv2<br />
<br />
If you are not using python3 by default (check the output of {{ic|python --version}}) you need to add the following line to your {{ic|~/.bashrc}} prior sourcing the {{ic|virtualenvwrapper.sh}} script.<br />
<br />
export VIRTUALENVWRAPPER_PYTHON=/usr/bin/python3<br />
<br />
Re-open your console and create the {{ic|WORKON_HOME}} folder:<br />
$ mkdir $WORKON_HOME<br />
<br />
=== Basic usage ===<br />
<br />
The main information source on virtualenvwrapper usage (and extension capability) is Doug Hellmann's [http://www.doughellmann.com/docs/virtualenvwrapper/ page].<br />
<br />
Create the virtual environment:<br />
$ mkvirtualenv -p /usr/bin/python2.7 my_env<br />
<br />
Activate the virtual environment:<br />
$ workon my_env<br />
<br />
Install some package inside the virtual environment (say, Django):<br />
(my_env) $ pip install django<br />
<br />
After you have done your things, leave the virtual environment:<br />
(my_env) $ deactivate<br />
<br />
== See also ==<br />
<br />
* [https://docs.python.org/3/library/venv.html Python venv (pyvenv)]<br />
* [https://pypi.python.org/pypi/virtualenv virtualenv Pypi page]<br />
* [http://wiki.pylonshq.com/display/pylonscookbook/Using+a+Virtualenv+Sandbox Tutorial for virtualenv]<br />
* [http://www.doughellmann.com/docs/virtualenvwrapper/ virtualenvwrapper page at Doug Hellmann's]</div>Cirrushttps://wiki.archlinux.org/index.php?title=Python/Virtual_environment&diff=461751Python/Virtual environment2017-01-06T20:27:31Z<p>Cirrus: /* Python versions */</p>
<hr />
<div>[[Category:Development]]<br />
[[es:Python/Virtual environment]]<br />
[[ja:Python/仮想環境]]<br />
[[zh-cn:Python/Virtualenv]]<br />
''virtualenv'' is a tool used to create an isolated workspace for a [[Python]] application. It has various advantages such as the ability to install modules locally, export a working environment, and execute a [[Python]] program in that environment.<br />
<br />
== Overview ==<br />
<br />
A virtual environment is a directory into which some binaries and shell scripts are installed. The binaries include ''python'' for executing scripts and ''pip'' for installing other modules within the environment. There are also shell scripts (one for [[bash]], csh, and [[fish]]) to activate the environment. Essentially, a virtual environment mimics a full system install of [[Python]] and all of the desired modules without interfering with any system on which the application might run.<br />
<br />
== Installation==<br />
<br />
[[Python]] 3.3+ comes with a tool called ''pyvenv'' and an API called ''venv'' for extending the native implementation. For applications that require an older version of Python, ''virtualenv'' must be used.<br />
<br />
=== Packages ===<br />
<br />
[[Install]] one of these packages from the [[official repositories]] to use a Python virtual environment.<br />
* Python 3.3+: {{pkg|python}}<br />
* Python 3: {{pkg|python-virtualenv}}<br />
* Python 2: {{pkg|python2-virtualenv}}<br />
<br />
== Usage ==<br />
<br />
All three tools use a similar workflow.<br />
<br />
=== Creation ===<br />
<br />
Use ''pyvenv'' or ''virtualenv'' to create the virtual environment within your project directory. Be sure to exclude the venv directory from version control--a copy of {{ic|pip freeze}} will be enough to rebuild it.<br />
<br />
==== pyvenv ====<br />
<br />
This tool is provided by {{pkg|python}} (3.3+).<br />
$ pyvenv venv<br />
<br />
==== virtualenv ====<br />
<br />
Use ''virtualenv'' for Python 3, available in {{pkg|python-virtualenv}}.<br />
$ virtualenv venv<br />
<br />
And ''virtualenv2'' for Python 2, available in {{pkg|python2-virtualenv}}.<br />
$ virtualenv2 venv<br />
<br />
=== Activation ===<br />
<br />
Use one of the provided shell scripts to activate and deactivate the environment. This example assumes bash is used.<br />
<br />
$ source venv/bin/activate<br />
(venv) $<br />
<br />
Once inside the virtual environment, modules can be installed with ''pip'' and scripts can be run as normal.<br />
<br />
To exit the virtual environment, run the function provided by {{ic|bin/activate}}:<br />
<br />
(venv) $ deactivate<br />
<br />
== Python versions ==<br />
<br />
The binary versions depend on which virtual environment tool was used. For instance, the ''python'' command used in the Python 2 example points to {{ic|bin/python2.7}}, while the one in the ''pyvenv'' example points to {{ic|bin/python3.5}}.<br />
<br />
One major difference between ''pyvenv'' and ''virtualenv'' is that the former uses the system's Python binary by default:<br />
$ ls -l pyvenv/bin/python3.5<br />
lrwxrwxrwx 1 foo foo 7 Jun 3 19:57 pyvenv/bin/python3.5 -> /usr/bin/python3<br />
<br />
The ''virtualenv'' tool uses a separate Python binary in the environment directory:<br />
$ ls -l venv3/bin/python3.5<br />
lrwxrwxrwx 1 foo foo 7 Jun 3 19:58 venv3/bin/python3.5 -> python3<br />
<br />
If pacman has updated python and you get errors when using ''virtualvenv'' and/or ''pip'' this command will create a new virtual environment using the most recent python, edit to suit:<br />
virtualenv -p /usr/bin/python3.6 <path/to/new/virtualenv/><br />
<br />
== virtualenvwrapper ==<br />
<br />
''virtualenvwrapper'' allows more natural command line interaction with your virtual environemnts by exposing several useful commands to create, activate and remove virtual environments. This package is a wrapper for both {{Pkg|python-virtualenv}} and {{Pkg|python2-virtualenv}}.<br />
<br />
=== Installation ===<br />
<br />
[[Install]] the {{Pkg|python-virtualenvwrapper}} package from the [[official repositories]].<br />
<br />
Now add the following lines to your {{ic|~/.bashrc}}:<br />
<br />
$ export WORKON_HOME=~/.virtualenvs<br />
$ source /usr/bin/virtualenvwrapper.sh<br />
<br />
Since python3 is a system-wide default in Arch, in order to be able to create python2 environments, you need to set {{ic|VIRTUALENVWRAPPER_PYTHON}} and {{ic|VIRTUALENVWRAPPER_VIRTUALENV}} prior to sourcing {{ic|virtualenvwrapper.sh}} in your {{ic|~/.bashrc}}:<br />
<br />
export VIRTUALENVWRAPPER_PYTHON=/usr/bin/python2.7<br />
export VIRTUALENVWRAPPER_VIRTUALENV=/usr/bin/virtualenv2<br />
<br />
If you are not using python3 by default (check the output of {{ic|python --version}}) you need to add the following line to your {{ic|~/.bashrc}} prior sourcing the {{ic|virtualenvwrapper.sh}} script.<br />
<br />
export VIRTUALENVWRAPPER_PYTHON=/usr/bin/python3<br />
<br />
Re-open your console and create the {{ic|WORKON_HOME}} folder:<br />
$ mkdir $WORKON_HOME<br />
<br />
=== Basic usage ===<br />
<br />
The main information source on virtualenvwrapper usage (and extension capability) is Doug Hellmann's [http://www.doughellmann.com/docs/virtualenvwrapper/ page].<br />
<br />
Create the virtual environment:<br />
$ mkvirtualenv -p /usr/bin/python2.7 my_env<br />
<br />
Activate the virtual environment:<br />
$ workon my_env<br />
<br />
Install some package inside the virtual environment (say, Django):<br />
(my_env) $ pip install django<br />
<br />
After you have done your things, leave the virtual environment:<br />
(my_env) $ deactivate<br />
<br />
== See also ==<br />
<br />
* [https://docs.python.org/3/library/venv.html Python venv (pyvenv)]<br />
* [https://pypi.python.org/pypi/virtualenv virtualenv Pypi page]<br />
* [http://wiki.pylonshq.com/display/pylonscookbook/Using+a+Virtualenv+Sandbox Tutorial for virtualenv]<br />
* [http://www.doughellmann.com/docs/virtualenvwrapper/ virtualenvwrapper page at Doug Hellmann's]</div>Cirrushttps://wiki.archlinux.org/index.php?title=Python/Virtual_environment&diff=461750Python/Virtual environment2017-01-06T20:26:30Z<p>Cirrus: /* Python versions */</p>
<hr />
<div>[[Category:Development]]<br />
[[es:Python/Virtual environment]]<br />
[[ja:Python/仮想環境]]<br />
[[zh-cn:Python/Virtualenv]]<br />
''virtualenv'' is a tool used to create an isolated workspace for a [[Python]] application. It has various advantages such as the ability to install modules locally, export a working environment, and execute a [[Python]] program in that environment.<br />
<br />
== Overview ==<br />
<br />
A virtual environment is a directory into which some binaries and shell scripts are installed. The binaries include ''python'' for executing scripts and ''pip'' for installing other modules within the environment. There are also shell scripts (one for [[bash]], csh, and [[fish]]) to activate the environment. Essentially, a virtual environment mimics a full system install of [[Python]] and all of the desired modules without interfering with any system on which the application might run.<br />
<br />
== Installation==<br />
<br />
[[Python]] 3.3+ comes with a tool called ''pyvenv'' and an API called ''venv'' for extending the native implementation. For applications that require an older version of Python, ''virtualenv'' must be used.<br />
<br />
=== Packages ===<br />
<br />
[[Install]] one of these packages from the [[official repositories]] to use a Python virtual environment.<br />
* Python 3.3+: {{pkg|python}}<br />
* Python 3: {{pkg|python-virtualenv}}<br />
* Python 2: {{pkg|python2-virtualenv}}<br />
<br />
== Usage ==<br />
<br />
All three tools use a similar workflow.<br />
<br />
=== Creation ===<br />
<br />
Use ''pyvenv'' or ''virtualenv'' to create the virtual environment within your project directory. Be sure to exclude the venv directory from version control--a copy of {{ic|pip freeze}} will be enough to rebuild it.<br />
<br />
==== pyvenv ====<br />
<br />
This tool is provided by {{pkg|python}} (3.3+).<br />
$ pyvenv venv<br />
<br />
==== virtualenv ====<br />
<br />
Use ''virtualenv'' for Python 3, available in {{pkg|python-virtualenv}}.<br />
$ virtualenv venv<br />
<br />
And ''virtualenv2'' for Python 2, available in {{pkg|python2-virtualenv}}.<br />
$ virtualenv2 venv<br />
<br />
=== Activation ===<br />
<br />
Use one of the provided shell scripts to activate and deactivate the environment. This example assumes bash is used.<br />
<br />
$ source venv/bin/activate<br />
(venv) $<br />
<br />
Once inside the virtual environment, modules can be installed with ''pip'' and scripts can be run as normal.<br />
<br />
To exit the virtual environment, run the function provided by {{ic|bin/activate}}:<br />
<br />
(venv) $ deactivate<br />
<br />
== Python versions ==<br />
<br />
The binary versions depend on which virtual environment tool was used. For instance, the ''python'' command used in the Python 2 example points to {{ic|bin/python2.7}}, while the one in the ''pyvenv'' example points to {{ic|bin/python3.5}}.<br />
<br />
One major difference between ''pyvenv'' and ''virtualenv'' is that the former uses the system's Python binary by default:<br />
$ ls -l pyvenv/bin/python3.5<br />
lrwxrwxrwx 1 foo foo 7 Jun 3 19:57 pyvenv/bin/python3.5 -> /usr/bin/python3<br />
<br />
The ''virtualenv'' tool uses a separate Python binary in the environment directory:<br />
$ ls -l venv3/bin/python3.5<br />
lrwxrwxrwx 1 foo foo 7 Jun 3 19:58 venv3/bin/python3.5 -> python3<br />
<br />
<br />
If pacman has updated python and you get errors when using ''virtualvenv'' and/or ''pip'' this command will create a new virtual environment using the most recent python, edit to suit:<br />
virtualenv -p /usr/bin/python3.6 <path/to/new/virtualenv/><br />
<br />
== virtualenvwrapper ==<br />
<br />
''virtualenvwrapper'' allows more natural command line interaction with your virtual environemnts by exposing several useful commands to create, activate and remove virtual environments. This package is a wrapper for both {{Pkg|python-virtualenv}} and {{Pkg|python2-virtualenv}}.<br />
<br />
=== Installation ===<br />
<br />
[[Install]] the {{Pkg|python-virtualenvwrapper}} package from the [[official repositories]].<br />
<br />
Now add the following lines to your {{ic|~/.bashrc}}:<br />
<br />
$ export WORKON_HOME=~/.virtualenvs<br />
$ source /usr/bin/virtualenvwrapper.sh<br />
<br />
Since python3 is a system-wide default in Arch, in order to be able to create python2 environments, you need to set {{ic|VIRTUALENVWRAPPER_PYTHON}} and {{ic|VIRTUALENVWRAPPER_VIRTUALENV}} prior to sourcing {{ic|virtualenvwrapper.sh}} in your {{ic|~/.bashrc}}:<br />
<br />
export VIRTUALENVWRAPPER_PYTHON=/usr/bin/python2.7<br />
export VIRTUALENVWRAPPER_VIRTUALENV=/usr/bin/virtualenv2<br />
<br />
If you are not using python3 by default (check the output of {{ic|python --version}}) you need to add the following line to your {{ic|~/.bashrc}} prior sourcing the {{ic|virtualenvwrapper.sh}} script.<br />
<br />
export VIRTUALENVWRAPPER_PYTHON=/usr/bin/python3<br />
<br />
Re-open your console and create the {{ic|WORKON_HOME}} folder:<br />
$ mkdir $WORKON_HOME<br />
<br />
=== Basic usage ===<br />
<br />
The main information source on virtualenvwrapper usage (and extension capability) is Doug Hellmann's [http://www.doughellmann.com/docs/virtualenvwrapper/ page].<br />
<br />
Create the virtual environment:<br />
$ mkvirtualenv -p /usr/bin/python2.7 my_env<br />
<br />
Activate the virtual environment:<br />
$ workon my_env<br />
<br />
Install some package inside the virtual environment (say, Django):<br />
(my_env) $ pip install django<br />
<br />
After you have done your things, leave the virtual environment:<br />
(my_env) $ deactivate<br />
<br />
== See also ==<br />
<br />
* [https://docs.python.org/3/library/venv.html Python venv (pyvenv)]<br />
* [https://pypi.python.org/pypi/virtualenv virtualenv Pypi page]<br />
* [http://wiki.pylonshq.com/display/pylonscookbook/Using+a+Virtualenv+Sandbox Tutorial for virtualenv]<br />
* [http://www.doughellmann.com/docs/virtualenvwrapper/ virtualenvwrapper page at Doug Hellmann's]</div>Cirrushttps://wiki.archlinux.org/index.php?title=Color_output_in_console&diff=459429Color output in console2016-12-15T20:59:19Z<p>Cirrus: /* Universal wrappers */ Added ccze</p>
<hr />
<div>[[Category:Eye candy]]<br />
[[Category:Command shells]]<br />
[[ja:コンソールのカラー出力]]<br />
[[zh-cn:Color output in console]]<br />
{{Expansion|And maybe create something bigger. Please take active approach if you can add some valuable information.|Talk:Color output in console#Why and what this page is about}}<br />
{{Style|Page is partly a collection of information on different applications, partly begin to lay theory to color output process. Please contribute your knowledge, if you can.}}<br />
{{Related articles start}}<br />
{{Related|Emacs#Custom colors and theme}}<br />
{{Related|nano#Syntax highlighting}}<br />
{{Related articles end}}<br />
This page was created to consolidate colorization of CLI outputs.<br />
<br />
== Applications ==<br />
<br />
=== diff ===<br />
<br />
diffutils from version 3.4 includes the {{ic|--color}} option ([https://lists.gnu.org/archive/html/info-gnu/2016-08/msg00004.html GNU mailing list]).<br />
<br />
$ alias diff='diff --color=auto'<br />
<br />
=== grep ===<br />
<br />
The {{ic|1=--color=auto}} option enables color highlighting. Color codes are emitted only on standard output; not in pipes or redirection.<br />
<br />
Color output in ''grep'' is also useful with [[Wikipedia:regexp|regexp]] tasks.<br />
<br />
Use an [[alias]] to permanently enable this option:<br />
<br />
alias grep='grep --color=auto'<br />
<br />
The {{ic|GREP_COLORS}} variable is used to define colors, and it configures various parts of highlighting.<br />
<br />
See {{man|1|grep}} for more information.<br />
<br />
{{Out of date|GREP_COLOR is deprecated in favor of GREP_COLORS.}}<br />
<br />
The {{ic|GREP_COLOR}} environment variable can be used to define the default highlight color (the default is red). To change the color, find the needed [http://www.tldp.org/HOWTO/Bash-Prompt-HOWTO/x329.html ANSI escape sequence] and apply it with:<br />
<br />
export GREP_COLOR="1;32"<br />
<br />
The {{ic|-n}} option includes file line numbers in the output.<br />
<br />
=== less ===<br />
<br />
==== Environment variables ====<br />
<br />
Add the following lines to your shell configuration file:<br />
<br />
export LESS=-R<br />
export LESS_TERMCAP_mb=$'\E[1;31m' # begin bold<br />
export LESS_TERMCAP_md=$'\E[1;36m' # begin blink<br />
export LESS_TERMCAP_me=$'\E[0m' # reset bold/blink<br />
export LESS_TERMCAP_so=$'\E[01;44;33m' # begin reverse video<br />
export LESS_TERMCAP_se=$'\E[0m' # reset reverse video<br />
export LESS_TERMCAP_us=$'\E[1;32m' # begin underline<br />
export LESS_TERMCAP_ue=$'\E[0m' # reset underline<br />
# and so on<br />
<br />
Change the values ([[Wikipedia:ANSI escape code#Colors|ANSI escape code]]) as you like. [http://boredzo.org/blog/archives/2016-08-15/colorized-man-pages-understood-and-customized This blog post] and the page [[Bash/Prompt customization]] (not bash-specific!) also help.<br />
<br />
{{note|The {{ic|LESS_TERMCAP_''xx''}} variables are currently undocumented in {{man|1|less}}. For a detailed explanation, see [http://unix.stackexchange.com/questions/108699/documentation-on-less-termcap-variables/108840#108840 this answer].}}<br />
<br />
==== Reading from stdin ====<br />
<br />
{{Note|It is recommended to add colored output through [[#Environment variables]] to your {{ic|~/.bashrc}} or {{ic|~/.zshrc}}, as the below is based on {{ic|1=export LESS=R}}}}<br />
<br />
When you run a command and pipe its [[Wikipedia:Standard output|standard output]] (''stdout'') to ''less'' for a paged view (e.g. {{ic|<nowiki>pacman -Qe | less</nowiki>}}), you may find that the output is no longer colored. This is usually because the program tries to detect if its ''stdout'' is an interactive terminal, in which case it prints colored text, and otherwise prints uncolored text. This is good behaviour when you want to redirect ''stdout'' to a file, e.g. {{ic|<nowiki>pacman -Qe > pkglst-backup.txt</nowiki>}}, but less suited when you want to view output in {{ic|less}}.<br />
<br />
Some programs provide an option to disable the interactive tty detection:<br />
<br />
# dmesg --color=always | less<br />
<br />
In case that the program does not provide any similar option, it is possible to trick the program into thinking its ''stdout'' is an interactive terminal with the following utilities:<br />
<br />
* {{App|stdoutisatty|A small program which catches the {{ic|isatty}} function call.|https://github.com/lilydjwg/stdoutisatty.|{{AUR|stdoutisatty-git}}}}<br />
:Example: {{ic|stdoutisatty ''program'' <nowiki>| less</nowiki>}}<br />
* {{App|unbuffer|A tclsh script comes with expect, it invokes desired program within a pty.|http://expect.sourceforge.net/example/unbuffer.man.html|{{Pkg|expect}}}}<br />
:Example: {{ic|unbuffer ''program'' <nowiki>| less</nowiki>}}<br />
<br />
Alternatively, using [http://zsh.sourceforge.net/Doc/Release/Zsh-Modules.html#The-zsh_002fzpty-Module zpty] module from [[zsh]]: [http://lilydjwg.is-programmer.com/2011/6/29/using-zpty-module-of-zsh.27677.html]<br />
<br />
{{hc|~/.zshrc|<nowiki><br />
zmodload zsh/zpty<br />
<br />
pty() {<br />
zpty pty-${UID} ${1+$@}<br />
if [[ ! -t 1 ]];then<br />
setopt local_traps<br />
trap '' INT<br />
fi<br />
zpty -r pty-${UID}<br />
zpty -d pty-${UID}<br />
}<br />
<br />
ptyless() {<br />
pty $@ | less<br />
}<br />
</nowiki>}}<br />
<br />
Usage:<br />
<br />
$ ptyless ''program''<br />
<br />
To pipe it to other pager (less in this example):<br />
<br />
$ pty ''program'' | less<br />
<br />
=== ls ===<br />
<br />
The {{ic|1=--color=auto}} option enables color highlighting. Color codes are emitted only on standard output; not in pipes or redirection.<br />
<br />
Use an [[alias]] to permanently enable this option:<br />
<br />
alias ls='ls --color=auto'<br />
<br />
The {{ic|LS_COLORS}} variable is used to define colors, and it configures various parts of highlighting. Use the {{man|1|dircolors}} command to set it.<br />
<br />
{{Note|Using the {{ic|--color}} option may incur a noticeable performance penalty when ''ls'' is run in a directory with very many entries. The default settings require ''ls'' to {{man|1|stat}} every single file it lists. However, if you would like most of the file-type coloring but can live without the other coloring options (e.g. executable, orphan, sticky, other-writable, capability), use ''dircolors'' to set the {{ic|LS_COLORS}} environment variable like this:<br />
<br />
<nowiki>eval $(dircolors -p | perl -pe 's/^((CAP|S[ET]|O[TR]|M|E)\w+).*/$1 00/' | dircolors -)</nowiki><br />
<br />
}}<br />
<br />
See {{man|1|ls}} for more information.<br />
<br />
=== man ===<br />
<br />
To enable colored {{Ic|man}}, two main pagers, {{Ic|less}} and {{Ic|most}}, are hacked here.<br />
<br />
==== Using less ====<br />
<br />
See [[#less]] for a more detailed description.<br />
<br />
For bash or zsh, add the following {{Ic|less}} wrapper function to {{ic|~/.bashrc}} or {{ic|~/.zshrc}}:<br />
<br />
{{bc|<nowiki><br />
man() {<br />
LESS_TERMCAP_md=$'\e[01;31m' \<br />
LESS_TERMCAP_me=$'\e[0m' \<br />
LESS_TERMCAP_se=$'\e[0m' \<br />
LESS_TERMCAP_so=$'\e[01;44;33m' \<br />
LESS_TERMCAP_ue=$'\e[0m' \<br />
LESS_TERMCAP_us=$'\e[01;32m' \<br />
command man "$@"<br />
}<br />
</nowiki>}}<br />
<br />
For [[Fish]] you could accomplish this with:<br />
<br />
{{hc|~/.config/fish/config.fish|<nowiki><br />
set -xU LESS_TERMCAP_md (printf "\e[01;31m")<br />
set -xU LESS_TERMCAP_me (printf "\e[0m")<br />
set -xU LESS_TERMCAP_se (printf "\e[0m")<br />
set -xU LESS_TERMCAP_so (printf "\e[01;44;33m")<br />
set -xU LESS_TERMCAP_ue (printf "\e[0m")<br />
set -xU LESS_TERMCAP_us (printf "\e[01;32m")<br />
</nowiki>}}<br />
<br />
Remember to source your config or restart your shell to make the changes take effect.<br />
<br />
==== Using most ====<br />
<br />
The basic function of 'most' is similar to {{Ic|less}} and {{Ic|more}}, but it has a smaller feature set. Configuring most to use colors is easier than using less, but additional configuration is necessary to make most behave like less.<br />
Install the {{Pkg|most}} package.<br />
<br />
Edit {{ic|/etc/man_db.conf}}, uncomment the pager definition and change it to:<br />
<br />
DEFINE pager most -s<br />
<br />
Test the new setup by typing:<br />
<br />
$ man whatever_man_page<br />
<br />
Modifying the color values requires editing {{ic|~/.mostrc}} (creating the file if it is not present) or editing {{ic|/etc/most.conf}} for system-wide changes. Example {{ic|~/.mostrc}}:<br />
<br />
% Color settings<br />
color normal lightgray black<br />
color status yellow blue<br />
color underline yellow black<br />
color overstrike brightblue black<br />
<br />
Another example showing keybindings similar to {{Ic|less}} (jump to line is set to 'J'):<br />
<br />
% less-like keybindings<br />
unsetkey "^K"<br />
unsetkey "g"<br />
unsetkey "G"<br />
unsetkey ":"<br />
<br />
setkey next_file ":n"<br />
setkey find_file ":e"<br />
setkey next_file ":p"<br />
setkey toggle_options ":o"<br />
setkey toggle_case ":c"<br />
setkey delete_file ":d"<br />
setkey exit ":q"<br />
<br />
setkey bob "g"<br />
setkey eob "G"<br />
setkey down "e"<br />
setkey down "E"<br />
setkey down "j"<br />
setkey down "^N"<br />
setkey up "y"<br />
setkey up "^Y"<br />
setkey up "k"<br />
setkey up "^P"<br />
setkey up "^K"<br />
setkey page_down "f"<br />
setkey page_down "^F"<br />
setkey page_up "b"<br />
setkey page_up "^B"<br />
setkey other_window "z"<br />
setkey other_window "w"<br />
setkey search_backward "?"<br />
setkey bob "p"<br />
setkey goto_mark "'"<br />
setkey find_file "E"<br />
setkey edit "v"<br />
<br />
==== Using X resources ====<br />
<br />
A quick way to add color to manual pages viewed on {{Pkg|xterm}}/{{Ic|uxterm}} or {{Pkg|rxvt-unicode}} is to modify {{ic|~/.Xresources}}.<br />
<br />
===== xterm =====<br />
<br />
*VT100.colorBDMode: true<br />
*VT100.colorBD: red<br />
*VT100.colorULMode: true<br />
*VT100.colorUL: cyan<br />
<br />
which ''replaces'' the decorations with the colors. Also add:<br />
<br />
*VT100.veryBoldColors: 6<br />
<br />
if you want colors and decorations (bold or underline) ''at the same time''. See {{ic|man xterm}} for a description of the {{ic|veryBoldColors}} resource.<br />
<br />
===== rxvt-unicode =====<br />
<br />
URxvt.colorIT: #87af5f<br />
URxvt.colorBD: #d7d7d7<br />
URxvt.colorUL: #87afd7<br />
<br />
Run:<br />
<br />
$ xrdb -load ~/.Xresources<br />
<br />
Launch a new {{Ic|xterm/uxterm}} or {{Ic|rxvt-unicode}} and you should see colorful man pages.<br />
<br />
This combination puts colors to '''bold''' and <u>underlined</u> words in {{Ic|xterm/uxterm}} or to '''bold''', <u>underlined</u>, and ''italicized'' text in {{Ic|rxvt-unicode}}. You can play with different combinations of these attributes (see the [http://pub.ligatura.org/fs/xfree86/xresources/xterm sources]{{Dead link|2013|09|10}} of this item).<br />
<br />
=== pacman ===<br />
<br />
[[Pacman]] has a color option. Uncomment the {{ic|Color}} line in {{ic|/etc/pacman.conf}}.<br />
<br />
== Wrappers ==<br />
<br />
{{move||Some of these could be made into sections of their own, or moved to existing sections such as [[#diff]]}}<br />
<br />
=== Universal wrappers ===<br />
<br />
(most of them outdated but still functioning)<br />
<br />
They go with multiple preconfigured presets that can be changed, and new can be created/contributed.<br />
<br />
* {{App|rainbow|Colorize commands output or STDIN using patterns.<br>Presets: df, diff, env, host, ifconfig, java-stack-trace, jboss, jonas, md5sum, mvn2, mvn3, ping, tomcat, top, traceroute.|https://github.com/nicoulaj/rainbow}}<br />
* {{App|grc|Yet another colouriser for beautifying your logfiles or output of commands.<br>Presets: configure, cvs, df, diff, esperanto, gcc, irclog, ldap, log, mount, netstat, ping, proftpd, traceroute, wdiff.|https://github.com/pengwynn/grc|{{Pkg|grc}}}}<br />
* {{App|colorlogs|Colorize commands output or STDIN using patterns.<br>Presets: logs, git status, ant, maven.|https://github.com/memorius/colorlogs}}<br />
* {{App|cope|A colourful wrapper for terminal programs.<br>Presets: acpi, arp, cc, df, dprofpp, fdisk, free, g++, gcc, id, ifconfig, ls, lspci, lsusb, make, md5sum, mpc, netstat, nm, nmap, nocope, ping, pmap, ps, readelf, route, screen, sha1sum, sha224sum, sha256sum, sha384sum, sha512sum, shasum, socklist, stat, strace, tcpdump, tracepath, traceroute, w, wget, who, xrandr.|https://github.com/yogan/cope|{{AUR|cope-git}}}}<br />
* {{App|cw|A non-intrusive real-time ANSI color wrapper for common unix-based commands.<br>Presets: arp, arping, auth.log@, blockdev, cal, cksum, clock, configure, cpuinfo@, crontab@, cw-pipe, cw-test.cgi, date, df, diff, dig, dmesg, du, env, figlet, file, find, finger, free, fstab@, fuser, g++, gcc, group@, groups, hdparm, hexdump, host, hosts@, id, ifconfig, inittab@, iptables, last, lastlog, lsattr, lsmod, lsof, ltrace-color, make, md5sum, meminfo@, messages@, mount, mpg123, netstat, nfsstat, nmap, nslookup, objdump, passwd@, ping, pmap, pmap_dump, praliases, profile@, protocols@, ps, pstree, quota, quotastats, resolv.conf@, route, routel, sdiff, services@, showmount, smbstatus, stat, strace-color, sysctl, syslog, tar, tcpdump, tracepath, traceroute, umount, uname, uptime, users, vmstat, w, wc, whereis, who, xferlog.|http://cwrapper.sourceforge.net/|{{AUR|cw}}}}<br />
* {{App|ccze|A fast log colorizer written in C, intended to be adrop-in replacement for colorize|https://github.com/cornet/ccze/|{{Pkg|ccze}}}}<br />
<br />
=== Libraries for colorizing an output ===<br />
<br />
* {{App|ruby-rainbow|Rainbow is extension to ruby's String class adding support for colorizing text on ANSI terminal|https://rubygems.org/gems/rainbow/|{{Pkg|ruby-rainbow}}}}<br />
* {{App|python-blessings|A thin, practical wrapper around terminal coloring, styling, and positioning|https://pypi.python.org/pypi/blessings|{{Pkg|python-blessings}}, {{Pkg|python2-blessings}}}}<br />
<br />
=== Application specific ===<br />
<br />
==== Compilers ====<br />
<br />
* {{App|colorgcc|A Perl wrapper to colorize the output of compilers with warning/error messages matching the gcc output format|https://schlueters.de/colorgcc.html|{{Pkg|colorgcc}}}}<br />
<br />
==== diff ====<br />
<br />
Diff has [[#diff|built-in color output]], which is reasonable to use. But the following wrappers can be used:<br />
<br />
* {{App|colordiff|Perl script for ''diff'' highlighting.|http://www.colordiff.org/|{{Pkg|colordiff}}}}<br />
* {{App|cwdiff|''(w)diff'' wrapper with directories support and highlighting.|https://github.com/junghans/cwdiff|{{AUR|cwdiff}}, {{AUR|cwdiff-git}}}}<br />
<br />
==== less ====<br />
<br />
===== source-highlight =====<br />
<br />
You can enable code syntax coloring in ''less''. First, [[install]] {{Pkg|source-highlight}}, then add these lines to your shell configuration file:<br />
<br />
{{hc|~/.bashrc|<nowiki><br />
export LESSOPEN="| /usr/bin/source-highlight-esc.sh %s"<br />
export LESS='-R '<br />
</nowiki>}}<br />
<br />
===== lesspipe =====<br />
<br />
Frequent users of the command line interface might want to install {{Pkg|lesspipe}}.<br />
<br />
Users may now list the compressed files inside of an archive using their pager:<br />
<br />
{{hc|$ less ''compressed_file''.tar.gz|2=<br />
==> use tar_file:contained_file to view a file in the archive<br />
-rw------- ''username''/''group'' 695 2008-01-04 19:24 ''compressed_file''/''content1''<br />
-rw------- ''username''/''group'' 43 2007-11-07 11:17 ''compressed_file''/''content2''<br />
''compressed_file''.tar.gz (END)<br />
}}<br />
<br />
''lesspipe'' also grants ''less'' the ability of interfacing with files other than archives, serving as an alternative for the specific command associated for that file-type (such as viewing HTML via {{Pkg|python-html2text}}).<br />
<br />
Re-login after installing ''lesspipe'' in order to activate it, or source {{ic|/etc/profile.d/lesspipe.sh}}.<br />
<br />
==== Make ====<br />
<br />
* {{App|colormake|A simple wrapper around make to make it's output more readable.|http://bre.klaki.net/programs/colormake/|{{AUR|colormake}}, {{AUR|colormake-git}}}}<br />
<br />
==== Ping ====<br />
<br />
* {{App|prettyping|Add some great features to ping monitoring. A wrapper around the standard ping tool with the objective of making the output prettier, more colorful, more compact, and easier to read.|http://denilson.sa.nom.br/prettyping/|{{AUR|prettyping}}}}<br />
<br />
== Shells ==<br />
<br />
=== bash ===<br />
<br />
See [[Bash/Prompt customization#Colors]].<br />
<br />
=== zsh ===<br />
<br />
See [[Zsh#Colors]].<br />
<br />
=== Fish ===<br />
<br />
See [[Fish#Web interface]].<br />
<br />
== Terminal emulators ==<br />
<br />
=== Virtual console ===<br />
<br />
{{Style|Lacks clarity on what "the colors" are, i.e. in [[#Virtual console]] they are about the ''representations'' of the 16 base colors (RGB values for yellow, red, blue, etc.), while in [[#Login screen]] they are about the base colors themselves. See also {{man|4|console_codes}} and [[User:Isacdaavid/Linux_Console]]}}<br />
<br />
The colors in the [[w:Virtual console|Linux virtual console]]—see {{man|4|console}}—running on the framebuffer can be changed. This is done by writing the escape code {{ic|\\e]PXRRGGBB}}, where {{ic|X}} is the hexadecimal index of the color from 0-F, and {{ic|RRGGBB}} is a traditional hexadecimal RGB code. <br />
<br />
For example, to reuse existing colors defined in {{ic|~/.Xresources}}, add the following to the shell initialization file (such as {{ic|~/.bashrc}}):<br />
<br />
if [ "$TERM" = "linux" ]; then<br />
_SEDCMD='s/.*\*color\([0-9]\{1,\}\).*#\([0-9a-fA-F]\{6\}\).*/\1 \2/p'<br />
for i in $(sed -n "$_SEDCMD" $HOME/.Xresources | awk '$1 < 16 {printf "\\e]P%X%s", $1, $2}'); do<br />
echo -en "$i"<br />
done<br />
clear<br />
fi<br />
<br />
==== Login screen ====<br />
<br />
The below is a colored example of the virtual console login screen in {{ic|/etc/issue}}. Create a backup of the original file with {{ic|mv /etc/issue /etc/issue.bak}} as root, and create a new {{ic|/etc/issue}}:<br />
<br />
\e[H\e[2J<br />
\e[1;30m| \e[34m\\s \\r<br />
\e[36;1m/\\\\ \e[37m|| \e[36m| | \e[30m|<br />
\e[36m/ \\\\ \e[37m|| \e[36m| _ \e[30m| \e[32m\\t<br />
\e[1;36m/ \e[0;36m.. \e[1m\\\\ \e[37m//==\\\\\\\\ ||/= /==\\\\ ||/=\\\\ \e[36m| | |/ \\\\ | | \\\\ / \e[30m| \e[32m\\d<br />
\e[0;36m/ . . \\\\ \e[37m|| || || | || || \e[36m| | | | | | X \e[1;30m|<br />
\e[0;36m/ . . \\\\ \e[37m\\\\\\\\==/| || \\\\==/ || || \e[36m| | | | \\\\_/| / \\\\ \e[1;30m| \e[31m\\U<br />
\e[0;36m/ .. .. \\\\ \e[0;37mA simple, lightweight linux distribution. \e[1;30m|<br />
\e[0;36m/_\x27 `_\\\\ \e[1;30m| \e[35m\\l \e[0mon \e[1;33m\\n<br />
\e[0m<br />
<br />
<br />
Save the file and make it executable with {{ic|chmod +x /etc/issue}}.<br />
<br />
See also:<br />
<br />
* https://bbs.archlinux.org/viewtopic.php?pid=386429#p386429<br />
* http://www.linuxfromscratch.org/blfs/view/svn/postlfs/logon.html<br />
<br />
=== X window system ===<br />
<br />
Most [[Xorg]] terminals, including [[xterm]] and [[urxvt]], support at least 16 basic colors. The colors 0-7 are the 'normal' colors. Colors 8-15 are their 'bright' counterparts, used for highlighting. These colors can be modified through [[X resources]], or through specific terminal settings. For example:<br />
<br />
{{hc|1=~/.Xresources|2=<br />
! Black + DarkGrey<br />
*color0: #000000<br />
*color8: #555753<br />
! DarkRed + Red<br />
*color1: #ff6565<br />
*color9: #ff8d8d<br />
! DarkGreen + Green<br />
*color2: #93d44f<br />
*color10: #c8e7a8<br />
! DarkYellow + Yellow<br />
*color3: #eab93d<br />
*color11: #ffc123<br />
! DarkBlue + Blue<br />
*color4: #204a87<br />
*color12: #3465a4<br />
! DarkMagenta + Magenta<br />
*color5: #ce5c00<br />
*color13: #f57900<br />
!DarkCyan + Cyan (both not tango)<br />
*color6: #89b6e2<br />
*color14: #46a4ff<br />
! LightGrey + White<br />
*color7: #cccccc<br />
*color15: #ffffff<br />
}}<br />
<br />
{{Warning|Color resources such as {{ic|foreground}} and {{ic|background}} can be read by other applications (such as [https://www.gnu.org/software/emacs/manual/html_node/emacs/Table-of-Resources.html emacs]). This can be avoided by specifiying the class name, for example {{ic|XTerm.foreground}}.}}<br />
<br />
See also:<br />
<br />
* [[#Using X resources]] for how to color bold and underlined text automatically.<br />
* [https://web.archive.org/web/20090130061234/http://phraktured.net/terminal-colors/ Color Themes] - Extensive list of terminal color themes by Phraktured.<br />
* [http://xcolors.net/ Xcolors.net] List of user-contributed terminal color themes.<br />
* [http://beta.andrewrcraig.us/index.php?page=xcolors Xcolors by dkeg]<br />
<br />
* [https://github.com/chriskempson/base16 base16 color schemes]<br />
<br />
=== Display all 256 colors ===<br />
<br />
Prints all 256 colors across the screen.<br />
<br />
$ (x=`tput op` y=`printf %76s`;for i in {0..256};do o=00$i;echo -e ${o:${#o}-3:3} `tput setaf $i;tput setab $i`${y// /=}$x;done)<br />
<br />
=== Display tput escape codes ===<br />
<br />
{{Merge|Bash/Prompt_customization|More context on ''tput'' is provided in that article}}<br />
<br />
Replace {{ic|tput op}} with whatever tput you want to trace. {{ic|op}} is the default foreground and background color.<br />
<br />
{{hc|<nowiki>$ ( strace -s5000 -e write tput op 2>&2 2>&1 ) | tee -a /dev/stderr | grep -o '"[^"]*"'</nowiki>|<br />
033[\033[1;34m"\33[39;49m"\033[00m<br />
}}<br />
<br />
=== Enumerate supported colors ===<br />
<br />
The following command will let you discover all the terminals you have terminfo support for, and the number of colors each terminal supports. The possible values are: 8, 15, 16, 52, 64, 88 and 256.<br />
<br />
{{hc|<nowiki>$ for T in `find /usr/share/terminfo -type f -printf '%f '`;do echo "$T `tput -T $T colors`";done|sort -nk2</nowiki>|<br />
Eterm-88color 88<br />
rxvt-88color 88<br />
xterm+88color 88<br />
xterm-88color 88<br />
Eterm-256color 256<br />
gnome-256color 256<br />
konsole-256color 256<br />
putty-256color 256<br />
rxvt-256color 256<br />
screen-256color 256<br />
screen-256color-bce 256<br />
screen-256color-bce-s 256<br />
screen-256color-s 256<br />
xterm+256color 256<br />
xterm-256color 256<br />
}}<br />
<br />
=== Enumerate terminal capabilities ===<br />
<br />
{{Merge|Bash/Prompt_customization|More context on ''tput'' is provided in that article}}<br />
<br />
This command is useful to see what features that are supported by your terminal.<br />
<br />
{{hc|<nowiki>$ infocmp -1 | sed -nu 's/^[ \000\t]*//;s/[ \000\t]*$//;/[^ \t\000]\{1,\}/!d;/acsc/d;s/=.*,//p'|column -c80</nowiki>|<br />
bel cuu ich kb2 kf15 kf3 kf44 kf59 mc0 rmso smul<br />
blink cuu1 il kbs kf16 kf30 kf45 kf6 mc4 rmul tbc<br />
bold cvvis il1 kcbt kf17 kf31 kf46 kf60 mc5 rs1 u6<br />
cbt dch ind kcub1 kf18 kf32 kf47 kf61 meml rs2 u7<br />
civis dch1 indn kcud1 kf19 kf33 kf48 kf62 memu sc u8<br />
clear dl initc kcuf1 kf2 kf34 kf49 kf63 op setab u9<br />
cnorm dl1 invis kcuu1 kf20 kf35 kf5 kf7 rc setaf vpa<br />
}}<br />
<br />
=== Color scheme scripts ===<br />
<br />
See [https://paste.xinu.at/m-dAiJ/] for scripts which display a chart of your current terminal scheme.<br />
<br />
== See also ==<br />
<br />
* [https://gkbrk.com/2016/07/lolcat-clone-in-x64-assembly/ lolcat clone in x64 assembly]<br />
* [http://unix.stackexchange.com/a/147 Setting colors for less] and [http://unix.stackexchange.com/a/6357 solving related problems] (threads on StackExchange)</div>Cirrushttps://wiki.archlinux.org/index.php?title=Color_output_in_console&diff=459428Color output in console2016-12-15T20:58:15Z<p>Cirrus: /* Libraries for colorizing an output */</p>
<hr />
<div>[[Category:Eye candy]]<br />
[[Category:Command shells]]<br />
[[ja:コンソールのカラー出力]]<br />
[[zh-cn:Color output in console]]<br />
{{Expansion|And maybe create something bigger. Please take active approach if you can add some valuable information.|Talk:Color output in console#Why and what this page is about}}<br />
{{Style|Page is partly a collection of information on different applications, partly begin to lay theory to color output process. Please contribute your knowledge, if you can.}}<br />
{{Related articles start}}<br />
{{Related|Emacs#Custom colors and theme}}<br />
{{Related|nano#Syntax highlighting}}<br />
{{Related articles end}}<br />
This page was created to consolidate colorization of CLI outputs.<br />
<br />
== Applications ==<br />
<br />
=== diff ===<br />
<br />
diffutils from version 3.4 includes the {{ic|--color}} option ([https://lists.gnu.org/archive/html/info-gnu/2016-08/msg00004.html GNU mailing list]).<br />
<br />
$ alias diff='diff --color=auto'<br />
<br />
=== grep ===<br />
<br />
The {{ic|1=--color=auto}} option enables color highlighting. Color codes are emitted only on standard output; not in pipes or redirection.<br />
<br />
Color output in ''grep'' is also useful with [[Wikipedia:regexp|regexp]] tasks.<br />
<br />
Use an [[alias]] to permanently enable this option:<br />
<br />
alias grep='grep --color=auto'<br />
<br />
The {{ic|GREP_COLORS}} variable is used to define colors, and it configures various parts of highlighting.<br />
<br />
See {{man|1|grep}} for more information.<br />
<br />
{{Out of date|GREP_COLOR is deprecated in favor of GREP_COLORS.}}<br />
<br />
The {{ic|GREP_COLOR}} environment variable can be used to define the default highlight color (the default is red). To change the color, find the needed [http://www.tldp.org/HOWTO/Bash-Prompt-HOWTO/x329.html ANSI escape sequence] and apply it with:<br />
<br />
export GREP_COLOR="1;32"<br />
<br />
The {{ic|-n}} option includes file line numbers in the output.<br />
<br />
=== less ===<br />
<br />
==== Environment variables ====<br />
<br />
Add the following lines to your shell configuration file:<br />
<br />
export LESS=-R<br />
export LESS_TERMCAP_mb=$'\E[1;31m' # begin bold<br />
export LESS_TERMCAP_md=$'\E[1;36m' # begin blink<br />
export LESS_TERMCAP_me=$'\E[0m' # reset bold/blink<br />
export LESS_TERMCAP_so=$'\E[01;44;33m' # begin reverse video<br />
export LESS_TERMCAP_se=$'\E[0m' # reset reverse video<br />
export LESS_TERMCAP_us=$'\E[1;32m' # begin underline<br />
export LESS_TERMCAP_ue=$'\E[0m' # reset underline<br />
# and so on<br />
<br />
Change the values ([[Wikipedia:ANSI escape code#Colors|ANSI escape code]]) as you like. [http://boredzo.org/blog/archives/2016-08-15/colorized-man-pages-understood-and-customized This blog post] and the page [[Bash/Prompt customization]] (not bash-specific!) also help.<br />
<br />
{{note|The {{ic|LESS_TERMCAP_''xx''}} variables are currently undocumented in {{man|1|less}}. For a detailed explanation, see [http://unix.stackexchange.com/questions/108699/documentation-on-less-termcap-variables/108840#108840 this answer].}}<br />
<br />
==== Reading from stdin ====<br />
<br />
{{Note|It is recommended to add colored output through [[#Environment variables]] to your {{ic|~/.bashrc}} or {{ic|~/.zshrc}}, as the below is based on {{ic|1=export LESS=R}}}}<br />
<br />
When you run a command and pipe its [[Wikipedia:Standard output|standard output]] (''stdout'') to ''less'' for a paged view (e.g. {{ic|<nowiki>pacman -Qe | less</nowiki>}}), you may find that the output is no longer colored. This is usually because the program tries to detect if its ''stdout'' is an interactive terminal, in which case it prints colored text, and otherwise prints uncolored text. This is good behaviour when you want to redirect ''stdout'' to a file, e.g. {{ic|<nowiki>pacman -Qe > pkglst-backup.txt</nowiki>}}, but less suited when you want to view output in {{ic|less}}.<br />
<br />
Some programs provide an option to disable the interactive tty detection:<br />
<br />
# dmesg --color=always | less<br />
<br />
In case that the program does not provide any similar option, it is possible to trick the program into thinking its ''stdout'' is an interactive terminal with the following utilities:<br />
<br />
* {{App|stdoutisatty|A small program which catches the {{ic|isatty}} function call.|https://github.com/lilydjwg/stdoutisatty.|{{AUR|stdoutisatty-git}}}}<br />
:Example: {{ic|stdoutisatty ''program'' <nowiki>| less</nowiki>}}<br />
* {{App|unbuffer|A tclsh script comes with expect, it invokes desired program within a pty.|http://expect.sourceforge.net/example/unbuffer.man.html|{{Pkg|expect}}}}<br />
:Example: {{ic|unbuffer ''program'' <nowiki>| less</nowiki>}}<br />
<br />
Alternatively, using [http://zsh.sourceforge.net/Doc/Release/Zsh-Modules.html#The-zsh_002fzpty-Module zpty] module from [[zsh]]: [http://lilydjwg.is-programmer.com/2011/6/29/using-zpty-module-of-zsh.27677.html]<br />
<br />
{{hc|~/.zshrc|<nowiki><br />
zmodload zsh/zpty<br />
<br />
pty() {<br />
zpty pty-${UID} ${1+$@}<br />
if [[ ! -t 1 ]];then<br />
setopt local_traps<br />
trap '' INT<br />
fi<br />
zpty -r pty-${UID}<br />
zpty -d pty-${UID}<br />
}<br />
<br />
ptyless() {<br />
pty $@ | less<br />
}<br />
</nowiki>}}<br />
<br />
Usage:<br />
<br />
$ ptyless ''program''<br />
<br />
To pipe it to other pager (less in this example):<br />
<br />
$ pty ''program'' | less<br />
<br />
=== ls ===<br />
<br />
The {{ic|1=--color=auto}} option enables color highlighting. Color codes are emitted only on standard output; not in pipes or redirection.<br />
<br />
Use an [[alias]] to permanently enable this option:<br />
<br />
alias ls='ls --color=auto'<br />
<br />
The {{ic|LS_COLORS}} variable is used to define colors, and it configures various parts of highlighting. Use the {{man|1|dircolors}} command to set it.<br />
<br />
{{Note|Using the {{ic|--color}} option may incur a noticeable performance penalty when ''ls'' is run in a directory with very many entries. The default settings require ''ls'' to {{man|1|stat}} every single file it lists. However, if you would like most of the file-type coloring but can live without the other coloring options (e.g. executable, orphan, sticky, other-writable, capability), use ''dircolors'' to set the {{ic|LS_COLORS}} environment variable like this:<br />
<br />
<nowiki>eval $(dircolors -p | perl -pe 's/^((CAP|S[ET]|O[TR]|M|E)\w+).*/$1 00/' | dircolors -)</nowiki><br />
<br />
}}<br />
<br />
See {{man|1|ls}} for more information.<br />
<br />
=== man ===<br />
<br />
To enable colored {{Ic|man}}, two main pagers, {{Ic|less}} and {{Ic|most}}, are hacked here.<br />
<br />
==== Using less ====<br />
<br />
See [[#less]] for a more detailed description.<br />
<br />
For bash or zsh, add the following {{Ic|less}} wrapper function to {{ic|~/.bashrc}} or {{ic|~/.zshrc}}:<br />
<br />
{{bc|<nowiki><br />
man() {<br />
LESS_TERMCAP_md=$'\e[01;31m' \<br />
LESS_TERMCAP_me=$'\e[0m' \<br />
LESS_TERMCAP_se=$'\e[0m' \<br />
LESS_TERMCAP_so=$'\e[01;44;33m' \<br />
LESS_TERMCAP_ue=$'\e[0m' \<br />
LESS_TERMCAP_us=$'\e[01;32m' \<br />
command man "$@"<br />
}<br />
</nowiki>}}<br />
<br />
For [[Fish]] you could accomplish this with:<br />
<br />
{{hc|~/.config/fish/config.fish|<nowiki><br />
set -xU LESS_TERMCAP_md (printf "\e[01;31m")<br />
set -xU LESS_TERMCAP_me (printf "\e[0m")<br />
set -xU LESS_TERMCAP_se (printf "\e[0m")<br />
set -xU LESS_TERMCAP_so (printf "\e[01;44;33m")<br />
set -xU LESS_TERMCAP_ue (printf "\e[0m")<br />
set -xU LESS_TERMCAP_us (printf "\e[01;32m")<br />
</nowiki>}}<br />
<br />
Remember to source your config or restart your shell to make the changes take effect.<br />
<br />
==== Using most ====<br />
<br />
The basic function of 'most' is similar to {{Ic|less}} and {{Ic|more}}, but it has a smaller feature set. Configuring most to use colors is easier than using less, but additional configuration is necessary to make most behave like less.<br />
Install the {{Pkg|most}} package.<br />
<br />
Edit {{ic|/etc/man_db.conf}}, uncomment the pager definition and change it to:<br />
<br />
DEFINE pager most -s<br />
<br />
Test the new setup by typing:<br />
<br />
$ man whatever_man_page<br />
<br />
Modifying the color values requires editing {{ic|~/.mostrc}} (creating the file if it is not present) or editing {{ic|/etc/most.conf}} for system-wide changes. Example {{ic|~/.mostrc}}:<br />
<br />
% Color settings<br />
color normal lightgray black<br />
color status yellow blue<br />
color underline yellow black<br />
color overstrike brightblue black<br />
<br />
Another example showing keybindings similar to {{Ic|less}} (jump to line is set to 'J'):<br />
<br />
% less-like keybindings<br />
unsetkey "^K"<br />
unsetkey "g"<br />
unsetkey "G"<br />
unsetkey ":"<br />
<br />
setkey next_file ":n"<br />
setkey find_file ":e"<br />
setkey next_file ":p"<br />
setkey toggle_options ":o"<br />
setkey toggle_case ":c"<br />
setkey delete_file ":d"<br />
setkey exit ":q"<br />
<br />
setkey bob "g"<br />
setkey eob "G"<br />
setkey down "e"<br />
setkey down "E"<br />
setkey down "j"<br />
setkey down "^N"<br />
setkey up "y"<br />
setkey up "^Y"<br />
setkey up "k"<br />
setkey up "^P"<br />
setkey up "^K"<br />
setkey page_down "f"<br />
setkey page_down "^F"<br />
setkey page_up "b"<br />
setkey page_up "^B"<br />
setkey other_window "z"<br />
setkey other_window "w"<br />
setkey search_backward "?"<br />
setkey bob "p"<br />
setkey goto_mark "'"<br />
setkey find_file "E"<br />
setkey edit "v"<br />
<br />
==== Using X resources ====<br />
<br />
A quick way to add color to manual pages viewed on {{Pkg|xterm}}/{{Ic|uxterm}} or {{Pkg|rxvt-unicode}} is to modify {{ic|~/.Xresources}}.<br />
<br />
===== xterm =====<br />
<br />
*VT100.colorBDMode: true<br />
*VT100.colorBD: red<br />
*VT100.colorULMode: true<br />
*VT100.colorUL: cyan<br />
<br />
which ''replaces'' the decorations with the colors. Also add:<br />
<br />
*VT100.veryBoldColors: 6<br />
<br />
if you want colors and decorations (bold or underline) ''at the same time''. See {{ic|man xterm}} for a description of the {{ic|veryBoldColors}} resource.<br />
<br />
===== rxvt-unicode =====<br />
<br />
URxvt.colorIT: #87af5f<br />
URxvt.colorBD: #d7d7d7<br />
URxvt.colorUL: #87afd7<br />
<br />
Run:<br />
<br />
$ xrdb -load ~/.Xresources<br />
<br />
Launch a new {{Ic|xterm/uxterm}} or {{Ic|rxvt-unicode}} and you should see colorful man pages.<br />
<br />
This combination puts colors to '''bold''' and <u>underlined</u> words in {{Ic|xterm/uxterm}} or to '''bold''', <u>underlined</u>, and ''italicized'' text in {{Ic|rxvt-unicode}}. You can play with different combinations of these attributes (see the [http://pub.ligatura.org/fs/xfree86/xresources/xterm sources]{{Dead link|2013|09|10}} of this item).<br />
<br />
=== pacman ===<br />
<br />
[[Pacman]] has a color option. Uncomment the {{ic|Color}} line in {{ic|/etc/pacman.conf}}.<br />
<br />
== Wrappers ==<br />
<br />
{{move||Some of these could be made into sections of their own, or moved to existing sections such as [[#diff]]}}<br />
<br />
=== Universal wrappers ===<br />
<br />
(most of them outdated but still functioning)<br />
<br />
They go with multiple preconfigured presets that can be changed, and new can be created/contributed.<br />
<br />
* {{App|rainbow|Colorize commands output or STDIN using patterns.<br>Presets: df, diff, env, host, ifconfig, java-stack-trace, jboss, jonas, md5sum, mvn2, mvn3, ping, tomcat, top, traceroute.|https://github.com/nicoulaj/rainbow}}<br />
* {{App|grc|Yet another colouriser for beautifying your logfiles or output of commands.<br>Presets: configure, cvs, df, diff, esperanto, gcc, irclog, ldap, log, mount, netstat, ping, proftpd, traceroute, wdiff.|https://github.com/pengwynn/grc|{{Pkg|grc}}}}<br />
* {{App|colorlogs|Colorize commands output or STDIN using patterns.<br>Presets: logs, git status, ant, maven.|https://github.com/memorius/colorlogs}}<br />
* {{App|cope|A colourful wrapper for terminal programs.<br>Presets: acpi, arp, cc, df, dprofpp, fdisk, free, g++, gcc, id, ifconfig, ls, lspci, lsusb, make, md5sum, mpc, netstat, nm, nmap, nocope, ping, pmap, ps, readelf, route, screen, sha1sum, sha224sum, sha256sum, sha384sum, sha512sum, shasum, socklist, stat, strace, tcpdump, tracepath, traceroute, w, wget, who, xrandr.|https://github.com/yogan/cope|{{AUR|cope-git}}}}<br />
* {{App|cw|A non-intrusive real-time ANSI color wrapper for common unix-based commands.<br>Presets: arp, arping, auth.log@, blockdev, cal, cksum, clock, configure, cpuinfo@, crontab@, cw-pipe, cw-test.cgi, date, df, diff, dig, dmesg, du, env, figlet, file, find, finger, free, fstab@, fuser, g++, gcc, group@, groups, hdparm, hexdump, host, hosts@, id, ifconfig, inittab@, iptables, last, lastlog, lsattr, lsmod, lsof, ltrace-color, make, md5sum, meminfo@, messages@, mount, mpg123, netstat, nfsstat, nmap, nslookup, objdump, passwd@, ping, pmap, pmap_dump, praliases, profile@, protocols@, ps, pstree, quota, quotastats, resolv.conf@, route, routel, sdiff, services@, showmount, smbstatus, stat, strace-color, sysctl, syslog, tar, tcpdump, tracepath, traceroute, umount, uname, uptime, users, vmstat, w, wc, whereis, who, xferlog.|http://cwrapper.sourceforge.net/|{{AUR|cw}}}}<br />
<br />
=== Libraries for colorizing an output ===<br />
<br />
* {{App|ruby-rainbow|Rainbow is extension to ruby's String class adding support for colorizing text on ANSI terminal|https://rubygems.org/gems/rainbow/|{{Pkg|ruby-rainbow}}}}<br />
* {{App|python-blessings|A thin, practical wrapper around terminal coloring, styling, and positioning|https://pypi.python.org/pypi/blessings|{{Pkg|python-blessings}}, {{Pkg|python2-blessings}}}}<br />
<br />
=== Application specific ===<br />
<br />
==== Compilers ====<br />
<br />
* {{App|colorgcc|A Perl wrapper to colorize the output of compilers with warning/error messages matching the gcc output format|https://schlueters.de/colorgcc.html|{{Pkg|colorgcc}}}}<br />
<br />
==== diff ====<br />
<br />
Diff has [[#diff|built-in color output]], which is reasonable to use. But the following wrappers can be used:<br />
<br />
* {{App|colordiff|Perl script for ''diff'' highlighting.|http://www.colordiff.org/|{{Pkg|colordiff}}}}<br />
* {{App|cwdiff|''(w)diff'' wrapper with directories support and highlighting.|https://github.com/junghans/cwdiff|{{AUR|cwdiff}}, {{AUR|cwdiff-git}}}}<br />
<br />
==== less ====<br />
<br />
===== source-highlight =====<br />
<br />
You can enable code syntax coloring in ''less''. First, [[install]] {{Pkg|source-highlight}}, then add these lines to your shell configuration file:<br />
<br />
{{hc|~/.bashrc|<nowiki><br />
export LESSOPEN="| /usr/bin/source-highlight-esc.sh %s"<br />
export LESS='-R '<br />
</nowiki>}}<br />
<br />
===== lesspipe =====<br />
<br />
Frequent users of the command line interface might want to install {{Pkg|lesspipe}}.<br />
<br />
Users may now list the compressed files inside of an archive using their pager:<br />
<br />
{{hc|$ less ''compressed_file''.tar.gz|2=<br />
==> use tar_file:contained_file to view a file in the archive<br />
-rw------- ''username''/''group'' 695 2008-01-04 19:24 ''compressed_file''/''content1''<br />
-rw------- ''username''/''group'' 43 2007-11-07 11:17 ''compressed_file''/''content2''<br />
''compressed_file''.tar.gz (END)<br />
}}<br />
<br />
''lesspipe'' also grants ''less'' the ability of interfacing with files other than archives, serving as an alternative for the specific command associated for that file-type (such as viewing HTML via {{Pkg|python-html2text}}).<br />
<br />
Re-login after installing ''lesspipe'' in order to activate it, or source {{ic|/etc/profile.d/lesspipe.sh}}.<br />
<br />
==== Make ====<br />
<br />
* {{App|colormake|A simple wrapper around make to make it's output more readable.|http://bre.klaki.net/programs/colormake/|{{AUR|colormake}}, {{AUR|colormake-git}}}}<br />
<br />
==== Ping ====<br />
<br />
* {{App|prettyping|Add some great features to ping monitoring. A wrapper around the standard ping tool with the objective of making the output prettier, more colorful, more compact, and easier to read.|http://denilson.sa.nom.br/prettyping/|{{AUR|prettyping}}}}<br />
<br />
== Shells ==<br />
<br />
=== bash ===<br />
<br />
See [[Bash/Prompt customization#Colors]].<br />
<br />
=== zsh ===<br />
<br />
See [[Zsh#Colors]].<br />
<br />
=== Fish ===<br />
<br />
See [[Fish#Web interface]].<br />
<br />
== Terminal emulators ==<br />
<br />
=== Virtual console ===<br />
<br />
{{Style|Lacks clarity on what "the colors" are, i.e. in [[#Virtual console]] they are about the ''representations'' of the 16 base colors (RGB values for yellow, red, blue, etc.), while in [[#Login screen]] they are about the base colors themselves. See also {{man|4|console_codes}} and [[User:Isacdaavid/Linux_Console]]}}<br />
<br />
The colors in the [[w:Virtual console|Linux virtual console]]—see {{man|4|console}}—running on the framebuffer can be changed. This is done by writing the escape code {{ic|\\e]PXRRGGBB}}, where {{ic|X}} is the hexadecimal index of the color from 0-F, and {{ic|RRGGBB}} is a traditional hexadecimal RGB code. <br />
<br />
For example, to reuse existing colors defined in {{ic|~/.Xresources}}, add the following to the shell initialization file (such as {{ic|~/.bashrc}}):<br />
<br />
if [ "$TERM" = "linux" ]; then<br />
_SEDCMD='s/.*\*color\([0-9]\{1,\}\).*#\([0-9a-fA-F]\{6\}\).*/\1 \2/p'<br />
for i in $(sed -n "$_SEDCMD" $HOME/.Xresources | awk '$1 < 16 {printf "\\e]P%X%s", $1, $2}'); do<br />
echo -en "$i"<br />
done<br />
clear<br />
fi<br />
<br />
==== Login screen ====<br />
<br />
The below is a colored example of the virtual console login screen in {{ic|/etc/issue}}. Create a backup of the original file with {{ic|mv /etc/issue /etc/issue.bak}} as root, and create a new {{ic|/etc/issue}}:<br />
<br />
\e[H\e[2J<br />
\e[1;30m| \e[34m\\s \\r<br />
\e[36;1m/\\\\ \e[37m|| \e[36m| | \e[30m|<br />
\e[36m/ \\\\ \e[37m|| \e[36m| _ \e[30m| \e[32m\\t<br />
\e[1;36m/ \e[0;36m.. \e[1m\\\\ \e[37m//==\\\\\\\\ ||/= /==\\\\ ||/=\\\\ \e[36m| | |/ \\\\ | | \\\\ / \e[30m| \e[32m\\d<br />
\e[0;36m/ . . \\\\ \e[37m|| || || | || || \e[36m| | | | | | X \e[1;30m|<br />
\e[0;36m/ . . \\\\ \e[37m\\\\\\\\==/| || \\\\==/ || || \e[36m| | | | \\\\_/| / \\\\ \e[1;30m| \e[31m\\U<br />
\e[0;36m/ .. .. \\\\ \e[0;37mA simple, lightweight linux distribution. \e[1;30m|<br />
\e[0;36m/_\x27 `_\\\\ \e[1;30m| \e[35m\\l \e[0mon \e[1;33m\\n<br />
\e[0m<br />
<br />
<br />
Save the file and make it executable with {{ic|chmod +x /etc/issue}}.<br />
<br />
See also:<br />
<br />
* https://bbs.archlinux.org/viewtopic.php?pid=386429#p386429<br />
* http://www.linuxfromscratch.org/blfs/view/svn/postlfs/logon.html<br />
<br />
=== X window system ===<br />
<br />
Most [[Xorg]] terminals, including [[xterm]] and [[urxvt]], support at least 16 basic colors. The colors 0-7 are the 'normal' colors. Colors 8-15 are their 'bright' counterparts, used for highlighting. These colors can be modified through [[X resources]], or through specific terminal settings. For example:<br />
<br />
{{hc|1=~/.Xresources|2=<br />
! Black + DarkGrey<br />
*color0: #000000<br />
*color8: #555753<br />
! DarkRed + Red<br />
*color1: #ff6565<br />
*color9: #ff8d8d<br />
! DarkGreen + Green<br />
*color2: #93d44f<br />
*color10: #c8e7a8<br />
! DarkYellow + Yellow<br />
*color3: #eab93d<br />
*color11: #ffc123<br />
! DarkBlue + Blue<br />
*color4: #204a87<br />
*color12: #3465a4<br />
! DarkMagenta + Magenta<br />
*color5: #ce5c00<br />
*color13: #f57900<br />
!DarkCyan + Cyan (both not tango)<br />
*color6: #89b6e2<br />
*color14: #46a4ff<br />
! LightGrey + White<br />
*color7: #cccccc<br />
*color15: #ffffff<br />
}}<br />
<br />
{{Warning|Color resources such as {{ic|foreground}} and {{ic|background}} can be read by other applications (such as [https://www.gnu.org/software/emacs/manual/html_node/emacs/Table-of-Resources.html emacs]). This can be avoided by specifiying the class name, for example {{ic|XTerm.foreground}}.}}<br />
<br />
See also:<br />
<br />
* [[#Using X resources]] for how to color bold and underlined text automatically.<br />
* [https://web.archive.org/web/20090130061234/http://phraktured.net/terminal-colors/ Color Themes] - Extensive list of terminal color themes by Phraktured.<br />
* [http://xcolors.net/ Xcolors.net] List of user-contributed terminal color themes.<br />
* [http://beta.andrewrcraig.us/index.php?page=xcolors Xcolors by dkeg]<br />
<br />
* [https://github.com/chriskempson/base16 base16 color schemes]<br />
<br />
=== Display all 256 colors ===<br />
<br />
Prints all 256 colors across the screen.<br />
<br />
$ (x=`tput op` y=`printf %76s`;for i in {0..256};do o=00$i;echo -e ${o:${#o}-3:3} `tput setaf $i;tput setab $i`${y// /=}$x;done)<br />
<br />
=== Display tput escape codes ===<br />
<br />
{{Merge|Bash/Prompt_customization|More context on ''tput'' is provided in that article}}<br />
<br />
Replace {{ic|tput op}} with whatever tput you want to trace. {{ic|op}} is the default foreground and background color.<br />
<br />
{{hc|<nowiki>$ ( strace -s5000 -e write tput op 2>&2 2>&1 ) | tee -a /dev/stderr | grep -o '"[^"]*"'</nowiki>|<br />
033[\033[1;34m"\33[39;49m"\033[00m<br />
}}<br />
<br />
=== Enumerate supported colors ===<br />
<br />
The following command will let you discover all the terminals you have terminfo support for, and the number of colors each terminal supports. The possible values are: 8, 15, 16, 52, 64, 88 and 256.<br />
<br />
{{hc|<nowiki>$ for T in `find /usr/share/terminfo -type f -printf '%f '`;do echo "$T `tput -T $T colors`";done|sort -nk2</nowiki>|<br />
Eterm-88color 88<br />
rxvt-88color 88<br />
xterm+88color 88<br />
xterm-88color 88<br />
Eterm-256color 256<br />
gnome-256color 256<br />
konsole-256color 256<br />
putty-256color 256<br />
rxvt-256color 256<br />
screen-256color 256<br />
screen-256color-bce 256<br />
screen-256color-bce-s 256<br />
screen-256color-s 256<br />
xterm+256color 256<br />
xterm-256color 256<br />
}}<br />
<br />
=== Enumerate terminal capabilities ===<br />
<br />
{{Merge|Bash/Prompt_customization|More context on ''tput'' is provided in that article}}<br />
<br />
This command is useful to see what features that are supported by your terminal.<br />
<br />
{{hc|<nowiki>$ infocmp -1 | sed -nu 's/^[ \000\t]*//;s/[ \000\t]*$//;/[^ \t\000]\{1,\}/!d;/acsc/d;s/=.*,//p'|column -c80</nowiki>|<br />
bel cuu ich kb2 kf15 kf3 kf44 kf59 mc0 rmso smul<br />
blink cuu1 il kbs kf16 kf30 kf45 kf6 mc4 rmul tbc<br />
bold cvvis il1 kcbt kf17 kf31 kf46 kf60 mc5 rs1 u6<br />
cbt dch ind kcub1 kf18 kf32 kf47 kf61 meml rs2 u7<br />
civis dch1 indn kcud1 kf19 kf33 kf48 kf62 memu sc u8<br />
clear dl initc kcuf1 kf2 kf34 kf49 kf63 op setab u9<br />
cnorm dl1 invis kcuu1 kf20 kf35 kf5 kf7 rc setaf vpa<br />
}}<br />
<br />
=== Color scheme scripts ===<br />
<br />
See [https://paste.xinu.at/m-dAiJ/] for scripts which display a chart of your current terminal scheme.<br />
<br />
== See also ==<br />
<br />
* [https://gkbrk.com/2016/07/lolcat-clone-in-x64-assembly/ lolcat clone in x64 assembly]<br />
* [http://unix.stackexchange.com/a/147 Setting colors for less] and [http://unix.stackexchange.com/a/6357 solving related problems] (threads on StackExchange)</div>Cirrushttps://wiki.archlinux.org/index.php?title=Color_output_in_console&diff=459427Color output in console2016-12-15T20:57:37Z<p>Cirrus: /* Libraries for colorizing an output */ added ccze</p>
<hr />
<div>[[Category:Eye candy]]<br />
[[Category:Command shells]]<br />
[[ja:コンソールのカラー出力]]<br />
[[zh-cn:Color output in console]]<br />
{{Expansion|And maybe create something bigger. Please take active approach if you can add some valuable information.|Talk:Color output in console#Why and what this page is about}}<br />
{{Style|Page is partly a collection of information on different applications, partly begin to lay theory to color output process. Please contribute your knowledge, if you can.}}<br />
{{Related articles start}}<br />
{{Related|Emacs#Custom colors and theme}}<br />
{{Related|nano#Syntax highlighting}}<br />
{{Related articles end}}<br />
This page was created to consolidate colorization of CLI outputs.<br />
<br />
== Applications ==<br />
<br />
=== diff ===<br />
<br />
diffutils from version 3.4 includes the {{ic|--color}} option ([https://lists.gnu.org/archive/html/info-gnu/2016-08/msg00004.html GNU mailing list]).<br />
<br />
$ alias diff='diff --color=auto'<br />
<br />
=== grep ===<br />
<br />
The {{ic|1=--color=auto}} option enables color highlighting. Color codes are emitted only on standard output; not in pipes or redirection.<br />
<br />
Color output in ''grep'' is also useful with [[Wikipedia:regexp|regexp]] tasks.<br />
<br />
Use an [[alias]] to permanently enable this option:<br />
<br />
alias grep='grep --color=auto'<br />
<br />
The {{ic|GREP_COLORS}} variable is used to define colors, and it configures various parts of highlighting.<br />
<br />
See {{man|1|grep}} for more information.<br />
<br />
{{Out of date|GREP_COLOR is deprecated in favor of GREP_COLORS.}}<br />
<br />
The {{ic|GREP_COLOR}} environment variable can be used to define the default highlight color (the default is red). To change the color, find the needed [http://www.tldp.org/HOWTO/Bash-Prompt-HOWTO/x329.html ANSI escape sequence] and apply it with:<br />
<br />
export GREP_COLOR="1;32"<br />
<br />
The {{ic|-n}} option includes file line numbers in the output.<br />
<br />
=== less ===<br />
<br />
==== Environment variables ====<br />
<br />
Add the following lines to your shell configuration file:<br />
<br />
export LESS=-R<br />
export LESS_TERMCAP_mb=$'\E[1;31m' # begin bold<br />
export LESS_TERMCAP_md=$'\E[1;36m' # begin blink<br />
export LESS_TERMCAP_me=$'\E[0m' # reset bold/blink<br />
export LESS_TERMCAP_so=$'\E[01;44;33m' # begin reverse video<br />
export LESS_TERMCAP_se=$'\E[0m' # reset reverse video<br />
export LESS_TERMCAP_us=$'\E[1;32m' # begin underline<br />
export LESS_TERMCAP_ue=$'\E[0m' # reset underline<br />
# and so on<br />
<br />
Change the values ([[Wikipedia:ANSI escape code#Colors|ANSI escape code]]) as you like. [http://boredzo.org/blog/archives/2016-08-15/colorized-man-pages-understood-and-customized This blog post] and the page [[Bash/Prompt customization]] (not bash-specific!) also help.<br />
<br />
{{note|The {{ic|LESS_TERMCAP_''xx''}} variables are currently undocumented in {{man|1|less}}. For a detailed explanation, see [http://unix.stackexchange.com/questions/108699/documentation-on-less-termcap-variables/108840#108840 this answer].}}<br />
<br />
==== Reading from stdin ====<br />
<br />
{{Note|It is recommended to add colored output through [[#Environment variables]] to your {{ic|~/.bashrc}} or {{ic|~/.zshrc}}, as the below is based on {{ic|1=export LESS=R}}}}<br />
<br />
When you run a command and pipe its [[Wikipedia:Standard output|standard output]] (''stdout'') to ''less'' for a paged view (e.g. {{ic|<nowiki>pacman -Qe | less</nowiki>}}), you may find that the output is no longer colored. This is usually because the program tries to detect if its ''stdout'' is an interactive terminal, in which case it prints colored text, and otherwise prints uncolored text. This is good behaviour when you want to redirect ''stdout'' to a file, e.g. {{ic|<nowiki>pacman -Qe > pkglst-backup.txt</nowiki>}}, but less suited when you want to view output in {{ic|less}}.<br />
<br />
Some programs provide an option to disable the interactive tty detection:<br />
<br />
# dmesg --color=always | less<br />
<br />
In case that the program does not provide any similar option, it is possible to trick the program into thinking its ''stdout'' is an interactive terminal with the following utilities:<br />
<br />
* {{App|stdoutisatty|A small program which catches the {{ic|isatty}} function call.|https://github.com/lilydjwg/stdoutisatty.|{{AUR|stdoutisatty-git}}}}<br />
:Example: {{ic|stdoutisatty ''program'' <nowiki>| less</nowiki>}}<br />
* {{App|unbuffer|A tclsh script comes with expect, it invokes desired program within a pty.|http://expect.sourceforge.net/example/unbuffer.man.html|{{Pkg|expect}}}}<br />
:Example: {{ic|unbuffer ''program'' <nowiki>| less</nowiki>}}<br />
<br />
Alternatively, using [http://zsh.sourceforge.net/Doc/Release/Zsh-Modules.html#The-zsh_002fzpty-Module zpty] module from [[zsh]]: [http://lilydjwg.is-programmer.com/2011/6/29/using-zpty-module-of-zsh.27677.html]<br />
<br />
{{hc|~/.zshrc|<nowiki><br />
zmodload zsh/zpty<br />
<br />
pty() {<br />
zpty pty-${UID} ${1+$@}<br />
if [[ ! -t 1 ]];then<br />
setopt local_traps<br />
trap '' INT<br />
fi<br />
zpty -r pty-${UID}<br />
zpty -d pty-${UID}<br />
}<br />
<br />
ptyless() {<br />
pty $@ | less<br />
}<br />
</nowiki>}}<br />
<br />
Usage:<br />
<br />
$ ptyless ''program''<br />
<br />
To pipe it to other pager (less in this example):<br />
<br />
$ pty ''program'' | less<br />
<br />
=== ls ===<br />
<br />
The {{ic|1=--color=auto}} option enables color highlighting. Color codes are emitted only on standard output; not in pipes or redirection.<br />
<br />
Use an [[alias]] to permanently enable this option:<br />
<br />
alias ls='ls --color=auto'<br />
<br />
The {{ic|LS_COLORS}} variable is used to define colors, and it configures various parts of highlighting. Use the {{man|1|dircolors}} command to set it.<br />
<br />
{{Note|Using the {{ic|--color}} option may incur a noticeable performance penalty when ''ls'' is run in a directory with very many entries. The default settings require ''ls'' to {{man|1|stat}} every single file it lists. However, if you would like most of the file-type coloring but can live without the other coloring options (e.g. executable, orphan, sticky, other-writable, capability), use ''dircolors'' to set the {{ic|LS_COLORS}} environment variable like this:<br />
<br />
<nowiki>eval $(dircolors -p | perl -pe 's/^((CAP|S[ET]|O[TR]|M|E)\w+).*/$1 00/' | dircolors -)</nowiki><br />
<br />
}}<br />
<br />
See {{man|1|ls}} for more information.<br />
<br />
=== man ===<br />
<br />
To enable colored {{Ic|man}}, two main pagers, {{Ic|less}} and {{Ic|most}}, are hacked here.<br />
<br />
==== Using less ====<br />
<br />
See [[#less]] for a more detailed description.<br />
<br />
For bash or zsh, add the following {{Ic|less}} wrapper function to {{ic|~/.bashrc}} or {{ic|~/.zshrc}}:<br />
<br />
{{bc|<nowiki><br />
man() {<br />
LESS_TERMCAP_md=$'\e[01;31m' \<br />
LESS_TERMCAP_me=$'\e[0m' \<br />
LESS_TERMCAP_se=$'\e[0m' \<br />
LESS_TERMCAP_so=$'\e[01;44;33m' \<br />
LESS_TERMCAP_ue=$'\e[0m' \<br />
LESS_TERMCAP_us=$'\e[01;32m' \<br />
command man "$@"<br />
}<br />
</nowiki>}}<br />
<br />
For [[Fish]] you could accomplish this with:<br />
<br />
{{hc|~/.config/fish/config.fish|<nowiki><br />
set -xU LESS_TERMCAP_md (printf "\e[01;31m")<br />
set -xU LESS_TERMCAP_me (printf "\e[0m")<br />
set -xU LESS_TERMCAP_se (printf "\e[0m")<br />
set -xU LESS_TERMCAP_so (printf "\e[01;44;33m")<br />
set -xU LESS_TERMCAP_ue (printf "\e[0m")<br />
set -xU LESS_TERMCAP_us (printf "\e[01;32m")<br />
</nowiki>}}<br />
<br />
Remember to source your config or restart your shell to make the changes take effect.<br />
<br />
==== Using most ====<br />
<br />
The basic function of 'most' is similar to {{Ic|less}} and {{Ic|more}}, but it has a smaller feature set. Configuring most to use colors is easier than using less, but additional configuration is necessary to make most behave like less.<br />
Install the {{Pkg|most}} package.<br />
<br />
Edit {{ic|/etc/man_db.conf}}, uncomment the pager definition and change it to:<br />
<br />
DEFINE pager most -s<br />
<br />
Test the new setup by typing:<br />
<br />
$ man whatever_man_page<br />
<br />
Modifying the color values requires editing {{ic|~/.mostrc}} (creating the file if it is not present) or editing {{ic|/etc/most.conf}} for system-wide changes. Example {{ic|~/.mostrc}}:<br />
<br />
% Color settings<br />
color normal lightgray black<br />
color status yellow blue<br />
color underline yellow black<br />
color overstrike brightblue black<br />
<br />
Another example showing keybindings similar to {{Ic|less}} (jump to line is set to 'J'):<br />
<br />
% less-like keybindings<br />
unsetkey "^K"<br />
unsetkey "g"<br />
unsetkey "G"<br />
unsetkey ":"<br />
<br />
setkey next_file ":n"<br />
setkey find_file ":e"<br />
setkey next_file ":p"<br />
setkey toggle_options ":o"<br />
setkey toggle_case ":c"<br />
setkey delete_file ":d"<br />
setkey exit ":q"<br />
<br />
setkey bob "g"<br />
setkey eob "G"<br />
setkey down "e"<br />
setkey down "E"<br />
setkey down "j"<br />
setkey down "^N"<br />
setkey up "y"<br />
setkey up "^Y"<br />
setkey up "k"<br />
setkey up "^P"<br />
setkey up "^K"<br />
setkey page_down "f"<br />
setkey page_down "^F"<br />
setkey page_up "b"<br />
setkey page_up "^B"<br />
setkey other_window "z"<br />
setkey other_window "w"<br />
setkey search_backward "?"<br />
setkey bob "p"<br />
setkey goto_mark "'"<br />
setkey find_file "E"<br />
setkey edit "v"<br />
<br />
==== Using X resources ====<br />
<br />
A quick way to add color to manual pages viewed on {{Pkg|xterm}}/{{Ic|uxterm}} or {{Pkg|rxvt-unicode}} is to modify {{ic|~/.Xresources}}.<br />
<br />
===== xterm =====<br />
<br />
*VT100.colorBDMode: true<br />
*VT100.colorBD: red<br />
*VT100.colorULMode: true<br />
*VT100.colorUL: cyan<br />
<br />
which ''replaces'' the decorations with the colors. Also add:<br />
<br />
*VT100.veryBoldColors: 6<br />
<br />
if you want colors and decorations (bold or underline) ''at the same time''. See {{ic|man xterm}} for a description of the {{ic|veryBoldColors}} resource.<br />
<br />
===== rxvt-unicode =====<br />
<br />
URxvt.colorIT: #87af5f<br />
URxvt.colorBD: #d7d7d7<br />
URxvt.colorUL: #87afd7<br />
<br />
Run:<br />
<br />
$ xrdb -load ~/.Xresources<br />
<br />
Launch a new {{Ic|xterm/uxterm}} or {{Ic|rxvt-unicode}} and you should see colorful man pages.<br />
<br />
This combination puts colors to '''bold''' and <u>underlined</u> words in {{Ic|xterm/uxterm}} or to '''bold''', <u>underlined</u>, and ''italicized'' text in {{Ic|rxvt-unicode}}. You can play with different combinations of these attributes (see the [http://pub.ligatura.org/fs/xfree86/xresources/xterm sources]{{Dead link|2013|09|10}} of this item).<br />
<br />
=== pacman ===<br />
<br />
[[Pacman]] has a color option. Uncomment the {{ic|Color}} line in {{ic|/etc/pacman.conf}}.<br />
<br />
== Wrappers ==<br />
<br />
{{move||Some of these could be made into sections of their own, or moved to existing sections such as [[#diff]]}}<br />
<br />
=== Universal wrappers ===<br />
<br />
(most of them outdated but still functioning)<br />
<br />
They go with multiple preconfigured presets that can be changed, and new can be created/contributed.<br />
<br />
* {{App|rainbow|Colorize commands output or STDIN using patterns.<br>Presets: df, diff, env, host, ifconfig, java-stack-trace, jboss, jonas, md5sum, mvn2, mvn3, ping, tomcat, top, traceroute.|https://github.com/nicoulaj/rainbow}}<br />
* {{App|grc|Yet another colouriser for beautifying your logfiles or output of commands.<br>Presets: configure, cvs, df, diff, esperanto, gcc, irclog, ldap, log, mount, netstat, ping, proftpd, traceroute, wdiff.|https://github.com/pengwynn/grc|{{Pkg|grc}}}}<br />
* {{App|colorlogs|Colorize commands output or STDIN using patterns.<br>Presets: logs, git status, ant, maven.|https://github.com/memorius/colorlogs}}<br />
* {{App|cope|A colourful wrapper for terminal programs.<br>Presets: acpi, arp, cc, df, dprofpp, fdisk, free, g++, gcc, id, ifconfig, ls, lspci, lsusb, make, md5sum, mpc, netstat, nm, nmap, nocope, ping, pmap, ps, readelf, route, screen, sha1sum, sha224sum, sha256sum, sha384sum, sha512sum, shasum, socklist, stat, strace, tcpdump, tracepath, traceroute, w, wget, who, xrandr.|https://github.com/yogan/cope|{{AUR|cope-git}}}}<br />
* {{App|cw|A non-intrusive real-time ANSI color wrapper for common unix-based commands.<br>Presets: arp, arping, auth.log@, blockdev, cal, cksum, clock, configure, cpuinfo@, crontab@, cw-pipe, cw-test.cgi, date, df, diff, dig, dmesg, du, env, figlet, file, find, finger, free, fstab@, fuser, g++, gcc, group@, groups, hdparm, hexdump, host, hosts@, id, ifconfig, inittab@, iptables, last, lastlog, lsattr, lsmod, lsof, ltrace-color, make, md5sum, meminfo@, messages@, mount, mpg123, netstat, nfsstat, nmap, nslookup, objdump, passwd@, ping, pmap, pmap_dump, praliases, profile@, protocols@, ps, pstree, quota, quotastats, resolv.conf@, route, routel, sdiff, services@, showmount, smbstatus, stat, strace-color, sysctl, syslog, tar, tcpdump, tracepath, traceroute, umount, uname, uptime, users, vmstat, w, wc, whereis, who, xferlog.|http://cwrapper.sourceforge.net/|{{AUR|cw}}}}<br />
<br />
=== Libraries for colorizing an output ===<br />
<br />
* {{App|ruby-rainbow|Rainbow is extension to ruby's String class adding support for colorizing text on ANSI terminal|https://rubygems.org/gems/rainbow/|{{Pkg|ruby-rainbow}}}}<br />
* {{App|python-blessings|A thin, practical wrapper around terminal coloring, styling, and positioning|https://pypi.python.org/pypi/blessings|{{Pkg|python-blessings}}, {{Pkg|python2-blessings}}}}<br />
* {{App|ccze|A fast log colorizer written in C, intended to be adrop-in replacement for colorize|https://github.com/cornet/ccze/|{{Pkg|ccze}}}}<br />
<br />
=== Application specific ===<br />
<br />
==== Compilers ====<br />
<br />
* {{App|colorgcc|A Perl wrapper to colorize the output of compilers with warning/error messages matching the gcc output format|https://schlueters.de/colorgcc.html|{{Pkg|colorgcc}}}}<br />
<br />
==== diff ====<br />
<br />
Diff has [[#diff|built-in color output]], which is reasonable to use. But the following wrappers can be used:<br />
<br />
* {{App|colordiff|Perl script for ''diff'' highlighting.|http://www.colordiff.org/|{{Pkg|colordiff}}}}<br />
* {{App|cwdiff|''(w)diff'' wrapper with directories support and highlighting.|https://github.com/junghans/cwdiff|{{AUR|cwdiff}}, {{AUR|cwdiff-git}}}}<br />
<br />
==== less ====<br />
<br />
===== source-highlight =====<br />
<br />
You can enable code syntax coloring in ''less''. First, [[install]] {{Pkg|source-highlight}}, then add these lines to your shell configuration file:<br />
<br />
{{hc|~/.bashrc|<nowiki><br />
export LESSOPEN="| /usr/bin/source-highlight-esc.sh %s"<br />
export LESS='-R '<br />
</nowiki>}}<br />
<br />
===== lesspipe =====<br />
<br />
Frequent users of the command line interface might want to install {{Pkg|lesspipe}}.<br />
<br />
Users may now list the compressed files inside of an archive using their pager:<br />
<br />
{{hc|$ less ''compressed_file''.tar.gz|2=<br />
==> use tar_file:contained_file to view a file in the archive<br />
-rw------- ''username''/''group'' 695 2008-01-04 19:24 ''compressed_file''/''content1''<br />
-rw------- ''username''/''group'' 43 2007-11-07 11:17 ''compressed_file''/''content2''<br />
''compressed_file''.tar.gz (END)<br />
}}<br />
<br />
''lesspipe'' also grants ''less'' the ability of interfacing with files other than archives, serving as an alternative for the specific command associated for that file-type (such as viewing HTML via {{Pkg|python-html2text}}).<br />
<br />
Re-login after installing ''lesspipe'' in order to activate it, or source {{ic|/etc/profile.d/lesspipe.sh}}.<br />
<br />
==== Make ====<br />
<br />
* {{App|colormake|A simple wrapper around make to make it's output more readable.|http://bre.klaki.net/programs/colormake/|{{AUR|colormake}}, {{AUR|colormake-git}}}}<br />
<br />
==== Ping ====<br />
<br />
* {{App|prettyping|Add some great features to ping monitoring. A wrapper around the standard ping tool with the objective of making the output prettier, more colorful, more compact, and easier to read.|http://denilson.sa.nom.br/prettyping/|{{AUR|prettyping}}}}<br />
<br />
== Shells ==<br />
<br />
=== bash ===<br />
<br />
See [[Bash/Prompt customization#Colors]].<br />
<br />
=== zsh ===<br />
<br />
See [[Zsh#Colors]].<br />
<br />
=== Fish ===<br />
<br />
See [[Fish#Web interface]].<br />
<br />
== Terminal emulators ==<br />
<br />
=== Virtual console ===<br />
<br />
{{Style|Lacks clarity on what "the colors" are, i.e. in [[#Virtual console]] they are about the ''representations'' of the 16 base colors (RGB values for yellow, red, blue, etc.), while in [[#Login screen]] they are about the base colors themselves. See also {{man|4|console_codes}} and [[User:Isacdaavid/Linux_Console]]}}<br />
<br />
The colors in the [[w:Virtual console|Linux virtual console]]—see {{man|4|console}}—running on the framebuffer can be changed. This is done by writing the escape code {{ic|\\e]PXRRGGBB}}, where {{ic|X}} is the hexadecimal index of the color from 0-F, and {{ic|RRGGBB}} is a traditional hexadecimal RGB code. <br />
<br />
For example, to reuse existing colors defined in {{ic|~/.Xresources}}, add the following to the shell initialization file (such as {{ic|~/.bashrc}}):<br />
<br />
if [ "$TERM" = "linux" ]; then<br />
_SEDCMD='s/.*\*color\([0-9]\{1,\}\).*#\([0-9a-fA-F]\{6\}\).*/\1 \2/p'<br />
for i in $(sed -n "$_SEDCMD" $HOME/.Xresources | awk '$1 < 16 {printf "\\e]P%X%s", $1, $2}'); do<br />
echo -en "$i"<br />
done<br />
clear<br />
fi<br />
<br />
==== Login screen ====<br />
<br />
The below is a colored example of the virtual console login screen in {{ic|/etc/issue}}. Create a backup of the original file with {{ic|mv /etc/issue /etc/issue.bak}} as root, and create a new {{ic|/etc/issue}}:<br />
<br />
\e[H\e[2J<br />
\e[1;30m| \e[34m\\s \\r<br />
\e[36;1m/\\\\ \e[37m|| \e[36m| | \e[30m|<br />
\e[36m/ \\\\ \e[37m|| \e[36m| _ \e[30m| \e[32m\\t<br />
\e[1;36m/ \e[0;36m.. \e[1m\\\\ \e[37m//==\\\\\\\\ ||/= /==\\\\ ||/=\\\\ \e[36m| | |/ \\\\ | | \\\\ / \e[30m| \e[32m\\d<br />
\e[0;36m/ . . \\\\ \e[37m|| || || | || || \e[36m| | | | | | X \e[1;30m|<br />
\e[0;36m/ . . \\\\ \e[37m\\\\\\\\==/| || \\\\==/ || || \e[36m| | | | \\\\_/| / \\\\ \e[1;30m| \e[31m\\U<br />
\e[0;36m/ .. .. \\\\ \e[0;37mA simple, lightweight linux distribution. \e[1;30m|<br />
\e[0;36m/_\x27 `_\\\\ \e[1;30m| \e[35m\\l \e[0mon \e[1;33m\\n<br />
\e[0m<br />
<br />
<br />
Save the file and make it executable with {{ic|chmod +x /etc/issue}}.<br />
<br />
See also:<br />
<br />
* https://bbs.archlinux.org/viewtopic.php?pid=386429#p386429<br />
* http://www.linuxfromscratch.org/blfs/view/svn/postlfs/logon.html<br />
<br />
=== X window system ===<br />
<br />
Most [[Xorg]] terminals, including [[xterm]] and [[urxvt]], support at least 16 basic colors. The colors 0-7 are the 'normal' colors. Colors 8-15 are their 'bright' counterparts, used for highlighting. These colors can be modified through [[X resources]], or through specific terminal settings. For example:<br />
<br />
{{hc|1=~/.Xresources|2=<br />
! Black + DarkGrey<br />
*color0: #000000<br />
*color8: #555753<br />
! DarkRed + Red<br />
*color1: #ff6565<br />
*color9: #ff8d8d<br />
! DarkGreen + Green<br />
*color2: #93d44f<br />
*color10: #c8e7a8<br />
! DarkYellow + Yellow<br />
*color3: #eab93d<br />
*color11: #ffc123<br />
! DarkBlue + Blue<br />
*color4: #204a87<br />
*color12: #3465a4<br />
! DarkMagenta + Magenta<br />
*color5: #ce5c00<br />
*color13: #f57900<br />
!DarkCyan + Cyan (both not tango)<br />
*color6: #89b6e2<br />
*color14: #46a4ff<br />
! LightGrey + White<br />
*color7: #cccccc<br />
*color15: #ffffff<br />
}}<br />
<br />
{{Warning|Color resources such as {{ic|foreground}} and {{ic|background}} can be read by other applications (such as [https://www.gnu.org/software/emacs/manual/html_node/emacs/Table-of-Resources.html emacs]). This can be avoided by specifiying the class name, for example {{ic|XTerm.foreground}}.}}<br />
<br />
See also:<br />
<br />
* [[#Using X resources]] for how to color bold and underlined text automatically.<br />
* [https://web.archive.org/web/20090130061234/http://phraktured.net/terminal-colors/ Color Themes] - Extensive list of terminal color themes by Phraktured.<br />
* [http://xcolors.net/ Xcolors.net] List of user-contributed terminal color themes.<br />
* [http://beta.andrewrcraig.us/index.php?page=xcolors Xcolors by dkeg]<br />
<br />
* [https://github.com/chriskempson/base16 base16 color schemes]<br />
<br />
=== Display all 256 colors ===<br />
<br />
Prints all 256 colors across the screen.<br />
<br />
$ (x=`tput op` y=`printf %76s`;for i in {0..256};do o=00$i;echo -e ${o:${#o}-3:3} `tput setaf $i;tput setab $i`${y// /=}$x;done)<br />
<br />
=== Display tput escape codes ===<br />
<br />
{{Merge|Bash/Prompt_customization|More context on ''tput'' is provided in that article}}<br />
<br />
Replace {{ic|tput op}} with whatever tput you want to trace. {{ic|op}} is the default foreground and background color.<br />
<br />
{{hc|<nowiki>$ ( strace -s5000 -e write tput op 2>&2 2>&1 ) | tee -a /dev/stderr | grep -o '"[^"]*"'</nowiki>|<br />
033[\033[1;34m"\33[39;49m"\033[00m<br />
}}<br />
<br />
=== Enumerate supported colors ===<br />
<br />
The following command will let you discover all the terminals you have terminfo support for, and the number of colors each terminal supports. The possible values are: 8, 15, 16, 52, 64, 88 and 256.<br />
<br />
{{hc|<nowiki>$ for T in `find /usr/share/terminfo -type f -printf '%f '`;do echo "$T `tput -T $T colors`";done|sort -nk2</nowiki>|<br />
Eterm-88color 88<br />
rxvt-88color 88<br />
xterm+88color 88<br />
xterm-88color 88<br />
Eterm-256color 256<br />
gnome-256color 256<br />
konsole-256color 256<br />
putty-256color 256<br />
rxvt-256color 256<br />
screen-256color 256<br />
screen-256color-bce 256<br />
screen-256color-bce-s 256<br />
screen-256color-s 256<br />
xterm+256color 256<br />
xterm-256color 256<br />
}}<br />
<br />
=== Enumerate terminal capabilities ===<br />
<br />
{{Merge|Bash/Prompt_customization|More context on ''tput'' is provided in that article}}<br />
<br />
This command is useful to see what features that are supported by your terminal.<br />
<br />
{{hc|<nowiki>$ infocmp -1 | sed -nu 's/^[ \000\t]*//;s/[ \000\t]*$//;/[^ \t\000]\{1,\}/!d;/acsc/d;s/=.*,//p'|column -c80</nowiki>|<br />
bel cuu ich kb2 kf15 kf3 kf44 kf59 mc0 rmso smul<br />
blink cuu1 il kbs kf16 kf30 kf45 kf6 mc4 rmul tbc<br />
bold cvvis il1 kcbt kf17 kf31 kf46 kf60 mc5 rs1 u6<br />
cbt dch ind kcub1 kf18 kf32 kf47 kf61 meml rs2 u7<br />
civis dch1 indn kcud1 kf19 kf33 kf48 kf62 memu sc u8<br />
clear dl initc kcuf1 kf2 kf34 kf49 kf63 op setab u9<br />
cnorm dl1 invis kcuu1 kf20 kf35 kf5 kf7 rc setaf vpa<br />
}}<br />
<br />
=== Color scheme scripts ===<br />
<br />
See [https://paste.xinu.at/m-dAiJ/] for scripts which display a chart of your current terminal scheme.<br />
<br />
== See also ==<br />
<br />
* [https://gkbrk.com/2016/07/lolcat-clone-in-x64-assembly/ lolcat clone in x64 assembly]<br />
* [http://unix.stackexchange.com/a/147 Setting colors for less] and [http://unix.stackexchange.com/a/6357 solving related problems] (threads on StackExchange)</div>Cirrushttps://wiki.archlinux.org/index.php?title=WeeChat&diff=454781WeeChat2016-10-22T22:08:04Z<p>Cirrus: /* See also */ dead links</p>
<hr />
<div>[[Category:Internet Relay Chat]]<br />
[[ja:WeeChat]]<br />
{{Style|See [[Help:Style]] and related.}}<br />
<br />
{{Related articles start}}<br />
{{Related|IRC channels}}<br />
{{Related|IRC}}<br />
{{Related|irssi}}<br />
{{Related|HexChat}}<br />
{{Related articles end}}<br />
'''WeeChat''' is a highly extendable and feature rich IRC Client currently under heavy development.<br />
<br />
== Installing ==<br />
<br />
[[Install]] the {{Pkg|weechat}} package, or {{AUR|weechat-git}} for the development version.<br />
<br />
== Running WeeChat==<br />
<br />
WeeChat is going to have multiple interfaces at some point, run '''weechat-[interface]''' to start WeeChat. <br />
<br />
As WeeChat currently only has an Ncurses interface. The command to start WeeChat is:<br />
<br />
$ weechat<br />
<br />
== Configuration ==<br />
<br />
You can configure WeeChat in 3 ways: using WeeChat's internal commands; using '''iset'''; or by editing the .conf files directly. WeeChat will automatically save settings on exit or when you run {{ic|/save}}, so if you are editing a .conf file in an editor, be sure to run {{ic|/reload}} from the console before exiting, otherwise your changes will be lost.<br />
<br />
=== Internal commands ===<br />
<br />
The {{ic|/set}} command follows this structure:<br />
{{ic|/set [file.name].[section].[directive]}}<br />
<br />
You can get a list of all configurable options by typing {{ic|/set}} in the '''weechat''' buffer window. Since there are nearly 600 default configurable options, you can search through them with a wildcard syntax: {{ic|/set irc.server.*}} or {{ic|/set *server*}} as an example. You can get help on each option with the {{ic|/help}} command: <br />
<br />
/help irc.server.freenode.autoconnect<br />
<br />
=== Internal menu-based ===<br />
<br />
For a more convenient method, install the '''iset''' script. If you have weechat 0.3.9 or newer, run:<br />
<br />
/script install iset.pl<br />
<br />
In older versions, use {{ic|/weeget install iset}}, or download [http://www.weechat.org/scripts/source/stable/iset.pl.html/ iset.pl] into your {{ic|~/.weechat/perl/autoload}} directory manually.<br />
<br />
Afterwards, run<br />
<br />
/iset<br />
<br />
to get a buffer with all configuration options.<br />
<br />
=== Configuration Files ===<br />
<br />
The .conf files for WeeChat are saved to {{ic|~/.weechat}}. These files are not commented. Detailed information can be found within the program itself (see '''Internally''' above), or WeeChat's [http://www.weechat.org/files/doc/stable/weechat_user.en.html user guide].<br />
<br />
{{Tip|in case you want to move {{ic|.weechat}} directory somewhere else (like in your '''$XDG_CONFIG_HOME'''), use this option: {{ic|$weechat -d $XDG_CONFIG_HOME/weechat}} or set the environment variable {{ic|WEECHAT_HOME}}.}}<br />
<br />
== Connecting to a server ==<br />
<br />
{{Note| Using '''/connect''' to connect to a temporary server is disabled by default if you're using 1.1+ [https://weechat.org/files/releasenotes/ReleaseNotes-devel.html#_temporary_servers_disabled_by_default_with_connect Release Note]<br />
<br />
Enable by '''/set irc.look.temporary_servers on'''<br />
<br />
}}<br />
<br />
You can connect to a IRC server by using '''/connect'''.<br />
<br />
/connect chat.freenode.net<br />
<br />
Or if there is already a '''Server''' setup you can use:<br />
<br />
/connect freenode<br />
<br />
== Creating a Server profile ==<br />
<br />
If you plan on connecting to a server more than once it may be beneficial to create a '''Server'''.<br />
<br />
/server add example irc.example.net/6667<br />
<br />
Would create the server '''example''' which would connect to '''irc.example.net''' on port '''6667'''<br />
<br />
See the WeeChat documentation and '''/help server''' for more information.<br />
<br />
== Configuring SSL ==<br />
<br />
Many IRC servers, including [https://freenode.net/ freenode] where [[IRC channel|#archlinux]] is, support SSL.<br />
<br />
If you're making a server with '''/server''', add the SSL port (usually 6697) and '''-ssl''' to the end of the line. For example:<br />
<br />
/server add freenode chat.freenode.net/6697 -ssl<br />
<br />
You can do the same thing if using '''/connect'''.<br />
<br />
/connect chat.freenode.net/6697 -ssl<br />
<br />
{{Warning|Some servers need the '''ssl_dhkey_size''' value changed to something lower. For example, if you're using freenode you'll need to set '''/set irc.server.freenode.ssl_dhkey_size 1024''' or '''/set irc.server.chat.freenode.net.ssl_dhkey_size 1024''' (see the server log)}}<br />
<br />
{{Note|Different servers may have a different port than 6697 - this is server specific.}}<br />
<br />
You may also want to change the location where WeeChat looks for trusted authorities (the default value is {{ic|%h/ssl/CAs.pem}} which translates to {{ic|~/.weechat/ssl/CAs.pem)}}:<br />
<br />
/set weechat.network.gnutls_ca_file "/etc/ssl/certs/ca-certificates.crt"<br />
<br />
== Tips and Tricks ==<br />
<br />
=== Upgrading ===<br />
<br />
WeeChat can be upgraded without disconnecting from the IRC servers (non-SSL connections only):<br />
<br />
/upgrade<br />
<br />
This will load the new WeeChat binary and reload the current configuration.<br />
<br />
=== Aliases ===<br />
<br />
Aliases can be created to simplify commonly executed commands. A nice example is Wraithan's '''smart filter''' alias:<br />
<br />
'''Smart Filter'''<br />
<br />
First, we need to enable smart filters:<br />
<br />
/set irc.look.smart_filter "on"<br />
<br />
Next, we will create the '''sfilter''' alias:<br />
<br />
/alias add sfilter filter add irc_smart_$server_$channel irc.$server.$channel irc_smart_filter *<br />
<br />
We can now type<br />
<br />
/sfilter<br />
<br />
in any buffer, and the smart filter will only be enabled for that buffer.<br />
<br />
The following alias will remove a previously enabled smart filter in the current buffer. Add the alias:<br />
<br />
/alias add rmsfilter filter del irc_smart_$server_$channel<br />
<br />
and execute it by<br />
<br />
/rmsfilter<br />
<br />
=== Exec command ===<br />
A new plugin called "exec" has been added, with command {{ic|/exec}}. It will execute external command and can display output to the current buffer with the '''-o''' option or locally (default).<br />
<br />
=== Key Bindings ===<br />
<br />
Some helpful bindings:<br />
<br />
To use ctrl-left/right arrow keys to jump to next/previous words on the input line:<br />
<br />
/key bind meta2-1;5D /input move_previous_word<br />
/key bind meta2-1;5C /input move_next_word<br />
<br />
=== SSH connection lost when idle ===<br />
<br />
If you're connecting to your WeeChat through a remote shell using SSH, for example running it in [[screen]] or [[tmux]] you might experience getting disconnected after a while when idle. There are multiple factors in play why this might happen, but the easiest way to change this is to force the connection to be kept alive by appending this to your SSH-configuration on the remote shell.<br />
<br />
This has nothing to do with WeeChat itself, but losing connection when idle won't happen with it's alternative [[irssi]] by default, and thus is a common situation for those converting to WeeChat. <br />
<br />
{{hc|# /etc/ssh/sshd_config|2=<br />
ClientAliveInterval 300}}<br />
<br />
Or have a look at [http://mosh.mit.edu/ Mosh].<br />
<br />
=== OTR ===<br />
<br />
Install {{AUR|python2-potr}} and enable the script '''otr.py'''. Then:<br />
<br />
/query <nick><br />
/otr start<br />
<br />
Get help on the plugin with:<br />
<br />
/help otr<br />
<br />
=== Slack ===<br />
<br />
[https://slack.com/ Slack] is a platform for team communication; an IRC on steroids. Thanks to its open API, it is possible to connect to your slack team using weechat.<br />
<br />
==== IRC gateway ====<br />
<br />
Once weechat is running, all you have to is add a new server this way:<br />
<br />
{{ic|<nowiki>/server add NAME HOST/6667 -autoconnect -ssl -ssl_dhkey_size=512 -password=PASSWORD -username=USERNAME -nicks=NICK</nowiki>}}<br />
<br />
where:<br />
<br />
* '''NAME''' is the name you want to give to the server<br />
* '''HOST''' is the the Host as provided on the Gateways page of your slack team<br />
* '''PASSWORD''' is the Pass as provided on the Gateways page of your slack team<br />
* '''USERNAME''' is the User as provided on the Gateways page of your slack team<br />
* '''NICK''' is your Slack username.<br />
<br />
===== Upload file =====<br />
<br />
To upload a file, run this following command from your shell :<br />
<br />
{{ic|<nowiki>curl -F file=@/path/to/file -F channels=CHAN -F token=XXX https://slack.com/api/files.upload</nowiki>}}<br />
<br />
where:<br />
<br />
* '''CHAN''' is the channel ID as provided on the Gateways page of your slack team<br />
* '''XXX''' is the team token as provided on the Gateways page of your slack team<br />
<br />
==== Native client ====<br />
<br />
There is a native client for slack: [https://github.com/rawdigits/wee-slack wee-slack]<br />
<br />
You need to install the python2 librairy websocket-client:<br />
<br />
{{ic|<nowiki>pacman -S python2-websocket-client</nowiki>}}<br />
<br />
Then install the wee-chat plugin into the weechat configuration folder<br />
<br />
{{ic|<nowiki>curl -o ~/.weechat/python/autoload/wee_slack.py https://raw.githubusercontent.com/rawdigits/wee-slack/master/wee_slack.py</nowiki>}}<br />
<br />
Run {{ic|<nowiki>/python reload</nowiki>}} to load the new plugin<br />
<br />
You will need an access token. You can grab one at [https://api.slack.com/docs/oauth-test-tokens here]<br />
<br />
Once weechat is running, register your token into weechat:<br />
<br />
{{ic|<nowiki>/set plugins.var.python.slack_extension.slack_api_token [YOUR_SLACK_TOKEN]</nowiki>}}<br />
<br />
And finally:<br />
<br />
{{ic|<nowiki>/save</nowiki>}}<br />
<br />
{{ic|<nowiki>/python reload</nowiki>}}<br />
<br />
===== Upload file =====<br />
<br />
To upload a file enter the following command into weechat:<br />
<br />
{{ic|<nowiki>/slack upload [file_path]</nowiki>}}<br />
<br />
=== Desktop notifications ===<br />
<br />
To receive desktop notifications for mentions or private messages, the [https://github.com/s3rvac/weechat-notify-send weechat-notify-send] script by Petr Zemek can be used.<br />
<br />
To install, use:<br />
<br />
cd ~/.weechat/python<br />
curl -O <nowiki>https://raw.githubusercontent.com/s3rvac/weechat-notify-send/master/notify_send.py</nowiki><br />
ln -s ../notify_send.py autoload/<br />
<br />
The script uses {{Pkg|libnotify}} and is known to work with both KDE and Gnome.<br />
<br />
=== Mobile device notifications ===<br />
<br />
To receive notifications for mentions or private messages to an Android mobile device, you can use the [https://irssinotifier.appspot.com/ IrssiNotifier] port to WeeChat from [http://www.weechat.org/files/scripts/irssinotifier.py here]. This script requires a Google Account, and a registration step with the service provider to obtain an API key. Then, install the plugin<br />
<br />
cd ~/.weechat/python<br />
curl -O <nowiki>http://www.weechat.org/files/scripts/irssinotifier.py</nowiki><br />
ln -s ../irssinotifier.py autoload/<br />
<br />
and intialize the API token and end-to-end encryption password in WeeChat<br />
<br />
/set plugins.var.python.irssinotifier.api_token your-api-token-from-website<br />
/set plugins.var.python.irssinotifier.encryption_password your-password-same-as-in-andoid-app<br />
/save<br />
<br />
An alternative that does not require a Google Account is a Ruby script for [http://www.notifymyandroid.com NotifyMyAndroid.com] from [https://github.com/jamtur01/nma-weechat here], with a similar installation procedure to the above, but into {{ic|~/.weechat/ruby}}.<br />
<br />
== Troubleshooting ==<br />
<br />
=== Errors loading plugins ===<br />
<br />
You may see output like the following in the main window after starting '''weechat''':<br />
<br />
12:29:37 =!= | Error: unable to load plugin "/usr/lib/weechat/plugins/'''tcl.so'''": libtcl8.6.so: cannot open shared object file: No such file or directory<br />
12:29:37 =!= | If you're trying to load a script and not a C plugin, try command to load scripts (/perl, /python, ...)<br />
12:29:37 =!= | Error: unable to load plugin "/usr/lib/weechat/plugins/'''ruby.so'''": libruby.so.2.0: cannot open shared object file: No such file or directory<br />
12:29:37 =!= | If you're trying to load a script and not a C plugin, try command to load scripts (/perl, /python, ...)<br />
12:29:37 | Plugins loaded: alias, aspell, charset, fifo, guile, irc, logger, lua, perl, python, relay, rmodifier, script, xfer<br />
<br />
The default configuration for weechat attempts to load all plugins found in /usr/lib/weechat/plugins which in this case includes both tcl and ruby. These packages are not required by the weechat package and may not be installed on your machine. There are two options if these errors bother you:<br />
<br />
# [[Packages|Install]] [https://www.archlinux.org/packages/?name=tcl tcl], [https://www.archlinux.org/packages/?name=ruby ruby] from the [[official repositories]].<br />
# Or, run {{ic|/set weechat.plugin.autoload "*,!tcl,!ruby"}} which will prevent loading those plugins with a bang (!) prefix.<br />
<br />
== Getting Help ==<br />
<br />
To access WeeChat's built-in help, simply type<br />
<br />
/help<br />
<br />
and the help will be displayed in the main buffer (usually buffer 1).<br />
<br />
== See also ==<br />
<br />
* [http://www.weechat.org Home Page]<br />
* [http://www.weechat.org/doc/ WeeChat Documentation]<br />
* [http://www.weechat.org/scripts/ WeeChat Scripts]<br />
* [http://dev.weechat.org/ WeeChat Development Blog]<br />
<br />
=== Guides ===<br />
<br />
* [http://fixato.org/guides/setting_up_weechat.html FiXato's guide to WeeChat]<br />
* [http://robots.thoughtbot.com/weechat-for-slacks-irc-gateway Thoughtbot article on weechat and slack]</div>Cirrushttps://wiki.archlinux.org/index.php?title=Users_and_groups&diff=454399Users and groups2016-10-19T12:00:23Z<p>Cirrus: /* Example adding a user */ added missing word</p>
<hr />
<div>[[Category:Security]]<br />
[[fa:کاربران و گروه ها]]<br />
[[de:Benutzer und Gruppen]]<br />
[[es:Users and groups]]<br />
[[fr:Utilisateurs et Groupes]]<br />
[[it:Users and groups]]<br />
[[ja:ユーザーとグループ]]<br />
[[ru:Users and groups]]<br />
[[sr:Users and groups]]<br />
[[zh-cn:Users and groups]]<br />
[[zh-tw:Users and groups]]<br />
{{Related articles start}}<br />
{{Related|DeveloperWiki:UID / GID Database}}<br />
{{Related|polkit}}<br />
{{Related|File permissions and attributes}}<br />
{{Related articles end}}<br />
<br />
Users and groups are used on GNU/Linux for [[Wikipedia:access control#Computer security|access control]]—that is, to control access to the system's files, directories, and peripherals. Linux offers relatively simple/coarse access control mechanisms by default. For more advanced options, see [[ACL]] and [[PAM#Configuration How-Tos]].<br />
<br />
== Overview ==<br />
<br />
A ''user'' is anyone who uses a computer. In this case, we are describing the names which represent those users. It may be Mary or Bill, and they may use the names Dragonlady or Pirate in place of their real name. All that matters is that the computer has a name for each account it creates, and it is this name by which a person gains access to use the computer. Some system services also run using restricted or privileged user accounts.<br />
<br />
Managing users is done for the purpose of security by limiting access in certain specific ways. The superuser (root) has complete access to the operating system and its configuration; it is intended for administrative use only. Unprivileged users can use the [[su]] and [[sudo]] programs for controlled privilege escalation.<br />
<br />
Any individual may have more than one account, as long as they use a different name for each account they create. Further, there are some reserved names which may not be used such as "root".<br />
<br />
Users may be grouped together into a "group", and users may be added to an existing group to utilize the privileged access it grants.<br />
<br />
{{Note|The beginner should use these tools carefully and stay away from having anything to do with any other ''existing'' user account, other than their own.}}<br />
<br />
== Permissions and ownership ==<br />
<br />
From [http://ph7spot.com/musings/in-unix-everything-is-a-file In UNIX Everything is a File]:<br />
<br />
:The UNIX operating system crystallizes a couple of unifying ideas and concepts that shaped its design, user interface, culture and evolution. One of the most important of these is probably the mantra: "everything is a file," widely regarded as one of the defining points of UNIX.<br />
<br />
:This key design principle consists of providing a unified paradigm for accessing a wide range of input/output resources: documents, directories, hard-drives, CD-ROMs, modems, keyboards, printers, monitors, terminals and even some inter-process and network communications. The trick is to provide a common abstraction for all of these resources, each of which the UNIX fathers called a "file." Since every "file" is exposed through the same API, you can use the same set of basic commands to read/write to a disk, keyboard, document or network device.<br />
<br />
From [http://www.intel-research.net/Publications/Pittsburgh/101220041324_277.pdf Extending UNIX File Abstraction for General-Purpose Networking]:<br />
<br />
:A fundamental and very powerful, consistent abstraction provided in UNIX and compatible operating systems is the file abstraction. Many OS services and device interfaces are implemented to provide a file or file system metaphor to applications. This enables new uses for, and greatly increases the power of, existing applications — simple tools designed with specific uses in mind can, with UNIX file abstractions, be used in novel ways. A simple tool, such as cat, designed to read one or more files and output the contents to standard output, can be used to read from I/O devices through special device files, typically found under the {{ic|/dev}} directory. On many systems, audio recording and playback can be done simply with the commands, "{{ic|cat /dev/audio > myfile}}" and "{{ic|cat myfile > /dev/audio}}," respectively.<br />
<br />
Every file on a GNU/Linux system is owned by a user and a group. In addition, there are three types of access permissions: read, write, and execute. Different access permissions can be applied to a file's owning user, owning group, and others (those without ownership). One can determine a file's owners and permissions by viewing the long listing format of the [[ls]] command:<br />
<br />
{{hc|$ ls -l /boot/|total 13740<br />
drwxr-xr-x 2 root root 4096 Jan 12 00:33 grub<br />
-rw-r--r-- 1 root root 8570335 Jan 12 00:33 initramfs-linux-fallback.img<br />
-rw-r--r-- 1 root root 1821573 Jan 12 00:31 initramfs-linux.img<br />
-rw-r--r-- 1 root root 1457315 Jan 8 08:19 System.map26<br />
-rw-r--r-- 1 root root 2209920 Jan 8 08:19 vmlinuz-linux}}<br />
<br />
The first column displays the file's permissions (for example, the file {{ic|initramfs-linux.img}} has permissions {{ic|-rw-r--r--}}). The third and fourth columns display the file's owning user and group, respectively. In this example, all files are owned by the ''root'' user and the ''root'' group.<br />
<br />
{{hc|$ ls -l /media/|total 16<br />
drwxrwx--- 1 root vboxsf 16384 Jan 29 11:02 sf_Shared}}<br />
<br />
In this example, the {{ic|sf_Shared}} directory is owned by the ''root'' user and the ''vboxsf'' group. It is also possible to determine a file's owners and permissions using the stat command:<br />
<br />
Owning user:<br />
<br />
{{hc|$ stat -c %U /media/sf_Shared/|root}}<br />
<br />
Owning group:<br />
<br />
{{hc|$ stat -c %G /media/sf_Shared/|vboxsf}}<br />
<br />
Access rights:<br />
<br />
{{hc|$ stat -c %A /media/sf_Shared/|drwxrwx---}}<br />
<br />
Access permissions are displayed in three groups of characters, representing the permissions of the owning user, owning group, and others, respectively. For example, the characters {{ic|-rw-r--r--}} indicate that the file's owner has read and write permission, but not execute ({{ic|rw-}}), whilst users belonging to the owning group and other users have only read permission ({{ic|r--}} and {{ic|r--}}). Meanwhile, the characters {{ic|drwxrwx---}} indicate that the file's owner and users belonging to the owning group all have read, write, and execute permissions ({{ic|rwx}} and {{ic|rwx}}), whilst other users are denied access ({{ic|---}}). The first character represents the file's type.<br />
<br />
List files owned by a user or group with the ''find'' utility:<br />
<br />
# find / -group ''group''<br />
<br />
# find / -user ''user''<br />
<br />
A file's owning user and group can be changed with the ''chown'' (change owner) command. A file's access permissions can be changed with the ''chmod'' (change mode) command.<br />
<br />
See [http://linux.die.net/man/1/chown man chown], [http://linux.die.net/man/1/chmod man chmod], and [http://www.linux.com/learn/tutorials/309527-understanding-linux-file-permissions Linux file permissions] for additional detail.<br />
<br />
== File list ==<br />
<br />
{{Warning|Do not edit these files by hand. There are utilities that properly handle locking and avoid invalidating the format of the database. See [[#User management]] and [[#Group management]] for an overview.}}<br />
<br />
{| class="wikitable"<br />
! File || Purpose<br />
|-<br />
| {{ic|/etc/shadow}} || Secure user account information<br />
|-<br />
| {{ic|/etc/passwd}} || User account information<br />
|-<br />
| {{ic|/etc/gshadow}} || Contains the shadowed information for group accounts<br />
|-<br />
| {{ic|/etc/group}} || Defines the groups to which users belong<br />
|-<br />
| {{ic|/etc/sudoers}} || List of who can run what by sudo<br />
|-<br />
| {{ic|/home/*}} || Home directories<br />
|}<br />
<br />
== User management ==<br />
<br />
To list users currently logged on the system, the ''who'' command can be used. To list all existing user accounts including their properties stored in the [[#User database|user database]], run {{ic|passwd -Sa}} as root. See {{man|1|passwd}} for the description of the output format.<br />
<br />
To add a new user, use the ''useradd'' command:<br />
<br />
# useradd -m -g ''initial_group'' -G ''additional_groups'' -s ''login_shell'' ''username''<br />
<br />
* {{ic|-m}} creates the user home directory as {{ic|/home/''username''}}. Within their home directory, a non-root user can write files, delete them, install programs, and so on.<br />
* {{ic|-g}} defines the group name or number of the user's initial login group. If specified, the group name must exist; if a group number is provided, it must refer to an already existing group. If not specified, the behaviour of ''useradd'' will depend on the {{ic|USERGROUPS_ENAB}} variable contained in {{ic|/etc/login.defs}}. The default behaviour ({{ic|USERGROUPS_ENAB yes}}) is to create a group with the same name as the username, with {{ic|GID}} equal to {{ic|UID}}.<br />
* {{ic|-G}} introduces a list of supplementary groups which the user is also a member of. Each group is separated from the next by a comma, with no intervening spaces. The default is for the user to belong only to the initial group.<br />
* {{ic|-s}} defines the path and file name of the user's default login shell. After the boot process is complete, the default login shell is the one specified here. Ensure the chosen shell package is installed if choosing something other than [[Bash]].<br />
<br />
{{Warning|In order to be able to log in, the login shell must be one of those listed in {{ic|/etc/shells}}, otherwise the [[PAM]] module {{ic|pam_shell}} will deny the login request. In particular, do not use the {{ic|/usr/bin/bash}} path instead of {{ic|/bin/bash}}, unless it is properly configured in {{ic|/etc/shells}}.}}<br />
<br />
{{Note|The password for the newly created user must then be defined, using ''passwd'' as shown in [[#Example adding a user]].}}<br />
<br />
When the login shell is intended to be non-functional, for example when the user account is created for a specific service, {{ic|/usr/bin/nologin}} may be specified in place of a regular shell to politely refuse a login (see {{man|8|nologin}}).<br />
<br />
=== Example adding a user ===<br />
<br />
On a typical desktop system, use the following command to add a new user named {{ic|archie}}, specify Bash as their login shell and add them to the [[#User groups|wheel]] group:<br />
<br />
# useradd -m -G wheel -s /bin/bash archie<br />
<br />
{{Tip|Do not worry about adding the user to other groups now. If later on you will install a particular application, or perform a specific configuration, that requires explicitly adding the user to a group, the wiki will remind you to do it in the specific article that you will be following.}}<br />
<br />
Although it is not required to protect the newly created user {{ic|archie}} with a password, it is highly recommend to do so:<br />
# passwd archie<br />
<br />
{{Tip|Bash is the default value for the shell (as indicated by {{ic|useradd -D}}), so you can omit the {{ic|-s}} option except if you want to use something else.}}<br />
<br />
The above ''useradd'' command will also automatically create a group called {{ic|archie}} with the same GID as the UID of the user {{ic|archie}} and makes this the default group for {{ic|archie}} on login. Making each user have their own group (with group name same as user name and GID same as UID) is the preferred way to add users.<br />
<br />
You could also make the default group something else, e.g. {{ic|study}}:<br />
<br />
# useradd -m -g study -G wheel -s /bin/bash archie<br />
<br />
Note that, in multi-user systems, using a single default group (e.g. {{ic|users}}) for every user is not recommended. The reason is that typically, the method for facilitating shared write access for specific groups of users is setting user [[umask]] value to {{ic|002}}, which means that the default group will by default always have write access to any file you create. See also [https://security.ias.edu/how-and-why-user-private-groups-unix User Private Groups].<br />
<br />
In the recommended scenario, where the default group has the same name as the user name, all files are by default writeable only for the user who created them. To allow write access to a specific group, shared files/folders can be made writeable by default for everyone in this group and the owning group can be automatically fixed to the group which owns the parent directory by setting the setgid bit on this directory:<br />
<br />
# chmod g+s ''our_shared_directory''<br />
<br />
Otherwise the file creator's default group (usually the same as the user name) is used. <br />
<br />
If a GID change is required temporarily you can also use the ''newgrp'' command to change the user's default GID to another GID at runtime. For example, after executing {{ic|newgrp ''groupname''}} files created by the user will be associated with the {{ic|''groupname''}} GID, without requiring a re-login. To change back to the default GID, execute ''newgrp'' without a groupname.<br />
<br />
=== Example adding a system user ===<br />
<br />
System users can be used to run processes/daemons under a different user, protecting (e.g. with [[chown]]) files and/or directories and more examples of computer hardening.<br />
<br />
With the following command a system user without shell access and without a {{ic|home}} directory is created (optionally append the {{ic|-U}} parameter to create a group with the same name as the user, and add the user to this group):<br />
<br />
# useradd -r -s /usr/bin/nologin ''username''<br />
<br />
=== Other examples of user management ===<br />
<br />
To change a user's login name:<br />
<br />
# usermod -l ''newname'' ''oldname''<br />
<br />
To change a user's home directory:<br />
<br />
# usermod -d /my/new/home -m ''username''<br />
<br />
The {{ic|-m}} option also automatically creates the new directory and moves the content there.<br />
<br />
{{Tip|You can create a link from the user's former home directory to the new one. Doing this will allow programs to find files that have hardcoded paths.<br />
<br />
# ln -s /my/new/home/ /my/old/home<br />
<br />
Make sure there is '''no''' trailing {{ic|/}} on {{ic|/my/old/home}}.<br />
}}<br />
<br />
To add a user to other groups use ({{ic|''additional_groups''}} is a comma-separated list):<br />
<br />
# usermod -aG ''additional_groups'' ''username''<br />
<br />
{{Warning|If the {{ic|-a}} option is omitted in the ''usermod'' command above, the user is removed from all groups not listed in {{ic|''additional_groups''}} (i.e. the user will be member only of those groups listed in {{ic|''additional_groups''}}).}}<br />
<br />
Alternatively, ''gpasswd'' may be used. Though the username can only be added (or removed) from one group at a time.<br />
<br />
# gpasswd --add ''username'' ''group''<br />
<br />
To enter user information for the [[#User database|GECOS]] comment (e.g. the full user name), type:<br />
<br />
# chfn ''username''<br />
<br />
(this way ''chfn'' runs in interactive mode).<br />
<br />
Alternatively the GECOS comment can be set more liberally with:<br />
<br />
# usermod -c "Comment" ''username''<br />
<br />
To mark a user's password as expired, requiring them to create a new password the first time they log in, type:<br />
<br />
# chage -d 0 ''username''<br />
<br />
User accounts may be deleted with the ''userdel'' command.<br />
<br />
# userdel -r ''username''<br />
<br />
The {{ic|-r}} option specifies that the user's home directory and mail spool should also be deleted.<br />
<br />
{{Tip|The {{AUR|adduser}} script allows carrying out the jobs of ''useradd'', ''chfn'' and ''passwd'' interactively. See also {{Bug|32893}}.}}<br />
<br />
=== Username change tips ===<br />
<br />
{{Warning|Make certain that you are not logged in as the user whose name you are about to change. Open a new tty ({{ic|Ctrl+Alt+F1}}) and log in as root or as another user and su to root. usermod should prevent you from doing this by mistake.}}<br />
<br />
Changing a username is safe and easy when done properly, just use the [[#Other examples of user management|usermod]] command. If the user is associated to a group with the same name, you can rename this with the [[#Group management|groupmod]] command.<br />
<br />
Alternatively, the {{ic|/etc/passwd}} file can be edited directly, see [[#User database]] for an introduction to its format.<br />
<br />
Also keep in mind the following notes:<br />
<br />
* If you are using [[sudo]] make sure you update your {{ic|/etc/sudoers}} to reflect the new username(s) (via the visudo command as root).<br />
* Personal [[cron#Crontab_format|crontabs]] need to be adjusted by renaming the user's file in {{ic|/var/spool/cron}} from the old to the new name, and then opening {{ic|crontab -e}} to change any relevant paths and have it adjust the file permissions accordingly.<br />
* [[Wine|Wine's]] personal folders/files' contents in {{ic|~/.wine/drive_c/users}}, {{ic|~/.local/share/applications/wine/Programs}} and possibly more need to be manually renamed/edited.<br />
* Certain Thunderbird addons, like [http://enigmail.mozdev.org/home/index.php Enigmail], may need to be reinstalled.<br />
* Anything on your system (desktop shortcuts, shell scripts, etc.) that uses an absolute path to your home dir (i.e. {{ic|/home/oldname}}) will need to be changed to reflect your new name. To avoid these problems in shell scripts, simply use the {{ic|~}} or {{ic|$HOME}} variables for home directories.<br />
* Also do not forget to edit accordingly the configuration files in {{ic|/etc}} that relies on your absolute path (i.e. Samba, CUPS, so on). A nice way to learn what files you need to update involves using the grep command this way: {{ic|grep -r {old_user} *}}<br />
<br />
== User database ==<br />
<br />
Local user information is stored in the plain-text {{ic|/etc/passwd}} file: each of its lines represents a user account, and has seven fields delimited by colons.<br />
<br />
''account:password:UID:GID:GECOS:directory:shell''<br />
<br />
Where:<br />
<br />
* {{ic|''account''}} is the user name. This field can not be blank. Standard *NIX naming rules apply.<br />
* {{ic|''password''}} is the user password. {{Warning|1=The {{ic|passwd}} file is world-readable, so storing passwords (hashed or otherwise) in this file is insecure. Instead, Arch Linux uses [[Security#Password hashes|shadowed passwords]]: the {{ic|password}} field will contain a placeholder character ({{ic|x}}) indicating that the hashed password is saved in the access-restricted file {{ic|/etc/shadow}}. For this reason it is recommended to always change passwords using the '''passwd''' command.}}<br />
* {{ic|''UID''}} is the numerical user ID. In Arch, the first login name (after root) is UID 1000 by default; subsequent UID entries for users should be greater than 1000.<br />
* {{ic|''GID''}} is the numerical primary group ID for the user. Numeric values for GIDs are listed in [[#Group management|/etc/group]].<br />
* {{ic|''GECOS''}} is an optional field used for informational purposes; usually it contains the full user name, but it can also be used by services such as ''finger'' and managed with the [[#Other examples of user management|chfn]] command. This field is optional and may be left blank.<br />
* {{ic|''directory''}} is used by the login command to set the {{ic|$HOME}} environment variable. Several services with their own users use {{ic|/}}, but normal users usually set a folder under {{ic|/home}}.<br />
* {{ic|''shell''}} is the path to the user's default [[command shell]]. This field is optional and defaults to {{ic|/bin/bash}}.<br />
<br />
Example:<br />
<br />
jack:x:1001:100:Jack Smith,some comment here,,:/home/jack:/bin/bash<br />
<br />
Broken down, this means: user {{ic|jack}}, whose password is in {{ic|/etc/shadow}}, whose UID is 1001 and whose primary group is 100. Jack Smith is his full name and there is a comment associated to his account; his home directory is {{ic|/home/jack}} and he is using [[Bash]].<br />
<br />
The ''pwck'' command can be used to verify the integrity of the user database. It can sort the user list by GID at the same time, which can be helpful for comparison:<br />
# pwck -s<br />
<br />
Note that the Arch Linux defaults of the files are created as ''.pacnew'' files by new releases of the {{Pkg|filesystem}} package. Unless Pacman outputs related messages for action, these ''.pacnew'' files can, and should, be disregarded/removed. New required default users and groups are added automatically by the packages' install script.<br />
<br />
== Group management ==<br />
<br />
{{ic|/etc/group}} is the file that defines the groups on the system (see {{man|5|group}} for details).<br />
<br />
Display group membership with the {{ic|groups}} command:<br />
<br />
$ groups ''user''<br />
<br />
If {{ic|''user''}} is omitted, the current user's group names are displayed.<br />
<br />
The {{ic|id}} command provides additional detail, such as the user's UID and associated GIDs:<br />
<br />
$ id ''user''<br />
<br />
To list all groups on the system:<br />
<br />
$ cat /etc/group<br />
<br />
Create new groups with the {{ic|groupadd}} command:<br />
<br />
# groupadd ''group''<br />
<br />
Add users to a group with the {{ic|gpasswd}} command:<br />
<br />
# gpasswd -a ''user'' ''group''<br />
<br />
Modify an existing group with {{ic|groupmod}}; e.g. to rename {{ic|old_group}} group to {{ic|new_group}} whilst preserving gid (all files previously owned by {{ic|old_group}} will be owned by {{ic|new_group}}):<br />
<br />
# groupmod -n ''new_group'' ''old_group''<br />
<br />
{{Note|This will change a group name but not the numerical GID of the group.}}<br />
<br />
To delete existing groups:<br />
<br />
# groupdel ''group''<br />
<br />
To remove users from a group:<br />
<br />
# gpasswd -d ''user'' ''group''<br />
<br />
If the user is currently logged in, he must log out and in again for the change to take effect.<br />
<br />
The ''grpck'' command can be used to verify the integrity of the system's group files. <br />
<br />
Updates to the {{Pkg|filesystem}} package create ''.pacnew'' files. Alike the ''.pacnew'' files for the [[#User database]], these can be disregarded/removed, because the install script adds any new required groups.<br />
<br />
== Group list ==<br />
<br />
This section explains the purpose of the essential groups from the [https://git.archlinux.org/svntogit/packages.git/tree/trunk/group?h=packages/filesystem core/filesystem] package. There are many other groups, which will be created with [[DeveloperWiki:UID / GID Database|correct GID]] when the relevant package is installed. See the main page for the software for details.<br />
<br />
{{Note|A later removal of a package does not remove the automatically created user/group (UID/GID) again. This is intentional because any files created during its usage would otherwise be left orphaned as a potential security risk.}}<br />
<br />
=== User groups ===<br />
<br />
Non-root workstation/desktop users often need to be added to some of following groups to allow access to hardware peripherals and facilitate system administration:<br />
<br />
{| class="wikitable"<br />
! Group || Affected files || Purpose<br />
|-<br />
| adm || || Administration group, similar to {{ic|wheel}}.<br />
|-<br />
| ftp || {{ic|/srv/ftp/}} || Access to files served by [[Wikipedia:FTP|FTP]] servers.<br />
|-<br />
| games || {{ic|/var/games}} || Access to some game software.<br />
|-<br />
| http || {{ic|/srv/http/}} || Access to files served by [[Wikipedia:HTTP|HTTP]] servers.<br />
|-<br />
| log || || Access to log files in {{ic|/var/log/}} created by [[syslog-ng]]. ||<br />
|-<br />
| rfkill || {{ic|/dev/rfkill}} || Right to control wireless devices power state (used by {{Pkg|rfkill}}).<br />
|-<br />
| sys || || Right to administer printers in [[CUPS]].<br />
|-<br />
| systemd-journal || {{ic|/var/log/journal/*}} || Can be used to provide read-only access to the systemd logs, as an alternative to {{ic|adm}} and {{ic|wheel}} [https://cgit.freedesktop.org/systemd/systemd/tree/README?id=fdbbf0eeda929451e2aaf34937a72f03a225e315#n190]. Otherwise, only user generated messages are displayed.<br />
|-<br />
| users || || Standard users group.<br />
|-<br />
| uucp || {{ic|/dev/ttyS[0-9]+}}, {{ic|/dev/tts/[0-9]+}}, {{ic|/dev/ttyUSB[0-9]+}}, {{ic|/dev/ttyACM[0-9]+}}, {{ic|/dev/rfcomm[0-9]+}} || RS-232 serial ports and devices connected to them.<br />
|-<br />
| wheel || || Administration group, commonly used to give access to the [[sudo]] and [[su]] utilities (neither uses it by default, configurable in {{ic|/etc/pam.d/su}} and {{ic|/etc/pam.d/su-l}}). It can also be used to gain full read access to [[systemd#Journal|journal]] files.<br />
|}<br />
<br />
=== System groups ===<br />
<br />
The following groups are used for system purposes, an assignment to users is only required for dedicated purposos:<br />
<br />
{| class="wikitable"<br />
! Group || Affected files || Purpose<br />
|-<br />
| dbus || || used internally by {{Pkg|dbus}}<br />
|-<br />
| kmem || {{ic|/dev/port}}, {{ic|/dev/mem}}, {{ic|/dev/kmem}} ||<br />
|-<br />
| locate || {{ic|/usr/bin/locate}}, {{ic|/var/lib/locate}}, {{ic|/var/lib/mlocate}}, {{ic|/var/lib/slocate}} || See [[Core utilities#locate]].<br />
|-<br />
| lp || {{ic|/dev/lp[0-9]*}}, {{ic|/dev/parport[0-9]*}}, {{ic|/etc/cups}}, {{ic|/var/log/cups}}, {{ic|/var/cache/cups}}, {{ic|/var/spool/cups}} || Access to parallel port devices (printers and others) and read-only access to [[CUPS]] files. If you run a non-printer parallel port device, see {{Bug|50009}} for implied problems.<br />
|-<br />
| mail || {{ic|/usr/bin/mail}} ||<br />
|-<br />
| nobody || || Unprivileged group.<br />
|-<br />
| proc || {{ic|/proc/''pid''/}} || A group authorized to learn processes information otherwise prohibited by {{ic|1=hidepid=}} mount option of the [https://www.kernel.org/doc/Documentation/filesystems/proc.txt proc filesystem]. The group must be explicitly set with the {{ic|1=gid=}} mount option.<br />
|-<br />
| root || {{ic|/*}} || Complete system administration and control (root, admin).<br />
|-<br />
| smmsp || || [[sendmail]] group.<br />
|-<br />
| tty || {{ic|/dev/tty}}, {{ic|/dev/vcc}}, {{ic|/dev/vc}}, {{ic|/dev/ptmx}} ||<br />
|-<br />
| utmp || {{ic|/run/utmp}}, {{ic|/var/log/btmp}}, {{ic|/var/log/wtmp}} ||<br />
|-<br />
|}<br />
<br />
=== Pre-systemd groups ===<br />
<br />
Before arch migrated to [[systemd]], users had to be manually added to these groups in order to be able to access the corresponding devices. This way has been deprecated in favour of [[udev]] marking the devices with a {{ic|uaccess}} [https://github.com/systemd/systemd/blob/master/src/login/70-uaccess.rules tag] and ''logind'' assigning the permissions to users dynamically via [[ACL]]s according to which session is currently active. Note that the session must not be broken for this to work (see [[General troubleshooting#Session permissions]] to check it).<br />
<br />
There are some notable exceptions which require adding a user to some of these groups: for example if you want to allow users to access the device even when they are not logged in. However, note that adding users to the groups can even cause some functionality to break (for example, the {{ic|audio}} group will break fast user switching and allows applications to block software mixing).<br />
<br />
{| class="wikitable"<br />
! Group || Affected files || Purpose<br />
|-<br />
| audio || {{ic|/dev/audio}}, {{ic|/dev/snd/*}}, {{ic|/dev/rtc0}} || Direct access to sound hardware, for all sessions. It is still required to make [[ALSA]] and [[OSS]] work in remote sessions, see [[ALSA#User privileges]].<br />
|-<br />
| disk || {{ic|/dev/sd[a-z][1-9]}} || Access to block devices not affected by other groups such as {{ic|optical}}, {{ic|floppy}}, and {{ic|storage}}.<br />
|-<br />
| floppy || {{ic|/dev/fd[0-9]}} || Access to floppy drives.<br />
|-<br />
| input || {{ic|/dev/input/event[0-9]*}}, {{ic|/dev/input/mouse[0-9]*}} || Access to input devices. Introduced in systemd 215 [http://lists.freedesktop.org/archives/systemd-commits/2014-June/006343.html].<br />
|-<br />
| kvm || {{ic|/dev/kvm}} || Access to virtual machines using [[KVM]].<br />
|-<br />
| optical || {{ic|/dev/sr[0-9]}}, {{ic|/dev/sg[0-9]}} || Access to optical devices such as CD and DVD drives.<br />
|-<br />
| scanner || {{ic|/var/lock/sane}} || Access to scanner hardware.<br />
|-<br />
| storage || || Access to removable drives such as USB hard drives, flash/jump drives, MP3 players; enables the user to mount storage devices.<br />
|-<br />
| video || {{ic|/dev/fb/0}}, {{ic|/dev/misc/agpgart}} || Access to video capture devices, 2D/3D hardware acceleration, framebuffer ([[X]] can be used ''without'' belonging to this group).<br />
|}<br />
<br />
=== Unused groups ===<br />
<br />
The following groups are currently not used for any purpose: <br />
<br />
{| class="wikitable"<br />
! Group || Affected files || Purpose<br />
|-<br />
| bin || none || Historical<br />
|-<br />
| daemon || ||<br />
|-<br />
| lock || ||<br />
|-<br />
| mem || ||<br />
|-<br />
| network || || Unused by default. Can be used e.g. for granting access to NetworkManager (see [[NetworkManager#Set up PolicyKit permissions]]). <br />
|-<br />
| power || ||<br />
|-<br />
| uuidd || ||<br />
|}</div>Cirrushttps://wiki.archlinux.org/index.php?title=Dwb&diff=446875Dwb2016-08-17T12:44:41Z<p>Cirrus: /* MPVideo */ rewrote script adds simplicity and notigy feature</p>
<hr />
<div>{{DISPLAYTITLE:dwb}}<br />
[[Category:Web browser]]<br />
[[de:dwb]]<br />
[[fr:dwb]]<br />
[[ja:dwb]]<br />
[http://portix.bitbucket.org/dwb/ dwb] is a lightweight and flexible web browser using the webkit engine. It is customizable through its web interface and fully usable with keyboard shortcuts.<br />
<br />
== Installation ==<br />
<br />
The {{Pkg|dwb}} package can be found in the [[official repositories]] and can be installed with [[pacman]]. There are also other versions in the [[AUR]]: {{AUR|dwb-git}}, {{AUR|dwb-gtk3}}{{Broken package link|{{aur-mirror|dwb-gtk3}}}}, and {{AUR|dwb-gtk3-git}}{{Broken package link|{{aur-mirror|dwb-gtk3-git}}}}.<br />
<br />
== Basic usage ==<br />
<br />
Starting from a fresh configuration, use {{ic|Sk}} to open the ''Keys'' page. As you can see from there, most bindings are borrowed from [[Vim]] and [[Emacs]].<br />
<br />
Use {{ic|:}} to access the command prompt. You can use {{ic|Tab}} to auto-complete.<br />
<br />
Read the man page for more details and enable the {{ic|auto-completion}} option in the settings to help you learn the bindings.<br />
<br />
$ man dwb<br />
<br />
=== dwb-specific ===<br />
<br />
o = enter url<br />
O = enter url in new tab<br />
f = spawn hints. Use arrow keys to browse the hints while displaying their URI, or use the hint letters.<br />
F = spawn hints in new tab<br />
;b = spawn hints in new background tab<br />
;r = follow multiple background links rapidly<br />
H = back<br />
L = forward<br />
J = go to next tab<br />
K = go to previous tab<br />
'n'+T = goto 'n' tab<br />
d = close tab<br />
u = undo close tab<br />
ctrl+s = stop<br />
r = reload<br />
R = reload ignoring cache<br />
gi = go to the first input field, doesn't enter input mode, use 'i' for that, so 'gi'+'i'<br />
ctrl+e = open editable field in external editor. Useful for forums and wikis.<br />
;d = download via hints<br />
M = save bookmark (bookmarks are saved in ~/.config/dwb/default/bookmarks)<br />
xb = show/hide status bar<br />
gf = toggle source view<br />
+ = zoom_in<br />
- = zoom_out<br />
= = reset to 100%<br />
<br />
=== vim-like ===<br />
<br />
i = toggle_insert_mode (Esc works to go back to normal mode much like Vim)<br />
Esc = back to normal mode (ctrl+n works too)<br />
j = scroll down<br />
k = scroll up<br />
h = scroll left<br />
l = scroll right<br />
gg = go to top<br />
G = go to bottom<br />
/ = find in page<br />
n = repeat find forward<br />
ZZ = save session and exit<br />
<br />
=== Notes ===<br />
<br />
Press {{ic|v}} to switch to caret browsing, then press {{ic|space}} to toggle between caret and visual mode. Press {{ic|Esc}} one or two times to go back to normal mode. While in caret browsing, you can use the arrow keys to browse the different parts of the page. Hold {{ic|Shift}} to select text. Press {{ic|Enter}} to follow links.<br />
<br />
== Configuration ==<br />
<br />
The configuration files are stored in {{ic|$XDG_CONFIG_HOME/dwb/}} (usually {{ic| ~/.config/dwb/}}) and can be easily accessed through the web interface. Type {{ic|Ss}} to open the ''Settings'' page.<br />
<br />
=== Search engines ===<br />
<br />
Open your favorite search engine, type {{ic|gs}} to select the web page's first input field, and then enter a keyword associated with it. <br />
<br />
Now you can use the keyword in the URI prompt to search directly on the corresponding website. Typing queries directly in the address bar will search with the default search engine, which is the first entry in {{ic|$XDG_CONFIG_HOME/dwb/searchengines}}.<br />
<br />
You can also add more by editing the configuration files. This may help for tricky sites like rfc-editor.org.<br />
<br />
{{hc|.config/dwb/settings|2=<br />
searchengine-submit-pattern=XXX<br />
}}<br />
<br />
{{hc|.config/dwb/searchengines|<nowiki><br />
sp https://startpage.com/do/search?q=XXX<br />
wp https://en.wikipedia.org/w/index.php?search=XXX&title=Special:Search<br />
aw https://wiki.archlinux.org/index.php?title=Special:Search&search=XXX<br />
rfc http://www.rfc-editor.org/search/rfc_search_detail.php?rfc=&title=XXX<br />
</nowiki>}}<br />
<br />
=== keys ===<br />
Standard keybinds can be edited by executing {{ic|:open dwb:keys}} (opening dwb:keys as a webpage). Settings are saved as soon as a value is changed and the element loses focus or the return key is pressed. This is reported in the status bar. Combinations of keys are separated with a space. Some less vim-like keys could be defined by:<br />
<br />
{{hc|dwb:keys|<nowiki><br />
history_back Go back Mod1 @Left@<br />
history_forward Go forward Mod1 @Right@<br />
</nowiki>}}<br />
<br />
This same format is used below for custom keybinds.<br />
<br />
=== Custom keybinds ===<br />
<br />
You can create custom key bindings by editing file {{ic|custom_keys}} in the profile directory. This is<br />
{{ic|~/.config/dwb/default}} by default. All keysyms which do not emit (multi)byte characters, must be enclosed in {{ic|@}}. One keybind can execute multiple ''dwb'' commands. These commands execute in same order as they are defined in bind, and must be separated by {{ic|;;}} separator. If the keybind's chord is already bound by ''dwb'', it might be ignored (behaviour is not consistent). In such case one can try to check, whether there is collison with binds defined in {{ic|~/.config/dwb/keys}} and try to unbind the chord there (eg set it to nothing). Any running ''dwb'' instance will owerwrite {{ic|keys}} file on exit, so remember to do your modifications while ''dwb'' is not runing or use default ''dwb'' interface ({{ic|Sk}}).<br />
<br />
{{hc|~/.config/dwb/default/custom_keys|<nowiki><br />
Control w :close_tab<br />
Control @Page_Up@ :focus_prev<br />
Control @Page_Down@ :focus_next<br />
</nowiki>}}<br />
<br />
== Extensions ==<br />
<br />
''dwb'' features an extension manager as a separate executable, ''dwbem''. To list all officially available extensions, use:<br />
<br />
{{hc|dwbem -a|<br />
Available extensions: Mainstream equivalent:<br />
- adblock_subscriptions Adblock<br />
- autoquvi Video DownloadHelper<br />
- contenthandler (Handle requests based on MIME type, filename extension or URI scheme)<br />
- downloadhandler (Handle downloads based on mimetype or filename extension, useful if 'download-no-confirm' is set)<br />
- formfiller LastPass, Lazarus (Save form data and fill forms with previously saved data, also with gpg-support)<br />
- googlebookmarks GBookmarks, GMarks (Add bookmarks to google bookmarks with a shortcut)<br />
- googledocs Open with Google Docs, Google Docs Viewer<br />
- grabscrolling (Adobe Acrobat style grab and drag mouse scrolling)<br />
- multimarks (Bookmark multiple urls to a single quickmark)<br />
- navtools Opera Fast Forward, IE 10 Flip Ahead<br />
- perdomainsettings (Change webkit-settings automatically on domain or url basis)<br />
- pwdhash PwdHash<br />
- requestpolicy RequestPolicy, Disconnect, Ghostery<br />
- simplyread Readability, Clearly<br />
- speeddial Speed Dial<br />
- supergenpass (Generate domain-based passwords; compatible with the bookmarklet supergenpass but with additional options)<br />
- unique_tabs (Remove duplicate tabs or avoid duplicate tabs by autoswitching to tabs with same url)<br />
- userscripts GreaseMonkey/Stylish<br />
- whitelistshortcuts (Whitelist webkit settings for certain domains with a shortcut)<br />
}}<br />
<br />
For more details, use {{ic|dwbem -I <extension>}} and read the [http://portix.bitbucket.org/dwb/resources/dwb.1.html dwb] and [http://portix.bitbucket.org/dwb/resources/dwbem.1.html dwbem] man pages. To get more details on all available extensions use {{ic|<nowiki>for i in $(dwbem -a | awk '/-/ {print $NF}'); do dwbem -I $i; done</nowiki>}}.<br />
<br />
Below is a list of popular extensions (or add-ons) for which ''dwb'' has a built-in alternative:<br />
<br />
* NoScript/Flashblock: ''dwb'' blocks flash by default and can block javascript.<br />
* Omnibar: just like Chrome, ''dwb'''s address gives quick access to search, history, and bookmarks.<br />
* Download Statusbar: ''dwb'''s displays downloads in a neat status bar by default.<br />
* IE Tab: ''dwb'' can open a page in any external browser with a simple userscript.<br />
* Session Manager: ''dwb'' uses its built-in session manager by default.<br />
* Private browsing: add {{ic|xpp:toggle enable-private-browsing}} to {{ic|custom_keys}} to toggle privacy mode by typing {{ic|xpp}}.<br />
<br />
=== Adblock ===<br />
<br />
''dwb'' features an Adblock extension. Install it with<br />
<br />
$ dwbem -i adblock_subscriptions<br />
<br />
Restart ''dwb'', enable adblocker with {{ic|:set adblocker true}}, use the ''adblock_subscribe'' command and choose your favorite filter (avoid using more than one filter to prevent duplicate entries that make the adblocker much slower). After that you also need to make the changes active with the ''adblock_update'' command.<br />
<br />
== Userscripts ==<br />
<br />
''dwb'' can execute .js or .sh scripts put in {{ic|~/.config/dwb/userscripts/}}. Make sure they are executable:<br />
chmod +x ~/.config/dwb/userscripts/myscript.js<br />
<br />
Below are some example scripts, see ''dwb'' [http://portix.bitbucket.org/dwb/snippets/snippets.html userscripts snippets] for more:<br />
<br />
=== defer-loading ===<br />
<br />
Prevents tabs from last session to load all at once at startup.<br />
{{hc|~/.config/dwb/userscripts/defer-loading.js|<nowiki><br />
//!javascript<br />
if (settings.loadOnFocus === false) {<br />
execute('local_set load-on-focus true');<br />
}<br />
Signal.connect('navigation', function(webview) {<br />
if (webview == tabs.current) {<br />
execute('local_set load-on-focus false');<br />
this.disconnect();<br />
}<br />
});</nowiki>}}<br />
<br />
=== fast-forward ===<br />
<br />
Opera features a neat key binding which allows users to load to next/previous logical page. This is very useful for forum threads, documentation, and articles spread over several pages.<br />
<br />
This feature can be implemented with a simple javascript function and bound to custom keys {{ic|<nowiki>}</nowiki>}} and {{ic|{}}:<br />
<br />
{{hc|~/.config/dwb/default/custom_keys|<nowiki><br />
}:exja (function(){var e=document.querySelector("[rel='next']");if(e){location=e.href;}else{var f=document.getElementsByTagName("a");var i=f.length;while((e=f[--i])){if(e.text.search(/(\bnext\b|^>$|^(>>|»)$|^(>|»)|(>|»)$|\bmore\b)/i)>-1){location=e.href; break;}} location.href=location.href.replace(/(\d+)([^\/\d]*)$/, function(a,b,c){return ++b+c})}})();<br />
{:exja (function(){var e=document.querySelector("[rel='prev']");if(e){location=e.href;}else{var f=document.getElementsByTagName("a");var i=f.length;while((e=f[--i])){if(e.text.search(/(\b(prev|previous)\b|^<$|^(<<|«)$|^(<|«)|(<|«)$)/i)>-1){location=e.href;break;}} location.href=location.href.replace(/(\d+)([^\/\d]*)$/, function(a,b,c){return --b+c})}})();<br />
</nowiki>}}<br />
<br />
Alternatively, the {{ic|navtools}} extension provides the same functionality and more, such as going up one directory, or loading the root URI.<br />
<br />
=== open-firefox ===<br />
Opens current page in Firefox with {{ic|xf}} (uses {{Pkg|firefox}} and {{Pkg|libnotify}}).<br />
{{hc|~/.config/dwb/userscripts/open-firefox.sh|<nowiki><br />
#!/bin/bash<br />
# dwb: xf<br />
firefox $DWB_URI &<br />
notify-send -u low "Firefox opening $DWB_URI" #optional notification<br />
</nowiki>}}<br />
<br />
=== startup-noautoreload ===<br />
<br />
Prevents previously-opened tabs from reloading all at once after a restart.<br />
{{hc|~/.config/dwb/userscripts/startup-noautoreload.js|<nowiki><br />
//!javascript<br />
// prevents previously-opened tabs from reloading all at once after a restart.<br />
execute("set load-on-focus true");<br />
<br />
var sigId = Signal.connect("navigation", function(wv) {<br />
if (wv == tabs.current)<br />
{<br />
execute("set load-on-focus false");<br />
Signal.disconnect(sigId);<br />
}<br />
});</nowiki>}}<br />
<br />
=== toggle-stylesheet ===<br />
<br />
Toggles between 2 global stylesheets with {{ic|xg}}.<br />
{{hc|~/.config/dwb/userscripts/toggle-stylesheet.sh|<nowiki><br />
#!/bin/bash<br />
# dwb:xg<br />
<br />
CURRENT_STYLESHEET="$(dwbremote get setting user-stylesheet-uri)"<br />
<br />
STYLESHEET_1="file://$HOME/.config/dwb/stylesheets/foo.css"<br />
STYLESHEET_2="file://$HOME/.config/dwb/stylesheets/bar.css"<br />
<br />
if [[ "${CURRENT_STYLESHEET}" = ${STYLESHEET_1} ]]; then<br />
dwbremote :local_set user-stylesheet-uri "$STYLESHEET_2"<br />
else <br />
dwbremote :local_set user-stylesheet-uri "$STYLESHEET_1"<br />
fi</nowiki>}}<br />
<br />
=== youtube-player ===<br />
<br />
Opens YouTube videos with MPlayer (uses {{Pkg|mplayer}} and {{Pkg|youtube-dl}}).<br />
{{hc|~/.config/dwb/userscripts/youtube-mplayer.js|<nowiki><br />
//!javascript <br />
// opens YouTube videos with mplayer.<br />
var regex = new RegExp("http(.*)://www.youtube.com/watch\\?(.*&)*v=.*");<br />
<br />
Signal.connect("navigation", function (wv, frame, request) {<br />
if (wv.mainFrame == frame && regex.test(request.uri)) <br />
system.spawn("sh -c 'mplayer \"$(youtube-dl -g " + request.uri + ")\"'");<br />
return false;<br />
});</nowiki>}}<br />
<br />
=== mpv.sh ===<br />
<br />
The [[vv]] keybind will open the URL of current page with mpv, works with You Tube, Dailymotion, Vodlocker and many more video streaming services. (uses {{Pkg|mpv}} {{Pkg|libnotify}} {{Pkg|youtube-dl}}).<br />
{{hc|~/.config/dwb/userscripts/mpv.sh|<nowiki><br />
#!/bin/bash<br />
# dwb: vv<br />
mpv $DWB_URI &<br />
notify-send -h string:bgcolor:#000000 -h string:fgcolor:#ff4444 "MPV is opening" "$DWB_URI" <br />
<br />
fi</nowiki>}}<br />
<br />
=== rocker gestures ===<br />
<br />
Enables Opera-like rocker gestures for navigating the history. Disable the context menu in the settings first.<br />
{{hc|~/.config/dwb/userscripts/rocker.js|<nowiki><br />
//!javascript<br />
var LMB = 1, MMB=2, RMB = 3, UNKNOWN = 10, DOWN = 11, UP = 12;<br />
<br />
var buttonStates = [UNKNOWN, UNKNOWN, UNKNOWN, UNKNOWN, UNKNOWN, UNKNOWN];<br />
var bp = new Signal("onButtonPress", function(wv, result, ev) {<br />
var mouseButton = ev.button;<br />
<br />
buttonStates[mouseButton] = DOWN;<br />
<br />
if (mouseButton == LMB && buttonStates[RMB] == DOWN) {<br />
execute("history_back");<br />
} else if (mouseButton == RMB && buttonStates[LMB] == DOWN) {<br />
execute("history_forward");<br />
}<br />
});<br />
var br = new Signal("onButtonRelease", function(wv, result, ev) {<br />
buttonStates[ev.button] = UP;<br />
});<br />
<br />
bp.connect();<br />
br.connect();</nowiki>}}<br />
<br />
== Stylesheet ==<br />
<br />
a global stylesheet can be defined in the Settings, under {{ic|user-stylesheet-uri}} (i.e. {{ic|file:///home/tux/.config/dwb/stylesheet.css}})<br />
<br />
If you browse with the status bar hidden and are annoyed by the the link previews that appear while hovering over links with the mouse, add this to the stylesheet: {{ic|#dwb_hover_element { display:none!important; }}}<br />
<br />
== Troubleshooting ==<br />
<br />
=== Search engines search for ''undefined'' ===<br />
<br />
If you are always searching for ''undefined'' even with the {{ic|searchengine-submit-pattern}} option set, then you should edit {{ic|$XDG_CONFIG_HOME/dwb/searchengines}} and adapt the URIs to match your {{ic|searchengine-submit-pattern}}.<br />
<br />
=== Fuzzy font in Github ===<br />
<br />
Install {{Pkg|ttf-freefont}} or add this in your {{ic|~/.config/fontconfig/fonts.conf}} inside the fontconfig-tags:<br />
<br />
<selectfont><br />
<rejectfont><br />
<pattern><br />
<patelt name="family"><br />
<string>Clean</string><br />
</patelt><br />
</pattern><br />
</rejectfont><br />
</selectfont><br />
<br />
If above solution doesn't help try to remove {{ic|xorg-fonts-75dpi}} and {{ic|xorg-fonts-100dpi}} packages.<br />
<br />
=== HTML5 media ===<br />
<br />
See [[Browser plugins#Multimedia playback]].<br />
<br />
== dwb-git ==<br />
<br />
{{AUR|dwb-git}} offers many improvements over the stable version, the most notable of which are listed below.<br />
<br />
{{Note|As of May 4th, 2015, the official {{Pkg|dwb}} package should contain all those features, and more.}}<br />
<br />
=== Plugin Support ===<br />
<br />
Browser Plugins can be enabled and disabled through the new [dwb:plugins dwb:plugins] settings page. Other [[Browser plugins]] may be supported as well, but these two alone will make your dwb experience much more enjoyable.<br />
<br />
==== Flash Support ====<br />
<br />
{{AUR|dwb-git}} has built in support for the {{Pkg|flashplugin}}. Dwb should auto-detect and enabled the plugin after it is installed. Alternatively, you can install {{Aur|gnash-gtk}}{{Broken package link|package not found}} and it will be detected as well.<br />
<br />
==== Java Support ====<br />
<br />
{{AUR|dwb-git}} has built in support for the {{Pkg|icedtea-web}}. Dwb should auto-detect and enable the plugin after it is installed.<br />
<br />
=== Improved Ability to Display Websites ===<br />
<br />
If you are having problems with they layout of websites not loading correctly then give {{AUR|dwb-git}} a shot.</div>Cirrushttps://wiki.archlinux.org/index.php?title=Dwb&diff=446859Dwb2016-08-17T11:32:38Z<p>Cirrus: /* MPVideo */ description edit</p>
<hr />
<div>{{DISPLAYTITLE:dwb}}<br />
[[Category:Web browser]]<br />
[[de:dwb]]<br />
[[fr:dwb]]<br />
[[ja:dwb]]<br />
[http://portix.bitbucket.org/dwb/ dwb] is a lightweight and flexible web browser using the webkit engine. It is customizable through its web interface and fully usable with keyboard shortcuts.<br />
<br />
== Installation ==<br />
<br />
The {{Pkg|dwb}} package can be found in the [[official repositories]] and can be installed with [[pacman]]. There are also other versions in the [[AUR]]: {{AUR|dwb-git}}, {{AUR|dwb-gtk3}}{{Broken package link|{{aur-mirror|dwb-gtk3}}}}, and {{AUR|dwb-gtk3-git}}{{Broken package link|{{aur-mirror|dwb-gtk3-git}}}}.<br />
<br />
== Basic usage ==<br />
<br />
Starting from a fresh configuration, use {{ic|Sk}} to open the ''Keys'' page. As you can see from there, most bindings are borrowed from [[Vim]] and [[Emacs]].<br />
<br />
Use {{ic|:}} to access the command prompt. You can use {{ic|Tab}} to auto-complete.<br />
<br />
Read the man page for more details and enable the {{ic|auto-completion}} option in the settings to help you learn the bindings.<br />
<br />
$ man dwb<br />
<br />
=== dwb-specific ===<br />
<br />
o = enter url<br />
O = enter url in new tab<br />
f = spawn hints. Use arrow keys to browse the hints while displaying their URI, or use the hint letters.<br />
F = spawn hints in new tab<br />
;b = spawn hints in new background tab<br />
;r = follow multiple background links rapidly<br />
H = back<br />
L = forward<br />
J = go to next tab<br />
K = go to previous tab<br />
'n'+T = goto 'n' tab<br />
d = close tab<br />
u = undo close tab<br />
ctrl+s = stop<br />
r = reload<br />
R = reload ignoring cache<br />
gi = go to the first input field, doesn't enter input mode, use 'i' for that, so 'gi'+'i'<br />
ctrl+e = open editable field in external editor. Useful for forums and wikis.<br />
;d = download via hints<br />
M = save bookmark (bookmarks are saved in ~/.config/dwb/default/bookmarks)<br />
xb = show/hide status bar<br />
gf = toggle source view<br />
+ = zoom_in<br />
- = zoom_out<br />
= = reset to 100%<br />
<br />
=== vim-like ===<br />
<br />
i = toggle_insert_mode (Esc works to go back to normal mode much like Vim)<br />
Esc = back to normal mode (ctrl+n works too)<br />
j = scroll down<br />
k = scroll up<br />
h = scroll left<br />
l = scroll right<br />
gg = go to top<br />
G = go to bottom<br />
/ = find in page<br />
n = repeat find forward<br />
ZZ = save session and exit<br />
<br />
=== Notes ===<br />
<br />
Press {{ic|v}} to switch to caret browsing, then press {{ic|space}} to toggle between caret and visual mode. Press {{ic|Esc}} one or two times to go back to normal mode. While in caret browsing, you can use the arrow keys to browse the different parts of the page. Hold {{ic|Shift}} to select text. Press {{ic|Enter}} to follow links.<br />
<br />
== Configuration ==<br />
<br />
The configuration files are stored in {{ic|$XDG_CONFIG_HOME/dwb/}} (usually {{ic| ~/.config/dwb/}}) and can be easily accessed through the web interface. Type {{ic|Ss}} to open the ''Settings'' page.<br />
<br />
=== Search engines ===<br />
<br />
Open your favorite search engine, type {{ic|gs}} to select the web page's first input field, and then enter a keyword associated with it. <br />
<br />
Now you can use the keyword in the URI prompt to search directly on the corresponding website. Typing queries directly in the address bar will search with the default search engine, which is the first entry in {{ic|$XDG_CONFIG_HOME/dwb/searchengines}}.<br />
<br />
You can also add more by editing the configuration files. This may help for tricky sites like rfc-editor.org.<br />
<br />
{{hc|.config/dwb/settings|2=<br />
searchengine-submit-pattern=XXX<br />
}}<br />
<br />
{{hc|.config/dwb/searchengines|<nowiki><br />
sp https://startpage.com/do/search?q=XXX<br />
wp https://en.wikipedia.org/w/index.php?search=XXX&title=Special:Search<br />
aw https://wiki.archlinux.org/index.php?title=Special:Search&search=XXX<br />
rfc http://www.rfc-editor.org/search/rfc_search_detail.php?rfc=&title=XXX<br />
</nowiki>}}<br />
<br />
=== keys ===<br />
Standard keybinds can be edited by executing {{ic|:open dwb:keys}} (opening dwb:keys as a webpage). Settings are saved as soon as a value is changed and the element loses focus or the return key is pressed. This is reported in the status bar. Combinations of keys are separated with a space. Some less vim-like keys could be defined by:<br />
<br />
{{hc|dwb:keys|<nowiki><br />
history_back Go back Mod1 @Left@<br />
history_forward Go forward Mod1 @Right@<br />
</nowiki>}}<br />
<br />
This same format is used below for custom keybinds.<br />
<br />
=== Custom keybinds ===<br />
<br />
You can create custom key bindings by editing file {{ic|custom_keys}} in the profile directory. This is<br />
{{ic|~/.config/dwb/default}} by default. All keysyms which do not emit (multi)byte characters, must be enclosed in {{ic|@}}. One keybind can execute multiple ''dwb'' commands. These commands execute in same order as they are defined in bind, and must be separated by {{ic|;;}} separator. If the keybind's chord is already bound by ''dwb'', it might be ignored (behaviour is not consistent). In such case one can try to check, whether there is collison with binds defined in {{ic|~/.config/dwb/keys}} and try to unbind the chord there (eg set it to nothing). Any running ''dwb'' instance will owerwrite {{ic|keys}} file on exit, so remember to do your modifications while ''dwb'' is not runing or use default ''dwb'' interface ({{ic|Sk}}).<br />
<br />
{{hc|~/.config/dwb/default/custom_keys|<nowiki><br />
Control w :close_tab<br />
Control @Page_Up@ :focus_prev<br />
Control @Page_Down@ :focus_next<br />
</nowiki>}}<br />
<br />
== Extensions ==<br />
<br />
''dwb'' features an extension manager as a separate executable, ''dwbem''. To list all officially available extensions, use:<br />
<br />
{{hc|dwbem -a|<br />
Available extensions: Mainstream equivalent:<br />
- adblock_subscriptions Adblock<br />
- autoquvi Video DownloadHelper<br />
- contenthandler (Handle requests based on MIME type, filename extension or URI scheme)<br />
- downloadhandler (Handle downloads based on mimetype or filename extension, useful if 'download-no-confirm' is set)<br />
- formfiller LastPass, Lazarus (Save form data and fill forms with previously saved data, also with gpg-support)<br />
- googlebookmarks GBookmarks, GMarks (Add bookmarks to google bookmarks with a shortcut)<br />
- googledocs Open with Google Docs, Google Docs Viewer<br />
- grabscrolling (Adobe Acrobat style grab and drag mouse scrolling)<br />
- multimarks (Bookmark multiple urls to a single quickmark)<br />
- navtools Opera Fast Forward, IE 10 Flip Ahead<br />
- perdomainsettings (Change webkit-settings automatically on domain or url basis)<br />
- pwdhash PwdHash<br />
- requestpolicy RequestPolicy, Disconnect, Ghostery<br />
- simplyread Readability, Clearly<br />
- speeddial Speed Dial<br />
- supergenpass (Generate domain-based passwords; compatible with the bookmarklet supergenpass but with additional options)<br />
- unique_tabs (Remove duplicate tabs or avoid duplicate tabs by autoswitching to tabs with same url)<br />
- userscripts GreaseMonkey/Stylish<br />
- whitelistshortcuts (Whitelist webkit settings for certain domains with a shortcut)<br />
}}<br />
<br />
For more details, use {{ic|dwbem -I <extension>}} and read the [http://portix.bitbucket.org/dwb/resources/dwb.1.html dwb] and [http://portix.bitbucket.org/dwb/resources/dwbem.1.html dwbem] man pages. To get more details on all available extensions use {{ic|<nowiki>for i in $(dwbem -a | awk '/-/ {print $NF}'); do dwbem -I $i; done</nowiki>}}.<br />
<br />
Below is a list of popular extensions (or add-ons) for which ''dwb'' has a built-in alternative:<br />
<br />
* NoScript/Flashblock: ''dwb'' blocks flash by default and can block javascript.<br />
* Omnibar: just like Chrome, ''dwb'''s address gives quick access to search, history, and bookmarks.<br />
* Download Statusbar: ''dwb'''s displays downloads in a neat status bar by default.<br />
* IE Tab: ''dwb'' can open a page in any external browser with a simple userscript.<br />
* Session Manager: ''dwb'' uses its built-in session manager by default.<br />
* Private browsing: add {{ic|xpp:toggle enable-private-browsing}} to {{ic|custom_keys}} to toggle privacy mode by typing {{ic|xpp}}.<br />
<br />
=== Adblock ===<br />
<br />
''dwb'' features an Adblock extension. Install it with<br />
<br />
$ dwbem -i adblock_subscriptions<br />
<br />
Restart ''dwb'', enable adblocker with {{ic|:set adblocker true}}, use the ''adblock_subscribe'' command and choose your favorite filter (avoid using more than one filter to prevent duplicate entries that make the adblocker much slower). After that you also need to make the changes active with the ''adblock_update'' command.<br />
<br />
== Userscripts ==<br />
<br />
''dwb'' can execute .js or .sh scripts put in {{ic|~/.config/dwb/userscripts/}}. Make sure they are executable:<br />
chmod +x ~/.config/dwb/userscripts/myscript.js<br />
<br />
Below are some example scripts, see ''dwb'' [http://portix.bitbucket.org/dwb/snippets/snippets.html userscripts snippets] for more:<br />
<br />
=== defer-loading ===<br />
<br />
Prevents tabs from last session to load all at once at startup.<br />
{{hc|~/.config/dwb/userscripts/defer-loading.js|<nowiki><br />
//!javascript<br />
if (settings.loadOnFocus === false) {<br />
execute('local_set load-on-focus true');<br />
}<br />
Signal.connect('navigation', function(webview) {<br />
if (webview == tabs.current) {<br />
execute('local_set load-on-focus false');<br />
this.disconnect();<br />
}<br />
});</nowiki>}}<br />
<br />
=== fast-forward ===<br />
<br />
Opera features a neat key binding which allows users to load to next/previous logical page. This is very useful for forum threads, documentation, and articles spread over several pages.<br />
<br />
This feature can be implemented with a simple javascript function and bound to custom keys {{ic|<nowiki>}</nowiki>}} and {{ic|{}}:<br />
<br />
{{hc|~/.config/dwb/default/custom_keys|<nowiki><br />
}:exja (function(){var e=document.querySelector("[rel='next']");if(e){location=e.href;}else{var f=document.getElementsByTagName("a");var i=f.length;while((e=f[--i])){if(e.text.search(/(\bnext\b|^>$|^(>>|»)$|^(>|»)|(>|»)$|\bmore\b)/i)>-1){location=e.href; break;}} location.href=location.href.replace(/(\d+)([^\/\d]*)$/, function(a,b,c){return ++b+c})}})();<br />
{:exja (function(){var e=document.querySelector("[rel='prev']");if(e){location=e.href;}else{var f=document.getElementsByTagName("a");var i=f.length;while((e=f[--i])){if(e.text.search(/(\b(prev|previous)\b|^<$|^(<<|«)$|^(<|«)|(<|«)$)/i)>-1){location=e.href;break;}} location.href=location.href.replace(/(\d+)([^\/\d]*)$/, function(a,b,c){return --b+c})}})();<br />
</nowiki>}}<br />
<br />
Alternatively, the {{ic|navtools}} extension provides the same functionality and more, such as going up one directory, or loading the root URI.<br />
<br />
=== open-firefox ===<br />
Opens current page in Firefox with {{ic|xf}} (uses {{Pkg|firefox}} and {{Pkg|libnotify}}).<br />
{{hc|~/.config/dwb/userscripts/open-firefox.sh|<nowiki><br />
#!/bin/bash<br />
# dwb: xf<br />
firefox $DWB_URI &<br />
notify-send -u low "Firefox opening $DWB_URI" #optional notification<br />
</nowiki>}}<br />
<br />
=== startup-noautoreload ===<br />
<br />
Prevents previously-opened tabs from reloading all at once after a restart.<br />
{{hc|~/.config/dwb/userscripts/startup-noautoreload.js|<nowiki><br />
//!javascript<br />
// prevents previously-opened tabs from reloading all at once after a restart.<br />
execute("set load-on-focus true");<br />
<br />
var sigId = Signal.connect("navigation", function(wv) {<br />
if (wv == tabs.current)<br />
{<br />
execute("set load-on-focus false");<br />
Signal.disconnect(sigId);<br />
}<br />
});</nowiki>}}<br />
<br />
=== toggle-stylesheet ===<br />
<br />
Toggles between 2 global stylesheets with {{ic|xg}}.<br />
{{hc|~/.config/dwb/userscripts/toggle-stylesheet.sh|<nowiki><br />
#!/bin/bash<br />
# dwb:xg<br />
<br />
CURRENT_STYLESHEET="$(dwbremote get setting user-stylesheet-uri)"<br />
<br />
STYLESHEET_1="file://$HOME/.config/dwb/stylesheets/foo.css"<br />
STYLESHEET_2="file://$HOME/.config/dwb/stylesheets/bar.css"<br />
<br />
if [[ "${CURRENT_STYLESHEET}" = ${STYLESHEET_1} ]]; then<br />
dwbremote :local_set user-stylesheet-uri "$STYLESHEET_2"<br />
else <br />
dwbremote :local_set user-stylesheet-uri "$STYLESHEET_1"<br />
fi</nowiki>}}<br />
<br />
=== youtube-player ===<br />
<br />
Opens YouTube videos with MPlayer (uses {{Pkg|mplayer}} and {{Pkg|youtube-dl}}).<br />
{{hc|~/.config/dwb/userscripts/youtube-mplayer.js|<nowiki><br />
//!javascript <br />
// opens YouTube videos with mplayer.<br />
var regex = new RegExp("http(.*)://www.youtube.com/watch\\?(.*&)*v=.*");<br />
<br />
Signal.connect("navigation", function (wv, frame, request) {<br />
if (wv.mainFrame == frame && regex.test(request.uri)) <br />
system.spawn("sh -c 'mplayer \"$(youtube-dl -g " + request.uri + ")\"'");<br />
return false;<br />
});</nowiki>}}<br />
<br />
=== MPVideo ===<br />
<br />
In addition to above script, this opens videos from Dailymotion, Vodlocker and more with mpv. (uses {{Pkg|mpv}} and {{Pkg|youtube-dl}}).<br />
{{hc|~/.config/dwb/userscripts/MPVideo.js|<nowiki><br />
//!javascript <br />
// opens videos from Dailymotion, Vodlocker and many more with mpv.<br />
<br />
function playInMplayer() {<br />
system.spawn("sh -c 'mpv \"$(youtube-dl -g " + tabs.current.uri + ")\"'");<br />
}<br />
<br />
bind("mp", playInMplayer, "play_in_mplayer");<br />
</nowiki>}}<br />
<br />
=== rocker gestures ===<br />
<br />
Enables Opera-like rocker gestures for navigating the history. Disable the context menu in the settings first.<br />
{{hc|~/.config/dwb/userscripts/rocker.js|<nowiki><br />
//!javascript<br />
var LMB = 1, MMB=2, RMB = 3, UNKNOWN = 10, DOWN = 11, UP = 12;<br />
<br />
var buttonStates = [UNKNOWN, UNKNOWN, UNKNOWN, UNKNOWN, UNKNOWN, UNKNOWN];<br />
var bp = new Signal("onButtonPress", function(wv, result, ev) {<br />
var mouseButton = ev.button;<br />
<br />
buttonStates[mouseButton] = DOWN;<br />
<br />
if (mouseButton == LMB && buttonStates[RMB] == DOWN) {<br />
execute("history_back");<br />
} else if (mouseButton == RMB && buttonStates[LMB] == DOWN) {<br />
execute("history_forward");<br />
}<br />
});<br />
var br = new Signal("onButtonRelease", function(wv, result, ev) {<br />
buttonStates[ev.button] = UP;<br />
});<br />
<br />
bp.connect();<br />
br.connect();</nowiki>}}<br />
<br />
== Stylesheet ==<br />
<br />
a global stylesheet can be defined in the Settings, under {{ic|user-stylesheet-uri}} (i.e. {{ic|file:///home/tux/.config/dwb/stylesheet.css}})<br />
<br />
If you browse with the status bar hidden and are annoyed by the the link previews that appear while hovering over links with the mouse, add this to the stylesheet: {{ic|#dwb_hover_element { display:none!important; }}}<br />
<br />
== Troubleshooting ==<br />
<br />
=== Search engines search for ''undefined'' ===<br />
<br />
If you are always searching for ''undefined'' even with the {{ic|searchengine-submit-pattern}} option set, then you should edit {{ic|$XDG_CONFIG_HOME/dwb/searchengines}} and adapt the URIs to match your {{ic|searchengine-submit-pattern}}.<br />
<br />
=== Fuzzy font in Github ===<br />
<br />
Install {{Pkg|ttf-freefont}} or add this in your {{ic|~/.config/fontconfig/fonts.conf}} inside the fontconfig-tags:<br />
<br />
<selectfont><br />
<rejectfont><br />
<pattern><br />
<patelt name="family"><br />
<string>Clean</string><br />
</patelt><br />
</pattern><br />
</rejectfont><br />
</selectfont><br />
<br />
If above solution doesn't help try to remove {{ic|xorg-fonts-75dpi}} and {{ic|xorg-fonts-100dpi}} packages.<br />
<br />
=== HTML5 media ===<br />
<br />
See [[Browser plugins#Multimedia playback]].<br />
<br />
== dwb-git ==<br />
<br />
{{AUR|dwb-git}} offers many improvements over the stable version, the most notable of which are listed below.<br />
<br />
{{Note|As of May 4th, 2015, the official {{Pkg|dwb}} package should contain all those features, and more.}}<br />
<br />
=== Plugin Support ===<br />
<br />
Browser Plugins can be enabled and disabled through the new [dwb:plugins dwb:plugins] settings page. Other [[Browser plugins]] may be supported as well, but these two alone will make your dwb experience much more enjoyable.<br />
<br />
==== Flash Support ====<br />
<br />
{{AUR|dwb-git}} has built in support for the {{Pkg|flashplugin}}. Dwb should auto-detect and enabled the plugin after it is installed. Alternatively, you can install {{Aur|gnash-gtk}}{{Broken package link|package not found}} and it will be detected as well.<br />
<br />
==== Java Support ====<br />
<br />
{{AUR|dwb-git}} has built in support for the {{Pkg|icedtea-web}}. Dwb should auto-detect and enable the plugin after it is installed.<br />
<br />
=== Improved Ability to Display Websites ===<br />
<br />
If you are having problems with they layout of websites not loading correctly then give {{AUR|dwb-git}} a shot.</div>Cirrushttps://wiki.archlinux.org/index.php?title=Dwb&diff=446858Dwb2016-08-17T11:31:04Z<p>Cirrus: /* MPVideo */</p>
<hr />
<div>{{DISPLAYTITLE:dwb}}<br />
[[Category:Web browser]]<br />
[[de:dwb]]<br />
[[fr:dwb]]<br />
[[ja:dwb]]<br />
[http://portix.bitbucket.org/dwb/ dwb] is a lightweight and flexible web browser using the webkit engine. It is customizable through its web interface and fully usable with keyboard shortcuts.<br />
<br />
== Installation ==<br />
<br />
The {{Pkg|dwb}} package can be found in the [[official repositories]] and can be installed with [[pacman]]. There are also other versions in the [[AUR]]: {{AUR|dwb-git}}, {{AUR|dwb-gtk3}}{{Broken package link|{{aur-mirror|dwb-gtk3}}}}, and {{AUR|dwb-gtk3-git}}{{Broken package link|{{aur-mirror|dwb-gtk3-git}}}}.<br />
<br />
== Basic usage ==<br />
<br />
Starting from a fresh configuration, use {{ic|Sk}} to open the ''Keys'' page. As you can see from there, most bindings are borrowed from [[Vim]] and [[Emacs]].<br />
<br />
Use {{ic|:}} to access the command prompt. You can use {{ic|Tab}} to auto-complete.<br />
<br />
Read the man page for more details and enable the {{ic|auto-completion}} option in the settings to help you learn the bindings.<br />
<br />
$ man dwb<br />
<br />
=== dwb-specific ===<br />
<br />
o = enter url<br />
O = enter url in new tab<br />
f = spawn hints. Use arrow keys to browse the hints while displaying their URI, or use the hint letters.<br />
F = spawn hints in new tab<br />
;b = spawn hints in new background tab<br />
;r = follow multiple background links rapidly<br />
H = back<br />
L = forward<br />
J = go to next tab<br />
K = go to previous tab<br />
'n'+T = goto 'n' tab<br />
d = close tab<br />
u = undo close tab<br />
ctrl+s = stop<br />
r = reload<br />
R = reload ignoring cache<br />
gi = go to the first input field, doesn't enter input mode, use 'i' for that, so 'gi'+'i'<br />
ctrl+e = open editable field in external editor. Useful for forums and wikis.<br />
;d = download via hints<br />
M = save bookmark (bookmarks are saved in ~/.config/dwb/default/bookmarks)<br />
xb = show/hide status bar<br />
gf = toggle source view<br />
+ = zoom_in<br />
- = zoom_out<br />
= = reset to 100%<br />
<br />
=== vim-like ===<br />
<br />
i = toggle_insert_mode (Esc works to go back to normal mode much like Vim)<br />
Esc = back to normal mode (ctrl+n works too)<br />
j = scroll down<br />
k = scroll up<br />
h = scroll left<br />
l = scroll right<br />
gg = go to top<br />
G = go to bottom<br />
/ = find in page<br />
n = repeat find forward<br />
ZZ = save session and exit<br />
<br />
=== Notes ===<br />
<br />
Press {{ic|v}} to switch to caret browsing, then press {{ic|space}} to toggle between caret and visual mode. Press {{ic|Esc}} one or two times to go back to normal mode. While in caret browsing, you can use the arrow keys to browse the different parts of the page. Hold {{ic|Shift}} to select text. Press {{ic|Enter}} to follow links.<br />
<br />
== Configuration ==<br />
<br />
The configuration files are stored in {{ic|$XDG_CONFIG_HOME/dwb/}} (usually {{ic| ~/.config/dwb/}}) and can be easily accessed through the web interface. Type {{ic|Ss}} to open the ''Settings'' page.<br />
<br />
=== Search engines ===<br />
<br />
Open your favorite search engine, type {{ic|gs}} to select the web page's first input field, and then enter a keyword associated with it. <br />
<br />
Now you can use the keyword in the URI prompt to search directly on the corresponding website. Typing queries directly in the address bar will search with the default search engine, which is the first entry in {{ic|$XDG_CONFIG_HOME/dwb/searchengines}}.<br />
<br />
You can also add more by editing the configuration files. This may help for tricky sites like rfc-editor.org.<br />
<br />
{{hc|.config/dwb/settings|2=<br />
searchengine-submit-pattern=XXX<br />
}}<br />
<br />
{{hc|.config/dwb/searchengines|<nowiki><br />
sp https://startpage.com/do/search?q=XXX<br />
wp https://en.wikipedia.org/w/index.php?search=XXX&title=Special:Search<br />
aw https://wiki.archlinux.org/index.php?title=Special:Search&search=XXX<br />
rfc http://www.rfc-editor.org/search/rfc_search_detail.php?rfc=&title=XXX<br />
</nowiki>}}<br />
<br />
=== keys ===<br />
Standard keybinds can be edited by executing {{ic|:open dwb:keys}} (opening dwb:keys as a webpage). Settings are saved as soon as a value is changed and the element loses focus or the return key is pressed. This is reported in the status bar. Combinations of keys are separated with a space. Some less vim-like keys could be defined by:<br />
<br />
{{hc|dwb:keys|<nowiki><br />
history_back Go back Mod1 @Left@<br />
history_forward Go forward Mod1 @Right@<br />
</nowiki>}}<br />
<br />
This same format is used below for custom keybinds.<br />
<br />
=== Custom keybinds ===<br />
<br />
You can create custom key bindings by editing file {{ic|custom_keys}} in the profile directory. This is<br />
{{ic|~/.config/dwb/default}} by default. All keysyms which do not emit (multi)byte characters, must be enclosed in {{ic|@}}. One keybind can execute multiple ''dwb'' commands. These commands execute in same order as they are defined in bind, and must be separated by {{ic|;;}} separator. If the keybind's chord is already bound by ''dwb'', it might be ignored (behaviour is not consistent). In such case one can try to check, whether there is collison with binds defined in {{ic|~/.config/dwb/keys}} and try to unbind the chord there (eg set it to nothing). Any running ''dwb'' instance will owerwrite {{ic|keys}} file on exit, so remember to do your modifications while ''dwb'' is not runing or use default ''dwb'' interface ({{ic|Sk}}).<br />
<br />
{{hc|~/.config/dwb/default/custom_keys|<nowiki><br />
Control w :close_tab<br />
Control @Page_Up@ :focus_prev<br />
Control @Page_Down@ :focus_next<br />
</nowiki>}}<br />
<br />
== Extensions ==<br />
<br />
''dwb'' features an extension manager as a separate executable, ''dwbem''. To list all officially available extensions, use:<br />
<br />
{{hc|dwbem -a|<br />
Available extensions: Mainstream equivalent:<br />
- adblock_subscriptions Adblock<br />
- autoquvi Video DownloadHelper<br />
- contenthandler (Handle requests based on MIME type, filename extension or URI scheme)<br />
- downloadhandler (Handle downloads based on mimetype or filename extension, useful if 'download-no-confirm' is set)<br />
- formfiller LastPass, Lazarus (Save form data and fill forms with previously saved data, also with gpg-support)<br />
- googlebookmarks GBookmarks, GMarks (Add bookmarks to google bookmarks with a shortcut)<br />
- googledocs Open with Google Docs, Google Docs Viewer<br />
- grabscrolling (Adobe Acrobat style grab and drag mouse scrolling)<br />
- multimarks (Bookmark multiple urls to a single quickmark)<br />
- navtools Opera Fast Forward, IE 10 Flip Ahead<br />
- perdomainsettings (Change webkit-settings automatically on domain or url basis)<br />
- pwdhash PwdHash<br />
- requestpolicy RequestPolicy, Disconnect, Ghostery<br />
- simplyread Readability, Clearly<br />
- speeddial Speed Dial<br />
- supergenpass (Generate domain-based passwords; compatible with the bookmarklet supergenpass but with additional options)<br />
- unique_tabs (Remove duplicate tabs or avoid duplicate tabs by autoswitching to tabs with same url)<br />
- userscripts GreaseMonkey/Stylish<br />
- whitelistshortcuts (Whitelist webkit settings for certain domains with a shortcut)<br />
}}<br />
<br />
For more details, use {{ic|dwbem -I <extension>}} and read the [http://portix.bitbucket.org/dwb/resources/dwb.1.html dwb] and [http://portix.bitbucket.org/dwb/resources/dwbem.1.html dwbem] man pages. To get more details on all available extensions use {{ic|<nowiki>for i in $(dwbem -a | awk '/-/ {print $NF}'); do dwbem -I $i; done</nowiki>}}.<br />
<br />
Below is a list of popular extensions (or add-ons) for which ''dwb'' has a built-in alternative:<br />
<br />
* NoScript/Flashblock: ''dwb'' blocks flash by default and can block javascript.<br />
* Omnibar: just like Chrome, ''dwb'''s address gives quick access to search, history, and bookmarks.<br />
* Download Statusbar: ''dwb'''s displays downloads in a neat status bar by default.<br />
* IE Tab: ''dwb'' can open a page in any external browser with a simple userscript.<br />
* Session Manager: ''dwb'' uses its built-in session manager by default.<br />
* Private browsing: add {{ic|xpp:toggle enable-private-browsing}} to {{ic|custom_keys}} to toggle privacy mode by typing {{ic|xpp}}.<br />
<br />
=== Adblock ===<br />
<br />
''dwb'' features an Adblock extension. Install it with<br />
<br />
$ dwbem -i adblock_subscriptions<br />
<br />
Restart ''dwb'', enable adblocker with {{ic|:set adblocker true}}, use the ''adblock_subscribe'' command and choose your favorite filter (avoid using more than one filter to prevent duplicate entries that make the adblocker much slower). After that you also need to make the changes active with the ''adblock_update'' command.<br />
<br />
== Userscripts ==<br />
<br />
''dwb'' can execute .js or .sh scripts put in {{ic|~/.config/dwb/userscripts/}}. Make sure they are executable:<br />
chmod +x ~/.config/dwb/userscripts/myscript.js<br />
<br />
Below are some example scripts, see ''dwb'' [http://portix.bitbucket.org/dwb/snippets/snippets.html userscripts snippets] for more:<br />
<br />
=== defer-loading ===<br />
<br />
Prevents tabs from last session to load all at once at startup.<br />
{{hc|~/.config/dwb/userscripts/defer-loading.js|<nowiki><br />
//!javascript<br />
if (settings.loadOnFocus === false) {<br />
execute('local_set load-on-focus true');<br />
}<br />
Signal.connect('navigation', function(webview) {<br />
if (webview == tabs.current) {<br />
execute('local_set load-on-focus false');<br />
this.disconnect();<br />
}<br />
});</nowiki>}}<br />
<br />
=== fast-forward ===<br />
<br />
Opera features a neat key binding which allows users to load to next/previous logical page. This is very useful for forum threads, documentation, and articles spread over several pages.<br />
<br />
This feature can be implemented with a simple javascript function and bound to custom keys {{ic|<nowiki>}</nowiki>}} and {{ic|{}}:<br />
<br />
{{hc|~/.config/dwb/default/custom_keys|<nowiki><br />
}:exja (function(){var e=document.querySelector("[rel='next']");if(e){location=e.href;}else{var f=document.getElementsByTagName("a");var i=f.length;while((e=f[--i])){if(e.text.search(/(\bnext\b|^>$|^(>>|»)$|^(>|»)|(>|»)$|\bmore\b)/i)>-1){location=e.href; break;}} location.href=location.href.replace(/(\d+)([^\/\d]*)$/, function(a,b,c){return ++b+c})}})();<br />
{:exja (function(){var e=document.querySelector("[rel='prev']");if(e){location=e.href;}else{var f=document.getElementsByTagName("a");var i=f.length;while((e=f[--i])){if(e.text.search(/(\b(prev|previous)\b|^<$|^(<<|«)$|^(<|«)|(<|«)$)/i)>-1){location=e.href;break;}} location.href=location.href.replace(/(\d+)([^\/\d]*)$/, function(a,b,c){return --b+c})}})();<br />
</nowiki>}}<br />
<br />
Alternatively, the {{ic|navtools}} extension provides the same functionality and more, such as going up one directory, or loading the root URI.<br />
<br />
=== open-firefox ===<br />
Opens current page in Firefox with {{ic|xf}} (uses {{Pkg|firefox}} and {{Pkg|libnotify}}).<br />
{{hc|~/.config/dwb/userscripts/open-firefox.sh|<nowiki><br />
#!/bin/bash<br />
# dwb: xf<br />
firefox $DWB_URI &<br />
notify-send -u low "Firefox opening $DWB_URI" #optional notification<br />
</nowiki>}}<br />
<br />
=== startup-noautoreload ===<br />
<br />
Prevents previously-opened tabs from reloading all at once after a restart.<br />
{{hc|~/.config/dwb/userscripts/startup-noautoreload.js|<nowiki><br />
//!javascript<br />
// prevents previously-opened tabs from reloading all at once after a restart.<br />
execute("set load-on-focus true");<br />
<br />
var sigId = Signal.connect("navigation", function(wv) {<br />
if (wv == tabs.current)<br />
{<br />
execute("set load-on-focus false");<br />
Signal.disconnect(sigId);<br />
}<br />
});</nowiki>}}<br />
<br />
=== toggle-stylesheet ===<br />
<br />
Toggles between 2 global stylesheets with {{ic|xg}}.<br />
{{hc|~/.config/dwb/userscripts/toggle-stylesheet.sh|<nowiki><br />
#!/bin/bash<br />
# dwb:xg<br />
<br />
CURRENT_STYLESHEET="$(dwbremote get setting user-stylesheet-uri)"<br />
<br />
STYLESHEET_1="file://$HOME/.config/dwb/stylesheets/foo.css"<br />
STYLESHEET_2="file://$HOME/.config/dwb/stylesheets/bar.css"<br />
<br />
if [[ "${CURRENT_STYLESHEET}" = ${STYLESHEET_1} ]]; then<br />
dwbremote :local_set user-stylesheet-uri "$STYLESHEET_2"<br />
else <br />
dwbremote :local_set user-stylesheet-uri "$STYLESHEET_1"<br />
fi</nowiki>}}<br />
<br />
=== youtube-player ===<br />
<br />
Opens YouTube videos with MPlayer (uses {{Pkg|mplayer}} and {{Pkg|youtube-dl}}).<br />
{{hc|~/.config/dwb/userscripts/youtube-mplayer.js|<nowiki><br />
//!javascript <br />
// opens YouTube videos with mplayer.<br />
var regex = new RegExp("http(.*)://www.youtube.com/watch\\?(.*&)*v=.*");<br />
<br />
Signal.connect("navigation", function (wv, frame, request) {<br />
if (wv.mainFrame == frame && regex.test(request.uri)) <br />
system.spawn("sh -c 'mplayer \"$(youtube-dl -g " + request.uri + ")\"'");<br />
return false;<br />
});</nowiki>}}<br />
<br />
=== MPVideo ===<br />
<br />
Slight modification of above script, this opens videos from Dailymotion, Vodlocker and more with mpv. (uses {{Pkg|mpv}} and {{Pkg|youtube-dl}}).<br />
{{hc|~/.config/dwb/userscripts/MPVideo.js|<nowiki><br />
//!javascript <br />
// opens videos from Dailymotion, Vodlocker and many more with mpv.<br />
<br />
function playInMplayer() {<br />
system.spawn("sh -c 'mpv \"$(youtube-dl -g " + tabs.current.uri + ")\"'");<br />
}<br />
<br />
bind("mp", playInMplayer, "play_in_mplayer");<br />
</nowiki>}}<br />
<br />
=== rocker gestures ===<br />
<br />
Enables Opera-like rocker gestures for navigating the history. Disable the context menu in the settings first.<br />
{{hc|~/.config/dwb/userscripts/rocker.js|<nowiki><br />
//!javascript<br />
var LMB = 1, MMB=2, RMB = 3, UNKNOWN = 10, DOWN = 11, UP = 12;<br />
<br />
var buttonStates = [UNKNOWN, UNKNOWN, UNKNOWN, UNKNOWN, UNKNOWN, UNKNOWN];<br />
var bp = new Signal("onButtonPress", function(wv, result, ev) {<br />
var mouseButton = ev.button;<br />
<br />
buttonStates[mouseButton] = DOWN;<br />
<br />
if (mouseButton == LMB && buttonStates[RMB] == DOWN) {<br />
execute("history_back");<br />
} else if (mouseButton == RMB && buttonStates[LMB] == DOWN) {<br />
execute("history_forward");<br />
}<br />
});<br />
var br = new Signal("onButtonRelease", function(wv, result, ev) {<br />
buttonStates[ev.button] = UP;<br />
});<br />
<br />
bp.connect();<br />
br.connect();</nowiki>}}<br />
<br />
== Stylesheet ==<br />
<br />
a global stylesheet can be defined in the Settings, under {{ic|user-stylesheet-uri}} (i.e. {{ic|file:///home/tux/.config/dwb/stylesheet.css}})<br />
<br />
If you browse with the status bar hidden and are annoyed by the the link previews that appear while hovering over links with the mouse, add this to the stylesheet: {{ic|#dwb_hover_element { display:none!important; }}}<br />
<br />
== Troubleshooting ==<br />
<br />
=== Search engines search for ''undefined'' ===<br />
<br />
If you are always searching for ''undefined'' even with the {{ic|searchengine-submit-pattern}} option set, then you should edit {{ic|$XDG_CONFIG_HOME/dwb/searchengines}} and adapt the URIs to match your {{ic|searchengine-submit-pattern}}.<br />
<br />
=== Fuzzy font in Github ===<br />
<br />
Install {{Pkg|ttf-freefont}} or add this in your {{ic|~/.config/fontconfig/fonts.conf}} inside the fontconfig-tags:<br />
<br />
<selectfont><br />
<rejectfont><br />
<pattern><br />
<patelt name="family"><br />
<string>Clean</string><br />
</patelt><br />
</pattern><br />
</rejectfont><br />
</selectfont><br />
<br />
If above solution doesn't help try to remove {{ic|xorg-fonts-75dpi}} and {{ic|xorg-fonts-100dpi}} packages.<br />
<br />
=== HTML5 media ===<br />
<br />
See [[Browser plugins#Multimedia playback]].<br />
<br />
== dwb-git ==<br />
<br />
{{AUR|dwb-git}} offers many improvements over the stable version, the most notable of which are listed below.<br />
<br />
{{Note|As of May 4th, 2015, the official {{Pkg|dwb}} package should contain all those features, and more.}}<br />
<br />
=== Plugin Support ===<br />
<br />
Browser Plugins can be enabled and disabled through the new [dwb:plugins dwb:plugins] settings page. Other [[Browser plugins]] may be supported as well, but these two alone will make your dwb experience much more enjoyable.<br />
<br />
==== Flash Support ====<br />
<br />
{{AUR|dwb-git}} has built in support for the {{Pkg|flashplugin}}. Dwb should auto-detect and enabled the plugin after it is installed. Alternatively, you can install {{Aur|gnash-gtk}}{{Broken package link|package not found}} and it will be detected as well.<br />
<br />
==== Java Support ====<br />
<br />
{{AUR|dwb-git}} has built in support for the {{Pkg|icedtea-web}}. Dwb should auto-detect and enable the plugin after it is installed.<br />
<br />
=== Improved Ability to Display Websites ===<br />
<br />
If you are having problems with they layout of websites not loading correctly then give {{AUR|dwb-git}} a shot.</div>Cirrushttps://wiki.archlinux.org/index.php?title=Dwb&diff=446857Dwb2016-08-17T11:19:39Z<p>Cirrus: /* MPVideo */ tidy</p>
<hr />
<div>{{DISPLAYTITLE:dwb}}<br />
[[Category:Web browser]]<br />
[[de:dwb]]<br />
[[fr:dwb]]<br />
[[ja:dwb]]<br />
[http://portix.bitbucket.org/dwb/ dwb] is a lightweight and flexible web browser using the webkit engine. It is customizable through its web interface and fully usable with keyboard shortcuts.<br />
<br />
== Installation ==<br />
<br />
The {{Pkg|dwb}} package can be found in the [[official repositories]] and can be installed with [[pacman]]. There are also other versions in the [[AUR]]: {{AUR|dwb-git}}, {{AUR|dwb-gtk3}}{{Broken package link|{{aur-mirror|dwb-gtk3}}}}, and {{AUR|dwb-gtk3-git}}{{Broken package link|{{aur-mirror|dwb-gtk3-git}}}}.<br />
<br />
== Basic usage ==<br />
<br />
Starting from a fresh configuration, use {{ic|Sk}} to open the ''Keys'' page. As you can see from there, most bindings are borrowed from [[Vim]] and [[Emacs]].<br />
<br />
Use {{ic|:}} to access the command prompt. You can use {{ic|Tab}} to auto-complete.<br />
<br />
Read the man page for more details and enable the {{ic|auto-completion}} option in the settings to help you learn the bindings.<br />
<br />
$ man dwb<br />
<br />
=== dwb-specific ===<br />
<br />
o = enter url<br />
O = enter url in new tab<br />
f = spawn hints. Use arrow keys to browse the hints while displaying their URI, or use the hint letters.<br />
F = spawn hints in new tab<br />
;b = spawn hints in new background tab<br />
;r = follow multiple background links rapidly<br />
H = back<br />
L = forward<br />
J = go to next tab<br />
K = go to previous tab<br />
'n'+T = goto 'n' tab<br />
d = close tab<br />
u = undo close tab<br />
ctrl+s = stop<br />
r = reload<br />
R = reload ignoring cache<br />
gi = go to the first input field, doesn't enter input mode, use 'i' for that, so 'gi'+'i'<br />
ctrl+e = open editable field in external editor. Useful for forums and wikis.<br />
;d = download via hints<br />
M = save bookmark (bookmarks are saved in ~/.config/dwb/default/bookmarks)<br />
xb = show/hide status bar<br />
gf = toggle source view<br />
+ = zoom_in<br />
- = zoom_out<br />
= = reset to 100%<br />
<br />
=== vim-like ===<br />
<br />
i = toggle_insert_mode (Esc works to go back to normal mode much like Vim)<br />
Esc = back to normal mode (ctrl+n works too)<br />
j = scroll down<br />
k = scroll up<br />
h = scroll left<br />
l = scroll right<br />
gg = go to top<br />
G = go to bottom<br />
/ = find in page<br />
n = repeat find forward<br />
ZZ = save session and exit<br />
<br />
=== Notes ===<br />
<br />
Press {{ic|v}} to switch to caret browsing, then press {{ic|space}} to toggle between caret and visual mode. Press {{ic|Esc}} one or two times to go back to normal mode. While in caret browsing, you can use the arrow keys to browse the different parts of the page. Hold {{ic|Shift}} to select text. Press {{ic|Enter}} to follow links.<br />
<br />
== Configuration ==<br />
<br />
The configuration files are stored in {{ic|$XDG_CONFIG_HOME/dwb/}} (usually {{ic| ~/.config/dwb/}}) and can be easily accessed through the web interface. Type {{ic|Ss}} to open the ''Settings'' page.<br />
<br />
=== Search engines ===<br />
<br />
Open your favorite search engine, type {{ic|gs}} to select the web page's first input field, and then enter a keyword associated with it. <br />
<br />
Now you can use the keyword in the URI prompt to search directly on the corresponding website. Typing queries directly in the address bar will search with the default search engine, which is the first entry in {{ic|$XDG_CONFIG_HOME/dwb/searchengines}}.<br />
<br />
You can also add more by editing the configuration files. This may help for tricky sites like rfc-editor.org.<br />
<br />
{{hc|.config/dwb/settings|2=<br />
searchengine-submit-pattern=XXX<br />
}}<br />
<br />
{{hc|.config/dwb/searchengines|<nowiki><br />
sp https://startpage.com/do/search?q=XXX<br />
wp https://en.wikipedia.org/w/index.php?search=XXX&title=Special:Search<br />
aw https://wiki.archlinux.org/index.php?title=Special:Search&search=XXX<br />
rfc http://www.rfc-editor.org/search/rfc_search_detail.php?rfc=&title=XXX<br />
</nowiki>}}<br />
<br />
=== keys ===<br />
Standard keybinds can be edited by executing {{ic|:open dwb:keys}} (opening dwb:keys as a webpage). Settings are saved as soon as a value is changed and the element loses focus or the return key is pressed. This is reported in the status bar. Combinations of keys are separated with a space. Some less vim-like keys could be defined by:<br />
<br />
{{hc|dwb:keys|<nowiki><br />
history_back Go back Mod1 @Left@<br />
history_forward Go forward Mod1 @Right@<br />
</nowiki>}}<br />
<br />
This same format is used below for custom keybinds.<br />
<br />
=== Custom keybinds ===<br />
<br />
You can create custom key bindings by editing file {{ic|custom_keys}} in the profile directory. This is<br />
{{ic|~/.config/dwb/default}} by default. All keysyms which do not emit (multi)byte characters, must be enclosed in {{ic|@}}. One keybind can execute multiple ''dwb'' commands. These commands execute in same order as they are defined in bind, and must be separated by {{ic|;;}} separator. If the keybind's chord is already bound by ''dwb'', it might be ignored (behaviour is not consistent). In such case one can try to check, whether there is collison with binds defined in {{ic|~/.config/dwb/keys}} and try to unbind the chord there (eg set it to nothing). Any running ''dwb'' instance will owerwrite {{ic|keys}} file on exit, so remember to do your modifications while ''dwb'' is not runing or use default ''dwb'' interface ({{ic|Sk}}).<br />
<br />
{{hc|~/.config/dwb/default/custom_keys|<nowiki><br />
Control w :close_tab<br />
Control @Page_Up@ :focus_prev<br />
Control @Page_Down@ :focus_next<br />
</nowiki>}}<br />
<br />
== Extensions ==<br />
<br />
''dwb'' features an extension manager as a separate executable, ''dwbem''. To list all officially available extensions, use:<br />
<br />
{{hc|dwbem -a|<br />
Available extensions: Mainstream equivalent:<br />
- adblock_subscriptions Adblock<br />
- autoquvi Video DownloadHelper<br />
- contenthandler (Handle requests based on MIME type, filename extension or URI scheme)<br />
- downloadhandler (Handle downloads based on mimetype or filename extension, useful if 'download-no-confirm' is set)<br />
- formfiller LastPass, Lazarus (Save form data and fill forms with previously saved data, also with gpg-support)<br />
- googlebookmarks GBookmarks, GMarks (Add bookmarks to google bookmarks with a shortcut)<br />
- googledocs Open with Google Docs, Google Docs Viewer<br />
- grabscrolling (Adobe Acrobat style grab and drag mouse scrolling)<br />
- multimarks (Bookmark multiple urls to a single quickmark)<br />
- navtools Opera Fast Forward, IE 10 Flip Ahead<br />
- perdomainsettings (Change webkit-settings automatically on domain or url basis)<br />
- pwdhash PwdHash<br />
- requestpolicy RequestPolicy, Disconnect, Ghostery<br />
- simplyread Readability, Clearly<br />
- speeddial Speed Dial<br />
- supergenpass (Generate domain-based passwords; compatible with the bookmarklet supergenpass but with additional options)<br />
- unique_tabs (Remove duplicate tabs or avoid duplicate tabs by autoswitching to tabs with same url)<br />
- userscripts GreaseMonkey/Stylish<br />
- whitelistshortcuts (Whitelist webkit settings for certain domains with a shortcut)<br />
}}<br />
<br />
For more details, use {{ic|dwbem -I <extension>}} and read the [http://portix.bitbucket.org/dwb/resources/dwb.1.html dwb] and [http://portix.bitbucket.org/dwb/resources/dwbem.1.html dwbem] man pages. To get more details on all available extensions use {{ic|<nowiki>for i in $(dwbem -a | awk '/-/ {print $NF}'); do dwbem -I $i; done</nowiki>}}.<br />
<br />
Below is a list of popular extensions (or add-ons) for which ''dwb'' has a built-in alternative:<br />
<br />
* NoScript/Flashblock: ''dwb'' blocks flash by default and can block javascript.<br />
* Omnibar: just like Chrome, ''dwb'''s address gives quick access to search, history, and bookmarks.<br />
* Download Statusbar: ''dwb'''s displays downloads in a neat status bar by default.<br />
* IE Tab: ''dwb'' can open a page in any external browser with a simple userscript.<br />
* Session Manager: ''dwb'' uses its built-in session manager by default.<br />
* Private browsing: add {{ic|xpp:toggle enable-private-browsing}} to {{ic|custom_keys}} to toggle privacy mode by typing {{ic|xpp}}.<br />
<br />
=== Adblock ===<br />
<br />
''dwb'' features an Adblock extension. Install it with<br />
<br />
$ dwbem -i adblock_subscriptions<br />
<br />
Restart ''dwb'', enable adblocker with {{ic|:set adblocker true}}, use the ''adblock_subscribe'' command and choose your favorite filter (avoid using more than one filter to prevent duplicate entries that make the adblocker much slower). After that you also need to make the changes active with the ''adblock_update'' command.<br />
<br />
== Userscripts ==<br />
<br />
''dwb'' can execute .js or .sh scripts put in {{ic|~/.config/dwb/userscripts/}}. Make sure they are executable:<br />
chmod +x ~/.config/dwb/userscripts/myscript.js<br />
<br />
Below are some example scripts, see ''dwb'' [http://portix.bitbucket.org/dwb/snippets/snippets.html userscripts snippets] for more:<br />
<br />
=== defer-loading ===<br />
<br />
Prevents tabs from last session to load all at once at startup.<br />
{{hc|~/.config/dwb/userscripts/defer-loading.js|<nowiki><br />
//!javascript<br />
if (settings.loadOnFocus === false) {<br />
execute('local_set load-on-focus true');<br />
}<br />
Signal.connect('navigation', function(webview) {<br />
if (webview == tabs.current) {<br />
execute('local_set load-on-focus false');<br />
this.disconnect();<br />
}<br />
});</nowiki>}}<br />
<br />
=== fast-forward ===<br />
<br />
Opera features a neat key binding which allows users to load to next/previous logical page. This is very useful for forum threads, documentation, and articles spread over several pages.<br />
<br />
This feature can be implemented with a simple javascript function and bound to custom keys {{ic|<nowiki>}</nowiki>}} and {{ic|{}}:<br />
<br />
{{hc|~/.config/dwb/default/custom_keys|<nowiki><br />
}:exja (function(){var e=document.querySelector("[rel='next']");if(e){location=e.href;}else{var f=document.getElementsByTagName("a");var i=f.length;while((e=f[--i])){if(e.text.search(/(\bnext\b|^>$|^(>>|»)$|^(>|»)|(>|»)$|\bmore\b)/i)>-1){location=e.href; break;}} location.href=location.href.replace(/(\d+)([^\/\d]*)$/, function(a,b,c){return ++b+c})}})();<br />
{:exja (function(){var e=document.querySelector("[rel='prev']");if(e){location=e.href;}else{var f=document.getElementsByTagName("a");var i=f.length;while((e=f[--i])){if(e.text.search(/(\b(prev|previous)\b|^<$|^(<<|«)$|^(<|«)|(<|«)$)/i)>-1){location=e.href;break;}} location.href=location.href.replace(/(\d+)([^\/\d]*)$/, function(a,b,c){return --b+c})}})();<br />
</nowiki>}}<br />
<br />
Alternatively, the {{ic|navtools}} extension provides the same functionality and more, such as going up one directory, or loading the root URI.<br />
<br />
=== open-firefox ===<br />
Opens current page in Firefox with {{ic|xf}} (uses {{Pkg|firefox}} and {{Pkg|libnotify}}).<br />
{{hc|~/.config/dwb/userscripts/open-firefox.sh|<nowiki><br />
#!/bin/bash<br />
# dwb: xf<br />
firefox $DWB_URI &<br />
notify-send -u low "Firefox opening $DWB_URI" #optional notification<br />
</nowiki>}}<br />
<br />
=== startup-noautoreload ===<br />
<br />
Prevents previously-opened tabs from reloading all at once after a restart.<br />
{{hc|~/.config/dwb/userscripts/startup-noautoreload.js|<nowiki><br />
//!javascript<br />
// prevents previously-opened tabs from reloading all at once after a restart.<br />
execute("set load-on-focus true");<br />
<br />
var sigId = Signal.connect("navigation", function(wv) {<br />
if (wv == tabs.current)<br />
{<br />
execute("set load-on-focus false");<br />
Signal.disconnect(sigId);<br />
}<br />
});</nowiki>}}<br />
<br />
=== toggle-stylesheet ===<br />
<br />
Toggles between 2 global stylesheets with {{ic|xg}}.<br />
{{hc|~/.config/dwb/userscripts/toggle-stylesheet.sh|<nowiki><br />
#!/bin/bash<br />
# dwb:xg<br />
<br />
CURRENT_STYLESHEET="$(dwbremote get setting user-stylesheet-uri)"<br />
<br />
STYLESHEET_1="file://$HOME/.config/dwb/stylesheets/foo.css"<br />
STYLESHEET_2="file://$HOME/.config/dwb/stylesheets/bar.css"<br />
<br />
if [[ "${CURRENT_STYLESHEET}" = ${STYLESHEET_1} ]]; then<br />
dwbremote :local_set user-stylesheet-uri "$STYLESHEET_2"<br />
else <br />
dwbremote :local_set user-stylesheet-uri "$STYLESHEET_1"<br />
fi</nowiki>}}<br />
<br />
=== youtube-player ===<br />
<br />
Opens YouTube videos with MPlayer (uses {{Pkg|mplayer}} and {{Pkg|youtube-dl}}).<br />
{{hc|~/.config/dwb/userscripts/youtube-mplayer.js|<nowiki><br />
//!javascript <br />
// opens YouTube videos with mplayer.<br />
var regex = new RegExp("http(.*)://www.youtube.com/watch\\?(.*&)*v=.*");<br />
<br />
Signal.connect("navigation", function (wv, frame, request) {<br />
if (wv.mainFrame == frame && regex.test(request.uri)) <br />
system.spawn("sh -c 'mplayer \"$(youtube-dl -g " + request.uri + ")\"'");<br />
return false;<br />
});</nowiki>}}<br />
<br />
=== MPVideo ===<br />
<br />
Slight modification of above script, this opens videos from You Tube, Dailymotion, Vodlocker and more with mpv. (uses {{Pkg|mpv}} and {{Pkg|youtube-dl}}).<br />
{{hc|~/.config/dwb/userscripts/MPVideo.js|<nowiki><br />
//!javascript <br />
// opens videos from You Tube, Dailymotion, Vodlocker and many more with mpv.<br />
<br />
function playInMplayer() {<br />
system.spawn("sh -c 'mpv \"$(youtube-dl -g " + tabs.current.uri + ")\"'");<br />
}<br />
<br />
bind("mp", playInMplayer, "play_in_mplayer");<br />
</nowiki>}}<br />
<br />
=== rocker gestures ===<br />
<br />
Enables Opera-like rocker gestures for navigating the history. Disable the context menu in the settings first.<br />
{{hc|~/.config/dwb/userscripts/rocker.js|<nowiki><br />
//!javascript<br />
var LMB = 1, MMB=2, RMB = 3, UNKNOWN = 10, DOWN = 11, UP = 12;<br />
<br />
var buttonStates = [UNKNOWN, UNKNOWN, UNKNOWN, UNKNOWN, UNKNOWN, UNKNOWN];<br />
var bp = new Signal("onButtonPress", function(wv, result, ev) {<br />
var mouseButton = ev.button;<br />
<br />
buttonStates[mouseButton] = DOWN;<br />
<br />
if (mouseButton == LMB && buttonStates[RMB] == DOWN) {<br />
execute("history_back");<br />
} else if (mouseButton == RMB && buttonStates[LMB] == DOWN) {<br />
execute("history_forward");<br />
}<br />
});<br />
var br = new Signal("onButtonRelease", function(wv, result, ev) {<br />
buttonStates[ev.button] = UP;<br />
});<br />
<br />
bp.connect();<br />
br.connect();</nowiki>}}<br />
<br />
== Stylesheet ==<br />
<br />
a global stylesheet can be defined in the Settings, under {{ic|user-stylesheet-uri}} (i.e. {{ic|file:///home/tux/.config/dwb/stylesheet.css}})<br />
<br />
If you browse with the status bar hidden and are annoyed by the the link previews that appear while hovering over links with the mouse, add this to the stylesheet: {{ic|#dwb_hover_element { display:none!important; }}}<br />
<br />
== Troubleshooting ==<br />
<br />
=== Search engines search for ''undefined'' ===<br />
<br />
If you are always searching for ''undefined'' even with the {{ic|searchengine-submit-pattern}} option set, then you should edit {{ic|$XDG_CONFIG_HOME/dwb/searchengines}} and adapt the URIs to match your {{ic|searchengine-submit-pattern}}.<br />
<br />
=== Fuzzy font in Github ===<br />
<br />
Install {{Pkg|ttf-freefont}} or add this in your {{ic|~/.config/fontconfig/fonts.conf}} inside the fontconfig-tags:<br />
<br />
<selectfont><br />
<rejectfont><br />
<pattern><br />
<patelt name="family"><br />
<string>Clean</string><br />
</patelt><br />
</pattern><br />
</rejectfont><br />
</selectfont><br />
<br />
If above solution doesn't help try to remove {{ic|xorg-fonts-75dpi}} and {{ic|xorg-fonts-100dpi}} packages.<br />
<br />
=== HTML5 media ===<br />
<br />
See [[Browser plugins#Multimedia playback]].<br />
<br />
== dwb-git ==<br />
<br />
{{AUR|dwb-git}} offers many improvements over the stable version, the most notable of which are listed below.<br />
<br />
{{Note|As of May 4th, 2015, the official {{Pkg|dwb}} package should contain all those features, and more.}}<br />
<br />
=== Plugin Support ===<br />
<br />
Browser Plugins can be enabled and disabled through the new [dwb:plugins dwb:plugins] settings page. Other [[Browser plugins]] may be supported as well, but these two alone will make your dwb experience much more enjoyable.<br />
<br />
==== Flash Support ====<br />
<br />
{{AUR|dwb-git}} has built in support for the {{Pkg|flashplugin}}. Dwb should auto-detect and enabled the plugin after it is installed. Alternatively, you can install {{Aur|gnash-gtk}}{{Broken package link|package not found}} and it will be detected as well.<br />
<br />
==== Java Support ====<br />
<br />
{{AUR|dwb-git}} has built in support for the {{Pkg|icedtea-web}}. Dwb should auto-detect and enable the plugin after it is installed.<br />
<br />
=== Improved Ability to Display Websites ===<br />
<br />
If you are having problems with they layout of websites not loading correctly then give {{AUR|dwb-git}} a shot.</div>Cirrushttps://wiki.archlinux.org/index.php?title=Dwb&diff=446812Dwb2016-08-16T20:19:17Z<p>Cirrus: /* MPVideo */ typo</p>
<hr />
<div>{{DISPLAYTITLE:dwb}}<br />
[[Category:Web browser]]<br />
[[de:dwb]]<br />
[[fr:dwb]]<br />
[[ja:dwb]]<br />
[http://portix.bitbucket.org/dwb/ dwb] is a lightweight and flexible web browser using the webkit engine. It is customizable through its web interface and fully usable with keyboard shortcuts.<br />
<br />
== Installation ==<br />
<br />
The {{Pkg|dwb}} package can be found in the [[official repositories]] and can be installed with [[pacman]]. There are also other versions in the [[AUR]]: {{AUR|dwb-git}}, {{AUR|dwb-gtk3}}{{Broken package link|{{aur-mirror|dwb-gtk3}}}}, and {{AUR|dwb-gtk3-git}}{{Broken package link|{{aur-mirror|dwb-gtk3-git}}}}.<br />
<br />
== Basic usage ==<br />
<br />
Starting from a fresh configuration, use {{ic|Sk}} to open the ''Keys'' page. As you can see from there, most bindings are borrowed from [[Vim]] and [[Emacs]].<br />
<br />
Use {{ic|:}} to access the command prompt. You can use {{ic|Tab}} to auto-complete.<br />
<br />
Read the man page for more details and enable the {{ic|auto-completion}} option in the settings to help you learn the bindings.<br />
<br />
$ man dwb<br />
<br />
=== dwb-specific ===<br />
<br />
o = enter url<br />
O = enter url in new tab<br />
f = spawn hints. Use arrow keys to browse the hints while displaying their URI, or use the hint letters.<br />
F = spawn hints in new tab<br />
;b = spawn hints in new background tab<br />
;r = follow multiple background links rapidly<br />
H = back<br />
L = forward<br />
J = go to next tab<br />
K = go to previous tab<br />
'n'+T = goto 'n' tab<br />
d = close tab<br />
u = undo close tab<br />
ctrl+s = stop<br />
r = reload<br />
R = reload ignoring cache<br />
gi = go to the first input field, doesn't enter input mode, use 'i' for that, so 'gi'+'i'<br />
ctrl+e = open editable field in external editor. Useful for forums and wikis.<br />
;d = download via hints<br />
M = save bookmark (bookmarks are saved in ~/.config/dwb/default/bookmarks)<br />
xb = show/hide status bar<br />
gf = toggle source view<br />
+ = zoom_in<br />
- = zoom_out<br />
= = reset to 100%<br />
<br />
=== vim-like ===<br />
<br />
i = toggle_insert_mode (Esc works to go back to normal mode much like Vim)<br />
Esc = back to normal mode (ctrl+n works too)<br />
j = scroll down<br />
k = scroll up<br />
h = scroll left<br />
l = scroll right<br />
gg = go to top<br />
G = go to bottom<br />
/ = find in page<br />
n = repeat find forward<br />
ZZ = save session and exit<br />
<br />
=== Notes ===<br />
<br />
Press {{ic|v}} to switch to caret browsing, then press {{ic|space}} to toggle between caret and visual mode. Press {{ic|Esc}} one or two times to go back to normal mode. While in caret browsing, you can use the arrow keys to browse the different parts of the page. Hold {{ic|Shift}} to select text. Press {{ic|Enter}} to follow links.<br />
<br />
== Configuration ==<br />
<br />
The configuration files are stored in {{ic|$XDG_CONFIG_HOME/dwb/}} (usually {{ic| ~/.config/dwb/}}) and can be easily accessed through the web interface. Type {{ic|Ss}} to open the ''Settings'' page.<br />
<br />
=== Search engines ===<br />
<br />
Open your favorite search engine, type {{ic|gs}} to select the web page's first input field, and then enter a keyword associated with it. <br />
<br />
Now you can use the keyword in the URI prompt to search directly on the corresponding website. Typing queries directly in the address bar will search with the default search engine, which is the first entry in {{ic|$XDG_CONFIG_HOME/dwb/searchengines}}.<br />
<br />
You can also add more by editing the configuration files. This may help for tricky sites like rfc-editor.org.<br />
<br />
{{hc|.config/dwb/settings|2=<br />
searchengine-submit-pattern=XXX<br />
}}<br />
<br />
{{hc|.config/dwb/searchengines|<nowiki><br />
sp https://startpage.com/do/search?q=XXX<br />
wp https://en.wikipedia.org/w/index.php?search=XXX&title=Special:Search<br />
aw https://wiki.archlinux.org/index.php?title=Special:Search&search=XXX<br />
rfc http://www.rfc-editor.org/search/rfc_search_detail.php?rfc=&title=XXX<br />
</nowiki>}}<br />
<br />
=== keys ===<br />
Standard keybinds can be edited by executing {{ic|:open dwb:keys}} (opening dwb:keys as a webpage). Settings are saved as soon as a value is changed and the element loses focus or the return key is pressed. This is reported in the status bar. Combinations of keys are separated with a space. Some less vim-like keys could be defined by:<br />
<br />
{{hc|dwb:keys|<nowiki><br />
history_back Go back Mod1 @Left@<br />
history_forward Go forward Mod1 @Right@<br />
</nowiki>}}<br />
<br />
This same format is used below for custom keybinds.<br />
<br />
=== Custom keybinds ===<br />
<br />
You can create custom key bindings by editing file {{ic|custom_keys}} in the profile directory. This is<br />
{{ic|~/.config/dwb/default}} by default. All keysyms which do not emit (multi)byte characters, must be enclosed in {{ic|@}}. One keybind can execute multiple ''dwb'' commands. These commands execute in same order as they are defined in bind, and must be separated by {{ic|;;}} separator. If the keybind's chord is already bound by ''dwb'', it might be ignored (behaviour is not consistent). In such case one can try to check, whether there is collison with binds defined in {{ic|~/.config/dwb/keys}} and try to unbind the chord there (eg set it to nothing). Any running ''dwb'' instance will owerwrite {{ic|keys}} file on exit, so remember to do your modifications while ''dwb'' is not runing or use default ''dwb'' interface ({{ic|Sk}}).<br />
<br />
{{hc|~/.config/dwb/default/custom_keys|<nowiki><br />
Control w :close_tab<br />
Control @Page_Up@ :focus_prev<br />
Control @Page_Down@ :focus_next<br />
</nowiki>}}<br />
<br />
== Extensions ==<br />
<br />
''dwb'' features an extension manager as a separate executable, ''dwbem''. To list all officially available extensions, use:<br />
<br />
{{hc|dwbem -a|<br />
Available extensions: Mainstream equivalent:<br />
- adblock_subscriptions Adblock<br />
- autoquvi Video DownloadHelper<br />
- contenthandler (Handle requests based on MIME type, filename extension or URI scheme)<br />
- downloadhandler (Handle downloads based on mimetype or filename extension, useful if 'download-no-confirm' is set)<br />
- formfiller LastPass, Lazarus (Save form data and fill forms with previously saved data, also with gpg-support)<br />
- googlebookmarks GBookmarks, GMarks (Add bookmarks to google bookmarks with a shortcut)<br />
- googledocs Open with Google Docs, Google Docs Viewer<br />
- grabscrolling (Adobe Acrobat style grab and drag mouse scrolling)<br />
- multimarks (Bookmark multiple urls to a single quickmark)<br />
- navtools Opera Fast Forward, IE 10 Flip Ahead<br />
- perdomainsettings (Change webkit-settings automatically on domain or url basis)<br />
- pwdhash PwdHash<br />
- requestpolicy RequestPolicy, Disconnect, Ghostery<br />
- simplyread Readability, Clearly<br />
- speeddial Speed Dial<br />
- supergenpass (Generate domain-based passwords; compatible with the bookmarklet supergenpass but with additional options)<br />
- unique_tabs (Remove duplicate tabs or avoid duplicate tabs by autoswitching to tabs with same url)<br />
- userscripts GreaseMonkey/Stylish<br />
- whitelistshortcuts (Whitelist webkit settings for certain domains with a shortcut)<br />
}}<br />
<br />
For more details, use {{ic|dwbem -I <extension>}} and read the [http://portix.bitbucket.org/dwb/resources/dwb.1.html dwb] and [http://portix.bitbucket.org/dwb/resources/dwbem.1.html dwbem] man pages. To get more details on all available extensions use {{ic|<nowiki>for i in $(dwbem -a | awk '/-/ {print $NF}'); do dwbem -I $i; done</nowiki>}}.<br />
<br />
Below is a list of popular extensions (or add-ons) for which ''dwb'' has a built-in alternative:<br />
<br />
* NoScript/Flashblock: ''dwb'' blocks flash by default and can block javascript.<br />
* Omnibar: just like Chrome, ''dwb'''s address gives quick access to search, history, and bookmarks.<br />
* Download Statusbar: ''dwb'''s displays downloads in a neat status bar by default.<br />
* IE Tab: ''dwb'' can open a page in any external browser with a simple userscript.<br />
* Session Manager: ''dwb'' uses its built-in session manager by default.<br />
* Private browsing: add {{ic|xpp:toggle enable-private-browsing}} to {{ic|custom_keys}} to toggle privacy mode by typing {{ic|xpp}}.<br />
<br />
=== Adblock ===<br />
<br />
''dwb'' features an Adblock extension. Install it with<br />
<br />
$ dwbem -i adblock_subscriptions<br />
<br />
Restart ''dwb'', enable adblocker with {{ic|:set adblocker true}}, use the ''adblock_subscribe'' command and choose your favorite filter (avoid using more than one filter to prevent duplicate entries that make the adblocker much slower). After that you also need to make the changes active with the ''adblock_update'' command.<br />
<br />
== Userscripts ==<br />
<br />
''dwb'' can execute .js or .sh scripts put in {{ic|~/.config/dwb/userscripts/}}. Make sure they are executable:<br />
chmod +x ~/.config/dwb/userscripts/myscript.js<br />
<br />
Below are some example scripts, see ''dwb'' [http://portix.bitbucket.org/dwb/snippets/snippets.html userscripts snippets] for more:<br />
<br />
=== defer-loading ===<br />
<br />
Prevents tabs from last session to load all at once at startup.<br />
{{hc|~/.config/dwb/userscripts/defer-loading.js|<nowiki><br />
//!javascript<br />
if (settings.loadOnFocus === false) {<br />
execute('local_set load-on-focus true');<br />
}<br />
Signal.connect('navigation', function(webview) {<br />
if (webview == tabs.current) {<br />
execute('local_set load-on-focus false');<br />
this.disconnect();<br />
}<br />
});</nowiki>}}<br />
<br />
=== fast-forward ===<br />
<br />
Opera features a neat key binding which allows users to load to next/previous logical page. This is very useful for forum threads, documentation, and articles spread over several pages.<br />
<br />
This feature can be implemented with a simple javascript function and bound to custom keys {{ic|<nowiki>}</nowiki>}} and {{ic|{}}:<br />
<br />
{{hc|~/.config/dwb/default/custom_keys|<nowiki><br />
}:exja (function(){var e=document.querySelector("[rel='next']");if(e){location=e.href;}else{var f=document.getElementsByTagName("a");var i=f.length;while((e=f[--i])){if(e.text.search(/(\bnext\b|^>$|^(>>|»)$|^(>|»)|(>|»)$|\bmore\b)/i)>-1){location=e.href; break;}} location.href=location.href.replace(/(\d+)([^\/\d]*)$/, function(a,b,c){return ++b+c})}})();<br />
{:exja (function(){var e=document.querySelector("[rel='prev']");if(e){location=e.href;}else{var f=document.getElementsByTagName("a");var i=f.length;while((e=f[--i])){if(e.text.search(/(\b(prev|previous)\b|^<$|^(<<|«)$|^(<|«)|(<|«)$)/i)>-1){location=e.href;break;}} location.href=location.href.replace(/(\d+)([^\/\d]*)$/, function(a,b,c){return --b+c})}})();<br />
</nowiki>}}<br />
<br />
Alternatively, the {{ic|navtools}} extension provides the same functionality and more, such as going up one directory, or loading the root URI.<br />
<br />
=== open-firefox ===<br />
Opens current page in Firefox with {{ic|xf}} (uses {{Pkg|firefox}} and {{Pkg|libnotify}}).<br />
{{hc|~/.config/dwb/userscripts/open-firefox.sh|<nowiki><br />
#!/bin/bash<br />
# dwb: xf<br />
firefox $DWB_URI &<br />
notify-send -u low "Firefox opening $DWB_URI" #optional notification<br />
</nowiki>}}<br />
<br />
=== startup-noautoreload ===<br />
<br />
Prevents previously-opened tabs from reloading all at once after a restart.<br />
{{hc|~/.config/dwb/userscripts/startup-noautoreload.js|<nowiki><br />
//!javascript<br />
// prevents previously-opened tabs from reloading all at once after a restart.<br />
execute("set load-on-focus true");<br />
<br />
var sigId = Signal.connect("navigation", function(wv) {<br />
if (wv == tabs.current)<br />
{<br />
execute("set load-on-focus false");<br />
Signal.disconnect(sigId);<br />
}<br />
});</nowiki>}}<br />
<br />
=== toggle-stylesheet ===<br />
<br />
Toggles between 2 global stylesheets with {{ic|xg}}.<br />
{{hc|~/.config/dwb/userscripts/toggle-stylesheet.sh|<nowiki><br />
#!/bin/bash<br />
# dwb:xg<br />
<br />
CURRENT_STYLESHEET="$(dwbremote get setting user-stylesheet-uri)"<br />
<br />
STYLESHEET_1="file://$HOME/.config/dwb/stylesheets/foo.css"<br />
STYLESHEET_2="file://$HOME/.config/dwb/stylesheets/bar.css"<br />
<br />
if [[ "${CURRENT_STYLESHEET}" = ${STYLESHEET_1} ]]; then<br />
dwbremote :local_set user-stylesheet-uri "$STYLESHEET_2"<br />
else <br />
dwbremote :local_set user-stylesheet-uri "$STYLESHEET_1"<br />
fi</nowiki>}}<br />
<br />
=== youtube-player ===<br />
<br />
Opens YouTube videos with MPlayer (uses {{Pkg|mplayer}} and {{Pkg|youtube-dl}}).<br />
{{hc|~/.config/dwb/userscripts/youtube-mplayer.js|<nowiki><br />
//!javascript <br />
// opens YouTube videos with mplayer.<br />
var regex = new RegExp("http(.*)://www.youtube.com/watch\\?(.*&)*v=.*");<br />
<br />
Signal.connect("navigation", function (wv, frame, request) {<br />
if (wv.mainFrame == frame && regex.test(request.uri)) <br />
system.spawn("sh -c 'mplayer \"$(youtube-dl -g " + request.uri + ")\"'");<br />
return false;<br />
});</nowiki>}}<br />
<br />
=== MPVideo ===<br />
<br />
Slight modification of above script, this opens videos from You Tube, Dailymotion, Vodlocker and more with mpv. (uses {{Pkg|mpv}} and {{Pkg|youtube-dl}}).<br />
{{hc|~/.config/dwb/userscripts/MPVideo.js|<nowiki><br />
//!javascript <br />
// opens videos from You Tube, Dailymotion, Vodlocker and many more with mpv.<br />
<br />
function playInMplayer() {<br />
system.spawn("sh -c 'mpv \"$(youtube-dl -g " + tabs.current.uri + ")\"'");<br />
}<br />
function downloadVideo() {<br />
system.spawn("sh -c 'xterm -e \"youtube-dl " + tabs.current.uri + "\"'");<br />
}<br />
bind("mp", playInMplayer, "play_in_mplayer");<br />
bind(null, downloadVideo, "download_video");<br />
</nowiki>}}<br />
<br />
=== rocker gestures ===<br />
<br />
Enables Opera-like rocker gestures for navigating the history. Disable the context menu in the settings first.<br />
{{hc|~/.config/dwb/userscripts/rocker.js|<nowiki><br />
//!javascript<br />
var LMB = 1, MMB=2, RMB = 3, UNKNOWN = 10, DOWN = 11, UP = 12;<br />
<br />
var buttonStates = [UNKNOWN, UNKNOWN, UNKNOWN, UNKNOWN, UNKNOWN, UNKNOWN];<br />
var bp = new Signal("onButtonPress", function(wv, result, ev) {<br />
var mouseButton = ev.button;<br />
<br />
buttonStates[mouseButton] = DOWN;<br />
<br />
if (mouseButton == LMB && buttonStates[RMB] == DOWN) {<br />
execute("history_back");<br />
} else if (mouseButton == RMB && buttonStates[LMB] == DOWN) {<br />
execute("history_forward");<br />
}<br />
});<br />
var br = new Signal("onButtonRelease", function(wv, result, ev) {<br />
buttonStates[ev.button] = UP;<br />
});<br />
<br />
bp.connect();<br />
br.connect();</nowiki>}}<br />
<br />
== Stylesheet ==<br />
<br />
a global stylesheet can be defined in the Settings, under {{ic|user-stylesheet-uri}} (i.e. {{ic|file:///home/tux/.config/dwb/stylesheet.css}})<br />
<br />
If you browse with the status bar hidden and are annoyed by the the link previews that appear while hovering over links with the mouse, add this to the stylesheet: {{ic|#dwb_hover_element { display:none!important; }}}<br />
<br />
== Troubleshooting ==<br />
<br />
=== Search engines search for ''undefined'' ===<br />
<br />
If you are always searching for ''undefined'' even with the {{ic|searchengine-submit-pattern}} option set, then you should edit {{ic|$XDG_CONFIG_HOME/dwb/searchengines}} and adapt the URIs to match your {{ic|searchengine-submit-pattern}}.<br />
<br />
=== Fuzzy font in Github ===<br />
<br />
Install {{Pkg|ttf-freefont}} or add this in your {{ic|~/.config/fontconfig/fonts.conf}} inside the fontconfig-tags:<br />
<br />
<selectfont><br />
<rejectfont><br />
<pattern><br />
<patelt name="family"><br />
<string>Clean</string><br />
</patelt><br />
</pattern><br />
</rejectfont><br />
</selectfont><br />
<br />
If above solution doesn't help try to remove {{ic|xorg-fonts-75dpi}} and {{ic|xorg-fonts-100dpi}} packages.<br />
<br />
=== HTML5 media ===<br />
<br />
See [[Browser plugins#Multimedia playback]].<br />
<br />
== dwb-git ==<br />
<br />
{{AUR|dwb-git}} offers many improvements over the stable version, the most notable of which are listed below.<br />
<br />
{{Note|As of May 4th, 2015, the official {{Pkg|dwb}} package should contain all those features, and more.}}<br />
<br />
=== Plugin Support ===<br />
<br />
Browser Plugins can be enabled and disabled through the new [dwb:plugins dwb:plugins] settings page. Other [[Browser plugins]] may be supported as well, but these two alone will make your dwb experience much more enjoyable.<br />
<br />
==== Flash Support ====<br />
<br />
{{AUR|dwb-git}} has built in support for the {{Pkg|flashplugin}}. Dwb should auto-detect and enabled the plugin after it is installed. Alternatively, you can install {{Aur|gnash-gtk}}{{Broken package link|package not found}} and it will be detected as well.<br />
<br />
==== Java Support ====<br />
<br />
{{AUR|dwb-git}} has built in support for the {{Pkg|icedtea-web}}. Dwb should auto-detect and enable the plugin after it is installed.<br />
<br />
=== Improved Ability to Display Websites ===<br />
<br />
If you are having problems with they layout of websites not loading correctly then give {{AUR|dwb-git}} a shot.</div>Cirrushttps://wiki.archlinux.org/index.php?title=Dwb&diff=446811Dwb2016-08-16T20:18:01Z<p>Cirrus: /* MPVideo */ fix</p>
<hr />
<div>{{DISPLAYTITLE:dwb}}<br />
[[Category:Web browser]]<br />
[[de:dwb]]<br />
[[fr:dwb]]<br />
[[ja:dwb]]<br />
[http://portix.bitbucket.org/dwb/ dwb] is a lightweight and flexible web browser using the webkit engine. It is customizable through its web interface and fully usable with keyboard shortcuts.<br />
<br />
== Installation ==<br />
<br />
The {{Pkg|dwb}} package can be found in the [[official repositories]] and can be installed with [[pacman]]. There are also other versions in the [[AUR]]: {{AUR|dwb-git}}, {{AUR|dwb-gtk3}}{{Broken package link|{{aur-mirror|dwb-gtk3}}}}, and {{AUR|dwb-gtk3-git}}{{Broken package link|{{aur-mirror|dwb-gtk3-git}}}}.<br />
<br />
== Basic usage ==<br />
<br />
Starting from a fresh configuration, use {{ic|Sk}} to open the ''Keys'' page. As you can see from there, most bindings are borrowed from [[Vim]] and [[Emacs]].<br />
<br />
Use {{ic|:}} to access the command prompt. You can use {{ic|Tab}} to auto-complete.<br />
<br />
Read the man page for more details and enable the {{ic|auto-completion}} option in the settings to help you learn the bindings.<br />
<br />
$ man dwb<br />
<br />
=== dwb-specific ===<br />
<br />
o = enter url<br />
O = enter url in new tab<br />
f = spawn hints. Use arrow keys to browse the hints while displaying their URI, or use the hint letters.<br />
F = spawn hints in new tab<br />
;b = spawn hints in new background tab<br />
;r = follow multiple background links rapidly<br />
H = back<br />
L = forward<br />
J = go to next tab<br />
K = go to previous tab<br />
'n'+T = goto 'n' tab<br />
d = close tab<br />
u = undo close tab<br />
ctrl+s = stop<br />
r = reload<br />
R = reload ignoring cache<br />
gi = go to the first input field, doesn't enter input mode, use 'i' for that, so 'gi'+'i'<br />
ctrl+e = open editable field in external editor. Useful for forums and wikis.<br />
;d = download via hints<br />
M = save bookmark (bookmarks are saved in ~/.config/dwb/default/bookmarks)<br />
xb = show/hide status bar<br />
gf = toggle source view<br />
+ = zoom_in<br />
- = zoom_out<br />
= = reset to 100%<br />
<br />
=== vim-like ===<br />
<br />
i = toggle_insert_mode (Esc works to go back to normal mode much like Vim)<br />
Esc = back to normal mode (ctrl+n works too)<br />
j = scroll down<br />
k = scroll up<br />
h = scroll left<br />
l = scroll right<br />
gg = go to top<br />
G = go to bottom<br />
/ = find in page<br />
n = repeat find forward<br />
ZZ = save session and exit<br />
<br />
=== Notes ===<br />
<br />
Press {{ic|v}} to switch to caret browsing, then press {{ic|space}} to toggle between caret and visual mode. Press {{ic|Esc}} one or two times to go back to normal mode. While in caret browsing, you can use the arrow keys to browse the different parts of the page. Hold {{ic|Shift}} to select text. Press {{ic|Enter}} to follow links.<br />
<br />
== Configuration ==<br />
<br />
The configuration files are stored in {{ic|$XDG_CONFIG_HOME/dwb/}} (usually {{ic| ~/.config/dwb/}}) and can be easily accessed through the web interface. Type {{ic|Ss}} to open the ''Settings'' page.<br />
<br />
=== Search engines ===<br />
<br />
Open your favorite search engine, type {{ic|gs}} to select the web page's first input field, and then enter a keyword associated with it. <br />
<br />
Now you can use the keyword in the URI prompt to search directly on the corresponding website. Typing queries directly in the address bar will search with the default search engine, which is the first entry in {{ic|$XDG_CONFIG_HOME/dwb/searchengines}}.<br />
<br />
You can also add more by editing the configuration files. This may help for tricky sites like rfc-editor.org.<br />
<br />
{{hc|.config/dwb/settings|2=<br />
searchengine-submit-pattern=XXX<br />
}}<br />
<br />
{{hc|.config/dwb/searchengines|<nowiki><br />
sp https://startpage.com/do/search?q=XXX<br />
wp https://en.wikipedia.org/w/index.php?search=XXX&title=Special:Search<br />
aw https://wiki.archlinux.org/index.php?title=Special:Search&search=XXX<br />
rfc http://www.rfc-editor.org/search/rfc_search_detail.php?rfc=&title=XXX<br />
</nowiki>}}<br />
<br />
=== keys ===<br />
Standard keybinds can be edited by executing {{ic|:open dwb:keys}} (opening dwb:keys as a webpage). Settings are saved as soon as a value is changed and the element loses focus or the return key is pressed. This is reported in the status bar. Combinations of keys are separated with a space. Some less vim-like keys could be defined by:<br />
<br />
{{hc|dwb:keys|<nowiki><br />
history_back Go back Mod1 @Left@<br />
history_forward Go forward Mod1 @Right@<br />
</nowiki>}}<br />
<br />
This same format is used below for custom keybinds.<br />
<br />
=== Custom keybinds ===<br />
<br />
You can create custom key bindings by editing file {{ic|custom_keys}} in the profile directory. This is<br />
{{ic|~/.config/dwb/default}} by default. All keysyms which do not emit (multi)byte characters, must be enclosed in {{ic|@}}. One keybind can execute multiple ''dwb'' commands. These commands execute in same order as they are defined in bind, and must be separated by {{ic|;;}} separator. If the keybind's chord is already bound by ''dwb'', it might be ignored (behaviour is not consistent). In such case one can try to check, whether there is collison with binds defined in {{ic|~/.config/dwb/keys}} and try to unbind the chord there (eg set it to nothing). Any running ''dwb'' instance will owerwrite {{ic|keys}} file on exit, so remember to do your modifications while ''dwb'' is not runing or use default ''dwb'' interface ({{ic|Sk}}).<br />
<br />
{{hc|~/.config/dwb/default/custom_keys|<nowiki><br />
Control w :close_tab<br />
Control @Page_Up@ :focus_prev<br />
Control @Page_Down@ :focus_next<br />
</nowiki>}}<br />
<br />
== Extensions ==<br />
<br />
''dwb'' features an extension manager as a separate executable, ''dwbem''. To list all officially available extensions, use:<br />
<br />
{{hc|dwbem -a|<br />
Available extensions: Mainstream equivalent:<br />
- adblock_subscriptions Adblock<br />
- autoquvi Video DownloadHelper<br />
- contenthandler (Handle requests based on MIME type, filename extension or URI scheme)<br />
- downloadhandler (Handle downloads based on mimetype or filename extension, useful if 'download-no-confirm' is set)<br />
- formfiller LastPass, Lazarus (Save form data and fill forms with previously saved data, also with gpg-support)<br />
- googlebookmarks GBookmarks, GMarks (Add bookmarks to google bookmarks with a shortcut)<br />
- googledocs Open with Google Docs, Google Docs Viewer<br />
- grabscrolling (Adobe Acrobat style grab and drag mouse scrolling)<br />
- multimarks (Bookmark multiple urls to a single quickmark)<br />
- navtools Opera Fast Forward, IE 10 Flip Ahead<br />
- perdomainsettings (Change webkit-settings automatically on domain or url basis)<br />
- pwdhash PwdHash<br />
- requestpolicy RequestPolicy, Disconnect, Ghostery<br />
- simplyread Readability, Clearly<br />
- speeddial Speed Dial<br />
- supergenpass (Generate domain-based passwords; compatible with the bookmarklet supergenpass but with additional options)<br />
- unique_tabs (Remove duplicate tabs or avoid duplicate tabs by autoswitching to tabs with same url)<br />
- userscripts GreaseMonkey/Stylish<br />
- whitelistshortcuts (Whitelist webkit settings for certain domains with a shortcut)<br />
}}<br />
<br />
For more details, use {{ic|dwbem -I <extension>}} and read the [http://portix.bitbucket.org/dwb/resources/dwb.1.html dwb] and [http://portix.bitbucket.org/dwb/resources/dwbem.1.html dwbem] man pages. To get more details on all available extensions use {{ic|<nowiki>for i in $(dwbem -a | awk '/-/ {print $NF}'); do dwbem -I $i; done</nowiki>}}.<br />
<br />
Below is a list of popular extensions (or add-ons) for which ''dwb'' has a built-in alternative:<br />
<br />
* NoScript/Flashblock: ''dwb'' blocks flash by default and can block javascript.<br />
* Omnibar: just like Chrome, ''dwb'''s address gives quick access to search, history, and bookmarks.<br />
* Download Statusbar: ''dwb'''s displays downloads in a neat status bar by default.<br />
* IE Tab: ''dwb'' can open a page in any external browser with a simple userscript.<br />
* Session Manager: ''dwb'' uses its built-in session manager by default.<br />
* Private browsing: add {{ic|xpp:toggle enable-private-browsing}} to {{ic|custom_keys}} to toggle privacy mode by typing {{ic|xpp}}.<br />
<br />
=== Adblock ===<br />
<br />
''dwb'' features an Adblock extension. Install it with<br />
<br />
$ dwbem -i adblock_subscriptions<br />
<br />
Restart ''dwb'', enable adblocker with {{ic|:set adblocker true}}, use the ''adblock_subscribe'' command and choose your favorite filter (avoid using more than one filter to prevent duplicate entries that make the adblocker much slower). After that you also need to make the changes active with the ''adblock_update'' command.<br />
<br />
== Userscripts ==<br />
<br />
''dwb'' can execute .js or .sh scripts put in {{ic|~/.config/dwb/userscripts/}}. Make sure they are executable:<br />
chmod +x ~/.config/dwb/userscripts/myscript.js<br />
<br />
Below are some example scripts, see ''dwb'' [http://portix.bitbucket.org/dwb/snippets/snippets.html userscripts snippets] for more:<br />
<br />
=== defer-loading ===<br />
<br />
Prevents tabs from last session to load all at once at startup.<br />
{{hc|~/.config/dwb/userscripts/defer-loading.js|<nowiki><br />
//!javascript<br />
if (settings.loadOnFocus === false) {<br />
execute('local_set load-on-focus true');<br />
}<br />
Signal.connect('navigation', function(webview) {<br />
if (webview == tabs.current) {<br />
execute('local_set load-on-focus false');<br />
this.disconnect();<br />
}<br />
});</nowiki>}}<br />
<br />
=== fast-forward ===<br />
<br />
Opera features a neat key binding which allows users to load to next/previous logical page. This is very useful for forum threads, documentation, and articles spread over several pages.<br />
<br />
This feature can be implemented with a simple javascript function and bound to custom keys {{ic|<nowiki>}</nowiki>}} and {{ic|{}}:<br />
<br />
{{hc|~/.config/dwb/default/custom_keys|<nowiki><br />
}:exja (function(){var e=document.querySelector("[rel='next']");if(e){location=e.href;}else{var f=document.getElementsByTagName("a");var i=f.length;while((e=f[--i])){if(e.text.search(/(\bnext\b|^>$|^(>>|»)$|^(>|»)|(>|»)$|\bmore\b)/i)>-1){location=e.href; break;}} location.href=location.href.replace(/(\d+)([^\/\d]*)$/, function(a,b,c){return ++b+c})}})();<br />
{:exja (function(){var e=document.querySelector("[rel='prev']");if(e){location=e.href;}else{var f=document.getElementsByTagName("a");var i=f.length;while((e=f[--i])){if(e.text.search(/(\b(prev|previous)\b|^<$|^(<<|«)$|^(<|«)|(<|«)$)/i)>-1){location=e.href;break;}} location.href=location.href.replace(/(\d+)([^\/\d]*)$/, function(a,b,c){return --b+c})}})();<br />
</nowiki>}}<br />
<br />
Alternatively, the {{ic|navtools}} extension provides the same functionality and more, such as going up one directory, or loading the root URI.<br />
<br />
=== open-firefox ===<br />
Opens current page in Firefox with {{ic|xf}} (uses {{Pkg|firefox}} and {{Pkg|libnotify}}).<br />
{{hc|~/.config/dwb/userscripts/open-firefox.sh|<nowiki><br />
#!/bin/bash<br />
# dwb: xf<br />
firefox $DWB_URI &<br />
notify-send -u low "Firefox opening $DWB_URI" #optional notification<br />
</nowiki>}}<br />
<br />
=== startup-noautoreload ===<br />
<br />
Prevents previously-opened tabs from reloading all at once after a restart.<br />
{{hc|~/.config/dwb/userscripts/startup-noautoreload.js|<nowiki><br />
//!javascript<br />
// prevents previously-opened tabs from reloading all at once after a restart.<br />
execute("set load-on-focus true");<br />
<br />
var sigId = Signal.connect("navigation", function(wv) {<br />
if (wv == tabs.current)<br />
{<br />
execute("set load-on-focus false");<br />
Signal.disconnect(sigId);<br />
}<br />
});</nowiki>}}<br />
<br />
=== toggle-stylesheet ===<br />
<br />
Toggles between 2 global stylesheets with {{ic|xg}}.<br />
{{hc|~/.config/dwb/userscripts/toggle-stylesheet.sh|<nowiki><br />
#!/bin/bash<br />
# dwb:xg<br />
<br />
CURRENT_STYLESHEET="$(dwbremote get setting user-stylesheet-uri)"<br />
<br />
STYLESHEET_1="file://$HOME/.config/dwb/stylesheets/foo.css"<br />
STYLESHEET_2="file://$HOME/.config/dwb/stylesheets/bar.css"<br />
<br />
if [[ "${CURRENT_STYLESHEET}" = ${STYLESHEET_1} ]]; then<br />
dwbremote :local_set user-stylesheet-uri "$STYLESHEET_2"<br />
else <br />
dwbremote :local_set user-stylesheet-uri "$STYLESHEET_1"<br />
fi</nowiki>}}<br />
<br />
=== youtube-player ===<br />
<br />
Opens YouTube videos with MPlayer (uses {{Pkg|mplayer}} and {{Pkg|youtube-dl}}).<br />
{{hc|~/.config/dwb/userscripts/youtube-mplayer.js|<nowiki><br />
//!javascript <br />
// opens YouTube videos with mplayer.<br />
var regex = new RegExp("http(.*)://www.youtube.com/watch\\?(.*&)*v=.*");<br />
<br />
Signal.connect("navigation", function (wv, frame, request) {<br />
if (wv.mainFrame == frame && regex.test(request.uri)) <br />
system.spawn("sh -c 'mplayer \"$(youtube-dl -g " + request.uri + ")\"'");<br />
return false;<br />
});</nowiki>}}<br />
<br />
=== MPVideo ===<br />
<br />
Slight modification of above script, this opens videos from You Tube, Dailymotion, Vodlocker and more with mpv. (uses {{Pkg|mpv}} and {{Pkg|youtube-dl}}).<br />
{{hc|~/.config/dwb/userscripts/MPVideo.js|<nowiki><br />
//!javascript <br />
// opens videos from You Tube, Dailymotion, Vodlocker and many with mpv.<br />
<br />
function playInMplayer() {<br />
system.spawn("sh -c 'mpv \"$(youtube-dl -g " + tabs.current.uri + ")\"'");<br />
}<br />
function downloadVideo() {<br />
system.spawn("sh -c 'xterm -e \"youtube-dl " + tabs.current.uri + "\"'");<br />
}<br />
bind("mp", playInMplayer, "play_in_mplayer");<br />
bind(null, downloadVideo, "download_video");<br />
</nowiki>}}<br />
<br />
=== rocker gestures ===<br />
<br />
Enables Opera-like rocker gestures for navigating the history. Disable the context menu in the settings first.<br />
{{hc|~/.config/dwb/userscripts/rocker.js|<nowiki><br />
//!javascript<br />
var LMB = 1, MMB=2, RMB = 3, UNKNOWN = 10, DOWN = 11, UP = 12;<br />
<br />
var buttonStates = [UNKNOWN, UNKNOWN, UNKNOWN, UNKNOWN, UNKNOWN, UNKNOWN];<br />
var bp = new Signal("onButtonPress", function(wv, result, ev) {<br />
var mouseButton = ev.button;<br />
<br />
buttonStates[mouseButton] = DOWN;<br />
<br />
if (mouseButton == LMB && buttonStates[RMB] == DOWN) {<br />
execute("history_back");<br />
} else if (mouseButton == RMB && buttonStates[LMB] == DOWN) {<br />
execute("history_forward");<br />
}<br />
});<br />
var br = new Signal("onButtonRelease", function(wv, result, ev) {<br />
buttonStates[ev.button] = UP;<br />
});<br />
<br />
bp.connect();<br />
br.connect();</nowiki>}}<br />
<br />
== Stylesheet ==<br />
<br />
a global stylesheet can be defined in the Settings, under {{ic|user-stylesheet-uri}} (i.e. {{ic|file:///home/tux/.config/dwb/stylesheet.css}})<br />
<br />
If you browse with the status bar hidden and are annoyed by the the link previews that appear while hovering over links with the mouse, add this to the stylesheet: {{ic|#dwb_hover_element { display:none!important; }}}<br />
<br />
== Troubleshooting ==<br />
<br />
=== Search engines search for ''undefined'' ===<br />
<br />
If you are always searching for ''undefined'' even with the {{ic|searchengine-submit-pattern}} option set, then you should edit {{ic|$XDG_CONFIG_HOME/dwb/searchengines}} and adapt the URIs to match your {{ic|searchengine-submit-pattern}}.<br />
<br />
=== Fuzzy font in Github ===<br />
<br />
Install {{Pkg|ttf-freefont}} or add this in your {{ic|~/.config/fontconfig/fonts.conf}} inside the fontconfig-tags:<br />
<br />
<selectfont><br />
<rejectfont><br />
<pattern><br />
<patelt name="family"><br />
<string>Clean</string><br />
</patelt><br />
</pattern><br />
</rejectfont><br />
</selectfont><br />
<br />
If above solution doesn't help try to remove {{ic|xorg-fonts-75dpi}} and {{ic|xorg-fonts-100dpi}} packages.<br />
<br />
=== HTML5 media ===<br />
<br />
See [[Browser plugins#Multimedia playback]].<br />
<br />
== dwb-git ==<br />
<br />
{{AUR|dwb-git}} offers many improvements over the stable version, the most notable of which are listed below.<br />
<br />
{{Note|As of May 4th, 2015, the official {{Pkg|dwb}} package should contain all those features, and more.}}<br />
<br />
=== Plugin Support ===<br />
<br />
Browser Plugins can be enabled and disabled through the new [dwb:plugins dwb:plugins] settings page. Other [[Browser plugins]] may be supported as well, but these two alone will make your dwb experience much more enjoyable.<br />
<br />
==== Flash Support ====<br />
<br />
{{AUR|dwb-git}} has built in support for the {{Pkg|flashplugin}}. Dwb should auto-detect and enabled the plugin after it is installed. Alternatively, you can install {{Aur|gnash-gtk}}{{Broken package link|package not found}} and it will be detected as well.<br />
<br />
==== Java Support ====<br />
<br />
{{AUR|dwb-git}} has built in support for the {{Pkg|icedtea-web}}. Dwb should auto-detect and enable the plugin after it is installed.<br />
<br />
=== Improved Ability to Display Websites ===<br />
<br />
If you are having problems with they layout of websites not loading correctly then give {{AUR|dwb-git}} a shot.</div>Cirrushttps://wiki.archlinux.org/index.php?title=Dwb&diff=446810Dwb2016-08-16T20:14:49Z<p>Cirrus: just enhaced youtube-player script to work with you tube and other video streaming services</p>
<hr />
<div>{{DISPLAYTITLE:dwb}}<br />
[[Category:Web browser]]<br />
[[de:dwb]]<br />
[[fr:dwb]]<br />
[[ja:dwb]]<br />
[http://portix.bitbucket.org/dwb/ dwb] is a lightweight and flexible web browser using the webkit engine. It is customizable through its web interface and fully usable with keyboard shortcuts.<br />
<br />
== Installation ==<br />
<br />
The {{Pkg|dwb}} package can be found in the [[official repositories]] and can be installed with [[pacman]]. There are also other versions in the [[AUR]]: {{AUR|dwb-git}}, {{AUR|dwb-gtk3}}{{Broken package link|{{aur-mirror|dwb-gtk3}}}}, and {{AUR|dwb-gtk3-git}}{{Broken package link|{{aur-mirror|dwb-gtk3-git}}}}.<br />
<br />
== Basic usage ==<br />
<br />
Starting from a fresh configuration, use {{ic|Sk}} to open the ''Keys'' page. As you can see from there, most bindings are borrowed from [[Vim]] and [[Emacs]].<br />
<br />
Use {{ic|:}} to access the command prompt. You can use {{ic|Tab}} to auto-complete.<br />
<br />
Read the man page for more details and enable the {{ic|auto-completion}} option in the settings to help you learn the bindings.<br />
<br />
$ man dwb<br />
<br />
=== dwb-specific ===<br />
<br />
o = enter url<br />
O = enter url in new tab<br />
f = spawn hints. Use arrow keys to browse the hints while displaying their URI, or use the hint letters.<br />
F = spawn hints in new tab<br />
;b = spawn hints in new background tab<br />
;r = follow multiple background links rapidly<br />
H = back<br />
L = forward<br />
J = go to next tab<br />
K = go to previous tab<br />
'n'+T = goto 'n' tab<br />
d = close tab<br />
u = undo close tab<br />
ctrl+s = stop<br />
r = reload<br />
R = reload ignoring cache<br />
gi = go to the first input field, doesn't enter input mode, use 'i' for that, so 'gi'+'i'<br />
ctrl+e = open editable field in external editor. Useful for forums and wikis.<br />
;d = download via hints<br />
M = save bookmark (bookmarks are saved in ~/.config/dwb/default/bookmarks)<br />
xb = show/hide status bar<br />
gf = toggle source view<br />
+ = zoom_in<br />
- = zoom_out<br />
= = reset to 100%<br />
<br />
=== vim-like ===<br />
<br />
i = toggle_insert_mode (Esc works to go back to normal mode much like Vim)<br />
Esc = back to normal mode (ctrl+n works too)<br />
j = scroll down<br />
k = scroll up<br />
h = scroll left<br />
l = scroll right<br />
gg = go to top<br />
G = go to bottom<br />
/ = find in page<br />
n = repeat find forward<br />
ZZ = save session and exit<br />
<br />
=== Notes ===<br />
<br />
Press {{ic|v}} to switch to caret browsing, then press {{ic|space}} to toggle between caret and visual mode. Press {{ic|Esc}} one or two times to go back to normal mode. While in caret browsing, you can use the arrow keys to browse the different parts of the page. Hold {{ic|Shift}} to select text. Press {{ic|Enter}} to follow links.<br />
<br />
== Configuration ==<br />
<br />
The configuration files are stored in {{ic|$XDG_CONFIG_HOME/dwb/}} (usually {{ic| ~/.config/dwb/}}) and can be easily accessed through the web interface. Type {{ic|Ss}} to open the ''Settings'' page.<br />
<br />
=== Search engines ===<br />
<br />
Open your favorite search engine, type {{ic|gs}} to select the web page's first input field, and then enter a keyword associated with it. <br />
<br />
Now you can use the keyword in the URI prompt to search directly on the corresponding website. Typing queries directly in the address bar will search with the default search engine, which is the first entry in {{ic|$XDG_CONFIG_HOME/dwb/searchengines}}.<br />
<br />
You can also add more by editing the configuration files. This may help for tricky sites like rfc-editor.org.<br />
<br />
{{hc|.config/dwb/settings|2=<br />
searchengine-submit-pattern=XXX<br />
}}<br />
<br />
{{hc|.config/dwb/searchengines|<nowiki><br />
sp https://startpage.com/do/search?q=XXX<br />
wp https://en.wikipedia.org/w/index.php?search=XXX&title=Special:Search<br />
aw https://wiki.archlinux.org/index.php?title=Special:Search&search=XXX<br />
rfc http://www.rfc-editor.org/search/rfc_search_detail.php?rfc=&title=XXX<br />
</nowiki>}}<br />
<br />
=== keys ===<br />
Standard keybinds can be edited by executing {{ic|:open dwb:keys}} (opening dwb:keys as a webpage). Settings are saved as soon as a value is changed and the element loses focus or the return key is pressed. This is reported in the status bar. Combinations of keys are separated with a space. Some less vim-like keys could be defined by:<br />
<br />
{{hc|dwb:keys|<nowiki><br />
history_back Go back Mod1 @Left@<br />
history_forward Go forward Mod1 @Right@<br />
</nowiki>}}<br />
<br />
This same format is used below for custom keybinds.<br />
<br />
=== Custom keybinds ===<br />
<br />
You can create custom key bindings by editing file {{ic|custom_keys}} in the profile directory. This is<br />
{{ic|~/.config/dwb/default}} by default. All keysyms which do not emit (multi)byte characters, must be enclosed in {{ic|@}}. One keybind can execute multiple ''dwb'' commands. These commands execute in same order as they are defined in bind, and must be separated by {{ic|;;}} separator. If the keybind's chord is already bound by ''dwb'', it might be ignored (behaviour is not consistent). In such case one can try to check, whether there is collison with binds defined in {{ic|~/.config/dwb/keys}} and try to unbind the chord there (eg set it to nothing). Any running ''dwb'' instance will owerwrite {{ic|keys}} file on exit, so remember to do your modifications while ''dwb'' is not runing or use default ''dwb'' interface ({{ic|Sk}}).<br />
<br />
{{hc|~/.config/dwb/default/custom_keys|<nowiki><br />
Control w :close_tab<br />
Control @Page_Up@ :focus_prev<br />
Control @Page_Down@ :focus_next<br />
</nowiki>}}<br />
<br />
== Extensions ==<br />
<br />
''dwb'' features an extension manager as a separate executable, ''dwbem''. To list all officially available extensions, use:<br />
<br />
{{hc|dwbem -a|<br />
Available extensions: Mainstream equivalent:<br />
- adblock_subscriptions Adblock<br />
- autoquvi Video DownloadHelper<br />
- contenthandler (Handle requests based on MIME type, filename extension or URI scheme)<br />
- downloadhandler (Handle downloads based on mimetype or filename extension, useful if 'download-no-confirm' is set)<br />
- formfiller LastPass, Lazarus (Save form data and fill forms with previously saved data, also with gpg-support)<br />
- googlebookmarks GBookmarks, GMarks (Add bookmarks to google bookmarks with a shortcut)<br />
- googledocs Open with Google Docs, Google Docs Viewer<br />
- grabscrolling (Adobe Acrobat style grab and drag mouse scrolling)<br />
- multimarks (Bookmark multiple urls to a single quickmark)<br />
- navtools Opera Fast Forward, IE 10 Flip Ahead<br />
- perdomainsettings (Change webkit-settings automatically on domain or url basis)<br />
- pwdhash PwdHash<br />
- requestpolicy RequestPolicy, Disconnect, Ghostery<br />
- simplyread Readability, Clearly<br />
- speeddial Speed Dial<br />
- supergenpass (Generate domain-based passwords; compatible with the bookmarklet supergenpass but with additional options)<br />
- unique_tabs (Remove duplicate tabs or avoid duplicate tabs by autoswitching to tabs with same url)<br />
- userscripts GreaseMonkey/Stylish<br />
- whitelistshortcuts (Whitelist webkit settings for certain domains with a shortcut)<br />
}}<br />
<br />
For more details, use {{ic|dwbem -I <extension>}} and read the [http://portix.bitbucket.org/dwb/resources/dwb.1.html dwb] and [http://portix.bitbucket.org/dwb/resources/dwbem.1.html dwbem] man pages. To get more details on all available extensions use {{ic|<nowiki>for i in $(dwbem -a | awk '/-/ {print $NF}'); do dwbem -I $i; done</nowiki>}}.<br />
<br />
Below is a list of popular extensions (or add-ons) for which ''dwb'' has a built-in alternative:<br />
<br />
* NoScript/Flashblock: ''dwb'' blocks flash by default and can block javascript.<br />
* Omnibar: just like Chrome, ''dwb'''s address gives quick access to search, history, and bookmarks.<br />
* Download Statusbar: ''dwb'''s displays downloads in a neat status bar by default.<br />
* IE Tab: ''dwb'' can open a page in any external browser with a simple userscript.<br />
* Session Manager: ''dwb'' uses its built-in session manager by default.<br />
* Private browsing: add {{ic|xpp:toggle enable-private-browsing}} to {{ic|custom_keys}} to toggle privacy mode by typing {{ic|xpp}}.<br />
<br />
=== Adblock ===<br />
<br />
''dwb'' features an Adblock extension. Install it with<br />
<br />
$ dwbem -i adblock_subscriptions<br />
<br />
Restart ''dwb'', enable adblocker with {{ic|:set adblocker true}}, use the ''adblock_subscribe'' command and choose your favorite filter (avoid using more than one filter to prevent duplicate entries that make the adblocker much slower). After that you also need to make the changes active with the ''adblock_update'' command.<br />
<br />
== Userscripts ==<br />
<br />
''dwb'' can execute .js or .sh scripts put in {{ic|~/.config/dwb/userscripts/}}. Make sure they are executable:<br />
chmod +x ~/.config/dwb/userscripts/myscript.js<br />
<br />
Below are some example scripts, see ''dwb'' [http://portix.bitbucket.org/dwb/snippets/snippets.html userscripts snippets] for more:<br />
<br />
=== defer-loading ===<br />
<br />
Prevents tabs from last session to load all at once at startup.<br />
{{hc|~/.config/dwb/userscripts/defer-loading.js|<nowiki><br />
//!javascript<br />
if (settings.loadOnFocus === false) {<br />
execute('local_set load-on-focus true');<br />
}<br />
Signal.connect('navigation', function(webview) {<br />
if (webview == tabs.current) {<br />
execute('local_set load-on-focus false');<br />
this.disconnect();<br />
}<br />
});</nowiki>}}<br />
<br />
=== fast-forward ===<br />
<br />
Opera features a neat key binding which allows users to load to next/previous logical page. This is very useful for forum threads, documentation, and articles spread over several pages.<br />
<br />
This feature can be implemented with a simple javascript function and bound to custom keys {{ic|<nowiki>}</nowiki>}} and {{ic|{}}:<br />
<br />
{{hc|~/.config/dwb/default/custom_keys|<nowiki><br />
}:exja (function(){var e=document.querySelector("[rel='next']");if(e){location=e.href;}else{var f=document.getElementsByTagName("a");var i=f.length;while((e=f[--i])){if(e.text.search(/(\bnext\b|^>$|^(>>|»)$|^(>|»)|(>|»)$|\bmore\b)/i)>-1){location=e.href; break;}} location.href=location.href.replace(/(\d+)([^\/\d]*)$/, function(a,b,c){return ++b+c})}})();<br />
{:exja (function(){var e=document.querySelector("[rel='prev']");if(e){location=e.href;}else{var f=document.getElementsByTagName("a");var i=f.length;while((e=f[--i])){if(e.text.search(/(\b(prev|previous)\b|^<$|^(<<|«)$|^(<|«)|(<|«)$)/i)>-1){location=e.href;break;}} location.href=location.href.replace(/(\d+)([^\/\d]*)$/, function(a,b,c){return --b+c})}})();<br />
</nowiki>}}<br />
<br />
Alternatively, the {{ic|navtools}} extension provides the same functionality and more, such as going up one directory, or loading the root URI.<br />
<br />
=== open-firefox ===<br />
Opens current page in Firefox with {{ic|xf}} (uses {{Pkg|firefox}} and {{Pkg|libnotify}}).<br />
{{hc|~/.config/dwb/userscripts/open-firefox.sh|<nowiki><br />
#!/bin/bash<br />
# dwb: xf<br />
firefox $DWB_URI &<br />
notify-send -u low "Firefox opening $DWB_URI" #optional notification<br />
</nowiki>}}<br />
<br />
=== startup-noautoreload ===<br />
<br />
Prevents previously-opened tabs from reloading all at once after a restart.<br />
{{hc|~/.config/dwb/userscripts/startup-noautoreload.js|<nowiki><br />
//!javascript<br />
// prevents previously-opened tabs from reloading all at once after a restart.<br />
execute("set load-on-focus true");<br />
<br />
var sigId = Signal.connect("navigation", function(wv) {<br />
if (wv == tabs.current)<br />
{<br />
execute("set load-on-focus false");<br />
Signal.disconnect(sigId);<br />
}<br />
});</nowiki>}}<br />
<br />
=== toggle-stylesheet ===<br />
<br />
Toggles between 2 global stylesheets with {{ic|xg}}.<br />
{{hc|~/.config/dwb/userscripts/toggle-stylesheet.sh|<nowiki><br />
#!/bin/bash<br />
# dwb:xg<br />
<br />
CURRENT_STYLESHEET="$(dwbremote get setting user-stylesheet-uri)"<br />
<br />
STYLESHEET_1="file://$HOME/.config/dwb/stylesheets/foo.css"<br />
STYLESHEET_2="file://$HOME/.config/dwb/stylesheets/bar.css"<br />
<br />
if [[ "${CURRENT_STYLESHEET}" = ${STYLESHEET_1} ]]; then<br />
dwbremote :local_set user-stylesheet-uri "$STYLESHEET_2"<br />
else <br />
dwbremote :local_set user-stylesheet-uri "$STYLESHEET_1"<br />
fi</nowiki>}}<br />
<br />
=== youtube-player ===<br />
<br />
Opens YouTube videos with MPlayer (uses {{Pkg|mplayer}} and {{Pkg|youtube-dl}}).<br />
{{hc|~/.config/dwb/userscripts/youtube-mplayer.js|<nowiki><br />
//!javascript <br />
// opens YouTube videos with mplayer.<br />
var regex = new RegExp("http(.*)://www.youtube.com/watch\\?(.*&)*v=.*");<br />
<br />
Signal.connect("navigation", function (wv, frame, request) {<br />
if (wv.mainFrame == frame && regex.test(request.uri)) <br />
system.spawn("sh -c 'mplayer \"$(youtube-dl -g " + request.uri + ")\"'");<br />
return false;<br />
});</nowiki>}}<br />
<br />
=== MPVideo ===<br />
<br />
Slight modification of above script, this opens videos from You Tube, Dailymotion, Vodlocker and more with mpv. (uses {{Pkg|mpv}} and {{Pkg|youtube-dl}}).<br />
{{hc|~/.config/dwb/userscripts/MPVideo.js|<nowiki><br />
//!javascript <br />
// opens videos from You Tube, Dailymotion, Vodlocker and many with mpv.<br />
<br />
function playInMplayer() {<br />
system.spawn("sh -c 'mpv \"$(youtube-dl -g " + tabs.current.uri + ")\"'");<br />
}<br />
function downloadVideo() {<br />
system.spawn("sh -c 'xterm -e \"youtube-dl " + tabs.current.uri + "\"'");<br />
}<br />
bind("mp", playInMplayer, "play_in_mplayer");<br />
bind(null, downloadVideo, "download_video");<br />
});</nowiki>}}<br />
<br />
=== rocker gestures ===<br />
<br />
Enables Opera-like rocker gestures for navigating the history. Disable the context menu in the settings first.<br />
{{hc|~/.config/dwb/userscripts/rocker.js|<nowiki><br />
//!javascript<br />
var LMB = 1, MMB=2, RMB = 3, UNKNOWN = 10, DOWN = 11, UP = 12;<br />
<br />
var buttonStates = [UNKNOWN, UNKNOWN, UNKNOWN, UNKNOWN, UNKNOWN, UNKNOWN];<br />
var bp = new Signal("onButtonPress", function(wv, result, ev) {<br />
var mouseButton = ev.button;<br />
<br />
buttonStates[mouseButton] = DOWN;<br />
<br />
if (mouseButton == LMB && buttonStates[RMB] == DOWN) {<br />
execute("history_back");<br />
} else if (mouseButton == RMB && buttonStates[LMB] == DOWN) {<br />
execute("history_forward");<br />
}<br />
});<br />
var br = new Signal("onButtonRelease", function(wv, result, ev) {<br />
buttonStates[ev.button] = UP;<br />
});<br />
<br />
bp.connect();<br />
br.connect();</nowiki>}}<br />
<br />
== Stylesheet ==<br />
<br />
a global stylesheet can be defined in the Settings, under {{ic|user-stylesheet-uri}} (i.e. {{ic|file:///home/tux/.config/dwb/stylesheet.css}})<br />
<br />
If you browse with the status bar hidden and are annoyed by the the link previews that appear while hovering over links with the mouse, add this to the stylesheet: {{ic|#dwb_hover_element { display:none!important; }}}<br />
<br />
== Troubleshooting ==<br />
<br />
=== Search engines search for ''undefined'' ===<br />
<br />
If you are always searching for ''undefined'' even with the {{ic|searchengine-submit-pattern}} option set, then you should edit {{ic|$XDG_CONFIG_HOME/dwb/searchengines}} and adapt the URIs to match your {{ic|searchengine-submit-pattern}}.<br />
<br />
=== Fuzzy font in Github ===<br />
<br />
Install {{Pkg|ttf-freefont}} or add this in your {{ic|~/.config/fontconfig/fonts.conf}} inside the fontconfig-tags:<br />
<br />
<selectfont><br />
<rejectfont><br />
<pattern><br />
<patelt name="family"><br />
<string>Clean</string><br />
</patelt><br />
</pattern><br />
</rejectfont><br />
</selectfont><br />
<br />
If above solution doesn't help try to remove {{ic|xorg-fonts-75dpi}} and {{ic|xorg-fonts-100dpi}} packages.<br />
<br />
=== HTML5 media ===<br />
<br />
See [[Browser plugins#Multimedia playback]].<br />
<br />
== dwb-git ==<br />
<br />
{{AUR|dwb-git}} offers many improvements over the stable version, the most notable of which are listed below.<br />
<br />
{{Note|As of May 4th, 2015, the official {{Pkg|dwb}} package should contain all those features, and more.}}<br />
<br />
=== Plugin Support ===<br />
<br />
Browser Plugins can be enabled and disabled through the new [dwb:plugins dwb:plugins] settings page. Other [[Browser plugins]] may be supported as well, but these two alone will make your dwb experience much more enjoyable.<br />
<br />
==== Flash Support ====<br />
<br />
{{AUR|dwb-git}} has built in support for the {{Pkg|flashplugin}}. Dwb should auto-detect and enabled the plugin after it is installed. Alternatively, you can install {{Aur|gnash-gtk}}{{Broken package link|package not found}} and it will be detected as well.<br />
<br />
==== Java Support ====<br />
<br />
{{AUR|dwb-git}} has built in support for the {{Pkg|icedtea-web}}. Dwb should auto-detect and enable the plugin after it is installed.<br />
<br />
=== Improved Ability to Display Websites ===<br />
<br />
If you are having problems with they layout of websites not loading correctly then give {{AUR|dwb-git}} a shot.</div>Cirrushttps://wiki.archlinux.org/index.php?title=Classroom/git_2016&diff=440274Classroom/git 20162016-07-06T21:08:49Z<p>Cirrus: /* Sign Up */</p>
<hr />
<div>[[Category:Classroom]]<br />
This is the sign up page for a GIT class/workshop being held in 2016. Instructions are below.<br />
<br />
=== Create an SSH Key ===<br />
<br />
You will need an ssh key to access git on the [https://archwomen.org Arch Women] servers. If you don't have a key, you can create one by running:<br />
<br />
ssh-keygen<br />
<br />
For more information on creating key pairs see, [[SSH keys]]<br />
<br />
=== Share Your Public Key ===<br />
<br />
After generating key pairs you should have a public and private key in {{ic|~/.ssh}}. The public key has the extension {{ic|.pub}}. To paste your public key to [https://ptpb.pw ptpb.pw] do:<br />
<br />
cat ~/.ssh/id_rsa.pub | curl -F c=@- <nowiki>https://ptpb.pw/</nowiki><br />
<br />
Make '''sure''' the key you paste has the {{ic|.pub}} extension, you don't want to publicly share your private key.<br />
<br />
== Sign Up ==<br />
<br />
Add the nick you want to use on git and a link to your public key to the table.<br />
<br />
{| class="wikitable"<br />
! style="font-weight: bold;" | Nick<br />
! style="font-weight: bold;" | SSH Public Key<br />
|-<br />
| meskarune<br />
| [https://ptpb.pw/vj4X/sh public key]<br />
|-<br />
| ripelascra<br />
| [https://ptpb.pw/KEKy/sh public key]<br />
|-<br />
| therue<br />
| [https://ptpb.pw/2pnP/sh public key]<br />
|-<br />
| cirrusUK<br />
| [https://ptpb.pw/6di9/sh public key]<br />
|-<br />
| nick<br />
| key<br />
|}<br />
<br />
=== Help ===<br />
<br />
If you have questions or need additional help join the #archlinux-newbie or #archlinux-women irc channels on irc.freenode.net.</div>Cirrus