https://wiki.archlinux.org/api.php?action=feedcontributions&user=Dlwilson88&feedformat=atomArchWiki - User contributions [en]2024-03-28T11:55:03ZUser contributionsMediaWiki 1.41.0https://wiki.archlinux.org/index.php?title=Creating_packages&diff=586465Creating packages2019-10-18T02:27:51Z<p>Dlwilson88: labeled npm2arch as a deadlink</p>
<hr />
<div>[[Category:About Arch]]<br />
[[Category:Package development]]<br />
[[cs:Creating packages]]<br />
[[es:Creating packages]]<br />
[[fa:ایجاد بستهها]]<br />
[[fr:Standard paquetage]]<br />
[[it:Creating packages]]<br />
[[ja:パッケージの作成]]<br />
[[pt:Creating packages]]<br />
[[ru:Creating packages]]<br />
[[zh-hans:Creating packages]]<br />
{{Related articles start}}<br />
{{Related|Arch Build System}}<br />
{{Related|Arch packaging standards}}<br />
{{Related|Arch User Repository}}<br />
{{Related|Creating packages for other distributions}}<br />
{{Related|makepkg}}<br />
{{Related|pacman}}<br />
{{Related|Patching in ABS}}<br />
{{Related|PKGBUILD}}<br />
{{Related|.SRCINFO}}<br />
{{Related|DeveloperWiki:Building in a Clean Chroot}}<br />
{{Related articles end}}<br />
<br />
This article aims to assist users creating their own packages using the Arch Linux "ports-like" [[Arch Build System|build system]], also for submission in [[AUR]]. It covers creation of a [[PKGBUILD]] &ndash; a package build description file sourced by {{ic|makepkg}} to create a binary package from source. If already in possession of a {{ic|PKGBUILD}}, see [[makepkg]]. For instructions regarding existing rules and ways to improve package quality see [[Arch packaging standards]].<br />
<br />
== Overview == <br />
<br />
Packages in Arch Linux are built using the [[makepkg]] utility and the information stored in a [[PKGBUILD]] file. When {{ic|makepkg}} runs, it searches for a {{ic|PKGBUILD}} in the current directory and follows the instructions in it to acquire the required files and/or compile them to be packed within a package file ({{ic|pkgname.pkg.tar.xz}}). The resulting package contains binary files and installation instructions ready to be installed by [[pacman]].<br />
<br />
An Arch package is no more than a tar archive, or 'tarball', compressed using {{man|1|xz}}, which contains the following files generated by makepkg:<br />
<br />
* The binary files to install.<br />
* {{ic|.PKGINFO}}: contains all the metadata needed by pacman to deal with packages, dependencies, etc.<br />
* {{ic|.BUILDINFO}}: contains information needed for reproducible builds. This file is present only if a package is built with pacman 5.1 or newer.<br />
* {{ic|.MTREE}}: contains hashes and timestamps of the files, which are included in the local database so that pacman can verify the integrity of the package.<br />
* {{ic|.INSTALL}}: an optional file used to execute commands after the install/upgrade/remove stage. (This file is present only if specified in the {{ic|PKGBUILD}}.)<br />
* {{ic|.Changelog}}: an optional file kept by the package maintainer documenting the changes of the package. (It is not present in all packages.)<br />
<br />
== Preparation ==<br />
<br />
=== Prerequisite software ===<br />
<br />
First, ensure that the necessary tools are [[install]]ed: the package group {{Grp|base-devel}} should be sufficient, it includes {{ic|make}} and additional tools needed for compiling from source.<br />
<br />
The key tool for building packages is [[makepkg]] (provided by {{Pkg|pacman}}), which does the following:<br />
<br />
# Checks if package dependencies are installed.<br />
# Downloads the source file(s) from the specified server(s).<br />
# Unpacks the source file(s).<br />
# Compiles the software and installs it under a fakeroot environment.<br />
# Strips symbols from binaries and libraries.<br />
# Generates the package meta file which is included with each package.<br />
# Compresses the fakeroot environment into a package file.<br />
# Stores the package file in the configured destination directory, which is the current working directory by default.<br />
<br />
=== Download and test the installation ===<br />
<br />
Download the source tarball of the software you want to package, extract it, and follow the author's steps to install the program. Make a note of all commands and/or steps needed to compile and install it. You will be repeating those same commands in the {{ic|PKGBUILD}} file.<br />
<br />
Most software authors stick to the 3-step build cycle:<br />
<br />
./configure<br />
make<br />
make install<br />
<br />
This is a good time to make sure the program is working correctly.<br />
<br />
== Creating a PKGBUILD ==<br />
<br />
When {{ic|makepkg}} is run, it looks for a {{ic|PKGBUILD}} file in the current working directory. If it finds one, it downloads the software's source code and compiles it according to the instructions specified in the {{ic|PKGBUILD}} file. The instructions must be fully interpretable by the [[Wikipedia:Bash_(Unix_shell)|Bash]] shell. After successful completion, the resulting binaries and metadata of the package, i.e. package version and dependencies, are packed in a {{ic|pkgname.pkg.tar.xz}} package file. The newly created package can be installed by simply using {{ic|makepkg --install}} which will call pacman in the background, or by directly using {{ic|pacman -U ''pkgname.pkg.tar.xz''}}.<br />
<br />
To start building a new package, first create a new directory for the package and change current directory into this one. Then, a {{ic|PKGBUILD}} file needs to be created: a prototype PKGBUILD found in {{ic|/usr/share/pacman/}} can be used or you can start from a {{ic|PKGBUILD}} from another package. The latter may be a good choice if a similar package already exists.<br />
<br />
=== Defining PKGBUILD variables ===<br />
<br />
Example PKGBUILDs are located in {{Ic|/usr/share/pacman/}}. An explanation of possible {{ic|PKGBUILD}} variables can be found in the [[PKGBUILD]] article.<br />
<br />
''makepkg'' defines two variables that you should use as part of the build and install process:<br />
<br />
; {{ic|srcdir}}: This points to the directory where ''makepkg'' extracts or symlinks all files in the source array.<br />
<br />
; {{ic|pkgdir}}: This points to the directory where ''makepkg'' bundles the installed package, which becomes the root directory of your built package.<br />
<br />
They contain ''absolute'' paths, which means you do not have to worry about your working directory if you use these variables properly.<br />
<br />
{{Note|''makepkg'', and thus the {{ic|build()}} and {{ic|package()}} functions, are intended to be non-interactive. Interactive utilities or scripts called in those functions may break ''makepkg'', particularly if it is invoked with build-logging enabled ({{ic|--log}}). (See {{Bug|13214}}.)}}<br />
<br />
=== PKGBUILD functions ===<br />
<br />
When building a package, {{ic|makepkg}} will invoke the following five functions if they have been defined in the PKGBUILD. Function {{ic|package()}} is required in every PKGBUILD and will always be invoked. If any of the other functions is not defined, {{ic|makepkg}} will simply skip the invocation of that function.<br />
<br />
During the build, the functions are invoked in the order in which they are listed here.<br />
<br />
==== prepare() ====<br />
<br />
With this function, commands that are used to prepare sources for building are run, such as [[Patching in ABS|patching]]. This function runs right after package extraction, before [[#pkgver()|pkgver()]] and the build function. If extraction is skipped ({{ic|makepkg --noextract}}), then {{ic|prepare()}} is not run. <br />
<br />
{{Note|(From {{man|5|PKGBUILD}}) The function is run in {{ic|bash -e}} mode, meaning any command that exits with a non-zero status will cause the function to exit.}}<br />
<br />
==== pkgver() ====<br />
<br />
{{ic|pkgver()}} runs after the sources are fetched, extracted and [[#prepare()|prepare()]] executed. So you can update the pkgver variable during a makepkg stage.<br />
<br />
This is particularly useful if you are [[VCS PKGBUILD Guidelines|making git/svn/hg/etc. packages]], where the build process may remain the same, but the source could be updated every day, even every hour. The old way of doing this was to put the date into the pkgver field which, if the software was not updated, makepkg would still rebuild it thinking the version had changed. Some useful commands for this are {{ic|git describe}}, {{ic|hg identify -ni}}, etc. Please test these before submitting a PKGBUILD, as a failure in the {{ic|pkgver()}} function can stop a build in its tracks. <br />
<br />
{{Note|pkgver cannot contain spaces or hyphens ({{ic|-}}). Using sed to correct this is common.}}<br />
<br />
==== build() ====<br />
<br />
Now you need to implement the {{ic|build()}} function in the {{ic|PKGBUILD}} file. This function uses common shell commands in [[Wikipedia:Bash_(Unix_shell)|Bash]] syntax to automatically compile software and create a directory called {{ic|pkg}} to install the software to. This allows ''makepkg'' to package files without having to sift through your file system.<br />
<br />
The first step in the {{ic|build()}} function is to change into the directory created by uncompressing the source tarball. ''makepkg'' will change the current directory to {{ic|$srcdir}} before executing the {{ic|build()}} function. Therefore, in most cases, like suggested in {{ic|/usr/share/pacman/PKGBUILD.proto}}, the first command will look like this:<br />
<br />
cd "$pkgname-$pkgver"<br />
<br />
Now, you need to list the same commands you used when you manually compiled the software. The {{ic|build()}} function in essence automates everything you did by hand and compiles the software in the fakeroot build environment. If the software you are packaging uses a configure script, it is good practice to use {{ic|1=--prefix=/usr}} when building packages for pacman. A lot of software installs files relative to the {{ic|/usr/local}} directory, which should only be done if you are manually building from source. All Arch Linux packages should use the {{ic|/usr}} directory. As seen in the {{ic|/usr/share/pacman/PKGBUILD.proto}} file, the next two lines often look like this:<br />
<br />
./configure --prefix=/usr<br />
make<br />
<br />
{{Note|If your software does not need to build anything, do not use the {{ic|build()}} function. The {{ic|build()}} function is not required, but the {{ic|package()}} function is.}}<br />
<br />
==== check() ====<br />
<br />
Place for calls to {{Ic|make check}} and similar testing routines. It is highly recommended to have {{Ic|check()}} as it helps to make sure software has been built correctly and works fine with its dependencies.<br />
<br />
Users who do not need it (and occasionally maintainers who can not fix a package for this to pass) can disable it using {{ic|1=BUILDENV+=('!check')}} in PKGBUILD/makepkg.conf or call {{ic|makepkg}} with {{ic|--nocheck}} flag.<br />
<br />
==== package() ====<br />
<br />
The final step is to put the compiled files in a directory where ''makepkg'' can retrieve them to create a package. This by default is the {{ic|pkg}} directory—a simple fakeroot environment. The {{ic|pkg}} directory replicates the hierarchy of the root file system of the software's installation paths. If you have to manually place files under the root of your filesystem, you should install them in the {{ic|pkg}} directory under the same directory structure. For example, if you want to install a file to {{ic|/usr/bin}}, it should instead be placed under {{ic|$pkgdir/usr/bin}}. Very few install procedures require the user to copy dozens of files manually. Instead, for most software, calling {{ic|make install}} will do so. The final line should look like the following in order to correctly install the software in the {{ic|pkg}} directory:<br />
<br />
make DESTDIR="$pkgdir/" install<br />
<br />
{{Note|It is sometimes the case where {{ic|DESTDIR}} is not used in the {{ic|Makefile}}; you may need to use {{ic|prefix}} instead. If the package is built with ''autoconf'' / ''automake'', use {{ic|DESTDIR}}; this is what is [https://www.gnu.org/software/automake/manual/automake.html#Install documented] in the manuals. If {{ic|DESTDIR}} does not work, try building with {{ic|1=make prefix="$pkgdir/usr/" install}}. If that does not work, you will have to look further into the install commands that are executed by "{{ic|make <...> install}}".}}<br />
<br />
{{ic|makepkg --repackage}} runs only the {{ic|package()}} function, so it creates a package without building. This may save time e.g. if you have changed just the {{ic|depends}} variable of the package.<br />
<br />
== Testing the PKGBUILD and package ==<br />
<br />
As you are writing the {{ic|build()}} function, you will want to test your changes frequently to ensure there are no bugs. You can do this using the {{ic|makepkg}} command in the directory containing the {{ic|PKGBUILD}} file. With a properly formatted {{ic|PKGBUILD}}, makepkg will create a package; with a broken or unfinished {{ic|PKGBUILD}}, it will raise an error.<br />
<br />
If makepkg finishes successfully, it will place a file named {{ic|pkgname-pkgver.pkg.tar.xz}} in your working directory. This package can be installed with the {{ic|pacman -U}} command. However, just because a package file was built does not imply that it is fully functional. It might conceivably contain only the directory and no files whatsoever if, for example, a prefix was specified improperly. You can use pacman's query functions to display a list of files contained in the package and the dependencies it requires with {{ic|pacman -Qlp [package file]}} and {{ic|pacman -Qip [package file]}} respectively.<br />
<br />
If the package looks sane, then you are done! However, if you plan on releasing the {{ic|PKGBUILD}} file, it is imperative that you check and double-check the contents of the {{ic|depends}} array. <br />
<br />
Also ensure that the package binaries actually ''run'' flawlessly! It is annoying to release a package that contains all necessary files, but crashes because of some obscure configuration option that does not quite work well with the rest of the system. If you are only going to compile packages for your own system, though, you do not need to worry too much about this quality assurance step, as you are the only person suffering from mistakes, after all.<br />
<br />
=== Checking package sanity ===<br />
<br />
After testing package functionality check it for errors using [[namcap]]:<br />
$ namcap PKGBUILD<br />
$ namcap ''<package file name>''.pkg.tar.xz<br />
<br />
Namcap will:<br />
<br />
# Check PKGBUILD contents for common errors and package file hierarchy for unnecessary/misplaced files<br />
# Scan all ELF files in package using {{ic|ldd}}, automatically reporting which packages with required shared libraries are missing from {{Ic|depends}} and which can be omitted as transitive dependencies<br />
# Heuristically search for missing and redundant dependencies<br />
<br />
and much more.<br />
<br />
Get into the habit of checking your packages with namcap to avoid having to fix the simplest mistakes after package submission.<br />
<br />
== Submitting packages to the AUR ==<br />
<br />
Please read [[AUR User Guidelines#Submitting packages]] for a detailed description of the submission process.<br />
<br />
== Summary ==<br />
<br />
# Download the source tarball of the software to package.<br />
# Try compiling the package and installing it into an arbitrary directory.<br />
# Copy over the prototype {{ic|/usr/share/pacman/PKGBUILD.proto}} and rename it to {{ic|PKGBUILD}} in a temporary working directory.<br />
# Edit the {{ic|PKGBUILD}} according to the needs of your package.<br />
# Run {{ic|makepkg}} and check whether the package builds correctly.<br />
# If not, repeat the previous two steps.<br />
<br />
=== Warnings ===<br />
<br />
* Before you can automate the package building process, you should have done it manually at least once unless you know ''exactly'' what you are doing ''in advance'', in which case you would not be reading this in the first place. Unfortunately, although a good bunch of program authors stick to the 3-step build cycle of "{{ic|./configure}}; {{ic|make}}; {{ic|make install}}", this is not always the case, and things can get real ugly if you have to apply patches to make everything work at all. Rule of thumb: If you cannot get the program to compile from the source tarball, and make it install itself to a defined, temporary subdirectory, you do not even need to try packaging it. There is not any magic pixie dust in {{ic|makepkg}} that makes source problems go away.<br />
* In a few cases, the packages are not even available as source and you have to use something like {{ic|sh installer.run}} to get it to work. You will have to do quite a bit of research (read READMEs, INSTALL instructions, man pages, perhaps ebuilds from Gentoo or other package installers, possibly even the MAKEFILEs or source code) to get it working. In some really bad cases, you have to edit the source files to get it to work at all. However, {{ic|makepkg}} needs to be completely autonomous, with no user input. Therefore if you need to edit the makefiles, you may have to bundle a custom patch with the {{ic|PKGBUILD}} and install it from inside the {{ic|prepare()}} function, or you might have to issue some {{ic|sed}} commands from inside the {{ic|prepare()}} function.<br />
<br />
== More detailed guidelines ==<br />
<br />
{{Package guidelines}}<br />
<br />
== PKGBUILD generators ==<br />
<br />
PKGBUILDs for some packages can be generated automatically.<br />
<br />
{{Note|Users are still responsible for ensuring that the package meets the high quality standards before submitting the generated files to the [[AUR]].}}<br />
<br />
* [[Go]]: [https://github.com/seletskiy/go-makepkg go-makepkg]<br />
* [[Haskell]]: [https://github.com/magthe/cblrepo cblrepo]<br />
* [[Node.js]]: {{AUR|nodejs-npm2arch}} [https://github.com/simon04/npm2arch|igorvisi npm2arch] {{Dead link|2019|10|17}}<br />
* [[Python]]: {{AUR|pipman-git}}, {{AUR|pip2arch-git}}, {{AUR|python-pypi2pkgbuild}}<br />
* [[Ruby]]: {{AUR|gem2arch}}, {{AUR|pacgem}}<br />
* [[Rust]]: {{AUR|cargo-pkgbuild}}<br />
<br />
== See also ==<br />
<br />
* [https://bbs.archlinux.org/viewtopic.php?id=91408 How to correctly create a patch file].<br />
* [https://archwomen.org/media/project_classroom/classlogs/ Arch Linux Classroom IRC Logs of classes about creating PKGBUILDs].<br />
* [http://www.linuxfromscratch.org/hints/downloads/files/fakeroot.txt Fakeroot approach for package installation]</div>Dlwilson88https://wiki.archlinux.org/index.php?title=Bash/Prompt_customization&diff=582082Bash/Prompt customization2019-09-13T03:13:20Z<p>Dlwilson88: changed customize to customizing for proper syntax</p>
<hr />
<div>[[Category:Eye candy]]<br />
[[Category:Command shells]]<br />
[[de:Bash-Prompt anpassen]]<br />
[[es:Bash/Prompt customization]]<br />
[[it:Bash/Prompt customization]]<br />
[[ja:Bash/プロンプトのカスタマイズ]]<br />
[[ru:Bash/Prompt customization]]<br />
[[zh-hans:Bash/Prompt customization]]<br />
{{Related articles start}}<br />
{{Related|Bash}}<br />
{{Related|Environment variables}}<br />
{{Related|Git#Git prompt}}<br />
{{Related articles end}}<br />
Bash has several prompts which can be customized to increase productivity, aesthetic appeal, and nerd cred.<br />
<br />
== Prompts ==<br />
<br />
Bash has four prompts that can be customized:<br />
<br />
* {{ic|PS1}} is the primary prompt which is displayed before each command, thus it is the one most people customize.<br />
* {{ic|PS2}} is the secondary prompt displayed when a command needs more input (e.g. a multi-line command).<br />
* {{ic|PS3}} is not very commonly used. It is the prompt displayed for Bash's {{ic|select}} built-in which displays interactive menus. Unlike the other prompts, it does not expand [[#Bash escape sequences|Bash escape sequences]]. Usually you would customize it in the script where the {{ic|select}} is used rather than in your {{ic|.bashrc}}.<br />
* {{ic|PS4}} is also not commonly used. It is displayed when debugging bash scripts to indicate levels of indirection. The first character is repeated to indicate deeper levels.<br />
<br />
All of the prompts are customized by setting the corresponding variable to the desired string (usually in {{ic|~/.bashrc}}), for example <br />
<br />
PS2='> '<br />
<br />
== Techniques ==<br />
<br />
While one can simply set their prompt to a plain string, there are a variety of techniques for making the prompt more dynamic and useful.<br />
<br />
=== Bash escape sequences ===<br />
<br />
When printing the prompt string, Bash looks for certain backslash-escaped characters and will expand them into special strings. For example, {{ic|\u}} is expanded into the current username and {{ic|\A}} is expanded to the current time. So a PS1 of {{ic|'\A \u $ '}} would be printed like {{ic|17:35 ''username'' $ }}.<br />
<br />
Check the "PROMPTING" section of the Bash man page for a complete list of escape sequences.<br />
<br />
=== Terminfo escape sequences ===<br />
<br />
Aside from the escape characters recognized by Bash, most terminals recognize special escape sequences that affect the terminal itself rather than printing characters. For example they might change the color of subsequent printed characters, move the cursor to an arbitrary location, or clear the screen. These escape sequences can be somewhat illegible and can vary from terminal to terminal, so they are documented in the terminfo database. To see what capabilities your terminal supports, run<br />
<br />
$ infocmp<br />
<br />
The capability names (the part before the =) can be looked up in {{man|5|terminfo}} for a description of what they do. For example, {{ic|setaf}} sets the foreground color of whatever text is printed after it. To get the escape code for a capability, you can use the {{ic|tput}} command. For example<br />
<br />
$ tput setaf 2<br />
<br />
prints the escape sequence to set the foreground color to green.<br />
<br />
{{Note|If tput commands are failing for you, ensure that you have set the correct {{ic|TERM}} value for your shell. For example, if you have set {{ic|xterm}} instead of {{ic|xterm-256color}}, {{ic|tput setaf}} will only work with color numbers 0-7.}}<br />
<br />
To practically incorporate these capabilities into your prompt, you can use Bash's command substitution and string interpolation. For example<br />
<br />
{{bc|<nowiki>GREEN="\[$(tput setaf 2)\]"<br />
RESET="\[$(tput sgr0)\]"<br />
<br />
PS1="${GREEN}my prompt${RESET}> "</nowiki>}}<br />
<div style="font-family: monospace; white-space: pre; padding: 1em; background-color: black; border: 1px solid #bcd; color: white;"><span style="color: #0f0">my prompt</span>> </div><br />
<br />
{{Note|Wrapping the tput output in {{ic|\[ \]}} is recommended by the Bash man page. This helps Bash ignore non-printable characters so that it correctly calculates the size of the prompt.}}<br />
<br />
=== ANSI escape sequences ===<br />
<br />
Unfortunately, valid ANSI escape sequences may be missing from your terminal's terminfo database. This is especially common with escape sequences for newer features such as 256 color support. In that case you cannot use tput, you must input the escape sequence manually.<br />
<br />
See [[Wikipedia:ANSI escape code]] for examples of escape sequences. Every escape sequence starts with a literal escape character, which you can input using the Bash escape sequence {{ic|\e}}. So for example,{{ic|\e[48;5;209m}} sets the background to a peachy color (if you have 256 color support) and {{ic|\e[2;2H}} moves the cursor near the top-left corner of the screen.<br />
<br />
In cases where Bash escape sequences are not supported (such as PS3) you can get a literal escape character using Bash's printf builtin:<br />
<br />
ESC=$(printf "\e")<br />
PEACH="$ESC[48;5;209m"<br />
<br />
=== Embedding commands ===<br />
<br />
If you want to add the output of some command to your prompt, you might be tempted to use command substitution. For example, to add the amount of free memory to your prompt you might try:<br />
{{hc|1=PS1="$(awk '/MemFree/{print $2}' /proc/meminfo) prompt > "|2=53718 prompt ><br />
53718 prompt ><br />
53718 prompt >}}<br />
<br />
But this doesn't work; the amount of memory shown is the same every time! This is because the command is run once, when PS1 is first set, and never again. The trick is to simply prevent the substitution either by escaping the {{ic|$}} or by defining it in single quotes&mdash;either way it will be substituted when the prompt is actually displayed:<br />
<br />
PS1="\$(awk '/MemFree/{print \$2}' /proc/meminfo) prompt > "<br />
# or<br />
PS1='$(awk "/MemFree/{print \$2}" /proc/meminfo) prompt > '<br />
<br />
To prevent long commands from making your PS1 huge, you can define functions:<br />
<br />
{{bc|1=free_mem()<br />
{<br />
awk '/MemFree/{print $2}' /proc/meminfo<br />
}<br />
<br />
PS1='$(free_mem) prompt > '}}<br />
<br />
{{Note|You can use terminfo/ANSI escape sequences inside substituted functions but '''not''' Bash escapes. In particular {{ic|\[ \]}} won't work for surrounding non-printable characters. Instead you can use the octal escapes {{ic|\001}} and {{ic|\002}} (e.g. using {{ic|printf}} or {{ic|echo -e}}).}}<br />
<br />
=== PROMPT_COMMAND ===<br />
<br />
If the {{ic|PROMPT_COMMAND}} variable is set, it will be evaluated right before PS1 is displayed. This can be used to achieve quite powerful effects. For example it can reassign PS1 based on some condition, or perform some operation on your Bash history every time you run a command.<br />
<br />
{{Warning|PROMPT_COMMAND generally should not be used to print characters directly to the prompt. Characters printed outside of PS1 are not counted by Bash, which will cause it to incorrectly place the cursor and clear characters. Either use PROMPT_COMMAND to set PS1 or look at [[#Embedding commands|embedding commands]].}}<br />
<br />
=== Escapes between command input and output ===<br />
<br />
You can affect your input text in Bash by not resetting the text properties at the end of your PS1. For example, inserting {{ic|tput blink}} at the end of your PS1 will make your typed commands blink. However this effect will also continue through the command's output since the text properties are not reset when you hit Enter.<br />
<br />
In order to insert escape sequences after you type a command but before the output is displayed, you can trap Bash's DEBUG signal, which is sent right before each command is executed:<br />
<br />
$ trap 'tput sgr0' DEBUG<br />
<br />
=== Customizing root prompts ===<br />
<br />
To ensure that you know when you are running as root, you can customize your root prompt to make it clearly stand out (perhaps blinking red?). This is done by customizing the Bash prompt as usual but in root's home directory, {{ic|/root}}. Start off by copying the skeleton files {{ic|/etc/skel/.bash_profile}} and {{ic|/etc/skel/.bashrc}} to {{ic|/root}}, then edit {{ic|/root/.bashrc}} as desired.<br />
<br />
== Examples ==<br />
<br />
=== Colors ===<br />
<br />
{{Tip|{{ic|infocmp}} shows the number of colors {{ic|tput}} works with, for example {{ic|colors#8}}.}}<br />
<br />
To see the full range of colors your terminal supports, you can use a simple loop with tput (change {{ic|setab}} to {{ic|setaf}} for text foregrounds):<br />
<br />
{{bc|for C in {0..255}; do<br />
tput setab $C<br />
echo -n "$C "<br />
done<br />
tput sgr0<br />
echo}}<br />
<br />
If that does not work (and you cannot fix it by setting the [[#Terminfo escape sequences|correct TERM value]]), you can test the different manual escape sequences:<br />
<br />
{{bc|# standard colors<br />
for C in {40..47}; do<br />
echo -en "\e[${C}m$C "<br />
done<br />
# high intensity colors<br />
for C in {100..107}; do<br />
echo -en "\e[${C}m$C "<br />
done<br />
# 256 colors<br />
for C in {16..255}; do<br />
echo -en "\e[48;5;${C}m$C "<br />
done<br />
echo -e "\e(B\e[m"<br />
}}<br />
<br />
To change the manual escapes from background to foreground, the standard color range is {{ic|30..37}}, the high intensity range is {{ic|90..97}}, and the 48 should be changed to 38 for 256 colors.<br />
<br />
=== Common capabilities ===<br />
<br />
The following [[#Terminfo escape sequences|terminfo capabilities]] are useful for prompt customization and are supported by many terminals. '''#1''' and '''#2''' are placeholders for numeric arguments.<br />
<br />
{| class="wikitable"<br />
! Capability !! Escape sequence !! Description<br />
|-<br />
!colspan="3"| Text attributes<br />
|-<br />
| blink || \E[5m || blinking text on<br />
|-<br />
| bold || \E[1m || bold text on<br />
|-<br />
| dim || \E[2m || dim text on<br />
|-<br />
| rev || \E[7m || reverse video on (switch text/background colors)<br />
|-<br />
| sitm || \E[3m || italic text on<br />
|-<br />
| ritm || \E[23m || italic text off<br />
|-<br />
| smso || \E[7m || highlighted text on<br />
|-<br />
| rmso || \E[27m || highlighted text off<br />
|-<br />
| smul || \E[4m || underlined text on<br />
|-<br />
| rmul || \E[24m || underlined text off<br />
|-<br />
| setab '''#1''' || \E[4'''#1'''m || set background color '''#1''' (0-7)<br />
|-<br />
| setaf '''#1''' || \E[3'''#1'''m || set text color '''#1''' (0-7)<br />
|-<br />
| sgr0 || \E(B\E[m || reset text attributes<br />
|-<br />
!colspan="3"| Cursor movement<br />
|-<br />
| sc || \E7 || save cursor position<br />
|-<br />
| rc || \E8 || restore saved cursor position<br />
|-<br />
| clear || \E[H\E[2J || clear screen and move cursor to top left<br />
|-<br />
| cuu '''#1''' || \E['''#1'''A || move cursor up '''#1''' rows<br />
|-<br />
| cud '''#1''' || \E['''#1'''B || move cursor down '''#1''' rows<br />
|-<br />
| cuf '''#1''' || \E['''#1'''C || move cursor right '''#1''' columns<br />
|-<br />
| cub '''#1''' || \E['''#1'''D || move cursor left '''#1''' columns<br />
|-<br />
| home || \E[H || move cursor to top left<br />
|-<br />
| hpa '''#1''' || \E['''#1'''G || move cursor to column '''#1'''<br />
|-<br />
| vpa '''#1''' || \E['''#1'''d || move cursor to row '''#1''', first column<br />
|-<br />
| cup '''#1''' '''#2''' || \E['''#1''';'''#2'''H || move cursor to row '''#1''', column '''#2'''<br />
|-<br />
!colspan="3"| Removing characters<br />
|-<br />
| dch '''#1''' || \E'''#1'''P || remove '''#1''' characters (like backspacing)<br />
|-<br />
| dl '''#1''' || \E'''#1'''M || remove '''#1''' lines<br />
|-<br />
| ech '''#1''' || \E'''#1'''X || clear '''#1''' characters (without moving cursor)<br />
|-<br />
| ed || \E[J || clear to bottom of screen<br />
|-<br />
| el || \E[K || clear to end of line<br />
|-<br />
| el1 || \E[1K || clear to beginning of line<br />
|}<br />
<br />
=== Visualizing exit codes ===<br />
<br />
Using the same trick from [[#Embedding commands|embedding commands]] you can delay the interpolation of special Bash variables like {{ic|$?}}. So the following prompt shows the exit code of the previous command:<br />
<br />
PS1="\$? > "<br />
# or<br />
PS1='$? > '<br />
<br />
<div style="font-family: monospace; white-space: pre; padding: 1em; background-color: black; border: 1px solid #bcd; color: white;">0 > true<br>0 > false<br>1 ></div><br />
<br />
This can be made more interesting using conditionals and functions:<br />
<br />
{{bc|<nowiki>exitstatus()<br />
{<br />
if [[ $? == 0 ]]; then<br />
echo ':)'<br />
else<br />
echo 'D:'<br />
fi<br />
}<br />
PS1='$(exitstatus) > '</nowiki>}}<br />
<br />
<div style="font-family: monospace; white-space: pre; padding: 1em; background-color: black; border: 1px solid #bcd; color: white;">:) > true<br>:) > false<br>D: ></div><br />
<br />
=== Positioning the cursor ===<br />
<br />
It is possible to move the cursor around the screen inside of PS1 to make different parts of the prompt appear in different locations. However, to ensure that Bash positions the cursor and output in the right position, you must move the cursor back to the original position after you are done printing elsewhere. This can be done using the tput capabilities {{ic|sc}} and {{ic|rc}} to save and restore the cursor position. The general pattern for a prompt that moves the cursor is<br />
<br />
PS1="\[$(tput sc; ''cursor-moving code'') ''positioned prompt stuff'' $(tput rc)\] ''normal prompt stuff''"<br />
<br />
where the entire block of repositioned prompt is wrapped in {{ic|\[ \]}} to prevent Bash from counting it as part of the regular prompt.<br />
<br />
==== Right-justified text ====<br />
<br />
The simplest way to print text on the right side of the screen is to use printf<br />
<br />
{{bc|1=rightprompt()<br />
{<br />
printf "%*s" $COLUMNS "right prompt"<br />
}<br />
<br />
PS1='\[$(tput sc; rightprompt; tput rc)\]left prompt > '<br />
}}<br />
<br />
<div style="font-family: monospace; white-space: pre; padding: 1em; background-color: black; border: 1px solid #bcd; color: white;">left prompt > <span style="float: right">right prompt</span></div><br />
<br />
This creates a right-justified variable-sized field {{ic|%*s}} and sets its size to the current number of columns of the terminal {{ic|$COLUMNS}}.<br />
<br />
==== Arbitrary positioning ====<br />
<br />
The {{ic|cup}} capability moves the cursor to a specific position on the screen, for example {{ic|tput cup 20 5}} moves the cursor to line 20, column 5 (where 0 0 is the top left corner). {{ic|cuu}}, {{ic|cud}}, {{ic|cuf}}, and {{ic|cub}} (up, down, forward, back) move the cursor relative to its current position. For example {{ic|tput cuf 10}} moves the cursor 10 characters to the right. You can use the {{ic|LINES}} and {{ic|COLUMNS}} variables in the arguments to move the cursor relative to the bottom and right edges. For example, to move 10 lines and 5 columns away from the bottom right corner:<br />
<br />
$ tput cup $((LINES - 11)) $((COLUMNS - 6))<br />
<br />
=== Customizing the terminal window title ===<br />
<br />
The terminal window title can be customized in much the same way as the prompt: by printing escape sequences in the shell. Thus it is common for users to include window title customizations in their prompt. Although this is technically a feature of xterm, many modern terminals support it. The escape sequence to use is {{ic|'''ESC''']2;''new title'''''BEL'''}} where {{ic|'''ESC'''}} and {{ic|'''BEL'''}} are the escape and bell characters. Using [[#Bash escape sequences]], changing the title in your prompt looks like<br />
<br />
PS1='\[\e]2;''new title''\a\]prompt > '<br />
<br />
Of course your window title string can include output from [[#Embedding commands|embedding commands]] or variables such as {{ic|$PWD}}, so that the title changes with each command.<br />
<br />
== See also ==<br />
<br />
* Community examples and screenshots in the Forum thread: [https://bbs.archlinux.org/viewtopic.php?id=50885 What's your PS1?] (only accessible if logged in)<br />
* [https://gitweb.gentoo.org/repo/gentoo.git/tree/app-shells/bash/files/bashrc Gentoo's {{ic|/etc/bash/bashrc}}]. See also {{AUR|gentoo-bashrc}}.<br />
* {{man|1|tput}}<br />
** [http://wiki.bash-hackers.org/scripting/terminalcodes tput reference on bash-hackers.org]<br />
** [http://tldp.org/HOWTO/Bash-Prompt-HOWTO/x405.html Colours and Cursor Movement With tput]<br />
* [http://www.tldp.org/HOWTO/Bash-Prompt-HOWTO/x329.html Bash Prompt HOWTO]<br />
* [http://gilesorr.com/bashprompt/prompts/index.html Giles Orr's collection of sample prompts]<br />
* [http://misc.flogisoft.com/bash/tip_colors_and_formatting Bash tips: Colors and formatting]<br />
* [https://github.com/nojhan/liquidprompt Liquid Prompt — a useful adaptive prompt for Bash & zsh]<br />
* [https://www.askapache.com/linux/bash-power-prompt/ Bash POWER PROMPT]<br />
* [[Wikipedia:ANSI escape code]]<br />
* [https://www.gnu.org/software/bash/manual/html_node/Controlling-the-Prompt.html GNU Bash manual: Controlling the Prompt]</div>Dlwilson88https://wiki.archlinux.org/index.php?title=Talk:Music_Player_Daemon&diff=580227Talk:Music Player Daemon2019-08-17T18:20:14Z<p>Dlwilson88: corrected minor grammatical errors</p>
<hr />
<div>== MPD with GNOME3 running as user ==<br />
<br />
I managed to get mpd & mpdscribble working with GNOME3. Make sure none of the services are enabled in systemd. Then edit the mpdconf file in your $HOME (mine is ~/.mpd/mpd.conf) and make sure the user option isn't set. Then open a terminal and run the command `gnome-session-propteries` and you'll get a window listing of all the programs GNOME starts with once you've logged in. Just add MPD and mpdscribble and all should be working the next time you login.<br />
[[User:Jonnybarnes|Jonnybarnes]] ([[User talk:Jonnybarnes|talk]]) 21:39, 31 October 2013 (UTC)<br />
<br />
== Style comment ==<br />
I am not a rocket scientist post-doc and I use mpd. I don't understand your criticism.[[User:Graysky|Graysky]] ([[User talk:Graysky|talk]]) 15:46, 10 October 2015 (UTC)<br />
<br />
:This article dives into tangents and edge-cases, and makes mpd look far more complicated than it actually is. Right now, it has little to not merit compared to the [http://www.musicpd.org/doc/user/index.html User's manual]. -- [[User:Alad|Alad]] ([[User talk:Alad|talk]]) 21:37, 10 October 2015 (UTC)<br />
<br />
::No offense intended, but would you be willing to mock-up how you think it should be? [[User:Graysky|Graysky]] ([[User talk:Graysky|talk]]) 06:09, 11 October 2015 (UTC)<br />
<br />
== User service is available again as of 0.19.21-1 ==<br />
<br />
The user service is available again, so the section Autostart with systemd is correct again.<br />
[[User:Dillebidum|Dillebidum]] ([[User talk:Dillebidum|talk]]) 10:14, 15 December 2016 (UTC)<br />
<br />
:Thanks, updated. [[User:Lonaowna|Lonaowna]] ([[User talk:Lonaowna|talk]]) 12:41, 15 December 2016 (UTC)</div>Dlwilson88https://wiki.archlinux.org/index.php?title=Talk:Music_Player_Daemon&diff=580226Talk:Music Player Daemon2019-08-17T18:15:30Z<p>Dlwilson88: corrected a minor error , you to your (end of the 1st sentence)</p>
<hr />
<div>== MPD with GNOME3 running as user ==<br />
<br />
I managed to get mpd & mpdscribble working with GNOME3. Make sure none of the services are enabled in systemd. Then edit the mpdconf file in your $HOME (mine is ~/.mpd/mpd.conf) and make sure the user option isn't set. The open a terminal and run the command `gnome-session-propteries` and you'll get a window listing all the programs GNOME starts once you've logged in. Just add MPD and mpdscribble and all should be working the next time you login.<br />
[[User:Jonnybarnes|Jonnybarnes]] ([[User talk:Jonnybarnes|talk]]) 21:39, 31 October 2013 (UTC)<br />
<br />
== Style comment ==<br />
I am not a rocket science post-doc and I use mpd. I don't understand your criticism.[[User:Graysky|Graysky]] ([[User talk:Graysky|talk]]) 15:46, 10 October 2015 (UTC)<br />
<br />
:This article dives into tangents and edge-cases, and makes mpd look far more complicated than it actually is. Right now, it has little to not merit compared to the [http://www.musicpd.org/doc/user/index.html User's manual]. -- [[User:Alad|Alad]] ([[User talk:Alad|talk]]) 21:37, 10 October 2015 (UTC)<br />
<br />
::No offense intended, but would you be willing to mock-up how you think it should be? [[User:Graysky|Graysky]] ([[User talk:Graysky|talk]]) 06:09, 11 October 2015 (UTC)<br />
<br />
== User service is available again as of 0.19.21-1 ==<br />
<br />
The user service is available again, so the section Autostart with systemd is correct again.<br />
[[User:Dillebidum|Dillebidum]] ([[User talk:Dillebidum|talk]]) 10:14, 15 December 2016 (UTC)<br />
<br />
:Thanks, updated. [[User:Lonaowna|Lonaowna]] ([[User talk:Lonaowna|talk]]) 12:41, 15 December 2016 (UTC)</div>Dlwilson88https://wiki.archlinux.org/index.php?title=Vim&diff=579641Vim2019-08-12T16:49:36Z<p>Dlwilson88: /* Saving runtime state */ fixed a Demonstrative Pronoun: Preserving "these" (plural) to "this" (singular) information can ...</p>
<hr />
<div>[[Category:Text editors]]<br />
[[Category:Console applications]]<br />
[[de:Vim]]<br />
[[es:Vim]]<br />
[[it:Vim]]<br />
[[ja:Vim]]<br />
[[lt:Vim]]<br />
[[ru:Vim]]<br />
[[zh-hans:Vim]]<br />
[[zh-hant:Vim]]<br />
{{Related articles start}}<br />
{{Related|List of applications/Documents#Vi-style text editors}}<br />
{{Related articles end}}<br />
<br />
[[Wikipedia:Vim (text editor)|Vim]] is a terminal text editor. It is an extended version of [[vi]] with additional features, including syntax highlighting, a comprehensive help system, native scripting (vimscript), a visual mode for text selection, comparison of files (vimdiff), and tools with restricted capabilities such as rview and rvim.<br />
<br />
== Installation ==<br />
<br />
[[Install]] one of the following packages:<br />
<br />
* {{Pkg|vim}} — with Python 2/3, Lua, Ruby and Perl interpreters support but without GTK/X support.<br />
* {{Pkg|gvim}} — which also provides the same as the above {{ic|vim}} package with GTK/X support.<br />
<br />
{{Note|<br />
* The {{Pkg|vim}} package is built without [[Xorg]] support; specifically the {{ic|+clipboard}} feature is missing, so Vim will not be able to operate with the ''primary'' and ''clipboard'' [[Clipboard|selection buffers]]. The {{Pkg|gvim}} package provides also the CLI version of Vim with the {{ic|+clipboard}} feature.<br />
* The unofficial repository [[Unofficial user repositories#herecura|herecura]] also provides a number of Vim/gVim variants: {{ic|vim-cli}}, {{ic|vim-gvim-common}}, {{ic|vim-gvim-gtk}}, {{ic|vim-gvim-qt}}, {{ic|vim-rt}} and {{ic|vim-tiny}}.<br />
}}<br />
<br />
== Usage ==<br />
<br />
For a basic overview on how to use Vim, follow the vim tutorial by running either ''vimtutor'' (for the terminal version) or ''gvimtutor'' (for the graphical version).<br />
<br />
Vim includes a broad help system that can be accessed with the {{ic|:h ''subject''}} command. Subjects include commands, configuration options, key bindings, plugins etc. Use the {{ic|:h}} command (without any subject) for information about the help system and jumping between subjects.<br />
<br />
== Configuration ==<br />
<br />
Vim's user-specific configuration file is located in the home directory: {{ic|~/.vimrc}}, and Vim files of current user are located inside {{ic|~/.vim/}}. The global configuration file is located at {{ic|/etc/vimrc}}. Global Vim files such as {{ic|defaults.vim}} and {{ic|archlinux.vim}} are located inside {{ic|/usr/share/vim/}}.<br />
<br />
{{Note|Commonly expected behavior such as syntax highlighting is enabled in {{ic|defaults.vim}}, which is loaded when no {{ic|~/.vimrc}} is present. Add {{ic|1=let skip_defaults_vim=1}} to {{ic|/etc/vimrc}} to disable loading of {{ic|defaults.vim}} completely. [https://github.com/vim/vim/issues/1033]<br />
Alternatively, to enable {{ic|defaults.vim}} even when {{ic|~/.vimrc}} is present, see {{ic|:h defaults}} in vim. }}<br />
<br />
=== Clipboard ===<br />
<br />
Vim commands such as {{ic|:yank}} or {{ic|:paste}} operate with the unnamed register, which by default corresponds to the {{ic|"*}} register. If the {{ic|+clipboard}} feature is available, the {{ic|"*}} register is reflected to the {{ic|PRIMARY}} buffer in X.<br />
<br />
To change the default register, you can {{ic|1=:set clipboard=unnamedplus}} to use the {{ic|"+}} register instead. The {{ic|"+}} register corresponds to the {{ic|CLIPBOARD}} buffer in X.<br />
<br />
For more information, see {{ic|:help 'clipboard'}}.<br />
<br />
{{Tip|Custom shortcuts for copy and paste operations can be created. See e.g. [http://superuser.com/a/189198] for binding {{ic|Ctrl+c}}, {{ic|Ctrl+v}} and {{ic|Ctrl+x}}.}}<br />
<br />
=== Syntax highlighting ===<br />
<br />
To enable syntax highlighting for many programming languages:<br />
<br />
:filetype plugin on<br />
:syntax on<br />
<br />
=== Indentation ===<br />
<br />
{{Expansion|Describe the {{ic|autoindent}} and {{ic|smartindent}} options.}}<br />
<br />
The indent file for specific file types can be loaded with:<br />
<br />
:filetype indent on<br />
<br />
=== Visual wrapping ===<br />
<br />
The {{ic|wrap}} option is on by default, which instructs Vim to wrap lines longer than the width of the window, so that the rest of the line is displayed on the next line. The {{ic|wrap}} option only affects how text is displayed, the text itself is not modified.<br />
<br />
The wrapping normally occurs after the last character that fits the window, even when it is in the middle of a word. More intelligent wrapping can be controlled with the {{ic|linebreak}} option. When it is enabled with {{ic|set linebreak}}, the wrapping occurs after characters listed in the {{ic|breakat}} string option, which by default contains a space and some punctuation marks (see {{ic|:help breakat}}).<br />
<br />
Wrapped lines are normally displayed at the beginning of the next line, regardless of any indentation. The [https://retracile.net/wiki/VimBreakIndent breakindent] option instructs Vim to take indentation into account when wrapping long lines, so that the wrapped lines keep the same indentation of the previously displayed line. The behaviour of {{ic|breakindent}} can be fine-tuned with the {{ic|breakindentopt}} option, for example to shift the wrapped line another four spaces to the right for Python files (see {{ic|:help breakindentopt}} for details):<br />
<br />
autocmd FileType python set breakindentopt=shift:4<br />
<br />
=== Using the mouse ===<br />
<br />
Vim has the ability to make use of the mouse, but it only works for certain terminals:<br />
* [[xterm]]/[[urxvt]]-based terminal emulators<br />
* Linux console with {{Pkg|gpm}} (see [[Console mouse support]] for details)<br />
* [[PuTTY]]<br />
<br />
To enable this feature, add this line into {{ic|~/.vimrc}}:<br />
<br />
set mouse=a<br />
<br />
The {{ic|1=mouse=a}} option is set in {{ic|defaults.vim}}.<br />
<br />
{{Note|Copy/paste will use the {{ic|"*}} register if there is access to an X server, see the [[#Clipboard]] section. The xterm handling of the mouse buttons can still be used by keeping the {{ic|shift key}} pressed.}}<br />
<br />
=== Traverse line breaks with arrow keys ===<br />
<br />
By default, pressing {{ic|←}} at the beginning of a line, or pressing {{ic|→}} at the end of a line, will not let the cursor traverse to the previous, or following, line.<br />
<br />
The default behavior can be changed by adding {{ic|1=set whichwrap=b,s,<,>,[,]}} to your {{ic|~/.vimrc}} file.<br />
<br />
== Merging files ==<br />
<br />
Vim includes a diff editor (a program that shows differences between two or more files and aids to conveniently merge them). Use ''vimdiff'' to run the diff editor — just specify some couple of files to it: {{ic|vimdiff ''file1'' ''file2''}}. Here is the list of ''vimdiff''-specific commands.<br />
<br />
{| class="wikitable"<br />
! Action !! Shortcut<br />
|-<br />
| next change || {{ic|]c}}<br />
|-<br />
| previous change || {{ic|[c}}<br />
|-<br />
| diff obtain || {{ic|do}}<br />
|-<br />
| diff put || {{ic|dp}}<br />
|-<br />
| fold open || {{ic|zo}}<br />
|-<br />
| fold close || {{ic|zc}}<br />
|-<br />
| rescan files || {{ic|:diffupdate}}<br />
|}<br />
<br />
== Tips and tricks ==<br />
<br />
=== Line numbers ===<br />
<br />
To show the line number column, use {{ic|:set number}}. By default absolute line numbers are shown, relative numbers can be enabled with {{ic|:set relativenumber}}.<br />
<br />
Jumping to a specific line is possible with {{ic|:''line number''}} or {{ic|''line number''gg}}. Jumps are remembered in a jump list, see {{ic|:h jump-motions}} for details.<br />
<br />
=== Spell checking ===<br />
<br />
Vim has the ability to do spell checking, enable by entering:<br />
<br />
set spell<br />
<br />
By default, only English language dictionaries are installed. More dictionaries can be found in the [[official repositories]] by searching for {{ic|vim-spell}}. Additional dictionaries can be found in the [http://ftp.vim.org/vim/runtime/spell/ Vim's FTP archive]. Additional dictionaries can be put in the folder {{ic|~/.vim/spell/}} and enabled with the command: {{ic|1=:setlocal spell spelllang=''en_us''}} (replacing the {{ic|''en_us''}} with the name of the needed dictionary).<br />
<br />
{| class="wikitable"<br />
! Action !! Shortcut<br />
|-<br />
| next spelling || {{ic|]s}}<br />
|-<br />
| previous spelling || {{ic|[s}}<br />
|-<br />
| spelling suggestions || {{ic|1=z=}}<br />
|-<br />
| spelling good, add || {{ic|zg}}<br />
|-<br />
| spelling good, session || {{ic|zG}}<br />
|-<br />
| spelling wrong, add || {{ic|zw}}<br />
|-<br />
| spelling wrong, session || {{ic|zW}}<br />
|-<br />
| spelling repeat all in file || {{ic|:spellr}}<br />
|}<br />
<br />
{{Tip|<br />
* To enable spelling in two languages (for instance English and German), add {{ic|1=set spelllang=''en,de''}} into your {{ic|~/.vimrc}} or {{ic|/etc/vimrc}}, and then restart Vim.<br />
* You can enable spell checking for arbitrary file types (e.g. ''.txt'') by using the FileType plugin and a custom rule for file type detection. To enable spell checking for any file ending with ''.txt'', create the file {{ic|/usr/share/vim/vimfiles/ftdetect/plaintext.vim}}, and insert the line {{ic|autocmd BufRead,BufNewFile *.txt setfiletype plaintext}} into that file. Next, insert the line {{ic|1=autocmd FileType plaintext setlocal spell spelllang=''en_us''}} into your {{ic|~/.vimrc}} or {{ic|/etc/vimrc}}, and then restart Vim. Alternatively, one can simply insert the line {{ic|autocmd BufRead,BufNewFile *.txt setlocal spell}} into their {{ic|~/.vimrc}} or {{ic|/etc/vimrc}}, and then restart Vim. Be sure to edit this line (specifically {{ic|*.txt}}) to include the filetype(s) intended for spell checking.<br />
* To enable spell checking for LaTeX (or TeX) documents only, add {{ic|1=autocmd FileType '''tex''' setlocal spell spelllang=''en_us''}} into your {{ic|~/.vimrc}} or {{ic|/etc/vimrc}}, and then restart Vim.}}<br />
<br />
=== Saving runtime state ===<br />
<br />
Normally, exiting {{ic|vim}} discards all unessential information such as opened files, command line history, yanked text etc. Preserving this information can be configured in the following ways.<br />
<br />
==== viminfo files ====<br />
<br />
The {{ic|viminfo}} file may also be used to store command line history, search string history, input-line history, registers' content, marks for files, location marks within files, last search/substitute pattern (to be used in search mode with {{ic|n}} and {{ic|&}} within the session), buffer list, and any global variables you may have defined. For the {{ic|viminfo}} modality to be available, the version of {{ic|vim}} you installed must have been compiled with the {{ic|+viminfo}} feature.<br />
<br />
Configure what is kept in your {{ic|viminfo}} file, by adding (for example) the following to your {{ic|~/.vimrc}} file:<br />
<br />
set viminfo='10,<100,:100,%,n~/.vim/.viminfo<br />
<br />
where each parameter is preceded by an identifier:<br />
'q : q, number of edited file remembered<br />
<m : m, number of lines saved for each register<br />
:p : p, number of history cmd lines remembered<br />
% : saves and restore the buffer list<br />
n...: fully qualified path to the viminfo files (note that this is a literal "''n''")<br />
<br />
See the official [http://vimdoc.sourceforge.net/htmldoc/options.html#'viminfo' viminfo documentation] for particulars on how a pre-existing {{ic|viminfo}} file is modified as it is updated with current session information, say from several buffers in the current session you are in the process of exiting.<br />
<br />
==== Session files ====<br />
<br />
Session files can be used to save the state of any number of particular sessions over time. One distinct session file may be used for each session or project of your interest. For that modality to be available, the version of {{ic|vim}} you installed must have been compiled with the {{ic|+mksession}} feature. <br />
<br />
Within a session, {{ic|:mksession[!] [''my_session_name.vim'']}} will write a vim-script to {{ic|''my_session_name.vim''}} in the current directory, or {{ic|Session.vim}} by default if you choose ''not'' to provide a file name. The optional {{ic|!}} will clobber a pre-existing session file with the same name and path.<br />
<br />
A {{ic|vim}} session can be resumed either when starting ''vim'' from terminal:<br />
$ vim -S [''my_session_name.vim'']<br />
<br />
Or in an already opened session buffer by running the vim command:<br />
:source ''my_session_name.vim''<br />
<br />
Exactly what is saved and additional details on session files options are extensively covered in the [http://vimdoc.sourceforge.net/htmldoc/usr_21.html#21.4 vim documentation]. Commented examples are found [http://vim.wikia.com/wiki/Go_away_and_come_back here].<br />
<br />
==== Saving cursor position ====<br />
<br />
See [http://vim.wikia.com/wiki/Restore_cursor_to_file_position_in_previous_editing_session Restore cursor to file position in previous editing session] on the Vim wiki.<br />
<br />
=== Replace vi command with Vim ===<br />
<br />
Create an [[alias]] for {{ic|vi}} to {{ic|vim}}.<br />
<br />
Alternatively, if you want to be able to type {{ic|sudo vi}} and get {{ic|vim}}, install {{AUR|vi-vim-symlink}} which will remove {{ic|vi}} and replace it with a symlink to {{ic|vim}}.<br />
<br />
=== DOS/Windows carriage returns ===<br />
<br />
If there is a {{ic|^M}} at the end of each line then this means you are editing a text file which was created in MS-DOS or Windows. This is because in Linux only a single line feed character (LF) used for line break, but in Windows/MS DOS systems they are using a sequence of a carriage return (CR) and a line feed (LF) for the same. And this carriage returns are displayed as {{ic|^M}}.<br />
<br />
To remove all carriage returns from a file do:<br />
<br />
:%s/^M//g<br />
<br />
Note that there {{ic|^}} is a control letter. To enter the control sequence {{ic|^M}} press {{ic|Ctrl+v,Ctrl+m}}.<br />
<br />
Alternatively install the package {{pkg|dos2unix}} and run {{ic|dos2unix ''file''}} to fix the file.<br />
<br />
{{Note| Another simple way is by changing {{ic|fileformat}} setting. {{ic|<nowiki>set ff=unix</nowiki>}} to convert files with DOS/Windows line ending to Unix line ending. To do the reverse, just issue {{ic|<nowiki>set ff=dos</nowiki>}} to convert files with Unix line ending to DOS/Windows line ending. }}<br />
<br />
=== Empty space at the bottom of gVim windows ===<br />
<br />
When using a [[window manager]] configured to ignore window size hints, gVim will fill the non-functional area with the GTK theme background color.<br />
<br />
The solution is to adjust how much space gVim reserves at the bottom of the window. Put the following line in {{ic|~/.vimrc}}:<br />
<br />
set guiheadroom=0<br />
<br />
{{Note|If you set it to zero, you will not be able to see the bottom horizontal scrollbar.}}<br />
<br />
=== Vim as a pager ===<br />
<br />
Using scripts Vim can be used as a [[terminal pager]], so that you get various vim features such as color schemes.<br />
<br />
Vim comes with the {{ic|/usr/share/vim/vim81/macros/less.sh}} script, for which you can create an [[alias]].<br />
<br />
Alternatively there is also the {{Pkg|vimpager}} Vim script. To change the default pager, [[export]] the {{ic|PAGER}} environment variable.<br />
<br />
== Plugins ==<br />
<br />
Adding plugins to Vim can increase your productivity. Plugins can alter Vim's UI, add new commands, code completion support, integrate other programs and utilities with Vim, add support for additional languages and more.<br />
<br />
{{Tip|For a list of popular plugins, see [http://vimawesome.com/ Vim Awesome]}}<br />
<br />
=== Installation ===<br />
<br />
==== Using the built-in package manager ====<br />
<br />
Vim 8 added the possibility to load third-party plugins natively. It is possible to use this functionality by storing third-party packages in {{ic|~/.vim/pack/foo}}.<br />
<br />
==== Using a plugin manager ====<br />
<br />
A plugin manager installs and manages Vim plugins in a similar way independent of which platform on you are running Vim. It is a plugin that acts as a package manager for other Vim plugins.<br />
<br />
* [https://github.com/gmarik/Vundle.vim Vundle] is currently the most popular plugin manager for Vim, available as {{AUR|vundle}} or {{AUR|vundle-git}}.<br />
* [https://github.com/junegunn/vim-plug Vim-plug] is a minimalist Vim plugin manager with many features like on-demand plugin loading and parallel updating, available as {{AUR|vim-plug}} or {{AUR|vim-plug-git}}.<br />
* [https://github.com/tpope/vim-pathogen pathogen.vim] is a simple plugin for managing Vim's runtimepath, available as {{AUR|vim-pathogen}} or {{AUR|vim-pathogen-git}}.<br />
* [https://github.com/Shougo/dein.vim Dein.vim] is a plugin manager replacing [https://github.com/Shougo/neobundle.vim NeoBundle], available as {{AUR|vim-dein}} or {{AUR|vim-dein-git}}.<br />
<br />
==== From Arch repositories ====<br />
<br />
The {{Grp|vim-plugins}} group provides many various plugins. Use {{ic|pacman -Sg vim-plugins}} command to list available packages which you can then [[install]] with pacman.<br />
<br />
=== cscope ===<br />
<br />
[http://cscope.sourceforge.net/ Cscope] is a tool for browsing a project. By navigating to a word/symbol/function and calling cscope (usually with shortcut keys) it can find: functions calling the function, the function definition, and more.<br />
<br />
[[Install]] the {{Pkg|cscope}} package.<br />
<br />
Copy the cscope default file where it will be automatically read by Vim:<br />
<br />
mkdir -p ~/.vim/plugin<br />
wget -P ~/.vim/plugin http://cscope.sourceforge.net/cscope_maps.vim<br />
<br />
{{Note|You will probably need to uncomment these lines in {{ic|~/.vim/plugin/cscope_maps.vim}} in order to enable cscope shortcuts in Vim 7.x:<br />
{{bc|1=<br />
set timeoutlen=4000<br />
set ttimeout<br />
}}}}<br />
<br />
Create a file which contains the list of files you wish cscope to index (cscope can handle many languages but this example finds ''.c'', ''.cpp'' and ''.h'' files, specific for C/C++ project):<br />
<br />
cd ''/path/to/project/dir''<br />
find . -type f -print | grep -E '\.(c(pp)?|h)$' > cscope.files<br />
<br />
Create database files that cscope will read:<br />
<br />
cscope -bq<br />
<br />
{{Note|You must browse your project files from this location or set and export the {{ic|$CSCOPE_DB}} variable, pointing it to the {{ic|cscope.out}} file.}}<br />
<br />
Default keyboard shortcuts:<br />
<br />
Ctrl-\ and<br />
c: Find functions calling this function<br />
d: Find functions called by this function<br />
e: Find this egrep pattern<br />
f: Find this file<br />
g: Find this definition<br />
i: Find files #including this file<br />
s: Find this C symbol<br />
t: Find assignments to<br />
<br />
Feel free to change the shortcuts.<br />
<br />
#Maps ctrl-c to find functions calling the function<br />
nnoremap <C-c> :cs find c <C-R>=expand("<cword>")<CR><CR><br />
<br />
=== Taglist ===<br />
<br />
[http://vim-taglist.sourceforge.net/ Taglist] provides an overview of the structure of source code files and allows you to efficiently browse through source code files in different programming languages.<br />
<br />
[[Install]] the {{Pkg|vim-taglist}} package.<br />
<br />
Useful options to be put in {{ic|~/.vimrc}}:<br />
<br />
let Tlist_Compact_Format = 1<br />
let Tlist_GainFocus_On_ToggleOpen = 1<br />
let Tlist_Close_On_Select = 1<br />
nnoremap <C-l> :TlistToggle<CR><br />
<br />
== See also ==<br />
<br />
=== Official ===<br />
<br />
* [http://www.vim.org/ Homepage]<br />
* [http://vimdoc.sourceforge.net/ Documentation]<br />
* [http://vim.wikia.com Vim Wiki]<br />
* [http://www.vim.org/scripts/ Vim Scripts]<br />
<br />
=== Tutorials ===<br />
<br />
* [https://danielmiessler.com/study/vim/ vim Tutorial and Primer]<br />
* [https://web.archive.org/web/20140822135551/http://usalug.com/vi.html vi Tutorial and Reference Guide]<br />
* [http://www.viemu.com/a_vi_vim_graphical_cheat_sheet_tutorial.html Graphical vi-Vim Cheat Sheet and Tutorial]<br />
* [http://blog.interlinked.org/tutorials/vim_tutorial.html Vim Introduction and Tutorial]<br />
* [http://www.openvim.com/ Open Vim] — collection of Vim learning tools<br />
* [http://yannesposito.com/Scratch/en/blog/Learn-Vim-Progressively/ Learn Vim Progressively]<br />
* [http://benmccormick.org/learning-vim-in-2014/ Learning Vim in 2014]<br />
* [http://www.moolenaar.net/habits.html Seven habits of effective text editing]<br />
* [http://bencrowder.net/files/vim-fu/ Basic Vim Tips]<br />
<br />
==== Videos ====<br />
<br />
* [http://vimcasts.org/ Vimcasts] — screencasts in ''.ogg'' format.<br />
* [http://derekwyatt.org/vim/tutorials/ Vim Tutorial Videos] — covering the basics up to advanced topics.<br />
<br />
==== Cheat sheets ====<br />
<br />
* https://devhints.io/vim<br />
* https://vim.rtorr.com/ - A mobile friendly Vim cheat sheet - [https://github.com/rtorr/vim-cheat-sheet Sources]<br />
<br />
==== Games ====<br />
<br />
* [http://vim-adventures.com/ Vim Adventures]<br />
* [http://vimgolf.com/ VimGolf]<br />
<br />
=== Configuration ===<br />
<br />
* [https://web.archive.org/web/20131020125020/http://nion.modprobe.de/setup/vimrc nion's]<br />
* [https://web.archive.org/web/20170222115910/http://amix.dk/vim/vimrc.html A detailed configuration from Amir Salihefendic]<br />
* [https://web.archive.org/web/20131004071740/http://www.jukie.net/~bart/conf/vimrc Bart Trojanowski]<br />
* [https://github.com/spf13/spf13-vim Steve Francia's Vim Distribution]<br />
* [http://vimawesome.com/ Vim Awesome] - Vim Plugins<br />
* [https://github.com/W4RH4WK/dotVim W4RH4WK's Vim configuration]<br />
* [https://www.askapache.com/linux/fast-vimrc/ Fast vimrc/colorscheme from askapache]<br />
* [https://gist.github.com/anonymous/c966c0757f62b451bffa Basic vimrc]<br />
* [http://www.usevim.com/ Usevim]<br />
<br />
==== Colors ====<br />
<br />
* [http://bytefluent.com/vivify/ Vivify]<br />
* [https://linuxtidbits.wordpress.com/2014/10/14/vim-customize-installed-colorschemes/ Vim colorscheme customization]</div>Dlwilson88https://wiki.archlinux.org/index.php?title=User_talk:Dlwilson88&diff=570397User talk:Dlwilson882019-04-03T05:54:49Z<p>Dlwilson88: Personal reminder</p>
<hr />
<div>Todo: Make my user page worth looking at.<br />
1. Add content worth reading.<br />
2. Return very soon to implement any and all changes.<br />
3. A little less procrastination and a little more motivation!</div>Dlwilson88https://wiki.archlinux.org/index.php?title=User:Dlwilson88&diff=570396User:Dlwilson882019-04-03T05:51:13Z<p>Dlwilson88: starting my own personal wiki user page</p>
<hr />
<div>This is the beginning of my personal wiki page</div>Dlwilson88https://wiki.archlinux.org/index.php?title=Cursor_themes&diff=570393Cursor themes2019-04-03T02:43:22Z<p>Dlwilson88: the word cursors was split curso {{ic|~/.Xresources}}rs. Mover the rs back to the end of curso.</p>
<hr />
<div>[[Category:X server]]<br />
[[Category:Eye candy]]<br />
[[es:Cursor themes]]<br />
[[it:Cursor themes]]<br />
[[ja:カーソルテーマ]]<br />
[[pt:Cursor themes]]<br />
[[ru:Cursor themes]]<br />
[[zh-hans:Cursor themes]]<br />
The display server is accompanied by a ''cursor theme'' that helps various aspects of GUI navigation and manipulation. The display server includes a cursor theme, however, other cursor themes can be installed and selected.<br />
<br />
== Installation ==<br />
<br />
Installation can be done with a package, or downloaded and extracted to an appropriate directory.<br />
<br />
=== Packages ===<br />
<br />
Cursors themes are available in the:<br />
<br />
* [[Official repositories]] — [https://www.archlinux.org/packages/?sort=&q=xcursor-&maintainer=&last_update=&flagged=&limit=50 "xcursor-" search].<br />
* [[AUR]] — [https://aur.archlinux.org/packages.php?O=0&L=0&C=17&K=cursor&SeB=nd&SB=n&SO=a&PP=50&do_Search=Go "cursor" search].<br />
<br />
=== Manually ===<br />
<br />
If a cursor theme is not available in the official repositories or the AUR, it can be added manually. A number of websites exist where cursor themes can be downloaded. Once downloaded, they need to be put in the ''icons'' directory (as cursors have the ability to be bundled with icon themes).<br />
<br />
Some websites that have cursor themes:<br />
<br />
* [https://www.gnome-look.org/browse/cat/107/ord/latest/ GNOME Look]<br />
* [http://www.customize.org/list/xcursors Customize.org]<br />
* [https://www.deviantart.com/browse/all/customization/skins/linuxutil/x11cursors/ Deviant Art]<br />
* [https://www.opendesktop.org/browse/cat/107/ Open Desktop]<br />
<br />
For ''user-specific'' installation, use the {{ic|~/.icons/}} directory. Extract them with this command that will work for most archives:<br />
<br />
$ tar xvf foobar-cursor-theme.tar.gz -C ~/.icons<br />
<br />
The cursor theme directory structure is {{ic|theme-name/cursors}}, for example: {{ic|~/.icons/''theme''/cursors/}}; make sure the extracted files follow this structure.<br />
<br />
{{Note|For ''system-wide'' installation the {{ic|/usr/share/icons}} directory is used. Direct extraction to this directory is usually discouraged as files here are not tracked by [[pacman]]; it is recommended to create a [[PKGBUILD|package]] for the cursor theme instead.}}<br />
<br />
Already installed cursor themes can be viewed with the command:<br />
<br />
find /usr/share/icons ~/.icons -type d -name "cursors"<br />
<br />
If the package includes an {{ic|index.theme}} file, check if there is an "Inherits" line inside. If yes, check whether the inherited theme also exists on the system (rename if needed).<br />
<br />
== Configuration ==<br />
<br />
There are various ways to set the cursor theme.<br />
<br />
=== XDG specification ===<br />
<br />
This method applies to both [[X11]] and [[Wayland]] cursor themes. <br />
<br />
For ''user-specific'' configuration, create or edit {{ic|~/.icons/default/index.theme}}; for ''system-wide'' configuration, one can edit {{ic|/usr/share/icons/default/index.theme}}.<br />
<br />
The {{ic|Inherits}} option in the {{ic|[icon theme]}} section must be set to the xcursor theme directory name {{ic|''cursor_theme_name''}}, for example {{ic|xcursor-breeze-snow}}:<br />
<br />
{{hc|~/.icons/default/index.theme|2=<br />
[icon theme] <br />
Inherits=''cursor_theme_name''}}<br />
<br />
You should then edit {{ic|~/.config/gtk-3.0/settings.ini}}, replacing the {{ic|''cursor_theme_name''}} with the chosen one: <br />
<br />
{{hc|~/.config/gtk-3.0/settings.ini|2=<br />
[Settings]<br />
gtk-cursor-theme-name=''cursor_theme_name''}}<br />
<br />
Re-login for the changes to take effect.<br />
<br />
=== LXAppearance ===<br />
<br />
[[LXDE#Cursors|LXAppearance]] sets the default cursor by creating an {{ic|~/.icons/default/index.theme}} file: if you edited that file manually, LXAppearance will overwrite it. Remember to also edit {{ic|~/.config/gtk-3.0/settings.ini}} manually as specified in [[#XDG specification]], because applications like Firefox use this setting instead.<br />
<br />
=== Desktop environments ===<br />
<br />
[[Desktop environments]] use the [http://standards.freedesktop.org/xsettings-spec/xsettings-spec-0.5.html XSETTINGS protocol], typically implemented through a settings daemon. While this allows to change the cursor on-the-fly, the applied theme may be inconsistent across applications. See [[#XDG specification]] to change the cursor theme manually.<br />
<br />
==== GNOME ====<br />
<br />
To change the theme in [[GNOME]], use {{Pkg|gnome-tweaks}} or set the configuration directly with:<br />
<br />
gsettings set org.gnome.desktop.interface cursor-theme ''cursor_theme_name''<br />
<br />
Change the cursor size with (depending on the theme, sizes are 24, 32, 48, 64):<br />
<br />
gsettings set org.gnome.desktop.interface cursor-size ''cursor_theme_size''<br />
<br />
==== MATE ====<br />
<br />
In MATE one can use mate-control-center or gsettings. To change the theme:<br />
<br />
gsettings set org.mate.peripherals-mouse cursor-theme ''cursor_theme_name''<br />
<br />
To change the size:<br />
<br />
gsettings set org.mate.peripherals-mouse ''theme-size''<br />
<br />
==== XFCE ====<br />
<br />
To change the xcursor theme, use:<br />
<br />
xfconf-query --channel xsettings --property /Gtk/CursorThemeName --set ''cursor_theme_name''<br />
<br />
To change the size:<br />
<br />
xfconf-query --channel xsettings --property /Gtk/CursorThemeSize --set ''cursor_theme_size''<br />
<br />
=== X resources ===<br />
<br />
To locally name a cursor theme, add to the {{ic|~/.Xresources}} file:<br />
<br />
Xcursor.theme: cursor-theme<br />
<br />
To have the cursor theme properly loaded it will need to be done so by the window manager; if it does not, it can be forced to load prior the window manager by putting the following command in {{ic|~/.xinitrc}} or [[.xprofile]] (depending on ones personal setup):<br />
<br />
$ xrdb ~/.Xresources<br />
<br />
Optionally, add this line to {{ic|~/.Xresources}} if your cursor theme supports multiple sizes:<br />
<br />
Xcursor.size: 16<br />
<br />
{{Tip|32, 48 or 64 may also be good size.}}<br />
<br />
If in doubt over supported cursor sizes, start X without this setting and let it choose the cursor size automatically. (Refer to your window manager documentation for details.)<br />
<br />
=== Environment variable ===<br />
<br />
You can use an [[environment variable]] to set a theme for a single application to try it out temporarily, for example:<br />
<br />
$ XCURSOR_THEME=SomeThemeName xclock<br />
<br />
XCURSOR_SIZE is optional if your cursor theme supports multiple sizes.<br />
<br />
=== Display managers ===<br />
<br />
Cursor theme can usually be set within a display manager, but keep in mind the cursor theme may not carry over to the user session. <br />
<br />
==== GDM ====<br />
<br />
See [[GDM#Changing the cursor theme]].<br />
<br />
== Troubleshooting ==<br />
<br />
=== Create links to missing cursors ===<br />
<br />
Applications may keep using the default cursors when a theme lacks some cursors. This can be corrected by adding links to the missing cursors. For example:<br />
<br />
$ cd ~/.icons/''theme''/cursors/<br />
$ ln -s right_ptr arrow<br />
$ ln -s cross crosshair<br />
$ ln -s right_ptr draft_large<br />
$ ln -s right_ptr draft_small<br />
$ ln -s cross plus<br />
$ ln -s left_ptr top_left_arrow<br />
$ ln -s cross tcross<br />
$ ln -s hand hand1<br />
$ ln -s hand hand2<br />
$ ln -s left_side left_tee<br />
$ ln -s left_ptr ul_angle<br />
$ ln -s left_ptr ur_angle<br />
$ ln -s left_ptr_watch 08e8e1c95fe2fc01f976f1e063a24ccd<br />
<br />
If the above does not solve the problem, look in {{ic|/usr/share/icons/whiteglass/cursors}} for additional cursors your theme may be missing, and create links for these as well.<br />
<br />
{{Tip|You can also remove unwanted cursors. To for example remove the "watch" cursor:<br />
<br />
$ cd ~/.icons/''theme''/cursors/<br />
$ rm watch left_ptr_watch<br />
$ ln -s left_ptr watch<br />
$ ln -s left_ptr left_ptr_watch<br />
}}<br />
<br />
=== Supplying missing cursors ===<br />
<br />
Some programs set their own custom cursors {{ic|~/.Xresources}} which you may want to override. A common example of this is rdesktop, which connects to a Microsoft Windows computer and uses the cursors obtained from the remote machine, which can often be difficult to see due to protocol limitations yielding poor conversion quality.<br />
<br />
This can be resolved by replacing these cursors with ones from the same (or another) cursor theme. In order to do this, the '''hash''' of the image must be obtained. This is done by setting the {{ic|XCURSOR_DISCOVER}} environment variable prior to launching the application that sets these cursors:<br />
<br />
$ XCURSOR_DISCOVER=1 rdesktop ...<br />
<br />
The first time (and only the first time) the cursor is set, some details will be displayed, like this:<br />
<br />
Cursor image name: 24020000002800000528000084810000<br />
...<br />
Cursor image name: 7bf1cc07d310bf080118007e08fc30ff<br />
...<br />
Cursor hash 24020000002800000528000084810000 returns 0x0<br />
<br />
When Xcursor looks for missing cursors, the search path includes {{ic|~/.icons/default/cursors}} so this is where an image can be placed for Xcursor to find. First, create this directory if it does not already exist:<br />
<br />
$ mkdir -p ~/.icons/default/cursors<br />
<br />
Then link the hash to the target image. Here we are using the {{ic|left_ptr}} image from the {{ic|Vanilla-DMZ}} cursor theme:<br />
<br />
$ ln -s /usr/share/icons/Vanilla-DMZ/cursors/left_ptr ~/.icons/default/cursors/24020000002800000528000084810000<br />
<br />
The change will be visible as soon as the application is restarted. No special method of launching the application is required.<br />
<br />
==== rdesktop ====<br />
<br />
Here are some common Microsoft Windows cursors that rdesktop uses when connecting to a remote machine running Windows 7. Unfortunately, animated cursors are difficult to override as they are sent frame-by-frame, so one mapping will be needed for every frame!<br />
<br />
$ ln -s /usr/share/icons/$THEME/cursors/xterm ~/.icons/default/cursors/00000000017e000002fc000000000000<br />
$ ln -s /usr/share/icons/$THEME/cursors/right_ptr ~/.icons/default/cursors/00000093000010860000631100006609<br />
$ ln -s /usr/share/icons/$THEME/cursors/plus ~/.icons/default/cursors/01e00000201c00004038000080300000<br />
$ ln -s /usr/share/icons/$THEME/cursors/left_ptr ~/.icons/default/cursors/24020000002800000528000084810000<br />
$ ln -s /usr/share/icons/$THEME/cursors/left_ptr_watch ~/.icons/default/cursors/6ce0180090108e0005814700a0021400<br />
$ ln -s /usr/share/icons/$THEME/cursors/hand ~/.icons/default/cursors/d2201000a2c622004385440041308800<br />
$ ln -s /usr/share/icons/$THEME/cursors/watch ~/.icons/default/cursors/fc618c00da110f0034fd0e004e082400<br />
<br />
=== Change X shaped default cursor ===<br />
<br />
The default X shaped Xcursor appears in window managers that do not set the default cursor to left_ptr or in window managers using XCB (like [[awesome]]) instead of Xlib.<br />
<br />
To fix this simply add the following to your {{ic|~/.xinitrc}} , xsession or window managers startup configuration if possible (for example bspwm's bspwmrc). <br />
$ xsetroot -cursor_name left_ptr<br />
<br />
The list of cursor styles is in [https://tronche.com/gui/x/xlib/appendix/b/ appendix B] of the X protocol.<br />
<br />
=== .Xdefaults ===<br />
<br />
If you have conflicting cursors then it might be because a different cursor has been set in the {{ic|~/.Xdefaults}} file.<br />
<br />
<br />
=== Cursor size doesn't change on startup ===<br />
<br />
If you are trying to change cursor size via {{ic|~/.Xresources}} in your {{ic|~/.xinitrc}} and it doesn't work, make sure that xrandr runs before loading {{ic|~/.Xresources}}.<br />
<br />
Make sure your {{ic|~/.Xresources}} looks similar to the following<br />
<br />
{{hc|~/.xinitrc|2=<br />
xrandr &&<br />
...<br />
xrdb --merge ~/.Xresources &&<br />
exec wm}}<br />
<br />
== See also ==<br />
<br />
* {{man|3|Xcursor}} — For more information about cursors in X (supported directories, formats, compatibility, etc.).</div>Dlwilson88https://wiki.archlinux.org/index.php?title=Multihead&diff=570020Multihead2019-03-29T02:43:22Z<p>Dlwilson88: placed several commas, corrected a few misspelled words and added a determiner before the noun time.</p>
<hr />
<div>[[Category:X server]]<br />
[[ja:マルチディスプレイ]]<br />
[[fa:Multihead]]<br />
[[zh-hans:Multihead]]<br />
{{Related articles start}}<br />
{{Related|Xorg}}<br />
{{Related|xrandr}}<br />
{{Related|NVIDIA#Multiple monitors}}<br />
{{Related|Nouveau#Dual Head}}<br />
{{Related|AMD Catalyst#Double Screen (Dual Head / Dual Screen / Xinerama)}}<br />
{{Related|ATI#Multihead setup}}<br />
{{Related|Extreme Multihead}}<br />
{{Related articles end}}<br />
<br />
'''Multi-head''', '''multi-screen''', '''multi-display''' or '''multi-monitor''' represent a setup when multiple display devices are attached to a computer. This article provides general description of multiple multi-head setup methods, and provides some examples of configuration.<br />
<br />
{{Note|The terms used in this article are very specific to avoid confusion:<br />
* '''Monitor''' refers to a physical display device, such as an LCD panel.<br />
* '''Screen''' refers to an X-Window screen (that is: a '''monitor''' attached to a '''display''').<br />
* '''Display''' refers to a collection of '''screens''' that are in use at the same time showing parts of a single desktop (you can drag windows among all '''screens''' in a single '''display''').<br />
}}<br />
<br />
== Historical background ==<br />
<br />
X Window System is the underlying graphical interface of most Unix/Linux computers providing a GUI. It was developed in 1984 at MIT. After about 35 years of development, tweaking and adding of new features and ideas, it is generally acknowledged to be a bit of a beast. It should be remembered that the common configuration at the time of development was a single running X providing individual views to Xterminals in a [[Wikipedia: Time-sharing|time-sharing]] system. Nowadays the standard is X providing a single screen on a desktop or laptop.<br />
<br />
{{Note|There is still a rare configuration often called [[Xorg multiseat|Zaphod display]], which allows multiple users of a single computer to each have an independent set of display's, mouse, and keyboard, as though they were using separate computers, but at a lower per-seat cost.}}<br />
<br />
All of this means that there are many ways of achieving the same thing and many slightly different things that can meet the same purpose. In modern X versions sometimes you can get away with limited or no configuration. In the last few years, the boast is that X is self-configuring. Certainly, the best practice rule of thumb is less configuration is better - that is ''only configure what is wrong''.<br />
<br />
== Separate screens ==<br />
<br />
This is the original way of configuring multiple monitors with X, and it has been around for decades. Each physical monitor is assigned as an X screen, and while you can move the mouse between them, they are more or less independent.<br />
<br />
Normally the X display has a single identifier such as {{ic|:0}} set in the {{ic|DISPLAY}} environment variable, but in this configuration each screen has a different {{ic|$DISPLAY}} value. The first screen is {{ic|:0.0}}, the second is {{ic|:0.1}} and so on.<br />
<br />
With this configuration, it is not possible to move windows between screens, apart from a few special programs like GIMP and Emacs which have multi-screen support. For most programs you must change the {{ic|DISPLAY}} environment variable when launching to have the program appear on another screen:<br />
<br />
# Launch a terminal on the second screen<br />
$ DISPLAY=:0.1 urxvt &<br />
<br />
Alternatively, if you have a terminal on each screen launching programs will inherit the {{ic|DISPLAY}} value and appear on the same screen they were launched on. But moving an application between screens involves closing it and reopening it again on the other screen.<br />
<br />
Working this way does have certain advantages, such as windows popping up on one screen won't steal the focus away from you if you are working on another screen - each screen is quite independent.<br />
<br />
== RandR ==<br />
<br />
[[Wikipedia:RandR|RandR]] ('''R'''otate '''and''' '''R'''esize) is an [[Wikipedia:X Window System|X Window System]] extension, which allows clients to dynamically change (e.g. resize, rotate, reflect) screens. In most cases, it can fully replace the old Xinerama setup. See [http://i3wm.org/docs/multi-monitor.html#_the_explanation an explanation] why RandR is better than Xinerama.<br />
<br />
RandR can be configured for the current session via the [[xrandr]] tool, arandr or persistently via an [[xorg.conf]] file.<br />
<br />
{{Note|There are multiple ways to configure the same thing, you might have to experiment a little before you find the best configuration.}}<br />
<br />
=== Configuration using arandr ===<br />
<br />
{{Move|xrandr|Not specific to this page.}}<br />
<br />
arandr can graphically arrange your monitors, change resolutions, and save a script to duplicate your setup. By default, if you "Save As" it will be saved in {{ic|~/.screenlayout/}}. These files can then be added to your {{ic|~/.profile}}. Sometimes problems arise from running the arandr script too soon after login.<br />
<br />
{{Accuracy|Graphical things don't belong into {{ic|~/.profile}}.}}<br />
<br />
Edit {{ic|~/.profile}}<br />
<br />
$ sleep 3<br />
$ /home/<user>/.screenlayout/myLayout.sh<br />
<br />
=== Configuration using xrandr ===<br />
<br />
{{Note|This section assumes that you have read the [[xrandr]] page for basic info about ''xrandr''.}}<br />
<br />
You may arrange your screens either relatively to each other (using the {{ic|--right-of}}, {{ic|--left-of}}, {{ic|--above}}, {{ic|--below}} options), or by absolute coordinates (using the {{ic|--pos}} option; note that in this case you usually need to know resolutions of your monitors). See {{man|1|xrandr}} for details. Some frequently used settings are described below.<br />
<br />
==== VGA1 left of HDMI1 at their preferred resolutions ====<br />
<br />
$ xrandr --output VGA1 --auto --output HDMI1 --auto --right-of VGA1<br />
<br />
{{ic|--right-of}} places the previous screen ({{ic|HDMI1}}) to the right of the specified screen ({{ic|VGA1}}).<br />
<br />
==== VGA1 right of HDMI1 at fixed resolutions ====<br />
<br />
$ xrandr --output VGA1 --mode 1024x768 --pos 1920x0 --output HDMI1 --mode 1920x1080 --pos 0x0<br />
<br />
or<br />
<br />
$ xrandr --output VGA1 --mode 1024x768 --output HDMI1 --mode 1920x1080 --left-of VGA1<br />
<br />
{{ic|--left-of}} places the previous screen ({{ic|HDMI1}}) to the left of the specified screen ({{ic|VGA1}}).<br />
<br />
==== Combine screens into virtual display ====<br />
<br />
Since randr version 1.5, it has been possible to combine monitors into one virtual display. This is an updated version of what was possible with Xinerama and works with open source drivers and does not require a Xorg restart. Some desktop environments do not support this feature yet. [[Openbox]] has been tested and works with this feature.<br />
<br />
Get monitor list by doing {{ic|xrandr --listmonitors}}<br />
<br />
0: +*DisplayPort-4 1920/518x1200/324+1920+0 DisplayPort-4<br />
1: +DisplayPort-3 1920/518x1200/324+0+0 DisplayPort-3<br />
2: +HDMI-A-0 1920/518x1200/324+3840+0 HDMI-A-0<br />
<br />
Create virtual display {{ic|xrandr --setmonitor SomeName auto DisplayPort-4,DisplayPort-3,HDMI-A-0}}. {{ic|auto}} determines the size of the virtual display, setting this to auto will automatically create the correct size of the display array. Monitor order in this command does not matter and the monitors need to be rearranged correctly after or before this command is executed. <br />
<br />
For a more detailed explanation see [http://www.straightrunning.com/tools/xrandr.html#sect3 this page].<br />
<br />
=== Configuration using xorg.conf ===<br />
<br />
This is similar to using ''xrandr'', separate {{ic|Monitor}} section is needed for each screen. As an {{ic|Identifier}}, the same value as reported by {{ic|xrandr -q}} is used (i.e. {{ic|Identifier "VGA1"}} is used instead of {{ic|--output VGA1}}).<br />
<br />
==== Example: dualhead configuration using relative coordinates ====<br />
<br />
{{hc|/etc/X11/xorg.conf.d/10-monitor.conf|<br />
Section "Monitor"<br />
Identifier "VGA1"<br />
Option "Primary" "true"<br />
EndSection<br />
<br />
Section "Monitor"<br />
Identifier "HDMI1"<br />
Option "LeftOf" "VGA1"<br />
EndSection<br />
}}<br />
<br />
==== Example: dualhead configuration using relative coordinates with custom resolutions ====<br />
The ID for each monitor can be found by running the {{ic|$ xrandr -q}} command and should be defined as {{ic|Monitor-<ID>}} inside the {{ic|Device}} section.<br />
<br />
See [[Xrandr#Adding undetected resolutions]].<br />
<br />
{{hc|/etc/X11/xorg.conf.d/10-monitor.conf|<br />
Section "Monitor"<br />
Identifier "DVI"<br />
Modeline "1680x1050_60.00" 146.25 1680 1784 1960 2240 1050 1053 1059 1089 -hsync +vsync<br />
Option "PreferredMode" "1680x1050_60.00"<br />
Option "LeftOf" "DP"<br />
Option "DPMS" "true"<br />
EndSection<br />
The noun phrase time seems to be missing a determiner before it.<br />
Section "Monitor"<br />
Identifier "DP"<br />
Modeline "1920x1080_60.00" 173.00 1920 2048 2248 2576 1080 1083 1088 1120 -hsync +vsync<br />
Option "PreferredMode" "1920x1080_60.00"<br />
Option "RightOf" "DVI"<br />
Option "DPMS" "true"<br />
EndSection<br />
<br />
Section "Screen"<br />
Identifier "Screen0"<br />
Device "Radeon" # e.g. Radeon, Intel, nvidia<br />
Monitor "DP"<br />
DefaultDepth 24<br />
SubSection "Display"<br />
Depth 24<br />
Virtual 3600 2130 # 1920 + 1680 (3600), 1080 + 1050 (2130)<br />
EndSubSection<br />
EndSection<br />
}}<br />
<br />
{{hc|/etc/X11/xorg.conf.d/20-radeon.conf|<br />
Section "Device"<br />
Identifier "Radeon"<br />
Driver "radeon"<br />
Option "Monitor-DVI-0" "DVI" # use DVI-0 as DVI<br />
Option "Monitor-DisplayPort-0" "DP"<br />
EndSection<br />
}}<br />
<br />
==== Example: dualhead configuration using absolute coordinates ====<br />
<br />
{{hc|/etc/X11/xorg.conf.d/10-monitor.conf|<br />
Section "Monitor"<br />
Identifier "VGA1"<br />
Option "PreferredMode" "1024x768"<br />
Option "Position" "1920 312"<br />
EndSection<br />
<br />
Section "Monitor"<br />
Identifier "HDMI1"<br />
Option "PreferredMode" "1920x1080"<br />
Option "Position" "0 0"<br />
EndSection<br />
}}<br />
<br />
There are no negative coordinates, the setup's leftmost and highest possibly targeted point is at 0,0<br />
<br />
{{Text art|<nowiki><br />
(0,0)-----------------+ <br />
| |(1920,312)---+<br />
| 1920 x 1080 || |<br />
| HDMI1 || 1024 x 768 |<br />
| || VGA1 |<br />
+---------------------++------------+<br />
</nowiki>}}<br />
<br />
== TwinView ==<br />
<br />
TwinView is [[NVIDIA]]'s extension which makes two monitors attached to a video card appear as a single screen. TwinView provides Xinerama extensions so that applications are aware there are two monitors connected, and thus it is incompatible with Xinerama. However, if you only have two monitors and they are both connected to the same NVIDIA card, there is little difference between TwinView and Xinerama (although in this situation TwinView may offer slightly better performance.)<br />
<br />
If you wish to attach more than two monitors or monitors attached to other video cards, you will need to use Xinerama instead of TwinView. Likewise, as of April 2012, both monitors must be in the same orientation - you cannot have one in landscape and the other in portrait mode.<br />
<br />
In the past, TwinView was the only way to get OpenGL acceleration with NVIDIA cards while being able to drag windows between screens. However modern versions of the NVIDIA closed-source driver are able to provide OpenGL acceleration even when using Xinerama.<br />
<br />
See [[NVIDIA#TwinView]] for an example configuration.<br />
<br />
== Xinerama ==<br />
<br />
[[Wikipedia:Xinerama|Xinerama]] is the old way of doing genuine multihead X. Xinerama combines all monitors into a single screen ({{ic|:0}}) making it possible to drag windows between screens.<br />
<br />
Xinerama is configured via custom [[Xorg#Configuration|X configuration files]]. There is also a GUI tool named [https://openapplibrary.org/project/wideguy WideGuy] to make toggling Xinerama easier. Note that to use WideGuy you still need a Xorg configuration with a ServerLayout section.<br />
<br />
Here are some [[Xorg#Configuration|X configuration]] examples:<br />
<br />
This is a ServerLayout section which controls where each monitor sits relative to the others.<br />
<br />
{{hc|/etc/X11/xorg.conf.d/90-serverlayout.conf|<br />
Section "ServerLayout"<br />
Identifier "Main"<br />
Screen 0 "Primary"<br />
Screen 1 "DellPortraitLeft" RightOf "Primary"<br />
Screen 2 "Wacom" RightOf "DellPortraitLeft"<br />
Screen 3 "U2412" LeftOf "Primary"<br />
Option "Xinerama" "1" # enable XINERAMA extension. Default is disabled.<br />
EndSection<br />
}}<br />
<br />
Each Screen in the above section is defined in a separate file, such as this one:<br />
<br />
{{hc|/etc/X11/xorg.conf.d/30-screen-dell2001.conf|<br />
# Define the monitor's physical specs<br />
Section "Monitor"<br />
Identifier "Dell 2001FP"<br />
VertRefresh 60<br />
Option "dpms" "on"<br />
<br />
# Modelines are probably unnecessary these days, but it does give you fine-grained control<br />
<br />
# 1600x1200 @ 60.00 Hz (GTF) hsync: 74.52 kHz; pclk: 160.96 MHz<br />
Modeline "1600x1200" 160.96 1600 1704 1880 2160 1200 1201 1204 1242 -HSync +Vsync<br />
EndSection<br />
<br />
# Define a screen that uses the above monitor. Note the Monitor value matches the above<br />
# Identifier value and the Device value matches one of the video cards defined below<br />
# (the card and connector this monitor are actually plugged in to.)<br />
Section "Screen"<br />
Identifier "DellPortraitLeft"<br />
Device "GeForce 8600GTb"<br />
Monitor "Dell 2001FP"<br />
DefaultDepth 24<br />
SubSection "Display"<br />
Depth 24<br />
Modes "1600x1200"<br />
ViewPort 0 0<br />
Virtual 1600 1200<br />
EndSubsection<br />
<br />
# This screen is in portrait mode<br />
Option "Rotate" "left"<br />
EndSection<br />
}}<br />
<br />
You will need to create a {{ic|Device}} section for each '''monitor''', i.e. a dual head video card will have two Device sections. The following example shows how to configure two video cards each providing two outputs, for a total of four monitors.<br />
<br />
{{hc|/etc/X11/xorg.conf.d/20-nvidia.conf|<br />
# First head of first video card in the system<br />
Section "Device"<br />
Identifier "GeForce 8600GT"<br />
Driver "nvidia"<br />
<br />
# If you have multiple video cards, the BusID controls which one this definition refers<br />
# to. You can omit it if you only have one card.<br />
BusID "PCI:1:0:0"<br />
<br />
# Need to flag this as only referring to one output on the card<br />
Screen 0<br />
<br />
# For nVidia devices, this controls which connector the monitor is connected to.<br />
Option "UseDisplayDevice" "DFP-0"<br />
<br />
# We want control!<br />
Option "DynamicTwinView" "FALSE"<br />
<br />
# Various performance and configuration options<br />
Option "AddARGBGLXVisuals" "true"<br />
Option "UseEDIDDpi" "false"<br />
Option "DPI" "96 x 96"<br />
Option "Coolbits" "1"<br />
EndSection<br />
<br />
# Second head of same video card (note different Identifier but same BusID.) We can omit<br />
# the UseDisplayDevice option this time as it will pick whichever one is remaining.<br />
Section "Device"<br />
Identifier "GeForce 8600GTb"<br />
Driver "nvidia"<br />
BusID "PCI:1:0:0"<br />
# This is the second output on this card<br />
Screen 1<br />
<br />
# Same config options for all cards<br />
Option "AddARGBGLXVisuals" "true"<br />
Option "UseEDIDDpi" "false"<br />
Option "DPI" "96 x 96"<br />
Option "Coolbits" "1"<br />
Option "DynamicTwinView" "FALSE"<br />
EndSection<br />
<br />
# First head of second video card, note different BusID.<br />
Section "Device"<br />
Identifier "G210"<br />
Driver "nvidia"<br />
BusID "PCI:2:0:0"<br />
Screen 0<br />
<br />
# Same config options for all cards<br />
Option "AddARGBGLXVisuals" "true"<br />
Option "UseEDIDDpi" "false"<br />
Option "DPI" "96 x 96"<br />
Option "Coolbits" "1"<br />
Option "DynamicTwinView" "FALSE"<br />
EndSection<br />
<br />
# Second head of second video card. Output connector is set here, which means the previous<br />
# Device will use the other connector, whatever it may be.<br />
Section "Device"<br />
Identifier "G210b"<br />
Driver "nvidia"<br />
BusID "PCI:2:0:0"<br />
Screen 1<br />
Option "UseDisplayDevice" "DFP-1"<br />
<br />
# Same config options for all cards<br />
Option "AddARGBGLXVisuals" "true"<br />
Option "UseEDIDDpi" "false"<br />
Option "DPI" "96 x 96"<br />
Option "Coolbits" "1"<br />
Option "DynamicTwinView" "FALSE"<br />
EndSection<br />
}}<br />
<br />
== Application support ==<br />
<br />
{{Out of date|This section contains outdated information, mostly specific to Xinerama.}}<br />
<br />
This section lists tips for individual applications.<br />
<br />
* mplayer: use {{ic|-xineramascreen 1}} to make the video play on screen #1 (the second screen.) Add {{ic|1=xineramascreen=1}} to {{ic|~/.mplayer/config}} to make it permanent.<br />
* Xonotic: if you are playing across multiple screens and you are unable to turn left/right properly, set {{ic|vid_stick_mouse}} to 1 in {{ic|~/.xonotic/data/config.cfg}}<br />
<br />
=== Window managers ===<br />
<br />
This section lists window managers and how they cope with multiple monitors.<br />
<br />
* [[Awesome]] - Works<br />
* [[FVWM]] - Works. Has support for Xinerama and multi-screen display, such as Single Logical Screen. <br />
* [[i3]] - Works<br />
* [[KDE]] - Works<br />
* [[MATE]] - Works<br />
* [[Qtile]] - Works<br />
* [[Spectrwm]] - Works (screens are different workspaces, both accessible and switching is possible by both keyboard and mouse) - as of March 2015<br />
* [[Xmonad]] - Works (screens are different workspaces, both accessible and switching is possible by both keyboard and mouse) - as of April 2014<br />
<br />
=== Display managers ===<br />
<br />
[[GDM]]: see [[GDM#Setup default monitor settings]].<br />
<br />
Users may prefer to use {{ic|startx}} and {{ic|~/.xinitrc}} instead of a display manager due to the lack of working support with multiple displays.<br />
<br />
=== Full screen games ===<br />
<br />
Many games require their window to appear at (0,0) when running in full-screen. If the screen you have at (0,0) - the left-most one - is not one you wish to game on, it is almost impossible to move a full-screen game onto a different screen.<br />
<br />
A workaround for this is to create a separate X11 configuration (a new '''layout''') just for playing games, which may have less (or only one) screen configured. You can then launch games using this separate layout, while normal desktop work uses the original multihead configuration.<br />
<br />
To create a new layout, copy {{ic|/etc/X11/xorg.d/90-serverlayout.conf}} and call it {{ic|91-serverlayout-gaming.conf}}. It is important to use a number larger than 90, as the one with the lowest number will become the default used when you first load X.<br />
<br />
Adjust this new configuration file to your preferred gaming configuration. Here is an example (based on the example Xinerama configuration above) with only one screen defined, noting that the screen specifics (such as resolution) are defined in other files and are unchanged from and shared with the normal configuration:<br />
<br />
{{hc|/etc/X11/xorg.conf.d/91-serverlayout-gaming.conf|<br />
# New screen layout only using a single screen called "Primary"<br />
Section "ServerLayout"<br />
Identifier "Gaming"<br />
Screen 0 "Primary" Absolute 0 0<br />
EndSection<br />
}}<br />
<br />
{{Tip|While it's easiest to just reuse the existing screen definitions, you can, of course, define new ones if you wish to have a different set of screen resolutions available.}}<br />
<br />
To use this new layout, launch the game via the {{ic|startx}} script:<br />
<br />
# Launch Xonotic on a new X11 display using the "Gaming" layout<br />
startx /usr/bin/xonotic-glx -fullscreen -- :1 -layout Gaming<br />
<br />
Note that:<br />
* You must specify the full path to the command to run, here {{ic|/usr/bin/xonotic-glx}}.<br />
* The {{ic|:1}} must refer to an empty unused display. The first display you are likely using for your desktop is {{ic|:0}}, so {{ic|:1}} will be fine for most people. But should you want to launch a second game at the same time, you would have to change this to {{ic|:2}}.<br />
* Just as you can switch between text consoles with Alt+Ctrl+F1 and back to X with Alt+Ctrl+F7, the new display will sit on Alt+Ctrl+F8. So you can switch back to your desktop with Alt+Ctrl+F7 and back to the game with Alt+Ctrl+F8. This is because you are running an independent X desktop, so if you switch out of the game with Alt+Tab or equivalent there will be an empty desktop with no window manager running.<br />
<br />
== See also ==<br />
<br />
* [https://bbs.archlinux.org/viewtopic.php?pid=652861 'How I got Dual Monitors with Nouveau Driver' forums thread]<br />
* [http://linuxgazette.net/124/smith.html Six-headed, Six-user Linux System]</div>Dlwilson88https://wiki.archlinux.org/index.php?title=Window_manager&diff=569823Window manager2019-03-26T12:23:11Z<p>Dlwilson88: corrected title bar (was one word), the verb interact should be in the to-infinitive form</p>
<hr />
<div>[[Category:Graphical user interfaces]]<br />
[[Category:Lists of software]]<br />
[[ar:Window manager]]<br />
[[es:Window manager]]<br />
[[fa:Window manager]]<br />
[[it:Window manager]]<br />
[[ja:ウィンドウマネージャ]]<br />
[[ko:Window manager]]<br />
[[pt:Window manager]]<br />
[[ru:Window manager]]<br />
[[zh-hans:Window manager]]<br />
{{Related articles start}}<br />
{{Related|Xdg-menu}}<br />
{{Related|Xorg}}<br />
{{Related|xinit}}<br />
{{Related|Start X at Login}}<br />
{{Related articles end}}<br />
<br />
A [[Wikipedia:Window manager|window manager]] (WM) is system software that controls the placement and appearance of windows within a windowing system in a graphical user interface (GUI). It can be part of a [[desktop environment]] (DE) or be used standalone.<br />
<br />
== Overview ==<br />
<br />
Window managers are X clients that control the appearance and behaviour of the frames ("windows") where the various graphical applications are drawn. They determine the border, title bar, size, and ability to resize windows, and often provide other functionality such as reserved areas for sticking [http://windowmaker.org/dockapps/ dockapps] like [[Window Maker]], or the ability to tab windows like [[Fluxbox]]. Some window managers are even bundled with simple utilities like menus to start programs or to configure the WM itself.<br />
<br />
The [http://standards.freedesktop.org/wm-spec/wm-spec-latest.html Extended Window Manager Hints] specification is used to allow window managers to interact in standard ways with the server and the other clients.<br />
<br />
Some window managers are developed as part of a more comprehensive [[desktop environment]], usually allowing the other provided applications to better interact with each other, giving a more consistent experience to the user, complete with features like desktop icons, fonts, toolbars, wallpapers, or desktop widgets.<br />
<br />
Other window managers are instead designed to be used ''standalone'', giving the user complete freedom over the choice of the other applications to be used. This allows the user to create a more lightweight and customized environment, tailored to his/her own specific needs. "Extras" like desktop icons, toolbars, wallpapers, or desktop widgets, if needed, will have to be added with additional dedicated applications.<br />
<br />
Some standalone WMs can be also used to replace the default WM of a DE, just like some DE-oriented WMs can be used standalone too.<br />
<br />
Prior to installing a window manager, a functional X server installation is required. See [[Xorg]] for detailed information.<br />
<br />
=== Types ===<br />
<br />
* [[#Stacking window managers|Stacking]] (aka floating) window managers provide the traditional desktop metaphor used in commercial operating systems like Windows and OS X. Windows act like pieces of paper on a desk, and can be stacked on top of each other. For available Arch Wiki pages see [[:Category:Stacking WMs]].<br />
* [[#Tiling window managers|Tiling]] window managers "tile" the windows so that none are overlapping. They usually make very extensive use of key-bindings and have less (or no) reliance on the mouse. Tiling window managers may be manual, offer predefined layouts, or both. For available Arch Wiki pages see [[:Category:Tiling WMs]].<br />
* [[#Dynamic window managers|Dynamic]] window managers can dynamically switch between tiling or floating window layout. For available Arch Wiki pages see [[:Category:Dynamic WMs]].<br />
<br />
See [[Comparison of tiling window managers]] and [[Wikipedia:Comparison of X window managers]] for comparison of window managers.<br />
<br />
== List of window managers==<br />
<br />
=== Stacking window managers ===<br />
<br />
* {{App|[[2bwm]]|Fast floating WM, with the particularity of having 2 borders, written over the XCB library and derived from mcwm written by Michael Cardell. In 2bwm everything is accessible from the keyboard but a pointing device can be used for move, resize and raise/lower. The name has recently changed from mcwm-beast to 2bwm.|https://github.com/venam/2bwm|{{AUR|2bwm}}}}<br />
<br />
* {{App|aewm|Modern, minimal window manager for X11. It is controlled entirely with the mouse, but contains no visible UI apart from window frames. The command set is sort of like vi: designed back in the dawn of time (1997) to squeeze speed out of low-memory machines, completely unintuitive and new-user-hostile, but quick and elegant in its own way.|http://www.red-bean.com/decklin/aewm/|{{AUR|aewm}}}}<br />
<br />
* {{App|[[Wikipedia:AfterStep|AfterStep]]|Window manager for the Unix X Window System. Originally based on the look and feel of the NeXTStep interface, it provides end users with a consistent, clean, and elegant desktop. The goal of AfterStep development is to provide for flexibility of desktop configuration, improving aesthetics, and efficient use of system resources.|http://www.afterstep.org/|{{AUR|afterstep-git}}}}<br />
<br />
* {{App|[[Blackbox]]|Fast, lightweight window manager for the X Window System, without all those annoying library dependencies. Blackbox is built with C++ and contains completely original code (even though the graphics implementation is similar to that of WindowMaker).|http://blackboxwm.sourceforge.net/|{{Pkg|blackbox}}}}<br />
<br />
* {{App|[[Compiz]]|OpenGL compositing manager that uses GLX_EXT_texture_from_pixmap for binding redirected top-level windows to texture objects. It has a flexible plug-in system and it is designed to run well on most graphics hardware.|https://launchpad.net/compiz|{{AUR|compiz}}, {{AUR|compiz-core}}}}<br />
<br />
* {{App|[[cwm]]|Originally deriving from evilwm, but later re-written from scratch. cwm aims to be simple, and offers helpful features such as searching for windows.|https://github.com/chneukirchen/cwm|{{AUR|cwm}}}}<br />
<br />
* {{App|eggwm|A lightweight QT4/QT5 window manager|{{AUR|eggwm-qt5}}|{{AUR|eggwm}}}}<br />
<br />
* {{App|[[Enlightenment]]|Enlightenment is not just a window manager for Linux/X11 and others, but also a whole suite of libraries to help you create beautiful user interfaces with much less work than doing it the old fashioned way and fighting with traditional toolkits, not to mention a traditional window manager.|http://www.enlightenment.org/|{{Pkg|enlightenment}}}}<br />
<br />
* {{App|[[evilwm]]|Minimalist window manager for the X Window System. 'Minimalist' here does not mean it is too bare to be usable - it just means it omits a lot of the stuff that make other window managers ''un''usable.|http://www.6809.org.uk/evilwm/|{{AUR|evilwm}}}}<br />
<br />
* {{App|[[Fluxbox]]|Window manager for X that was based on the Blackbox 0.61.1 code. It is very light on resources and easy to handle but yet full of features to make an easy and extremely fast desktop experience. It is built using C++ and licensed under the MIT License.|https://github.com/fluxbox/fluxbox|{{Pkg|fluxbox}}}}<br />
<br />
* {{App|[[Wikipedia:FLWM|Flwm]]|Attempt to combine the best ideas from several window managers. The primary influence and code base is from wm2 by Chris Cannam.|http://flwm.sourceforge.net/|{{AUR|flwm}}}}<br />
<br />
* {{App|[[FVWM]]|Extremely powerful ICCCM-compliant multiple virtual desktop window manager for the X Window system. Development is active, and support is excellent.|http://www.fvwm.org/|{{Pkg|fvwm}}}}<br />
<br />
* {{app|[http://elementaryos.org/journal/meet-gala-window-manager Gala]|A beautiful Window Manager from elementaryos, part of [[Pantheon]]. Also as a compositing manager, based on libmutter.|https://launchpad.net/gala|{{aur|gala}}, {{aur|gala-git}} }}<br />
<br />
* {{App|Goomwwm|X11 window manager implemented in C as a cleanroom software project. It manages windows in a minimal floating layout, while providing flexible keyboard-driven controls for window switching, sizing, moving, tagging, and tiling. It is also fast, lightweight, modeless, Xinerama-aware, and EWMH compatible wherever possible.|https://github.com/seanpringle/goomwwm|{{AUR|goomwwm}}}}<br />
<br />
* {{App|[[IceWM]]|Window manager for the X Window System. The goal of IceWM is speed, simplicity, and not getting in the user's way.|https://ice-wm.org/|{{Pkg|icewm}}}}<br />
<br />
* {{App|jbwm|jbwm is a window manager based on evilwm, with a minimal configuration size of approximately 16kb, focused on small binary size and usability, incorporating optional title-bars and XFT title-bar font rendering as compile-time options. jbwm also features easier to use keybindings than evilwm.|https://github.com/jefbed/jbwm|{{AUR|jbwm}}}}<br />
<br />
* {{App|[[JWM]]|Window manager for the X11 Window System. JWM is written in C and uses only Xlib at a minimum.|https://joewing.net/projects/jwm/index.shtml|{{Pkg|jwm}}}}<br />
<br />
* {{App|Karmen|Window manager for X, written by Johan Veenhuizen. It is designed to "just work." There is no configuration file and no library dependencies other than Xlib. The input focus model is click-to-focus. Karmen aims at ICCCM and EWMH compliance.|http://karmen.sourceforge.net/|{{AUR|karmen}}}}<br />
<br />
* {{App|[[Wikipedia:KWin|KWin]]|The standard KDE window manager since KDE 4.0, ships with the first version of built-in support for compositing, making it also a compositing manager. This allows KWin to provide advanced graphical effects, similar to Compiz, while also providing all the features from previous KDE releases (such as very good integration with the rest of KDE, advanced configurability, focus stealing prevention, a well-tested window manager, robust handling of misbehaving applications/toolkits, etc.). Also serves as a compositor for [[Wayland]].|https://techbase.kde.org/Projects/KWin|{{Pkg|kwin}}}}<br />
<br />
* {{App|lwm|Window manager for X that tries to keep out of your face. There are no icons, no button bars, no icon docks, no root menus, no nothing: if you want all that, then other programs can provide it. There is no configurability either: if you want that, you want a different window manager; one that helps your operating system in its evil conquest of your disc space and its annexation of your physical memory.|http://www.jfc.org.uk/software/lwm.html|{{Pkg|lwm}}}}<br />
<br />
* {{App|Marco|The MATE window manager, fork of Metacity.|https://github.com/mate-desktop/marco|{{Pkg|marco}}}}<br />
<br />
* {{App|[[Wikipedia:Metacity|Metacity]]|This window manager strives to be quiet, small, stable, get on with its job, and stay out of your attention. It is used by the legacy GNOME 2 and GNOME flashback sessions, and superseded by Mutter.|https://blogs.gnome.org/metacity/|{{Pkg|metacity}}}}<br />
<br />
* {{App|[[Wikipedia:Mutter_(software)#Muffin|Muffin]]|Window and compositing manager for Cinnamon, fork of Mutter, based on Clutter, uses OpenGL. It cannot be used outside of Cinnamon.|https://github.com/linuxmint/muffin/|{{Pkg|muffin}}}}<br />
<br />
* {{App|[[Wikipedia:Mutter (window manager)|Mutter]]|Window and compositing manager for GNOME, based on Clutter, uses OpenGL. Also serves a Wayland compositor.|https://gitlab.gnome.org/GNOME/mutter/|{{Pkg|mutter}}}}<br />
<br />
* {{App|[[Wikipedia:Motif_Window_Manager|MWM]]|The Motif Window Manager (MWM) is an X window manager based on the Motif toolkit.|http://sourceforge.net/projects/motif/|{{Pkg|openmotif}}}}<br />
<br />
* {{App|[[Openbox]]|Highly configurable, next generation window manager with extensive standards support. The *box visual style is well known for its minimalistic appearance. Openbox uses the *box visual style, while providing a greater number of options for theme developers than previous *box implementations. The theme documentation describes the full range of options found in Openbox themes.|http://openbox.org/|{{Pkg|openbox}}}}<br />
<br />
* {{App|[[pawm]]|Window manager for the X Window system. So it is not a 'desktop' and does not offer you a huge pile of useless options, just the facilities needed to run your X applications and at the same time having a friendly and easy to use interface.|http://www.pleyades.net/pawm/|{{AUR|pawm}}}}<br />
<br />
* {{App|[[PekWM]]|Window manager that once upon a time was based on the aewm++ window manager, but it has evolved enough that it no longer resembles aewm++ at all. It has a much expanded feature-set, including window grouping (similar to Ion, PWM, or Fluxbox), auto-properties, Xinerama, keygrabber that supports keychains, and much more.|https://www.pekwm.org/|{{Pkg|pekwm}}}}<br />
<br />
* {{App|[[Sawfish]]|Extensible window manager using a Lisp-based scripting language. Its policy is very minimal compared to most window managers. Its aim is simply to manage windows in the most flexible and attractive manner possible. All high-level WM functions are implemented in Lisp for future extensibility or redefinition.|http://sawfish.wikia.com/wiki/Main_Page|{{AUR|sawfish}}}}<br />
<br />
* {{App|TinyWM|Tiny window manager created as an exercise in minimalism. It may be helpful in learning some of the very basics of creating a window manager. It is comprised of approximately 50 lines of C. There is also a Python version using python-xlib.|http://incise.org/tinywm.html|{{AUR|tinywm}} {{AUR|tinywm-git}}}}<br />
<br />
* {{App|[[twm]]|Window manager for the X Window System. It provides titlebars, shaped windows, several forms of icon management, user-defined macro functions, click-to-type and pointer-driven keyboard focus, and user-specified key and pointer button bindings.|https://cgit.freedesktop.org/xorg/app/twm/|{{Pkg|xorg-twm}}}}<br />
<br />
* {{App|[[Wikipedia:UDE|UWM]]|The ultimate window manager for UDE.|http://udeproject.sourceforge.net/|{{AUR|ude}}}}<br />
<br />
* {{App|Wind|Small floating window manager. Tries to comply with ICCCM, EHWM, NetWM.|http://windwm.sourceforge.net/|{{AUR|windwm}}, {{AUR|windwm-git}}}}<br />
<br />
* {{App|WindowLab|Small and simple window manager of novel design. It has a click-to-focus but not raise-on-focus policy, a window resizing mechanism that allows one or many edges of a window to be changed in one action, and an innovative menubar that shares the same part of the screen as the taskbar. Window titlebars are prevented from going off the edge of the screen by constraining the mouse pointer, and when appropriate the pointer is also constrained to the taskbar/menubar in order to make target menu items easier to hit.|https://github.com/nickgravgaard/windowlab|{{AUR|windowlab}}}}<br />
<br />
* {{App|[[Window Maker]]|X11 window manager originally designed to provide integration support for the GNUstep Desktop Environment. In every way possible, it reproduces the elegant look and feel of the NEXTSTEP user interface. It is fast, feature rich, easy to configure, and easy to use. It is also free software, with contributions being made by programmers from around the world.|https://windowmaker.org/|{{AUR|windowmaker}}}}<br />
<br />
* {{App|WM2|Window manager for X. It provides an unusual style of window decoration and as little functionality as its author feels comfortable with in a window manager. wm2 is not configurable, except by editing the source and recompiling the code, and is really intended for people who do not particularly want their window manager to be too friendly. |http://www.all-day-breakfast.com/wm2/|{{AUR|wm2}}}}<br />
<br />
* {{App|[[Xfwm]]|The [[Xfce]] window manager manages the placement of application windows on the screen, provides beautiful window decorations, manages workspaces or virtual desktops and natively supports multiscreen mode. It provides its own compositing manager (from the X.Org Composite extension) for true transparency and shadows. The Xfce window manager also includes a keyboard shortcuts editor for user specific commands and basic windows manipulations and provides a preferences dialog for advanced tweaks.|https://docs.xfce.org/xfce/xfwm4/start|{{pkg|xfwm4}}}}<br />
<br />
=== Tiling window managers ===<br />
<br />
* {{App|[[Bspwm]]|bspwm is a tiling window manager that represents windows as the leaves of a full binary tree. It has support for EWMH and multiple monitors, and is configured and controlled through messages.|https://github.com/baskerville/bspwm|{{Pkg|bspwm}}}}<br />
<br />
* {{App|[[EXWM]]|EXWM (Emacs X Window Manager) is a full-featured tiling X window manager for Emacs built on top of XELB. It features fully keyboard-driven operations, hybrid layout modes (tiling & stacking), dynamic workspace support, ICCCM/EWMH compliance, RandR (multi-monitor) support, and a built-in system tray.|https://github.com/ch11ng/exwm|{{AUR|emacs-exwm-git}}}}<br />
<br />
* {{App|[[Herbstluftwm]]|Manual tiling window manager for X11 using Xlib and Glib. The layout is based on splitting frames into subframes which can be split again or can be filled with windows (similar to i3/ musca). Tags (or workspaces or virtual desktops or …) can be added/removed at runtime. Each tag contains its own layout. Exactly one tag is viewed on each monitor. The tags are monitor independent (similar to xmonad). It is configured at runtime via ipc calls from herbstclient. So the configuration file is just a script which is run on startup. (similar to wmii/musca).|https://herbstluftwm.org|{{pkg|herbstluftwm}}}}<br />
<br />
* {{App|howm|A lightweight, tiling X11 window manager that mimics vi by offering operators, motions and modes. Configuration is done through the included {{ic|config.h}} file.|https://github.com/HarveyHunt/howm|{{AUR|howm-x11}}}}<br />
<br />
* {{App|[[i3]]|Tiling window manager, completely written from scratch. i3 was created because wmii, our favorite window manager at the time, did not provide some features we wanted (multi-monitor done right, for example), had some bugs, did not progress for quite some time, and was not easy to hack at all (source code comments/documentation completely lacking). Notable differences are in the areas of multi-monitor support and the tree metaphor. For speed the Plan 9 interface of wmii is not implemented. |https://i3wm.org/|{{Pkg|i3-wm}}}}<br />
<br />
* {{App|[[Ion3]]|Tiling tabbed X11 window manager designed with keyboard users in mind. It was one of the first of the “new wave" of tiling windowing environments (the other being LarsWM, with quite a different approach) and has since spawned an entire category of tiling window managers for X11 – none of which really manage to reproduce the feel and functionality of Ion. It uses Lua as an embedded interpreter which handles all of the configuration. |http://tuomov.iki.fi/software|{{AUR|ion3}}}}<br />
<br />
* {{App|[[Notion]]|Tiling, tabbed window manager for the X window system that utilizes 'tiles' and 'tabbed' windows.<br />
** Tiling: you divide the screen into non-overlapping 'tiles'. Every window occupies one tile, and is maximized to it<br />
** Tabbing: a tile may contain multiple windows - they will be 'tabbed'.<br />
** Static: most tiled window managers are 'dynamic', meaning they automatically resize and move around tiles as windows appear and disappear. Notion, by contrast, does not automatically change the tiling.<br />
: Notion is a fork of Ion3.|http://notion.sf.net/|{{Pkg|notion}}}}<br />
<br />
* {{App|[[Ratpoison]]|Simple Window Manager with no fat library dependencies, no fancy graphics, no window decorations, and no rodent dependence. It is largely modeled after GNU Screen which has done wonders in the virtual terminal market. Ratpoison is configured with a simple text file. The information bar in Ratpoison is somewhat different, as it shows only when needed. It serves as both an application launcher as well as a notification bar. Ratpoison does not include a system tray.|http://www.nongnu.org/ratpoison/|{{Pkg|ratpoison}}}}<br />
<br />
* {{App|[[Stumpwm]]|Tiling, keyboard driven X11 Window Manager written entirely in Common Lisp. Stumpwm attempts to be customizable yet visually minimal. It does have various hooks to attach your personal customizations, and variables to tweak, and can be reconfigured and reloaded while running. There are no window decorations, no icons, no buttons, and no system tray. Its information bar can be set to show constantly or only when needed.|https://stumpwm.github.io/|{{AUR|stumpwm-git}}}}<br />
<br />
* {{App|[[subtle]]|Manual tiling window manager with a rather uncommon approach of tiling: Per default there is no typical layout enforcement, windows are placed on a position (gravity) in a custom grid. The user can change the gravity of each window either directly per grabs or with rules defined by tags in the config. It has workspace tags and automatic client tagging, mouse and keyboard control as well as an extendable statusbar. |http://subforge.org/projects/subtle|{{AUR|subtle-git}}}}<br />
<br />
* {{App|[[sway]]| Sway is a drop-in replacement for the i3 window manager, but for Wayland instead of X11. It works with your existing i3 configuration and supports most of i3's features, and a few extras.|http://swaywm.org/|{{Pkg|sway}}}}<br />
<br />
* {{App|way-cooler| Way Cooler is a tiling Wayland window manager, written in Rust, configurable using Lua, and extendable with D-Bus.|http://way-cooler.org/|{{AUR|way-cooler}}}}<br />
<br />
* {{App|[[WMFS]]|Window Manager From Scratch is a lightweight and highly configurable tiling window manager for X. It can be configured with a configuration file, supports Xft (FreeType) fonts and is compliant with the Extended Window Manager Hints (EWMH) specifications, Xinerama and Xrandr. WMFS can be driven with Vi based commands (ViWMFS).|https://github.com/xorg62/wmfs|{{AUR|wmfs}}}}<br />
<br />
* {{App|[[WMFS2]]|Incompatible successor of WMFS. It's even more minimalistic and brings some new stuff.|https://github.com/xorg62/wmfs|{{AUR|wmfs2-git}}}}<br />
<br />
=== Dynamic window managers ===<br />
<br />
* {{App|[[awesome]]|Highly configurable, next generation framework window manager for X. It is very fast, extensible and licensed under the GNU GPLv2 license. Configured in Lua, it has a system tray, information bar, and launcher built in. There are extensions available to it written in Lua. Awesome uses XCB as opposed to Xlib, which may result in a speed increase. Awesome has other features as well, such as an early replacement for notification-daemon, a right-click menu similar to that of the *box window managers, and many other things. |https://awesomewm.org/|{{Pkg|awesome}}}}<br />
<br />
* {{App|[[catwm]]|Small window manager, even simpler than dwm, written in C. Configuration is done by modifying the config.h file and recompiling.|https://github.com/pyknite/catwm|{{AUR|catwm-git}}}}<br />
<br />
* {{App|[[dwm]]|Dynamic window manager for X. It manages windows in tiled, monocle and floating layouts. All of the layouts can be applied dynamically, optimising the environment for the application in use and the task performed. does not include a tray app or automatic launcher, although dmenu integrates well with it, as they are from the same author. It has no text configuration file. Configuration is done entirely by modifying the C source code, and it must be recompiled and restarted each time it is changed.|http://dwm.suckless.org/|{{AUR|dwm}}}}<br />
<br />
* {{App|[[echinus]]|Simple and lightweight tiling and floating window manager for X11. Started as a dwm fork with easier configuration, echinus became full-featured re-parenting window manager with EWMH support. It has an EWMH-compatible panel/taskbar, called {{AUR|ourico}}.|http://plhk.ru|{{AUR|echinus}}}}<br />
<br />
* {{App|[[FrankenWM]]|Basically monsterwm with floating done right. Features that are added on top of basic mwm include: more layouts (fibonacci, equal stack, dual stack), gaps (and borders) are adjustable on the fly, minimize/maximize single windows, hide/show all windows, resizing master and stack individually, invert stack.|https://github.com/sulami/FrankenWM|{{AUR|frankenwm-git}}}}<br />
<br />
* {{App|[[spectrwm]]|Small dynamic tiling window manager for X11, largely inspired by xmonad and dwm. It tries to stay out of the way so that valuable screen real estate can be used for much more important stuff. It has sane defaults and is configured with a text file. It was written by hackers for hackers and it strives to be small, compact and fast. It has a built-in status bar fed from a user-defined script.|https://github.com/conformal/spectrwm/wiki|{{Pkg|spectrwm}}}}<br />
<br />
* {{App|[[Qtile]]|Full-featured, hackable tiling window manager written in Python. Qtile is simple, small, and extensible. It's easy to write your own layouts, widgets, and built-in commands.It is written and configured entirely in Python, which means you can leverage the full power and flexibility of the language to make it fit your needs. |https://github.com/qtile/qtile|{{Pkg|qtile}}}}<br />
<br />
* {{App|[[wmii]]|Small, dynamic window manager for X11. It is scriptable, has a 9P filesystem interface and supports classic and tiling (Acme-like) window management. It aims to maintain a small and clean (read hackable and beautiful) codebase. The default configuration is in bash and [http://rc.cat-v.org rc (the Plan 9 shell)], but programs exist written in ruby, and any program that can work with text can configure it. It has a status bar and launcher built in, and also an optional system tray ({{ic|witray}}). |http://wmii.suckless.org/|{{AUR|wmii}}}}<br />
<br />
* {{App|[[xmonad]]|Dynamically tiling X11 window manager that is written and configured in Haskell. In a normal WM, you spend half your time aligning and searching for windows. Xmonad makes work easier, by automating this. XMonad is configured in Haskell. For all configuration changes, xmonad must be recompiled, so the Haskell compiler (over 100MB) must be installed. A large library called {{Pkg|xmonad-contrib}} provides many additional features|http://xmonad.org/|{{Pkg|xmonad}}}}<br />
<br />
== See also ==<br />
<br />
* http://www.gilesorr.com/wm/<br />
* http://www.slant.co/topics/390/~what-are-the-best-window-managers-for-linux/<br />
* https://l3net.wordpress.com/2013/03/17/a-memory-comparison-of-light-linux-desktops/<br />
* http://www.xwinman.org/others.php</div>Dlwilson88