https://wiki.archlinux.org/api.php?action=feedcontributions&user=J99&feedformat=atomArchWiki - User contributions [en]2024-03-28T09:08:42ZUser contributionsMediaWiki 1.41.0https://wiki.archlinux.org/index.php?title=Rime&diff=516227Rime2018-04-06T20:49:49Z<p>J99: Configuration and Usage into different sections, add instructions on changing candidate page size</p>
<hr />
<div>[[Category:Internationalization]]<br />
[[ja:Rime IME]]<br />
'''[https://rime.github.io/ Rime IME]''' is an input method engine for entering Chinese characters supporting a wide range of input methods. Rime IME can be used with the [[IBus]] and [[Fcitx]] input method frameworks.<br />
<br />
== Installation ==<br />
<br />
Rime IME is provided by {{Pkg|librime}} and can be used with {{Pkg|ibus-rime}} or {{Pkg|fcitx-rime}}.<br />
<br />
== Configuration ==<br />
<br />
{{Note|Rime works with {{Pkg|ibus}} or {{Pkg|fcitx}}. Please see also [[IBus]] and [[Fcitx]] for installation and configuration.}}<br />
<br />
In order for Rime to work, input schemas are needed. Schemas are text files that can be created and customized by users. Alternatively, there are several [https://github.com/rime/brise#packages default input schemas] you can choose from:<br />
* Luna Pinyin (Standard Mandarin)<br />
* Terra Pinyin (with tones)<br />
* Zhuyin (Mandarin Phonetic Symbol)<br />
* Double Pinyin (Ziranma, MSPY)<br />
* Jyutping (Cantonese)<br />
* Wugniu (Wuu)<br />
* Cangjie5<br />
* Wubi86<br />
<br />
You can switch input schema at any time by pressing {{ic|F4}} to trigger the program menu. See [[Rime IME#Usage#Selecting Input Method|Selecting Input Method]].<br />
<br />
To customize Rime, you should first create the rime config directory.<br />
Assuming you are using {{Pkg|ibus-rime}}:<br />
$ mkdir ~/.config/ibus/rime<br />
<br />
Or if you are using {{Pkg|fcitx-rime}}:<br />
$ mkdir ~/.config/fcitx/rime/<br />
<br />
In this directory, create a file named {{Ic|default.custom.yaml}}, where you can specify your input schema of choice. For example, if you want to be able to type pinyin with tones, you can use the Terra Pinyin input method by adding it to the list of enabled schemas:<br />
{{hc|default.custom.yaml|<br />
patch:<br />
schema_list:<br />
- schema: terra_pinyin<br />
}}<br />
Note that the indentation level is important. This file overrides the default configuration. So if you only add Terra Pinyin, it will be the only schema enabled.<br />
<br />
To make the customizations effective, you need to redeploy. If you have working ibus or fcitx GUI, you may find a ⟲ (Deploy) button and click it.<br />
Alternatively, use the following command, assuming you are using {{Pkg|ibus-rime}}:<br />
$ rm ~/.config/ibus/rime/default.yaml && ibus-daemon -drx<br />
<br />
Or if you are using {{Pkg|fcitx-rime}}:<br />
$ rm ~/.config/fcitx/rime/default.yaml && fcitx-remote -r<br />
<br />
Note: Tones are optionals but you can type them to filter the list very well. Here is how to type them:<br />
1st tone: -<br />
2nd tone: /<br />
3rd tone: <<br />
4th tone: \<br />
<br />
Example: if one wants to type {{Ic|hǎo}} to display only Chinese characters that are pronounced this way, one must type {{Ic|hao<}} and it will be automatically converted to hǎo.<br />
<br />
By default, RIME only displays five candidates for input whilst typing. You can change this by setting the {{ic|"menu/page_size"}} value manually.<br />
{{hc|default.custom.yaml|<br />
patch:<br />
"menu/page_size": 9<br />
}}<br />
== Usage ==<br />
<br />
Rime provides some great features that allow you to write Chinese characters and its punctuation well.<br />
<br />
===Selecting Input Method===<br />
<br />
At any time, while running Rime, you can access some basic options with {{ic|F4}}. The displayed options look like this:<br />
1. Method name<br />
2. 中文 -› 西文<br />
3. 全角 -› 半角<br />
4. 漢字 -› 汉字<br />
etc.<br />
<br />
The first one indicates the name of the method you have selected (Ex: 地球拼音 for Terra Pinyin). If you have enabled multiple input methods, you can switch between them.<br />
<br />
The second one lets you switch between Chinese and western languages.<br />
<br />
The third one lets you select if you want to type the punctuation in full width (全角) or in half width (半角).<br />
<br />
The last one allows you to switch between traditional Chinese (漢字) and simplified Chinese (汉字).<br />
<br />
=== Chinese punctuation ===<br />
<br />
You have access to all the Chinese punctuation thanks to Rime. Here is a little table showing you how to type some of them:<br />
[ -> 「 【 〔 [<br />
] -> 」 】 〕 ]<br />
{ -> 『 〖 {<br />
} -> 』 〗 }<br />
< -> 《 〈 « ‹<br />
> -> 》 〉 » ›<br />
@ -> @ @ ☯<br />
/ -> / / ÷<br />
* -> * * ・ × ※<br />
% -> % % ° ℃<br />
$ -> ¥ $ € £ ¥<br />
| -> ・ | | § ¦<br />
_ -> ——<br />
\ -> 、 \ \<br />
^ -> ……<br />
~ -> 〜 ~ ~ 〰<br />
<br />
=== Advanced ===<br />
<br />
Rime allows you to change everything you can imagine and more examples are provided on the website of the project (in Chinese): https://github.com/rime/home/wiki/CustomizationGuide<br />
<br />
== See also ==<br />
<br />
* [https://rime.github.io/ Rime IME official site]<br />
* [https://github.com/rime/home/wiki Rime IME Wiki at Github]</div>J99https://wiki.archlinux.org/index.php?title=Rime&diff=516224Rime2018-04-06T20:37:59Z<p>J99: /* Configuration */ Make input switching more obvious</p>
<hr />
<div>[[Category:Internationalization]]<br />
[[ja:Rime IME]]<br />
'''[https://rime.github.io/ Rime IME]''' is an input method engine for entering Chinese characters supporting a wide range of input methods. Rime IME can be used with the [[IBus]] and [[Fcitx]] input method frameworks.<br />
<br />
== Installation ==<br />
<br />
Rime IME is provided by {{Pkg|librime}} and can be used with {{Pkg|ibus-rime}} or {{Pkg|fcitx-rime}}.<br />
<br />
== Configuration ==<br />
<br />
{{Note|Rime works with {{Pkg|ibus}} or {{Pkg|fcitx}}. Please see also [[IBus]] and [[Fcitx]] for installation and configuration.}}<br />
<br />
In order for Rime to work, input schemas are needed. Schemas are text files that can be created and customized by users. Alternatively, there are several [https://github.com/rime/brise#packages default input schemas] you can choose from:<br />
* Luna Pinyin (Standard Mandarin)<br />
* Terra Pinyin (with tones)<br />
* Zhuyin (Mandarin Phonetic Symbol)<br />
* Double Pinyin (Ziranma, MSPY)<br />
* Jyutping (Cantonese)<br />
* Wugniu (Wuu)<br />
* Cangjie5<br />
* Wubi86<br />
<br />
You can switch input schema at any time by pressing {{ic|F4}} to trigger the program menu. See [[Rime IME#Basic configuration access|Basic configuration access]].<br />
<br />
To customize Rime, you should first create the rime config directory.<br />
Assuming you are using {{Pkg|ibus-rime}}:<br />
$ mkdir ~/.config/ibus/rime<br />
<br />
Or if you are using {{Pkg|fcitx-rime}}:<br />
$ mkdir ~/.config/fcitx/rime/<br />
<br />
In this directory, create a file named {{Ic|default.custom.yaml}}, where you can specify your input schema of choice. For example, if you want to be able to type pinyin with tones, you can use the Terra Pinyin input method by adding it to the list of enabled schemas:<br />
{{hc|default.custom.yaml|<br />
patch:<br />
schema_list:<br />
- schema: terra_pinyin<br />
}}<br />
Note that the indentation level is important. This file overrides the default configuration. So if you only add Terra Pinyin, it will be the only schema enabled.<br />
<br />
To make the customizations effective, you need to redeploy. If you have working ibus or fcitx GUI, you may find a ⟲ (Deploy) button and click it.<br />
Alternatively, use the following command, assuming you are using {{Pkg|ibus-rime}}:<br />
$ rm ~/.config/ibus/rime/default.yaml && ibus-daemon -drx<br />
<br />
Or if you are using {{Pkg|fcitx-rime}}:<br />
$ rm ~/.config/fcitx/rime/default.yaml && fcitx-remote -r<br />
<br />
Note: Tones are optionals but you can type them to filter the list very well. Here is how to type them:<br />
1st tone: -<br />
2nd tone: /<br />
3rd tone: <<br />
4th tone: \<br />
<br />
Example: if one wants to type {{Ic|hǎo}} to display only Chinese characters that are pronounced this way, one must type {{Ic|hao<}} and it will be automatically converted to hǎo.<br />
<br />
==== Usage ====<br />
<br />
Rime provides some great features that allow you to write Chinese characters and its punctuation well.<br />
<br />
===== Basic configuration access =====<br />
<br />
At any time, while running Rime, you can access some basic options with {{ic|F4}}. The displayed options look like this:<br />
1. Method name<br />
2. 中文 -› 西文<br />
3. 全角 -› 半角<br />
4. 漢字 -› 汉字<br />
etc.<br />
<br />
The first one indicates the name of the method you have selected (Ex: 地球拼音 for Terra Pinyin). If you have enabled multiple input methods, you can switch between them.<br />
<br />
The second one lets you switch between Chinese and western languages.<br />
<br />
The third one lets you select if you want to type the punctuation in full width (全角) or in half width (半角).<br />
<br />
The last one allows you to switch between traditional Chinese (漢字) and simplified Chinese (汉字).<br />
<br />
===== Chinese punctuation =====<br />
<br />
You have access to all the Chinese punctuation thanks to Rime. Here is a little table showing you how to type some of them:<br />
[ -> 「 【 〔 [<br />
] -> 」 】 〕 ]<br />
{ -> 『 〖 {<br />
} -> 』 〗 }<br />
< -> 《 〈 « ‹<br />
> -> 》 〉 » ›<br />
@ -> @ @ ☯<br />
/ -> / / ÷<br />
* -> * * ・ × ※<br />
% -> % % ° ℃<br />
$ -> ¥ $ € £ ¥<br />
| -> ・ | | § ¦<br />
_ -> ——<br />
\ -> 、 \ \<br />
^ -> ……<br />
~ -> 〜 ~ ~ 〰<br />
<br />
===== Advanced =====<br />
<br />
Rime allows you to change everything you can imagine and more examples are provided on the website of the project (in Chinese): https://github.com/rime/home/wiki/CustomizationGuide<br />
<br />
== See also ==<br />
<br />
* [https://rime.github.io/ Rime IME official site]<br />
* [https://github.com/rime/home/wiki Rime IME Wiki at Github]</div>J99https://wiki.archlinux.org/index.php?title=Fonts&diff=513290Fonts2018-03-10T16:45:21Z<p>J99: /* Families */ typo</p>
<hr />
<div>[[Category:Fonts]]<br />
[[cs:Fonts]]<br />
[[de:Schriftarten]]<br />
[[es:Fonts]]<br />
[[it:Fonts]]<br />
[[ja:フォント]]<br />
[[ru:Fonts]]<br />
[[zh-hans:Fonts]]<br />
[[zh-hant:Fonts]]<br />
{{Related articles start}}<br />
{{Related|Font configuration}}<br />
{{Related|Java Runtime Environment Fonts}}<br />
{{Related|Metric-compatible fonts}}<br />
{{Related articles end}}<br />
<br />
From [[Wikipedia:Computer font]]: "A computer font (or font) is an electronic data file containing a set of glyphs, characters, or symbols such as dingbats."<br />
<br />
Note that certain font licenses may impose some legal limitations.<br />
<br />
== Font formats ==<br />
<br />
Most computer fonts used today are in either ''bitmap'' or ''outline'' data formats. <br />
;Bitmap fonts: Consist of a matrix of dots or pixels representing the image of each glyph in each face and size.<br />
;Outline or ''vector'' fonts: Use Bézier curves, drawing instructions and mathematical formulae to describe each glyph, which make the character outlines scalable to any size.<br />
<br />
=== Bitmap formats ===<br />
<br />
* [[Wikipedia:Glyph Bitmap Distribution Format|Bitmap Distribution Format]] (BDF) by Adobe<br />
* [[Wikipedia:Portable Compiled Format|Portable Compiled Format]] (PCF) by Xorg<br />
* [[Wikipedia:PC Screen Font|PC Screen Font]] (PSF) used by the Kernel for console fonts, not supported by Xorg (for Unicode PSF files the extension is {{ic|psfu}})<br />
<br />
These formats can also be gzipped. See [[#Bitmap]] for the available bitmap fonts.<br />
<br />
=== Outline formats ===<br />
<br />
* [[Wikipedia:PostScript fonts|PostScript fonts]] by Adobe – has various formats, e.g: Printer Font ASCII (PFA) and Printer Font Binary (PPB)<br />
* [[Wikipedia:TrueType|TrueType]] by Apple and Microsoft (file extension: {{ic|ttf}})<br />
* [[Wikipedia:OpenType|OpenType]] by Microsoft, built on TrueType (file extensions: {{ic|otf}}, {{ic|ttf}})<br />
<br />
For most purposes, the technical differences between TrueType and OpenType can be ignored.<br />
<br />
=== Other formats ===<br />
<br />
The typesetting application, ''TeX,'' and its companion font software, ''Metafont,'' render characters using their own methods. Some of the file extensions used for fonts by these two programs are {{ic|*pk}}, {{ic|*gf}}, {{ic|mf}} and {{ic|vf}}.<br />
<br />
[https://fontforge.github.io/en-US/ FontForge] ({{Pkg|fontforge}}), a font editing application, can store fonts in its native text-based format, {{ic|sfd}}, ''s''pline ''f''ont ''d''atabase.<br />
<br />
The [http://www.w3.org/TR/SVG/fonts.html SVG] format also has its own font description method.<br />
<br />
== Installation ==<br />
<br />
There are various methods for installing fonts.<br />
<br />
=== Pacman ===<br />
<br />
Fonts and font collections in the enabled repositories can be installed using [[pacman]].<br />
<br />
Available fonts may be found by [[pacman#Querying package databases|querying packages]] (e.g. for {{ic|font}} or {{ic|ttf}}).<br />
<br />
=== Creating a package ===<br />
<br />
You should give pacman the ability to manage your fonts, which is done by creating an Arch package. These can also be shared with the community in the [[AUR]]. The packages to install fonts are particularly similar; simply taking an existing [https://git.archlinux.org/svntogit/packages.git/tree/trunk/PKGBUILD?h=packages/adobe-source-code-pro-fonts package] as template should work well. To learn about how to modify it for your font, please refer to [[Creating packages]].<br />
<br />
The family name of a font file can be aquired with the use of {{ic|fc-query}} for example: {{ic|fc-query -f '%{family[0]}\n' /path/to/file}}. The formatting is described in the FcPatternFormat(3) manual.<br />
<br />
=== Manual installation ===<br />
<br />
The recommended way of adding fonts that are not in the repositories to your system is described in [[#Creating a package]]. This gives pacman the ability to remove or update them at a later time. Fonts can alternately be installed manually as well.<br />
<br />
To install fonts system-wide (available for all users), move the folder to the {{ic|/usr/share/fonts/}} directory. The files need to be readable by every user, use [[chmod]] to set the correct permissions (i.e. at least {{ic|0444}} for files and {{ic|0555}} for directories). To install fonts for only a single user, use {{ic|~/.local/share/fonts}} ({{ic|~/.fonts/}} is now deprecated).<br />
<br />
For Xserver to load fonts directly (as opposed to the use of a ''font server'') the directory for your newly added font must be added with a FontPath entry. This entry is located in the ''Files'' section [[Xorg#Configuration|of your Xorg configuration file]] (e.g. {{ic|/etc/X11/xorg.conf}} or {{ic|/etc/xorg.conf}}). See [[#Older applications]] for more detail.<br />
<br />
Then update the fontconfig font cache: (usually unnecessary as software using the fontconfig library do this.)<br />
<br />
$ fc-cache<br />
<br />
=== Older applications ===<br />
<br />
With older applications that do not support fontconfig (e.g. GTK+ 1.x applications, and {{ic|xfontsel}}) the index will need to be created in the font directory:<br />
<br />
$ mkfontscale<br />
$ mkfontdir<br />
<br />
Or to include more than one folder with one command:<br />
<br />
$ for dir in /font/dir1/ /font/dir2/; do xset +fp $dir; done && xset fp rehash<br />
<br />
Or if fonts were installed in a different sub-folders under the e.g. {{ic|/usr/share/fonts}}:<br />
<br />
$ for dir in * ; do if [ -d "$dir" ]; then cd "$dir";xset +fp "$PWD" ;mkfontscale; mkfontdir;cd .. ;fi; done && xset fp rehash<br />
<br />
At times the X server may fail to load the fonts directory and you will need to rescan all the {{ic|fonts.dir}} files:<br />
<br />
# xset +fp /usr/share/fonts/misc # Inform the X server of new directories<br />
# xset fp rehash # Forces a new rescan<br />
<br />
To check that the font(s) is included:<br />
<br />
$ xlsfonts | grep fontname<br />
<br />
{{note|Many packages will automatically configure Xorg to use the font upon installation. If that is the case with your font, this step is not necessary.}}<br />
<br />
This can also be set globally in {{ic|/etc/X11/xorg.conf}} or {{ic|/etc/X11/xorg.conf.d}}.<br />
<br />
Here is an example of the section that must be added to {{ic|/etc/X11/xorg.conf}}. Add or remove paths based on your particular font requirements.<br />
<br />
# Let X.Org know about the custom font directories<br />
Section "Files"<br />
FontPath "/usr/share/fonts/100dpi"<br />
FontPath "/usr/share/fonts/75dpi"<br />
FontPath "/usr/share/fonts/cantarell"<br />
FontPath "/usr/share/fonts/cyrillic"<br />
FontPath "/usr/share/fonts/encodings"<br />
FontPath "/usr/share/fonts/misc"<br />
FontPath "/usr/share/fonts/truetype"<br />
FontPath "/usr/share/fonts/TTF"<br />
FontPath "/usr/share/fonts/util"<br />
EndSection<br />
<br />
=== Pango Warnings ===<br />
<br />
When [http://www.pango.org/ Pango] is in use on your system it will read from [http://www.freedesktop.org/wiki/Software/fontconfig fontconfig] to sort out where to source fonts.<br />
<br />
(process:5741): Pango-WARNING **: failed to choose a font, expect ugly output. engine-type='PangoRenderFc', script='common'<br />
(process:5741): Pango-WARNING **: failed to choose a font, expect ugly output. engine-type='PangoRenderFc', script='latin'<br />
<br />
If you are seeing errors similar to this and/or seeing blocks instead of characters in your application then you need to add fonts and update the font cache. This example uses the {{Pkg|ttf-liberation}} fonts to illustrate the solution (after successful installation of the package) and runs as root to enable them system-wide.<br />
<br />
# fc-cache<br />
/usr/share/fonts: caching, new cache contents: 0 fonts, 3 dirs<br />
/usr/share/fonts/TTF: caching, new cache contents: 16 fonts, 0 dirs<br />
/usr/share/fonts/encodings: caching, new cache contents: 0 fonts, 1 dirs<br />
/usr/share/fonts/encodings/large: caching, new cache contents: 0 fonts, 0 dirs<br />
/usr/share/fonts/util: caching, new cache contents: 0 fonts, 0 dirs<br />
/var/cache/fontconfig: cleaning cache directory<br />
fc-cache: succeeded<br />
<br />
You can test for a default font being set like so:<br />
<br />
# fc-match<br />
LiberationMono-Regular.ttf: "Liberation Mono" "Regular"<br />
<br />
== Console fonts ==<br />
<br />
{{Note|This section is about the [[Wikipedia:Linux console|Linux console]]. For alternative console solutions offering more features (full Unicode fonts, modern graphics adapters etc.), see [[fbterm]], [[KMSCON]] or similar projects.}}<br />
<br />
By default, the [[Wikipedia:Virtual console|virtual console]] uses the kernel built-in font with a [[Wikipedia:CP437|CP437]] character set,<sup>[https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/drivers/tty/vt/Makefile#n4]</sup> but this can be easily changed.<br />
<br />
The [[Wikipedia:Linux console|Linux console]] uses UTF-8 encoding by default, but because the standard VGA-compatible framebuffer is used, a console font is limited to either a standard 256, or 512 glyphs. If the font has more than 256 glyphs, the number of colours is reduced from 16 to 8. In order to assign correct symbol to be displayed to the given Unicode value, a special translation map, often called ''unimap'', is needed. Nowadays most of the console fonts have the ''unimap'' built-in; historically, it had to be loaded separately.<br />
<br />
The {{Pkg|kbd}} package provides tools to change virtual console font and font mapping. Available fonts are saved in the {{ic|/usr/share/kbd/consolefonts/}} directory, those ending with ''.psfu'' or ''.psfu.gz'' have a Unicode translation map built-in.<br />
<br />
Keymaps, the connection between the key pressed and the character used by the computer, are found in the subdirectories of {{ic|/usr/share/kbd/keymaps/}}, see [[Keyboard configuration in console]] for details.<br />
<br />
{{Note|Replacing the font can cause issues with programs that expect a standard VGA-style font, such as those using line drawing graphics.}}<br />
<br />
{{Tip|For European based languages written in Latin/Greek letters you can use {{ic|eurlatgr}} font, it includes a broad range of Latin/Greek letter variations as well as<br />
special characters [https://lists.altlinux.org/pipermail/kbd/2014-February/000439.html].}}<br />
<br />
=== Preview and temporary changes ===<br />
<br />
{{Tip|An organized library of images for previewing is available: [http://alexandre.deverteuil.net/pages/consolefonts/ Linux console fonts screenshots].}}<br />
<br />
$ showconsolefont<br />
<br />
shows a table of glyphs or letters of a font.<br />
<br />
{{ic|setfont}} temporarily change the font if passed a font name (in {{ic|/usr/share/kbd/consolefonts/}}) such as<br />
<br />
$ setfont lat2-16 -m 8859-2<br />
<br />
Font names are case-sensitive. With no parameter, {{ic|setfont}} returns the console to the default font.<br />
<br />
{{Tip|All font changing commands can be typed in "blind".}}<br />
<br />
{{Note|''setfont'' only works on the console currently being used. Any other consoles, active or inactive, remain unaffected.}}<br />
<br />
=== Persistent configuration ===<br />
<br />
The {{ic|FONT}} variable in {{ic|/etc/vconsole.conf}} is used to set the font at boot, persistently for all consoles. See {{man|5|vconsole.conf}} for details.<br />
<br />
For displaying characters such as ''Č, ž, đ, š'' or ''Ł, ę, ą, ś'' using the font {{ic|lat2-16.psfu.gz}}:<br />
<br />
{{hc|/etc/vconsole.conf|2=<br />
...<br />
FONT=lat2-16<br />
FONT_MAP=8859-2<br />
}}<br />
<br />
It means that second part of ISO/IEC 8859 characters are used with size 16. You can change font size using other values (e.g. {{ic|lat2-08}}). For the regions determined by 8859 specification, look at the [[Wikipedia:ISO/IEC 8859#The parts of ISO/IEC 8859]].<br />
<br />
To use the specified font in early userspace, use the {{ic|consolefont}} hook in {{ic|/etc/mkinitcpio.conf}}. See [[Mkinitcpio#HOOKS]] for more information. <br />
<br />
If the fonts seems to not change on boot, or change only temporarily, it is most likely that they got reset when graphics driver was initialized and console was switched to framebuffer. To avoid this, load your graphics driver earlier. See for example [[Kernel mode setting#Early KMS start]], [https://bbs.archlinux.org/viewtopic.php?id=145765] or other ways to setup your framebuffer before {{ic|/etc/vconsole.conf}} is applied.<br />
<br />
== Font packages ==<br />
<br />
This is a selective list that includes many font packages from the [[AUR]] along with those in the official repositories. Fonts are tagged "Unicode" if they have wide Unicode support, see the project or <br />
Wikipedia pages for detail.<br />
<br />
The [https://github.com/ternstor/distrofonts Archfonts Python script] can be used to generate an overview of all the TTF fonts found in the official repositories / the AUR (the image generation is done using {{AUR|ttf2png}}).<br />
<br />
=== Bitmap ===<br />
<br />
* Default 8x16<br />
* [http://www.dcmembers.com/jibsen/download/61/ Dina] ({{Pkg|dina-font}}) – 6pt, 8pt, 9pt, 10pt, monospaced, based on Proggy<br />
* [http://font.gohu.org/ Gohu] ({{AUR|gohufont}}) – 11px, 14px, normal and bold<br />
* [http://artwizaleczapka.sourceforge.net/ Lime] ({{Pkg|artwiz-fonts}})<br />
* [http://tobiasjung.name/profont/ ProFont] ({{Pkg|profont}}) – 10px, 11px, 12px, 15px, 17px, 22px, 29px, normal<br />
* [[Wikipedia:Proggy programming fonts|Proggy]] ({{AUR|proggyfonts}}) – has different variants<br />
* [http://www.fial.com/~scott/tamsyn-font/ Tamsyn] ({{Pkg|tamsyn-font}})<br />
* [http://terminus-font.sourceforge.net/ Terminus] ({{Pkg|terminus-font}})<br />
* [https://github.com/lucy/tewi-font Tewi] ({{AUR|bdf-tewi-git}})<br />
* [http://unifoundry.com/unifont.html Unifont] ([[Wikipedia:Unicode font#Comparison of fonts|most extensive]] Unicode coverage of any font) ({{Pkg|bdf-unifont}})<br />
<br />
=== Latin script ===<br />
<br />
==== Families ====<br />
<br />
* [[Wikipedia:Bitstream Vera|Bitstream Vera]] ({{Pkg|ttf-bitstream-vera}}) – serif, sans-serif, and monospace<br />
* [https://quoteunquoteapps.com/courierprime/ Courier Prime] ({{AUR|ttf-courier-prime}}) – Courier font alternative optimized for screenplays<br />
* [[Wikipedia:Croscore fonts|Croscore fonts]] ({{Pkg|ttf-croscore}}) – Google's substitute for Windows' Arial, Times New Roman, and Courier New<br />
* [[Wikipedia:DejaVu fonts|DejaVu fonts]] ({{Pkg|ttf-dejavu}}) – Bitstream Vera modified for greater Unicode coverage<br />
* [[Wikipedia:Droid (font)|Droid]] ({{Pkg|ttf-droid}}, included in {{AUR|ttf-google-fonts-git}}) – default font for older Android versions<br />
* [[Wikipedia:Roboto|Roboto]] ({{Pkg|ttf-roboto}}) – default font for newer Android versions<br />
* [[Wikipedia:Noto fonts|Google Noto]] ({{Pkg|noto-fonts}}) – Unicode<br />
* [[Wikipedia:Liberation fonts|Liberation fonts]] ({{Pkg|ttf-liberation}}) – free metric-compatible substitute for the Arial, Arial Narrow, Times New Roman and Courier New fonts found in Windows and Microsoft Office products<br />
* [[Wikipedia:Ubuntu Font Family|Ubuntu Font Family]] ({{Pkg|ttf-ubuntu-font-family}})<br />
* [http://corefonts.sourceforge.net/ Microsoft fonts] ({{AUR|ttf-ms-fonts}}) – Andalé Mono, Courier New, Arial, Arial Black, Comic Sans, Impact, Lucida Sans, Microsoft Sans Serif, Trebuchet, Verdana, Georgia, Times New Roman<br />
* Vista fonts ({{AUR|ttf-vista-fonts}}) – Consolas, Calibri, Candara, Corbel, Cambria, Constantia<br />
<br />
==== Monospaced ====<br />
<br />
For more monospaced fonts see [[#Bitmap]] and [[#Families]].<br />
<br />
* [http://www.marksimonson.com/fonts/view/anonymous-pro Anonymous Pro] ({{pkg|ttf-anonymous-pro}}, included in {{AUR|ttf-google-fonts-git}})<br />
* [https://damieng.com/blog/2008/05/26/envy-code-r-preview-7-coding-font-released Envy Code R] ({{AUR|ttf-envy-code-r}})<br />
* Fantasque Sans Mono ({{AUR|ttf-fantasque-sans-git}})<br />
* [[Wikipedia:Fira Sans|Fira Mono]] ({{pkg|ttf-fira-mono}}, {{pkg|otf-fira-mono}}) – designed for Firefox OS<br />
* [[Wikipedia:GNU FreeFont|FreeMono]] ({{Pkg|ttf-freefont}}) - Unicode<br />
* [https://sourcefoundry.org/hack/ Hack] ({{pkg|ttf-hack}}) - an open source monospaced font, used as the default in KDE Plasma<br />
* [[Wikipedia:Inconsolata|Inconsolata]] ({{Pkg|ttf-inconsolata}}, included in {{AUR|ttf-google-fonts-git}}) - inspired by Consolas<br />
* [https://leonardo-m.livejournal.com/77079.html Inconsolata-g] ({{AUR|ttf-inconsolata-g}}) - adds some programmer-friendly modifications<br />
* [[Wikipedia:Lucida Typewriter|Lucida Typewriter]] (included in package {{AUR|jre}})<br />
* [[Wikipedia:Menlo (typeface)|Menlo]] (derivative: {{AUR|ttf-meslo}}) - default monospaced font of OS X<br />
* [[Wikipedia:Monaco (typeface)|Monaco]] ({{AUR|ttf-monaco}}) - proprietary font designed by Apple for OS X<br />
* Monofur ({{AUR|ttf-monofur}})<br />
* [https://madmalik.github.io/mononoki Mononoki] ({{AUR|ttf-mononoki}})<br />
* [[Wikipedia:Source_Code_Pro|Source Code Pro]] ({{pkg|adobe-source-code-pro-fonts}})<br />
<br />
Relevant websites:<br />
<br />
* [http://hivelogic.com/articles/top-10-programming-fonts Dan Benjamin's Top 10 Programming Fonts].<br />
* [http://www.lowing.org/fonts/ Trevor Lowing's font list]<br />
* [https://www.slant.co/topics/67/~what-are-the-best-programming-fonts Slant: What are the best programming fonts?]<br />
* [https://stackoverflow.com/questions/4689/recommended-fonts-for-programming Stack Overflow: Recommended fonts for programming]<br />
<br />
==== Sans-serif ====<br />
<br />
* [http://scripts.sil.org/cms/scripts/page.php?site_id=nrsi&id=andika Andika] ({{AUR|ttf-andika}})<br />
* [[Wikipedia:GNU FreeFont|FreeSans]] ({{Pkg|ttf-freefont}}) - Unicode<br />
* [https://github.com/rsms/inter Inter UI] ({{AUR|ttf-inter-ui}}) – designed for user interfaces<br />
* [[Wikipedia:Linux Libertine|Linux Biolinum]] ({{Pkg|ttf-linux-libertine}}) – free substitute for Times New Roman<br />
* [[Wikipedia:PT Sans|PT Sans]] ({{AUR|ttf-google-fonts-git}}) - 3 major variations: normal, narrow, and caption - Unicode: Latin, Cyrillic<br />
* [[Wikipedia:Source Sans Pro|Source Sans Pro]] ({{pkg|adobe-source-sans-pro-fonts}})<br />
* [[Wikipedia:Tahoma (typeface)|Tahoma]] ({{AUR|ttf-tahoma}})<br />
<br />
==== Serif ====<br />
<br />
* [http://www.georgduffner.at/ebgaramond/ EB Garamond] ({{AUR|otf-eb-garamond}})<br />
* [[Wikipedia:GNU FreeFont|FreeSerif]] ({{Pkg|ttf-freefont}}) - Unicode<br />
* [[Wikipedia:Gentium|Gentium]] ({{Pkg|ttf-gentium}}) - Unicode: Latin, Greek, Cyrillic, Phonetic Alphabet<br />
* [[Wikipedia:Linux Libertine|Linux Libertine]] ({{Pkg|ttf-linux-libertine}}) - Unicode: Latin, Greek, Cyrillic, Hebrew<br />
<br />
==== Unsorted ====<br />
<br />
{{Style|This section should be absorbed into the Monospace/Serif/Sans-Serif structure}}<br />
<br />
* {{Pkg|font-bh-ttf}} - X.Org Luxi fonts<br />
* {{Pkg|ttf-cheapskate}} - Font collection from ''dustismo.com''<br />
* {{Pkg|ttf-junicode}} - Junius font containing almost complete medieval latin script glyphs<br />
* {{Pkg|ttf-mph-2b-damase}} - Covers full plane 1 and several scripts<br />
* {{Pkg|xorg-fonts-type1}} - IBM Courier and Adobe Utopia sets of [[Wikipedia:PostScript fonts|PostScript fonts]]<br />
* {{AUR|all-repository-fonts}} - Meta package for all fonts in the official repositories.<br />
* {{AUR|ttf-google-fonts-git}} - a huge collection of free fonts (including Ubuntu, Inconsolata, Droid, etc.) - Note: Your font dialog might get very long as >100 fonts will be added.<br />
<br />
=== Non-latin scripts ===<br />
<br />
==== Ancient Scripts ====<br />
<br />
* {{AUR|ttf-ancient-fonts}} - Font containing Unicode symbols for Aegean, Egyptian, Cuneiform, Anatolian, Maya, and Analecta scripts<br />
<br />
==== Arabic ====<br />
<br />
* {{AUR|ttf-amiri}} - A classical Arabic typeface in Naskh style poineered by Amiria Press<br />
* {{AUR|ttf-arabeyes-fonts}} - Collection of free Arabic fonts<br />
* {{AUR|ttf-qurancomplex-fonts}} - Fonts by King Fahd Glorious Quran Printing Complex in al-Madinah al-Munawwarah<br />
* {{AUR|ttf-sil-lateef}} - Unicode Arabic font from SIL<br />
* {{AUR|ttf-sil-scheherazade}} - Unicode Arabic font from SIL<br />
<br />
==== Braille ====<br />
<br />
*{{Pkg|ttf-ubraille}} - Font containing Unicode symbols for ''braille''<br />
<br />
==== Chinese, Japanese, Korean, Vietnamese ====<br />
<br />
===== Pan-CJK =====<br />
*adobe source han fonts<br />
Large collection of fonts which comprehensively support Simplified Chinese, Traditional Chinese, Japanese, and Korean, with a consistent design and look.<br />
**{{Pkg|adobe-source-han-sans-otc-fonts}} - Sans fonts<br />
**{{Pkg|adobe-source-han-serif-otc-fonts}} - Serif fonts<br />
<br />
*{{Pkg|noto-fonts-cjk}} - Large collection of fonts which comprehensively support Simplified Chinese, Traditional Chinese, Japanese, and Korean, with a consistent design and look. It is currently a rebadged version of {{Pkg|adobe-source-han-sans-otc-fonts}}.<br />
<br />
===== Chinese =====<br />
* adobe source han fonts<br />
** {{Pkg|adobe-source-han-sans-cn-fonts}} - Simplified Chinese OpenType/CFF Sans fonts<br />
** {{Pkg|adobe-source-han-sans-tw-fonts}} - Traditional Chinese OpenType/CFF Sans fonts<br />
** {{Pkg|adobe-source-han-serif-cn-fonts}} - Simplified Chinese OpenType/CFF Serif fonts<br />
** {{Pkg|adobe-source-han-serif-tw-fonts}} - Traditional Chinese OpenType/CFF Serif fonts<br />
<br />
* noto Chinese fonts<br />
** {{AUR|noto-fonts-sc}} - Noto CJK-SC fonts for Simplified Chinese<br />
** {{AUR|noto-fonts-tc}} - Noto CJK-TC fonts for Traditional Chinese<br />
<br />
* wqy fonts<br />
** {{Pkg|wqy-zenhei}} - Hei Ti Style (sans-serif) Chinese Outline font embedded with bitmapped Song Ti (also supporting Japanese (partial) and Korean characters).<br />
** {{Pkg|wqy-bitmapfont}} - Bitmapped Song Ti (serif) Chinese font.<br />
<br />
* arphic fonts<br />
** {{Pkg|ttf-arphic-ukai}} - ''Kaiti'' (brush stroke) Unicode font (enabling anti-aliasing is suggested)<br />
** {{Pkg|ttf-arphic-uming}} - ''Mingti'' (printed) Unicode font<br />
<br />
* {{Pkg|opendesktop-fonts}} - ''New Sung'' font, previously is ttf-fireflysung package<br />
<br />
* {{Pkg|ttf-hannom}} - Chinese and Vietnamese ttf fonts<br />
<br />
* Standart fonts of the Republic of China ministry of education in Taiwan<br />
** {{AUR|ttf-tw}} - Kai and Song traditional Chinese font from the Ministry of Education of Taiwan<br />
** {{AUR|ttf-twcns-fonts}} Chinese TrueType fonts by Ministry of Education of Taiwan government, support CNS11643 standard, including Kai and Sung fontface.<br />
<br />
*Windows Chinses fonts<br />
**{{AUR|ttf-ms-win8-zh_cn}} - windows8 simple Chinese fonts。<br />
**{{AUR|ttf-ms-win8-zh_tw}} - windows8 traditional Chinese fonts。<br />
**{{AUR|ttf-ms-win10-zh_cn}} - windows10 simple Chinese fonts。<br />
**{{AUR|ttf-ms-win10-zh_tw}} - windows10 traditional Chinese fonts。<br />
<br />
* {{AUR|ttf-i.bming}} - CJK serif font that emphasis on an old-style typeface.<br />
<br />
===== Japanese =====<br />
<br />
* {{Pkg|adobe-source-han-sans-jp-fonts}} - Japanese OpenType/CFF fonts<br />
* {{Pkg|otf-ipafont}} - Formal style Japanese Gothic (sans-serif) and Mincho (serif) fonts set; one of the highest quality open source font. Default of openSUSE-ja.<br />
* {{Pkg|ttf-hanazono}} - A free Japanese kanji font, style Mincho (serif).<br />
* {{Pkg|ttf-sazanami}} - Japanese free TrueType font. This is outdated and not maintained any more, but may be defined as a fallback font on several environments.<br />
* {{AUR|ttf-koruri}} - Japanese TrueType font obtained by mixing {{AUR|ttf-mplus}} and Open Sans<br />
* {{AUR|ttf-monapo}} - Japanese fonts to show [[wikipedia:2channel_Shift_JIS_art|2channel Shift JIS art]] properly.<br />
* {{AUR|ttf-mplus}} - Modern Gothic style Japanese outline fonts. It includes all of Japanese Hiragana/Katakana, Basic Latin, Latin-1 Supplement, Latin Extended-A, IPA Extensions and most of Japanese Kanji, Greek, Cyrillic, Vietnamese with 7 weights (proportional) or 5 weights (monospace).<br />
* {{AUR|ttf-vlgothic}} - Japanese Gothic fonts. Default of Debian/Fedora/Vine Linux<br />
<br />
===== Korean =====<br />
<br />
* {{Pkg|adobe-source-han-sans-kr-fonts}} - Korean OpenType/CFF fonts<br />
* {{Pkg|ttf-baekmuk}} - Collection of Korean TrueType fonts<br />
* {{AUR|spoqa-han-sans}} - Source Han Sans customized by Spoqa<br />
* {{AUR|ttf-d2coding}} - D2Coding fixed width TrueType font made by Naver<br />
* {{AUR|ttf-nanum}} - Nanum series TrueType fonts<br />
* {{AUR|ttf-nanumgothic_coding}} - Nanum series fixed width TrueType fonts<br />
<br />
===== Vietnamese =====<br />
<br />
* {{Pkg|ttf-hannom}} - Vietnamese TrueType font for chữ Nôm characters<br />
<br />
==== Cyrillic ====<br />
<br />
See also [[#Latin script]].<br />
<br />
* {{AUR|ttf-paratype}} - Font family by ParaType: sans, serif, mono, extended cyrillic and latin, OFL license<br />
* {{AUR|otf-russkopis}} - A free OpenType cursive font for Cyrillic script<br />
<br />
==== Greek ====<br />
<br />
Almost all Unicode fonts contain the Greek character set (polytonic included). Some additional font packages, which might not contain the complete Unicode set but utilize high quality Greek (and Latin, of course) typefaces are:<br />
<br />
* {{AUR|otf-gfs}} - Selection of OpenType fonts from the Greek Font Society<br />
* {{AUR|ttf-mgopen}} - Professional TrueType fonts from Magenta<br />
<br />
==== Hebrew ====<br />
<br />
* {{AUR|culmus}} - Nice collection of free Hebrew fonts<br />
<br />
==== Indic ====<br />
<br />
* {{Pkg|ttf-freebanglafont}} - Font for Bangla<br />
* {{Pkg|ttf-indic-otf}} - Indic OpenType Fonts collection (containing ttf-freebanglafont), provides the character [http://www.fileformat.info/info/unicode/char/ca0/index.htm U+0CA0] "ಠ"<br />
* {{AUR|lohit-fonts}} - Indic TrueType fonts from Fedora Project (containing Oriya Fonts and more)<br />
* {{AUR|ttf-devanagarifonts}} - Devanagari TrueType fonts (contains 283 fonts)<br />
* {{AUR|ttf-gurmukhi-fonts_sikhnet}} - TrueType Gurmukhi fonts (gurbaniwebthick,prabhki)<br />
* {{AUR|ttf-gurmukhi_punjabi}} - TTF Gurmukhi / Punjabi (contains 252 fonts)<br />
* {{AUR|ttf-gujrati-fonts}} - TTF Gujarati fonts (Avantika,Gopika,Shree768)<br />
* {{AUR|ttf-kannada-font}} - Kannada, the language of Karnataka state in India<br />
* {{AUR|ttf-lklug}} - Sinhala Unicode font<br />
* {{AUR|ttf-tamil}} - Tamil Unicode fonts<br />
* {{AUR|ttf-urdufonts}} - Urdu fonts (Jameel Noori Nastaleeq (+kasheeda), Nafees Web Naskh, PDMS Saleem Quran Font) and font configuration to set Jameel Noori Nastaleeq as default font for Urdu<br />
<br />
==== Khmer ====<br />
<br />
* {{Pkg|ttf-khmer}} - Font covering glyphs for Khmer language<br />
* [https://www.google.com/fonts/specimen/Hanuman Hanuman] ({{AUR|ttf-google-fonts-git}})<br />
<br />
==== Mongolic and Tungusic ====<br />
<br />
* {{AUR|ttf-abkai}} - Fonts for Sibe, Manchu and Daur scripts (incomplete, currently in development)<br />
<br />
==== Persian ====<br />
<br />
* {{AUR|persian-fonts}} - Meta package for installing all Persian fonts in AUR.<br />
* {{AUR|borna-fonts}} - Borna Rayaneh Co. Persian B font series.<br />
* {{AUR|iran-nastaliq-fonts}} - A free Unicode calligraphic Persian font.<br />
* {{AUR|iranian-fonts}} - Iranian-Sans and Iranian-Serif Persian font family.<br />
* {{AUR|ir-standard-fonts}} - Iran Supreme Council of Information and Communication Technology (SCICT) standard Persian fonts.<br />
* {{AUR|persian-hm-ftx-fonts}} - A Persian font series derived from X Series 2, Metafont and FarsiTeX fonts with Kashida feature.<br />
* {{AUR|persian-hm-xs2-fonts}} - A Persian font series derived from X Series 2 fonts with Kashida feature.<br />
* {{AUR|sina-fonts}} - Sina Pardazesh Co. Persian font series.<br />
* {{AUR|gandom-fonts}}, {{AUR|parastoo-fonts}}, {{AUR|sahel-fonts}}, {{AUR|samim-fonts}}, {{AUR|shabnam-fonts}}, {{AUR|tanha-fonts}}, {{AUR|vazir-fonts}}, {{AUR|vazir-code-fonts}} - Beautiful Persian fonts made by Ali Rasti Kerdar.<br />
* {{AUR|ttf-yas}} - The Yas Persian font series (with '''hollow zero''').<br />
* {{AUR|ttf-x2}} - Free fonts with support for Persian, Arabic, Urdu, Pashto, Dari, Uzbek, Kurdish, Uighur, old Turkish (Ottoman) and modern Turkish (Roman).<br />
<br />
==== Tai–Kadai ====<br />
<br />
* {{Pkg|fonts-tlwg}} - Collection of scalable Thai fonts<br />
* {{AUR|ttf-lao}} - Lao TTF font (Phetsarath_OT)<br />
* {{AUR|ttf-lao-fonts}} - Lao TTF fonts, both Unicode and non-Unicode for Windows<br />
<br />
==== Tibeto-Burman ====<br />
<br />
* {{Pkg|ttf-tibetan-machine}} - Tibetan Machine TTFont<br />
* {{AUR|ttf-myanmar-fonts}} - 121 Fonts from myordbok.com<br />
<br />
=== Emoji and symbols ===<br />
<br />
A section of the Unicode standard is designated for pictographic characters called "emoji".<br />
<br />
* {{Pkg|noto-fonts-emoji}} - Google's own emoji font, like on Android or Google Hangouts.<br />
* {{Pkg|ttf-symbola}} - provides many Unicode symbols, including emoji, in outline style.<br />
* {{AUR|ttf-emojione-color}} - a color and B&W emoji SVGinOT font built from EmojiOne.<br />
* {{AUR|ttf-twemoji-color}} - Twitter's open-sourced emoji glyphs.<br />
<br />
[[wikipedia:Emoticon#Japanese_style|Kaomoji]] are sometimes referred to as "Japanese emoticons" and are composed of characters from various character sets, including CJK and Indic fonts. For example, the following set of packages covers most of existing kaomoji: {{Pkg|ttf-freefont}}, {{Pkg|ttf-arphic-uming}}, and {{Pkg|ttf-indic-otf}}.<br />
<br />
=== Math ===<br />
<br />
* {{Pkg|font-mathematica}} - Mathematica fonts by Wolfram Research, Inc.<br />
* {{Pkg|texlive-core}} and {{Pkg|texlive-fontsextra}} contain many math fonts such as Latin Modern Math and [[Wikipedia:STIX Fonts project|STIX Fonts]]. See [[TeX Live#Fonts]] for configuration.<br />
* {{AUR|otf-stix}} - A standalone, more recent version of STIX<br />
* {{AUR|otf-latin-modern}}, {{AUR|otf-latinmodern-math}} - Improved version of Computer Modern fonts as used in LaTeX<br />
* {{AUR|ttf-computer-modern-fonts}}, {{AUR|otf-cm-unicode}} - [[wikipedia:Computer Modern|Computer Modern]] (of TeX fame)<br />
* {{AUR|ttf-mathtype}} - MathType fonts<br />
<br />
=== Other operating system fonts ===<br />
<br />
* {{AUR|ttf-mac-fonts}} - Apple MacOS TrueType fonts<br />
<br />
See [[Metric-compatible fonts]], which lists available alternatives for [[Microsoft fonts]].<br />
<br />
== Fallback font order with X11 ==<br />
<br />
Fontconfig automatically chooses a font that matches the current requirement. That is to say, if one is looking at a window containing English and Chinese for example, it will switch to another font for the Chinese text if the default one does not support it.<br />
<br />
Fontconfig lets every user configure the order they want via {{ic|$XDG_CONFIG_HOME/fontconfig/fonts.conf}}.<br />
If you want a particular Chinese font to be selected after your favorite Serif font, your file would look like this:<br />
<br />
<?xml version="1.0"?><br />
<!DOCTYPE fontconfig SYSTEM "fonts.dtd"><br />
<fontconfig><br />
<alias><br />
<family>serif</family><br />
<prefer><br />
<family>Your favorite Latin Serif font name</family><br />
<family>Your Chinese font name</family><br />
</prefer><br />
</alias><br />
</fontconfig><br />
<br />
{{Tip|If you use a Chinese locale, set {{ic|LC_LANG}} to {{ic|und}} to make this work. Otherwise both English and Chinese text will be rendered in the Chinese font.}}<br />
<br />
You can add a section for sans-serif and monospace as well. For more informations, have a look at the fontconfig manual.<br />
<br />
See also [[Font configuration#Replace or set default fonts]].<br />
<br />
== Font alias ==<br />
<br />
There are several font aliases which represent other fonts in order that applications may use similar fonts. The most common aliases are: {{ic|serif}} for a font of the serif type (e.g. DejaVu Serif); {{ic|sans-serif}} for a font of the sans-serif type (e.g. DejaVu Sans); and {{ic|monospace}} for a monospaced font (e.g. DejaVu Sans Mono). However, the fonts which these aliases represent may vary and the relationship is often not shown in font management tools, such as those found in [[KDE]] and other [[desktop environments]].<br />
<br />
To reverse an alias and find which font it is representing, run:<br />
<br />
{{hc|$ fc-match monospace|<br />
DejaVuSansMono.ttf: "DejaVu Sans Mono" "Book"<br />
}}<br />
<br />
In this case, {{ic|DejaVuSansMono.ttf}} is the font represented by the monospace alias.<br />
<br />
== Tips and tricks ==<br />
<br />
=== List all installed fonts ===<br />
<br />
You can use the following command to list all installed Fontconfig fonts that are available on your system. <br />
<br />
$ fc-list<br />
<br />
=== Lists installed fonts for a particular language ===<br />
<br />
Applications and browsers select and display fonts depending upon fontconfig preferences and available font glyph for Unicode text. To list installed fonts for a particular language, issue a command {{ic|<nowiki>fc-list :lang="two letter language code"</nowiki>}}. For instance, to list installed Arabic fonts or fonts supporting Arabic glyph:<br />
{{hc|$ fc-list -f '%{file}\n' :lang&#61;ar|2=<br />
<nowiki><br />
/usr/share/fonts/TTF/FreeMono.ttf<br />
/usr/share/fonts/TTF/DejaVuSansCondensed.ttf<br />
/usr/share/fonts/truetype/custom/DroidKufi-Bold.ttf<br />
/usr/share/fonts/TTF/DejaVuSansMono.ttf<br />
/usr/share/fonts/TTF/FreeSerif.ttf<br />
</nowiki><br />
}}<br />
<br />
=== Set terminal font on-the-fly ===<br />
<br />
{{Expansion|Which terminals specifically support this method? Where is the documentation for the escape codes?}}<br />
<br />
For terminal emulators that use {{ic|Xresources}}, fonts can be set by using escape sequences. Specifically, {{ic|echo -e "\033]710;$font\007"}} to change the normal font ({{ic|*font}} in {{ic|~/.Xresources}}), and replace {{ic|710}} with {{ic|711}}, {{ic|712}}, and {{ic|713}} to change the {{ic|*boldFont}}, {{ic|*italicFont}}, and {{ic|*boldItalicFont}}, respectively.<br />
<br />
{{ic|$font}} uses the same syntax as in {{ic|~/.Xresources}} and can be anything the terminal emulator will support. (Example: {{ic|1=xft:dejavu sans mono:size=9}})<br />
<br />
=== Application-specific font cache ===<br />
<br />
Matplotlib ({{pkg|python-matplotlib}} or {{pkg|python2-matplotlib}}) uses its own font cache, so after updating fonts, be sure to remove {{ic|~/.matplotlib/fontList.cache}}, <br />
{{ic|~/.cache/matplotlib/fontList.cache}}, {{ic|~/.sage/matplotlib-1.2.1/fontList.cache}}, etc. so it will regenerate its cache and find the new fonts [http://matplotlib.1069221.n5.nabble.com/getting-matplotlib-to-recognize-a-new-font-td40500.html].<br />
<br />
== See also ==<br />
<br />
* [http://behdad.org/text/ State of Text Rendering]<br />
* [https://fontlibrary.org/en Font Library] - Fonts under Free licenses<br />
* [https://screenshots.debian.net/packages?search=fonts&show=with Fonts on screenshots.debian.net]</div>J99https://wiki.archlinux.org/index.php?title=Fonts&diff=513289Fonts2018-03-10T16:45:01Z<p>J99: /* Families */ Liberation fonts description</p>
<hr />
<div>[[Category:Fonts]]<br />
[[cs:Fonts]]<br />
[[de:Schriftarten]]<br />
[[es:Fonts]]<br />
[[it:Fonts]]<br />
[[ja:フォント]]<br />
[[ru:Fonts]]<br />
[[zh-hans:Fonts]]<br />
[[zh-hant:Fonts]]<br />
{{Related articles start}}<br />
{{Related|Font configuration}}<br />
{{Related|Java Runtime Environment Fonts}}<br />
{{Related|Metric-compatible fonts}}<br />
{{Related articles end}}<br />
<br />
From [[Wikipedia:Computer font]]: "A computer font (or font) is an electronic data file containing a set of glyphs, characters, or symbols such as dingbats."<br />
<br />
Note that certain font licenses may impose some legal limitations.<br />
<br />
== Font formats ==<br />
<br />
Most computer fonts used today are in either ''bitmap'' or ''outline'' data formats. <br />
;Bitmap fonts: Consist of a matrix of dots or pixels representing the image of each glyph in each face and size.<br />
;Outline or ''vector'' fonts: Use Bézier curves, drawing instructions and mathematical formulae to describe each glyph, which make the character outlines scalable to any size.<br />
<br />
=== Bitmap formats ===<br />
<br />
* [[Wikipedia:Glyph Bitmap Distribution Format|Bitmap Distribution Format]] (BDF) by Adobe<br />
* [[Wikipedia:Portable Compiled Format|Portable Compiled Format]] (PCF) by Xorg<br />
* [[Wikipedia:PC Screen Font|PC Screen Font]] (PSF) used by the Kernel for console fonts, not supported by Xorg (for Unicode PSF files the extension is {{ic|psfu}})<br />
<br />
These formats can also be gzipped. See [[#Bitmap]] for the available bitmap fonts.<br />
<br />
=== Outline formats ===<br />
<br />
* [[Wikipedia:PostScript fonts|PostScript fonts]] by Adobe – has various formats, e.g: Printer Font ASCII (PFA) and Printer Font Binary (PPB)<br />
* [[Wikipedia:TrueType|TrueType]] by Apple and Microsoft (file extension: {{ic|ttf}})<br />
* [[Wikipedia:OpenType|OpenType]] by Microsoft, built on TrueType (file extensions: {{ic|otf}}, {{ic|ttf}})<br />
<br />
For most purposes, the technical differences between TrueType and OpenType can be ignored.<br />
<br />
=== Other formats ===<br />
<br />
The typesetting application, ''TeX,'' and its companion font software, ''Metafont,'' render characters using their own methods. Some of the file extensions used for fonts by these two programs are {{ic|*pk}}, {{ic|*gf}}, {{ic|mf}} and {{ic|vf}}.<br />
<br />
[https://fontforge.github.io/en-US/ FontForge] ({{Pkg|fontforge}}), a font editing application, can store fonts in its native text-based format, {{ic|sfd}}, ''s''pline ''f''ont ''d''atabase.<br />
<br />
The [http://www.w3.org/TR/SVG/fonts.html SVG] format also has its own font description method.<br />
<br />
== Installation ==<br />
<br />
There are various methods for installing fonts.<br />
<br />
=== Pacman ===<br />
<br />
Fonts and font collections in the enabled repositories can be installed using [[pacman]].<br />
<br />
Available fonts may be found by [[pacman#Querying package databases|querying packages]] (e.g. for {{ic|font}} or {{ic|ttf}}).<br />
<br />
=== Creating a package ===<br />
<br />
You should give pacman the ability to manage your fonts, which is done by creating an Arch package. These can also be shared with the community in the [[AUR]]. The packages to install fonts are particularly similar; simply taking an existing [https://git.archlinux.org/svntogit/packages.git/tree/trunk/PKGBUILD?h=packages/adobe-source-code-pro-fonts package] as template should work well. To learn about how to modify it for your font, please refer to [[Creating packages]].<br />
<br />
The family name of a font file can be aquired with the use of {{ic|fc-query}} for example: {{ic|fc-query -f '%{family[0]}\n' /path/to/file}}. The formatting is described in the FcPatternFormat(3) manual.<br />
<br />
=== Manual installation ===<br />
<br />
The recommended way of adding fonts that are not in the repositories to your system is described in [[#Creating a package]]. This gives pacman the ability to remove or update them at a later time. Fonts can alternately be installed manually as well.<br />
<br />
To install fonts system-wide (available for all users), move the folder to the {{ic|/usr/share/fonts/}} directory. The files need to be readable by every user, use [[chmod]] to set the correct permissions (i.e. at least {{ic|0444}} for files and {{ic|0555}} for directories). To install fonts for only a single user, use {{ic|~/.local/share/fonts}} ({{ic|~/.fonts/}} is now deprecated).<br />
<br />
For Xserver to load fonts directly (as opposed to the use of a ''font server'') the directory for your newly added font must be added with a FontPath entry. This entry is located in the ''Files'' section [[Xorg#Configuration|of your Xorg configuration file]] (e.g. {{ic|/etc/X11/xorg.conf}} or {{ic|/etc/xorg.conf}}). See [[#Older applications]] for more detail.<br />
<br />
Then update the fontconfig font cache: (usually unnecessary as software using the fontconfig library do this.)<br />
<br />
$ fc-cache<br />
<br />
=== Older applications ===<br />
<br />
With older applications that do not support fontconfig (e.g. GTK+ 1.x applications, and {{ic|xfontsel}}) the index will need to be created in the font directory:<br />
<br />
$ mkfontscale<br />
$ mkfontdir<br />
<br />
Or to include more than one folder with one command:<br />
<br />
$ for dir in /font/dir1/ /font/dir2/; do xset +fp $dir; done && xset fp rehash<br />
<br />
Or if fonts were installed in a different sub-folders under the e.g. {{ic|/usr/share/fonts}}:<br />
<br />
$ for dir in * ; do if [ -d "$dir" ]; then cd "$dir";xset +fp "$PWD" ;mkfontscale; mkfontdir;cd .. ;fi; done && xset fp rehash<br />
<br />
At times the X server may fail to load the fonts directory and you will need to rescan all the {{ic|fonts.dir}} files:<br />
<br />
# xset +fp /usr/share/fonts/misc # Inform the X server of new directories<br />
# xset fp rehash # Forces a new rescan<br />
<br />
To check that the font(s) is included:<br />
<br />
$ xlsfonts | grep fontname<br />
<br />
{{note|Many packages will automatically configure Xorg to use the font upon installation. If that is the case with your font, this step is not necessary.}}<br />
<br />
This can also be set globally in {{ic|/etc/X11/xorg.conf}} or {{ic|/etc/X11/xorg.conf.d}}.<br />
<br />
Here is an example of the section that must be added to {{ic|/etc/X11/xorg.conf}}. Add or remove paths based on your particular font requirements.<br />
<br />
# Let X.Org know about the custom font directories<br />
Section "Files"<br />
FontPath "/usr/share/fonts/100dpi"<br />
FontPath "/usr/share/fonts/75dpi"<br />
FontPath "/usr/share/fonts/cantarell"<br />
FontPath "/usr/share/fonts/cyrillic"<br />
FontPath "/usr/share/fonts/encodings"<br />
FontPath "/usr/share/fonts/misc"<br />
FontPath "/usr/share/fonts/truetype"<br />
FontPath "/usr/share/fonts/TTF"<br />
FontPath "/usr/share/fonts/util"<br />
EndSection<br />
<br />
=== Pango Warnings ===<br />
<br />
When [http://www.pango.org/ Pango] is in use on your system it will read from [http://www.freedesktop.org/wiki/Software/fontconfig fontconfig] to sort out where to source fonts.<br />
<br />
(process:5741): Pango-WARNING **: failed to choose a font, expect ugly output. engine-type='PangoRenderFc', script='common'<br />
(process:5741): Pango-WARNING **: failed to choose a font, expect ugly output. engine-type='PangoRenderFc', script='latin'<br />
<br />
If you are seeing errors similar to this and/or seeing blocks instead of characters in your application then you need to add fonts and update the font cache. This example uses the {{Pkg|ttf-liberation}} fonts to illustrate the solution (after successful installation of the package) and runs as root to enable them system-wide.<br />
<br />
# fc-cache<br />
/usr/share/fonts: caching, new cache contents: 0 fonts, 3 dirs<br />
/usr/share/fonts/TTF: caching, new cache contents: 16 fonts, 0 dirs<br />
/usr/share/fonts/encodings: caching, new cache contents: 0 fonts, 1 dirs<br />
/usr/share/fonts/encodings/large: caching, new cache contents: 0 fonts, 0 dirs<br />
/usr/share/fonts/util: caching, new cache contents: 0 fonts, 0 dirs<br />
/var/cache/fontconfig: cleaning cache directory<br />
fc-cache: succeeded<br />
<br />
You can test for a default font being set like so:<br />
<br />
# fc-match<br />
LiberationMono-Regular.ttf: "Liberation Mono" "Regular"<br />
<br />
== Console fonts ==<br />
<br />
{{Note|This section is about the [[Wikipedia:Linux console|Linux console]]. For alternative console solutions offering more features (full Unicode fonts, modern graphics adapters etc.), see [[fbterm]], [[KMSCON]] or similar projects.}}<br />
<br />
By default, the [[Wikipedia:Virtual console|virtual console]] uses the kernel built-in font with a [[Wikipedia:CP437|CP437]] character set,<sup>[https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/drivers/tty/vt/Makefile#n4]</sup> but this can be easily changed.<br />
<br />
The [[Wikipedia:Linux console|Linux console]] uses UTF-8 encoding by default, but because the standard VGA-compatible framebuffer is used, a console font is limited to either a standard 256, or 512 glyphs. If the font has more than 256 glyphs, the number of colours is reduced from 16 to 8. In order to assign correct symbol to be displayed to the given Unicode value, a special translation map, often called ''unimap'', is needed. Nowadays most of the console fonts have the ''unimap'' built-in; historically, it had to be loaded separately.<br />
<br />
The {{Pkg|kbd}} package provides tools to change virtual console font and font mapping. Available fonts are saved in the {{ic|/usr/share/kbd/consolefonts/}} directory, those ending with ''.psfu'' or ''.psfu.gz'' have a Unicode translation map built-in.<br />
<br />
Keymaps, the connection between the key pressed and the character used by the computer, are found in the subdirectories of {{ic|/usr/share/kbd/keymaps/}}, see [[Keyboard configuration in console]] for details.<br />
<br />
{{Note|Replacing the font can cause issues with programs that expect a standard VGA-style font, such as those using line drawing graphics.}}<br />
<br />
{{Tip|For European based languages written in Latin/Greek letters you can use {{ic|eurlatgr}} font, it includes a broad range of Latin/Greek letter variations as well as<br />
special characters [https://lists.altlinux.org/pipermail/kbd/2014-February/000439.html].}}<br />
<br />
=== Preview and temporary changes ===<br />
<br />
{{Tip|An organized library of images for previewing is available: [http://alexandre.deverteuil.net/pages/consolefonts/ Linux console fonts screenshots].}}<br />
<br />
$ showconsolefont<br />
<br />
shows a table of glyphs or letters of a font.<br />
<br />
{{ic|setfont}} temporarily change the font if passed a font name (in {{ic|/usr/share/kbd/consolefonts/}}) such as<br />
<br />
$ setfont lat2-16 -m 8859-2<br />
<br />
Font names are case-sensitive. With no parameter, {{ic|setfont}} returns the console to the default font.<br />
<br />
{{Tip|All font changing commands can be typed in "blind".}}<br />
<br />
{{Note|''setfont'' only works on the console currently being used. Any other consoles, active or inactive, remain unaffected.}}<br />
<br />
=== Persistent configuration ===<br />
<br />
The {{ic|FONT}} variable in {{ic|/etc/vconsole.conf}} is used to set the font at boot, persistently for all consoles. See {{man|5|vconsole.conf}} for details.<br />
<br />
For displaying characters such as ''Č, ž, đ, š'' or ''Ł, ę, ą, ś'' using the font {{ic|lat2-16.psfu.gz}}:<br />
<br />
{{hc|/etc/vconsole.conf|2=<br />
...<br />
FONT=lat2-16<br />
FONT_MAP=8859-2<br />
}}<br />
<br />
It means that second part of ISO/IEC 8859 characters are used with size 16. You can change font size using other values (e.g. {{ic|lat2-08}}). For the regions determined by 8859 specification, look at the [[Wikipedia:ISO/IEC 8859#The parts of ISO/IEC 8859]].<br />
<br />
To use the specified font in early userspace, use the {{ic|consolefont}} hook in {{ic|/etc/mkinitcpio.conf}}. See [[Mkinitcpio#HOOKS]] for more information. <br />
<br />
If the fonts seems to not change on boot, or change only temporarily, it is most likely that they got reset when graphics driver was initialized and console was switched to framebuffer. To avoid this, load your graphics driver earlier. See for example [[Kernel mode setting#Early KMS start]], [https://bbs.archlinux.org/viewtopic.php?id=145765] or other ways to setup your framebuffer before {{ic|/etc/vconsole.conf}} is applied.<br />
<br />
== Font packages ==<br />
<br />
This is a selective list that includes many font packages from the [[AUR]] along with those in the official repositories. Fonts are tagged "Unicode" if they have wide Unicode support, see the project or <br />
Wikipedia pages for detail.<br />
<br />
The [https://github.com/ternstor/distrofonts Archfonts Python script] can be used to generate an overview of all the TTF fonts found in the official repositories / the AUR (the image generation is done using {{AUR|ttf2png}}).<br />
<br />
=== Bitmap ===<br />
<br />
* Default 8x16<br />
* [http://www.dcmembers.com/jibsen/download/61/ Dina] ({{Pkg|dina-font}}) – 6pt, 8pt, 9pt, 10pt, monospaced, based on Proggy<br />
* [http://font.gohu.org/ Gohu] ({{AUR|gohufont}}) – 11px, 14px, normal and bold<br />
* [http://artwizaleczapka.sourceforge.net/ Lime] ({{Pkg|artwiz-fonts}})<br />
* [http://tobiasjung.name/profont/ ProFont] ({{Pkg|profont}}) – 10px, 11px, 12px, 15px, 17px, 22px, 29px, normal<br />
* [[Wikipedia:Proggy programming fonts|Proggy]] ({{AUR|proggyfonts}}) – has different variants<br />
* [http://www.fial.com/~scott/tamsyn-font/ Tamsyn] ({{Pkg|tamsyn-font}})<br />
* [http://terminus-font.sourceforge.net/ Terminus] ({{Pkg|terminus-font}})<br />
* [https://github.com/lucy/tewi-font Tewi] ({{AUR|bdf-tewi-git}})<br />
* [http://unifoundry.com/unifont.html Unifont] ([[Wikipedia:Unicode font#Comparison of fonts|most extensive]] Unicode coverage of any font) ({{Pkg|bdf-unifont}})<br />
<br />
=== Latin script ===<br />
<br />
==== Families ====<br />
<br />
* [[Wikipedia:Bitstream Vera|Bitstream Vera]] ({{Pkg|ttf-bitstream-vera}}) – serif, sans-serif, and monospace<br />
* [https://quoteunquoteapps.com/courierprime/ Courier Prime] ({{AUR|ttf-courier-prime}}) – Courier font alternative optimized for screenplays<br />
* [[Wikipedia:Croscore fonts|Croscore fonts]] ({{Pkg|ttf-croscore}}) – Google's substitute for Windows' Arial, Times New Roman, and Courier New<br />
* [[Wikipedia:DejaVu fonts|DejaVu fonts]] ({{Pkg|ttf-dejavu}}) – Bitstream Vera modified for greater Unicode coverage<br />
* [[Wikipedia:Droid (font)|Droid]] ({{Pkg|ttf-droid}}, included in {{AUR|ttf-google-fonts-git}}) – default font for older Android versions<br />
* [[Wikipedia:Roboto|Roboto]] ({{Pkg|ttf-roboto}}) – default font for newer Android versions<br />
* [[Wikipedia:Noto fonts|Google Noto]] ({{Pkg|noto-fonts}}) – Unicode<br />
* [[Wikipedia:Liberation fonts|Liberation fonts]] ({{Pkg|ttf-liberation}}) – free metric-compatible substitute for the Arial, Arial Narrow, Times New Roman and Courier New found in Windows and Microsoft Office products<br />
* [[Wikipedia:Ubuntu Font Family|Ubuntu Font Family]] ({{Pkg|ttf-ubuntu-font-family}})<br />
* [http://corefonts.sourceforge.net/ Microsoft fonts] ({{AUR|ttf-ms-fonts}}) – Andalé Mono, Courier New, Arial, Arial Black, Comic Sans, Impact, Lucida Sans, Microsoft Sans Serif, Trebuchet, Verdana, Georgia, Times New Roman<br />
* Vista fonts ({{AUR|ttf-vista-fonts}}) – Consolas, Calibri, Candara, Corbel, Cambria, Constantia<br />
<br />
==== Monospaced ====<br />
<br />
For more monospaced fonts see [[#Bitmap]] and [[#Families]].<br />
<br />
* [http://www.marksimonson.com/fonts/view/anonymous-pro Anonymous Pro] ({{pkg|ttf-anonymous-pro}}, included in {{AUR|ttf-google-fonts-git}})<br />
* [https://damieng.com/blog/2008/05/26/envy-code-r-preview-7-coding-font-released Envy Code R] ({{AUR|ttf-envy-code-r}})<br />
* Fantasque Sans Mono ({{AUR|ttf-fantasque-sans-git}})<br />
* [[Wikipedia:Fira Sans|Fira Mono]] ({{pkg|ttf-fira-mono}}, {{pkg|otf-fira-mono}}) – designed for Firefox OS<br />
* [[Wikipedia:GNU FreeFont|FreeMono]] ({{Pkg|ttf-freefont}}) - Unicode<br />
* [https://sourcefoundry.org/hack/ Hack] ({{pkg|ttf-hack}}) - an open source monospaced font, used as the default in KDE Plasma<br />
* [[Wikipedia:Inconsolata|Inconsolata]] ({{Pkg|ttf-inconsolata}}, included in {{AUR|ttf-google-fonts-git}}) - inspired by Consolas<br />
* [https://leonardo-m.livejournal.com/77079.html Inconsolata-g] ({{AUR|ttf-inconsolata-g}}) - adds some programmer-friendly modifications<br />
* [[Wikipedia:Lucida Typewriter|Lucida Typewriter]] (included in package {{AUR|jre}})<br />
* [[Wikipedia:Menlo (typeface)|Menlo]] (derivative: {{AUR|ttf-meslo}}) - default monospaced font of OS X<br />
* [[Wikipedia:Monaco (typeface)|Monaco]] ({{AUR|ttf-monaco}}) - proprietary font designed by Apple for OS X<br />
* Monofur ({{AUR|ttf-monofur}})<br />
* [https://madmalik.github.io/mononoki Mononoki] ({{AUR|ttf-mononoki}})<br />
* [[Wikipedia:Source_Code_Pro|Source Code Pro]] ({{pkg|adobe-source-code-pro-fonts}})<br />
<br />
Relevant websites:<br />
<br />
* [http://hivelogic.com/articles/top-10-programming-fonts Dan Benjamin's Top 10 Programming Fonts].<br />
* [http://www.lowing.org/fonts/ Trevor Lowing's font list]<br />
* [https://www.slant.co/topics/67/~what-are-the-best-programming-fonts Slant: What are the best programming fonts?]<br />
* [https://stackoverflow.com/questions/4689/recommended-fonts-for-programming Stack Overflow: Recommended fonts for programming]<br />
<br />
==== Sans-serif ====<br />
<br />
* [http://scripts.sil.org/cms/scripts/page.php?site_id=nrsi&id=andika Andika] ({{AUR|ttf-andika}})<br />
* [[Wikipedia:GNU FreeFont|FreeSans]] ({{Pkg|ttf-freefont}}) - Unicode<br />
* [https://github.com/rsms/inter Inter UI] ({{AUR|ttf-inter-ui}}) – designed for user interfaces<br />
* [[Wikipedia:Linux Libertine|Linux Biolinum]] ({{Pkg|ttf-linux-libertine}}) – free substitute for Times New Roman<br />
* [[Wikipedia:PT Sans|PT Sans]] ({{AUR|ttf-google-fonts-git}}) - 3 major variations: normal, narrow, and caption - Unicode: Latin, Cyrillic<br />
* [[Wikipedia:Source Sans Pro|Source Sans Pro]] ({{pkg|adobe-source-sans-pro-fonts}})<br />
* [[Wikipedia:Tahoma (typeface)|Tahoma]] ({{AUR|ttf-tahoma}})<br />
<br />
==== Serif ====<br />
<br />
* [http://www.georgduffner.at/ebgaramond/ EB Garamond] ({{AUR|otf-eb-garamond}})<br />
* [[Wikipedia:GNU FreeFont|FreeSerif]] ({{Pkg|ttf-freefont}}) - Unicode<br />
* [[Wikipedia:Gentium|Gentium]] ({{Pkg|ttf-gentium}}) - Unicode: Latin, Greek, Cyrillic, Phonetic Alphabet<br />
* [[Wikipedia:Linux Libertine|Linux Libertine]] ({{Pkg|ttf-linux-libertine}}) - Unicode: Latin, Greek, Cyrillic, Hebrew<br />
<br />
==== Unsorted ====<br />
<br />
{{Style|This section should be absorbed into the Monospace/Serif/Sans-Serif structure}}<br />
<br />
* {{Pkg|font-bh-ttf}} - X.Org Luxi fonts<br />
* {{Pkg|ttf-cheapskate}} - Font collection from ''dustismo.com''<br />
* {{Pkg|ttf-junicode}} - Junius font containing almost complete medieval latin script glyphs<br />
* {{Pkg|ttf-mph-2b-damase}} - Covers full plane 1 and several scripts<br />
* {{Pkg|xorg-fonts-type1}} - IBM Courier and Adobe Utopia sets of [[Wikipedia:PostScript fonts|PostScript fonts]]<br />
* {{AUR|all-repository-fonts}} - Meta package for all fonts in the official repositories.<br />
* {{AUR|ttf-google-fonts-git}} - a huge collection of free fonts (including Ubuntu, Inconsolata, Droid, etc.) - Note: Your font dialog might get very long as >100 fonts will be added.<br />
<br />
=== Non-latin scripts ===<br />
<br />
==== Ancient Scripts ====<br />
<br />
* {{AUR|ttf-ancient-fonts}} - Font containing Unicode symbols for Aegean, Egyptian, Cuneiform, Anatolian, Maya, and Analecta scripts<br />
<br />
==== Arabic ====<br />
<br />
* {{AUR|ttf-amiri}} - A classical Arabic typeface in Naskh style poineered by Amiria Press<br />
* {{AUR|ttf-arabeyes-fonts}} - Collection of free Arabic fonts<br />
* {{AUR|ttf-qurancomplex-fonts}} - Fonts by King Fahd Glorious Quran Printing Complex in al-Madinah al-Munawwarah<br />
* {{AUR|ttf-sil-lateef}} - Unicode Arabic font from SIL<br />
* {{AUR|ttf-sil-scheherazade}} - Unicode Arabic font from SIL<br />
<br />
==== Braille ====<br />
<br />
*{{Pkg|ttf-ubraille}} - Font containing Unicode symbols for ''braille''<br />
<br />
==== Chinese, Japanese, Korean, Vietnamese ====<br />
<br />
===== Pan-CJK =====<br />
*adobe source han fonts<br />
Large collection of fonts which comprehensively support Simplified Chinese, Traditional Chinese, Japanese, and Korean, with a consistent design and look.<br />
**{{Pkg|adobe-source-han-sans-otc-fonts}} - Sans fonts<br />
**{{Pkg|adobe-source-han-serif-otc-fonts}} - Serif fonts<br />
<br />
*{{Pkg|noto-fonts-cjk}} - Large collection of fonts which comprehensively support Simplified Chinese, Traditional Chinese, Japanese, and Korean, with a consistent design and look. It is currently a rebadged version of {{Pkg|adobe-source-han-sans-otc-fonts}}.<br />
<br />
===== Chinese =====<br />
* adobe source han fonts<br />
** {{Pkg|adobe-source-han-sans-cn-fonts}} - Simplified Chinese OpenType/CFF Sans fonts<br />
** {{Pkg|adobe-source-han-sans-tw-fonts}} - Traditional Chinese OpenType/CFF Sans fonts<br />
** {{Pkg|adobe-source-han-serif-cn-fonts}} - Simplified Chinese OpenType/CFF Serif fonts<br />
** {{Pkg|adobe-source-han-serif-tw-fonts}} - Traditional Chinese OpenType/CFF Serif fonts<br />
<br />
* noto Chinese fonts<br />
** {{AUR|noto-fonts-sc}} - Noto CJK-SC fonts for Simplified Chinese<br />
** {{AUR|noto-fonts-tc}} - Noto CJK-TC fonts for Traditional Chinese<br />
<br />
* wqy fonts<br />
** {{Pkg|wqy-zenhei}} - Hei Ti Style (sans-serif) Chinese Outline font embedded with bitmapped Song Ti (also supporting Japanese (partial) and Korean characters).<br />
** {{Pkg|wqy-bitmapfont}} - Bitmapped Song Ti (serif) Chinese font.<br />
<br />
* arphic fonts<br />
** {{Pkg|ttf-arphic-ukai}} - ''Kaiti'' (brush stroke) Unicode font (enabling anti-aliasing is suggested)<br />
** {{Pkg|ttf-arphic-uming}} - ''Mingti'' (printed) Unicode font<br />
<br />
* {{Pkg|opendesktop-fonts}} - ''New Sung'' font, previously is ttf-fireflysung package<br />
<br />
* {{Pkg|ttf-hannom}} - Chinese and Vietnamese ttf fonts<br />
<br />
* Standart fonts of the Republic of China ministry of education in Taiwan<br />
** {{AUR|ttf-tw}} - Kai and Song traditional Chinese font from the Ministry of Education of Taiwan<br />
** {{AUR|ttf-twcns-fonts}} Chinese TrueType fonts by Ministry of Education of Taiwan government, support CNS11643 standard, including Kai and Sung fontface.<br />
<br />
*Windows Chinses fonts<br />
**{{AUR|ttf-ms-win8-zh_cn}} - windows8 simple Chinese fonts。<br />
**{{AUR|ttf-ms-win8-zh_tw}} - windows8 traditional Chinese fonts。<br />
**{{AUR|ttf-ms-win10-zh_cn}} - windows10 simple Chinese fonts。<br />
**{{AUR|ttf-ms-win10-zh_tw}} - windows10 traditional Chinese fonts。<br />
<br />
* {{AUR|ttf-i.bming}} - CJK serif font that emphasis on an old-style typeface.<br />
<br />
===== Japanese =====<br />
<br />
* {{Pkg|adobe-source-han-sans-jp-fonts}} - Japanese OpenType/CFF fonts<br />
* {{Pkg|otf-ipafont}} - Formal style Japanese Gothic (sans-serif) and Mincho (serif) fonts set; one of the highest quality open source font. Default of openSUSE-ja.<br />
* {{Pkg|ttf-hanazono}} - A free Japanese kanji font, style Mincho (serif).<br />
* {{Pkg|ttf-sazanami}} - Japanese free TrueType font. This is outdated and not maintained any more, but may be defined as a fallback font on several environments.<br />
* {{AUR|ttf-koruri}} - Japanese TrueType font obtained by mixing {{AUR|ttf-mplus}} and Open Sans<br />
* {{AUR|ttf-monapo}} - Japanese fonts to show [[wikipedia:2channel_Shift_JIS_art|2channel Shift JIS art]] properly.<br />
* {{AUR|ttf-mplus}} - Modern Gothic style Japanese outline fonts. It includes all of Japanese Hiragana/Katakana, Basic Latin, Latin-1 Supplement, Latin Extended-A, IPA Extensions and most of Japanese Kanji, Greek, Cyrillic, Vietnamese with 7 weights (proportional) or 5 weights (monospace).<br />
* {{AUR|ttf-vlgothic}} - Japanese Gothic fonts. Default of Debian/Fedora/Vine Linux<br />
<br />
===== Korean =====<br />
<br />
* {{Pkg|adobe-source-han-sans-kr-fonts}} - Korean OpenType/CFF fonts<br />
* {{Pkg|ttf-baekmuk}} - Collection of Korean TrueType fonts<br />
* {{AUR|spoqa-han-sans}} - Source Han Sans customized by Spoqa<br />
* {{AUR|ttf-d2coding}} - D2Coding fixed width TrueType font made by Naver<br />
* {{AUR|ttf-nanum}} - Nanum series TrueType fonts<br />
* {{AUR|ttf-nanumgothic_coding}} - Nanum series fixed width TrueType fonts<br />
<br />
===== Vietnamese =====<br />
<br />
* {{Pkg|ttf-hannom}} - Vietnamese TrueType font for chữ Nôm characters<br />
<br />
==== Cyrillic ====<br />
<br />
See also [[#Latin script]].<br />
<br />
* {{AUR|ttf-paratype}} - Font family by ParaType: sans, serif, mono, extended cyrillic and latin, OFL license<br />
* {{AUR|otf-russkopis}} - A free OpenType cursive font for Cyrillic script<br />
<br />
==== Greek ====<br />
<br />
Almost all Unicode fonts contain the Greek character set (polytonic included). Some additional font packages, which might not contain the complete Unicode set but utilize high quality Greek (and Latin, of course) typefaces are:<br />
<br />
* {{AUR|otf-gfs}} - Selection of OpenType fonts from the Greek Font Society<br />
* {{AUR|ttf-mgopen}} - Professional TrueType fonts from Magenta<br />
<br />
==== Hebrew ====<br />
<br />
* {{AUR|culmus}} - Nice collection of free Hebrew fonts<br />
<br />
==== Indic ====<br />
<br />
* {{Pkg|ttf-freebanglafont}} - Font for Bangla<br />
* {{Pkg|ttf-indic-otf}} - Indic OpenType Fonts collection (containing ttf-freebanglafont), provides the character [http://www.fileformat.info/info/unicode/char/ca0/index.htm U+0CA0] "ಠ"<br />
* {{AUR|lohit-fonts}} - Indic TrueType fonts from Fedora Project (containing Oriya Fonts and more)<br />
* {{AUR|ttf-devanagarifonts}} - Devanagari TrueType fonts (contains 283 fonts)<br />
* {{AUR|ttf-gurmukhi-fonts_sikhnet}} - TrueType Gurmukhi fonts (gurbaniwebthick,prabhki)<br />
* {{AUR|ttf-gurmukhi_punjabi}} - TTF Gurmukhi / Punjabi (contains 252 fonts)<br />
* {{AUR|ttf-gujrati-fonts}} - TTF Gujarati fonts (Avantika,Gopika,Shree768)<br />
* {{AUR|ttf-kannada-font}} - Kannada, the language of Karnataka state in India<br />
* {{AUR|ttf-lklug}} - Sinhala Unicode font<br />
* {{AUR|ttf-tamil}} - Tamil Unicode fonts<br />
* {{AUR|ttf-urdufonts}} - Urdu fonts (Jameel Noori Nastaleeq (+kasheeda), Nafees Web Naskh, PDMS Saleem Quran Font) and font configuration to set Jameel Noori Nastaleeq as default font for Urdu<br />
<br />
==== Khmer ====<br />
<br />
* {{Pkg|ttf-khmer}} - Font covering glyphs for Khmer language<br />
* [https://www.google.com/fonts/specimen/Hanuman Hanuman] ({{AUR|ttf-google-fonts-git}})<br />
<br />
==== Mongolic and Tungusic ====<br />
<br />
* {{AUR|ttf-abkai}} - Fonts for Sibe, Manchu and Daur scripts (incomplete, currently in development)<br />
<br />
==== Persian ====<br />
<br />
* {{AUR|persian-fonts}} - Meta package for installing all Persian fonts in AUR.<br />
* {{AUR|borna-fonts}} - Borna Rayaneh Co. Persian B font series.<br />
* {{AUR|iran-nastaliq-fonts}} - A free Unicode calligraphic Persian font.<br />
* {{AUR|iranian-fonts}} - Iranian-Sans and Iranian-Serif Persian font family.<br />
* {{AUR|ir-standard-fonts}} - Iran Supreme Council of Information and Communication Technology (SCICT) standard Persian fonts.<br />
* {{AUR|persian-hm-ftx-fonts}} - A Persian font series derived from X Series 2, Metafont and FarsiTeX fonts with Kashida feature.<br />
* {{AUR|persian-hm-xs2-fonts}} - A Persian font series derived from X Series 2 fonts with Kashida feature.<br />
* {{AUR|sina-fonts}} - Sina Pardazesh Co. Persian font series.<br />
* {{AUR|gandom-fonts}}, {{AUR|parastoo-fonts}}, {{AUR|sahel-fonts}}, {{AUR|samim-fonts}}, {{AUR|shabnam-fonts}}, {{AUR|tanha-fonts}}, {{AUR|vazir-fonts}}, {{AUR|vazir-code-fonts}} - Beautiful Persian fonts made by Ali Rasti Kerdar.<br />
* {{AUR|ttf-yas}} - The Yas Persian font series (with '''hollow zero''').<br />
* {{AUR|ttf-x2}} - Free fonts with support for Persian, Arabic, Urdu, Pashto, Dari, Uzbek, Kurdish, Uighur, old Turkish (Ottoman) and modern Turkish (Roman).<br />
<br />
==== Tai–Kadai ====<br />
<br />
* {{Pkg|fonts-tlwg}} - Collection of scalable Thai fonts<br />
* {{AUR|ttf-lao}} - Lao TTF font (Phetsarath_OT)<br />
* {{AUR|ttf-lao-fonts}} - Lao TTF fonts, both Unicode and non-Unicode for Windows<br />
<br />
==== Tibeto-Burman ====<br />
<br />
* {{Pkg|ttf-tibetan-machine}} - Tibetan Machine TTFont<br />
* {{AUR|ttf-myanmar-fonts}} - 121 Fonts from myordbok.com<br />
<br />
=== Emoji and symbols ===<br />
<br />
A section of the Unicode standard is designated for pictographic characters called "emoji".<br />
<br />
* {{Pkg|noto-fonts-emoji}} - Google's own emoji font, like on Android or Google Hangouts.<br />
* {{Pkg|ttf-symbola}} - provides many Unicode symbols, including emoji, in outline style.<br />
* {{AUR|ttf-emojione-color}} - a color and B&W emoji SVGinOT font built from EmojiOne.<br />
* {{AUR|ttf-twemoji-color}} - Twitter's open-sourced emoji glyphs.<br />
<br />
[[wikipedia:Emoticon#Japanese_style|Kaomoji]] are sometimes referred to as "Japanese emoticons" and are composed of characters from various character sets, including CJK and Indic fonts. For example, the following set of packages covers most of existing kaomoji: {{Pkg|ttf-freefont}}, {{Pkg|ttf-arphic-uming}}, and {{Pkg|ttf-indic-otf}}.<br />
<br />
=== Math ===<br />
<br />
* {{Pkg|font-mathematica}} - Mathematica fonts by Wolfram Research, Inc.<br />
* {{Pkg|texlive-core}} and {{Pkg|texlive-fontsextra}} contain many math fonts such as Latin Modern Math and [[Wikipedia:STIX Fonts project|STIX Fonts]]. See [[TeX Live#Fonts]] for configuration.<br />
* {{AUR|otf-stix}} - A standalone, more recent version of STIX<br />
* {{AUR|otf-latin-modern}}, {{AUR|otf-latinmodern-math}} - Improved version of Computer Modern fonts as used in LaTeX<br />
* {{AUR|ttf-computer-modern-fonts}}, {{AUR|otf-cm-unicode}} - [[wikipedia:Computer Modern|Computer Modern]] (of TeX fame)<br />
* {{AUR|ttf-mathtype}} - MathType fonts<br />
<br />
=== Other operating system fonts ===<br />
<br />
* {{AUR|ttf-mac-fonts}} - Apple MacOS TrueType fonts<br />
<br />
See [[Metric-compatible fonts]], which lists available alternatives for [[Microsoft fonts]].<br />
<br />
== Fallback font order with X11 ==<br />
<br />
Fontconfig automatically chooses a font that matches the current requirement. That is to say, if one is looking at a window containing English and Chinese for example, it will switch to another font for the Chinese text if the default one does not support it.<br />
<br />
Fontconfig lets every user configure the order they want via {{ic|$XDG_CONFIG_HOME/fontconfig/fonts.conf}}.<br />
If you want a particular Chinese font to be selected after your favorite Serif font, your file would look like this:<br />
<br />
<?xml version="1.0"?><br />
<!DOCTYPE fontconfig SYSTEM "fonts.dtd"><br />
<fontconfig><br />
<alias><br />
<family>serif</family><br />
<prefer><br />
<family>Your favorite Latin Serif font name</family><br />
<family>Your Chinese font name</family><br />
</prefer><br />
</alias><br />
</fontconfig><br />
<br />
{{Tip|If you use a Chinese locale, set {{ic|LC_LANG}} to {{ic|und}} to make this work. Otherwise both English and Chinese text will be rendered in the Chinese font.}}<br />
<br />
You can add a section for sans-serif and monospace as well. For more informations, have a look at the fontconfig manual.<br />
<br />
See also [[Font configuration#Replace or set default fonts]].<br />
<br />
== Font alias ==<br />
<br />
There are several font aliases which represent other fonts in order that applications may use similar fonts. The most common aliases are: {{ic|serif}} for a font of the serif type (e.g. DejaVu Serif); {{ic|sans-serif}} for a font of the sans-serif type (e.g. DejaVu Sans); and {{ic|monospace}} for a monospaced font (e.g. DejaVu Sans Mono). However, the fonts which these aliases represent may vary and the relationship is often not shown in font management tools, such as those found in [[KDE]] and other [[desktop environments]].<br />
<br />
To reverse an alias and find which font it is representing, run:<br />
<br />
{{hc|$ fc-match monospace|<br />
DejaVuSansMono.ttf: "DejaVu Sans Mono" "Book"<br />
}}<br />
<br />
In this case, {{ic|DejaVuSansMono.ttf}} is the font represented by the monospace alias.<br />
<br />
== Tips and tricks ==<br />
<br />
=== List all installed fonts ===<br />
<br />
You can use the following command to list all installed Fontconfig fonts that are available on your system. <br />
<br />
$ fc-list<br />
<br />
=== Lists installed fonts for a particular language ===<br />
<br />
Applications and browsers select and display fonts depending upon fontconfig preferences and available font glyph for Unicode text. To list installed fonts for a particular language, issue a command {{ic|<nowiki>fc-list :lang="two letter language code"</nowiki>}}. For instance, to list installed Arabic fonts or fonts supporting Arabic glyph:<br />
{{hc|$ fc-list -f '%{file}\n' :lang&#61;ar|2=<br />
<nowiki><br />
/usr/share/fonts/TTF/FreeMono.ttf<br />
/usr/share/fonts/TTF/DejaVuSansCondensed.ttf<br />
/usr/share/fonts/truetype/custom/DroidKufi-Bold.ttf<br />
/usr/share/fonts/TTF/DejaVuSansMono.ttf<br />
/usr/share/fonts/TTF/FreeSerif.ttf<br />
</nowiki><br />
}}<br />
<br />
=== Set terminal font on-the-fly ===<br />
<br />
{{Expansion|Which terminals specifically support this method? Where is the documentation for the escape codes?}}<br />
<br />
For terminal emulators that use {{ic|Xresources}}, fonts can be set by using escape sequences. Specifically, {{ic|echo -e "\033]710;$font\007"}} to change the normal font ({{ic|*font}} in {{ic|~/.Xresources}}), and replace {{ic|710}} with {{ic|711}}, {{ic|712}}, and {{ic|713}} to change the {{ic|*boldFont}}, {{ic|*italicFont}}, and {{ic|*boldItalicFont}}, respectively.<br />
<br />
{{ic|$font}} uses the same syntax as in {{ic|~/.Xresources}} and can be anything the terminal emulator will support. (Example: {{ic|1=xft:dejavu sans mono:size=9}})<br />
<br />
=== Application-specific font cache ===<br />
<br />
Matplotlib ({{pkg|python-matplotlib}} or {{pkg|python2-matplotlib}}) uses its own font cache, so after updating fonts, be sure to remove {{ic|~/.matplotlib/fontList.cache}}, <br />
{{ic|~/.cache/matplotlib/fontList.cache}}, {{ic|~/.sage/matplotlib-1.2.1/fontList.cache}}, etc. so it will regenerate its cache and find the new fonts [http://matplotlib.1069221.n5.nabble.com/getting-matplotlib-to-recognize-a-new-font-td40500.html].<br />
<br />
== See also ==<br />
<br />
* [http://behdad.org/text/ State of Text Rendering]<br />
* [https://fontlibrary.org/en Font Library] - Fonts under Free licenses<br />
* [https://screenshots.debian.net/packages?search=fonts&show=with Fonts on screenshots.debian.net]</div>J99https://wiki.archlinux.org/index.php?title=Lenovo_ThinkPad_T440s&diff=512841Lenovo ThinkPad T440s2018-03-05T21:01:46Z<p>J99: /* UEFI vs BIOS */ typo</p>
<hr />
<div>[[Category:Lenovo]]<br />
[[ja:Lenovo ThinkPad T440s]]<br />
This article covers the installation and configuration of Arch Linux on a Lenovo T440s laptop.<br />
<br />
== Installation ==<br />
<br />
=== UEFI vs BIOS ===<br />
<br />
The T440S has Secure Boot and dual UEFI/BIOS boot enabled by default. Unless you are comfortable in attempting to set up UEFI boot, it's simpler to get an after-market operating system installed if the booting is switched to BIOS-only. In the BIOS/EFI menu, set booting to "Legacy Only" (which uses BIOS emulation instead of EFI).<br />
<br />
If using UEFI for your installation, you may want to consider the following: <br />
*Secure Boot must be disabled in order to boot a non-Windows operating system. Go to ''Security > Secure Boot'' and set Secure Boot to Disabled. You may also want to put it into Setup/Custom Mode.<br />
* If the security chip is enabled, this can sometimes prevent your bootloader's bootx64.efi from being booted. Under ''Security > Security Chip'', set Security Chip Selection to Discrete TPM and Security Chip to Disabled.<br />
<br />
=== Driver Selection ===<br />
<br />
{| class="wikitable"<br />
|-<br />
! Device || Driver Package<br />
|-<br />
| Video || [[Intel graphics]]<br />
|-<br />
| ClickPad || [[libinput]]<br />
|-<br />
| Wireless/Bluetooth || iwlwifi*<br />
|-<br />
| Finger Print Reader || [[Fprint]] since V 0.6.0<br />
|-<br />
| SD-Card Reader (Realtek RTS5227) || {{AUR|rts5227-dkms}}<br />
|}<br />
<br />
Note*: Depending on what you picked when ordering the laptop, you might have a stock ThinkPad wireless card. Check [http://www.thinkwiki.org/wiki/Drivers this page] for more information.<br />
<br />
=== Tp_smapi ===<br />
<br />
See [[tp_smapi]] and a configuration for [[Lenovo ThinkPad T420#Tp_smapi|ThinkPad T420]].<br />
<br />
== Tweaks ==<br />
=== Screen resolution and scaling ===<br />
In order to use the real dpi value create the file ({{ic|/etc/X11/xorg.conf.d/90-monitor.conf}}):<br />
<br />
{{bc|<br />
Section "Monitor"<br />
Identifier "<default monitor>"<br />
DisplaySize 309 173 # In millimeters<br />
EndSection<br />
}}<br />
<br />
Otherwise the defalut resolution is set to 96dpi.<br />
<br />
If you have a 1920x1080 FHD panel installed and find that text and UI elements are too small, it may interest you to consider using [[HiDPI|display scaling]] to adjust the size of UI elements to your preference. Integer HiDPI scaling is likely too excessive for a display of this resolution and size, so you will want to consider a fractional scaling solution.<br />
<br />
=== Backlight ===<br />
<br />
See [[Backlight]].<br />
<br />
=== Touchpad ===<br />
<br />
Most responsive configuration is obtained through [[xinput]]. <br />
<br />
Decent Synaptics configuration, utilizing sane settings for the X1-Carbon:<br />
* [http://rscircus.org/post/72978821261/t440s-clickpad-fix-which-feels-good "R's Circus" Synaptics configuration]<br />
<br />
== Updating the BIOS ==<br />
{{Warning|Flashing motherboard BIOS is a dangerous activity that can render your motherboard inoperable!}}<br />
See [[Flashing BIOS from Linux#Bootable optical disk emulation]] and [http://www.lenzg.net/archives/358-Updating-the-BIOS-on-my-ThinkPad-T440-without-Windows-or-a-DVD-Drive.html Updating the BIOS on my ThinkPad T440]</div>J99https://wiki.archlinux.org/index.php?title=Lenovo_ThinkPad_T440s&diff=512840Lenovo ThinkPad T440s2018-03-05T20:57:29Z<p>J99: Add info on display scaling</p>
<hr />
<div>[[Category:Lenovo]]<br />
[[ja:Lenovo ThinkPad T440s]]<br />
This article covers the installation and configuration of Arch Linux on a Lenovo T440s laptop.<br />
<br />
== Installation ==<br />
<br />
=== UEFI vs BIOS ===<br />
<br />
The T440S has Secure Boot and dual UEFI/BIOS boot enabled by default. Unless you are comfortable in attempting to set up UEFI boot, it's simpler to get an after-market operating system installed if the booting is switched to BIOS-only. In the BIOS/EFI menu, set booting to "Legacy Only" (which uses BIOS emulation instead of EFI).<br />
<br />
If using UEFI for your installation, you may want to consider the following: <br />
*Secure Boot must be disabled in order to boot a non-Windows operating system. Go to ''Security > Secure Boot'' and set Secure Boot to Disabled. You also want to put it into Setup/Custom Mode.<br />
* If the security chip is enabled, this can sometimes prevent your bootloader's bootx64.efi from being booted. Under ''Security > Security Chip'', set Security Chip Selection to Discrete TPM and Security Chip to Disabled.<br />
<br />
=== Driver Selection ===<br />
<br />
{| class="wikitable"<br />
|-<br />
! Device || Driver Package<br />
|-<br />
| Video || [[Intel graphics]]<br />
|-<br />
| ClickPad || [[libinput]]<br />
|-<br />
| Wireless/Bluetooth || iwlwifi*<br />
|-<br />
| Finger Print Reader || [[Fprint]] since V 0.6.0<br />
|-<br />
| SD-Card Reader (Realtek RTS5227) || {{AUR|rts5227-dkms}}<br />
|}<br />
<br />
Note*: Depending on what you picked when ordering the laptop, you might have a stock ThinkPad wireless card. Check [http://www.thinkwiki.org/wiki/Drivers this page] for more information.<br />
<br />
=== Tp_smapi ===<br />
<br />
See [[tp_smapi]] and a configuration for [[Lenovo ThinkPad T420#Tp_smapi|ThinkPad T420]].<br />
<br />
== Tweaks ==<br />
=== Screen resolution and scaling ===<br />
In order to use the real dpi value create the file ({{ic|/etc/X11/xorg.conf.d/90-monitor.conf}}):<br />
<br />
{{bc|<br />
Section "Monitor"<br />
Identifier "<default monitor>"<br />
DisplaySize 309 173 # In millimeters<br />
EndSection<br />
}}<br />
<br />
Otherwise the defalut resolution is set to 96dpi.<br />
<br />
If you have a 1920x1080 FHD panel installed and find that text and UI elements are too small, it may interest you to consider using [[HiDPI|display scaling]] to adjust the size of UI elements to your preference. Integer HiDPI scaling is likely too excessive for a display of this resolution and size, so you will want to consider a fractional scaling solution.<br />
<br />
=== Backlight ===<br />
<br />
See [[Backlight]].<br />
<br />
=== Touchpad ===<br />
<br />
Most responsive configuration is obtained through [[xinput]]. <br />
<br />
Decent Synaptics configuration, utilizing sane settings for the X1-Carbon:<br />
* [http://rscircus.org/post/72978821261/t440s-clickpad-fix-which-feels-good "R's Circus" Synaptics configuration]<br />
<br />
== Updating the BIOS ==<br />
{{Warning|Flashing motherboard BIOS is a dangerous activity that can render your motherboard inoperable!}}<br />
See [[Flashing BIOS from Linux#Bootable optical disk emulation]] and [http://www.lenzg.net/archives/358-Updating-the-BIOS-on-my-ThinkPad-T440-without-Windows-or-a-DVD-Drive.html Updating the BIOS on my ThinkPad T440]</div>J99https://wiki.archlinux.org/index.php?title=Lenovo_ThinkPad_T440s&diff=512838Lenovo ThinkPad T440s2018-03-05T20:49:25Z<p>J99: /* UEFI vs BIOS */ Tips for UEFI boot</p>
<hr />
<div>[[Category:Lenovo]]<br />
[[ja:Lenovo ThinkPad T440s]]<br />
This article covers the installation and configuration of Arch Linux on a Lenovo T440s laptop.<br />
<br />
== Installation ==<br />
<br />
=== UEFI vs BIOS ===<br />
<br />
The T440S has Secure Boot and dual UEFI/BIOS boot enabled by default. Unless you are comfortable in attempting to set up UEFI boot, it's simpler to get an after-market operating system installed if the booting is switched to BIOS-only. In the BIOS/EFI menu, set booting to "Legacy Only" (which uses BIOS emulation instead of EFI).<br />
<br />
If using UEFI for your installation, you may want to consider the following: <br />
*Secure Boot must be disabled in order to boot a non-Windows operating system. Go to ''Security > Secure Boot'' and set Secure Boot to Disabled. You also want to put it into Setup/Custom Mode.<br />
* If the security chip is enabled, this can sometimes prevent your bootloader's bootx64.efi from being booted. Under ''Security > Security Chip'', set Security Chip Selection to Discrete TPM and Security Chip to Disabled.<br />
<br />
=== Driver Selection ===<br />
<br />
{| class="wikitable"<br />
|-<br />
! Device || Driver Package<br />
|-<br />
| Video || [[Intel graphics]]<br />
|-<br />
| ClickPad || [[libinput]]<br />
|-<br />
| Wireless/Bluetooth || iwlwifi*<br />
|-<br />
| Finger Print Reader || [[Fprint]] since V 0.6.0<br />
|-<br />
| SD-Card Reader (Realtek RTS5227) || {{AUR|rts5227-dkms}}<br />
|}<br />
<br />
Note*: Depending on what you picked when ordering the laptop, you might have a stock ThinkPad wireless card. Check [http://www.thinkwiki.org/wiki/Drivers this page] for more information.<br />
<br />
=== Tp_smapi ===<br />
<br />
See [[tp_smapi]] and a configuration for [[Lenovo ThinkPad T420#Tp_smapi|ThinkPad T420]].<br />
<br />
== Tweaks ==<br />
=== Screen resolution ===<br />
In order to use the real dpi value create the file ({{ic|/etc/X11/xorg.conf.d/90-monitor.conf}}):<br />
<br />
{{bc|<br />
Section "Monitor"<br />
Identifier "<default monitor>"<br />
DisplaySize 309 173 # In millimeters<br />
EndSection<br />
}}<br />
<br />
Otherwise the defalut resolution is set to 96dpi.<br />
<br />
=== Backlight ===<br />
<br />
See [[Backlight]].<br />
<br />
=== Touchpad ===<br />
<br />
Most responsive configuration is obtained through [[xinput]]. <br />
<br />
Decent Synaptics configuration, utilizing sane settings for the X1-Carbon:<br />
* [http://rscircus.org/post/72978821261/t440s-clickpad-fix-which-feels-good "R's Circus" Synaptics configuration]<br />
<br />
== Updating the BIOS ==<br />
{{Warning|Flashing motherboard BIOS is a dangerous activity that can render your motherboard inoperable!}}<br />
See [[Flashing BIOS from Linux#Bootable optical disk emulation]] and [http://www.lenzg.net/archives/358-Updating-the-BIOS-on-my-ThinkPad-T440-without-Windows-or-a-DVD-Drive.html Updating the BIOS on my ThinkPad T440]</div>J99https://wiki.archlinux.org/index.php?title=Lenovo_ThinkPad_T440s&diff=512836Lenovo ThinkPad T440s2018-03-05T20:38:41Z<p>J99: /* UEFI vs BIOS */ Minor phrasing changes and spelling corrections</p>
<hr />
<div>[[Category:Lenovo]]<br />
[[ja:Lenovo ThinkPad T440s]]<br />
This article covers the installation and configuration of Arch Linux on a Lenovo T440s laptop.<br />
<br />
== Installation ==<br />
<br />
=== UEFI vs BIOS ===<br />
<br />
The T440S has Secure Boot and dual UEFI/BIOS boot enabled by default. Unless you are comfortable in attempting to set up UEFI boot, it's simpler to get an after-market OS installed if the booting is switched to BIOS-only. In the BIOS/EFI menu, set booting to "Legacy Only" (which uses BIOS emulation instead of EFI).<br />
<br />
=== Driver Selection ===<br />
<br />
{| class="wikitable"<br />
|-<br />
! Device || Driver Package<br />
|-<br />
| Video || [[Intel graphics]]<br />
|-<br />
| ClickPad || [[libinput]]<br />
|-<br />
| Wireless/Bluetooth || iwlwifi*<br />
|-<br />
| Finger Print Reader || [[Fprint]] since V 0.6.0<br />
|-<br />
| SD-Card Reader (Realtek RTS5227) || {{AUR|rts5227-dkms}}<br />
|}<br />
<br />
Note*: Depending on what you picked when ordering the laptop, you might have a stock ThinkPad wireless card. Check [http://www.thinkwiki.org/wiki/Drivers this page] for more information.<br />
<br />
=== Tp_smapi ===<br />
<br />
See [[tp_smapi]] and a configuration for [[Lenovo ThinkPad T420#Tp_smapi|ThinkPad T420]].<br />
<br />
== Tweaks ==<br />
=== Screen resolution ===<br />
In order to use the real dpi value create the file ({{ic|/etc/X11/xorg.conf.d/90-monitor.conf}}):<br />
<br />
{{bc|<br />
Section "Monitor"<br />
Identifier "<default monitor>"<br />
DisplaySize 309 173 # In millimeters<br />
EndSection<br />
}}<br />
<br />
Otherwise the defalut resolution is set to 96dpi.<br />
<br />
=== Backlight ===<br />
<br />
See [[Backlight]].<br />
<br />
=== Touchpad ===<br />
<br />
Most responsive configuration is obtained through [[xinput]]. <br />
<br />
Decent Synaptics configuration, utilizing sane settings for the X1-Carbon:<br />
* [http://rscircus.org/post/72978821261/t440s-clickpad-fix-which-feels-good "R's Circus" Synaptics configuration]<br />
<br />
== Updating the BIOS ==<br />
{{Warning|Flashing motherboard BIOS is a dangerous activity that can render your motherboard inoperable!}}<br />
See [[Flashing BIOS from Linux#Bootable optical disk emulation]] and [http://www.lenzg.net/archives/358-Updating-the-BIOS-on-my-ThinkPad-T440-without-Windows-or-a-DVD-Drive.html Updating the BIOS on my ThinkPad T440]</div>J99https://wiki.archlinux.org/index.php?title=Uniform_look_for_Qt_and_GTK_applications&diff=512835Uniform look for Qt and GTK applications2018-03-05T20:24:24Z<p>J99: /* Breeze */ Advise reader to have kde-gtk-config installed beforehand</p>
<hr />
<div>[[Category:Widget toolkits]]<br />
[[Category:Eye candy]]<br />
[[es:Uniform look for Qt and GTK applications]]<br />
[[it:Uniform look for Qt and GTK applications]]<br />
[[ja:Qt と GTK アプリケーションの外観の統合]]<br />
[[ru:Uniform look for Qt and GTK applications]]<br />
[[zh-hans:Uniform look for Qt and GTK applications]]<br />
{{Related articles start}}<br />
{{Related|GTK+}}<br />
{{Related|Qt}}<br />
{{Related articles end}}<br />
[[Qt]] and [[GTK+]] based programs both use a different widget toolkit to render the graphical user interface. Each come with different themes, styles and icon sets by default, among other things, so the "look and feel" differ significantly. This article will help you make your Qt and GTK+ applications look similar for a more streamlined and integrated desktop experience.<br />
<br />
== Overview ==<br />
<br />
To get a similar look between the toolkits, you will most likely have to modify the following:<br />
* '''Theme''': The custom appearance of an application, widget set, etc. It usually consists of a style, an icon theme and a color theme.<br />
* '''Style''': The graphical layout and look of the widget set.<br />
* '''Icon Theme''': A set of global icons.<br />
* '''Color Theme''': A set of global colors that are used in conjunction with the style.<br />
<br />
You can choose various approaches:<br />
* Modify [[#Styles for both Qt and GTK+|GTK+ and Qt styles]] separately with the tools listed below for each toolkit and aim for choosing similarly looking themes (style, colors, icons, cursors, fonts).<br />
* Use a special [[#Theme engines|theme engine]], which intermediates the modification of the other graphical toolkit to match your main toolkit.<br />
<br />
== Styles for both Qt and GTK+ ==<br />
There are widget style sets available for the purpose of integration, where builds are written and provided for both Qt and GTK+, all major versions included. With these, you can have one look for all applications regardless of the toolkit they had been written with.<br />
<br />
{{Tip|You may want to apply user defined styles to root applications, see [[GTK#Theme not applied to root applications]] and [[Qt#Theme not applied to root applications]].}}<br />
{{Note|1=Since version 3.16, GTK+ 3 [https://bbs.archlinux.org/viewtopic.php?pid=1518404#p1518404 does not support] non-CSS themes, hence previous solutions such as Oxygen-Gtk are [https://bugs.kde.org/show_bug.cgi?id=340288 no longer viable] options.}}<br />
<br />
=== Breeze ===<br />
<br />
Breeze is the default Qt style of KDE Plasma. It can be installed with the {{Pkg|breeze}} package for Qt5, the {{Pkg|breeze-kde4}} package for Qt4, and the {{Pkg|breeze-gtk}} package for GTK+ 2 and GTK+ 3.<br />
<br />
Once installed, you can use one of the many [[GTK+#Configuration tools|GTK+ configuration tools]] to change the GTK+ theme. <br />
<br />
If running KDE Plasma, install {{pkg|kde-gtk-config}} and either run it from the command line, or go to ''System Settings > Application Style > GNOME Application Style (GTK)''. Fonts, icon themes, cursors, and widget styles set in System Settings outside of the GTK configuration module will affect Qt only; GTK settings should be set manually using the previously mentioned module.<br />
<br />
=== Adwaita ===<br />
<br />
Adwaita is the default GNOME theme. The GTK+ 3 version is included in the {{Pkg|gtk3}} package, while the GTK+ 2 version is in {{Pkg|gnome-themes-standard}}. [https://github.com/MartinBriza/adwaita-qt adwaita-qt] is a Qt port of the Adwaita theme. Unlike [[#QGtkStyle]], which mimics the GTK+ 2 theme, it provides a native Qt style made to look like the GTK+ 3 Adwaita. It can be [[install|installed]] with the {{AUR|adwaita-qt4}} and {{AUR|adwaita-qt5}} packages for the Qt 4 and 5 versions, respectively.<br />
<br />
To set the Qt style as default:<br />
<br />
* For Qt4, it can be enabled with ''Qt Configuration'' ({{ic|qtconfig-qt4}}), choose ''adwaita'' under ''Appearance > GUI Style''. Alternatively, edit the {{ic|/etc/xdg/Trolltech.conf}} (system-wide) or {{ic|~/.config/Trolltech.conf}} (user-specific) file:<br />
<br />
{{hc|~/.config/Trolltech.conf|2=<br />
...<br />
[Qt]<br />
style=adwaita<br />
...<br />
}}<br />
<br />
* For Qt 5, it can be enabled by setting the following [[Environment variables#Graphical applications|environment variable]]: {{ic|1=QT_STYLE_OVERRIDE=adwaita}}. Alternatively, use {{Pkg|qt5ct}} package. For more detailed instructions, see [[Qt#Configuration of Qt5 apps under environments other than KDE Plasma]].<br />
<br />
== Theme engines ==<br />
<br />
A ''theme engine'' can be thought of as a thin layer API which translates themes (excluding icons) between one or more toolkits. These engines add some extra code in the process and it is arguable that this kind of a solution is not as elegant and optimal as using native styles.<br />
<br />
=== QGtkStyle ===<br />
<br />
{{Note|QGtkStyle has been removed from {{Pkg|qt5-base}} 5.7.0 [https://github.com/qtproject/qtbase/commit/899a815414e95da8d9429a4a4f4d7094e49cfc55] and added to {{Pkg|qt5-styleplugins}} [https://github.com/qtproject/qtstyleplugins/commit/102da7d50231fc5723dba6e72340bef3d29471aa]}}<br />
<br />
{{Warning|Depending on GTK+ 2 theme, this style may cause rendering issues such as transparent fonts or inconsistent widgets.}}<br />
<br />
This Qt style uses GTK+ 2 to render all components to blend in with [[GNOME]] and similar GTK+ based environments. Beginning with Qt 4.5, this style is included in Qt. It requires {{Pkg|gtk2}} to be installed and configured.<br />
<br />
This is the default Qt4 style in Cinnamon, GNOME and Xfce, and the default Qt5 style in Cinnamon, GNOME, MATE, LXDE and Xfce. In other environments:<br />
<br />
* For Qt4, it can be enabled with ''Qt Configuration'' ({{ic|qtconfig-qt4}}), choose ''GTK+'' under ''Appearance > GUI Style''. Alternatively, edit the {{ic|/etc/xdg/Trolltech.conf}} (system-wide) or {{ic|~/.config/Trolltech.conf}} (user-specific) file:<br />
<br />
{{hc|~/.config/Trolltech.conf|2=<br />
...<br />
[Qt]<br />
style=GTK+<br />
...<br />
}}<br />
<br />
* For Qt 5, it can be enabled by installing {{Pkg|qt5-styleplugins}} and setting the following [[Environment variables#Graphical applications|environment variable]]: {{ic|1=QT_QPA_PLATFORMTHEME=gtk2}}<br />
<br />
For full uniformity, make sure that the configured [[GTK+#Themes|GTK+ theme]] supports both GTK+ 2 and GTK+ 3. If your preferred theme has inconsistent rendering after configuring Qt to use GTK+2, install {{ic|gtk-theme-switch2}} and choose a theme.<br />
<br />
=== QGnomePlatform ===<br />
<br />
This Qt 5 platform theme applies the appearance settings of GNOME for Qt applications. It can be installed with the {{AUR|qgnomeplatform}} package or the {{AUR|qgnomeplatform-git}} package for the development version. It does not provide a Qt style itself, instead it requires a [[#Styles for both Qt and GTK+|style that support both Qt and GTK+]].<br />
<br />
This platform theme is enabled automatically in GNOME since version 3.20. For other systems, it can be enabled by setting the following [[Environment variables#Graphical applications|environment variable]]: {{ic|1=QT_QPA_PLATFORMTHEME=qgnomeplatform}}.<br />
<br />
== Tips and tricks ==<br />
=== KDE file dialogs for GTK+ applications ===<br />
'''Chromium''' <br />
At least for chromium installing {{ic|kdialog}} makes chromium used kde file dialog ( so `KGtk-wrapper` is not required )<br />
<br />
{{Warning|Some GTK+ applications may not be compatible with KGtk-wrapper (e.g. [[Chromium]]), sometimes the wrapper makes the application crash ([[Firefox]] or [[Thunderbird]]).}}<br />
<br />
{{AUR|kgtk}} from the [[AUR]] is a wrapper script which uses {{ic|LD_PRELOAD}} to force KDE file dialogs in GTK+ 2.x apps. Once installed you can run GTK+ 2.x applications with {{ic|kgtk-wrapper}} in two ways (using [[GIMP]] in the examples):<br />
<br />
* Calling {{ic|kgtk-wrapper}} directly and using the GTK+ 2.x binary as an argument:<br />
:{{bc|$ /usr/bin/kgtk-wrapper gimp}}<br />
* Modifying the KDE .desktop shortcuts files you can find at {{ic|/usr/share/applications/}} to prefix the {{ic|Exec}} statement with kgtk-wrapper.<br />
:e.g. with [[GIMP]], edit the {{ic|/usr/share/applications/gimp.desktop}} shortcut file and replace {{ic|1=Exec=gimp-2.8 %U}} by {{ic|1=Exec=kgtk-wrapper gimp-2.8 %U}}.<br />
<br />
=== Using a GTK+ icon theme in Qt apps ===<br />
<br />
{{Style|Duplicates [[environment variables]]}}<br />
<br />
If you are running Plasma, install {{Pkg|kde-gtk-config}} and select the icon-theme under ''System Settings > Application Style > GTK''.<br />
<br />
If you are using [[GNOME]], first check if {{Pkg|dconf-editor}} is installed.<br />
<br />
Then, run {{ic|dconf-editor}} and look under ''org > gnome > desktop > interface'' for {{ic|icon-theme}} key and change it to your preferred icon theme. <br />
<br />
If you are not using [[GNOME]], for example if you are running a minimal system with {{Pkg|i3-wm}}, first install {{Pkg|dconf-editor}}. <br />
<br />
Then, run {{ic|dconf-editor}} and look under ''org > gnome > desktop > interface'' for {{ic|icon-theme}} key and change it to your preferred icon theme. <br />
<br />
Since, you are not using [[GNOME]], you might have to set the value of {{ic|DESKTOP_SESSION}} in your profile. To do that execute the below code in a terminal and restart your system.<br />
<br />
$ echo 'export DESKTOP_SESSION=gnome' >> /etc/profile<br />
<br />
'''OR'''<br />
<br />
Set {{ic|1=export DESKTOP_SESSION=gnome}} somewhere in your {{ic|~/.xinitrc}} or, if you are using a [[Display manager]] in [[Xprofile]].<br />
<br />
{{Note| If the icon theme was not applied, you might want to check if the name that you entered of your preferred theme, was in the correct format. For example, if you want to apply the currently active icon theme to your QT applications, you can find the correct format of it's name with the command:<br />
<br />
{{bc|1=$ cat ~/.gtkrc-2.0 {{!}} grep icon-theme {{!}} cut -d= -f2}}<br />
<br />
}}<br />
<br />
=== Improve subpixel rendering of GTK apps under KDE Plasma ===<br />
<br />
See [[Font configuration#LCD filter]].<br />
<br />
== Troubleshooting ==<br />
<br />
=== Qt applications do not use QGtkStyle ===<br />
Qt will not apply QGtkStyle correctly if GTK+ is using the [[#GTK+-Qt Engine|GTK+-Qt Engine]]{{Broken section link}}. Qt determines whether the GTK+-Qt Engine is in use by reading the GTK+ configuration files listed in the environmental variable {{ic|GTK2_RC_FILES}}. If the environmental variable is not set properly, Qt assumes you are using the engine, sets QGtkStyle to use the style GTK+ style ''Clearlooks'', and outputs an error message:<br />
<br />
QGtkStyle cannot be used together with the GTK_Qt engine.<br />
<br />
Another error you may get after launching {{ic|qtconfig-qt4}} from a shell and selecting the GTK+ style is:<br />
<br />
QGtkStyle was unable to detect the current GTK+ theme.<br />
<br />
According to [https://bbs.archlinux.org/viewtopic.php?id&#61;99175&p&#61;1 this thread], you may simply have to install {{AUR|libgnomeui}} to solve this issue. This has the added benefit that you do not need to edit a file every time you change your theme via a graphical tool, like the one provided by xfce.<br />
<br />
Users of [[Openbox]] and other non-GNOME environments may encounter this problem. To solve this, first add the following to your {{ic|.xinitrc}} file:<br />
{{hc|.xinitrc|<nowiki><br />
...<br />
export GTK2_RC_FILES="$HOME/.gtkrc-2.0"<br />
...<br />
</nowiki>}}<br />
<br />
{{Note|<br />
* Make sure to add this line before invoking the window manager.<br />
* You can add multiple paths by separating them with colons.<br />
* Make sure to use {{ic|$HOME}} instead of {{ic|~}} as it will not properly expand to the user's home directory.<br />
}}<br />
<br />
Then specify the theme you want in the {{ic|~/.gtkrc-2.0}} file using a [[#GTK2 styles|dedicated application]]{{Broken section link}} or manually, by adding:<br />
{{hc|.gtkrc-2.0|<nowiki><br />
...<br />
gtk-theme-name="[name of theme]"<br />
...<br />
</nowiki>}}<br />
<br />
Some tools only insert the following include directive in {{ic|~/.gtkrc-2.0}}:<br />
{{hc|.gtkrc-2.0|<br />
...<br />
include "/usr/share/themes/SomeTheme/gtk-2.0/gtkrc"<br />
...<br />
}}<br />
<br />
which apparently is not recognized by all versions of QGtkStyle. You can hotfix this problem by inserting the {{ic|gtk-theme-name}} manually in your {{ic|~/.gtkrc-2.0}} file like above.<br />
<br />
{{Note|Style-changing applications will most probably rewrite the {{ic|~/.gtkrc-2.0}} file the next time you change themes.}}<br />
<br />
If these steps do not work, install {{Pkg|gconf}} and run this command:<br />
<br />
gconftool-2 --set --type string /desktop/gnome/interface/gtk_theme [name of theme]<br />
<br />
If you further want to set the same icon and cursor theme, then you have to specify them, too.<br />
<br />
gconftool-2 --set --type string /desktop/gnome/interface/icon_theme Faenza-Dark<br />
<br />
This sets the icon theme to Faenza-Dark located in {{ic|/usr/share/icons/Faenza-Dark}}. For the cursor theme you first have to set the gconf value.<br />
<br />
gconftool-2 --set --type string /desktop/gnome/peripherals/mouse/cursor_theme Adwaita<br />
<br />
Then you will have to create the file {{ic|/usr/share/icons/default/index.theme}} with the following lines:<br />
<br />
[Icon Theme]<br />
Inherits=Adwaita<br />
<br />
=== Themes not working in GTK+ apps ===<br />
<br />
If the style or theme engine you set up is not showing in your GTK applications then it is likely your GTK+ settings files are not being loaded for some reason. You can check where your system expects to find these files by doing the following..<br />
$ export | grep gtk<br />
<br />
Usually the expected files should be {{ic|~/.gtkrc}} for GTK1 and {{ic|~/.gtkrc2.0}} or {{ic|~/.gtkrc2.0-kde}} for GTK+ 2.x.<br />
<br />
=== GTK+ apps don't use svg (breeze) icons after system upgrade ===<br />
<br />
Try to run this to fix this issue:<br />
# gdk-pixbuf-query-loaders --update-cache</div>J99https://wiki.archlinux.org/index.php?title=Uniform_look_for_Qt_and_GTK_applications&diff=512834Uniform look for Qt and GTK applications2018-03-05T20:21:38Z<p>J99: /* Breeze */ New line for readability</p>
<hr />
<div>[[Category:Widget toolkits]]<br />
[[Category:Eye candy]]<br />
[[es:Uniform look for Qt and GTK applications]]<br />
[[it:Uniform look for Qt and GTK applications]]<br />
[[ja:Qt と GTK アプリケーションの外観の統合]]<br />
[[ru:Uniform look for Qt and GTK applications]]<br />
[[zh-hans:Uniform look for Qt and GTK applications]]<br />
{{Related articles start}}<br />
{{Related|GTK+}}<br />
{{Related|Qt}}<br />
{{Related articles end}}<br />
[[Qt]] and [[GTK+]] based programs both use a different widget toolkit to render the graphical user interface. Each come with different themes, styles and icon sets by default, among other things, so the "look and feel" differ significantly. This article will help you make your Qt and GTK+ applications look similar for a more streamlined and integrated desktop experience.<br />
<br />
== Overview ==<br />
<br />
To get a similar look between the toolkits, you will most likely have to modify the following:<br />
* '''Theme''': The custom appearance of an application, widget set, etc. It usually consists of a style, an icon theme and a color theme.<br />
* '''Style''': The graphical layout and look of the widget set.<br />
* '''Icon Theme''': A set of global icons.<br />
* '''Color Theme''': A set of global colors that are used in conjunction with the style.<br />
<br />
You can choose various approaches:<br />
* Modify [[#Styles for both Qt and GTK+|GTK+ and Qt styles]] separately with the tools listed below for each toolkit and aim for choosing similarly looking themes (style, colors, icons, cursors, fonts).<br />
* Use a special [[#Theme engines|theme engine]], which intermediates the modification of the other graphical toolkit to match your main toolkit.<br />
<br />
== Styles for both Qt and GTK+ ==<br />
There are widget style sets available for the purpose of integration, where builds are written and provided for both Qt and GTK+, all major versions included. With these, you can have one look for all applications regardless of the toolkit they had been written with.<br />
<br />
{{Tip|You may want to apply user defined styles to root applications, see [[GTK#Theme not applied to root applications]] and [[Qt#Theme not applied to root applications]].}}<br />
{{Note|1=Since version 3.16, GTK+ 3 [https://bbs.archlinux.org/viewtopic.php?pid=1518404#p1518404 does not support] non-CSS themes, hence previous solutions such as Oxygen-Gtk are [https://bugs.kde.org/show_bug.cgi?id=340288 no longer viable] options.}}<br />
<br />
=== Breeze ===<br />
<br />
Breeze is the default Qt style of KDE Plasma. It can be installed with the {{Pkg|breeze}} package for Qt5, the {{Pkg|breeze-kde4}} package for Qt4, and the {{Pkg|breeze-gtk}} package for GTK+ 2 and GTK+ 3.<br />
<br />
Once installed, you can use one of the many [[GTK+#Configuration tools|GTK+ configuration tools]] to change the GTK+ theme. <br />
<br />
If running KDE Plasma, go to ''Application Style > GNOME Application Style (GTK)'' in System Settings or run the {{ic|kde-gtk-config}} command. Fonts, icon themes, cursors, and widget styles set in System Settings outside of the GTK configuration module will affect Qt only; GTK settings should be set manually using the previously mentioned module.<br />
<br />
=== Adwaita ===<br />
<br />
Adwaita is the default GNOME theme. The GTK+ 3 version is included in the {{Pkg|gtk3}} package, while the GTK+ 2 version is in {{Pkg|gnome-themes-standard}}. [https://github.com/MartinBriza/adwaita-qt adwaita-qt] is a Qt port of the Adwaita theme. Unlike [[#QGtkStyle]], which mimics the GTK+ 2 theme, it provides a native Qt style made to look like the GTK+ 3 Adwaita. It can be [[install|installed]] with the {{AUR|adwaita-qt4}} and {{AUR|adwaita-qt5}} packages for the Qt 4 and 5 versions, respectively.<br />
<br />
To set the Qt style as default:<br />
<br />
* For Qt4, it can be enabled with ''Qt Configuration'' ({{ic|qtconfig-qt4}}), choose ''adwaita'' under ''Appearance > GUI Style''. Alternatively, edit the {{ic|/etc/xdg/Trolltech.conf}} (system-wide) or {{ic|~/.config/Trolltech.conf}} (user-specific) file:<br />
<br />
{{hc|~/.config/Trolltech.conf|2=<br />
...<br />
[Qt]<br />
style=adwaita<br />
...<br />
}}<br />
<br />
* For Qt 5, it can be enabled by setting the following [[Environment variables#Graphical applications|environment variable]]: {{ic|1=QT_STYLE_OVERRIDE=adwaita}}. Alternatively, use {{Pkg|qt5ct}} package. For more detailed instructions, see [[Qt#Configuration of Qt5 apps under environments other than KDE Plasma]].<br />
<br />
== Theme engines ==<br />
<br />
A ''theme engine'' can be thought of as a thin layer API which translates themes (excluding icons) between one or more toolkits. These engines add some extra code in the process and it is arguable that this kind of a solution is not as elegant and optimal as using native styles.<br />
<br />
=== QGtkStyle ===<br />
<br />
{{Note|QGtkStyle has been removed from {{Pkg|qt5-base}} 5.7.0 [https://github.com/qtproject/qtbase/commit/899a815414e95da8d9429a4a4f4d7094e49cfc55] and added to {{Pkg|qt5-styleplugins}} [https://github.com/qtproject/qtstyleplugins/commit/102da7d50231fc5723dba6e72340bef3d29471aa]}}<br />
<br />
{{Warning|Depending on GTK+ 2 theme, this style may cause rendering issues such as transparent fonts or inconsistent widgets.}}<br />
<br />
This Qt style uses GTK+ 2 to render all components to blend in with [[GNOME]] and similar GTK+ based environments. Beginning with Qt 4.5, this style is included in Qt. It requires {{Pkg|gtk2}} to be installed and configured.<br />
<br />
This is the default Qt4 style in Cinnamon, GNOME and Xfce, and the default Qt5 style in Cinnamon, GNOME, MATE, LXDE and Xfce. In other environments:<br />
<br />
* For Qt4, it can be enabled with ''Qt Configuration'' ({{ic|qtconfig-qt4}}), choose ''GTK+'' under ''Appearance > GUI Style''. Alternatively, edit the {{ic|/etc/xdg/Trolltech.conf}} (system-wide) or {{ic|~/.config/Trolltech.conf}} (user-specific) file:<br />
<br />
{{hc|~/.config/Trolltech.conf|2=<br />
...<br />
[Qt]<br />
style=GTK+<br />
...<br />
}}<br />
<br />
* For Qt 5, it can be enabled by installing {{Pkg|qt5-styleplugins}} and setting the following [[Environment variables#Graphical applications|environment variable]]: {{ic|1=QT_QPA_PLATFORMTHEME=gtk2}}<br />
<br />
For full uniformity, make sure that the configured [[GTK+#Themes|GTK+ theme]] supports both GTK+ 2 and GTK+ 3. If your preferred theme has inconsistent rendering after configuring Qt to use GTK+2, install {{ic|gtk-theme-switch2}} and choose a theme.<br />
<br />
=== QGnomePlatform ===<br />
<br />
This Qt 5 platform theme applies the appearance settings of GNOME for Qt applications. It can be installed with the {{AUR|qgnomeplatform}} package or the {{AUR|qgnomeplatform-git}} package for the development version. It does not provide a Qt style itself, instead it requires a [[#Styles for both Qt and GTK+|style that support both Qt and GTK+]].<br />
<br />
This platform theme is enabled automatically in GNOME since version 3.20. For other systems, it can be enabled by setting the following [[Environment variables#Graphical applications|environment variable]]: {{ic|1=QT_QPA_PLATFORMTHEME=qgnomeplatform}}.<br />
<br />
== Tips and tricks ==<br />
=== KDE file dialogs for GTK+ applications ===<br />
'''Chromium''' <br />
At least for chromium installing {{ic|kdialog}} makes chromium used kde file dialog ( so `KGtk-wrapper` is not required )<br />
<br />
{{Warning|Some GTK+ applications may not be compatible with KGtk-wrapper (e.g. [[Chromium]]), sometimes the wrapper makes the application crash ([[Firefox]] or [[Thunderbird]]).}}<br />
<br />
{{AUR|kgtk}} from the [[AUR]] is a wrapper script which uses {{ic|LD_PRELOAD}} to force KDE file dialogs in GTK+ 2.x apps. Once installed you can run GTK+ 2.x applications with {{ic|kgtk-wrapper}} in two ways (using [[GIMP]] in the examples):<br />
<br />
* Calling {{ic|kgtk-wrapper}} directly and using the GTK+ 2.x binary as an argument:<br />
:{{bc|$ /usr/bin/kgtk-wrapper gimp}}<br />
* Modifying the KDE .desktop shortcuts files you can find at {{ic|/usr/share/applications/}} to prefix the {{ic|Exec}} statement with kgtk-wrapper.<br />
:e.g. with [[GIMP]], edit the {{ic|/usr/share/applications/gimp.desktop}} shortcut file and replace {{ic|1=Exec=gimp-2.8 %U}} by {{ic|1=Exec=kgtk-wrapper gimp-2.8 %U}}.<br />
<br />
=== Using a GTK+ icon theme in Qt apps ===<br />
<br />
{{Style|Duplicates [[environment variables]]}}<br />
<br />
If you are running Plasma, install {{Pkg|kde-gtk-config}} and select the icon-theme under ''System Settings > Application Style > GTK''.<br />
<br />
If you are using [[GNOME]], first check if {{Pkg|dconf-editor}} is installed.<br />
<br />
Then, run {{ic|dconf-editor}} and look under ''org > gnome > desktop > interface'' for {{ic|icon-theme}} key and change it to your preferred icon theme. <br />
<br />
If you are not using [[GNOME]], for example if you are running a minimal system with {{Pkg|i3-wm}}, first install {{Pkg|dconf-editor}}. <br />
<br />
Then, run {{ic|dconf-editor}} and look under ''org > gnome > desktop > interface'' for {{ic|icon-theme}} key and change it to your preferred icon theme. <br />
<br />
Since, you are not using [[GNOME]], you might have to set the value of {{ic|DESKTOP_SESSION}} in your profile. To do that execute the below code in a terminal and restart your system.<br />
<br />
$ echo 'export DESKTOP_SESSION=gnome' >> /etc/profile<br />
<br />
'''OR'''<br />
<br />
Set {{ic|1=export DESKTOP_SESSION=gnome}} somewhere in your {{ic|~/.xinitrc}} or, if you are using a [[Display manager]] in [[Xprofile]].<br />
<br />
{{Note| If the icon theme was not applied, you might want to check if the name that you entered of your preferred theme, was in the correct format. For example, if you want to apply the currently active icon theme to your QT applications, you can find the correct format of it's name with the command:<br />
<br />
{{bc|1=$ cat ~/.gtkrc-2.0 {{!}} grep icon-theme {{!}} cut -d= -f2}}<br />
<br />
}}<br />
<br />
=== Improve subpixel rendering of GTK apps under KDE Plasma ===<br />
<br />
See [[Font configuration#LCD filter]].<br />
<br />
== Troubleshooting ==<br />
<br />
=== Qt applications do not use QGtkStyle ===<br />
Qt will not apply QGtkStyle correctly if GTK+ is using the [[#GTK+-Qt Engine|GTK+-Qt Engine]]{{Broken section link}}. Qt determines whether the GTK+-Qt Engine is in use by reading the GTK+ configuration files listed in the environmental variable {{ic|GTK2_RC_FILES}}. If the environmental variable is not set properly, Qt assumes you are using the engine, sets QGtkStyle to use the style GTK+ style ''Clearlooks'', and outputs an error message:<br />
<br />
QGtkStyle cannot be used together with the GTK_Qt engine.<br />
<br />
Another error you may get after launching {{ic|qtconfig-qt4}} from a shell and selecting the GTK+ style is:<br />
<br />
QGtkStyle was unable to detect the current GTK+ theme.<br />
<br />
According to [https://bbs.archlinux.org/viewtopic.php?id&#61;99175&p&#61;1 this thread], you may simply have to install {{AUR|libgnomeui}} to solve this issue. This has the added benefit that you do not need to edit a file every time you change your theme via a graphical tool, like the one provided by xfce.<br />
<br />
Users of [[Openbox]] and other non-GNOME environments may encounter this problem. To solve this, first add the following to your {{ic|.xinitrc}} file:<br />
{{hc|.xinitrc|<nowiki><br />
...<br />
export GTK2_RC_FILES="$HOME/.gtkrc-2.0"<br />
...<br />
</nowiki>}}<br />
<br />
{{Note|<br />
* Make sure to add this line before invoking the window manager.<br />
* You can add multiple paths by separating them with colons.<br />
* Make sure to use {{ic|$HOME}} instead of {{ic|~}} as it will not properly expand to the user's home directory.<br />
}}<br />
<br />
Then specify the theme you want in the {{ic|~/.gtkrc-2.0}} file using a [[#GTK2 styles|dedicated application]]{{Broken section link}} or manually, by adding:<br />
{{hc|.gtkrc-2.0|<nowiki><br />
...<br />
gtk-theme-name="[name of theme]"<br />
...<br />
</nowiki>}}<br />
<br />
Some tools only insert the following include directive in {{ic|~/.gtkrc-2.0}}:<br />
{{hc|.gtkrc-2.0|<br />
...<br />
include "/usr/share/themes/SomeTheme/gtk-2.0/gtkrc"<br />
...<br />
}}<br />
<br />
which apparently is not recognized by all versions of QGtkStyle. You can hotfix this problem by inserting the {{ic|gtk-theme-name}} manually in your {{ic|~/.gtkrc-2.0}} file like above.<br />
<br />
{{Note|Style-changing applications will most probably rewrite the {{ic|~/.gtkrc-2.0}} file the next time you change themes.}}<br />
<br />
If these steps do not work, install {{Pkg|gconf}} and run this command:<br />
<br />
gconftool-2 --set --type string /desktop/gnome/interface/gtk_theme [name of theme]<br />
<br />
If you further want to set the same icon and cursor theme, then you have to specify them, too.<br />
<br />
gconftool-2 --set --type string /desktop/gnome/interface/icon_theme Faenza-Dark<br />
<br />
This sets the icon theme to Faenza-Dark located in {{ic|/usr/share/icons/Faenza-Dark}}. For the cursor theme you first have to set the gconf value.<br />
<br />
gconftool-2 --set --type string /desktop/gnome/peripherals/mouse/cursor_theme Adwaita<br />
<br />
Then you will have to create the file {{ic|/usr/share/icons/default/index.theme}} with the following lines:<br />
<br />
[Icon Theme]<br />
Inherits=Adwaita<br />
<br />
=== Themes not working in GTK+ apps ===<br />
<br />
If the style or theme engine you set up is not showing in your GTK applications then it is likely your GTK+ settings files are not being loaded for some reason. You can check where your system expects to find these files by doing the following..<br />
$ export | grep gtk<br />
<br />
Usually the expected files should be {{ic|~/.gtkrc}} for GTK1 and {{ic|~/.gtkrc2.0}} or {{ic|~/.gtkrc2.0-kde}} for GTK+ 2.x.<br />
<br />
=== GTK+ apps don't use svg (breeze) icons after system upgrade ===<br />
<br />
Try to run this to fix this issue:<br />
# gdk-pixbuf-query-loaders --update-cache</div>J99https://wiki.archlinux.org/index.php?title=Uniform_look_for_Qt_and_GTK_applications&diff=512833Uniform look for Qt and GTK applications2018-03-05T20:21:14Z<p>J99: /* Breeze */ typo fix</p>
<hr />
<div>[[Category:Widget toolkits]]<br />
[[Category:Eye candy]]<br />
[[es:Uniform look for Qt and GTK applications]]<br />
[[it:Uniform look for Qt and GTK applications]]<br />
[[ja:Qt と GTK アプリケーションの外観の統合]]<br />
[[ru:Uniform look for Qt and GTK applications]]<br />
[[zh-hans:Uniform look for Qt and GTK applications]]<br />
{{Related articles start}}<br />
{{Related|GTK+}}<br />
{{Related|Qt}}<br />
{{Related articles end}}<br />
[[Qt]] and [[GTK+]] based programs both use a different widget toolkit to render the graphical user interface. Each come with different themes, styles and icon sets by default, among other things, so the "look and feel" differ significantly. This article will help you make your Qt and GTK+ applications look similar for a more streamlined and integrated desktop experience.<br />
<br />
== Overview ==<br />
<br />
To get a similar look between the toolkits, you will most likely have to modify the following:<br />
* '''Theme''': The custom appearance of an application, widget set, etc. It usually consists of a style, an icon theme and a color theme.<br />
* '''Style''': The graphical layout and look of the widget set.<br />
* '''Icon Theme''': A set of global icons.<br />
* '''Color Theme''': A set of global colors that are used in conjunction with the style.<br />
<br />
You can choose various approaches:<br />
* Modify [[#Styles for both Qt and GTK+|GTK+ and Qt styles]] separately with the tools listed below for each toolkit and aim for choosing similarly looking themes (style, colors, icons, cursors, fonts).<br />
* Use a special [[#Theme engines|theme engine]], which intermediates the modification of the other graphical toolkit to match your main toolkit.<br />
<br />
== Styles for both Qt and GTK+ ==<br />
There are widget style sets available for the purpose of integration, where builds are written and provided for both Qt and GTK+, all major versions included. With these, you can have one look for all applications regardless of the toolkit they had been written with.<br />
<br />
{{Tip|You may want to apply user defined styles to root applications, see [[GTK#Theme not applied to root applications]] and [[Qt#Theme not applied to root applications]].}}<br />
{{Note|1=Since version 3.16, GTK+ 3 [https://bbs.archlinux.org/viewtopic.php?pid=1518404#p1518404 does not support] non-CSS themes, hence previous solutions such as Oxygen-Gtk are [https://bugs.kde.org/show_bug.cgi?id=340288 no longer viable] options.}}<br />
<br />
=== Breeze ===<br />
<br />
Breeze is the default Qt style of KDE Plasma. It can be installed with the {{Pkg|breeze}} package for Qt5, the {{Pkg|breeze-kde4}} package for Qt4, and the {{Pkg|breeze-gtk}} package for GTK+ 2 and GTK+ 3.<br />
<br />
Once installed, you can use one of the many [[GTK+#Configuration tools|GTK+ configuration tools]] to change the GTK+ theme. If running KDE Plasma, go to ''Application Style > GNOME Application Style (GTK)'' in System Settings or run the {{ic|kde-gtk-config}} command. Fonts, icon themes, cursors, and widget styles set in System Settings outside of the GTK configuration module will affect Qt only; GTK settings should be set manually using the previously mentioned module.<br />
<br />
=== Adwaita ===<br />
<br />
Adwaita is the default GNOME theme. The GTK+ 3 version is included in the {{Pkg|gtk3}} package, while the GTK+ 2 version is in {{Pkg|gnome-themes-standard}}. [https://github.com/MartinBriza/adwaita-qt adwaita-qt] is a Qt port of the Adwaita theme. Unlike [[#QGtkStyle]], which mimics the GTK+ 2 theme, it provides a native Qt style made to look like the GTK+ 3 Adwaita. It can be [[install|installed]] with the {{AUR|adwaita-qt4}} and {{AUR|adwaita-qt5}} packages for the Qt 4 and 5 versions, respectively.<br />
<br />
To set the Qt style as default:<br />
<br />
* For Qt4, it can be enabled with ''Qt Configuration'' ({{ic|qtconfig-qt4}}), choose ''adwaita'' under ''Appearance > GUI Style''. Alternatively, edit the {{ic|/etc/xdg/Trolltech.conf}} (system-wide) or {{ic|~/.config/Trolltech.conf}} (user-specific) file:<br />
<br />
{{hc|~/.config/Trolltech.conf|2=<br />
...<br />
[Qt]<br />
style=adwaita<br />
...<br />
}}<br />
<br />
* For Qt 5, it can be enabled by setting the following [[Environment variables#Graphical applications|environment variable]]: {{ic|1=QT_STYLE_OVERRIDE=adwaita}}. Alternatively, use {{Pkg|qt5ct}} package. For more detailed instructions, see [[Qt#Configuration of Qt5 apps under environments other than KDE Plasma]].<br />
<br />
== Theme engines ==<br />
<br />
A ''theme engine'' can be thought of as a thin layer API which translates themes (excluding icons) between one or more toolkits. These engines add some extra code in the process and it is arguable that this kind of a solution is not as elegant and optimal as using native styles.<br />
<br />
=== QGtkStyle ===<br />
<br />
{{Note|QGtkStyle has been removed from {{Pkg|qt5-base}} 5.7.0 [https://github.com/qtproject/qtbase/commit/899a815414e95da8d9429a4a4f4d7094e49cfc55] and added to {{Pkg|qt5-styleplugins}} [https://github.com/qtproject/qtstyleplugins/commit/102da7d50231fc5723dba6e72340bef3d29471aa]}}<br />
<br />
{{Warning|Depending on GTK+ 2 theme, this style may cause rendering issues such as transparent fonts or inconsistent widgets.}}<br />
<br />
This Qt style uses GTK+ 2 to render all components to blend in with [[GNOME]] and similar GTK+ based environments. Beginning with Qt 4.5, this style is included in Qt. It requires {{Pkg|gtk2}} to be installed and configured.<br />
<br />
This is the default Qt4 style in Cinnamon, GNOME and Xfce, and the default Qt5 style in Cinnamon, GNOME, MATE, LXDE and Xfce. In other environments:<br />
<br />
* For Qt4, it can be enabled with ''Qt Configuration'' ({{ic|qtconfig-qt4}}), choose ''GTK+'' under ''Appearance > GUI Style''. Alternatively, edit the {{ic|/etc/xdg/Trolltech.conf}} (system-wide) or {{ic|~/.config/Trolltech.conf}} (user-specific) file:<br />
<br />
{{hc|~/.config/Trolltech.conf|2=<br />
...<br />
[Qt]<br />
style=GTK+<br />
...<br />
}}<br />
<br />
* For Qt 5, it can be enabled by installing {{Pkg|qt5-styleplugins}} and setting the following [[Environment variables#Graphical applications|environment variable]]: {{ic|1=QT_QPA_PLATFORMTHEME=gtk2}}<br />
<br />
For full uniformity, make sure that the configured [[GTK+#Themes|GTK+ theme]] supports both GTK+ 2 and GTK+ 3. If your preferred theme has inconsistent rendering after configuring Qt to use GTK+2, install {{ic|gtk-theme-switch2}} and choose a theme.<br />
<br />
=== QGnomePlatform ===<br />
<br />
This Qt 5 platform theme applies the appearance settings of GNOME for Qt applications. It can be installed with the {{AUR|qgnomeplatform}} package or the {{AUR|qgnomeplatform-git}} package for the development version. It does not provide a Qt style itself, instead it requires a [[#Styles for both Qt and GTK+|style that support both Qt and GTK+]].<br />
<br />
This platform theme is enabled automatically in GNOME since version 3.20. For other systems, it can be enabled by setting the following [[Environment variables#Graphical applications|environment variable]]: {{ic|1=QT_QPA_PLATFORMTHEME=qgnomeplatform}}.<br />
<br />
== Tips and tricks ==<br />
=== KDE file dialogs for GTK+ applications ===<br />
'''Chromium''' <br />
At least for chromium installing {{ic|kdialog}} makes chromium used kde file dialog ( so `KGtk-wrapper` is not required )<br />
<br />
{{Warning|Some GTK+ applications may not be compatible with KGtk-wrapper (e.g. [[Chromium]]), sometimes the wrapper makes the application crash ([[Firefox]] or [[Thunderbird]]).}}<br />
<br />
{{AUR|kgtk}} from the [[AUR]] is a wrapper script which uses {{ic|LD_PRELOAD}} to force KDE file dialogs in GTK+ 2.x apps. Once installed you can run GTK+ 2.x applications with {{ic|kgtk-wrapper}} in two ways (using [[GIMP]] in the examples):<br />
<br />
* Calling {{ic|kgtk-wrapper}} directly and using the GTK+ 2.x binary as an argument:<br />
:{{bc|$ /usr/bin/kgtk-wrapper gimp}}<br />
* Modifying the KDE .desktop shortcuts files you can find at {{ic|/usr/share/applications/}} to prefix the {{ic|Exec}} statement with kgtk-wrapper.<br />
:e.g. with [[GIMP]], edit the {{ic|/usr/share/applications/gimp.desktop}} shortcut file and replace {{ic|1=Exec=gimp-2.8 %U}} by {{ic|1=Exec=kgtk-wrapper gimp-2.8 %U}}.<br />
<br />
=== Using a GTK+ icon theme in Qt apps ===<br />
<br />
{{Style|Duplicates [[environment variables]]}}<br />
<br />
If you are running Plasma, install {{Pkg|kde-gtk-config}} and select the icon-theme under ''System Settings > Application Style > GTK''.<br />
<br />
If you are using [[GNOME]], first check if {{Pkg|dconf-editor}} is installed.<br />
<br />
Then, run {{ic|dconf-editor}} and look under ''org > gnome > desktop > interface'' for {{ic|icon-theme}} key and change it to your preferred icon theme. <br />
<br />
If you are not using [[GNOME]], for example if you are running a minimal system with {{Pkg|i3-wm}}, first install {{Pkg|dconf-editor}}. <br />
<br />
Then, run {{ic|dconf-editor}} and look under ''org > gnome > desktop > interface'' for {{ic|icon-theme}} key and change it to your preferred icon theme. <br />
<br />
Since, you are not using [[GNOME]], you might have to set the value of {{ic|DESKTOP_SESSION}} in your profile. To do that execute the below code in a terminal and restart your system.<br />
<br />
$ echo 'export DESKTOP_SESSION=gnome' >> /etc/profile<br />
<br />
'''OR'''<br />
<br />
Set {{ic|1=export DESKTOP_SESSION=gnome}} somewhere in your {{ic|~/.xinitrc}} or, if you are using a [[Display manager]] in [[Xprofile]].<br />
<br />
{{Note| If the icon theme was not applied, you might want to check if the name that you entered of your preferred theme, was in the correct format. For example, if you want to apply the currently active icon theme to your QT applications, you can find the correct format of it's name with the command:<br />
<br />
{{bc|1=$ cat ~/.gtkrc-2.0 {{!}} grep icon-theme {{!}} cut -d= -f2}}<br />
<br />
}}<br />
<br />
=== Improve subpixel rendering of GTK apps under KDE Plasma ===<br />
<br />
See [[Font configuration#LCD filter]].<br />
<br />
== Troubleshooting ==<br />
<br />
=== Qt applications do not use QGtkStyle ===<br />
Qt will not apply QGtkStyle correctly if GTK+ is using the [[#GTK+-Qt Engine|GTK+-Qt Engine]]{{Broken section link}}. Qt determines whether the GTK+-Qt Engine is in use by reading the GTK+ configuration files listed in the environmental variable {{ic|GTK2_RC_FILES}}. If the environmental variable is not set properly, Qt assumes you are using the engine, sets QGtkStyle to use the style GTK+ style ''Clearlooks'', and outputs an error message:<br />
<br />
QGtkStyle cannot be used together with the GTK_Qt engine.<br />
<br />
Another error you may get after launching {{ic|qtconfig-qt4}} from a shell and selecting the GTK+ style is:<br />
<br />
QGtkStyle was unable to detect the current GTK+ theme.<br />
<br />
According to [https://bbs.archlinux.org/viewtopic.php?id&#61;99175&p&#61;1 this thread], you may simply have to install {{AUR|libgnomeui}} to solve this issue. This has the added benefit that you do not need to edit a file every time you change your theme via a graphical tool, like the one provided by xfce.<br />
<br />
Users of [[Openbox]] and other non-GNOME environments may encounter this problem. To solve this, first add the following to your {{ic|.xinitrc}} file:<br />
{{hc|.xinitrc|<nowiki><br />
...<br />
export GTK2_RC_FILES="$HOME/.gtkrc-2.0"<br />
...<br />
</nowiki>}}<br />
<br />
{{Note|<br />
* Make sure to add this line before invoking the window manager.<br />
* You can add multiple paths by separating them with colons.<br />
* Make sure to use {{ic|$HOME}} instead of {{ic|~}} as it will not properly expand to the user's home directory.<br />
}}<br />
<br />
Then specify the theme you want in the {{ic|~/.gtkrc-2.0}} file using a [[#GTK2 styles|dedicated application]]{{Broken section link}} or manually, by adding:<br />
{{hc|.gtkrc-2.0|<nowiki><br />
...<br />
gtk-theme-name="[name of theme]"<br />
...<br />
</nowiki>}}<br />
<br />
Some tools only insert the following include directive in {{ic|~/.gtkrc-2.0}}:<br />
{{hc|.gtkrc-2.0|<br />
...<br />
include "/usr/share/themes/SomeTheme/gtk-2.0/gtkrc"<br />
...<br />
}}<br />
<br />
which apparently is not recognized by all versions of QGtkStyle. You can hotfix this problem by inserting the {{ic|gtk-theme-name}} manually in your {{ic|~/.gtkrc-2.0}} file like above.<br />
<br />
{{Note|Style-changing applications will most probably rewrite the {{ic|~/.gtkrc-2.0}} file the next time you change themes.}}<br />
<br />
If these steps do not work, install {{Pkg|gconf}} and run this command:<br />
<br />
gconftool-2 --set --type string /desktop/gnome/interface/gtk_theme [name of theme]<br />
<br />
If you further want to set the same icon and cursor theme, then you have to specify them, too.<br />
<br />
gconftool-2 --set --type string /desktop/gnome/interface/icon_theme Faenza-Dark<br />
<br />
This sets the icon theme to Faenza-Dark located in {{ic|/usr/share/icons/Faenza-Dark}}. For the cursor theme you first have to set the gconf value.<br />
<br />
gconftool-2 --set --type string /desktop/gnome/peripherals/mouse/cursor_theme Adwaita<br />
<br />
Then you will have to create the file {{ic|/usr/share/icons/default/index.theme}} with the following lines:<br />
<br />
[Icon Theme]<br />
Inherits=Adwaita<br />
<br />
=== Themes not working in GTK+ apps ===<br />
<br />
If the style or theme engine you set up is not showing in your GTK applications then it is likely your GTK+ settings files are not being loaded for some reason. You can check where your system expects to find these files by doing the following..<br />
$ export | grep gtk<br />
<br />
Usually the expected files should be {{ic|~/.gtkrc}} for GTK1 and {{ic|~/.gtkrc2.0}} or {{ic|~/.gtkrc2.0-kde}} for GTK+ 2.x.<br />
<br />
=== GTK+ apps don't use svg (breeze) icons after system upgrade ===<br />
<br />
Try to run this to fix this issue:<br />
# gdk-pixbuf-query-loaders --update-cache</div>J99https://wiki.archlinux.org/index.php?title=Uniform_look_for_Qt_and_GTK_applications&diff=512832Uniform look for Qt and GTK applications2018-03-05T20:20:43Z<p>J99: /* Breeze */ More info on the scope of System Settings in regards to GTK</p>
<hr />
<div>[[Category:Widget toolkits]]<br />
[[Category:Eye candy]]<br />
[[es:Uniform look for Qt and GTK applications]]<br />
[[it:Uniform look for Qt and GTK applications]]<br />
[[ja:Qt と GTK アプリケーションの外観の統合]]<br />
[[ru:Uniform look for Qt and GTK applications]]<br />
[[zh-hans:Uniform look for Qt and GTK applications]]<br />
{{Related articles start}}<br />
{{Related|GTK+}}<br />
{{Related|Qt}}<br />
{{Related articles end}}<br />
[[Qt]] and [[GTK+]] based programs both use a different widget toolkit to render the graphical user interface. Each come with different themes, styles and icon sets by default, among other things, so the "look and feel" differ significantly. This article will help you make your Qt and GTK+ applications look similar for a more streamlined and integrated desktop experience.<br />
<br />
== Overview ==<br />
<br />
To get a similar look between the toolkits, you will most likely have to modify the following:<br />
* '''Theme''': The custom appearance of an application, widget set, etc. It usually consists of a style, an icon theme and a color theme.<br />
* '''Style''': The graphical layout and look of the widget set.<br />
* '''Icon Theme''': A set of global icons.<br />
* '''Color Theme''': A set of global colors that are used in conjunction with the style.<br />
<br />
You can choose various approaches:<br />
* Modify [[#Styles for both Qt and GTK+|GTK+ and Qt styles]] separately with the tools listed below for each toolkit and aim for choosing similarly looking themes (style, colors, icons, cursors, fonts).<br />
* Use a special [[#Theme engines|theme engine]], which intermediates the modification of the other graphical toolkit to match your main toolkit.<br />
<br />
== Styles for both Qt and GTK+ ==<br />
There are widget style sets available for the purpose of integration, where builds are written and provided for both Qt and GTK+, all major versions included. With these, you can have one look for all applications regardless of the toolkit they had been written with.<br />
<br />
{{Tip|You may want to apply user defined styles to root applications, see [[GTK#Theme not applied to root applications]] and [[Qt#Theme not applied to root applications]].}}<br />
{{Note|1=Since version 3.16, GTK+ 3 [https://bbs.archlinux.org/viewtopic.php?pid=1518404#p1518404 does not support] non-CSS themes, hence previous solutions such as Oxygen-Gtk are [https://bugs.kde.org/show_bug.cgi?id=340288 no longer viable] options.}}<br />
<br />
=== Breeze ===<br />
<br />
Breeze is the default Qt style of KDE Plasma. It can be installed with the {{Pkg|breeze}} package for Qt5, the {{Pkg|breeze-kde4}} package for Qt4, and the {{Pkg|breeze-gtk}} package for GTK+ 2 and GTK+ 3.<br />
<br />
Once installed, you can use one of the many [[GTK+#Configuration tools|GTK+ configuration tools]] to change the GTK+ theme. If running KDE Plasma, go to ''Application Style > GNOME Application Style (GTK)'' in any other module in System Settings or run the {{ic|kde-gtk-config}} command. Fonts, icon themes, cursors, and widget styles set in System Settings outside of the GTK configuration module will affect Qt only; GTK settings should be set manually using the previously mentioned module.<br />
<br />
=== Adwaita ===<br />
<br />
Adwaita is the default GNOME theme. The GTK+ 3 version is included in the {{Pkg|gtk3}} package, while the GTK+ 2 version is in {{Pkg|gnome-themes-standard}}. [https://github.com/MartinBriza/adwaita-qt adwaita-qt] is a Qt port of the Adwaita theme. Unlike [[#QGtkStyle]], which mimics the GTK+ 2 theme, it provides a native Qt style made to look like the GTK+ 3 Adwaita. It can be [[install|installed]] with the {{AUR|adwaita-qt4}} and {{AUR|adwaita-qt5}} packages for the Qt 4 and 5 versions, respectively.<br />
<br />
To set the Qt style as default:<br />
<br />
* For Qt4, it can be enabled with ''Qt Configuration'' ({{ic|qtconfig-qt4}}), choose ''adwaita'' under ''Appearance > GUI Style''. Alternatively, edit the {{ic|/etc/xdg/Trolltech.conf}} (system-wide) or {{ic|~/.config/Trolltech.conf}} (user-specific) file:<br />
<br />
{{hc|~/.config/Trolltech.conf|2=<br />
...<br />
[Qt]<br />
style=adwaita<br />
...<br />
}}<br />
<br />
* For Qt 5, it can be enabled by setting the following [[Environment variables#Graphical applications|environment variable]]: {{ic|1=QT_STYLE_OVERRIDE=adwaita}}. Alternatively, use {{Pkg|qt5ct}} package. For more detailed instructions, see [[Qt#Configuration of Qt5 apps under environments other than KDE Plasma]].<br />
<br />
== Theme engines ==<br />
<br />
A ''theme engine'' can be thought of as a thin layer API which translates themes (excluding icons) between one or more toolkits. These engines add some extra code in the process and it is arguable that this kind of a solution is not as elegant and optimal as using native styles.<br />
<br />
=== QGtkStyle ===<br />
<br />
{{Note|QGtkStyle has been removed from {{Pkg|qt5-base}} 5.7.0 [https://github.com/qtproject/qtbase/commit/899a815414e95da8d9429a4a4f4d7094e49cfc55] and added to {{Pkg|qt5-styleplugins}} [https://github.com/qtproject/qtstyleplugins/commit/102da7d50231fc5723dba6e72340bef3d29471aa]}}<br />
<br />
{{Warning|Depending on GTK+ 2 theme, this style may cause rendering issues such as transparent fonts or inconsistent widgets.}}<br />
<br />
This Qt style uses GTK+ 2 to render all components to blend in with [[GNOME]] and similar GTK+ based environments. Beginning with Qt 4.5, this style is included in Qt. It requires {{Pkg|gtk2}} to be installed and configured.<br />
<br />
This is the default Qt4 style in Cinnamon, GNOME and Xfce, and the default Qt5 style in Cinnamon, GNOME, MATE, LXDE and Xfce. In other environments:<br />
<br />
* For Qt4, it can be enabled with ''Qt Configuration'' ({{ic|qtconfig-qt4}}), choose ''GTK+'' under ''Appearance > GUI Style''. Alternatively, edit the {{ic|/etc/xdg/Trolltech.conf}} (system-wide) or {{ic|~/.config/Trolltech.conf}} (user-specific) file:<br />
<br />
{{hc|~/.config/Trolltech.conf|2=<br />
...<br />
[Qt]<br />
style=GTK+<br />
...<br />
}}<br />
<br />
* For Qt 5, it can be enabled by installing {{Pkg|qt5-styleplugins}} and setting the following [[Environment variables#Graphical applications|environment variable]]: {{ic|1=QT_QPA_PLATFORMTHEME=gtk2}}<br />
<br />
For full uniformity, make sure that the configured [[GTK+#Themes|GTK+ theme]] supports both GTK+ 2 and GTK+ 3. If your preferred theme has inconsistent rendering after configuring Qt to use GTK+2, install {{ic|gtk-theme-switch2}} and choose a theme.<br />
<br />
=== QGnomePlatform ===<br />
<br />
This Qt 5 platform theme applies the appearance settings of GNOME for Qt applications. It can be installed with the {{AUR|qgnomeplatform}} package or the {{AUR|qgnomeplatform-git}} package for the development version. It does not provide a Qt style itself, instead it requires a [[#Styles for both Qt and GTK+|style that support both Qt and GTK+]].<br />
<br />
This platform theme is enabled automatically in GNOME since version 3.20. For other systems, it can be enabled by setting the following [[Environment variables#Graphical applications|environment variable]]: {{ic|1=QT_QPA_PLATFORMTHEME=qgnomeplatform}}.<br />
<br />
== Tips and tricks ==<br />
=== KDE file dialogs for GTK+ applications ===<br />
'''Chromium''' <br />
At least for chromium installing {{ic|kdialog}} makes chromium used kde file dialog ( so `KGtk-wrapper` is not required )<br />
<br />
{{Warning|Some GTK+ applications may not be compatible with KGtk-wrapper (e.g. [[Chromium]]), sometimes the wrapper makes the application crash ([[Firefox]] or [[Thunderbird]]).}}<br />
<br />
{{AUR|kgtk}} from the [[AUR]] is a wrapper script which uses {{ic|LD_PRELOAD}} to force KDE file dialogs in GTK+ 2.x apps. Once installed you can run GTK+ 2.x applications with {{ic|kgtk-wrapper}} in two ways (using [[GIMP]] in the examples):<br />
<br />
* Calling {{ic|kgtk-wrapper}} directly and using the GTK+ 2.x binary as an argument:<br />
:{{bc|$ /usr/bin/kgtk-wrapper gimp}}<br />
* Modifying the KDE .desktop shortcuts files you can find at {{ic|/usr/share/applications/}} to prefix the {{ic|Exec}} statement with kgtk-wrapper.<br />
:e.g. with [[GIMP]], edit the {{ic|/usr/share/applications/gimp.desktop}} shortcut file and replace {{ic|1=Exec=gimp-2.8 %U}} by {{ic|1=Exec=kgtk-wrapper gimp-2.8 %U}}.<br />
<br />
=== Using a GTK+ icon theme in Qt apps ===<br />
<br />
{{Style|Duplicates [[environment variables]]}}<br />
<br />
If you are running Plasma, install {{Pkg|kde-gtk-config}} and select the icon-theme under ''System Settings > Application Style > GTK''.<br />
<br />
If you are using [[GNOME]], first check if {{Pkg|dconf-editor}} is installed.<br />
<br />
Then, run {{ic|dconf-editor}} and look under ''org > gnome > desktop > interface'' for {{ic|icon-theme}} key and change it to your preferred icon theme. <br />
<br />
If you are not using [[GNOME]], for example if you are running a minimal system with {{Pkg|i3-wm}}, first install {{Pkg|dconf-editor}}. <br />
<br />
Then, run {{ic|dconf-editor}} and look under ''org > gnome > desktop > interface'' for {{ic|icon-theme}} key and change it to your preferred icon theme. <br />
<br />
Since, you are not using [[GNOME]], you might have to set the value of {{ic|DESKTOP_SESSION}} in your profile. To do that execute the below code in a terminal and restart your system.<br />
<br />
$ echo 'export DESKTOP_SESSION=gnome' >> /etc/profile<br />
<br />
'''OR'''<br />
<br />
Set {{ic|1=export DESKTOP_SESSION=gnome}} somewhere in your {{ic|~/.xinitrc}} or, if you are using a [[Display manager]] in [[Xprofile]].<br />
<br />
{{Note| If the icon theme was not applied, you might want to check if the name that you entered of your preferred theme, was in the correct format. For example, if you want to apply the currently active icon theme to your QT applications, you can find the correct format of it's name with the command:<br />
<br />
{{bc|1=$ cat ~/.gtkrc-2.0 {{!}} grep icon-theme {{!}} cut -d= -f2}}<br />
<br />
}}<br />
<br />
=== Improve subpixel rendering of GTK apps under KDE Plasma ===<br />
<br />
See [[Font configuration#LCD filter]].<br />
<br />
== Troubleshooting ==<br />
<br />
=== Qt applications do not use QGtkStyle ===<br />
Qt will not apply QGtkStyle correctly if GTK+ is using the [[#GTK+-Qt Engine|GTK+-Qt Engine]]{{Broken section link}}. Qt determines whether the GTK+-Qt Engine is in use by reading the GTK+ configuration files listed in the environmental variable {{ic|GTK2_RC_FILES}}. If the environmental variable is not set properly, Qt assumes you are using the engine, sets QGtkStyle to use the style GTK+ style ''Clearlooks'', and outputs an error message:<br />
<br />
QGtkStyle cannot be used together with the GTK_Qt engine.<br />
<br />
Another error you may get after launching {{ic|qtconfig-qt4}} from a shell and selecting the GTK+ style is:<br />
<br />
QGtkStyle was unable to detect the current GTK+ theme.<br />
<br />
According to [https://bbs.archlinux.org/viewtopic.php?id&#61;99175&p&#61;1 this thread], you may simply have to install {{AUR|libgnomeui}} to solve this issue. This has the added benefit that you do not need to edit a file every time you change your theme via a graphical tool, like the one provided by xfce.<br />
<br />
Users of [[Openbox]] and other non-GNOME environments may encounter this problem. To solve this, first add the following to your {{ic|.xinitrc}} file:<br />
{{hc|.xinitrc|<nowiki><br />
...<br />
export GTK2_RC_FILES="$HOME/.gtkrc-2.0"<br />
...<br />
</nowiki>}}<br />
<br />
{{Note|<br />
* Make sure to add this line before invoking the window manager.<br />
* You can add multiple paths by separating them with colons.<br />
* Make sure to use {{ic|$HOME}} instead of {{ic|~}} as it will not properly expand to the user's home directory.<br />
}}<br />
<br />
Then specify the theme you want in the {{ic|~/.gtkrc-2.0}} file using a [[#GTK2 styles|dedicated application]]{{Broken section link}} or manually, by adding:<br />
{{hc|.gtkrc-2.0|<nowiki><br />
...<br />
gtk-theme-name="[name of theme]"<br />
...<br />
</nowiki>}}<br />
<br />
Some tools only insert the following include directive in {{ic|~/.gtkrc-2.0}}:<br />
{{hc|.gtkrc-2.0|<br />
...<br />
include "/usr/share/themes/SomeTheme/gtk-2.0/gtkrc"<br />
...<br />
}}<br />
<br />
which apparently is not recognized by all versions of QGtkStyle. You can hotfix this problem by inserting the {{ic|gtk-theme-name}} manually in your {{ic|~/.gtkrc-2.0}} file like above.<br />
<br />
{{Note|Style-changing applications will most probably rewrite the {{ic|~/.gtkrc-2.0}} file the next time you change themes.}}<br />
<br />
If these steps do not work, install {{Pkg|gconf}} and run this command:<br />
<br />
gconftool-2 --set --type string /desktop/gnome/interface/gtk_theme [name of theme]<br />
<br />
If you further want to set the same icon and cursor theme, then you have to specify them, too.<br />
<br />
gconftool-2 --set --type string /desktop/gnome/interface/icon_theme Faenza-Dark<br />
<br />
This sets the icon theme to Faenza-Dark located in {{ic|/usr/share/icons/Faenza-Dark}}. For the cursor theme you first have to set the gconf value.<br />
<br />
gconftool-2 --set --type string /desktop/gnome/peripherals/mouse/cursor_theme Adwaita<br />
<br />
Then you will have to create the file {{ic|/usr/share/icons/default/index.theme}} with the following lines:<br />
<br />
[Icon Theme]<br />
Inherits=Adwaita<br />
<br />
=== Themes not working in GTK+ apps ===<br />
<br />
If the style or theme engine you set up is not showing in your GTK applications then it is likely your GTK+ settings files are not being loaded for some reason. You can check where your system expects to find these files by doing the following..<br />
$ export | grep gtk<br />
<br />
Usually the expected files should be {{ic|~/.gtkrc}} for GTK1 and {{ic|~/.gtkrc2.0}} or {{ic|~/.gtkrc2.0-kde}} for GTK+ 2.x.<br />
<br />
=== GTK+ apps don't use svg (breeze) icons after system upgrade ===<br />
<br />
Try to run this to fix this issue:<br />
# gdk-pixbuf-query-loaders --update-cache</div>J99https://wiki.archlinux.org/index.php?title=Uniform_look_for_Qt_and_GTK_applications&diff=512830Uniform look for Qt and GTK applications2018-03-05T20:05:12Z<p>J99: /* Breeze */ Quick instructions for KDE Plasma, seeing as it is the most common combination to use with Breeze</p>
<hr />
<div>[[Category:Widget toolkits]]<br />
[[Category:Eye candy]]<br />
[[es:Uniform look for Qt and GTK applications]]<br />
[[it:Uniform look for Qt and GTK applications]]<br />
[[ja:Qt と GTK アプリケーションの外観の統合]]<br />
[[ru:Uniform look for Qt and GTK applications]]<br />
[[zh-hans:Uniform look for Qt and GTK applications]]<br />
{{Related articles start}}<br />
{{Related|GTK+}}<br />
{{Related|Qt}}<br />
{{Related articles end}}<br />
[[Qt]] and [[GTK+]] based programs both use a different widget toolkit to render the graphical user interface. Each come with different themes, styles and icon sets by default, among other things, so the "look and feel" differ significantly. This article will help you make your Qt and GTK+ applications look similar for a more streamlined and integrated desktop experience.<br />
<br />
== Overview ==<br />
<br />
To get a similar look between the toolkits, you will most likely have to modify the following:<br />
* '''Theme''': The custom appearance of an application, widget set, etc. It usually consists of a style, an icon theme and a color theme.<br />
* '''Style''': The graphical layout and look of the widget set.<br />
* '''Icon Theme''': A set of global icons.<br />
* '''Color Theme''': A set of global colors that are used in conjunction with the style.<br />
<br />
You can choose various approaches:<br />
* Modify [[#Styles for both Qt and GTK+|GTK+ and Qt styles]] separately with the tools listed below for each toolkit and aim for choosing similarly looking themes (style, colors, icons, cursors, fonts).<br />
* Use a special [[#Theme engines|theme engine]], which intermediates the modification of the other graphical toolkit to match your main toolkit.<br />
<br />
== Styles for both Qt and GTK+ ==<br />
There are widget style sets available for the purpose of integration, where builds are written and provided for both Qt and GTK+, all major versions included. With these, you can have one look for all applications regardless of the toolkit they had been written with.<br />
<br />
{{Tip|You may want to apply user defined styles to root applications, see [[GTK#Theme not applied to root applications]] and [[Qt#Theme not applied to root applications]].}}<br />
{{Note|1=Since version 3.16, GTK+ 3 [https://bbs.archlinux.org/viewtopic.php?pid=1518404#p1518404 does not support] non-CSS themes, hence previous solutions such as Oxygen-Gtk are [https://bugs.kde.org/show_bug.cgi?id=340288 no longer viable] options.}}<br />
<br />
=== Breeze ===<br />
<br />
Breeze is the default Qt style of KDE Plasma. It can be installed with the {{Pkg|breeze}} package for Qt5, the {{Pkg|breeze-kde4}} package for Qt4, and the {{Pkg|breeze-gtk}} package for GTK+ 2 and GTK+ 3.<br />
<br />
Once installed, you can use one of the many [[GTK+#Configuration tools|GTK+ configuration tools]] to change the GTK+ theme. If running KDE Plasma, go to ''Application Style > GTK'' in System Settings or run the {{ic|kde-gtk-config}} command.<br />
<br />
=== Adwaita ===<br />
<br />
Adwaita is the default GNOME theme. The GTK+ 3 version is included in the {{Pkg|gtk3}} package, while the GTK+ 2 version is in {{Pkg|gnome-themes-standard}}. [https://github.com/MartinBriza/adwaita-qt adwaita-qt] is a Qt port of the Adwaita theme. Unlike [[#QGtkStyle]], which mimics the GTK+ 2 theme, it provides a native Qt style made to look like the GTK+ 3 Adwaita. It can be [[install|installed]] with the {{AUR|adwaita-qt4}} and {{AUR|adwaita-qt5}} packages for the Qt 4 and 5 versions, respectively.<br />
<br />
To set the Qt style as default:<br />
<br />
* For Qt4, it can be enabled with ''Qt Configuration'' ({{ic|qtconfig-qt4}}), choose ''adwaita'' under ''Appearance > GUI Style''. Alternatively, edit the {{ic|/etc/xdg/Trolltech.conf}} (system-wide) or {{ic|~/.config/Trolltech.conf}} (user-specific) file:<br />
<br />
{{hc|~/.config/Trolltech.conf|2=<br />
...<br />
[Qt]<br />
style=adwaita<br />
...<br />
}}<br />
<br />
* For Qt 5, it can be enabled by setting the following [[Environment variables#Graphical applications|environment variable]]: {{ic|1=QT_STYLE_OVERRIDE=adwaita}}. Alternatively, use {{Pkg|qt5ct}} package. For more detailed instructions, see [[Qt#Configuration of Qt5 apps under environments other than KDE Plasma]].<br />
<br />
== Theme engines ==<br />
<br />
A ''theme engine'' can be thought of as a thin layer API which translates themes (excluding icons) between one or more toolkits. These engines add some extra code in the process and it is arguable that this kind of a solution is not as elegant and optimal as using native styles.<br />
<br />
=== QGtkStyle ===<br />
<br />
{{Note|QGtkStyle has been removed from {{Pkg|qt5-base}} 5.7.0 [https://github.com/qtproject/qtbase/commit/899a815414e95da8d9429a4a4f4d7094e49cfc55] and added to {{Pkg|qt5-styleplugins}} [https://github.com/qtproject/qtstyleplugins/commit/102da7d50231fc5723dba6e72340bef3d29471aa]}}<br />
<br />
{{Warning|Depending on GTK+ 2 theme, this style may cause rendering issues such as transparent fonts or inconsistent widgets.}}<br />
<br />
This Qt style uses GTK+ 2 to render all components to blend in with [[GNOME]] and similar GTK+ based environments. Beginning with Qt 4.5, this style is included in Qt. It requires {{Pkg|gtk2}} to be installed and configured.<br />
<br />
This is the default Qt4 style in Cinnamon, GNOME and Xfce, and the default Qt5 style in Cinnamon, GNOME, MATE, LXDE and Xfce. In other environments:<br />
<br />
* For Qt4, it can be enabled with ''Qt Configuration'' ({{ic|qtconfig-qt4}}), choose ''GTK+'' under ''Appearance > GUI Style''. Alternatively, edit the {{ic|/etc/xdg/Trolltech.conf}} (system-wide) or {{ic|~/.config/Trolltech.conf}} (user-specific) file:<br />
<br />
{{hc|~/.config/Trolltech.conf|2=<br />
...<br />
[Qt]<br />
style=GTK+<br />
...<br />
}}<br />
<br />
* For Qt 5, it can be enabled by installing {{Pkg|qt5-styleplugins}} and setting the following [[Environment variables#Graphical applications|environment variable]]: {{ic|1=QT_QPA_PLATFORMTHEME=gtk2}}<br />
<br />
For full uniformity, make sure that the configured [[GTK+#Themes|GTK+ theme]] supports both GTK+ 2 and GTK+ 3. If your preferred theme has inconsistent rendering after configuring Qt to use GTK+2, install {{ic|gtk-theme-switch2}} and choose a theme.<br />
<br />
=== QGnomePlatform ===<br />
<br />
This Qt 5 platform theme applies the appearance settings of GNOME for Qt applications. It can be installed with the {{AUR|qgnomeplatform}} package or the {{AUR|qgnomeplatform-git}} package for the development version. It does not provide a Qt style itself, instead it requires a [[#Styles for both Qt and GTK+|style that support both Qt and GTK+]].<br />
<br />
This platform theme is enabled automatically in GNOME since version 3.20. For other systems, it can be enabled by setting the following [[Environment variables#Graphical applications|environment variable]]: {{ic|1=QT_QPA_PLATFORMTHEME=qgnomeplatform}}.<br />
<br />
== Tips and tricks ==<br />
=== KDE file dialogs for GTK+ applications ===<br />
'''Chromium''' <br />
At least for chromium installing {{ic|kdialog}} makes chromium used kde file dialog ( so `KGtk-wrapper` is not required )<br />
<br />
{{Warning|Some GTK+ applications may not be compatible with KGtk-wrapper (e.g. [[Chromium]]), sometimes the wrapper makes the application crash ([[Firefox]] or [[Thunderbird]]).}}<br />
<br />
{{AUR|kgtk}} from the [[AUR]] is a wrapper script which uses {{ic|LD_PRELOAD}} to force KDE file dialogs in GTK+ 2.x apps. Once installed you can run GTK+ 2.x applications with {{ic|kgtk-wrapper}} in two ways (using [[GIMP]] in the examples):<br />
<br />
* Calling {{ic|kgtk-wrapper}} directly and using the GTK+ 2.x binary as an argument:<br />
:{{bc|$ /usr/bin/kgtk-wrapper gimp}}<br />
* Modifying the KDE .desktop shortcuts files you can find at {{ic|/usr/share/applications/}} to prefix the {{ic|Exec}} statement with kgtk-wrapper.<br />
:e.g. with [[GIMP]], edit the {{ic|/usr/share/applications/gimp.desktop}} shortcut file and replace {{ic|1=Exec=gimp-2.8 %U}} by {{ic|1=Exec=kgtk-wrapper gimp-2.8 %U}}.<br />
<br />
=== Using a GTK+ icon theme in Qt apps ===<br />
<br />
{{Style|Duplicates [[environment variables]]}}<br />
<br />
If you are running Plasma, install {{Pkg|kde-gtk-config}} and select the icon-theme under ''System Settings > Application Style > GTK''.<br />
<br />
If you are using [[GNOME]], first check if {{Pkg|dconf-editor}} is installed.<br />
<br />
Then, run {{ic|dconf-editor}} and look under ''org > gnome > desktop > interface'' for {{ic|icon-theme}} key and change it to your preferred icon theme. <br />
<br />
If you are not using [[GNOME]], for example if you are running a minimal system with {{Pkg|i3-wm}}, first install {{Pkg|dconf-editor}}. <br />
<br />
Then, run {{ic|dconf-editor}} and look under ''org > gnome > desktop > interface'' for {{ic|icon-theme}} key and change it to your preferred icon theme. <br />
<br />
Since, you are not using [[GNOME]], you might have to set the value of {{ic|DESKTOP_SESSION}} in your profile. To do that execute the below code in a terminal and restart your system.<br />
<br />
$ echo 'export DESKTOP_SESSION=gnome' >> /etc/profile<br />
<br />
'''OR'''<br />
<br />
Set {{ic|1=export DESKTOP_SESSION=gnome}} somewhere in your {{ic|~/.xinitrc}} or, if you are using a [[Display manager]] in [[Xprofile]].<br />
<br />
{{Note| If the icon theme was not applied, you might want to check if the name that you entered of your preferred theme, was in the correct format. For example, if you want to apply the currently active icon theme to your QT applications, you can find the correct format of it's name with the command:<br />
<br />
{{bc|1=$ cat ~/.gtkrc-2.0 {{!}} grep icon-theme {{!}} cut -d= -f2}}<br />
<br />
}}<br />
<br />
=== Improve subpixel rendering of GTK apps under KDE Plasma ===<br />
<br />
See [[Font configuration#LCD filter]].<br />
<br />
== Troubleshooting ==<br />
<br />
=== Qt applications do not use QGtkStyle ===<br />
Qt will not apply QGtkStyle correctly if GTK+ is using the [[#GTK+-Qt Engine|GTK+-Qt Engine]]{{Broken section link}}. Qt determines whether the GTK+-Qt Engine is in use by reading the GTK+ configuration files listed in the environmental variable {{ic|GTK2_RC_FILES}}. If the environmental variable is not set properly, Qt assumes you are using the engine, sets QGtkStyle to use the style GTK+ style ''Clearlooks'', and outputs an error message:<br />
<br />
QGtkStyle cannot be used together with the GTK_Qt engine.<br />
<br />
Another error you may get after launching {{ic|qtconfig-qt4}} from a shell and selecting the GTK+ style is:<br />
<br />
QGtkStyle was unable to detect the current GTK+ theme.<br />
<br />
According to [https://bbs.archlinux.org/viewtopic.php?id&#61;99175&p&#61;1 this thread], you may simply have to install {{AUR|libgnomeui}} to solve this issue. This has the added benefit that you do not need to edit a file every time you change your theme via a graphical tool, like the one provided by xfce.<br />
<br />
Users of [[Openbox]] and other non-GNOME environments may encounter this problem. To solve this, first add the following to your {{ic|.xinitrc}} file:<br />
{{hc|.xinitrc|<nowiki><br />
...<br />
export GTK2_RC_FILES="$HOME/.gtkrc-2.0"<br />
...<br />
</nowiki>}}<br />
<br />
{{Note|<br />
* Make sure to add this line before invoking the window manager.<br />
* You can add multiple paths by separating them with colons.<br />
* Make sure to use {{ic|$HOME}} instead of {{ic|~}} as it will not properly expand to the user's home directory.<br />
}}<br />
<br />
Then specify the theme you want in the {{ic|~/.gtkrc-2.0}} file using a [[#GTK2 styles|dedicated application]]{{Broken section link}} or manually, by adding:<br />
{{hc|.gtkrc-2.0|<nowiki><br />
...<br />
gtk-theme-name="[name of theme]"<br />
...<br />
</nowiki>}}<br />
<br />
Some tools only insert the following include directive in {{ic|~/.gtkrc-2.0}}:<br />
{{hc|.gtkrc-2.0|<br />
...<br />
include "/usr/share/themes/SomeTheme/gtk-2.0/gtkrc"<br />
...<br />
}}<br />
<br />
which apparently is not recognized by all versions of QGtkStyle. You can hotfix this problem by inserting the {{ic|gtk-theme-name}} manually in your {{ic|~/.gtkrc-2.0}} file like above.<br />
<br />
{{Note|Style-changing applications will most probably rewrite the {{ic|~/.gtkrc-2.0}} file the next time you change themes.}}<br />
<br />
If these steps do not work, install {{Pkg|gconf}} and run this command:<br />
<br />
gconftool-2 --set --type string /desktop/gnome/interface/gtk_theme [name of theme]<br />
<br />
If you further want to set the same icon and cursor theme, then you have to specify them, too.<br />
<br />
gconftool-2 --set --type string /desktop/gnome/interface/icon_theme Faenza-Dark<br />
<br />
This sets the icon theme to Faenza-Dark located in {{ic|/usr/share/icons/Faenza-Dark}}. For the cursor theme you first have to set the gconf value.<br />
<br />
gconftool-2 --set --type string /desktop/gnome/peripherals/mouse/cursor_theme Adwaita<br />
<br />
Then you will have to create the file {{ic|/usr/share/icons/default/index.theme}} with the following lines:<br />
<br />
[Icon Theme]<br />
Inherits=Adwaita<br />
<br />
=== Themes not working in GTK+ apps ===<br />
<br />
If the style or theme engine you set up is not showing in your GTK applications then it is likely your GTK+ settings files are not being loaded for some reason. You can check where your system expects to find these files by doing the following..<br />
$ export | grep gtk<br />
<br />
Usually the expected files should be {{ic|~/.gtkrc}} for GTK1 and {{ic|~/.gtkrc2.0}} or {{ic|~/.gtkrc2.0-kde}} for GTK+ 2.x.<br />
<br />
=== GTK+ apps don't use svg (breeze) icons after system upgrade ===<br />
<br />
Try to run this to fix this issue:<br />
# gdk-pixbuf-query-loaders --update-cache</div>J99https://wiki.archlinux.org/index.php?title=Fonts&diff=512829Fonts2018-03-05T19:45:07Z<p>J99: /* Monospaced */ a description of the Hack font</p>
<hr />
<div>[[Category:Fonts]]<br />
[[cs:Fonts]]<br />
[[de:Schriftarten]]<br />
[[es:Fonts]]<br />
[[it:Fonts]]<br />
[[ja:フォント]]<br />
[[ru:Fonts]]<br />
[[zh-hans:Fonts]]<br />
[[zh-hant:Fonts]]<br />
{{Related articles start}}<br />
{{Related|Font configuration}}<br />
{{Related|Java Runtime Environment Fonts}}<br />
{{Related|Metric-compatible fonts}}<br />
{{Related articles end}}<br />
<br />
From [[Wikipedia:Computer font]]: "A computer font (or font) is an electronic data file containing a set of glyphs, characters, or symbols such as dingbats."<br />
<br />
Note that certain font licenses may impose some legal limitations.<br />
<br />
== Font formats ==<br />
<br />
Most computer fonts used today are in either ''bitmap'' or ''outline'' data formats. <br />
;Bitmap fonts: Consist of a matrix of dots or pixels representing the image of each glyph in each face and size.<br />
;Outline or ''vector'' fonts: Use Bézier curves, drawing instructions and mathematical formulae to describe each glyph, which make the character outlines scalable to any size.<br />
<br />
=== Bitmap formats ===<br />
<br />
* [[Wikipedia:Glyph Bitmap Distribution Format|Bitmap Distribution Format]] (BDF) by Adobe<br />
* [[Wikipedia:Portable Compiled Format|Portable Compiled Format]] (PCF) by Xorg<br />
* [[Wikipedia:PC Screen Font|PC Screen Font]] (PSF) used by the Kernel for console fonts, not supported by Xorg (for Unicode PSF files the extension is {{ic|psfu}})<br />
<br />
These formats can also be gzipped. See [[#Bitmap]] for the available bitmap fonts.<br />
<br />
=== Outline formats ===<br />
<br />
* [[Wikipedia:PostScript fonts|PostScript fonts]] by Adobe – has various formats, e.g: Printer Font ASCII (PFA) and Printer Font Binary (PPB)<br />
* [[Wikipedia:TrueType|TrueType]] by Apple and Microsoft (file extension: {{ic|ttf}})<br />
* [[Wikipedia:OpenType|OpenType]] by Microsoft, built on TrueType (file extensions: {{ic|otf}}, {{ic|ttf}})<br />
<br />
For most purposes, the technical differences between TrueType and OpenType can be ignored.<br />
<br />
=== Other formats ===<br />
<br />
The typesetting application, ''TeX,'' and its companion font software, ''Metafont,'' render characters using their own methods. Some of the file extensions used for fonts by these two programs are {{ic|*pk}}, {{ic|*gf}}, {{ic|mf}} and {{ic|vf}}.<br />
<br />
[https://fontforge.github.io/en-US/ FontForge] ({{Pkg|fontforge}}), a font editing application, can store fonts in its native text-based format, {{ic|sfd}}, ''s''pline ''f''ont ''d''atabase.<br />
<br />
The [http://www.w3.org/TR/SVG/fonts.html SVG] format also has its own font description method.<br />
<br />
== Installation ==<br />
<br />
There are various methods for installing fonts.<br />
<br />
=== Pacman ===<br />
<br />
Fonts and font collections in the enabled repositories can be installed using [[pacman]].<br />
<br />
Available fonts may be found by [[pacman#Querying package databases|querying packages]] (e.g. for {{ic|font}} or {{ic|ttf}}).<br />
<br />
=== Creating a package ===<br />
<br />
You should give pacman the ability to manage your fonts, which is done by creating an Arch package. These can also be shared with the community in the [[AUR]]. The packages to install fonts are particularly similar; simply taking an existing [https://git.archlinux.org/svntogit/packages.git/tree/trunk/PKGBUILD?h=packages/adobe-source-code-pro-fonts package] as template should work well. To learn about how to modify it for your font, please refer to [[Creating packages]].<br />
<br />
The family name of a font file can be aquired with the use of {{ic|fc-query}} for example: {{ic|fc-query -f '%{family[0]}\n' /path/to/file}}. The formatting is described in the FcPatternFormat(3) manual.<br />
<br />
=== Manual installation ===<br />
<br />
The recommended way of adding fonts that are not in the repositories to your system is described in [[#Creating a package]]. This gives pacman the ability to remove or update them at a later time. Fonts can alternately be installed manually as well.<br />
<br />
To install fonts system-wide (available for all users), move the folder to the {{ic|/usr/share/fonts/}} directory. The files need to be readable by every user, use [[chmod]] to set the correct permissions (i.e. at least {{ic|0444}} for files and {{ic|0555}} for directories). To install fonts for only a single user, use {{ic|~/.local/share/fonts}} ({{ic|~/.fonts/}} is now deprecated).<br />
<br />
For Xserver to load fonts directly (as opposed to the use of a ''font server'') the directory for your newly added font must be added with a FontPath entry. This entry is located in the ''Files'' section [[Xorg#Configuration|of your Xorg configuration file]] (e.g. {{ic|/etc/X11/xorg.conf}} or {{ic|/etc/xorg.conf}}). See [[#Older applications]] for more detail.<br />
<br />
Then update the fontconfig font cache: (usually unnecessary as software using the fontconfig library do this.)<br />
<br />
$ fc-cache<br />
<br />
=== Older applications ===<br />
<br />
With older applications that do not support fontconfig (e.g. GTK+ 1.x applications, and {{ic|xfontsel}}) the index will need to be created in the font directory:<br />
<br />
$ mkfontscale<br />
$ mkfontdir<br />
<br />
Or to include more than one folder with one command:<br />
<br />
$ for dir in /font/dir1/ /font/dir2/; do xset +fp $dir; done && xset fp rehash<br />
<br />
Or if fonts were installed in a different sub-folders under the e.g. {{ic|/usr/share/fonts}}:<br />
<br />
$ for dir in * ; do if [ -d "$dir" ]; then cd "$dir";xset +fp "$PWD" ;mkfontscale; mkfontdir;cd .. ;fi; done && xset fp rehash<br />
<br />
At times the X server may fail to load the fonts directory and you will need to rescan all the {{ic|fonts.dir}} files:<br />
<br />
# xset +fp /usr/share/fonts/misc # Inform the X server of new directories<br />
# xset fp rehash # Forces a new rescan<br />
<br />
To check that the font(s) is included:<br />
<br />
$ xlsfonts | grep fontname<br />
<br />
{{note|Many packages will automatically configure Xorg to use the font upon installation. If that is the case with your font, this step is not necessary.}}<br />
<br />
This can also be set globally in {{ic|/etc/X11/xorg.conf}} or {{ic|/etc/X11/xorg.conf.d}}.<br />
<br />
Here is an example of the section that must be added to {{ic|/etc/X11/xorg.conf}}. Add or remove paths based on your particular font requirements.<br />
<br />
# Let X.Org know about the custom font directories<br />
Section "Files"<br />
FontPath "/usr/share/fonts/100dpi"<br />
FontPath "/usr/share/fonts/75dpi"<br />
FontPath "/usr/share/fonts/cantarell"<br />
FontPath "/usr/share/fonts/cyrillic"<br />
FontPath "/usr/share/fonts/encodings"<br />
FontPath "/usr/share/fonts/misc"<br />
FontPath "/usr/share/fonts/truetype"<br />
FontPath "/usr/share/fonts/TTF"<br />
FontPath "/usr/share/fonts/util"<br />
EndSection<br />
<br />
=== Pango Warnings ===<br />
<br />
When [http://www.pango.org/ Pango] is in use on your system it will read from [http://www.freedesktop.org/wiki/Software/fontconfig fontconfig] to sort out where to source fonts.<br />
<br />
(process:5741): Pango-WARNING **: failed to choose a font, expect ugly output. engine-type='PangoRenderFc', script='common'<br />
(process:5741): Pango-WARNING **: failed to choose a font, expect ugly output. engine-type='PangoRenderFc', script='latin'<br />
<br />
If you are seeing errors similar to this and/or seeing blocks instead of characters in your application then you need to add fonts and update the font cache. This example uses the {{Pkg|ttf-liberation}} fonts to illustrate the solution (after successful installation of the package) and runs as root to enable them system-wide.<br />
<br />
# fc-cache<br />
/usr/share/fonts: caching, new cache contents: 0 fonts, 3 dirs<br />
/usr/share/fonts/TTF: caching, new cache contents: 16 fonts, 0 dirs<br />
/usr/share/fonts/encodings: caching, new cache contents: 0 fonts, 1 dirs<br />
/usr/share/fonts/encodings/large: caching, new cache contents: 0 fonts, 0 dirs<br />
/usr/share/fonts/util: caching, new cache contents: 0 fonts, 0 dirs<br />
/var/cache/fontconfig: cleaning cache directory<br />
fc-cache: succeeded<br />
<br />
You can test for a default font being set like so:<br />
<br />
# fc-match<br />
LiberationMono-Regular.ttf: "Liberation Mono" "Regular"<br />
<br />
== Console fonts ==<br />
<br />
{{Note|This section is about the [[Wikipedia:Linux console|Linux console]]. For alternative console solutions offering more features (full Unicode fonts, modern graphics adapters etc.), see [[fbterm]], [[KMSCON]] or similar projects.}}<br />
<br />
By default, the [[Wikipedia:Virtual console|virtual console]] uses the kernel built-in font with a [[Wikipedia:CP437|CP437]] character set,<sup>[https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/drivers/tty/vt/Makefile#n4]</sup> but this can be easily changed.<br />
<br />
The [[Wikipedia:Linux console|Linux console]] uses UTF-8 encoding by default, but because the standard VGA-compatible framebuffer is used, a console font is limited to either a standard 256, or 512 glyphs. If the font has more than 256 glyphs, the number of colours is reduced from 16 to 8. In order to assign correct symbol to be displayed to the given Unicode value, a special translation map, often called ''unimap'', is needed. Nowadays most of the console fonts have the ''unimap'' built-in; historically, it had to be loaded separately.<br />
<br />
The {{Pkg|kbd}} package provides tools to change virtual console font and font mapping. Available fonts are saved in the {{ic|/usr/share/kbd/consolefonts/}} directory, those ending with ''.psfu'' or ''.psfu.gz'' have a Unicode translation map built-in.<br />
<br />
Keymaps, the connection between the key pressed and the character used by the computer, are found in the subdirectories of {{ic|/usr/share/kbd/keymaps/}}, see [[Keyboard configuration in console]] for details.<br />
<br />
{{Note|Replacing the font can cause issues with programs that expect a standard VGA-style font, such as those using line drawing graphics.}}<br />
<br />
{{Tip|For European based languages written in Latin/Greek letters you can use {{ic|eurlatgr}} font, it includes a broad range of Latin/Greek letter variations as well as<br />
special characters [https://lists.altlinux.org/pipermail/kbd/2014-February/000439.html].}}<br />
<br />
=== Preview and temporary changes ===<br />
<br />
{{Tip|An organized library of images for previewing is available: [http://alexandre.deverteuil.net/pages/consolefonts/ Linux console fonts screenshots].}}<br />
<br />
$ showconsolefont<br />
<br />
shows a table of glyphs or letters of a font.<br />
<br />
{{ic|setfont}} temporarily change the font if passed a font name (in {{ic|/usr/share/kbd/consolefonts/}}) such as<br />
<br />
$ setfont lat2-16 -m 8859-2<br />
<br />
Font names are case-sensitive. With no parameter, {{ic|setfont}} returns the console to the default font.<br />
<br />
{{Tip|All font changing commands can be typed in "blind".}}<br />
<br />
{{Note|''setfont'' only works on the console currently being used. Any other consoles, active or inactive, remain unaffected.}}<br />
<br />
=== Persistent configuration ===<br />
<br />
The {{ic|FONT}} variable in {{ic|/etc/vconsole.conf}} is used to set the font at boot, persistently for all consoles. See {{man|5|vconsole.conf}} for details.<br />
<br />
For displaying characters such as ''Č, ž, đ, š'' or ''Ł, ę, ą, ś'' using the font {{ic|lat2-16.psfu.gz}}:<br />
<br />
{{hc|/etc/vconsole.conf|2=<br />
...<br />
FONT=lat2-16<br />
FONT_MAP=8859-2<br />
}}<br />
<br />
It means that second part of ISO/IEC 8859 characters are used with size 16. You can change font size using other values (e.g. {{ic|lat2-08}}). For the regions determined by 8859 specification, look at the [[Wikipedia:ISO/IEC 8859#The parts of ISO/IEC 8859]].<br />
<br />
To use the specified font in early userspace, use the {{ic|consolefont}} hook in {{ic|/etc/mkinitcpio.conf}}. See [[Mkinitcpio#HOOKS]] for more information. <br />
<br />
If the fonts seems to not change on boot, or change only temporarily, it is most likely that they got reset when graphics driver was initialized and console was switched to framebuffer. To avoid this, load your graphics driver earlier. See for example [[Kernel mode setting#Early KMS start]], [https://bbs.archlinux.org/viewtopic.php?id=145765] or other ways to setup your framebuffer before {{ic|/etc/vconsole.conf}} is applied.<br />
<br />
== Font packages ==<br />
<br />
This is a selective list that includes many font packages from the [[AUR]] along with those in the official repositories. Fonts are tagged "Unicode" if they have wide Unicode support, see the project or <br />
Wikipedia pages for detail.<br />
<br />
The [https://github.com/ternstor/distrofonts Archfonts Python script] can be used to generate an overview of all the TTF fonts found in the official repositories / the AUR (the image generation is done using {{AUR|ttf2png}}).<br />
<br />
=== Bitmap ===<br />
<br />
* Default 8x16<br />
* [http://www.dcmembers.com/jibsen/download/61/ Dina] ({{Pkg|dina-font}}) – 6pt, 8pt, 9pt, 10pt, monospaced, based on Proggy<br />
* [http://font.gohu.org/ Gohu] ({{AUR|gohufont}}) – 11px, 14px, normal and bold<br />
* [http://artwizaleczapka.sourceforge.net/ Lime] ({{Pkg|artwiz-fonts}})<br />
* [http://tobiasjung.name/profont/ ProFont] ({{Pkg|profont}}) – 10px, 11px, 12px, 15px, 17px, 22px, 29px, normal<br />
* [[Wikipedia:Proggy programming fonts|Proggy]] ({{AUR|proggyfonts}}) – has different variants<br />
* [http://www.fial.com/~scott/tamsyn-font/ Tamsyn] ({{Pkg|tamsyn-font}})<br />
* [http://terminus-font.sourceforge.net/ Terminus] ({{Pkg|terminus-font}})<br />
* [https://github.com/lucy/tewi-font Tewi] ({{AUR|bdf-tewi-git}})<br />
* [http://unifoundry.com/unifont.html Unifont] ([[Wikipedia:Unicode font#Comparison of fonts|most extensive]] Unicode coverage of any font) ({{Pkg|bdf-unifont}})<br />
<br />
=== Latin script ===<br />
<br />
==== Families ====<br />
<br />
* [[Wikipedia:Bitstream Vera|Bitstream Vera]] ({{Pkg|ttf-bitstream-vera}}) – serif, sans-serif, and monospace<br />
* [https://quoteunquoteapps.com/courierprime/ Courier Prime] ({{AUR|ttf-courier-prime}}) – Courier font alternative optimized for screenplays<br />
* [[Wikipedia:Croscore fonts|Croscore fonts]] ({{Pkg|ttf-croscore}}) – Google's substitute for Windows' Arial, Times New Roman, and Courier New<br />
* [[Wikipedia:DejaVu fonts|DejaVu fonts]] ({{Pkg|ttf-dejavu}}) – Bitstream Vera modified for greater Unicode coverage<br />
* [[Wikipedia:Droid (font)|Droid]] ({{Pkg|ttf-droid}}, included in {{AUR|ttf-google-fonts-git}}) – default font for older Android versions<br />
* [[Wikipedia:Roboto|Roboto]] ({{Pkg|ttf-roboto}}) – default font for newer Android versions<br />
* [[Wikipedia:Noto fonts|Google Noto]] ({{Pkg|noto-fonts}}) – Unicode<br />
* [[Wikipedia:Liberation fonts|Liberation fonts]] ({{Pkg|ttf-liberation}}) – free substitute for Windows' Arial, Arial Narrow, Times New Roman and Courier New<br />
* [[Wikipedia:Ubuntu Font Family|Ubuntu Font Family]] ({{Pkg|ttf-ubuntu-font-family}})<br />
* [http://corefonts.sourceforge.net/ Microsoft fonts] ({{AUR|ttf-ms-fonts}}) – Andalé Mono, Courier New, Arial, Arial Black, Comic Sans, Impact, Lucida Sans, Microsoft Sans Serif, Trebuchet, Verdana, Georgia, Times New Roman<br />
* Vista fonts ({{AUR|ttf-vista-fonts}}) – Consolas, Calibri, Candara, Corbel, Cambria, Constantia<br />
<br />
==== Monospaced ====<br />
<br />
For more monospaced fonts see [[#Bitmap]] and [[#Families]].<br />
<br />
* [http://www.marksimonson.com/fonts/view/anonymous-pro Anonymous Pro] ({{pkg|ttf-anonymous-pro}}, included in {{AUR|ttf-google-fonts-git}})<br />
* [https://damieng.com/blog/2008/05/26/envy-code-r-preview-7-coding-font-released Envy Code R] ({{AUR|ttf-envy-code-r}})<br />
* Fantasque Sans Mono ({{AUR|ttf-fantasque-sans-git}})<br />
* [[Wikipedia:Fira Sans|Fira Mono]] ({{pkg|ttf-fira-mono}}, {{pkg|otf-fira-mono}}) – designed for Firefox OS<br />
* [[Wikipedia:GNU FreeFont|FreeMono]] ({{Pkg|ttf-freefont}}) - Unicode<br />
* [https://sourcefoundry.org/hack/ Hack] ({{pkg|ttf-hack}}) - an open source monospaced font, used as the default in KDE Plasma<br />
* [[Wikipedia:Inconsolata|Inconsolata]] ({{Pkg|ttf-inconsolata}}, included in {{AUR|ttf-google-fonts-git}}) - inspired by Consolas<br />
* [https://leonardo-m.livejournal.com/77079.html Inconsolata-g] ({{AUR|ttf-inconsolata-g}}) - adds some programmer-friendly modifications<br />
* [[Wikipedia:Lucida Typewriter|Lucida Typewriter]] (included in package {{AUR|jre}})<br />
* [[Wikipedia:Menlo (typeface)|Menlo]] (derivative: {{AUR|ttf-meslo}}) - default monospaced font of OS X<br />
* [[Wikipedia:Monaco (typeface)|Monaco]] ({{AUR|ttf-monaco}}) - proprietary font designed by Apple for OS X<br />
* Monofur ({{AUR|ttf-monofur}})<br />
* [https://madmalik.github.io/mononoki Mononoki] ({{AUR|ttf-mononoki}})<br />
* [[Wikipedia:Source_Code_Pro|Source Code Pro]] ({{pkg|adobe-source-code-pro-fonts}})<br />
<br />
Relevant websites:<br />
<br />
* [http://hivelogic.com/articles/top-10-programming-fonts Dan Benjamin's Top 10 Programming Fonts].<br />
* [http://www.lowing.org/fonts/ Trevor Lowing's font list]<br />
* [https://www.slant.co/topics/67/~what-are-the-best-programming-fonts Slant: What are the best programming fonts?]<br />
* [https://stackoverflow.com/questions/4689/recommended-fonts-for-programming Stack Overflow: Recommended fonts for programming]<br />
<br />
==== Sans-serif ====<br />
<br />
* [http://scripts.sil.org/cms/scripts/page.php?site_id=nrsi&id=andika Andika] ({{AUR|ttf-andika}})<br />
* [[Wikipedia:GNU FreeFont|FreeSans]] ({{Pkg|ttf-freefont}}) - Unicode<br />
* [https://github.com/rsms/inter Inter UI] ({{AUR|ttf-inter-ui}}) – designed for user interfaces<br />
* [[Wikipedia:Linux Libertine|Linux Biolinum]] ({{Pkg|ttf-linux-libertine}}) – free substitute for Times New Roman<br />
* [[Wikipedia:PT Sans|PT Sans]] ({{AUR|ttf-google-fonts-git}}) - 3 major variations: normal, narrow, and caption - Unicode: Latin, Cyrillic<br />
* [[Wikipedia:Source Sans Pro|Source Sans Pro]] ({{pkg|adobe-source-sans-pro-fonts}})<br />
* [[Wikipedia:Tahoma (typeface)|Tahoma]] ({{AUR|ttf-tahoma}})<br />
<br />
==== Serif ====<br />
<br />
* [http://www.georgduffner.at/ebgaramond/ EB Garamond] ({{AUR|otf-eb-garamond}})<br />
* [[Wikipedia:GNU FreeFont|FreeSerif]] ({{Pkg|ttf-freefont}}) - Unicode<br />
* [[Wikipedia:Gentium|Gentium]] ({{Pkg|ttf-gentium}}) - Unicode: Latin, Greek, Cyrillic, Phonetic Alphabet<br />
* [[Wikipedia:Linux Libertine|Linux Libertine]] ({{Pkg|ttf-linux-libertine}}) - Unicode: Latin, Greek, Cyrillic, Hebrew<br />
<br />
==== Unsorted ====<br />
<br />
{{Style|This section should be absorbed into the Monospace/Serif/Sans-Serif structure}}<br />
<br />
* {{Pkg|font-bh-ttf}} - X.Org Luxi fonts<br />
* {{Pkg|ttf-cheapskate}} - Font collection from ''dustismo.com''<br />
* {{Pkg|ttf-junicode}} - Junius font containing almost complete medieval latin script glyphs<br />
* {{Pkg|ttf-mph-2b-damase}} - Covers full plane 1 and several scripts<br />
* {{Pkg|xorg-fonts-type1}} - IBM Courier and Adobe Utopia sets of [[Wikipedia:PostScript fonts|PostScript fonts]]<br />
* {{AUR|all-repository-fonts}} - Meta package for all fonts in the official repositories.<br />
* {{AUR|ttf-google-fonts-git}} - a huge collection of free fonts (including Ubuntu, Inconsolata, Droid, etc.) - Note: Your font dialog might get very long as >100 fonts will be added.<br />
<br />
=== Non-latin scripts ===<br />
<br />
==== Ancient Scripts ====<br />
<br />
* {{AUR|ttf-ancient-fonts}} - Font containing Unicode symbols for Aegean, Egyptian, Cuneiform, Anatolian, Maya, and Analecta scripts<br />
<br />
==== Arabic ====<br />
<br />
* {{AUR|ttf-amiri}} - A classical Arabic typeface in Naskh style poineered by Amiria Press<br />
* {{AUR|ttf-arabeyes-fonts}} - Collection of free Arabic fonts<br />
* {{AUR|ttf-qurancomplex-fonts}} - Fonts by King Fahd Glorious Quran Printing Complex in al-Madinah al-Munawwarah<br />
* {{AUR|ttf-sil-lateef}} - Unicode Arabic font from SIL<br />
* {{AUR|ttf-sil-scheherazade}} - Unicode Arabic font from SIL<br />
<br />
==== Braille ====<br />
<br />
*{{Pkg|ttf-ubraille}} - Font containing Unicode symbols for ''braille''<br />
<br />
==== Chinese, Japanese, Korean, Vietnamese ====<br />
<br />
===== Pan-CJK =====<br />
*adobe source han fonts<br />
Large collection of fonts which comprehensively support Simplified Chinese, Traditional Chinese, Japanese, and Korean, with a consistent design and look.<br />
**{{Pkg|adobe-source-han-sans-otc-fonts}} - Sans fonts<br />
**{{Pkg|adobe-source-han-serif-otc-fonts}} - Serif fonts<br />
<br />
*{{Pkg|noto-fonts-cjk}} - Large collection of fonts which comprehensively support Simplified Chinese, Traditional Chinese, Japanese, and Korean, with a consistent design and look. It is currently a rebadged version of {{Pkg|adobe-source-han-sans-otc-fonts}}.<br />
<br />
===== Chinese =====<br />
* adobe source han fonts<br />
** {{Pkg|adobe-source-han-sans-cn-fonts}} - Simplified Chinese OpenType/CFF Sans fonts<br />
** {{Pkg|adobe-source-han-sans-tw-fonts}} - Traditional Chinese OpenType/CFF Sans fonts<br />
** {{Pkg|adobe-source-han-serif-cn-fonts}} - Simplified Chinese OpenType/CFF Serif fonts<br />
** {{Pkg|adobe-source-han-serif-tw-fonts}} - Traditional Chinese OpenType/CFF Serif fonts<br />
<br />
* noto Chinese fonts<br />
** {{AUR|noto-fonts-sc}} - Noto CJK-SC fonts for Simplified Chinese<br />
** {{AUR|noto-fonts-tc}} - Noto CJK-TC fonts for Traditional Chinese<br />
<br />
* wqy fonts<br />
** {{Pkg|wqy-zenhei}} - Hei Ti Style (sans-serif) Chinese Outline font embedded with bitmapped Song Ti (also supporting Japanese (partial) and Korean characters).<br />
** {{Pkg|wqy-bitmapfont}} - Bitmapped Song Ti (serif) Chinese font.<br />
<br />
* arphic fonts<br />
** {{Pkg|ttf-arphic-ukai}} - ''Kaiti'' (brush stroke) Unicode font (enabling anti-aliasing is suggested)<br />
** {{Pkg|ttf-arphic-uming}} - ''Mingti'' (printed) Unicode font<br />
<br />
* {{Pkg|opendesktop-fonts}} - ''New Sung'' font, previously is ttf-fireflysung package<br />
<br />
* {{Pkg|ttf-hannom}} - Chinese and Vietnamese ttf fonts<br />
<br />
* Standart fonts of the Republic of China ministry of education in Taiwan<br />
** {{AUR|ttf-tw}} - Kai and Song traditional Chinese font from the Ministry of Education of Taiwan<br />
** {{AUR|ttf-twcns-fonts}} Chinese TrueType fonts by Ministry of Education of Taiwan government, support CNS11643 standard, including Kai and Sung fontface.<br />
<br />
*Windows Chinses fonts<br />
**{{AUR|ttf-ms-win8-zh_cn}} - windows8 simple Chinese fonts。<br />
**{{AUR|ttf-ms-win8-zh_tw}} - windows8 traditional Chinese fonts。<br />
**{{AUR|ttf-ms-win10-zh_cn}} - windows10 simple Chinese fonts。<br />
**{{AUR|ttf-ms-win10-zh_tw}} - windows10 traditional Chinese fonts。<br />
<br />
* {{AUR|ttf-i.bming}} - CJK serif font that emphasis on an old-style typeface.<br />
<br />
===== Japanese =====<br />
<br />
* {{Pkg|adobe-source-han-sans-jp-fonts}} - Japanese OpenType/CFF fonts<br />
* {{Pkg|otf-ipafont}} - Formal style Japanese Gothic (sans-serif) and Mincho (serif) fonts set; one of the highest quality open source font. Default of openSUSE-ja.<br />
* {{Pkg|ttf-hanazono}} - A free Japanese kanji font, style Mincho (serif).<br />
* {{Pkg|ttf-sazanami}} - Japanese free TrueType font. This is outdated and not maintained any more, but may be defined as a fallback font on several environments.<br />
* {{AUR|ttf-koruri}} - Japanese TrueType font obtained by mixing {{AUR|ttf-mplus}} and Open Sans<br />
* {{AUR|ttf-monapo}} - Japanese fonts to show [[wikipedia:2channel_Shift_JIS_art|2channel Shift JIS art]] properly.<br />
* {{AUR|ttf-mplus}} - Modern Gothic style Japanese outline fonts. It includes all of Japanese Hiragana/Katakana, Basic Latin, Latin-1 Supplement, Latin Extended-A, IPA Extensions and most of Japanese Kanji, Greek, Cyrillic, Vietnamese with 7 weights (proportional) or 5 weights (monospace).<br />
* {{AUR|ttf-vlgothic}} - Japanese Gothic fonts. Default of Debian/Fedora/Vine Linux<br />
<br />
===== Korean =====<br />
<br />
* {{Pkg|adobe-source-han-sans-kr-fonts}} - Korean OpenType/CFF fonts<br />
* {{Pkg|ttf-baekmuk}} - Collection of Korean TrueType fonts<br />
* {{AUR|spoqa-han-sans}} - Source Han Sans customized by Spoqa<br />
* {{AUR|ttf-d2coding}} - D2Coding fixed width TrueType font made by Naver<br />
* {{AUR|ttf-nanum}} - Nanum series TrueType fonts<br />
* {{AUR|ttf-nanumgothic_coding}} - Nanum series fixed width TrueType fonts<br />
<br />
===== Vietnamese =====<br />
<br />
* {{Pkg|ttf-hannom}} - Vietnamese TrueType font for chữ Nôm characters<br />
<br />
==== Cyrillic ====<br />
<br />
See also [[#Latin script]].<br />
<br />
* {{AUR|ttf-paratype}} - Font family by ParaType: sans, serif, mono, extended cyrillic and latin, OFL license<br />
* {{AUR|otf-russkopis}} - A free OpenType cursive font for Cyrillic script<br />
<br />
==== Greek ====<br />
<br />
Almost all Unicode fonts contain the Greek character set (polytonic included). Some additional font packages, which might not contain the complete Unicode set but utilize high quality Greek (and Latin, of course) typefaces are:<br />
<br />
* {{AUR|otf-gfs}} - Selection of OpenType fonts from the Greek Font Society<br />
* {{AUR|ttf-mgopen}} - Professional TrueType fonts from Magenta<br />
<br />
==== Hebrew ====<br />
<br />
* {{AUR|culmus}} - Nice collection of free Hebrew fonts<br />
<br />
==== Indic ====<br />
<br />
* {{Pkg|ttf-freebanglafont}} - Font for Bangla<br />
* {{Pkg|ttf-indic-otf}} - Indic OpenType Fonts collection (containing ttf-freebanglafont), provides the character [http://www.fileformat.info/info/unicode/char/ca0/index.htm U+0CA0] "ಠ"<br />
* {{AUR|lohit-fonts}} - Indic TrueType fonts from Fedora Project (containing Oriya Fonts and more)<br />
* {{AUR|ttf-devanagarifonts}} - Devanagari TrueType fonts (contains 283 fonts)<br />
* {{AUR|ttf-gurmukhi-fonts_sikhnet}} - TrueType Gurmukhi fonts (gurbaniwebthick,prabhki)<br />
* {{AUR|ttf-gurmukhi_punjabi}} - TTF Gurmukhi / Punjabi (contains 252 fonts)<br />
* {{AUR|ttf-gujrati-fonts}} - TTF Gujarati fonts (Avantika,Gopika,Shree768)<br />
* {{AUR|ttf-kannada-font}} - Kannada, the language of Karnataka state in India<br />
* {{AUR|ttf-lklug}} - Sinhala Unicode font<br />
* {{AUR|ttf-tamil}} - Tamil Unicode fonts<br />
* {{AUR|ttf-urdufonts}} - Urdu fonts (Jameel Noori Nastaleeq (+kasheeda), Nafees Web Naskh, PDMS Saleem Quran Font) and font configuration to set Jameel Noori Nastaleeq as default font for Urdu<br />
<br />
==== Khmer ====<br />
<br />
* {{Pkg|ttf-khmer}} - Font covering glyphs for Khmer language<br />
* [https://www.google.com/fonts/specimen/Hanuman Hanuman] ({{AUR|ttf-google-fonts-git}})<br />
<br />
==== Mongolic and Tungusic ====<br />
<br />
* {{AUR|ttf-abkai}} - Fonts for Sibe, Manchu and Daur scripts (incomplete, currently in development)<br />
<br />
==== Persian ====<br />
<br />
* {{AUR|persian-fonts}} - Meta package for installing all Persian fonts in AUR.<br />
* {{AUR|borna-fonts}} - Borna Rayaneh Co. Persian B font series.<br />
* {{AUR|iran-nastaliq-fonts}} - A free Unicode calligraphic Persian font.<br />
* {{AUR|iranian-fonts}} - Iranian-Sans and Iranian-Serif Persian font family.<br />
* {{AUR|ir-standard-fonts}} - Iran Supreme Council of Information and Communication Technology (SCICT) standard Persian fonts.<br />
* {{AUR|persian-hm-ftx-fonts}} - A Persian font series derived from X Series 2, Metafont and FarsiTeX fonts with Kashida feature.<br />
* {{AUR|persian-hm-xs2-fonts}} - A Persian font series derived from X Series 2 fonts with Kashida feature.<br />
* {{AUR|sina-fonts}} - Sina Pardazesh Co. Persian font series.<br />
* {{AUR|gandom-fonts}}, {{AUR|parastoo-fonts}}, {{AUR|sahel-fonts}}, {{AUR|samim-fonts}}, {{AUR|shabnam-fonts}}, {{AUR|tanha-fonts}}, {{AUR|vazir-fonts}}, {{AUR|vazir-code-fonts}} - Beautiful Persian fonts made by Ali Rasti Kerdar.<br />
* {{AUR|ttf-yas}} - The Yas Persian font series (with '''hollow zero''').<br />
* {{AUR|ttf-x2}} - Free fonts with support for Persian, Arabic, Urdu, Pashto, Dari, Uzbek, Kurdish, Uighur, old Turkish (Ottoman) and modern Turkish (Roman).<br />
<br />
==== Tai–Kadai ====<br />
<br />
* {{Pkg|fonts-tlwg}} - Collection of scalable Thai fonts<br />
* {{AUR|ttf-lao}} - Lao TTF font (Phetsarath_OT)<br />
* {{AUR|ttf-lao-fonts}} - Lao TTF fonts, both Unicode and non-Unicode for Windows<br />
<br />
==== Tibeto-Burman ====<br />
<br />
* {{Pkg|ttf-tibetan-machine}} - Tibetan Machine TTFont<br />
* {{AUR|ttf-myanmar-fonts}} - 121 Fonts from myordbok.com<br />
<br />
=== Emoji and symbols ===<br />
<br />
A section of the Unicode standard is designated for pictographic characters called "emoji".<br />
<br />
* {{Pkg|noto-fonts-emoji}} - Google's own emoji font, like on Android or Google Hangouts.<br />
* {{Pkg|ttf-symbola}} - provides many Unicode symbols, including emoji, in outline style.<br />
* {{AUR|ttf-emojione-color}} - a color and B&W emoji SVGinOT font built from EmojiOne.<br />
* {{AUR|ttf-twemoji-color}} - Twitter's open-sourced emoji glyphs.<br />
<br />
[[wikipedia:Emoticon#Japanese_style|Kaomoji]] are sometimes referred to as "Japanese emoticons" and are composed of characters from various character sets, including CJK and Indic fonts. For example, the following set of packages covers most of existing kaomoji: {{Pkg|ttf-freefont}}, {{Pkg|ttf-arphic-uming}}, and {{Pkg|ttf-indic-otf}}.<br />
<br />
To enable emoji fonts add 'Emoji' generic family as fallback for main font families by adding this to your [[Font configuration]]:<br />
<br />
{{hc|/etc/fonts/local.conf|<nowiki><?xml version="1.0" encoding="UTF-8"?><br />
<!DOCTYPE fontconfig SYSTEM "fonts.dtd"><br />
<fontconfig><br />
<match><br />
<test name="family"><br />
<string>serif</string><br />
</test><br />
<edit name="family" mode="prepend" binding="weak"><br />
<string>Emoji</string><br />
</edit><br />
</match><br />
<br />
<match><br />
<test name="family"><br />
<string>sans-serif</string><br />
</test><br />
<edit name="family" mode="prepend" binding="weak"><br />
<string>Emoji</string><br />
</edit><br />
</match><br />
<br />
<match><br />
<test name="family"><br />
<string>monospace</string><br />
</test><br />
<edit name="family" mode="prepend" binding="weak"><br />
<string>Emoji</string><br />
</edit><br />
</match><br />
</fontconfig></nowiki>}}<br />
<br />
=== Math ===<br />
<br />
* {{Pkg|font-mathematica}} - Mathematica fonts by Wolfram Research, Inc.<br />
* {{Pkg|texlive-core}} and {{Pkg|texlive-fontsextra}} contain many math fonts such as Latin Modern Math and [[Wikipedia:STIX Fonts project|STIX Fonts]]. See [[TeX Live#Fonts]] for configuration.<br />
* {{AUR|otf-stix}} - A standalone, more recent version of STIX<br />
* {{AUR|otf-latin-modern}}, {{AUR|otf-latinmodern-math}} - Improved version of Computer Modern fonts as used in LaTeX<br />
* {{AUR|ttf-computer-modern-fonts}}, {{AUR|otf-cm-unicode}} - [[wikipedia:Computer Modern|Computer Modern]] (of TeX fame)<br />
* {{AUR|ttf-mathtype}} - MathType fonts<br />
<br />
=== Other operating system fonts ===<br />
<br />
* {{AUR|ttf-mac-fonts}} - Apple MacOS TrueType fonts<br />
<br />
See [[Metric-compatible fonts]], which lists available alternatives for [[Microsoft fonts]].<br />
<br />
== Fallback font order with X11 ==<br />
<br />
Fontconfig automatically chooses a font that matches the current requirement. That is to say, if one is looking at a window containing English and Chinese for example, it will switch to another font for the Chinese text if the default one does not support it.<br />
<br />
Fontconfig lets every user configure the order they want via {{ic|$XDG_CONFIG_HOME/fontconfig/fonts.conf}}.<br />
If you want a particular Chinese font to be selected after your favorite Serif font, your file would look like this:<br />
<br />
<?xml version="1.0"?><br />
<!DOCTYPE fontconfig SYSTEM "fonts.dtd"><br />
<fontconfig><br />
<alias><br />
<family>serif</family><br />
<prefer><br />
<family>Your favorite Latin Serif font name</family><br />
<family>Your Chinese font name</family><br />
</prefer><br />
</alias><br />
</fontconfig><br />
<br />
{{Tip|If you use a Chinese locale, set {{ic|LC_LANG}} to {{ic|und}} to make this work. Otherwise both English and Chinese text will be rendered in the Chinese font.}}<br />
<br />
You can add a section for sans-serif and monospace as well. For more informations, have a look at the fontconfig manual.<br />
<br />
See also [[Font configuration#Replace or set default fonts]].<br />
<br />
== Font alias ==<br />
<br />
There are several font aliases which represent other fonts in order that applications may use similar fonts. The most common aliases are: {{ic|serif}} for a font of the serif type (e.g. DejaVu Serif); {{ic|sans-serif}} for a font of the sans-serif type (e.g. DejaVu Sans); and {{ic|monospace}} for a monospaced font (e.g. DejaVu Sans Mono). However, the fonts which these aliases represent may vary and the relationship is often not shown in font management tools, such as those found in [[KDE]] and other [[desktop environments]].<br />
<br />
To reverse an alias and find which font it is representing, run:<br />
<br />
{{hc|$ fc-match monospace|<br />
DejaVuSansMono.ttf: "DejaVu Sans Mono" "Book"<br />
}}<br />
<br />
In this case, {{ic|DejaVuSansMono.ttf}} is the font represented by the monospace alias.<br />
<br />
== Tips and tricks ==<br />
<br />
=== List all installed fonts ===<br />
<br />
You can use the following command to list all installed Fontconfig fonts that are available on your system. <br />
<br />
$ fc-list<br />
<br />
=== Lists installed fonts for a particular language ===<br />
<br />
Applications and browsers select and display fonts depending upon fontconfig preferences and available font glyph for Unicode text. To list installed fonts for a particular language, issue a command {{ic|<nowiki>fc-list :lang="two letter language code"</nowiki>}}. For instance, to list installed Arabic fonts or fonts supporting Arabic glyph:<br />
{{hc|$ fc-list -f '%{file}\n' :lang&#61;ar|2=<br />
<nowiki><br />
/usr/share/fonts/TTF/FreeMono.ttf<br />
/usr/share/fonts/TTF/DejaVuSansCondensed.ttf<br />
/usr/share/fonts/truetype/custom/DroidKufi-Bold.ttf<br />
/usr/share/fonts/TTF/DejaVuSansMono.ttf<br />
/usr/share/fonts/TTF/FreeSerif.ttf<br />
</nowiki><br />
}}<br />
<br />
=== Set terminal font on-the-fly ===<br />
<br />
{{Expansion|Which terminals specifically support this method? Where is the documentation for the escape codes?}}<br />
<br />
For terminal emulators that use {{ic|Xresources}}, fonts can be set by using escape sequences. Specifically, {{ic|echo -e "\033]710;$font\007"}} to change the normal font ({{ic|*font}} in {{ic|~/.Xresources}}), and replace {{ic|710}} with {{ic|711}}, {{ic|712}}, and {{ic|713}} to change the {{ic|*boldFont}}, {{ic|*italicFont}}, and {{ic|*boldItalicFont}}, respectively.<br />
<br />
{{ic|$font}} uses the same syntax as in {{ic|~/.Xresources}} and can be anything the terminal emulator will support. (Example: {{ic|1=xft:dejavu sans mono:size=9}})<br />
<br />
=== Application-specific font cache ===<br />
<br />
Matplotlib ({{pkg|python-matplotlib}} or {{pkg|python2-matplotlib}}) uses its own font cache, so after updating fonts, be sure to remove {{ic|~/.matplotlib/fontList.cache}}, <br />
{{ic|~/.cache/matplotlib/fontList.cache}}, {{ic|~/.sage/matplotlib-1.2.1/fontList.cache}}, etc. so it will regenerate its cache and find the new fonts [http://matplotlib.1069221.n5.nabble.com/getting-matplotlib-to-recognize-a-new-font-td40500.html].<br />
<br />
== See also ==<br />
<br />
* [http://behdad.org/text/ State of Text Rendering]<br />
* [https://fontlibrary.org/en Font Library] - Fonts under Free licenses<br />
* [https://screenshots.debian.net/packages?search=fonts&show=with Fonts on screenshots.debian.net]</div>J99https://wiki.archlinux.org/index.php?title=General_recommendations&diff=512825General recommendations2018-03-05T19:30:02Z<p>J99: /* Fonts */ phrasing</p>
<hr />
<div>[[Category:Getting and installing Arch]]<br />
[[cs:General recommendations]]<br />
[[el:General recommendations]]<br />
[[es:General recommendations]]<br />
[[fa:توصیههای عمومی]]<br />
[[it:General recommendations]]<br />
[[ja:一般的な推奨事項]]<br />
[[ko:General recommendations]]<br />
[[pl:General recommendations]]<br />
[[pt:General recommendations]]<br />
[[ro:Recomandări generale]]<br />
[[ru:General recommendations]]<br />
[[zh-hans:General recommendations]]<br />
[[zh-hant:General recommendations]]<br />
{{Related articles start}}<br />
{{Related|FAQ}}<br />
{{Related|Installation guide}}<br />
{{Related|List of applications}}<br />
{{Related articles end}}<br />
<br />
This document is an annotated index of popular articles and important information for improving and adding functionalities to the installed Arch system. Readers are assumed to have read and followed the [[Installation guide]] to obtain a basic Arch Linux installation. Having read and understood the concepts explained in [[#System administration]] and [[#Package management]] is ''required'' for following the other sections of this page and the other articles in the wiki.<br />
<br />
== System administration ==<br />
<br />
This section deals with administrative tasks and system management. For more, please see [[Core utilities]] and [[:Category:System administration]].<br />
<br />
=== Users and groups ===<br />
<br />
A new installation leaves you with only the superuser account, better known as "root". Logging in as root for prolonged periods of time, possibly even exposing it via [[SSH]] on a server, [https://apple.stackexchange.com/questions/192365/is-it-ok-to-use-the-root-user-as-a-normal-user/192422#192422 is insecure]. Instead, you should create and use unprivileged user account(s) for most tasks, only using the root account for system administration. See [[Users and groups#User management]] for details.<br />
<br />
Users and groups are a mechanism for ''access control''; administrators may fine-tune group membership and ownership to grant or deny users and services access to system resources. Read the [[Users and groups]] article for details and potential security risks.<br />
<br />
=== Privilege escalation ===<br />
<br />
Both the [[su]] and [[sudo]] commands allow you to run commands as another user. By default ''su'' drops you to a login shell as the root user, and ''sudo'' by default temporarily grants you root privileges for a single command. See their respective articles for differences.<br />
<br />
=== Service management ===<br />
<br />
Arch Linux uses [[systemd]] as the [[init]] process, which is a system and service manager for Linux. For maintaining your Arch Linux installation, it is a good idea to learn the basics about it. Interaction with ''systemd'' is done through the ''systemctl'' command. Read [[systemd#Basic systemctl usage]] for more information.<br />
<br />
=== System maintenance ===<br />
<br />
Arch is a rolling release system and has rapid package turnover, so users have to take some time to do [[system maintenance]]. Read [[Security]] for recommendations and best practices on hardening the system.<br />
<br />
== Package management ==<br />
<br />
This section contains helpful information related to package management. For more, please see [[FAQ#Package management]] and [[:Category:Package management]].<br />
<br />
{{Note|It is imperative to keep up to date with changes in Arch Linux that require manual intervention '''before''' upgrading your system. Subscribe to the [https://mailman.archlinux.org/mailman/listinfo/arch-announce/ arch-announce mailing list] or check the front page [https://www.archlinux.org/ Arch news] every time before you update. Alternatively, you may find it useful to subscribe to [https://www.archlinux.org/feeds/news/ this RSS feed] or follow [https://twitter.com/archlinux @archlinux] on Twitter.}}<br />
<br />
=== pacman ===<br />
<br />
[[pacman]] is the Arch Linux ''pac''kage ''man''ager: all users are required to become familiar with it before reading any other articles.<br />
<br />
See [[pacman/Tips and tricks]] for suggestions on how to improve your interaction with ''pacman'' and package management in general.<br />
<br />
=== Repositories ===<br />
<br />
See [[Official repositories]] for details about the purpose of each officially maintained repository.<br />
<br />
If you plan on using 32-bit applications, you will want to enable the [[multilib]] repository. <br />
<br />
[[Unofficial user repositories]] lists several other unsupported repositories.<br />
<br />
You may consider installing the [[pkgstats]] service.<br />
<br />
=== Mirrors ===<br />
<br />
Visit [[Mirrors]] for steps on taking full advantage of using the fastest and most up to date mirrors of the official repositories. As explained in the article, a particularly good advice is to routinely check the [https://www.archlinux.org/mirrors/status/ Mirror Status] page for a list of mirrors that have been recently synced.<br />
<br />
=== Arch Build System ===<br />
<br />
''Ports'' is a system initially used by BSD distributions consisting of build scripts that reside in a directory tree on the local system. Simply put, each port contains a script within a directory intuitively named after the installable third-party application.<br />
<br />
The [[Arch Build System]] offers the same functionality by providing build scripts called [[PKGBUILD]]s, which are populated with information for a given piece of software; integrity hashes, project URL, version, license and build instructions. These PKGBUILDs are later parsed by [[makepkg]], the actual program that generates packages cleanly manageable by ''pacman''.<br />
<br />
Every package in the repositories along with those present in the AUR are subject to recompilation with ''makepkg''.<br />
<br />
=== Arch User Repository ===<br />
<br />
While the Arch Build System allows the ability of building software available in the official repositories, the [[Arch User Repository]] (AUR) is the equivalent for user submitted packages. It is an unsupported repository of build scripts accessible through the [https://aur.archlinux.org/ web interface] or through [[AurJson]].<br />
<br />
== Booting ==<br />
<br />
This section contains information pertaining to the boot process. An overview of the Arch boot process can be found at [[Arch boot process]]. For more, please see [[:Category:Boot process]].<br />
<br />
=== Hardware auto-recognition ===<br />
<br />
Hardware should be auto-detected by [[udev]] during the boot process by default. A potential improvement in boot time can be achieved by disabling module auto-loading and specifying required modules manually, as described in [[Kernel modules]]. Additionally, [[Xorg]] should be able to auto-detect required drivers using {{ic|udev}}, but users have the option to configure the X server manually too.<br />
<br />
=== Microcode ===<br />
<br />
Processors may have [http://www.anandtech.com/show/8376/intel-disables-tsx-instructions-erratum-found-in-haswell-haswelleep-broadwelly faulty behaviour], which the kernel can correct by updating the ''microcode'' on startup. Intel processors require a separate package to this effect. See [[Microcode]] for details.<br />
<br />
=== Retaining boot messages ===<br />
<br />
Once it concludes, the screen is cleared and the login prompt appears, leaving users unable to gather feedback from the boot process. [[Disable clearing of boot messages]] to overcome this limitation.<br />
<br />
=== Num Lock activation ===<br />
<br />
Num Lock is a toggle key found in most keyboards. For activating Num Lock's number key-assignment during startup, see [[Activating Numlock on Bootup]].<br />
<br />
== Graphical user interface ==<br />
<br />
This section provides orientation for users wishing to run graphical applications on their system. See [[:Category:X server]] for additional resources.<br />
<br />
=== Display server ===<br />
<br />
[[Xorg]] is the public, open-source implementation of the [[Wikipedia:X Window System|X Window System]] (commonly X11, or X). It is required for running applications with graphical user interfaces (GUIs), and the majority of users will want to install it.<br />
<br />
[[Wayland]] is a newer, alternative display server protocol and the Weston reference implementation is available.<br />
<br />
=== Display drivers ===<br />
<br />
The default ''vesa'' display driver will work with most video cards, but performance can be significantly improved and additional features harnessed by installing the appropriate driver for [[ATI]], [[Intel]], or [[NVIDIA]] products.<br />
<br />
=== Desktop environments ===<br />
<br />
Although Xorg provides the basic framework for building a graphical environment, additional components may be considered necessary for a complete user experience. [[Desktop environment]]s such as [[GNOME]], [[KDE]], [[LXDE]], and [[Xfce]] bundle together a wide range of ''X clients'', such as a window manager, panel, file manager, terminal emulator, text editor, icons, and other utilities. Users with less experience may wish to install a desktop environment for a more familiar environment. See [[:Category:Desktop environments]] for additional resources.<br />
<br />
=== Window managers ===<br />
<br />
A full-fledged desktop environment provides a complete and consistent graphical user interface, but tends to consume a considerable amount of system resources. Users seeking to maximize performance or otherwise simplify their environment may opt to install a [[window manager]] alone and hand-pick desired extras. Most desktop environments allow use of an alternative window manager as well. [[:Category:Dynamic WMs|Dynamic]], [[:Category:Stacking WMs|stacking]], and [[:Category:Tiling WMs|tiling]] window managers differ in their handling of window placement.<br />
<br />
=== Display manager ===<br />
<br />
Most desktop environments include a [[display manager]] for automatically starting the graphical environment and managing user logins. Users without a desktop environment can install one separately. Alternatively you may [[start X at login]] as a simple alternative to a display manager.<br />
<br />
== Power management ==<br />
<br />
This section may be of use to laptop owners or users otherwise seeking power management controls. For more, please see [[:Category:Power management]].<br />
<br />
See [[Power management]] for more general overview.<br />
<br />
=== ACPI events ===<br />
<br />
Users can configure how the system reacts to ACPI events such as pressing the power button or closing a laptop's lid. For the new (recommended) method using [[systemd]], see [[Power management#Power management with systemd|Power management with systemd]]. For the old method, see [[acpid]].<br />
<br />
=== CPU frequency scaling ===<br />
<br />
Modern processors can decrease their frequency and voltage to reduce heat and power consumption. Less heat leads to more quiet system and prolongs the life of hardware. See [[CPU frequency scaling]] for details.<br />
<br />
=== Laptops ===<br />
<br />
For articles related to portable computing along with model-specific installation guides, please see [[:Category:Laptops]]. For a general overview of laptop-related articles and recommendations, see [[Laptop]].<br />
<br />
=== Suspend and Hibernate ===<br />
<br />
See main article: [[Suspend and hibernate]].<br />
<br />
== Multimedia ==<br />
<br />
[[:Category:Multimedia]] includes additional resources.<br />
<br />
=== Sound ===<br />
<br />
[[Sound]] is provided by kernel sound drivers:<br />
<br />
* [[ALSA]] is included with the kernel and is recommended because usually it works out of the box (it just needs to be [[Advanced Linux Sound Architecture#Unmuting the channels|unmuted]]).<br />
<br />
* [[OSS]] is a viable alternative in case ALSA does not work.<br />
<br />
Users may additionally wish to install and configure a [[Sound system#Sound servers|sound server]] such as [[PulseAudio]]. For advanced audio requirements, see [[professional audio]].<br />
<br />
=== Browser plugins ===<br />
<br />
For access to certain web content, [[browser plugins]] such as Adobe Acrobat Reader, Adobe Flash Player, and Java can be installed.<br />
<br />
=== Codecs ===<br />
<br />
[[Codecs]] are utilized by multimedia applications to encode or decode audio or video streams. In order to play encoded streams, users must ensure an appropriate codec is installed.<br />
<br />
== Networking ==<br />
<br />
This section is confined to small networking procedures. Head over to [[Network configuration]] for a full guide. For more, please see [[:Category:Networking]].<br />
<br />
=== Clock synchronization ===<br />
<br />
The [[Wikipedia:Network Time Protocol|Network Time Protocol]] (NTP) is a protocol for synchronizing the clocks of computer systems over packet-switched, variable-latency data networks. See [[Time#Time synchronization]] for implementations of such protocol.<br />
<br />
=== DNS security ===<br />
<br />
For better security while browsing web, paying online, connecting to [[SSH]] services and similar tasks consider using [[DNSSEC]]-enabled client software which can validate signed [[Wikipedia:Domain Name System|DNS]] records, and [[DNSCrypt]] to encrypt DNS traffic.<br />
<br />
=== Setting up a firewall ===<br />
<br />
A firewall can provide an extra layer of protection on top of the Linux networking stack. While the stock Arch kernel is capable of using [[Wikipedia:Netfilter|Netfilter]]'s [[iptables]] and [[nftables]], neither are enabled by default. It is highly recommended to set up some form of firewall. See [[:Category:Firewalls]] for available guides.<br />
<br />
=== Resource sharing ===<br />
<br />
To share files among the machines in a network, follow the [[NFS]] or the [[SSHFS]] article.<br />
<br />
Use [[Samba]] to join a Windows network. To configure the machine to use Active Directory for authentication, read [[Active Directory Integration]].<br />
<br />
See also [[:Category:Network sharing]].<br />
<br />
== Input devices ==<br />
<br />
This section contains popular input device configuration tips. For more, please see [[:Category:Input devices]].<br />
<br />
=== Keyboard layouts ===<br />
<br />
Non-English or otherwise non-standard keyboards may not function as expected by default. The necessary steps to configure the keymap are different for virtual console and [[Xorg]], they are described in [[Keyboard configuration in console]] and [[Keyboard configuration in Xorg]] respectively.<br />
<br />
=== Mouse buttons ===<br />
<br />
Owners of advanced or unusual mice may find that not all mouse buttons are recognized by default, or may wish to assign different actions for extra buttons. Instructions can be found in [[Mouse buttons]].<br />
<br />
=== Laptop touchpads ===<br />
<br />
Many laptops use [https://www.synaptics.com/ Synaptics] or [http://www.alps.com/ ALPS] "touchpad" pointing devices. For these, and several other touchpad models, you can use either the Synaptics input driver or libinput; see [[Touchpad Synaptics]] and [[libinput]] for installation and configuration details.<br />
<br />
=== TrackPoints ===<br />
<br />
See the [[TrackPoint]] article to configure your TrackPoint device.<br />
<br />
== Optimization ==<br />
<br />
This section aims to summarize tweaks, tools and available options useful to improve system and application performance.<br />
<br />
=== Benchmarking ===<br />
<br />
[[Benchmarking]] is the act of measuring performance and comparing the results to another system's results or a widely accepted standard through a unified procedure.<br />
<br />
=== Improving performance ===<br />
<br />
The [[Improving performance]] article gathers information and is a basic rundown about gaining performance in Arch Linux.<br />
<br />
=== Solid state drives ===<br />
<br />
The [[Solid State Drives]] article covers many aspects of solid state drives, including configuring them to maximize their lifetimes.<br />
<br />
== System service ==<br />
<br />
This section relates to [[daemons]]. For more, please see [[:Category:Daemons and system services]].<br />
<br />
=== File index and search ===<br />
<br />
Most distributions have a ''locate'' command available to be able to quickly search for files. To get this functionality in Arch Linux, {{Pkg|mlocate}} is the recommended install. After the install you should run ''updatedb'' to index the filesystems.<br />
<br />
[[List of applications/Utilities#Finders|Desktop search engines]] provide a similar service, while better integrated into [[desktop environment]]s.<br />
<br />
=== Local mail delivery ===<br />
<br />
A default setup does not provide a way to sync mail. To configure ''Postfix'' for simple local mailbox delivery, see [[Postfix]]. Other options are [[SSMTP]], [[msmtp]] and [[fdm]].<br />
<br />
=== Printing ===<br />
<br />
[[CUPS]] is a standards-based, open source printing system developed by Apple. See [[:Category:Printers]] for printer-specific articles.<br />
<br />
== Appearance ==<br />
<br />
This section contains frequently-sought "eye candy" tweaks for an aesthetically pleasing Arch experience. For more, please see [[:Category:Eye candy]].<br />
<br />
=== Fonts ===<br />
<br />
You may wish to install a set of TrueType fonts, as only unscalable bitmap fonts are included in a basic Arch system. The {{Pkg|ttf-dejavu}} package provides a set of high quality, general-purpose fonts with good [[Wikipedia:Unicode|Unicode]] coverage. The {{pkg|ttf-liberation}} font set provides freely licensed substitutes that are metrically compatible with numerous fonts from Monotype Imaging, the latter of which are commonly used in the Microsoft ecosystem.<br />
<br />
A plethora of information on the subject can be found in the [[Fonts]] and [[Font configuration]] articles.<br />
<br />
If spending a significant amount of time working from the virtual console (i.e. outside an X server), users may wish to change the console font to improve readability; see [[Fonts#Console fonts]].<br />
<br />
=== GTK+ and Qt themes ===<br />
<br />
A big part of the applications with a graphical interface for Linux systems are based on the [[GTK+]] or the [[Qt]] toolkits. See those articles and [[Uniform look for Qt and GTK applications]] for ideas to improve the appearance of your installed programs and adapt it to your liking.<br />
<br />
== Console improvements ==<br />
<br />
This section applies to small modifications that better console programs' practicality. For more, please see [[:Category:Command shells]].<br />
<br />
=== Aliases ===<br />
<br />
Aliasing a command, or a group thereof, is a way of saving time when using the console. This is specially helpful for repetitive tasks that do not need significant alteration to their parameters between executions. Common time-saving aliases can be found in [[Bash#Aliases]], which are easily portable to [[zsh]] as well.<br />
<br />
=== Alternative shells ===<br />
<br />
[[Bash]] is the shell that is installed by default in an Arch system. The live installation media, however, uses [[zsh]] with the {{Pkg|grml-zsh-config}} addon package. See [[Command-line shell#List of shells]] for more alternatives.<br />
<br />
=== Bash additions ===<br />
<br />
A list of miscellaneous Bash settings, including completion enhancements, history search and [[Readline]] macros is available in [[Bash#Tips and tricks]].<br />
<br />
=== Colored output ===<br />
<br />
This section is covered in [[Color output in console]].<br />
<br />
=== Compressed files ===<br />
<br />
Compressed files, or archives, are frequently encountered on a GNU/Linux system. [[Tar]] is one of the most commonly used archiving tools, and users should be familiar with its syntax (Arch Linux packages, for example, are simply xzipped tarballs). See [[Bash/Functions]] for other helpful commands.<br />
<br />
=== Console prompt ===<br />
<br />
The console prompt (PS1) can be customized to a great extent. See [[Bash/Prompt customization]] or [[Zsh#Prompts]] if using Bash or Zsh, respectively.<br />
<br />
=== Emacs shell ===<br />
<br />
Emacs is known for featuring options beyond the duties of regular text editing, one of these being a full shell replacement. Consult [[Emacs#Colored output issues]] for a fix regarding garbled characters that may result from enabling colored output.<br />
<br />
=== Mouse support ===<br />
<br />
Using a mouse with the console for copy-paste operations can be preferred over [[GNU Screen]]'s traditional copy mode. Refer to [[Console mouse support]] for comprehensive directions. Note that you can already do this in [[terminal emulators]] with the [[clipboard]].<br />
<br />
=== Scrollback buffer ===<br />
<br />
To be able to save and view text which has scrolled off the screen, refer to [[General troubleshooting#Scrollback]].<br />
<br />
=== Session management ===<br />
<br />
Using terminal multiplexers like [[tmux]] or [[GNU Screen]], programs may be run under sessions composed of tabs and panes that can be detached at will, so when the user either kills the terminal emulator, terminates [[X]], or logs off, the programs associated with the session will continue to run in the background as long as the terminal multiplexer server is active. Interacting with the programs requires reattaching to the session.</div>J99https://wiki.archlinux.org/index.php?title=General_recommendations&diff=512823General recommendations2018-03-05T19:29:08Z<p>J99: /* Fonts */ Add ttf-liberation</p>
<hr />
<div>[[Category:Getting and installing Arch]]<br />
[[cs:General recommendations]]<br />
[[el:General recommendations]]<br />
[[es:General recommendations]]<br />
[[fa:توصیههای عمومی]]<br />
[[it:General recommendations]]<br />
[[ja:一般的な推奨事項]]<br />
[[ko:General recommendations]]<br />
[[pl:General recommendations]]<br />
[[pt:General recommendations]]<br />
[[ro:Recomandări generale]]<br />
[[ru:General recommendations]]<br />
[[zh-hans:General recommendations]]<br />
[[zh-hant:General recommendations]]<br />
{{Related articles start}}<br />
{{Related|FAQ}}<br />
{{Related|Installation guide}}<br />
{{Related|List of applications}}<br />
{{Related articles end}}<br />
<br />
This document is an annotated index of popular articles and important information for improving and adding functionalities to the installed Arch system. Readers are assumed to have read and followed the [[Installation guide]] to obtain a basic Arch Linux installation. Having read and understood the concepts explained in [[#System administration]] and [[#Package management]] is ''required'' for following the other sections of this page and the other articles in the wiki.<br />
<br />
== System administration ==<br />
<br />
This section deals with administrative tasks and system management. For more, please see [[Core utilities]] and [[:Category:System administration]].<br />
<br />
=== Users and groups ===<br />
<br />
A new installation leaves you with only the superuser account, better known as "root". Logging in as root for prolonged periods of time, possibly even exposing it via [[SSH]] on a server, [https://apple.stackexchange.com/questions/192365/is-it-ok-to-use-the-root-user-as-a-normal-user/192422#192422 is insecure]. Instead, you should create and use unprivileged user account(s) for most tasks, only using the root account for system administration. See [[Users and groups#User management]] for details.<br />
<br />
Users and groups are a mechanism for ''access control''; administrators may fine-tune group membership and ownership to grant or deny users and services access to system resources. Read the [[Users and groups]] article for details and potential security risks.<br />
<br />
=== Privilege escalation ===<br />
<br />
Both the [[su]] and [[sudo]] commands allow you to run commands as another user. By default ''su'' drops you to a login shell as the root user, and ''sudo'' by default temporarily grants you root privileges for a single command. See their respective articles for differences.<br />
<br />
=== Service management ===<br />
<br />
Arch Linux uses [[systemd]] as the [[init]] process, which is a system and service manager for Linux. For maintaining your Arch Linux installation, it is a good idea to learn the basics about it. Interaction with ''systemd'' is done through the ''systemctl'' command. Read [[systemd#Basic systemctl usage]] for more information.<br />
<br />
=== System maintenance ===<br />
<br />
Arch is a rolling release system and has rapid package turnover, so users have to take some time to do [[system maintenance]]. Read [[Security]] for recommendations and best practices on hardening the system.<br />
<br />
== Package management ==<br />
<br />
This section contains helpful information related to package management. For more, please see [[FAQ#Package management]] and [[:Category:Package management]].<br />
<br />
{{Note|It is imperative to keep up to date with changes in Arch Linux that require manual intervention '''before''' upgrading your system. Subscribe to the [https://mailman.archlinux.org/mailman/listinfo/arch-announce/ arch-announce mailing list] or check the front page [https://www.archlinux.org/ Arch news] every time before you update. Alternatively, you may find it useful to subscribe to [https://www.archlinux.org/feeds/news/ this RSS feed] or follow [https://twitter.com/archlinux @archlinux] on Twitter.}}<br />
<br />
=== pacman ===<br />
<br />
[[pacman]] is the Arch Linux ''pac''kage ''man''ager: all users are required to become familiar with it before reading any other articles.<br />
<br />
See [[pacman/Tips and tricks]] for suggestions on how to improve your interaction with ''pacman'' and package management in general.<br />
<br />
=== Repositories ===<br />
<br />
See [[Official repositories]] for details about the purpose of each officially maintained repository.<br />
<br />
If you plan on using 32-bit applications, you will want to enable the [[multilib]] repository. <br />
<br />
[[Unofficial user repositories]] lists several other unsupported repositories.<br />
<br />
You may consider installing the [[pkgstats]] service.<br />
<br />
=== Mirrors ===<br />
<br />
Visit [[Mirrors]] for steps on taking full advantage of using the fastest and most up to date mirrors of the official repositories. As explained in the article, a particularly good advice is to routinely check the [https://www.archlinux.org/mirrors/status/ Mirror Status] page for a list of mirrors that have been recently synced.<br />
<br />
=== Arch Build System ===<br />
<br />
''Ports'' is a system initially used by BSD distributions consisting of build scripts that reside in a directory tree on the local system. Simply put, each port contains a script within a directory intuitively named after the installable third-party application.<br />
<br />
The [[Arch Build System]] offers the same functionality by providing build scripts called [[PKGBUILD]]s, which are populated with information for a given piece of software; integrity hashes, project URL, version, license and build instructions. These PKGBUILDs are later parsed by [[makepkg]], the actual program that generates packages cleanly manageable by ''pacman''.<br />
<br />
Every package in the repositories along with those present in the AUR are subject to recompilation with ''makepkg''.<br />
<br />
=== Arch User Repository ===<br />
<br />
While the Arch Build System allows the ability of building software available in the official repositories, the [[Arch User Repository]] (AUR) is the equivalent for user submitted packages. It is an unsupported repository of build scripts accessible through the [https://aur.archlinux.org/ web interface] or through [[AurJson]].<br />
<br />
== Booting ==<br />
<br />
This section contains information pertaining to the boot process. An overview of the Arch boot process can be found at [[Arch boot process]]. For more, please see [[:Category:Boot process]].<br />
<br />
=== Hardware auto-recognition ===<br />
<br />
Hardware should be auto-detected by [[udev]] during the boot process by default. A potential improvement in boot time can be achieved by disabling module auto-loading and specifying required modules manually, as described in [[Kernel modules]]. Additionally, [[Xorg]] should be able to auto-detect required drivers using {{ic|udev}}, but users have the option to configure the X server manually too.<br />
<br />
=== Microcode ===<br />
<br />
Processors may have [http://www.anandtech.com/show/8376/intel-disables-tsx-instructions-erratum-found-in-haswell-haswelleep-broadwelly faulty behaviour], which the kernel can correct by updating the ''microcode'' on startup. Intel processors require a separate package to this effect. See [[Microcode]] for details.<br />
<br />
=== Retaining boot messages ===<br />
<br />
Once it concludes, the screen is cleared and the login prompt appears, leaving users unable to gather feedback from the boot process. [[Disable clearing of boot messages]] to overcome this limitation.<br />
<br />
=== Num Lock activation ===<br />
<br />
Num Lock is a toggle key found in most keyboards. For activating Num Lock's number key-assignment during startup, see [[Activating Numlock on Bootup]].<br />
<br />
== Graphical user interface ==<br />
<br />
This section provides orientation for users wishing to run graphical applications on their system. See [[:Category:X server]] for additional resources.<br />
<br />
=== Display server ===<br />
<br />
[[Xorg]] is the public, open-source implementation of the [[Wikipedia:X Window System|X Window System]] (commonly X11, or X). It is required for running applications with graphical user interfaces (GUIs), and the majority of users will want to install it.<br />
<br />
[[Wayland]] is a newer, alternative display server protocol and the Weston reference implementation is available.<br />
<br />
=== Display drivers ===<br />
<br />
The default ''vesa'' display driver will work with most video cards, but performance can be significantly improved and additional features harnessed by installing the appropriate driver for [[ATI]], [[Intel]], or [[NVIDIA]] products.<br />
<br />
=== Desktop environments ===<br />
<br />
Although Xorg provides the basic framework for building a graphical environment, additional components may be considered necessary for a complete user experience. [[Desktop environment]]s such as [[GNOME]], [[KDE]], [[LXDE]], and [[Xfce]] bundle together a wide range of ''X clients'', such as a window manager, panel, file manager, terminal emulator, text editor, icons, and other utilities. Users with less experience may wish to install a desktop environment for a more familiar environment. See [[:Category:Desktop environments]] for additional resources.<br />
<br />
=== Window managers ===<br />
<br />
A full-fledged desktop environment provides a complete and consistent graphical user interface, but tends to consume a considerable amount of system resources. Users seeking to maximize performance or otherwise simplify their environment may opt to install a [[window manager]] alone and hand-pick desired extras. Most desktop environments allow use of an alternative window manager as well. [[:Category:Dynamic WMs|Dynamic]], [[:Category:Stacking WMs|stacking]], and [[:Category:Tiling WMs|tiling]] window managers differ in their handling of window placement.<br />
<br />
=== Display manager ===<br />
<br />
Most desktop environments include a [[display manager]] for automatically starting the graphical environment and managing user logins. Users without a desktop environment can install one separately. Alternatively you may [[start X at login]] as a simple alternative to a display manager.<br />
<br />
== Power management ==<br />
<br />
This section may be of use to laptop owners or users otherwise seeking power management controls. For more, please see [[:Category:Power management]].<br />
<br />
See [[Power management]] for more general overview.<br />
<br />
=== ACPI events ===<br />
<br />
Users can configure how the system reacts to ACPI events such as pressing the power button or closing a laptop's lid. For the new (recommended) method using [[systemd]], see [[Power management#Power management with systemd|Power management with systemd]]. For the old method, see [[acpid]].<br />
<br />
=== CPU frequency scaling ===<br />
<br />
Modern processors can decrease their frequency and voltage to reduce heat and power consumption. Less heat leads to more quiet system and prolongs the life of hardware. See [[CPU frequency scaling]] for details.<br />
<br />
=== Laptops ===<br />
<br />
For articles related to portable computing along with model-specific installation guides, please see [[:Category:Laptops]]. For a general overview of laptop-related articles and recommendations, see [[Laptop]].<br />
<br />
=== Suspend and Hibernate ===<br />
<br />
See main article: [[Suspend and hibernate]].<br />
<br />
== Multimedia ==<br />
<br />
[[:Category:Multimedia]] includes additional resources.<br />
<br />
=== Sound ===<br />
<br />
[[Sound]] is provided by kernel sound drivers:<br />
<br />
* [[ALSA]] is included with the kernel and is recommended because usually it works out of the box (it just needs to be [[Advanced Linux Sound Architecture#Unmuting the channels|unmuted]]).<br />
<br />
* [[OSS]] is a viable alternative in case ALSA does not work.<br />
<br />
Users may additionally wish to install and configure a [[Sound system#Sound servers|sound server]] such as [[PulseAudio]]. For advanced audio requirements, see [[professional audio]].<br />
<br />
=== Browser plugins ===<br />
<br />
For access to certain web content, [[browser plugins]] such as Adobe Acrobat Reader, Adobe Flash Player, and Java can be installed.<br />
<br />
=== Codecs ===<br />
<br />
[[Codecs]] are utilized by multimedia applications to encode or decode audio or video streams. In order to play encoded streams, users must ensure an appropriate codec is installed.<br />
<br />
== Networking ==<br />
<br />
This section is confined to small networking procedures. Head over to [[Network configuration]] for a full guide. For more, please see [[:Category:Networking]].<br />
<br />
=== Clock synchronization ===<br />
<br />
The [[Wikipedia:Network Time Protocol|Network Time Protocol]] (NTP) is a protocol for synchronizing the clocks of computer systems over packet-switched, variable-latency data networks. See [[Time#Time synchronization]] for implementations of such protocol.<br />
<br />
=== DNS security ===<br />
<br />
For better security while browsing web, paying online, connecting to [[SSH]] services and similar tasks consider using [[DNSSEC]]-enabled client software which can validate signed [[Wikipedia:Domain Name System|DNS]] records, and [[DNSCrypt]] to encrypt DNS traffic.<br />
<br />
=== Setting up a firewall ===<br />
<br />
A firewall can provide an extra layer of protection on top of the Linux networking stack. While the stock Arch kernel is capable of using [[Wikipedia:Netfilter|Netfilter]]'s [[iptables]] and [[nftables]], neither are enabled by default. It is highly recommended to set up some form of firewall. See [[:Category:Firewalls]] for available guides.<br />
<br />
=== Resource sharing ===<br />
<br />
To share files among the machines in a network, follow the [[NFS]] or the [[SSHFS]] article.<br />
<br />
Use [[Samba]] to join a Windows network. To configure the machine to use Active Directory for authentication, read [[Active Directory Integration]].<br />
<br />
See also [[:Category:Network sharing]].<br />
<br />
== Input devices ==<br />
<br />
This section contains popular input device configuration tips. For more, please see [[:Category:Input devices]].<br />
<br />
=== Keyboard layouts ===<br />
<br />
Non-English or otherwise non-standard keyboards may not function as expected by default. The necessary steps to configure the keymap are different for virtual console and [[Xorg]], they are described in [[Keyboard configuration in console]] and [[Keyboard configuration in Xorg]] respectively.<br />
<br />
=== Mouse buttons ===<br />
<br />
Owners of advanced or unusual mice may find that not all mouse buttons are recognized by default, or may wish to assign different actions for extra buttons. Instructions can be found in [[Mouse buttons]].<br />
<br />
=== Laptop touchpads ===<br />
<br />
Many laptops use [https://www.synaptics.com/ Synaptics] or [http://www.alps.com/ ALPS] "touchpad" pointing devices. For these, and several other touchpad models, you can use either the Synaptics input driver or libinput; see [[Touchpad Synaptics]] and [[libinput]] for installation and configuration details.<br />
<br />
=== TrackPoints ===<br />
<br />
See the [[TrackPoint]] article to configure your TrackPoint device.<br />
<br />
== Optimization ==<br />
<br />
This section aims to summarize tweaks, tools and available options useful to improve system and application performance.<br />
<br />
=== Benchmarking ===<br />
<br />
[[Benchmarking]] is the act of measuring performance and comparing the results to another system's results or a widely accepted standard through a unified procedure.<br />
<br />
=== Improving performance ===<br />
<br />
The [[Improving performance]] article gathers information and is a basic rundown about gaining performance in Arch Linux.<br />
<br />
=== Solid state drives ===<br />
<br />
The [[Solid State Drives]] article covers many aspects of solid state drives, including configuring them to maximize their lifetimes.<br />
<br />
== System service ==<br />
<br />
This section relates to [[daemons]]. For more, please see [[:Category:Daemons and system services]].<br />
<br />
=== File index and search ===<br />
<br />
Most distributions have a ''locate'' command available to be able to quickly search for files. To get this functionality in Arch Linux, {{Pkg|mlocate}} is the recommended install. After the install you should run ''updatedb'' to index the filesystems.<br />
<br />
[[List of applications/Utilities#Finders|Desktop search engines]] provide a similar service, while better integrated into [[desktop environment]]s.<br />
<br />
=== Local mail delivery ===<br />
<br />
A default setup does not provide a way to sync mail. To configure ''Postfix'' for simple local mailbox delivery, see [[Postfix]]. Other options are [[SSMTP]], [[msmtp]] and [[fdm]].<br />
<br />
=== Printing ===<br />
<br />
[[CUPS]] is a standards-based, open source printing system developed by Apple. See [[:Category:Printers]] for printer-specific articles.<br />
<br />
== Appearance ==<br />
<br />
This section contains frequently-sought "eye candy" tweaks for an aesthetically pleasing Arch experience. For more, please see [[:Category:Eye candy]].<br />
<br />
=== Fonts ===<br />
<br />
You may wish to install a set of TrueType fonts, as only unscalable bitmap fonts are included in a basic Arch system. The {{Pkg|ttf-dejavu}} package provides a set of high quality, general-purpose fonts with good [[Wikipedia:Unicode|Unicode]] coverage. The {{pkg|ttf-liberation}} font set provides freely licensed substitutes that are metrically compatible with numerous fonts from Monotype Imaging that are commonly used in the Microsoft ecosystem.<br />
<br />
A plethora of information on the subject can be found in the [[Fonts]] and [[Font configuration]] articles.<br />
<br />
If spending a significant amount of time working from the virtual console (i.e. outside an X server), users may wish to change the console font to improve readability; see [[Fonts#Console fonts]].<br />
<br />
=== GTK+ and Qt themes ===<br />
<br />
A big part of the applications with a graphical interface for Linux systems are based on the [[GTK+]] or the [[Qt]] toolkits. See those articles and [[Uniform look for Qt and GTK applications]] for ideas to improve the appearance of your installed programs and adapt it to your liking.<br />
<br />
== Console improvements ==<br />
<br />
This section applies to small modifications that better console programs' practicality. For more, please see [[:Category:Command shells]].<br />
<br />
=== Aliases ===<br />
<br />
Aliasing a command, or a group thereof, is a way of saving time when using the console. This is specially helpful for repetitive tasks that do not need significant alteration to their parameters between executions. Common time-saving aliases can be found in [[Bash#Aliases]], which are easily portable to [[zsh]] as well.<br />
<br />
=== Alternative shells ===<br />
<br />
[[Bash]] is the shell that is installed by default in an Arch system. The live installation media, however, uses [[zsh]] with the {{Pkg|grml-zsh-config}} addon package. See [[Command-line shell#List of shells]] for more alternatives.<br />
<br />
=== Bash additions ===<br />
<br />
A list of miscellaneous Bash settings, including completion enhancements, history search and [[Readline]] macros is available in [[Bash#Tips and tricks]].<br />
<br />
=== Colored output ===<br />
<br />
This section is covered in [[Color output in console]].<br />
<br />
=== Compressed files ===<br />
<br />
Compressed files, or archives, are frequently encountered on a GNU/Linux system. [[Tar]] is one of the most commonly used archiving tools, and users should be familiar with its syntax (Arch Linux packages, for example, are simply xzipped tarballs). See [[Bash/Functions]] for other helpful commands.<br />
<br />
=== Console prompt ===<br />
<br />
The console prompt (PS1) can be customized to a great extent. See [[Bash/Prompt customization]] or [[Zsh#Prompts]] if using Bash or Zsh, respectively.<br />
<br />
=== Emacs shell ===<br />
<br />
Emacs is known for featuring options beyond the duties of regular text editing, one of these being a full shell replacement. Consult [[Emacs#Colored output issues]] for a fix regarding garbled characters that may result from enabling colored output.<br />
<br />
=== Mouse support ===<br />
<br />
Using a mouse with the console for copy-paste operations can be preferred over [[GNU Screen]]'s traditional copy mode. Refer to [[Console mouse support]] for comprehensive directions. Note that you can already do this in [[terminal emulators]] with the [[clipboard]].<br />
<br />
=== Scrollback buffer ===<br />
<br />
To be able to save and view text which has scrolled off the screen, refer to [[General troubleshooting#Scrollback]].<br />
<br />
=== Session management ===<br />
<br />
Using terminal multiplexers like [[tmux]] or [[GNU Screen]], programs may be run under sessions composed of tabs and panes that can be detached at will, so when the user either kills the terminal emulator, terminates [[X]], or logs off, the programs associated with the session will continue to run in the background as long as the terminal multiplexer server is active. Interacting with the programs requires reattaching to the session.</div>J99https://wiki.archlinux.org/index.php?title=Securely_wipe_disk&diff=511926Securely wipe disk2018-02-24T19:30:42Z<p>J99: /* hdparm */ Mention article Solid State Drive/Memory cell clearing</p>
<hr />
<div>[[Category:Security]]<br />
[[Category:File systems]]<br />
[[ja:ディスクの完全消去]]<br />
{{Related articles start}}<br />
{{Related|Securely wipe disk/Tips and tricks}}<br />
{{Related|File recovery}}<br />
{{Related|Benchmarking/Data storage devices}}<br />
{{Related|Frandom}}<br />
{{Related|Disk encryption#Preparing the disk}}<br />
{{Related|dm-crypt}}<br />
{{Related articles end}}<br />
Wiping a disk is done by writing new data over every single bit.<br />
<br />
{{Note|References to "disks" in this article also apply to loopback devices.}}<br />
<br />
== Common use cases ==<br />
<br />
=== Wipe all data left on the device ===<br />
<br />
The most common usecase for completely and irrevocably wiping a device will be when the device is going to be given away or sold. There may be (unencrypted) data left on the device and you want to protect against simple forensic investigation that is mere child's play with for example [[File recovery]] software.<br />
<br />
If you want to quickly wipe everything from the disk, {{ic|/dev/zero}} or simple patterns allow maximum performance while adequate randomness can be advantageous in some cases that should be covered up in [[#Data remanence]].<br />
<br />
Every overwritten bit means to provide a level of data erasure not allowing recovery with normal system functions (like standard ATA/SCSI commands) and hardware interfaces. Any file recovery software mentioned above then would need to be specialized on proprietary storage-hardware features.<br />
<br />
In case of a HDD data recreation will not be possible without at least undocumented drive commands or fiddling about the device’s controller or firmware to make them read out for example reallocated sectors (bad blocks that [[S.M.A.R.T.]] retired from use).<br />
<br />
There are different wiping issues with different physical storage technologies, most notably all Flash memory based devices and older magnetic storage (old HDD's, floppy disks, tape).<br />
<br />
=== Preparations for block device encryption ===<br />
<br />
If you want to prepare your drive to securely set up [[Disk encryption#Block device encryption]] inside the wiped area afterwards you really should use [[#Random data]] generated by a trusted cryptographically strong random number generator (referred to as RNG in this article from now on).<br />
<br />
See also [[Wikipedia:Random number generation]].<br />
<br />
{{Warning|If Block device encryption is mapped on a partition that contains anything else than random/encrypted data, disclosure of usage patterns on the encrypted drive is possible and weakens the encryption being comparable with filesystem-level-encryption. Never use {{ic|/dev/zero}}, simple patterns (badblocks, eg.) or other unrandom data before setting up Block device encryption if you are serious about it!}}<br />
<br />
== Data remanence ==<br />
<br />
See also [[Wikipedia:Data remanence]].<br />
<br />
The residual representation of data may remain even after attempts have been made to remove or erase the data.<br />
<br />
Residual data may get wiped by writing (random) data to the disk with a single or even more than one iteration. However, more than one iteration may not significantly decrease the possibility to reconstruct the data of hard disk drives. See [[#Residual magnetism]]. <br />
<br />
=== Operating system, programs and filesystem ===<br />
<br />
The operating system, executed programs or [[Wikipedia:Journaling file system|journaling file system]]s may copy your unencrypted data throughout the block device. When writing to plain disks this should only be relevant in conjunction with one of the above.<br />
<br />
If the data can get exactly located on the disk and was never copied anywhere else, wiping with random data can be thoroughgoing and impressively quick as long there is enough entropy in the pool.<br />
<br />
A good example is cryptsetup using {{ic|/dev/urandom}} for [[Dm-crypt/Device encryption#Key management|wiping the LUKS keyslots]].<br />
<br />
=== Hardware-specific issues ===<br />
<br />
==== Flash memory ====<br />
<br />
[[Wikipedia:Write amplification|Write amplification]] and other characteristics make Flash memory (explicitly including SSDs) a stubborn target for reliable wiping.<br />
As there is a lot of transparent abstraction in between data as seen by a device's controller chip and the operating system sight data is never overwritten in place and wiping particular blocks or files is not reliable.<br />
<br />
Other "features" like transparent compression (all SandForce SSD's) can compress your /dev/zero or pattern stream so if wiping is fast beyond belief this might be the case.<br />
<br />
Disassembling Flash memory devices, unsoldering the chips and analyzing data content without the controller in between is feasible without difficulty using [http://www.flash-extractor.com/manual/reader_models/ simple hardware]. Data recovery companies do it for cheap money.<br />
<br />
For more information see:<br />
<br />
* [[SSD memory cell clearing]]<br />
* [http://www.usenix.org/events/fast11/tech/full_papers/Wei.pdf Reliably Erasing Data From Flash-Based Solid State Drives].<br />
* [[#Select a target]]<br />
==== Marked Bad Sectors ====<br />
<br />
If a hard drive marks a sector as bad, it cordons it off, and the section becomes impossible to write to via software. Thus a full overwrite would not reach it. However because of block sizes, these sections would only amount to a few theoretically recoverable KB.<br />
<br />
==== Residual magnetism ====<br />
<br />
A single, full overwrite with zeros or random data does not lead to any recoverable data on a modern high-density storage device.[http://www.howtogeek.com/115573/htg-explains-why-you-only-have-to-wipe-a-disk-once-to-erase-it/] Indications otherwise refer to single residual bits; reconstruction of byte patterns is generally not feasible.[https://web.archive.org/web/20120102004746/http://www.h-online.com/newsticker/news/item/Secure-deletion-a-single-overwrite-will-do-it-739699.html] See also [https://www.google.com/search?tbs=bks:1&q=isbn:9783540898610], [http://security.stackexchange.com/questions/26132/is-data-remanence-a-myth/26134#26134] and [http://www.nber.org/sys-admin/overwritten-data-guttman.html].<br />
<br />
== Select a target ==<br />
<br />
{{Note|Fdisk will not work on [[GPT]] formatted devices. Use gdisk ({{Pkg|gptfdisk}}) instead.}}<br />
Use fdisk to locate all read/write devices the user has read acess to.<br />
<br />
Check the output for lines that start with devices such as {{ic|/dev/sd"X"}}.<br />
<br />
This is an example for a HDD formatted to boot a linux system:<br />
<br />
{{hc|# fdisk -l|<nowiki>Disk /dev/sda: 250.1 GB, 250059350016 bytes, 488397168 sectors<br />
Units = sectors of 1 * 512 = 512 bytes<br />
Sector size (logical/physical): 512 bytes / 512 bytes<br />
I/O size (minimum/optimal): 512 bytes / 512 bytes<br />
Disk identifier: 0x00ff784a<br />
<br />
Device Boot Start End Blocks Id System<br />
/dev/sda1 * 2048 206847 102400 83 Linux<br />
/dev/sda2 206848 488397167 244095160 83 Linux</nowiki>}}<br />
<br />
Or the Arch Install Medium written to a 4GB USB thumb drive:<br />
<br />
{{hc|# fdisk -l|<nowiki>Disk /dev/sdb: 4075 MB, 4075290624 bytes, 7959552 sectors<br />
Units = sectors of 1 * 512 = 512 bytes<br />
Sector size (logical/physical): 512 bytes / 512 bytes<br />
I/O size (minimum/optimal): 512 bytes / 512 bytes<br />
Disk identifier: 0x526e236e<br />
<br />
Device Boot Start End Blocks Id System<br />
/dev/sdb1 * 0 802815 401408 17 Hidden HPFS/NTFS</nowiki>}}<br />
<br />
If you are worried about unintentional damage of important data on the primary computer, consider using an isolated environment such as a virtual environment (VirtualBox, VMWare, QEMU, etc...) with direct connected disk drives to it or a single computer only with a storage disk(s) that need to be wiped booted from a [[Archiso|Live Media]](USB, CD, PXE, etc...) or use a script to [[Securely wipe disk/Tips and tricks#Prevent wiping mounted partitions|prevent wiping mounted partitions by typo]].<br />
<br />
== Select a block size ==<br />
<br />
See also [[Wikipedia:Dd (Unix)#Block size]], [http://people.redhat.com/msnitzer/docs/io-limits.txt blocksize io-limits].<br />
<br />
If you have an [[Advanced Format]] hard drive it is recommended that you specify a block size larger than the default 512 bytes. To speed up the overwriting process choose a block size matching your drive's physical geometry by appending the block size option to the ''dd'' command (i.e. {{ic|<nowiki>bs=4096</nowiki>}} for 4KB).<br />
<br />
''fdisk'' prints physical and logical sector size for every disk. Alternatively sysfs does expose information:<br />
/sys/block/sdX/size<br />
/sys/block/sdX/queue/physical_block_size<br />
/sys/block/sdX/queue/logical_block_size<br />
/sys/block/sdX/sdXY/alignment_offset<br />
/sys/block/sdX/sdXY/start<br />
/sys/block/sdX/sdXY/size<br />
<br />
{{Warning|These methods show the block size the drive reports to the kernel. However, many Advanced Format drives incorrectly understate the physical block size as 512.}}<br />
<br />
{{Tip|This script helps to calculate parameters to wipe a device/partition with dd {{AUR|genwipe.sh}}, e.g.{{ic| genwipe.sh /dev/sd"XY"}}.}}<br />
<br />
=== Calculate blocks to wipe manually ===<br />
<br />
In the following the determination of the data area to wipe is done in an example. <br />
<br />
A block storage devices contains sectors and a size of a single sector that can be used to calculate the whole size of device in bytes. You can do it by multiplying sectors with size of the sector.<br />
<br />
As an example we use the parameters with the ''dd'' command to wipe a partition: <br />
<br />
# dd if=''data_source'' of=/dev/sd"X" bs=''sector_size'' count=''sector_number'' seek=''partitions_start_sector''<br />
<br />
Here you will see only a part of output of {{ic|fdisk -l /dev/sdX}} with root, showing the example partition information: <br />
<br />
{{bc|Device Boot Start End Sectors Size Id Type<br />
/dev/sd"XA" 2048 3839711231 3839709184 1,8T 83 Linux<br />
/dev/sd"XB" 3839711232 3907029167 67317936 32,1G 5 Extended<br />
}}<br />
<br />
The first line of the ''fdisk'' output shows the disk size in bytes and logical sectors:<br />
<br />
Disk /dev/sd"X": 1,8 TiB, 2000398934016 bytes, 3907029168 sectors<br />
<br />
To calculate size of a single logical sector use {{ic|echo $((2000398934016 / 3907029168))}} or use data from the second line of ''fdisk'' output:<br />
<br />
Units: sectors of 1 * 512 = 512 bytes<br />
<br />
To calculate physical sectors that will make it work faster we can use the third line:<br />
<br />
Sector size (logical/physical): 512 bytes / 4096 bytes<br />
<br />
To get disk size in the physical sectors you will need the known disk size in bytes divided with size of a single physical sector {{ic|echo $((2000398934016 / 4096))}}, you can get size of the storage device or partition on it even with the {{ic|blockdev --getsize64 /dev/sd"XY"}} command.<br />
<br />
{{Note|<br />
* In the examples below we will use the logical sector size.<br />
* You can even wipe unallocated disk space with a {{ic|dd}} command by calculating the difference between the end of one and start of the next partition.}}<br />
<br />
To wipe partition {{ic|/dev/sd"XA"}} the example parameters with logical sectors would be used like this: <br />
<br />
{{bc|1=Start=2048<br />
End=3839711231<br />
BytesInSector=512}}<br />
<br />
By using the starting address of the partition on the device by defining it in the {{ic|1=seek=}} option<br />
<br />
# dd if=''data_source'' of=/dev/sd"X" bs=${BytesInSector} count=${End} seek=${Start}<br />
<br />
By using the partitions name<br />
<br />
{{bc|1=LogicalSectors=3839709184}}<br />
<br />
# dd if=''data_source'' of=/dev/sd"XA" bs=${BytesInSector} count=${LogicalSectors}<br />
<br />
Or, to wipe the whole disk by using physical sectors:<br />
<br />
{{bc|1=AllDiskPhysicalSectors=488378646<br />
PhysicalSectorSizeBytes=4096}}<br />
<br />
# dd if=''data_source'' of=/dev/sd"X" bs=${PhysicalSectorSizeBytes} count=${AllDiskPhysicalSectors} seek=0<br />
<br />
{{Note|The {{ic|1=count=}} option not necessary when wiping the physical limited area e.g. {{ic|sd"XY"}} or {{ic|sd"X"}} from begin to the end but will show an error about out of free space when will try to write outside of limits.}}<br />
<br />
== Select a data source ==<br />
<br />
As just said If you want to wipe sensitive data you can use anything matching your needs. <br />
<br />
If you want to setup block device encryption afterwards, you should always wipe at least with an encryption cipher as source or even pseudorandom data.<br />
<br />
For data that is not truly random your disk's writing speed should be the only limiting factor. If you need random data, the required system performance to generate it may extremely depend on what you choose as source of entropy.<br />
<br />
=== Non-random data ===<br />
<br />
Overwriting with {{ic|/dev/zero}} or simple patterns is considered secure in most resources. In the case of current HDD's it should be sufficient for fast disk wipes.<br />
<br />
{{Warning|A drive that is abnormally fast in writing patterns or zeroing could be doing transparent compression. It is obviously presumable not all blocks get wiped this way. Some [[#Flash memory]] devices do "feature" that.}}<br />
<br />
==== Pattern write test ====<br />
<br />
[[#Badblocks]] can write simple patterns to every block of a device and then read and check them searching for damaged areas (just like memtest86* does with memory).<br />
<br />
As the pattern is written to every accesible block this effectively wipes the device.<br />
<br />
=== Random data ===<br />
<br />
For differences between random and pseudorandom data as source, please see [[Random number generation]].<br />
<br />
{{Note|Data that is hard to compress (random data) will get written slower, if the drive logic mentioned in the [[#Non-random data]] warning tries compressing it. This should not lead to [[#Data remanence]] though. As maximum write-speed is not the performance-bottleneck it can get completely neglected while wiping disks with random data.}}<br />
<br />
=== Encrypted data ===<br />
<br />
When preparing a drive for full-disk encryption, sourcing high quality entropy is usually not necessary. The alternative is to use an encrypted datastream. For example, if you will use AES for your encrypted partition, you would wipe it with an equivalent encryption cipher prior to creating the filesystem to make the empty space not distinguishable from the used space.<br />
<br />
== Overwrite the target ==<br />
<br />
The chosen drive can be overwritten with several utilities, make your choice. If you only want to wipe a single file, [[Securely wipe disk/Tips and tricks#Wipe a single file]] has considerations in addition to the utilities mentioned below. <br />
<br />
=== By redirecting output ===<br />
<br />
The redirected output can be used both for creation of the files to rewrite free space on the partition, wipe the whole device or a single partition on it.<br />
<br />
In the following are examples that can be used to rewrite the partition or a block device by redirecting [http://tldp.org/HOWTO/Bash-Prog-Intro-HOWTO-3.html stdout] from other utilities: <br />
<br />
{{hc|$ cat /dev/urandom > /dev/sd"XY"|<br />
cat: write error: No space left on device}}<br />
<br />
{{hc|$ xz -z0 /dev/urandom -c > /dev/sd"XY"|<br />
xz: (stdout): Write error: No space left on device}}<br />
<br />
{{hc|1=$ dd if=/dev/urandom > /dev/sd"XY"|2=<br />
dd: writing to ‘standard output’: No space left on device<br />
20481+0 records in<br />
20480+0 records out<br />
10485760 bytes (10 MB) copied, 2.29914 s, 4.6 MB/s}}<br />
<br />
The file copy command {{ic|cp}} can also be used to rewrite the device, because it ignores the type of the destination:<br />
<br />
{{hc|$ cp /dev/urandom /dev/sd"XY"|<br />
cp: error writing ‘/dev/sd"XY"’: No space left on device<br />
cp: failed to extend ‘/dev/sd"XY"’: No space left on device}}<br />
<br />
To show speed and time you can use {{Pkg|pv}}:<br />
<br />
# pv --timer --rate --stop-at-size -s "$(blockdev --getsize64 /dev/sd"XY" )" /dev/zero > /dev/sd"XY"<br />
<br />
=== dd ===<br />
<br />
See also [[Core utilities#dd]].<br />
<br />
{{Warning|There is no confirmation regarding the sanity of this command so '''repeatedly check''' that the correct drive or partition has been targeted. Make certain that the {{ic|<nowiki>of=...</nowiki>}} option points to the target drive and not to a system disk.}}<br />
<br />
Zero-fill the disk by writing a zero byte to every addressable location on the disk using the [[Wikipedia:/dev/zero|/dev/zero]] stream.<br />
<br />
# dd if=/dev/zero of=/dev/sdX bs=4096<br />
<br />
Or the [[Wikipedia:/dev/random|/dev/urandom]] stream:<br />
# dd if=/dev/urandom of=/dev/sdX bs=4096<br />
<br />
The process is finished when dd reports {{ic|No space left on device}} and returns control back:<br />
dd: writing to ‘/dev/sdb’: No space left on device<br />
7959553+0 records in<br />
7959552+0 records out<br />
4075290624 bytes (4.1 GB) copied, 1247.7 s, 3.3 MB/s<br />
<br />
To speed up wiping a large drive, see also: <br />
* [[Securely wipe disk/Tips and tricks#dd - advanced example]] which uses OpenSSL, <br />
* [[Securely wipe disk/Tips and tricks#Using a template file]] which wipes with non-random preset data(e.g. overwrite a whole disk with a single file) but is very fast<br />
* [[Dm-crypt/Drive preparation#dm-crypt specific methods]] which uses dm-crypt.<br />
<br />
=== wipe ===<br />
<br />
Specialized on wiping files and is available as the {{Pkg|wipe}} package. To make a quick wipe of a destination you can use something like:<br />
<br />
$ wipe -r -q /path/to/wipe<br />
<br />
See also {{man|1|wipe}}.<br />
<br />
=== shred ===<br />
<br />
[https://www.gnu.org/software/coreutils/manual/html_node/shred-invocation.html ''shred''] (from the {{Pkg|coreutils}} package) is a Unix command that can be used to securely delete individual files or full devices so that they can be recovered only with great difficulty with specialised hardware, if at all. By default ''shred'' uses three passes, writing [[Random number generation|pseudo-random data]] to the device during each pass. This can be reduced or increased.<br />
<br />
The following command invokes shred with its default settings and displays the progress.<br />
# shred -v /dev/sd''X''<br />
<br />
Alternatively, shred can be instructed to do only one pass, with entropy from e.g. {{ic|/dev/urandom}}.<br />
# shred --verbose --random-source=/dev/urandom -n1 /dev/sd''X''<br />
<br />
=== Badblocks ===<br />
<br />
For letting badblocks (from the {{Pkg|e2fsprogs}} package) perform a disk wipe, a destructive [[Badblocks#read-write_Test_.28warning:destructive.29|read-write test]] has to be done:<br />
<br />
# badblocks -c <NUMBER_BLOCKS> -wsv /dev/<drive><br />
<br />
=== hdparm ===<br />
{{warning|Do not attempt to issue a Secure Erase ATA command on a device connected through USB; see https://ata.wiki.kernel.org/index.php/ATA_Secure_Erase and http://www.tomshardware.co.uk/answers/id-1984547/secure-erase-external-usb-hard-drive.html for details.}}<br />
<br />
[[hdparm]] supports [http://tinyapps.org/docs/wipe_drives_hdparm.html ATA Secure Erase], which is functionally equivalent to zero-filling a disk. It is however handled by the hard-drive firmware itself, and includes "hidden data areas". As such, it can be seen as a modern-day "low-level format" command. [[SSD]] drives reportedly achieve factory performance after issuing this command, but may not be sufficiently wiped (see [[#Flash memory]]).<br />
<br />
Some drives support '''Enhanced Secure Erase''', which uses distinct patterns defined by the manufacturer. If the output of {{ic|hdparm -I}} for the device indicates a manifold time advantage for the '''Enhanced''' erasure, the device probably has a hardware encryption feature and the wipe will be performed to the encryption keys only. <br />
<br />
For detailed instructions on using ATA Secure Erase, see [[Solid State Drive/Memory cell clearing]] and the [https://ata.wiki.kernel.org/index.php/ATA_Secure_Erase Linux ATA wiki].<br />
<br />
== See also ==<br />
* [http://superuser.com/questions/19326/how-to-wipe-free-disk-space-in-linux Wipe free space in Linux]</div>J99https://wiki.archlinux.org/index.php?title=Wake-on-LAN&diff=510977Wake-on-LAN2018-02-16T10:53:46Z<p>J99: /* NetworkManager */ Instructions for disabling WoL</p>
<hr />
<div>[[Category:Networking]]<br />
[[ja:Wake-on-LAN]]<br />
[[Wikipedia:Wake-on-LAN|Wake-on-LAN]] (WoL) is a feature to switch on a computer via the network.<br />
<br />
== Hardware settings ==<br />
<br />
The target computer's motherboard and [[wikipedia:Network interface controller|Network Interface Controller]] have to support Wake-on-LAN. The target computer has to be physically connected (with a cable) to a router or to the source computer, wireless cards do not support WoL.<br />
<br />
The Wake-on-LAN feature also has to be enabled in the computer's BIOS. Different motherboard manufacturers use slightly different language for this feature. Look for terminology such as "PCI Power up", "Allow PCI wake up event" or "Boot from PCI/PCI-E".<br />
<br />
It is known that some motherboards are affected by a bug that can cause immediate or random wake-up after a ''shutdown'' whenever the BIOS WoL feature is enabled (as discussed in [https://bbs.archlinux.org/viewtopic.php?id=173648 this thread] for example). The following actions in the BIOS preferences can solve this issue with some motherboards:<br />
# Disable all references to ''xHCI'' in the USB settings (note this will also disable USB 3.0 at boot time)<br />
# Disable ''EuP 2013'' if it is explicitly an option<br />
# Optionally enable wake-up on keyboard actions<br />
{{Note|There are mixed opinions as to the value of #3 above and it may be motherboard dependent.}}<br />
<br />
== Software configuration ==<br />
<br />
=== Enable WoL on the network adapter ===<br />
<br />
Depending on the hardware, the network driver may have WoL switched off by default.<br />
<br />
To query this status or to change the settings, install {{Pkg|ethtool}}, determine the name of the [[network interface]], and query it using the command:<br />
<br />
{{hc|# ethtool ''interface'' {{!}} grep Wake-on|<br />
Supports Wake-on: pumbag<br />
Wake-on: d}}<br />
The ''Wake-on'' values define what activity triggers wake up: {{ic|d}} (disabled), {{ic|p}} (PHY activity), {{ic|u}} (unicast activity), {{ic|m}} (multicast activity), {{ic|b}} (broadcast activity), {{ic|a}} (ARP activity), and {{ic|g}} (magic packet activity). The value {{ic|g}} is required for WoL to work, if not, the following command enables the WoL feature in the driver:<br />
<br />
# ethtool -s ''interface'' wol g<br />
<br />
This command might not last beyond the next reboot and in this case must be repeated via some mechanism. Common solutions are listed in the following subsections.<br />
<br />
=== Make it persistent ===<br />
<br />
==== netctl ====<br />
<br />
If using netctl, one can make this setting persistent by adding the following the netctl profile:<br />
<br />
{{hc|/etc/netctl/''profile''|2=<br />
ExecUpPost='/usr/bin/ethtool -s ''interface'' wol g'<br />
}}<br />
<br />
==== systemd.link ====<br />
<br />
Link-level configuration is possible through systemd. The actual setup is performed by the {{ic|net_setup_link}} udev builtin. Add the {{ic|WakeOnLan}} option to the network link file:<br />
<br />
{{hc|/etc/systemd/network/50-wired.link|2=<br />
[Link]<br />
WakeOnLan=magic<br />
...<br />
}}<br />
<br />
{{Note|This configuration applies only to the link-level, and is independent of network-level daemons such as [[NetworkManager]] or [[systemd-networkd]].}}<br />
<br />
See [[systemd-networkd#link files]] and {{man|5|systemd.link}} for more information.<br />
<br />
==== systemd service ====<br />
<br />
This is an equivalent of previous {{ic|systemd.link}} option, but uses a standalone systemd service.<br />
<br />
{{hc|/etc/systemd/system/wol@.service|2=<br />
[Unit]<br />
Description=Wake-on-LAN for %i<br />
Requires=network.target<br />
After=network.target<br />
<br />
[Service]<br />
ExecStart=/usr/bin/ethtool -s %i wol g<br />
Type=oneshot<br />
<br />
[Install]<br />
WantedBy=multi-user.target<br />
}}<br />
<br />
Alternatively install the {{AUR|wol-systemd}} package.<br />
<br />
Then activate this new service by [[starting]] {{ic|wol@''interface''.service}}.<br />
<br />
==== udev ====<br />
<br />
[[udev]] is capable of running any command as soon as a device is visible. The following rule will turn on WOL on all [[network interface]]s whose name matches {{ic|enp*}}:<br />
<br />
{{hc|/etc/udev/rules.d/99-wol.rules|<nowiki><br />
ACTION=="add", SUBSYSTEM=="net", NAME=="enp*", RUN+="/usr/bin/ethtool -s $name wol g"<br />
</nowiki>}}<br />
<br />
The {{ic|$name}} placeholder will be replaced by the value of the {{ic|NAME}} variable for the matched device.<br />
<br />
{{Note|The name of the configuration file is important. Due to the introduction of [[Network configuration#Network interfaces|persistent device names]] in systemd v197, it is important that the rules matching a specific network interface are named lexicographically after {{ic|80-net-name-slot.rules}}, so that they are applied after the devices gain the persistent names.}}<br />
<br />
{{Warning|[[udev]] will match the device as soon it becomes available, be this in the [[initramfs]] (before the switch_root) or the main system. The order is not deterministic; there is no guarantee. Be sure that your initramfs includes the necessary udev rules (from {{ic|/etc/udev/rules.d}}) and supporting binaries ({{ic|/usr/bin/ethtool}}).}}<br />
<br />
==== cron ====<br />
<br />
A command can be run each time the computer is (re)booted using "@reboot" in a crontab. First, make sure [[Cron#Installation|cron]] is enabled, and then [[Cron#Basic_commands|edit a crontab]] for the root user that contains the following line:<br />
<br />
@reboot /usr/bin/ethtool -s ''interface'' wol g<br />
<br />
==== NetworkManager ====<br />
<br />
In version 1.0.6 NetworkManager [https://www.phoronix.com/scan.php?page=news_item&px=NetworkManager-WoL-Control adds Wake-on-LAN controls]. One way to enable Wake-on-LAN by magic packet is through nmcli.<br />
<br />
First, search for the name of the wired connection:<br />
<br />
{{hc|# nmcli con show|2=<br />
NAME UUID TYPE DEVICE<br />
wired1 612e300a-c047-4adb-91e2-12ea7bfe214e 802-3-ethernet enp0s25<br />
}}<br />
<br />
By following, one can view current status of Wake-on-LAN settings:<br />
<br />
{{hc|# nmcli c show "wired1" <nowiki>|</nowiki> grep 802-3-ethernet.wake-on-lan|2=<br />
802-3-ethernet.wake-on-lan: default<br />
802-3-ethernet.wake-on-lan-password: --<br />
}}<br />
<br />
Enable Wake-on-LAN by magic packet on that connection:<br />
<br />
# nmcli c modify "wired1" 802-3-ethernet.wake-on-lan magic<br />
<br />
Then reboot, possibly two times. To disable Wake-on-Lan, substitute {{ic|magic}} with {{ic|ignore}}.<br />
<br />
From version 1.2.0 Wake-on-LAN settings can be changed graphically using {{Pkg|nm-connection-editor}}.<br />
<br />
=== Enable WoL in TLP ===<br />
<br />
When using [[TLP]] for suspend/hibernate, the {{ic|WOL_DISABLE}} setting should be set to {{ic|N}} in {{ic|/etc/default/tlp}} to allow resuming the computer with WoL.<br />
<br />
== Trigger a wake up ==<br />
<br />
To trigger WoL on a target machine, its MAC address and external or internal IP should be known.<br />
<br />
To obtain the internal IP address and MAC address of the target computer, execute the following command:<br />
<br />
{{hc|$ ip addr|<br />
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default<br />
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00<br />
inet 127.0.0.1/8 scope host lo<br />
valid_lft forever preferred_lft forever<br />
inet6 ::1/128 scope host<br />
valid_lft forever preferred_lft forever<br />
2: enp1s0: <BROADCAST,MULTICAST,PROMISC,UP,LOWER_UP> mtu 1500 qdisc fq_codel master br0 state UP group default qlen 1000<br />
link/ether '''48:05:ca:09:0e:6a''' brd ff:ff:ff:ff:ff:ff<br />
inet '''192.168.1.20/24''' brd 192.168.1.255 scope global br0<br />
valid_lft forever preferred_lft forever<br />
inet6 fe80::6a05:caff:fe09:e6a/64 scope link<br />
valid_lft forever preferred_lft forever<br />
}}<br />
<br />
Here the internal IP address is {{ic|192.168.1.20}} and the MAC address is {{ic|48:05:ca:09:0e:6a}}.<br />
<br />
One program able to send magic packets for WoL is {{Pkg|wol}}.<br />
<br />
=== On the same LAN ===<br />
<br />
If you are connected directly to another computer through a network cable, or the traffic within a LAN is not firewalled, then using Wake-on-LAN should be very easy since there is no need to worry about port redirects.<br />
<br />
In the simplest case the default broadcast address {{ic|255.255.255.255}} is used:<br />
<br />
$ wol ''target_MAC_address''<br />
<br />
To broadcast the magic packet only to a specific subnet or host, use the {{ic|-i}} switch:<br />
<br />
$ wol -i ''target_IP'' ''target_MAC_address''<br />
<br />
{{Tip|If you intend to continue using Wake-on-LAN, it is recommended to assign a static IP address to the target computer.}}<br />
<br />
=== Across the internet ===<br />
<br />
When the source and target computers are separated by a router, Wake-on-LAN can be achieved via [[wikipedia:Port forwarding|port forwarding]]. The router needs to be configured using one of these two options:<br />
<br />
* Forward a different port to each target machine. This requires any target machine to have a static IP address on its LAN.<br />
* Forward a single port to the [[wikipedia:Broadcast_address|broadcast address]]. This is likely not possible on your router with the stock firmware, in this case refer to [[#Forward a port to the broadcast address]] for workarounds.<br />
<br />
In both cases, run the following command from the source computer to trigger wake-up:<br />
<br />
$ wol -p ''forwarded_port'' -i ''router_IP'' ''target_MAC_address''<br />
<br />
==== Forward a port to the broadcast address ====<br />
<br />
Most routers do not allow to forward to broadcast, however if you can get shell access to your router (through telnet, ssh, serial cable, etc), you can implement this workaround:<br />
$ ip neighbor add 192.168.1.254 lladdr FF:FF:FF:FF:FF:FF dev net0<br />
<br />
(The above command assumes your network is ''192.168.1.0/24'' and uses ''net0'' as network interface). Now, forward UDP port 9 to 192.168.1.254. This has worked for me on a Linksys WRT54G running [[Wikipedia:Tomato_(firmware)|Tomato]], and on the Verizon FIOS ActionTec router.<br />
<br />
For notes on how to do it on a router with [[Wikipedia:DD-WRT|DD-WRT]] firmware, see [http://www.dd-wrt.com/wiki/index.php/WOL#Remote_Wake_On_LAN_via_Port_Forwarding this tutorial].<br />
<br />
For notes on how to do it on a router with [[Wikipedia:OpenWrt|OpenWrt]] firmware, see [https://wiki.openwrt.org/doc/uci/wol this tutorial].<br />
<br />
== Miscellaneous ==<br />
<br />
=== Check reception of the magic packets ===<br />
In order to make sure the WoL packets reach the target computer, one can listen to the UDP port, usually port 9, for magic packets.<br />
<br />
This can be performed by installing {{pkg|gnu-netcat}} from the [[official repositories]] on the target computer and using the following command:<br />
<br />
# nc --udp --listen --local-port=9 --hexdump<br />
<br />
Then wait for the incoming traffic to appear in the {{ic|nc}} terminal.<br />
<br />
The magic packet frame expected contains 6 bytes of FF followed by 16 repetitions of the target computer's MAC (6 bytes each) for a total of 102 bytes.<br />
<br />
=== Example of WoL script ===<br />
Here is a script that illustrates the use of {{ic|wol}} with different machines:<br />
{{bc|<nowiki><br />
#!/bin/bash<br />
<br />
# definition of MAC addresses<br />
monster=01:12:46:82:ab:4f<br />
ghost=01:1a:d2:56:6b:e6<br />
<br />
echo "Which PC to wake?"<br />
echo "m) monster"<br />
echo "g) ghost"<br />
echo "q) quit"<br />
read input1<br />
case $input1 in<br />
m)<br />
/usr/bin/wol $monster<br />
;;<br />
g)<br />
# uses wol over the internet provided that port 9 is forwarded to ghost on ghost's router<br />
/usr/bin/wol --port=9 --host=ghost.mydomain.org $ghost<br />
;;<br />
Q|q)<br />
break<br />
;;<br />
esac</nowiki>}}<br />
<br />
== Troubleshooting ==<br />
<br />
=== Battery draining problem ===<br />
Some laptops have a battery draining problem after shutdown [http://ubuntuforums.org/archive/index.php/t-1729782.html]. This might be caused by enabled WOL. To solve this problem, disable it by using ethtool as mentioned above.<br />
<br />
# ethtool -s net0 wol d<br />
<br />
=== Realtek ===<br />
<br />
Users with Realtek 8168 8169 8101 8111(C) based NICs (cards / and on-board) may notice a problem where the NIC seems to be disabled on boot and has no Link light. See [[Network configuration#Realtek no link / WOL problem]].<br />
<br />
If the link light on the network switch is enabled when the computer is turned off but wake on LAN is still not working, booting the system using the {{Pkg|r8168}} kernel module at least once and then switching back to the r8169 kernel module included with the kernel seems to fix it at least in the following configurations:<br />
* MSI B85M-E45 motherboard, BIOS version V10.9, onboard Realtek 8111G chipset<br />
<br />
For the {{ic|r8168}} module you might need to set the {{ic|1=s5wol=1}} [[Kernel_modules#Setting_module_options|module option]] to enable the wake on LAN functionality.<br />
<br />
===alx driver support===<br />
<br />
For some newer Atheros-based NICs (such as Atheros AR8161 and Killer E2500), WOL support has been disabled in the mainline {{ic|alx}} module due to a bug causing unintentional wake-up (see [http://www.spinics.net/lists/netdev/msg242477.html this patch discussion]). A patch can be applied (or installed as a [[dkms]] module) which both restores WOL support and fixes the underlying bug, as outlined in [https://bugzilla.kernel.org/show_bug.cgi?id=61651 this thread].<br />
<br />
== See also ==<br />
<br />
* [http://www.depicus.com/wake-on-lan/woli.aspx Wake-On-Lan]</div>J99https://wiki.archlinux.org/index.php?title=Redshift&diff=510682Redshift2018-02-13T18:24:29Z<p>J99: /* Autostart */ Use &> /dev/null & for xinitrc.d command</p>
<hr />
<div>[[Category:X server]]<br />
[[Category:Graphics]]<br />
[[Category:Eye candy]]<br />
[[ja:Redshift]]<br />
[[ru:Redshift]]<br />
From the [http://jonls.dk/redshift/ Redshift project web page]:<br />
<br />
:Redshift adjusts the color temperature of your screen according to your surroundings. This may help your eyes hurt less if you are working in front of the screen at night. This program is inspired by [http://justgetflux.com f.lux].<br />
<br />
{{Note| <br />
* Redshift does not support [[Wayland]] since it offers no way to adjust the color temperature. [https://github.com/jonls/redshift/issues/55]<br />
* [[GNOME]] provides features like Redshift out-of-the-box and has [[Wayland]] support.<br />
}}<br />
<br />
== Installation ==<br />
<br />
=== Redshift ===<br />
<br />
[[Install]] the {{Pkg|redshift}} package. Alternatively, install the {{AUR|redshift-minimal}} package, for a version with minimal dependencies.<br />
<br />
==== Redshift-GTK ====<br />
<br />
The {{ic|redshift-gtk}} command is provided by the {{Pkg|redshift}} package. Redshift-GTK provides a system tray icon for controlling Redshift and requires the following packages to be installed: {{Pkg|python-gobject}}, {{Pkg|python-xdg}}, and {{Pkg|librsvg}}.<br />
<br />
===== Alternatives =====<br />
<br />
Another GTK application is {{AUR|redshiftgui-bin}} and alternative Qt solutions available are {{AUR|redshift-qt}}, {{AUR|redshiftconf}} or {{AUR|plasma5-applets-redshift-control-git}}.<br />
<br />
== Configuration ==<br />
<br />
Redshift will at least need your location to start, meaning the latitude and longitude of your location. Redshift employs several routines for obtaining your location. If none of them works (e.g. none of the used helper programs is installed), you need to enter your location manually: For most places/cities an easy way is to look up the wikipedia page of that place and get the location from there (search the page for "coordinates").<br />
<br />
=== Autostart ===<br />
<br />
There are several options to have redshift automatically started:<br />
<br />
* By adding adding a shell script with the contents {{ic|redshift &> /dev/null &}} in {{ic|/etc/X11/xinit/xinitrc.d/}}, and then make it executable with {{ic|chmod +x script_name.sh}}.<br />
* By adding {{ic|pgrep redshift &> /dev/null <nowiki>||</nowiki> redshift &> /dev/null &}} to {{ic|~/.xinitrc}} if you are using {{ic|startx}}<br />
* By using the provided [[Systemd#Using units|systemd service unit files]]. Be careful: the service can only be started in user mode, see [[systemd/User#Basic setup]]. Two service files are provided: {{ic|/usr/lib/systemd/user/redshift.service}} and {{ic|/usr/lib/systemd/user/redshift-gtk.service}}. Activate only one of them depending on whether or not you want the system tray icon. The {{ic|DISPLAY}} environment variable needs to be configured. See [[systemd/User#DISPLAY and XAUTHORITY]].<br />
* By right-clicking the system tray icon when redshift-gtk or plasma5-applets-redshift-control is already launched and selecting 'Autostart'.<br />
{{note|The redshift services files contains {{ic|Restart<nowiki>=</nowiki>always}} so the service will restart infinitely (see {{man|5|systemd.service}}) }}<br />
* By using your preferred window manager or desktop environment's autostart methods. For example in i3, the following line could be added to the config file: {{ic|exec --no-startup-id redshift-gtk}}. On other desktop environments, [[Desktop entries]] inside {{Ic|~/.config/autostart}} can be used.<br />
<br />
=== Quick start ===<br />
{{Tip|You can get the coordinates of a place with [http://www.geonames.org/ GeoNames.org].}}<br />
<br />
To just get it up and running with a basic setup, issue:<br />
<br />
$ redshift -l LAT:LON<br />
<br />
where LAT is the latitude and LON is the longitude of your location.<br />
<br />
=== Automatic location based on GPS ===<br />
<br />
You can also use {{Pkg|gpsd}} to automatically determine your GPS location and use it as an input for Redshift. Create the following script and pass {{ic|$lat}} and {{ic|$lon}} to {{ic|redshift -l $lat;$lon}}:<br />
<br />
#!/bin/bash<br />
date<br />
#gpsdata=$( gpspipe -w -n 10 | grep -m 1 lon )<br />
gpsdata=$( gpspipe -w | grep -m 1 TPV )<br />
lat=$( echo "$gpsdata" | jsawk 'return this.lat' )<br />
lon=$( echo "$gpsdata" | jsawk 'return this.lon' )<br />
alt=$( echo "$gpsdata" | jsawk 'return this.alt' )<br />
dt=$( echo "$gpsdata" | jsawk 'return this.time' )<br />
echo "$dt"<br />
echo "You are here: $lat, $lon at $alt"<br />
<br />
For more information, see [https://bbs.archlinux.org/viewtopic.php?pid=1389735#p1389735 this] forums thread.<br />
<br />
=== Manual setup ===<br />
<br />
Redshift reads the configuration file {{ic|~/.config/redshift.conf}}, if it exists. However, Redshift does not create that configuration file, so you have to create it manually.<br />
Below is an example (copied from the [http://jonls.dk/redshift/ Redshift website]).<br />
<br />
{{note|There seems to be a bug in Redshift that causes the transition option in the configuration file to not work as described: Instead of handling the transition between day and night it '''only''' changes the transition between application start-up and shutdown (and delay the latter as a consequence). See the [[talk:redshift#Day and night transition|talk page]] and the [https://github.com/jonls/redshift/issues/270 issue on the Redshift project page] for more information.}}<br />
<br />
{{hc|~/.config/redshift.conf|2=<br />
; Global settings for redshift<br />
[redshift]<br />
; Set the day and night screen temperatures (Neutral is 6500K)<br />
temp-day=5700<br />
temp-night=3500<br />
<br />
; Enable/Disable a smooth transition between day and night<br />
; 0 will cause a direct change from day to night screen temperature.<br />
; 1 will gradually increase or decrease the screen temperature.<br />
transition=1<br />
<br />
; Set the screen brightness. Default is 1.0.<br />
;brightness=0.9<br />
; It is also possible to use different settings for day and night<br />
; since version 1.8.<br />
;brightness-day=0.7<br />
;brightness-night=0.4<br />
; Set the screen gamma (for all colors, or each color channel<br />
; individually)<br />
gamma=0.8<br />
;gamma=0.8:0.7:0.8<br />
; This can also be set individually for day and night since<br />
; version 1.10.<br />
;gamma-day=0.8:0.7:0.8<br />
;gamma-night=0.6<br />
<br />
; Set the location-provider: 'geoclue2' or 'manual'<br />
; type 'redshift -l list' to see possible values.<br />
; The location provider settings are in a different section.<br />
location-provider=manual<br />
<br />
; Set the adjustment-method: 'randr', 'vidmode'<br />
; type 'redshift -m list' to see all possible values.<br />
; 'randr' is the preferred method, 'vidmode' is an older API.<br />
; but works in some cases when 'randr' does not.<br />
; The adjustment method settings are in a different section.<br />
adjustment-method=randr<br />
<br />
; Configuration of the location-provider:<br />
; type 'redshift -l PROVIDER:help' to see the settings.<br />
; ex: 'redshift -l manual:help'<br />
; Keep in mind that longitudes west of Greenwich (e.g. the Americas)<br />
; are negative numbers.<br />
[manual]<br />
lat=48.1<br />
lon=11.6<br />
<br />
; Configuration of the adjustment-method<br />
; type 'redshift -m METHOD:help' to see the settings.<br />
; ex: 'redshift -m randr:help'<br />
; In this example, randr is configured to adjust screen 1.<br />
; Note that the numbering starts from 0, so this is actually the<br />
; second screen. If this option is not specified, Redshift will try<br />
; to adjust _all_ screens.<br />
[randr]<br />
screen=1<br />
}}<br />
<br />
=== Use real screen brightness ===<br />
<br />
Redshift has a brightness adjustment setting, but it does not work the way most people might expect. In fact it is a fake brightness adjustment obtained by manipulating the gamma ramps, which means that it does not reduce the backlight of the screen. [http://jonls.dk/redshift/#known-bugs-and-limitations]<br />
<br />
Changing screen backlight is possible with redshift hooks and {{pkg|xorg-xrandr}} and {{pkg|xorg-xbacklight}} but, please see [[Backlight#xbacklight]] as there are some limitations and you may have to find another method of controlling the backlight depending on your hardware.<br />
<br />
You need to create a file in {{ic|~/.config/redshift/hooks}} and make it executable. You can use and edit the following example:<br />
<br />
$ mkdir -p ~/.config/redshift/hooks<br />
<br />
Create and adjust the following script:<br />
{{hc|<br />
~/.config/redshift/hooks/brightness.sh|output=#!/bin/sh<br />
<br />
# Set brightness via xbrightness when redshift status changes<br />
<br />
# Set brightness values for each status.<br />
# Range from 1 to 100 is valid<br />
brightness_day="100"<br />
brightness_transition="50"<br />
brightness_night="10"<br />
# Set fade time for changes to one minute<br />
fade_time=60000<br />
<br />
case $1 in<br />
period-changed)<br />
case $3 in<br />
night)<br />
xbacklight -set $brightness_night -time $fade_time<br />
;;<br />
transition)<br />
xbacklight -set $brightness_transition -time $fade_time<br />
;;<br />
daytime)<br />
xbacklight -set $brightness_day -time $fade_time<br />
;;<br />
esac<br />
;;<br />
esac<br />
}}<br />
<br />
Make it executable:<br />
<br />
$ chmod +x ~/.config/redshift/hooks/brightness.sh<br />
<br />
[[Restart]] the {{ic|redshift.service}} [[user]] to apply changes.<br />
<br />
Check the service status as it should '''not''' contain the following message:<br />
<br />
redshift[..]: No outputs have backlight property<br />
<br />
== Troubleshooting ==<br />
<br />
=== Screen 1 could not be found ===<br />
<br />
Locate configuration-file "redshift.conf" in your distribution and change "screen 1" to "screen 0"<br />
<br />
=== Left/right clicking the tray icon doesn't work ===<br />
Install {{Pkg|libappindicator-gtk3}}. See [https://github.com/jonls/redshift/issues/363] and [https://bugs.archlinux.org/task/49971]<br />
<br />
=== Failed to run Redshift due to geoclue2 ===<br />
{{note|Prior to apply the method below, close redshift-gtk and restart the geoclue service. Sometimes the location service fails due to e.g. connection established after the location service.}}<br />
<br />
If using [[GNOME]], you can also toggle Location Services to "On" in "Settings -> Privacy"<br />
<br />
By default, the geoclue2 configuration files does not allow Redshift access.<br />
In order to allow access, add the following lines to {{ic|/etc/geoclue/geoclue.conf}}<br />
{{hc|/etc/geoclue/geoclue.conf|2=<br />
[redshift]<br />
allowed=true<br />
system=false<br />
users=<br />
}}<br />
=== Redshift temporarily resets using some wine apps that reset gamma values ===<br />
<br />
If you notice that using some wine apps, redshift seems to reset temporarily upon launch, or adjusting settings, or etc, then there is a useful registry key that seems to alleviate this. See [https://www.winehq.org/pipermail/wine-bugs/2015-January/403770.html] and [https://wiki.winehq.org/UsefulRegistryKeys]. Set or create the string value<br />
{{hc|HKEY_CURRENT_USER\Software\Wine\X11 Driver|2=UseXVidMode="N"}} using the registry editor, or import/set it otherwise.<br />
<br />
== See also ==<br />
* [http://jonls.dk/redshift Redshift website]<br />
* [http://github.com/jonls/redshift Redshift on github]<br />
* {{App|sct|set color temperature|{{AUR|sct}}|{{AUR|sct}}}}<br />
* {{AUR|xflux-gui-git}}<br />
* [[Wikipedia:Redshift_(software)]]</div>J99https://wiki.archlinux.org/index.php?title=Redshift&diff=510603Redshift2018-02-13T01:05:10Z<p>J99: /* Autostart */ Clarify /etc/X11/xinit/xinitrc.d/ autostart instructions</p>
<hr />
<div>[[Category:X server]]<br />
[[Category:Graphics]]<br />
[[Category:Eye candy]]<br />
[[ja:Redshift]]<br />
[[ru:Redshift]]<br />
From the [http://jonls.dk/redshift/ Redshift project web page]:<br />
<br />
:Redshift adjusts the color temperature of your screen according to your surroundings. This may help your eyes hurt less if you are working in front of the screen at night. This program is inspired by [http://justgetflux.com f.lux].<br />
<br />
{{Note| <br />
* Redshift does not support [[Wayland]] since it offers no way to adjust the color temperature. [https://github.com/jonls/redshift/issues/55]<br />
* [[GNOME]] provides features like Redshift out-of-the-box and has [[Wayland]] support.<br />
}}<br />
<br />
== Installation ==<br />
<br />
=== Redshift ===<br />
<br />
[[Install]] the {{Pkg|redshift}} package. Alternatively, install the {{AUR|redshift-minimal}} package, for a version with minimal dependencies.<br />
<br />
==== Redshift-GTK ====<br />
<br />
The {{ic|redshift-gtk}} command is provided by the {{Pkg|redshift}} package. Redshift-GTK provides a system tray icon for controlling Redshift and requires the following packages to be installed: {{Pkg|python-gobject}}, {{Pkg|python-xdg}}, and {{Pkg|librsvg}}.<br />
<br />
===== Alternatives =====<br />
<br />
Another GTK application is {{AUR|redshiftgui-bin}} and alternative Qt solutions available are {{AUR|redshift-qt}}, {{AUR|redshiftconf}} or {{AUR|plasma5-applets-redshift-control-git}}.<br />
<br />
== Configuration ==<br />
<br />
Redshift will at least need your location to start, meaning the latitude and longitude of your location. Redshift employs several routines for obtaining your location. If none of them works (e.g. none of the used helper programs is installed), you need to enter your location manually: For most places/cities an easy way is to look up the wikipedia page of that place and get the location from there (search the page for "coordinates").<br />
<br />
=== Autostart ===<br />
<br />
There are several options to have redshift automatically started:<br />
<br />
* By adding adding a shell script with the contents {{ic|redshift & disown}} in {{ic|/etc/X11/xinit/xinitrc.d/}}, and then make it executable with {{ic|chmod +x script_name.sh}}.<br />
* By adding {{ic|pgrep redshift &> /dev/null <nowiki>||</nowiki> redshift &> /dev/null &}} to {{ic|~/.xinitrc}} if you are using {{ic|startx}}<br />
* By using the provided [[Systemd#Using units|systemd service unit files]]. Be careful: the service can only be started in user mode, see [[systemd/User#Basic setup]]. Two service files are provided: {{ic|/usr/lib/systemd/user/redshift.service}} and {{ic|/usr/lib/systemd/user/redshift-gtk.service}}. Activate only one of them depending on whether or not you want the system tray icon. The {{ic|DISPLAY}} environment variable needs to be configured. See [[systemd/User#DISPLAY and XAUTHORITY]].<br />
* By right-clicking the system tray icon when redshift-gtk or plasma5-applets-redshift-control is already launched and selecting 'Autostart'.<br />
{{note|The redshift services files contains {{ic|Restart<nowiki>=</nowiki>always}} so the service will restart infinitely (see {{man|5|systemd.service}}) }}<br />
* By using your preferred window manager or desktop environment's autostart methods. For example in i3, the following line could be added to the config file: {{ic|exec --no-startup-id redshift-gtk}}. On other desktop environments, [[Desktop entries]] inside {{Ic|~/.config/autostart}} can be used.<br />
<br />
=== Quick start ===<br />
{{Tip|You can get the coordinates of a place with [http://www.geonames.org/ GeoNames.org].}}<br />
<br />
To just get it up and running with a basic setup, issue:<br />
<br />
$ redshift -l LAT:LON<br />
<br />
where LAT is the latitude and LON is the longitude of your location.<br />
<br />
=== Automatic location based on GPS ===<br />
<br />
You can also use {{Pkg|gpsd}} to automatically determine your GPS location and use it as an input for Redshift. Create the following script and pass {{ic|$lat}} and {{ic|$lon}} to {{ic|redshift -l $lat;$lon}}:<br />
<br />
#!/bin/bash<br />
date<br />
#gpsdata=$( gpspipe -w -n 10 | grep -m 1 lon )<br />
gpsdata=$( gpspipe -w | grep -m 1 TPV )<br />
lat=$( echo "$gpsdata" | jsawk 'return this.lat' )<br />
lon=$( echo "$gpsdata" | jsawk 'return this.lon' )<br />
alt=$( echo "$gpsdata" | jsawk 'return this.alt' )<br />
dt=$( echo "$gpsdata" | jsawk 'return this.time' )<br />
echo "$dt"<br />
echo "You are here: $lat, $lon at $alt"<br />
<br />
For more information, see [https://bbs.archlinux.org/viewtopic.php?pid=1389735#p1389735 this] forums thread.<br />
<br />
=== Manual setup ===<br />
<br />
Redshift reads the configuration file {{ic|~/.config/redshift.conf}}, if it exists. However, Redshift does not create that configuration file, so you have to create it manually.<br />
Below is an example (copied from the [http://jonls.dk/redshift/ Redshift website]).<br />
<br />
{{note|There seems to be a bug in Redshift that causes the transition option in the configuration file to not work as described: Instead of handling the transition between day and night it '''only''' changes the transition between application start-up and shutdown (and delay the latter as a consequence). See the [[talk:redshift#Day and night transition|talk page]] and the [https://github.com/jonls/redshift/issues/270 issue on the Redshift project page] for more information.}}<br />
<br />
{{hc|~/.config/redshift.conf|2=<br />
; Global settings for redshift<br />
[redshift]<br />
; Set the day and night screen temperatures (Neutral is 6500K)<br />
temp-day=5700<br />
temp-night=3500<br />
<br />
; Enable/Disable a smooth transition between day and night<br />
; 0 will cause a direct change from day to night screen temperature.<br />
; 1 will gradually increase or decrease the screen temperature.<br />
transition=1<br />
<br />
; Set the screen brightness. Default is 1.0.<br />
;brightness=0.9<br />
; It is also possible to use different settings for day and night<br />
; since version 1.8.<br />
;brightness-day=0.7<br />
;brightness-night=0.4<br />
; Set the screen gamma (for all colors, or each color channel<br />
; individually)<br />
gamma=0.8<br />
;gamma=0.8:0.7:0.8<br />
; This can also be set individually for day and night since<br />
; version 1.10.<br />
;gamma-day=0.8:0.7:0.8<br />
;gamma-night=0.6<br />
<br />
; Set the location-provider: 'geoclue2' or 'manual'<br />
; type 'redshift -l list' to see possible values.<br />
; The location provider settings are in a different section.<br />
location-provider=manual<br />
<br />
; Set the adjustment-method: 'randr', 'vidmode'<br />
; type 'redshift -m list' to see all possible values.<br />
; 'randr' is the preferred method, 'vidmode' is an older API.<br />
; but works in some cases when 'randr' does not.<br />
; The adjustment method settings are in a different section.<br />
adjustment-method=randr<br />
<br />
; Configuration of the location-provider:<br />
; type 'redshift -l PROVIDER:help' to see the settings.<br />
; ex: 'redshift -l manual:help'<br />
; Keep in mind that longitudes west of Greenwich (e.g. the Americas)<br />
; are negative numbers.<br />
[manual]<br />
lat=48.1<br />
lon=11.6<br />
<br />
; Configuration of the adjustment-method<br />
; type 'redshift -m METHOD:help' to see the settings.<br />
; ex: 'redshift -m randr:help'<br />
; In this example, randr is configured to adjust screen 1.<br />
; Note that the numbering starts from 0, so this is actually the<br />
; second screen. If this option is not specified, Redshift will try<br />
; to adjust _all_ screens.<br />
[randr]<br />
screen=1<br />
}}<br />
<br />
=== Use real screen brightness ===<br />
<br />
Redshift has a brightness adjustment setting, but it does not work the way most people might expect. In fact it is a fake brightness adjustment obtained by manipulating the gamma ramps, which means that it does not reduce the backlight of the screen. [http://jonls.dk/redshift/#known-bugs-and-limitations]<br />
<br />
Changing screen backlight is possible with redshift hooks and {{pkg|xorg-xrandr}} and {{pkg|xorg-xbacklight}} but, please see [[Backlight#xbacklight]] as there are some limitations and you may have to find another method of controlling the backlight depending on your hardware.<br />
<br />
You need to create a file in {{ic|~/.config/redshift/hooks}} and make it executable. You can use and edit the following example:<br />
<br />
$ mkdir -p ~/.config/redshift/hooks<br />
<br />
Create and adjust the following script:<br />
{{hc|<br />
~/.config/redshift/hooks/brightness.sh|output=#!/bin/sh<br />
<br />
# Set brightness via xbrightness when redshift status changes<br />
<br />
# Set brightness values for each status.<br />
# Range from 1 to 100 is valid<br />
brightness_day="100"<br />
brightness_transition="50"<br />
brightness_night="10"<br />
# Set fade time for changes to one minute<br />
fade_time=60000<br />
<br />
case $1 in<br />
period-changed)<br />
case $3 in<br />
night)<br />
xbacklight -set $brightness_night -time $fade_time<br />
;;<br />
transition)<br />
xbacklight -set $brightness_transition -time $fade_time<br />
;;<br />
daytime)<br />
xbacklight -set $brightness_day -time $fade_time<br />
;;<br />
esac<br />
;;<br />
esac<br />
}}<br />
<br />
Make it executable:<br />
<br />
$ chmod +x ~/.config/redshift/hooks/brightness.sh<br />
<br />
[[Restart]] the {{ic|redshift.service}} [[user]] to apply changes.<br />
<br />
Check the service status as it should '''not''' contain the following message:<br />
<br />
redshift[..]: No outputs have backlight property<br />
<br />
== Troubleshooting ==<br />
<br />
=== Screen 1 could not be found ===<br />
<br />
Locate configuration-file "redshift.conf" in your distribution and change "screen 1" to "screen 0"<br />
<br />
=== Left/right clicking the tray icon doesn't work ===<br />
Install {{Pkg|libappindicator-gtk3}}. See [https://github.com/jonls/redshift/issues/363] and [https://bugs.archlinux.org/task/49971]<br />
<br />
=== Failed to run Redshift due to geoclue2 ===<br />
{{note|Prior to apply the method below, close redshift-gtk and restart the geoclue service. Sometimes the location service fails due to e.g. connection established after the location service.}}<br />
<br />
If using [[GNOME]], you can also toggle Location Services to "On" in "Settings -> Privacy"<br />
<br />
By default, the geoclue2 configuration files does not allow Redshift access.<br />
In order to allow access, add the following lines to {{ic|/etc/geoclue/geoclue.conf}}<br />
{{hc|/etc/geoclue/geoclue.conf|2=<br />
[redshift]<br />
allowed=true<br />
system=false<br />
users=<br />
}}<br />
=== Redshift temporarily resets using some wine apps that reset gamma values ===<br />
<br />
If you notice that using some wine apps, redshift seems to reset temporarily upon launch, or adjusting settings, or etc, then there is a useful registry key that seems to alleviate this. See [https://www.winehq.org/pipermail/wine-bugs/2015-January/403770.html] and [https://wiki.winehq.org/UsefulRegistryKeys]. Set or create the string value<br />
{{hc|HKEY_CURRENT_USER\Software\Wine\X11 Driver|2=UseXVidMode="N"}} using the registry editor, or import/set it otherwise.<br />
<br />
== See also ==<br />
* [http://jonls.dk/redshift Redshift website]<br />
* [http://github.com/jonls/redshift Redshift on github]<br />
* {{App|sct|set color temperature|{{AUR|sct}}|{{AUR|sct}}}}<br />
* {{AUR|xflux-gui-git}}<br />
* [[Wikipedia:Redshift_(software)]]</div>J99https://wiki.archlinux.org/index.php?title=Data-at-rest_encryption&diff=510491Data-at-rest encryption2018-02-11T17:52:18Z<p>J99: add VeraCrypt and update TrueCrypt info</p>
<hr />
<div>[[Category:Encryption]]<br />
[[Category:File systems]]<br />
[[es:Disk encryption]]<br />
[[it:Disk encryption]]<br />
[[ja:ディスク暗号化]]<br />
[[pl:Disk encryption]]<br />
{{Related articles start}}<br />
{{Related|dm-crypt}}<br />
{{Related|TrueCrypt}}<br />
{{Related|eCryptfs}}<br />
{{Related|EncFS}}<br />
{{Related|Tomb}}<br />
{{Related|tcplay}}<br />
{{Related|GnuPG}}<br />
{{Related|Self-Encrypting Drives}}<br />
{{Related articles end}}<br />
This article discusses common techniques available in Arch Linux for cryptographically protecting a logical part of a storage disk (folder, partition, whole disk, ...), so that all data that is written to it is automatically encrypted, and decrypted on-the-fly when read again.<br />
<br />
"Storage disks" in this context can be your computer's hard drive(s), external devices like USB flash drives or DVD's, as well as ''virtual'' storage disks like loop-back devices or cloud storage ''(as long as Arch Linux can address it as a block device or filesystem)''.<br />
<br />
If you already know ''what'' you want to protect and ''how'' you want to encrypt, you are encouraged to directly browse the ''related'' how-to articles listed on the right. <br />
<br />
==Why use encryption?==<br />
<br />
Disk encryption ensures that files are always stored on disk in an encrypted form. The files only become available to the operating system and applications in readable form while the system is running and unlocked by a trusted user. An unauthorized person looking at the disk contents directly, will only find garbled random-looking data instead of the actual files.<br />
<br />
For example, this can prevent unauthorized viewing of the data when the computer or hard-disk is:<br />
* located in a place to which non-trusted people might gain access while you are away<br />
* lost or stolen, as with laptops, netbooks or external storage devices<br />
* in the repair shop<br />
* discarded after its end-of-life<br />
<br />
In addition, disk encryption can also be used to add some security against unauthorized attempts to tamper with your operating system – for example, the installation of keyloggers or Trojan horses by attackers who can gain physical access to the system while you are away.<br />
<br />
{{Warning|Disk encryption does '''not''' protect your data from all threats.}}<br />
You will still be vulnerable to:<br />
* Attackers who can break into your system (e.g. over the Internet) while it is running and after you have already unlocked and mounted the encrypted parts of the disk.<br />
* Attackers who are able to gain physical access to the computer while it is running (even if you use a screenlocker), or very shortly ''after'' it was running, if they have the resources to perform a [[Wikipedia:Cold boot attack|cold boot attack]].<br />
* A government entity, which not only has the resources to easily pull off the above attacks, but also may simply force you to give up your keys/passphrases using various techniques of [[Wikipedia:Coercion|coercion]]. In most non-democratic countries around the world, as well as in the USA and UK, it may be legal for law enforcement agencies to do so if they have suspicions that you might be hiding something of interest.<br />
<br />
A very strong disk encryption setup (e.g. full system encryption with authenticity checking and no plaintext boot partition) is required to stand a chance against professional attackers who are able to tamper with your system ''before'' you use it. And even then it is doubtful whether it can really prevent all types of tampering (e.g. hardware keyloggers). The best remedy might be [[Wikipedia:Hardware-based full disk encryption|hardware-based full disk encryption]] and [[Wikipedia:Trusted_Computing|Trusted Computing]].<br />
<br />
{{Warning|Disk encryption also will not protect you against someone simply [[Securely wipe disk|wiping your disk]]. [[Backup programs|Regular backups]] are recommended to keep your data safe.}}<br />
<br />
== Data encryption vs system encryption ==<br />
<br />
; Data encryption<br />
: Defined as encrypting only the user's data itself (often located within the {{ic|/home}} directory, or on removable media like a data DVD), data encryption is the simplest and least intrusive use of disk encryption, but has some significant drawbacks.<br />
: In modern computing systems, there are many background processes that may cache/store information about user data or parts of the data itself in non-encrypted areas of the hard drive, like:<br />
<br />
:* swap partitions<br />
:** (potential remedies: disable swapping, or use [[encrypted swap]] as well)<br />
:* {{ic|/tmp}} (temporary files created by user applications)<br />
:** (potential remedies: avoid such applications; mount {{ic|/tmp}} inside a [[ramdisk]])<br />
:* {{ic|/var}} (log files and databases and such; for example, mlocate stores an index of all file names in {{ic|/var/lib/mlocate/mlocate.db}})<br />
<br />
:In addition, mere data encryption will leave you vulnerable to offline system tampering attacks (e.g. someone installing a hidden program that [[Wikipedia:Keystroke_logging|records]] the passphrase you use to unlock the encrypted data, or waits for you to unlock it and then secretly copies/sends some of the data to a location where the attacker can retrieve it).<br />
<br />
; System encryption<br />
: Defined as the encryption of the operating system ''and'' user data, system encryption helps to address some of the inadequacies of data encryption.<br />
<br />
: Benefits:<br />
:* prevents unauthorized physical access to (and tampering with) operating system files ''(but see warning above)''<br />
:* prevents unauthorized physical access to private data that may be cached by the system<br />
: Disadvantages:<br />
:* unlocking of the encrypted parts of the disk can no longer happen during or after user login; it must now happen at boot time<br />
<br />
In practice, there is not always a clear line between data encryption and system encryption, and many different compromises and customized setups are possible.<br />
<br />
In any case, disk encryption should only be viewed as an adjunct to the existing security mechanisms of the operating system - focused on securing offline physical access, while relying on ''other'' parts of the system to provide things like network security and user-based access control.<br />
<br />
See also [[Wikipedia:Disk encryption]].<br />
<br />
==Available methods==<br />
<br />
All disk encryption methods operate in such a way that even though the disk actually holds encrypted data, the operating system and applications "see" it as the corresponding normal readable data as long as the cryptographic container (i.e. the logical part of the disk that holds the encrypted data) has been "unlocked" and mounted.<br />
<br />
For this to happen, some "secret information" (usually in the form of a keyfile and/or passphrase) needs to be supplied by the user, from which the actual encryption key can be derived (and stored in the kernel keyring for the duration of the session).<br />
<br />
If you are completely unfamiliar with this sort of operation, please also read the [[#How the encryption works]] section below.<br />
<br />
The available disk encryption methods can be separated into two types by their layer of operation:<br />
<br />
===Stacked filesystem encryption===<br />
<br />
Stacked filesystem encryption solutions are implemented as a layer that stacks on top of an existing filesystem, causing all files written to an encryption-enabled folder to be encrypted on-the-fly before the underlying filesystem writes them to disk, and decrypted whenever the filesystem reads them from disk. This way, the files are stored in the host filesystem in encrypted form (meaning that their contents, and usually also their file/folder names, are replaced by random-looking data of roughly the same length), but other than that they still exist in that filesystem as they would without encryption, as normal files / symlinks / hardlinks / etc.<br />
<br />
The way it is implemented, is that to unlock the folder storing the raw encrypted files in the host filesystem ("lower directory"), it is mounted (using a special stacked pseudo-filesystem) onto itself or optionally a different location ("upper directory"), where the same files then appear in readable form - until it is unmounted again, or the system is turned off.<br />
<br />
Available solutions in this category are [[eCryptfs]] and [[EncFS]].<br />
<br />
===Block device encryption===<br />
<br />
Block device encryption methods, on the other hand, operate ''below'' the filesystem layer and make sure that everything written to a certain block device (i.e. a whole disk, or a partition, or a file acting as a virtual loop-back device) is encrypted. This means that while the block device is offline, its whole content looks like a large blob of random data, with no way of determining what kind of filesystem and data it contains. Accessing the data happens, again, by mounting the protected container (in this case the block device) to an arbitrary location in a special way.<br />
<br />
The following "block device encryption" solutions are available in Arch Linux:<br />
<br />
;loop-AES: loop-AES is a descendant of cryptoloop and is a secure and fast solution to system encryption. However, loop-AES is considered less user-friendly than other options as it requires non-standard kernel support. <br />
<br />
;dm-crypt: [[dm-crypt]] is the standard device-mapper encryption functionality provided by the Linux kernel. It can be used directly by those who like to have full control over all aspects of partition and key management. The management of dm-crypt is done with the {{Pkg|cryptsetup}} userspace utility. It can be used for the following types of block-device encryption: ''LUKS'' (default), ''plain'', and has limited features for ''loopAES'' and ''Truecrypt'' devices. <br />
:* LUKS, used by default, is an additional convenience layer which stores all of the needed setup information for dm-crypt on the disk itself and abstracts partition and key management in an attempt to improve ease of use and cryptographic security. <br />
:* plain dm-crypt mode, being the original kernel functionality, does not employ the convenience layer. It is more difficult to apply the same cryptographic strength with it. When doing so, longer keys (passphrases or keyfiles) are the result. It has, however, other advantages, described in the following [[#Practical implications|comparison table]]. <br />
<br />
;TrueCrypt/VeraCrypt: A highly portable format, supporting encryption of whole disks/partitions or file containers, with compatibility across all major operating systems. [[TrueCrypt]] was discontinued by its developers in May 2014. The general consensus among users is to use the actively developed fork VeraCrypt instead, which was audited in 2016.<br />
<br />
For practical implications of the chosen layer of operation, see the [[#Practical implications|comparison table]] below, as well as the general write up for [http://ksouedu.com/doc/ecryptfs-utils/ecryptfs-faq.html#compare eCryptfs]. See [[:Category:Encryption]] for the available content of the methods compared below, as well as other tools not included in the table.<br />
<br />
===Comparison table===<br />
<br />
The column "dm-crypt +/- LUKS" denotes features of dm-crypt for both LUKS ("+") and plain ("-") encryption modes. If a specific feature requires using LUKS, this is indicated by "(with LUKS)". Likewise "(without LUKS)" indicates usage of LUKS is counter-productive to achieve the feature and plain mode should be used.<br />
<br />
{| class="wikitable" style="text-align:center; cell-padding:100px; "<br />
! style="text-align:left; background:#ddd"|<br />
=====Summary=====<br />
! style="background:#ddd" | Loop-AES<br />
! style="background:#ddd" | dm-crypt +/- LUKS<br />
! style="background:#ddd" | TrueCrypt<br />
! style="background:#ddd" | VeraCrypt<br />
! style="background:#ddd" | eCryptfs<br />
! style="background:#ddd" | EncFs<br />
|-<br />
! style="text-align:left; font-weight:normal; background:#eee" | Type<br />
| block device encryption<br />
| block device encryption<br />
| block device encryption<br />
| block device encryption<br />
| stacked filesystem encryption<br />
| stacked filesystem encryption<br />
|-<br />
! style="text-align:left; font-weight:normal; background:#eee" | Main selling points<br />
| longest-existing one; possibly the fastest; works on legacy systems<br />
| de-facto standard for block device encryption on Linux; very flexible<br />
| very portable, well-polished, self-contained solution<br />
| actively developed fork of TrueCrypt and de facto replacement<br />
| slightly faster than EncFS; individual encrypted files portable between systems<br />
| easiest one to use; supports non-root administration<br />
|-<br />
! style="text-align:left; font-weight:normal; background:#eee" | Availability in Arch Linux<br />
| must manually compile custom kernel<br />
| ''kernel modules:'' already shipped with default kernel; ''tools:'' {{Pkg|device-mapper}}, {{Pkg|cryptsetup}} [core]<br />
| {{pkg|truecrypt}} [extra] (discontinued) or the backwards-compatible {{pkg|veracrypt}} [community]<br />
| {{pkg|veracrypt}} [community]<br />
| ''kernel module:'' already shipped with default kernel; ''tools:'' {{Pkg|ecryptfs-utils}} [community]<br />
| {{Pkg|encfs}} [community]<br />
|-<br />
! style="text-align:left; font-weight:normal; background:#eee" | License<br />
| GPL<br />
| GPL<br />
| TrueCrypt License 3.1[[#See also|[1]]]<br />
| Apache License 2.0, parts subject to TrueCrypt License v3.0[[#See also|[1]]]<br />
| GPL<br />
| GPL<br />
|-<br />
! style="text-align:left; background:#ddd"|<br />
=====Basic classification=====<br />
! style="background:#ddd" | Loop-AES<br />
! style="background:#ddd" | dm-crypt +/- LUKS<br />
! style="background:#ddd" | TrueCrypt<br />
! style="background:#ddd" | VeraCrypt<br />
! style="background:#ddd" | eCryptfs<br />
! style="background:#ddd" | EncFs<br />
|-<br />
! style="text-align:left; font-weight:normal; background:#eee" | Encrypts<br />
| whole block devices<br />
| whole block devices<br />
| whole block devices<br />
| whole block devices<br />
| files<br />
| files<br />
|-<br />
! style="text-align:left; font-weight:normal; background:#eee" | Container for encrypted data may be...<br />
| a disk or disk partition / a file acting as a virtual partition<br />
| a disk or disk partition / a file acting as a virtual partition<br />
| a disk or disk partition / a file acting as a virtual partition<br />
| a disk or disk partition / a file acting as a virtual partition<br />
| a directory in an existing file system<br />
| a directory in an existing file system<br />
|-<br />
! style="text-align:left; font-weight:normal; background:#eee" | Relation to filesystem<br />
| operates below filesystem layer: does not care whether the content of the encrypted block device is a filesystem, a partition table, a LVM setup, or anything else<br />
| operates below filesystem layer: does not care whether the content of the encrypted block device is a filesystem, a partition table, a LVM setup, or anything else<br />
| operates below filesystem layer: does not care whether the content of the encrypted block device is a filesystem, a partition table, a LVM setup, or anything else<br />
| operates below filesystem layer: does not care whether the content of the encrypted block device is a filesystem, a partition table, a LVM setup, or anything else<br />
| adds an additional layer to an existing filesystem, to automatically encrypt/decrypt files whenever they are written/read<br />
| adds an additional layer to an existing filesystem, to automatically encrypt/decrypt files whenever they are written/read<br />
|-<br />
! style="text-align:left; font-weight:normal; background:#eee" | Encryption implemented in...<br />
| kernelspace<br />
| kernelspace<br />
| kernelspace<br />
| kernelspace<br />
| kernelspace<br />
| userspace (using FUSE)<br />
|-<br />
! style="text-align:left; font-weight:normal; background:#eee" | Cryptographic metadata stored in...<br />
| ?<br />
| with LUKS: LUKS Header <br />
| begin/end of (decrypted) device ([http://www.truecrypt.org/docs/volume-format-specification format])<br />
| begin/end of (decrypted) device ([https://www.veracrypt.fr/en/VeraCrypt%20Volume%20Format%20Specification.html format spec])<br />
| header of each encrypted file<br />
| control file at the top level of each EncFs container<br />
|-<br />
! style="text-align:left; font-weight:normal; background:#eee" | Wrapped encryption key stored in...<br />
| ?<br />
| with LUKS: LUKS header <br />
| begin/end of (decrypted) device ([http://www.truecrypt.org/docs/volume-format-specification format spec])<br />
| begin/end of (decrypted) device ([https://www.veracrypt.fr/en/VeraCrypt%20Volume%20Format%20Specification.html format spec])<br />
| key file that can be stored anywhere<br />
| key file that can be stored anywhere<br />
[https://github.com/rfjakob/encfs/blob/next/encfs/encfs.pod#environment-variables][https://github.com/vgough/encfs/issues/48#issuecomment-69301831]<br />
|-<br />
! style="text-align:left; background:#ddd"|<br />
=====Practical implications=====<br />
! style="background:#ddd" | Loop-AES<br />
! style="background:#ddd" | dm-crypt +/- LUKS<br />
! style="background:#ddd" | TrueCrypt<br />
! style="background:#ddd" | VeraCrypt<br />
! style="background:#ddd" | eCryptfs<br />
! style="background:#ddd" | EncFs<br />
|-<br />
! style="text-align:left; font-weight:normal; background:#eee" | File metadata (number of files, dir structure, file sizes, permissions, mtimes, etc.) is encrypted<br />
| <span style="color:#080; font-size:2em">✔</span><br />
| <span style="color:#080; font-size:2em">✔</span><br />
| <span style="color:#080; font-size:2em">✔</span><br />
| <span style="color:#080; font-size:2em">✔</span><br />
| <span style="color:#f00; font-size:2em">✖</span><br>(file and dir names can be encrypted though)<br />
| <span style="color:#f00; font-size:2em">✖</span><br>(file and dir names can be encrypted though)<br />
|-<br />
! style="text-align:left; font-weight:normal; background:#eee" | Can be used to custom<encrypt whole hard drives (including partition tables)<br />
| <span style="color:#080; font-size:2em">✔</span><br />
| <span style="color:#080; font-size:2em">✔</span><br />
| <span style="color:#080; font-size:2em">✔</span><br />
<br />
| <span style="color:#080; font-size:2em">✔</span><br />
| <span style="color:#f00; font-size:2em">✖</span><br />
| <span style="color:#f00; font-size:2em">✖</span><br />
|-<br />
! style="text-align:left; font-weight:normal; background:#eee" | Can be used to encrypt swap space<br />
| <span style="color:#080; font-size:2em">✔</span><br />
| <span style="color:#080; font-size:2em">✔</span><br />
| <span style="color:#080; font-size:2em">✔</span><br />
| <span style="color:#080; font-size:2em">✔</span><br />
| <span style="color:#f00; font-size:2em">✖</span><br />
| <span style="color:#f00; font-size:2em">✖</span><br />
|-<br />
<br />
! style="text-align:left; font-weight:normal; background:#eee" | Can be used without pre-allocating a fixed amount of space for the encrypted data container<br />
| <span style="color:#f00; font-size:2em">✖</span><br />
| <span style="color:#f00; font-size:2em">✖</span><br />
| <span style="color:#f00; font-size:2em">✖</span><br />
| <span style="color:#f00; font-size:2em">✖</span><br />
| <span style="color:#080; font-size:2em">✔</span><br />
| <span style="color:#080; font-size:2em">✔</span><br />
|-<br />
! style="text-align:left; font-weight:normal; background:#eee" | Can be used to protect existing filesystems without block device access, e.g. NFS or Samba shares, cloud storage, etc.<br />
| <span style="color:#f00; font-size:2em">✖</span><br>[[#See also|[2]]]<br />
| <span style="color:#f00; font-size:2em">✖</span><br />
| <span style="color:#f00; font-size:2em">✖</span><br />
| <span style="color:#f00; font-size:2em">✖</span><br />
| <span style="color:#080; font-size:2em">✔</span><br />
| <span style="color:#080; font-size:2em">✔</span><br />
|-<br />
! style="text-align:left; font-weight:normal; background:#eee" | Allows offline file-based backups of encrypted files<br />
| <span style="color:#f00; font-size:2em">✖</span><br />
| <span style="color:#f00; font-size:2em">✖</span><br />
| <span style="color:#f00; font-size:2em">✖</span><br />
| <span style="color:#f00; font-size:2em">✖</span><br />
| <span style="color:#080; font-size:2em">✔</span><br />
| <span style="color:#080; font-size:2em">✔</span><br />
|-<br />
! style="text-align:left; background:#ddd"|<br />
=====Usability features=====<br />
! style="background:#ddd" | Loop-AES<br />
! style="background:#ddd" | dm-crypt +/- LUKS<br />
! style="background:#ddd" | TrueCrypt<br />
! style="background:#ddd" | VeraCrypt<br />
! style="background:#ddd" | eCryptfs<br />
! style="background:#ddd" | EncFs<br />
|-<br />
! style="text-align:left; font-weight:normal; background:#eee" | Support for automounting on login<br />
| ?<br />
| <span style="color:#080; font-size:2em">✔</span><br />
| <span style="color:#080; font-size:2em">✔</span><br />
with [[TrueCrypt#Automounting_using_.2Fetc.2Fcrypttab|systemd and /etc/crypttab]]<br />
| <span style="color:#080; font-size:2em">✔</span><br />
with [[TrueCrypt#Automounting_using_.2Fetc.2Fcrypttab|systemd and /etc/crypttab]]<br />
| <span style="color:#080; font-size:2em">✔</span><br />
| <span style="color:#080; font-size:2em">✔</span><br />
|-<br />
! style="text-align:left; font-weight:normal; background:#eee" | Support for automatic unmounting in case of inactivity<br />
| ?<br />
| ?<br />
| ?<br />
| ?<br />
| ?<br />
| <span style="color:#080; font-size:2em">✔</span><br />
|-<br />
! style="text-align:left; font-weight:normal; background:#eee" | Non-root users can create/destroy containers for encrypted data<br />
| <span style="color:#f00; font-size:2em">✖</span><br />
| <span style="color:#f00; font-size:2em">✖</span><br />
| <span style="color:#f00; font-size:2em">✖</span><br />
| <span style="color:#f00; font-size:2em">✖</span><br />
| limited<br />
| <span style="color:#080; font-size:2em">✔</span><br />
|-<br />
! style="text-align:left; font-weight:normal; background:#eee" | Provides a GUI<br />
| <span style="color:#f00; font-size:2em">✖</span><br />
| <span style="color:#f00; font-size:2em">✖</span><br />
| <span style="color:#080; font-size:2em">✔</span><br />
| <span style="color:#080; font-size:2em">✔</span><br />
| <span style="color:#f00; font-size:2em">✖</span><br />
| <span style="color:#080; font-size:2em">✔</span><br />
[http://www.libertyzero.com/GEncfsM/][https://launchpad.net/gencfsm]<br />
|-<br />
! style="text-align:left; background:#ddd"|<br />
=====Security features=====<br />
! style="background:#ddd" | Loop-AES<br />
! style="background:#ddd" | dm-crypt +/- LUKS<br />
! style="background:#ddd" | TrueCrypt<br />
! style="background:#ddd" | VeraCrypt<br />
! style="background:#ddd" | eCryptfs<br />
! style="background:#ddd" | EncFs<br />
|-<br />
<br />
! style="text-align:left; font-weight:normal; background:#eee" | Supported ciphers<br />
| AES<br />
| AES, Anubis, CAST5/6, Twofish, Serpent, Camellia, Blowfish,… (every cipher the kernel Crypto API offers)<br />
| AES, Twofish, Serpent<br />
| AES, Twofish, Serpernt, Camellia, Kuznyechik<br />
| AES, Blowfish, Twofish...<br />
| AES, Blowfish, Twofish, and any other ciphers available on the system<br />
|-<br />
! style="text-align:left; font-weight:normal; background:#eee" | Support for salting<br />
| ?<br />
| <span style="color:#080; font-size:2em">✔</span><br>(with LUKS)<br />
| <span style="color:#080; font-size:2em">✔</span><br />
| <span style="color:#080; font-size:2em">✔</span><br />
| <span style="color:#080; font-size:2em">✔</span><br />
| ?<br />
|-<br />
! style="text-align:left; font-weight:normal; background:#eee" | Support for cascading multiple ciphers<br />
| ?<br />
| Not in one device, but blockdevices can be cascaded<br />
| <span style="color:#080; font-size:2em">✔</span><br />
AES-Twofish, AES-Twofish-Serpent, Serpent-AES, Serpent-Twofish-AES, Twofish-Serpent<br />
| <span style="color:#080; font-size:2em">✔</span><br />
AES-Twofish, AES-Twofish-Serpent, Serpent-AES, Serpent-Twofish-AES, Twofish-Serpent<br />
| ?<br />
| <span style="color:#f00; font-size:2em">✖</span><br />
|-<br />
! style="text-align:left; font-weight:normal; background:#eee" | Support for key-slot diffusion<br />
| ?<br />
| <span style="color:#080; font-size:2em">✔</span><br>(with LUKS)<br />
| ?<br />
| ?<br />
| ?<br />
| ?<br />
|-<br />
! style="text-align:left; font-weight:normal; background:#eee" | Protection against key scrubbing<br />
| <span style="color:#080; font-size:2em">✔</span><br />
| <span style="color:#080; font-size:2em">✔</span><br>(without LUKS)<br />
| ?<br />
| ?<br />
| ?<br />
| ?<br />
|-<br />
! style="text-align:left; font-weight:normal; background:#eee" | Support for multiple (independently revocable) keys for the same encrypted data<br />
| ?<br />
| <span style="color:#080; font-size:2em">✔</span><br>(with LUKS)<br />
| ?<br />
| ?<br />
| ?<br />
| <span style="color:#f00; font-size:2em">✖</span><br />
|-<br />
! style="text-align:left; background:#ddd"|<br />
<br />
=====Performance features=====<br />
! style="background:#ddd" | Loop-AES<br />
! style="background:#ddd" | dm-crypt +/- LUKS<br />
! style="background:#ddd" | TrueCrypt<br />
! style="background:#ddd" | VeraCrypt<br />
! style="background:#ddd" | eCryptfs<br />
! style="background:#ddd" | EncFs<br />
|-<br />
! style="text-align:left; font-weight:normal; background:#eee" | Multithreading support<br />
| ?<br />
| <span style="color:#080; font-size:2em">✔</span><br>[[#See also|[8]]]<br />
| <span style="color:#080; font-size:2em">✔</span><br />
| <span style="color:#080; font-size:2em">✔</span><br />
| ?<br />
| ?<br />
|-<br />
! style="text-align:left; font-weight:normal; background:#eee" | Hardware-accelerated encryption support<br />
| <span style="color:#080; font-size:2em">✔</span><br />
| <span style="color:#080; font-size:2em">✔</span><br />
| <span style="color:#080; font-size:2em">✔</span><br />
| <span style="color:#080; font-size:2em">✔</span><br />
| <span style="color:#080; font-size:2em">✔</span><br />
| <span style="color:#080; font-size:2em">✔</span><br>[[#See also|[13]]]<br />
|-<br />
! style="text-align:left; background:#ddd"|<br />
=====Block device encryption specific=====<br />
! style="background:#ddd" | Loop-AES<br />
! style="background:#ddd" | dm-crypt +/- LUKS<br />
! style="background:#ddd" | TrueCrypt<br />
! style="background:#ddd" | VeraCrypt<br />
! style="background:#ddd" | <br />
! style="background:#ddd" | <br />
|-<br />
! style="text-align:left; font-weight:normal; background:#eee" | Support for (manually) resizing the encrypted block device in-place<br />
| ?<br />
| <span style="color:#080; font-size:2em">✔</span><br />
| <span style="color:#f00; font-size:2em">✖</span><br />
| <span style="color:#f00; font-size:2em">✖</span><br />
! style="background:#ddd" | <br />
! style="background:#ddd" | <br />
|-<br />
! style="text-align:left; background:#ddd"|<br />
=====Stacked filesystem encryption specific=====<br />
! style="background:#ddd" |<br />
! style="background:#ddd" |<br />
! style="background:#ddd" |<br />
! style="background:#ddd" |<br />
! style="background:#ddd" | eCryptfs<br />
! style="background:#ddd" | EncFs<br />
|-<br />
! style="text-align:left; font-weight:normal; background:#eee" | Supported file systems<br />
! style="background:#ddd" |<br />
! style="background:#ddd" |<br />
! style="background:#ddd" |<br />
! style="background:#ddd" |<br />
| ext3, ext4, xfs (with caveats), jfs, nfs...<br />
| ext3, ext4, xfs (with caveats), jfs, nfs, cifs...<br />
[https://github.com/vgough/encfs]<br />
|-<br />
! style="text-align:left; font-weight:normal; background:#eee" | Ability to encrypt filenames<br />
! style="background:#ddd" |<br />
! style="background:#ddd" |<br />
! style="background:#ddd" |<br />
! style="background:#ddd" |<br />
| <span style="color:#080; font-size:2em">✔</span><br />
| <span style="color:#080; font-size:2em">✔</span><br />
|-<br />
! style="text-align:left; font-weight:normal; background:#eee" | Ability to ''not'' encrypt filenames<br />
! style="background:#ddd" |<br />
! style="background:#ddd" |<br />
! style="background:#ddd" |<br />
! style="background:#ddd" |<br />
| <span style="color:#080; font-size:2em">✔</span><br />
| <span style="color:#080; font-size:2em">✔</span><br />
|-<br />
! style="text-align:left; font-weight:normal; background:#eee" | Optimized handling of sparse files<br />
! style="background:#ddd" |<br />
! style="background:#ddd" |<br />
! style="background:#ddd" |<br />
! style="background:#ddd" |<br />
| <span style="color:#f00; font-size:2em">✖</span><br />
| <span style="color:#080; font-size:2em">✔</span><br />
|-<br />
! style="text-align:left; background:#ddd"|<br />
=====Compatibility & prevalence=====<br />
! style="background:#ddd" | Loop-AES<br />
! style="background:#ddd" | dm-crypt +/- LUKS<br />
! style="background:#ddd" | TrueCrypt<br />
! style="background:#ddd" | VeraCrypt<br />
! style="background:#ddd" | eCryptfs<br />
! style="background:#ddd" | EncFs<br />
|-<br />
! style="text-align:left; font-weight:normal; background:#eee" | Supported Linux kernel versions<br />
| 2.0 or newer<br />
| CBC-mode since 2.6.4, ESSIV 2.6.10, LRW 2.6.20, XTS 2.6.24<br />
| ?<br />
| ?<br />
| ?<br />
| 2.4 or newer<br />
|-<br />
! style="text-align:left; font-weight:normal; background:#eee" | Encrypted data can also be accessed from Windows<br />
| <span style="color:#080; font-size:2em">✔</span><br>(with [[#See also|[3]]], [[#See also|[14]]])<br />
|?<br>(with [[#See also|[4]]], [[#See also|[14]]])<br />
| <span style="color:#080; font-size:2em">✔</span><br />
| <span style="color:#080; font-size:2em">✔</span><br />
| ?<br />
| ?<br>[[#See also|[9]]]<br />
|-<br />
! style="text-align:left; font-weight:normal; background:#eee" | Encrypted data can also be accessed from Mac OS X<br />
| ?<br />
| ?<br />
| <span style="color:#080; font-size:2em">✔</span><br />
| <span style="color:#080; font-size:2em">✔</span><br />
| ?<br />
| <span style="color:#080; font-size:2em">✔</span><br>[[#See also|[5]]]<br />
|-<br />
! style="text-align:left; font-weight:normal; background:#eee" | Encrypted data can also be accessed from FreeBSD<br />
| ?<br />
| ?<br />
| <span style="color:#080;; font-size:2em">✔</span><br />
(with VeraCrypt)<br />
| <span style="color:#080; font-size:2em">✔</span><br><br />
| ?<br />
| <span style="color:#080; font-size:2em">✔</span><br>[[#See also|[6]]]<br />
|-<br />
<br />
! style="text-align:left; font-weight:normal; background:#eee" | Used by<br />
| ?<br />
| Debian/Ubuntu installer (system encryption)<br>Fedora installer <br />
| ?<br />
| ?<br />
| Ubuntu installer (home dir encryption)<br>Chromium OS (encryption of cached user data [[#See also|[7]]])<br />
| ?<br />
|}<br />
<br />
==Preparation==<br />
<br />
===Choosing a setup===<br />
<br />
Which disk encryption setup is appropriate for you will depend on your goals (please read [[#Why use encryption?]] above) and system parameters.<br />
<br />
Among other things, you will need to answer the following questions:<br />
<br />
;What kind of "attacker" do you want to protect against?<br />
<br />
* Casual computer user snooping around your disk when your system is turned off / stolen / etc.<br />
* Professional cryptanalyst who can get repeated read/write access to your system before and after you use it<br />
* Anything in between<br />
<br />
;What encryption strategy shall be employed?<br />
<br />
* Data encryption<br />
* System encryption<br />
* Something in between<br />
<br />
;How should swap, {{ic|/tmp}}, etc. be taken care of?<br />
<br />
* Ignore, and hope no data is leaked<br />
* Disable or mount as ramdisk<br />
* Encrypt ''(as part of full disk encryption, or separately)''<br />
<br />
;How should encrypted parts of the disk be unlocked?<br />
<br />
* Passphrase ''(same as login password, or separate)''<br />
* Keyfile ''(e.g. on a USB stick, that you keep in a safe place or carry around with yourself)''<br />
* Both<br />
<br />
;''When'' should encrypted parts of the disk be unlocked?<br />
<br />
* Before boot<br />
* During boot<br />
* At login<br />
* Manually on demand ''(after login)''<br />
<br />
;How should multiple users be accomodated?<br />
<br />
* Not at all<br />
* Using a shared passphrase/key<br />
* Independently issued and revocable passphrases/keys for the same encrypted part of the disk<br />
* Separate encrypted parts of the disk for different users<br />
<br />
Then you can go on to make the required technical choices (see [[#Available methods]] above, and [[#How the encryption works]] below), regarding:<br />
<br />
* stacked filesystem encryption vs. blockdevice encryption<br />
* key management<br />
* cipher and mode of operation<br />
* metadata storage<br />
* location of the "lower directory" (in case of stacked filesystem encryption)<br />
<br />
=== Examples ===<br />
<br />
In practice, it could turn out something like:<br />
<br />
;Example 1: Simple data encryption (internal hard drive) using a virtual folder called {{ic|~/Private}} in the user's home directory encrypted with [[EncFS]]<br>└──> encrypted versions of the files stored on-disk in {{ic|~/.Private}}<br>└──> unlocked on demand with dedicated passphrase<br />
<br />
;Example 2: Partial system encryption with each user's home directory encrypted with [[ECryptfs]]<br>└──> unlocked on respective user login, using login passphrase<br>└──> {{ic|swap}} and {{ic|/tmp}} partitions encrypted with [[Dm-crypt with LUKS]], using an automatically generated per-session throwaway key<br>└──> indexing/caching of contents of {{ic|/home}} by ''slocate'' (and similar apps) disabled.<br />
<br />
;Example 3: System encryption - whole hard drive except {{ic|/boot}} partition (however, {{ic|/boot}} can be encrypted with [[Dm-crypt/Encrypting_an_entire_system#Encrypted_boot_partition_.28GRUB.29|GRUB]]) encrypted with [[Dm-crypt with LUKS]] <br>└──> unlocked during boot, using passphrases or USB stick with keyfiles<br>└──> Maybe different passphrases/keys per user - independently revocable<br>└──> Maybe encryption spanning multiple drives or partition layout flexibility with [[Dm-crypt/Encrypting an entire system#LUKS on LVM|LUKS on LVM]]<br />
<br />
;Example 4: Hidden/plain system encryption - whole hard drive encrypted with [[dm-crypt|plain dm-crypt]] <br>└──> USB-boot, using dedicated passphrase plus USB stick with keyfile<br>└──> data integrity checked before mounting<br>└──> {{ic|/boot}} partition located on aforementioned USB stick<br />
<br />
Many other combinations are of course possible. You should carefully plan what kind of setup will be appropriate for your system.<br />
<br />
===Choosing a strong passphrase===<br />
<br />
See [[Security#Passwords]].<br />
<br />
===Preparing the disk===<br />
<br />
Before setting up disk encryption on a (part of a) disk, consider securely wiping it first. This consists of overwriting the entire drive or partition with a stream of zero bytes or random bytes, and is done for one or both of the following reasons:<br />
<br />
;Prevent recovery of previously stored data<br />
<br />
Disk encryption does not change the fact that individual sectors are only overwritten on demand, when the file system creates or modifies the data those particular sectors hold (see [[#How the encryption works]] below). Sectors which the filesystem considers "not currently used" are not touched, and may still contain remnants of data from previous filesystems. The only way to make sure that all data which you previously stored on the drive can not be [[Wikipedia:Data_recovery|recovered]], is to manually erase it.<br />
For this purpose it does not matter whether zero bytes or random bytes are used (although wiping with zero bytes will be much faster).<br />
<br />
;Prevent disclosure of usage patterns on the encrypted drive<br />
<br />
Ideally, the whole encrypted part of the disk should be indistinguishable from uniformly random data. This way, no unauthorized person can know which and how many sectors actually contain encrypted data - which may be a desirable goal in itself (as part of true confidentiality), and also serves as an additional barrier against attackers trying to break the encryption.<br />
In order to satisfy this goal, wiping the disk using high-quality random bytes is crucial.<br />
<br />
The second goal only makes sense in combination with block device encryption, because in the case of stacked filesystem encryption the encrypted data can easily be located anyways (in the form of distinct encrypted files in the host filesystem). Also note that even if you only intend to encrypt a particular folder, you will have to erase the whole partition if you want to get rid of files that were previously stored in that folder in unencrypted form (due to [[Wikipedia::File_system_fragmentation|disk fragmentation]]). If there are other folders on the same partition, you will have to back them up and move them back afterwards.<br />
<br />
Once you have decided which kind of disk erasure you want to perform, refer to the [[Securely wipe disk]] article for technical instructions.<br />
<br />
{{Tip|In deciding which method to use for secure erasure of a hard disk drive, remember that this will not need to be performed more than once for as long as the drive is used as an encrypted drive.}}<br />
<br />
==How the encryption works==<br />
<br />
This section is intended as a high-level introduction to the concepts and processes which are at the heart of usual disk encryption setups.<br />
<br />
It does not go into technical or mathematical details (consult the appropriate literature for that), but should provide a system administrator with a rough understanding of how different setup choices (especially regarding key management) can affect usability and security.<br />
<br />
===Basic principle===<br />
<br />
For the purposes of disk encryption, each blockdevice (or individual file in the case of stacked filesystem encryption) is divided into '''sectors''' of equal length, for example 512 bytes (4,096 bits). The encryption/decryption then happens on a per-sector basis, so the n'th sector of the blockdevice/file on disk will store the encrypted version of the n'th sector of the original data.<br />
<br />
Whenever the operating system or an application requests a certain fragment of data from the blockdevice/file, the whole sector (or sectors) that contains the data will be read from disk, decrypted on-the-fly, and temporarily stored in memory:<br />
<br />
╔═══════╗<br />
sector 1 ║"???.."║<br />
╠═══════╣ ╭┈┈┈┈┈╮<br />
sector 2 ║"???.."║ ┊ key ┊<br />
╠═══════╣ ╰┈┈┬┈┈╯<br />
: : │<br />
╠═══════╣ ▼ ┣┉┉┉┉┉┉┉┫<br />
sector n ║"???.."║━━━━━━━(decryption)━━━━━━▶┋"abc.."┋ sector n<br />
╠═══════╣ ┣┉┉┉┉┉┉┉┫<br />
: :<br />
╚═══════╝<br />
<br />
encrypted unencrypted<br />
blockdevice or data in RAM<br />
file on disk<br />
<br />
Similarly, on each write operation, all sectors that are affected must be re-encrypted complelety (while the rest of the sectors remain untouched). <br />
<br />
In order to be able to de/encrypt data, the disk encryption system needs to know the unique secret "key" associated with it. Whenever the encrypted block device or folder in question is to be mounted, its corresponding key (called henceforth its "master key") must be supplied. <br />
<br />
The entropy of the key is of utmost importance for the security of the encryption. A randomly generated byte string of a certain length, for example 32 bytes (256 bits), has desired properties but is not feasible to remember and apply manually during the mount. <br />
<br />
For that reason two techniques are used as aides. The first is the application of cryptography to increase the entropic property of the master key, usually involving a separate human-friendly passphrase. For the different types of encryption the [[#Comparison table]] lists respective features. The second method is to create a keyfile with high entropy and store it on a medium separate from the data drive to be encrypted. <br />
<br />
See also [[Wikipedia:Authenticated encryption]].<br />
<br />
===Keys, keyfiles and passphrases===<br />
<br />
The following are examples how to store and cryptographically secure a master key with a keyfile:<br />
<br />
;Stored in a plaintext keyfile<br />
<br />
Simply storing the master key in a file (in readable form) is the simplest option. The file - called a "keyfile" - can be placed on a USB stick that you keep in a secure location and only connect to the computer when you want to mount the encrypted parts of the disk (e.g. during boot or login).<br />
<br />
;Stored in passphrase-protected form in a keyfile or on the disk itself<br />
<br />
The master key (and thus the encrypted data) can be protected with a secret passphrase, which you will have to remember and enter each time you want to mount the encrypted block device or folder. See [[#Cryptographic metadata]] below for details.<br />
<br />
;Randomly generated on-the-fly for each session<br />
<br />
In some cases, e.g. when encrypting swap space or a {{ic|/tmp}} partition, it is not necessary to keep a persistent master key at all. A new throwaway key can be randomly generated for each session, without requiring any user interaction. This means that once unmounted, all files written to the partition in question can never be decrypted again by ''anyone'' - which in those particular use-cases is perfectly fine.<br />
<br />
===Cryptographic metadata===<br />
<br />
Frequently the encryption techniques use cryptographic functions to enhance the security of the master key itself. On mount of the encrypted device the passphrase or keyfile is passed through these and only the result can unlock the master key to decrypt the data. <br />
<br />
A common setup is to apply so-called "key stretching" to the passphrase (via a "key derivation function"), and use the resulting enhanced passphrase as the mount key for decrypting the actual master key (which has been previously stored in encrypted form):<br />
<br />
╭┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈╮ ╭┈┈┈┈┈┈┈┈┈┈┈╮<br />
┊ mount passphrase ┊━━━━━⎛key derivation⎞━━━▶┊ mount key ┊<br />
╰┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈╯ ,───⎝ function ⎠ ╰┈┈┈┈┈┬┈┈┈┈┈╯<br />
╭──────╮ ╱ │<br />
│ salt │───────────´ │<br />
╰──────╯ │<br />
╭─────────────────────╮ ▼ ╭┈┈┈┈┈┈┈┈┈┈┈┈╮<br />
│ encrypted master key│━━━━━━━━━━━━━━━━━━━━━━(decryption)━━━▶┊ master key ┊<br />
╰─────────────────────╯ ╰┈┈┈┈┈┈┈┈┈┈┈┈╯<br />
<br />
The '''key derivation function''' (e.g. PBKDF2 or scrypt) is deliberately slow (it applies many iterations of a hash function, e.g. 1000 iterations of HMAC-SHA-512), so that brute-force attacks to find the passphrase are rendered infeasible. For the normal use-case of an authorized user, it will only need to be calculated once per session, so the small slowdown is not a problem.<br />
It also takes an additional blob of data, the so-called "'''salt'''", as an argument - this is randomly generated once during set-up of the disk encryption and stored unprotected as part of the cryptographic metadata. Because it will be a different value for each setup, this makes it infeasible for attackers to speed up brute-force attacks using precomputed tables for the key derivation function.<br />
<br />
The '''encrypted master key''' can be stored on disk together with the encrypted data. This way, the confidentiality of the encrypted data depends completely on the secret passphrase. <br />
<br />
Additional security can be attained by instead storing the encrypted master key in a keyfile on e.g. a USB stick. This provides '''two-factor authentication''': Accessing the encrypted data now requires something only you ''know'' (the passphrase), and additionally something only you ''have'' (the keyfile).<br />
<br />
Another way of achieving two-factor authentication is to augment the above key retrieval scheme to mathematically "combine" the passphrase with byte data read from one or more external files (located on a USB stick or similar), before passing it to the key derivation function.The files in question can be anything, e.g. normal JPEG images, which can be beneficial for [[#Plausible deniability]]. They are still called "keyfiles" in this context, though.<br />
<br />
After it has been derived, the master key is securely stored in memory (e.g. in a kernel keyring), for as long as the encrypted block device or folder is mounted.<br />
<br />
It is usually not used for de/encrypting the disk data directly, though.<br />
For example, in the case of stacked filesystem encryption, each file can be automatically assigned its own encryption key. Whenever the file is to be read/modified, this file key first needs to be decrypted using the main key, before it can itself be used to de/encrypt the file contents:<br />
<br />
╭┈┈┈┈┈┈┈┈┈┈┈┈╮<br />
┊ master key ┊<br />
''file on disk:'' ╰┈┈┈┈┈┬┈┈┈┈┈┈╯<br />
┌ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ┐ │<br />
╎╭───────────────────╮╎ ▼ ╭┈┈┈┈┈┈┈┈┈┈╮<br />
╎│ encrypted file key│━━━━(decryption)━━━▶┊ file key ┊<br />
╎╰───────────────────╯╎ ╰┈┈┈┈┬┈┈┈┈┈╯<br />
╎┌───────────────────┐╎ ▼ ┌┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┐<br />
╎│ encrypted file │◀━━━━━━━━━━━━━━━━━(de/encryption)━━━▶┊ readable file ┊<br />
╎│ contents │╎ ┊ contents ┊<br />
╎└───────────────────┘╎ └┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┘<br />
└ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ┘<br />
<br />
In a similar manner, a separate key (e.g. one per folder) may be used for the encryption of file names in the case of stacked filesystem encryption.<br />
<br />
In the case of block device encryption one master key is used per device and, hence, all data. Some methods offer features to assign multiple passphrases/keyfiles for the same device and others not. Some use above mentioned functions to secure the master key and others give the control over the key security fully to the user. Two examples are explained by the cryptographic parameters used by [[dm-crypt]] in plain or LUKS modes. <br />
<br />
When comparing the parameters used by both modes one notes that dm-crypt plain mode has parameters relating to how to locate the keyfile (e.g. {{ic|--keyfile-size}}, {{ic|--keyfile-offset}}). The dm-crypt LUKS mode does not need these, because each blockdevice contains a header with the cryptographic metadata at the beginning. The header includes the used cipher, the encrypted master-key itself and parameters required for its derivation for decryption. The latter parameters in turn result from options used during initial encryption of the master-key (e.g. {{ic|--iter-time}}, {{ic|--use-random}}). <br />
<br />
For the dis-/advantages of the different techniques, please refer back to [[#Comparison table]] or browse the specific pages. <br />
<br />
See also:<br />
* [[Wikipedia:Passphrase]]<br />
* [[Wikipedia:Key (cryptography)]]<br />
* [[Wikipedia:Key management]]<br />
* [[Wikipedia:Key derivation function]]<br />
<br />
===Ciphers and modes of operation===<br />
<br />
The actual algorithm used for translating between pieces of unencrypted and encrypted data (so-called "plaintext" and "ciphertext") which correspond to each other with respect to a given encryption key, is called a "'''cipher'''".<br />
<br />
Disk encryption employs "block ciphers", which operate on fixed-length blocks of data, e.g. 16 bytes (128 bits). At the time of this writing, the predominantly used ones are:<br />
{| class="wikitable" style="margin:0 5em 1.5em 5em;"<br />
! scope="col" style="text-align:left" | <br />
! scope="col" style="text-align:left" | block&nbsp;size<br />
! scope="col" style="text-align:left" | key&nbsp;size<br />
! scope="col" style="text-align:left" | comment<br />
|-<br />
! scope="row" style="text-align:right" | [[Wikipedia:Advanced_Encryption_Standard|AES]]<br />
| 128 bits<br />
| 128, 192 or 256 bits<br />
| ''approved by the NSA for protecting "SECRET" and "TOP SECRET" classified US-government information (when used with a key size of 192 or 256 bits)''<br />
|-<br />
! scope="row" style="text-align:right" | [[wikipedia:Blowfish (cipher)|Blowfish]]<br />
| 64 bits<br />
| 32–448 bits<br />
| ''one of the first patent-free secure ciphers that became publicly available, hence very well established on Linux''<br />
|-<br />
! scope="row" style="text-align:right" | [[Wikipedia:Twofish|Twofish]]<br />
| 128 bits<br />
| 128, 192 or 256 bits<br />
| ''developed as successor of Blowfish, but has not attained as much widespread usage''<br />
|-<br />
! scope="row" style="text-align:right" | [[wikipedia:Serpent (cipher)|Serpent]]<br />
| 128 bits<br />
| 128, 192 or 256 bits<br />
| Considered the most secure of the five AES-competition finalists[[#See also|[10]]][[#See also|[11]]][[#See also|[12]]].<br />
|}<br />
<br />
Encrypting/decrypting a sector ([[#Basic principle|see above]]) is achieved by dividing it into small blocks matching the cipher's block-size, and following a certain rule-set (a so-called "'''mode of operation'''") for how to consecutively apply the cipher to the individual blocks.<br />
<br />
Simply applying it to each block separately without modification (dubbed the "''electronic codebook (ECB)''" mode) would not be secure, because if the same 16 bytes of plaintext always produce the same 16 bytes of ciphertext, an attacker could easily recognize patterns in the ciphertext that is stored on disk.<br />
<br />
The most basic (and common) mode of operation used in practice is "''cipher-block chaining (CBC)''". When encrypting a sector with this mode, each block of plaintext data is combined in a mathematical way with the ciphertext of the previous block, before encrypting it using the cipher. For the first block, since it has no previous ciphertext to use, a special pre-generated data block stored with the sector's cryptographic metadata and called an "'''initialization vector (IV)'''" is used:<br />
<br />
╭──────────────╮<br />
│initialization│<br />
│vector │<br />
╰────────┬─────╯<br />
╭ ╠══════════╣ ╭─key │ ┣┉┉┉┉┉┉┉┉┉┉┫ <br />
│ ║ ║ ▼ ▼ ┋ ┋ . START<br />
┴ ║"????????"║◀━━━━(cipher)━━━━(+)━━━━━┋"Hello, W"┋ block ╱╰────┐<br />
sector n ║ ║ ┋ ┋ 1 ╲╭────┘<br />
of file or ║ ║──────────────────╮ ┋ ┋ ' <br />
blockdevice ╟──────────╢ ╭─key │ ┠┈┈┈┈┈┈┈┈┈┈┨<br />
┬ ║ ║ ▼ ▼ ┋ ┋<br />
│ ║"????????"║◀━━━━(cipher)━━━━(+)━━━━━┋"orld !!!"┋ block<br />
│ ║ ║ ┋ ┋ 2<br />
│ ║ ║──────────────────╮ ┋ ┋<br />
│ ╟──────────╢ │ ┠┈┈┈┈┈┈┈┈┈┈┨<br />
│ ║ ║ ▼ ┋ ┋<br />
: : ... : ... ... : ... : ...<br />
<br />
ciphertext plaintext<br />
on disk in RAM<br />
<br />
When decrypting, the procedure is reversed analogously.<br />
<br />
One thing worth noting is the generation of the unique initialization vector for each sector. The simplest choice is to calculate it in a predictable fashion from a readily available value such as the sector number. However, this might allow an attacker with repeated access to the system to perform a so-called [[wikipedia:Watermarking_attack|watermarking attack]]. To prevent that, a method called "Encrypted salt-sector initialization vector ('''ESSIV''')" can be used to generate the initialization vectors in a way that makes them look completely random to a potential attacker.<br />
<br />
There are also a number of other, more complicated modes of operation available for disk encryption, which already provide built-in security against such attacks (and hence do not require ESSIV).<br />
Some can also additionally guarantee authenticity of the encrypted data (i.e. confirm that it has not been modified/corrupted by someone who does not have access to the key).<br />
<br />
See also:<br />
* [[Wikipedia:Disk encryption theory]]<br />
* [[Wikipedia:Block cipher]]<br />
* [[Wikipedia:Block cipher modes of operation]]<br />
<br />
===Plausible deniability===<br />
<br />
See [[Wikipedia:Plausible deniability]].<br />
<br />
== See also ==<br />
<br />
# [[#Summary|^]] see http://www.truecrypt.org/legal/license<br />
# [[#Practical implications|^]] well, a single file in those filesystems could be used as a container (virtual loop-back device!) but then one would not actually be using the filesystem (and the features it provides) anymore<br />
# [[#Compatibility & prevalence|^]] [http://www.scherrer.cc/crypt CrossCrypt] {{Dead link|2015|01|20}} - Open Source AES and TwoFish Linux compatible on the fly encryption for Windows XP and Windows 2000<br />
# [[#Compatibility & prevalence|^]] (1) [http://sourceforge.net/projects/freeotfe.mirror/ FreeOTFE (on sf.net)] (2) [http://web.archive.org/web/20130531062457/http://freeotfe.org/ FreeOTFE (archived)] - supports Windows 2000 and later (for PC), and Windows Mobile 2003 and later (for PDA)<br />
# [[#Compatibility & prevalence|^]] see [http://www.arg0.net/encfs-mac-build EncFs build instructions for Mac]<br />
# [[#Compatibility & prevalence|^]] see http://www.freshports.org/sysutils/fusefs-encfs/<br />
# [[#Compatibility & prevalence|^]] see http://www.chromium.org/chromium-os/chromiumos-design-docs/protecting-cached-user-data<br />
# [[#Compatibility & prevalence|^]] http://kernelnewbies.org/Linux_2_6_38#head-49f5f735853f8cc7c4d89e5c266fe07316b49f4c<br />
# [[#Compatibility & prevalence|^]] http://members.ferrara.linux.it/freddy77/encfs.html<br />
# [[#Compatibility & prevalence|^]] http://csrc.nist.gov/archive/aes/round2/r2report.pdf<br />
# [[#Compatibility & prevalence|^]] https://www.cl.cam.ac.uk/~rja14/Papers/serpentcase.pdf<br />
# [[#Compatibility & prevalence|^]] https://www.cl.cam.ac.uk/~rja14/Papers/serpent.pdf<br />
# [[#Performance features|^]] https://github.com/vgough/encfs/issues/118<br />
# [[#Compatibility & prevalence|^]] <s>[https://github.com/t-d-k/doxbox DOXBOX]</s> renamed into [https://github.com/t-d-k/LibreCrypt LibreCrypt] - support to open dm-crypt / LUKS in newer Windows releases (includes fork from OTFE). Project seems to be abandoned by developer, with multiple open issues.</div>J99https://wiki.archlinux.org/index.php?title=TrueCrypt&diff=510484TrueCrypt2018-02-11T16:42:17Z<p>J99: /* Accessing a TrueCrypt or VeraCrypt container using cryptsetup */ update section to include instructions for VeraCrypt</p>
<hr />
<div>[[Category:Encryption]]<br />
[[Category:File systems]]<br />
[[de:TrueCrypt]]<br />
[[ja:TrueCrypt]]<br />
{{Related articles start}}<br />
{{Related|Disk encryption}}<br />
{{Related|Tcplay}}<br />
{{Related|Tomb}}<br />
{{Related articles end}}<br />
<br />
{{Warning|Development of TrueCrypt was discontinued on May 2014, i.e. it [http://truecrypt.sourceforge.net/ will no longer receive updates and fixes]. The final release repository with information about TrueCrypt code audit is found at [https://www.grc.com/misc/truecrypt/truecrypt.htm].<br />
<br />
Consider using [https://veracrypt.fr/ VeraCrypt], a TrueCrypt fork in active development installable with the {{Pkg|veracrypt}} package; VeraCrypt storage format is compatible with TrueCrypt storage format since version 1.0f.<br />
}}<br />
<br />
{{Warning|On 2015/09/26 two critical security issues has been found in '''Windows''' version of TrueCrypt: CVE-2015-7358 and CVE-2015-7359. Take this into account if you're planning to use this software to share encrypted volumes between Windows and ArchLinux. More information: [https://veracrypt.codeplex.com/SourceControl/changeset/cf4794372e5dea753b6310f1ca6912c6bfa86d45 1][http://www.theregister.co.uk/2015/09/29/google_flaks_find_admin_elevation_holes_that_gave_truecrypt_audit_the_slip/ 2]}}<br />
<br />
{{Note|1={{Pkg|truecrypt}} 1:7.1a-3 and {{Pkg|veracrypt}} 1.16-5 cannot mount volumes since the [https://www.archlinux.org/news/c-abi-change/ C++ ABI change] on 2015-12-10, see {{Bug|47325}} and the [https://bbs.archlinux.org/viewtopic.php?id=206047 forum thread]. [[Downgrading]] to ''truecrypt'' 1:7.1a-2 works around the problem. Furthermore, the problem appears to be fixed in 1:7.1a-4.}}<br />
<br />
TrueCrypt is a free open source on-the-fly encryption (OTFE) program. Some of its features are:<br />
* Virtual encrypted disks within files that can be mounted as real disks.<br />
* Encryption of an entire hard disk partition or a storage device/medium.<br />
* All encryption algorithms use the LRW mode of operation, which is more secure than CBC mode with predictable initialization vectors for storage encryption.<br />
* "Hidden volumes" within a normal "outer" encrypted volume. A hidden volume can not be distinguished from random data without access to a passphrase and/or keyfile.<br />
<br />
For more details on how TrueCrypt compares to other disk encryption solution, see [[Disk encryption#Comparison table]].<br />
<br />
== Installation ==<br />
<br />
{{Note|For opening and accessing an existing TrueCrypt container [[#Accessing a TrueCrypt container using cryptsetup|cryptsetup]] is the preferred way, since it is well integrated with the rest of the system. Creating a new TrueCrypt container can be done using {{ic|truecrypt}}, after which it can be opened using {{ic|cryptsetup}}.}}<br />
<br />
[[Install]] {{Pkg|truecrypt}} from the [[official repositories]].<br />
If you use any kernel other than {{Pkg|linux}} install the corresponding kernel module.<br />
<br />
If you are using truecrypt to encrypt a virtual filesystem (e.g. a file), the module will be automatically loaded whenever you run the ''truecrypt'' command.<br />
<br />
If you are using truecrypt to encrypt a physical device (e.g. a hard disk or usb drive), you will likely want to load the module during the boot sequence:<br />
<br />
Add the module to {{ic|/etc/modules-load.d/}}:<br />
# tee /etc/modules-load.d/truecrypt.conf <<< "truecrypt"<br />
<br />
{{Note|<br />
* This didn't work for me (module truecrypt seems to be non-existent now), but adding "loop" module worked<br />
# tee /etc/modules-load.d/truecrypt.conf <<< "loop"<br />
# modprobe loop<br />
* It does not appear that loading a module applies with TrueCrypt 7.1a, the current version in Arch as of 4/19/2013. The above advice may be outdated with respect to the module, however it is still important to enable '''FUSE''', '''loop''' and your encryption algorithm (e.g. '''AES''', '''XTS''', '''SHA512''') in custom kernels.<br />
If you only want to open and access an existing truecrypt container, this can also be done with {{ic|cryptsetup}} i.e. without installing Truecrypt.<br />
}}<br />
<br />
== Accessing a TrueCrypt or VeraCrypt container using cryptsetup ==<br />
<br />
Since version 1.6.7, {{Pkg|cryptsetup}} supports opening TrueCrypt and VeraCrypt containers natively, without the need of the {{Pkg|truecrypt}} or {{Pkg|veracrypt}} package. Use the following command as a guideline.<br />
$ cryptsetup --type tcrypt open container-to-mount container-name<br />
<br />
To mount a VeraCrypt cointainer, you must use the {{ic|--veracrypt}} option alongside {{ic|--type tcrypt}}. If using a custom Personal Iteration Multiplier (PIM), use the {{ic|--veracrypt-query-pim}} option to be promoted for the PIM.<br />
<br />
Replace {{ic|container-to-mount}} with the device file under {{ic|/dev}} or the path to the file you wish to open. Upon successful opening, the plaintext device will appear as {{ic|/dev/mapper/container-name}}, which you can {{ic|mount}} like any normal device.<br />
<br />
If you are using key files, supply them using the {{ic|--key-file}} option, to open a hidden volume, supply the {{ic|--tcrypt-hidden}} option and for a partition or whole drive that is encrypted in system mode use the {{ic|--tcrypt-system}} option.<br />
<br />
See {{man|8|cryptsetup}} for more details and all supported options.<br />
<br />
=== Automounting using /etc/crypttab ===<br />
<br />
Since version 206, [[systemd]] supports (auto)mounting TrueCrypt containers at boot or runtime using {{ic|/etc/crypttab}}.<br />
<br />
The following example setup will mount {{ic|/dev/sda2}} in system encryption mode as soon as {{ic|/mnt/truecrypt-volume}} is accessed using systemd's automounting logic. The passphrase to open the volume is given in {{ic|/etc/volume.password}}. Note that the device file given in {{ic|/etc/fstab}} needs to be the one from {{ic|/dev/mapper/}} and not, for example, from {{ic|/dev/disk/by-uuid/}} for automounting logic to kick in. Other than that you can still reliably identify the encrypted volume itself inside of {{ic|/etc/crypttab}} using device file names from {{ic|/dev/disk/}}.<br />
<br />
{{hc|/etc/crypttab|<nowiki><br />
truecrypt-volume /dev/sda2 /etc/volume.password tcrypt-system,noauto</nowiki><br />
}}<br />
<br />
For a standard truecrypt volume, use ''tcrypt'' instead of ''tcrypt-system''. And for a hidden one, use ''tcrypt-hidden''.<br />
<br />
{{hc|/etc/fstab|<nowiki><br />
/dev/mapper/truecrypt-volume /mnt/truecrypt-volume auto noauto,x-systemd.automount 0 0</nowiki><br />
}}<br />
<br />
Instead of ''auto'', you can put directly your filesystem, and put usual mount options. It is useful with NTFS for mounting as a normal user.<br />
<br />
See {{man|5|crypttab}} for more details and options supported.<br />
<br />
== Encrypting a file as a virtual volume ==<br />
<br />
The following instructions will create a file that will act as a virtual filesystem, allowing you to mount it and store files within the encrypted file. This is a convenient way to store sensitive information, such as financial data or passwords, in a single file that can be accessed from Linux, Windows, or Macs.<br />
<br />
To create a new truecrypt file interactively, type the following in a terminal:<br />
$ truecrypt -t -c<br />
<br />
Follow the instructions, choosing the default values unless you know what you are doing:<br />
<br />
Volume type:<br />
1) Normal<br />
2) Hidden<br />
Select [1]: 1<br />
<br />
Enter file or device path for new volume: /home/user/''EncryptedFile''.tc<br />
<br />
Enter volume size (bytes - size/sizeK/sizeM/sizeG): 32M<br />
<br />
Encryption algorithm:<br />
1) AES<br />
2) Blowfish<br />
3) CAST5<br />
4) Serpent<br />
5) Triple DES<br />
6) Twofish<br />
7) AES-Twofish<br />
8) AES-Twofish-Serpent<br />
9) Serpent-AES<br />
10) Serpent-Twofish-AES<br />
11) Twofish-Serpent<br />
Select [1]: 1<br />
<br />
Hash algorithm:<br />
1) RIPEMD-160<br />
2) SHA-1<br />
3) Whirlpool<br />
Select [1]: 1 <br />
<br />
Filesystem:<br />
1) None<br />
2) FAT<br />
3) Linux Ext2<br />
4) Linux Ext3<br />
5) Linux Ext4<br />
Select [2]: <br />
<br />
Enter password for new volume '/home/user/''EncryptedFile''.tc': *****************************<br />
Re-enter password: *****************************<br />
<br />
Enter keyfile path [none]: <br />
<br />
Please type at least 320 randomly chosen characters and then press Enter:<br />
<br />
Done: 32.00 MB Speed: 10.76 MB/s Left: 0:00:00 <br />
Volume created.<br />
<br />
You can now mount the new encrypted file to a previously-created directory:<br />
$ truecrypt -t /home/user/''EncryptedFile''.tc /home/user/''EncryptedFileFolder''<br />
<br />
{{Note|Truecrypt requires root privileges and as such, running the above command as a user will attempt to use '''sudo''' for authentication. To work with files as a regular user, please see[[#Mount volumes as a normal user|Mount volumes as a normal user]].}}<br />
<br />
Once mounted, you can copy or create new files within the encrypted directory as if it was any normal directory. When you are you ready to re-encrypt the contents and unmount the directory, run:<br />
$ truecrypt -t -d<br />
<br />
Again, this will require administrator privileges through the use of '''sudo'''. After running it check if the files that are to be encrypted are indeed no longer in the directory. (might want to try unimportant data first) If they are still there, note that ''rm'' doesn't make the data unrecoverable.<br />
<br />
For more information about truecrypt in general, run:<br />
$ man truecrypt<br />
{{Note|As of 1:7.1a-1 dont see a man or info page.}}<br />
<br />
Several options can be passed at the command line, making automated access and creation a simple task. The man page is highly recommended reading.<br />
<br />
== Encrypting a physical volume ==<br />
<br />
{{Note|1= If you are having problems with the graphical interface, you can run in CLI mode with the -t flag.}}<br />
<br />
If you want to use a keyfile, create one with this command:<br />
truecrypt --create-keyfile /etc/disk.key<br />
By default both passphrase and key will be needed to unlock the volume.<br />
<br />
Create a new volume in the device {{ic|/dev/sda1}}:<br />
# truecrypt --volume-type=normal -c /dev/sda1<br />
<br />
Map the volume to {{ic|/dev/mapper/truecrypt1}}:<br />
# truecrypt -N 1 /dev/sda1<br />
<br />
If this command does not for you try this to map the volume:<br />
# truecrypt --filesystem=none --slot=1 /dev/sda1<br />
<br />
Simply format the disk like you normally would choosing your favourite [[file system]], except use the path {{ic|/dev/mapper/truecrypt1}}. E.g. for ext4 use:<br />
# mkfs.ext4 /dev/mapper/truecrypt1<br />
<br />
Mount the volume:<br />
# mount /dev/mapper/truecrypt1 /media/disk<br />
<br />
Map and mount a volume:<br />
# truecrypt /dev/sda1 /media/disk<br />
<br />
Unmount and unmap a volume:<br />
# truecrypt -d /dev/sda1<br />
<br />
== Creating a hidden volume ==<br />
<br />
First, create a normal outer volume as described in [[#Encrypting a physical volume]].<br />
<br />
Map the outer volume to {{ic|/dev/mapper/truecrypt1}}:<br />
# truecrypt -N 1 /dev/sda1<br />
<br />
Create a hidden truecrypt volume in the free space of the outer volume:<br />
# truecrypt --type hidden -c /dev/sda1<br />
You need to use another passphrase and/or keyfile here than the one you used for the outer volume.<br />
<br />
Unmap the outer truecrypt volume and map the hidden one:<br />
# truecrypt -d /dev/sda1<br />
# truecrypt -N 1 /dev/sda1<br />
Just use the passphrase you chose for the hidden volume and TrueCrypt will automatically choose it before the outer.<br />
<br />
Create a file system on it (if you have not already) and mount it:<br />
# mkfs.ext4 /dev/mapper/truecrypt1<br />
# mount /dev/mapper/truecrypt1 /media/disk<br />
<br />
Map and mount the outer volume with the hidden write-protected:<br />
truecrypt -P /dev/sda1 /media/disk<br />
<br />
== Mount a special filesystem ==<br />
<br />
{{Note|Current Versions of truecrypt seem to support NTFS write support by default so the {{ic|--filesystem}} flag no longer seems to be necessary.}}<br />
<br />
In the following example I want to mount a ntfs-volume, but TrueCrypt does not use ''ntfs-3g by'' default (so there is no write access; checked in version 6.1).<br />
The following command works for me:<br />
truecrypt --filesystem=ntfs-3g --mount /file/you/want/to/mount<br />
You may also want to mount ntfs volume without execute flag on all files<br />
truecrypt --filesystem=ntfs-3g --fs-options=users,uid=$(id -u),gid=$(id -g),fmask=0113,dmask=0002<br />
<br />
== Mount volumes via fstab ==<br />
<br />
First of all, we need to write a script which will handle the way mounting via fstab is done. Place the following in {{ic|/usr/bin/mount.truecrypt}}:<br />
{{bc|<nowiki><br />
#!/bin/sh<br />
DEV="$1"<br />
MNTPT="$2"<br />
OPTIONS=""<br />
TCOPTIONS=""<br />
<br />
shift 3<br />
IFS=','<br />
for arg in $*; do<br />
case "$arg" in<br />
system) TCOPTIONS=(${TCOPTIONS[*]} --m=system);;<br />
fs*) TCOPTIONS=(${TCOPTIONS[*]} --filesystem=${arg#*=});;<br />
keyfiles*) TCOPTIONS=(${TCOPTIONS[*]} --keyfiles=${arg#*=});;<br />
password*) TCOPTIONS=(${TCOPTIONS[*]} --password=${arg#*=}) && echo "password triggered" ;;<br />
protect-hidden*) TCOPTIONS=(${TCOPTIONS[*]} --protect-hidden=${arg#*=});;<br />
*) OPTIONS="${OPTIONS}${arg},";;<br />
<br />
esac<br />
done<br />
<br />
/bin/truecrypt --text --non-interactive ${DEV} ${MNTPT} ${TCOPTIONS[*]} --fs-options="${OPTIONS%,*}"<br />
</nowiki>}}<br />
Also do not forget to make the file executable:<br />
<br />
# chmod +x /usr/bin/mount.truecrypt<br />
<br />
Finally, add the device to fstab somewhat like this:<br />
<br />
/dev/sdb3 /mnt truecrypt fs=vfat,defaults 0 0<br />
<br />
{{Tip|This script is also provided by the {{AUR|truecrypt-mount}} package.}}<br />
<br />
== Mount volumes as a normal user ==<br />
<br />
TrueCrypt needs root privileges to work: this procedure will allow normal users to use it, also giving writing permissions to mounted volumes.<br />
<br />
Both methods below require [[Sudo]]. Make sure it is configured before proceeding.<br />
<br />
=== Method 1: add a truecrypt group ===<br />
<br />
Create a new group called truecrypt and give it the necessary permissions. Any users that belongs to that group, will be able to use TrueCrypt.<br />
# groupadd truecrypt<br />
<br />
Edit the sudo configuration:<br />
# visudo<br />
<br />
Append the following lines at the bottom of the sudo configuration file:<br />
# Users in the truecrypt group are allowed to run TrueCrypt as root.<br />
%truecrypt ALL=(root) NOPASSWD:/usr/bin/truecrypt<br />
<br />
You can now add your users to the truecrypt group:<br />
# gpasswd -M first_user,second_user,etc truecrypt<br />
<br />
{{Note|In order to make these changes active, any user that has been added to the truecrypt group have to logout.}}<br />
<br />
After that, you can mount your device by<br />
<br />
# truecrypt --mount ''/path/to/device'' ''/path/to/mountpoint''<br />
<br />
Default mountpoint is {{ic|/media/truecrypt1}}. Normally, it is not necessary to explicitly specify the filesystem of your device using the {{ic|--filesystem}} flag.<br />
<br />
It is definitely reasonable to give truecrypt some permission masks. Otherwise, every file on your mounted device will be executable. So instead of the above, you can use<br />
<br />
# truecrypt --fs-options=users,uid=$(id -u),gid=$(id -g),fmask=0113,dmask=0002 --mount /PATH/TO/DEVICE /PATH/TO/MOUNTPOINT<br />
<br />
and add this line to your bash configuration file, {{ic|~/.bashrc}} as an alias:<br />
<br />
alias tc1='truecrypt --fs-options=users,uid=$(id -u),gid=$(id -g),fmask=0113,dmask=0002 --mount ''/path/to/device"" ''/path/to/mountpoint'<br />
<br />
To mount this specific device, use<br />
<br />
# tc1<br />
<br />
as a normal user.<br />
<br />
=== Method 2: sudo simplified ===<br />
<br />
Simply enable desired user to run truecrypt without a password:<br />
# visudo<br />
<br />
Append the following:<br />
USERNAME ALL = (root) NOPASSWD:/usr/bin/truecrypt<br />
<br />
alternatively, if you make use of the wheel group:<br />
%wheel ALL = (root) NOPASSWD:/usr/bin/truecrypt<br />
<br />
If you have any difficulties with permissions as a normal user, just add the {{ic|-u}} flag to the truecrypt mount command, for example:<br />
$ truecrypt -u /home/user/''EncryptedFile''.tc /home/user/''EncryptedFileFolder''<br />
<br />
=== Automatic mount on login ===<br />
<br />
Simply add:<br />
{{bc|<br />
$ truecrypt /home/user/''Encrypted File''.tc /home/user/''Encrypted File Folder'' <<EOF<br />
''password''<br />
EOF<br />
}}<br />
to your startup procedure. Do not use the {{ic|-p}} switch, this method is more secure. Otherwise everyone can just look up the password via ''ps'' and similar tools, as it is in the process name! [http://thoughtyblog.wordpress.com/2009/07/05/truecrypt-linux-hide-password-from-ps/ source]<br />
<br />
The most recent truecrypt has a couple of followup questions. If you have expect installed, this will work (assuming no keyfile and no desire to protect hidden volume), saved to a file with root-only perms called from /etc/rc.local:<br />
<br />
{{bc|<nowiki><br />
#! /bin/bash<br />
expect << EOF<br />
spawn /usr/bin/truecrypt ''/path/to/EncryptedFile'' ''/mount/point''<br />
expect "Enter password"<br />
send "volume password\n"<br />
expect "Enter keyfile"<br />
send "\n"<br />
expect "Protect hidden volume"<br />
send "\n"<br />
expect eof;<br />
EOF<br />
</nowiki>}}<br />
<br />
Of course, this isn't as secure as entering your password manually. But for some use cases, such as when your TrueCrypt filesystem is in a file on shared storage, it's better than being unencrypted.<br />
<br />
== Safely unmount and unmap volumes (on shutdown) ==<br />
<br />
You can unmount a specific device by<br />
<br />
# truecrypt -d ''/path/to/mountpoint''<br />
<br />
or leave away the path to unmount all truecrypt volumes.<br />
<br />
If you want your truecrypt device to be unmounted automatically at shutdown, add the following to the file {{ic|/etc/rc.local.shutdown}}:<br />
<br />
if (/usr/bin/truecrypt --text --list)<br />
then {<br />
/usr/bin/truecrypt -d<br />
sleep 3<br />
}<br />
fi<br />
<br />
You can also leave away the ''sleep'' command, it is just to give the unmounting some time to complete before the actual shutdown.<br />
<br />
== Errors ==<br />
<br />
=== TrueCrypt is already running ===<br />
<br />
If a messagebox ''TrueCrypt is already running'' appears when starting TrueCrypt, check for a hidden file in the home directory of the concerned user called ''.TrueCrypt-lock-username''. Substitute ''username'' with the individual username. Delete the file and start TrueCrypt again.<br />
<br />
=== Deleted stale lockfile ===<br />
<br />
If you always get a message "Delete stale lockfile [....]" after starting Truecrypt, the Truecrypt process with the lowest ID has to be killed during Gnome log out. Edit {{ic|/etc/gdm/PostSession/Default}} and add the following line before exit 0:<br />
kill $(ps -ef | grep truecrypt | tr -s ' ' | cut -d ' ' -f 2)<br />
<br />
=== Issues with Unicode file/folder names ===<br />
<br />
==== NTFS ====<br />
<br />
Should files resp. folders containing Unicode characters in their names be incorrectly or not at all displayed on TrueCrypt NTFS volumes (while e. g. being correctly handled on non-encrypted NTFS partitions), first verify that you have the [[NTFS-3G]] driver installed and then create the following symlink as root:<br />
ln -s /sbin/mount.ntfs-3g /sbin/mount.ntfs<br />
That will cause TrueCrypt to automatically use this driver for NTFS volumes, having the same effect as the explicit use of<br />
truecrypt --filesystem=ntfs-3g /path/to/volume<br />
via the console.<br />
<br />
One may also consider setting e.g.:<br />
rw,noatime<br />
amongst other options in the TrueCrypt GUI (''Settings > Preferences > Mount Options'').<br />
<br />
==== FAT ====<br />
<br />
Similarly, FAT32 volumes created using Windows may use Unicode rather than ISO 8859-1. In order to use UTF-8 globally, set the mount option:<br />
iocharset=utf8<br />
<br />
Alternatively, when mounting volumes locally use:<br />
--fs-options=iocharset=utf8<br />
<br />
Since [https://bugs.archlinux.org/task/56781 linux-4.14.4], UTF8 charset is enabled by default. So in order to mount volumes using ISO 8859-1 encoding, you need to set the following option:<br />
--fs-options=utf8=no<br />
<br />
=== Unmount error (device mapper) ===<br />
<br />
If you always get a message "device-mapper: remove ioctl failed: Device or resource busy" when attempting to dismount your truecrypt volume, the solution is to goto: Setting > Preferences > System Integration > Kernel Service and check the box<br />
Do not use kernel cryptographic services<br />
<br />
=== Mount error (device mapper, truecrypt partition) ===<br />
<br />
When attempting to mount your truecrypt volume, a message like this one may appear:<br />
<br />
Error: device-mapper: create ioctl failed: Device or resource busy<br />
Command failed<br />
If so, run:<br />
# cryptsetup remove /dev/mapper/truecrypt1<br />
<br />
=== Failed to set up a loop device ===<br />
<br />
If you get a message "Failed to set up a loop device" when trying to create/mount a TrueCrypt volume, it may be because you updated your kernel recently without rebooting.<br />
Rebooting should fix this error.<br />
<br />
Otherwise, check if ''loop'' has been loaded as kernel module:<br />
<br />
$ lsmod | grep loop<br />
<br />
If not listed, retry the TrueCrypt command after {{ic|modprobe loop}}. Should it work, consider to add ''loop'' to the modules in {{ic|/etc/modules-load.d}}:<br />
<br />
# tee /etc/modules-load.d/truecrypt.conf <<< "loop"<br />
<br />
{{Note|As of udev 181-5, the loop device module is no longer auto-loaded, and the procedure described here is necessary.}}<br />
<br />
With newer kernel versions there are no loop devices created at startup. If there are no loop devices the first time mounting a container file, TrueCrypt fails ("Failed to set up a loop device") but also creates the maximum number of loop devices (usually 256), mounting should now work.<br />
<br />
To avoid this you can create a loop device before mounting a file:<br />
<br />
# mknod -m 0660 /dev/loop8 b 7 8<br />
<br />
This creates {{ic|/dev/loop8}}. Or create some loop devices at startup:<br />
<br />
# echo "options loop max_loop=8" > /etc/modprobe.d/eightloop.conf<br />
<br />
Change {{ic|1=max_loop=8}} to the number of devices you need.<br />
<br />
=== System partition passwords need en_US keymap ===<br />
If you are using Xorg (which you most likely are, should you not know what that is), use the following command to use US keymap until restart:<br />
<br />
# setxkbmap us<br />
<br />
=== Permission denied on NTFS volume ===<br />
If you cannot modify the filesystem, although permissions seem to be correct, this can be a result of not having [[NTFS-3G]] installed, see [[#NTFS|NTFS]].<br />
<br />
== See also ==<br />
<br />
* [http://www.truecrypt.org/ TrueCrypt homepage]<br />
* [http://www.gentoo-wiki.info/HOWTO_Truecrypt HOWTO: Truecrypt Gentoo wiki]<br />
* [http://www.howtoforge.com/truecrypt_data_encryption Truecrypt tutorial on HowToForge]<br />
* [http://www.privacylover.com/encryption/analysis-is-there-a-backdoor-in-truecrypt-is-truecrypt-a-cia-honeypot/ There is a good chance the CIA has a backdoor?] (via [https://secure.wikimedia.org/wikipedia/en/wiki/Truecrypt wp])</div>J99https://wiki.archlinux.org/index.php?title=User_talk:J99&diff=510479User talk:J992018-02-11T16:00:14Z<p>J99: Created blank page</p>
<hr />
<div></div>J99https://wiki.archlinux.org/index.php?title=User:J99&diff=510478User:J992018-02-11T16:00:01Z<p>J99: Created blank page</p>
<hr />
<div></div>J99https://wiki.archlinux.org/index.php?title=Talk:TrueCrypt&diff=510477Talk:TrueCrypt2018-02-11T15:59:45Z<p>J99: sign</p>
<hr />
<div>==Automatic mount home on login==<br />
You need to create an encrypted physical volume with the same password that your login. Then install pam_mount from AUR and change the following lines.<br />
/etc/security/pam_mount.conf.xml<br />
<cryptmount>bash -c "grep -q %(MNTPT) /etc/mtab || truecrypt --text --protect-hidden=no --keyfiles=&#39;&#39; %(VOLUME) %(MNTPT)"</cryptmount><br />
<cryptumount>truecrypt -d</cryptumount><br />
<volume fstype="crypt" path="/dev/sdXX" mountpoint="/home" /><br />
/etc/pam.d/{login,gdm,kdm,...}<br />
auth optional pam_mount.so<br />
session optional pam_mount.so<br />
<br />
'''Note:''' The volume label can be especified per home (~/.pam_mount.conf.xml)<br />
<br />
--[[User:Nak|Nak]] 09:03, 26 December 2010 (EST)<br />
<br />
==Outdated==<br />
Some of the information on this page is outdated since truecrypt 5.1, for example the steps to use ext3 as filesystem on the encrypted volume. I'd update it but am not sure if we should keep the present information as reference or replace it with the updated one. --[[User:Chimeric|chi]] 19:29, 2 May 2008 (EDT)<br />
<br />
==bashrc==<br />
Is there an error in ''Method 1 (Add a truecrypt group)''? It says that some lines should be added to ''/etc/bash/bashrc''. In my opinion it should say that these lines have to be added to each user's ''.bashrc''. --[[User:Sandstorm|Sandstorm]] 13:45, 1 June 2008 (EDT)<br />
: That file doesn't exist in my system, but I guess adding them to /etc/bash.bashrc should work, if people use bash. However, wouldn't it be most general if you put it in /etc/profile? --[[User:Unhammer|Unhammer]] 14:13, 12 March 2010 (EST)<br />
<br />
==GUI==<br />
What are the GUI options? (I found [http://www.kde-apps.org/content/show.php/TCmount?content=54314&PHPSESSID=e5af TCMount], but it's discontinued since it had security problems.)<br />
<br />
:: Why the fuck does it separate into a gui and a cli version like normal people, where did the man page go? You cant even do {{ic|truecrypt -l |grep someshit}} because it pops up a gui. Is this cruel and arbitrary and should it affect my trust in the software? It boggles the mind.[[User:Jasper1984|Jasper1984]] ([[User talk:Jasper1984|talk]]) 18:55, 21 October 2012 (UTC)<br />
<br />
Use truecrypt -t -l for cli version.<br />
<br />
== tcplay ==<br />
<br />
Anyone else is trying it? Is that ok in this page?<br />
<br />
== Proper wipe? ==<br />
I created a truecrypted directory, then incrypted it with {{ic|truecrypt -d}}. I look at the files -'''still there?!''' Therefore i will add a comment telling people to check it. And that {{ic|rm}} doesn't make them unrecoverable.(after removing them remounting with truecrypt did return the files, so it does look like it worked) <br />
<br />
This will make the page ''look'' worse. [[User:Jasper1984|Jasper1984]] ([[User talk:Jasper1984|talk]]) 19:05, 21 October 2012 (UTC)<br />
<br />
==<s> Status? </s>==<br />
<br />
The warning is confusing. Was development discontinued, but then the project got adopted? Or was it adopted some time in the past and later the adopters discontinued development? --[[User:Margali|cfr]] ([[User talk:Margali|talk]]) 03:48, 29 October 2017 (UTC)<br />
<br />
:Hi, I've reworded the Warning, please see if it's clearer. -- [[User:Kynikos|Kynikos]] ([[User talk:Kynikos|talk]]) 11:08, 30 October 2017 (UTC)<br />
<br />
== VeraCrypt article ==<br />
VeraCrypt is considered to be the de facto replacment for TrueCrypt, now that the latter is discontinued. Perhaps we should consider moving/merging this article to one named VeraCrypt? [[User:J99|J99]] ([[User talk:J99|talk]]) 15:59, 11 February 2018 (UTC)</div>J99https://wiki.archlinux.org/index.php?title=Talk:TrueCrypt&diff=510476Talk:TrueCrypt2018-02-11T15:59:14Z<p>J99: propose VeraCrypt article</p>
<hr />
<div>==Automatic mount home on login==<br />
You need to create an encrypted physical volume with the same password that your login. Then install pam_mount from AUR and change the following lines.<br />
/etc/security/pam_mount.conf.xml<br />
<cryptmount>bash -c "grep -q %(MNTPT) /etc/mtab || truecrypt --text --protect-hidden=no --keyfiles=&#39;&#39; %(VOLUME) %(MNTPT)"</cryptmount><br />
<cryptumount>truecrypt -d</cryptumount><br />
<volume fstype="crypt" path="/dev/sdXX" mountpoint="/home" /><br />
/etc/pam.d/{login,gdm,kdm,...}<br />
auth optional pam_mount.so<br />
session optional pam_mount.so<br />
<br />
'''Note:''' The volume label can be especified per home (~/.pam_mount.conf.xml)<br />
<br />
--[[User:Nak|Nak]] 09:03, 26 December 2010 (EST)<br />
<br />
==Outdated==<br />
Some of the information on this page is outdated since truecrypt 5.1, for example the steps to use ext3 as filesystem on the encrypted volume. I'd update it but am not sure if we should keep the present information as reference or replace it with the updated one. --[[User:Chimeric|chi]] 19:29, 2 May 2008 (EDT)<br />
<br />
==bashrc==<br />
Is there an error in ''Method 1 (Add a truecrypt group)''? It says that some lines should be added to ''/etc/bash/bashrc''. In my opinion it should say that these lines have to be added to each user's ''.bashrc''. --[[User:Sandstorm|Sandstorm]] 13:45, 1 June 2008 (EDT)<br />
: That file doesn't exist in my system, but I guess adding them to /etc/bash.bashrc should work, if people use bash. However, wouldn't it be most general if you put it in /etc/profile? --[[User:Unhammer|Unhammer]] 14:13, 12 March 2010 (EST)<br />
<br />
==GUI==<br />
What are the GUI options? (I found [http://www.kde-apps.org/content/show.php/TCmount?content=54314&PHPSESSID=e5af TCMount], but it's discontinued since it had security problems.)<br />
<br />
:: Why the fuck does it separate into a gui and a cli version like normal people, where did the man page go? You cant even do {{ic|truecrypt -l |grep someshit}} because it pops up a gui. Is this cruel and arbitrary and should it affect my trust in the software? It boggles the mind.[[User:Jasper1984|Jasper1984]] ([[User talk:Jasper1984|talk]]) 18:55, 21 October 2012 (UTC)<br />
<br />
Use truecrypt -t -l for cli version.<br />
<br />
== tcplay ==<br />
<br />
Anyone else is trying it? Is that ok in this page?<br />
<br />
== Proper wipe? ==<br />
I created a truecrypted directory, then incrypted it with {{ic|truecrypt -d}}. I look at the files -'''still there?!''' Therefore i will add a comment telling people to check it. And that {{ic|rm}} doesn't make them unrecoverable.(after removing them remounting with truecrypt did return the files, so it does look like it worked) <br />
<br />
This will make the page ''look'' worse. [[User:Jasper1984|Jasper1984]] ([[User talk:Jasper1984|talk]]) 19:05, 21 October 2012 (UTC)<br />
<br />
==<s> Status? </s>==<br />
<br />
The warning is confusing. Was development discontinued, but then the project got adopted? Or was it adopted some time in the past and later the adopters discontinued development? --[[User:Margali|cfr]] ([[User talk:Margali|talk]]) 03:48, 29 October 2017 (UTC)<br />
<br />
:Hi, I've reworded the Warning, please see if it's clearer. -- [[User:Kynikos|Kynikos]] ([[User talk:Kynikos|talk]]) 11:08, 30 October 2017 (UTC)<br />
<br />
== VeraCrypt article ==<br />
VeraCrypt is considered to be the de facto replacment for TrueCrypt, now that the latter is discontinued. Perhaps we should consider moving/merging this article to one named VeraCrypt?</div>J99