https://wiki.archlinux.org/api.php?action=feedcontributions&user=Delapouite&feedformat=atomArchWiki - User contributions [en]2024-03-29T14:13:04ZUser contributionsMediaWiki 1.41.0https://wiki.archlinux.org/index.php?title=Unified_Extensible_Firmware_Interface&diff=789694Unified Extensible Firmware Interface2023-10-10T08:45:34Z<p>Delapouite: add man link to findmnt</p>
<hr />
<div>[[Category:Boot process]]<br />
[[es:Unified Extensible Firmware Interface]]<br />
[[ja:Unified Extensible Firmware Interface]]<br />
[[ru:Unified Extensible Firmware Interface]]<br />
[[zh-hans:Unified Extensible Firmware Interface]]<br />
{{Related articles start}}<br />
{{Related|EFI system partition}}<br />
{{Related|Arch boot process}}<br />
{{Related|GUID Partition Table}}<br />
{{Related|Secure Boot}}<br />
{{Related|Unified kernel image}}<br />
{{Related articles end}}<br />
<br />
The [https://www.uefi.org/ Unified Extensible Firmware Interface] (UEFI, successor of the EFI) is an interface between operating systems and firmware. It provides a standard environment for booting an operating system and running pre-boot applications.<br />
<br />
It is distinct from the "[[Partitioning#Master Boot Record (bootstrap code)|MBR boot code]]" method that was used by legacy [[Wikipedia:BIOS|BIOS]] systems. See [[Arch boot process]] for their differences and the boot process using UEFI. To set up UEFI boot loaders, see [[Arch boot process#Boot loader]].<br />
<br />
{{Note|Early vendor UEFI implementations may carry more bugs than their BIOS counterparts. Consider using legacy BIOS booting for such systems if you encounter unsolvable issues.}}<br />
<br />
== UEFI versions ==<br />
<br />
* UEFI started as Intel's EFI in versions 1.x.<br />
* Later, a group of companies called the UEFI Forum took over its development, which renamed it as Unified EFI starting with version 2.0.<br />
* Unless specified as EFI 1.x, EFI and UEFI terms are used interchangeably to denote UEFI 2.x firmware.<br />
* Apple's EFI implementation is neither an EFI 1.x version nor UEFI 2.x version but mixes up both. This kind of firmware does not fall under any one (U)EFI specification and therefore is not a standard UEFI firmware. Unless stated explicitly, these instructions are general and some of them may not work or may be different in [[Mac|Apple Macs]].<br />
<br />
The latest UEFI specification can be found at https://uefi.org/specifications.<br />
<br />
== UEFI firmware bitness ==<br />
<br />
Under UEFI, every program whether it is an OS loader or a utility (e.g. a memory testing or recovery tool), should be an EFI application corresponding to the UEFI firmware bitness/architecture.<br />
<br />
The vast majority of x86_64 systems, including recent Apple Macs, use x64 (64-bit) UEFI firmware. The only known devices that use IA32 (32-bit) UEFI are older (pre 2008) Apple Macs, Intel Atom System-on-Chip systems (as on 2 November 2013)[https://web.archive.org/web/20201224150025/https://software.intel.com/content/www/us/en/develop/blogs/why-cheap-systems-run-32-bit-uefi-on-x64-systems.html] and some older Intel server boards that are known to operate on Intel EFI 1.10 firmware.<br />
<br />
An x64 UEFI firmware does not include support for launching 32-bit EFI applications (unlike x86_64 Linux and Windows versions which include such support). Therefore the EFI application must be compiled for that specific firmware processor bitness/architecture.<br />
<br />
{{Note|Systems with IA32 UEFI require using a boot loader that supports mixed mode booting. For example, [[systemd-boot]].}}<br />
<br />
{{Warning|Starting with {{Pkg|grub}} 2:2.06.r566.g857af0e17-1, GRUB's {{ic|i386-efi}} target is broken so it cannot be used to boot on IA32 UEFI. See {{Bug|79098}}.}}<br />
<br />
=== Checking the firmware bitness ===<br />
<br />
The firmware bitness can be checked from a booted operating system.<br />
<br />
==== From Linux ====<br />
<br />
On distributions running Linux kernel 4.0 or newer, the UEFI firmware bitness can be found via the sysfs interface. Run:<br />
<br />
$ cat /sys/firmware/efi/fw_platform_size<br />
<br />
It will return {{ic|64}} for a 64-bit (x64) UEFI or {{ic|32}} for a 32-bit (IA32) UEFI. If the file does not exist, then you have not [[Installation guide#Verify the boot mode|booted in UEFI mode]].<br />
<br />
==== From macOS ====<br />
<br />
Pre-2008 [[Mac]]s mostly have IA32 EFI firmware while >=2008 Macs have mostly x64 EFI. All Macs capable of running Mac OS X Snow Leopard 64-bit Kernel have x64 EFI 1.x firmware.<br />
<br />
To find out the arch of the EFI firmware in a Mac, type the following into the Mac OS X terminal:<br />
<br />
$ ioreg -l -p IODeviceTree | grep firmware-abi<br />
<br />
If the command returns {{ic|EFI32}} then it is IA32 (32-bit) EFI firmware. If it returns {{ic|EFI64}} then it is x64 EFI firmware. Most of the Macs do not have UEFI 2.x firmware as Apple's EFI implementation is not fully compliant with UEFI 2.x specification.<br />
<br />
==== From Microsoft Windows ====<br />
<br />
64-bit versions of Windows do not support booting on a 32-bit UEFI. So, if you have a 32-bit version of Windows booted in UEFI mode, you have a 32-bit UEFI.<br />
<br />
To check the bitness run {{ic|msinfo32.exe}}. In the ''System Summary'' section look at the values of "System Type" and "BIOS mode".<br />
<br />
For a 64-bit Windows on a 64-bit UEFI it will be {{ic|System Type: x64-based PC}} and {{ic|BIOS mode: UEFI}}, for a 32-bit Windows on a 32-bit UEFI - {{ic|System Type: x86-based PC}} and {{ic|BIOS mode: UEFI}}. If the "BIOS mode" is not {{ic|UEFI}}, then Windows is not booted in UEFI mode.<br />
<br />
== Linux kernel configuration options for UEFI ==<br />
<br />
The required Linux Kernel configuration options[https://docs.kernel.org/arch/x86/x86_64/uefi.html] for UEFI systems are:<br />
<br />
CONFIG_RELOCATABLE=y<br />
CONFIG_EFI=y<br />
CONFIG_EFI_STUB=y<br />
CONFIG_X86_SYSFB=y<br />
CONFIG_FB_SIMPLE=y<br />
CONFIG_FRAMEBUFFER_CONSOLE=y<br />
<br />
UEFI Runtime Variables Support ('''efivarfs''' filesystem - {{ic|/sys/firmware/efi/efivars}}). This option is important as this is required to manipulate UEFI runtime variables using tools like [[#efibootmgr|efibootmgr]]. The configuration option below has been added in kernel 3.10 and later.<br />
<br />
CONFIG_EFIVAR_FS=y<br />
<br />
UEFI Runtime Variables Support (old '''efivars sysfs''' interface - {{ic|/sys/firmware/efi/vars}}). This option should be disabled to prevent any potential issues with both efivarfs and sysfs-efivars enabled.<br />
<br />
CONFIG_EFI_VARS=n<br />
<br />
[[GUID Partition Table]] (GPT) configuration option - mandatory for UEFI support<br />
<br />
CONFIG_EFI_PARTITION=y<br />
<br />
EFI mixed-mode support - to boot a x86_64 kernel on a IA32 UEFI.<br />
<br />
CONFIG_EFI_MIXED=y<br />
<br />
{{Tip|All of the above options are set accordingly in all [[Kernel#Officially supported kernels|officially supported kernels]].}}<br />
<br />
== UEFI variables ==<br />
<br />
UEFI defines variables through which an operating system can interact with the firmware. UEFI boot variables are used by the boot loader and used by the OS only for early system start-up. UEFI runtime variables allow an OS to manage certain settings of the firmware like the UEFI boot manager or managing the keys for UEFI Secure Boot protocol etc. You can get the list using:<br />
<br />
$ efivar --list<br />
<br />
=== UEFI variables support in Linux kernel ===<br />
<br />
Linux kernel exposes UEFI variables data to userspace via '''efivarfs''' ('''EFI''' '''VAR'''iable '''F'''ile'''S'''ystem) interface ({{ic|CONFIG_EFIVAR_FS}}) - mounted using {{ic|efivarfs}} kernel module at {{ic|/sys/firmware/efi/efivars}} - it has no maximum per-variable size limitation and supports UEFI Secure Boot variables. Introduced in kernel 3.8.<br />
<br />
=== Requirements for UEFI variable support ===<br />
<br />
# Kernel should be booted in UEFI mode via [[EFISTUB]] (optionally using a [[boot manager]]) or by a UEFI [[boot loader]], not via BIOS or CSM, or Apple's Boot Camp which is also a CSM.<br />
# EFI Runtime Services support should be present in the kernel ({{ic|1=CONFIG_EFI=y}}, check if present with {{ic|zgrep CONFIG_EFI /proc/config.gz}}).<br />
# EFI Runtime Services in the kernel SHOULD NOT be disabled via the [[kernel command line]], i.e. {{ic|noefi}} kernel parameter SHOULD NOT be used.<br />
# {{ic|efivarfs}} filesystem should be mounted at {{ic|/sys/firmware/efi/efivars}}, otherwise follow [[#Mount efivarfs]] section below.<br />
# {{ic|efivar}} should list (option {{ic|-l}}/{{ic|--list}}) the UEFI variables without any error.<br />
<br />
If UEFI Variables support does not work even after the above conditions are satisfied, try the below workarounds:<br />
<br />
# If listing of the UEFI variables ({{ic|efivar -l}}) leads to {{ic|efivar: error listing variables: Function not implemented}} and the system is booted into a [[realtime kernel]], add {{ic|1=efi=runtime}} to the [[kernel parameters]] and reboot (efivarfs functionality is disabled by default on those kernels).<br />
# See [[#Userspace tools are unable to modify UEFI variable data]] for more troubleshooting steps<br />
<br />
==== Mount efivarfs ====<br />
<br />
If {{ic|efivarfs}} is not automatically mounted at {{ic|/sys/firmware/efi/efivars}} by [[systemd]] during boot, then you need to manually mount it to expose UEFI variables to [[#Userspace tools|userspace tools]] like ''efibootmgr'':<br />
<br />
# mount -t efivarfs efivarfs /sys/firmware/efi/efivars<br />
<br />
{{Note|The above command should be run '''both ''outside''''' (i.e. before) '''and ''inside''''' the [[chroot]], if any.}}<br />
<br />
See [https://docs.kernel.org/filesystems/efivarfs.html efivarfs.html] for kernel documentation.<br />
<br />
=== Userspace tools ===<br />
<br />
There are few tools that can access/modify the UEFI variables, namely<br />
<br />
* {{App|efivar|Library and Tool to manipulate UEFI variables (used by efibootmgr)|https://github.com/rhboot/efivar|{{Pkg|efivar}}}}<br />
* {{App|efibootmgr|Tool to manipulate UEFI Firmware Boot Manager Settings|https://github.com/rhboot/efibootmgr|{{Pkg|efibootmgr}}}}<br />
* {{App|uefivars|Dumps list of UEFI variables with some additional PCI related info (uses efibootmgr code internally)|https://github.com/fpmurphy/Various/tree/master/uefivars-2.0|{{AUR|uefivars-git}}}}<br />
* {{App|efitools|Tools for manipulating UEFI secure boot platforms|https://git.kernel.org/pub/scm/linux/kernel/git/jejb/efitools.git|{{Pkg|efitools}}}}<br />
* {{App|Ubuntu's Firmware Test Suite|Test suite that performs sanity checks on Intel/AMD PC firmware|https://wiki.ubuntu.com/FirmwareTestSuite/|{{AUR|fwts-git}}}}<br />
<br />
==== efibootmgr ====<br />
<br />
You will have to [[install]] the {{Pkg|efibootmgr}} package.<br />
<br />
{{Note|<br />
* If ''efibootmgr'' does not work on your system, you can reboot into [[#UEFI Shell]] and use {{ic|bcfg}} to create a boot entry for the bootloader.<br />
* If you are unable to use {{ic|efibootmgr}}, some UEFI firmwares allow users to directly manage UEFI boot entries from within its boot-time interface. For example, some firmwares have an "Add New Boot Option" choice which enables you to select a local EFI system partition and manually enter the EFI application location e.g. {{ic|\EFI\refind\refind_x64.efi}}.<br />
* The below commands use [[rEFInd]] boot manager as example.<br />
}}<br />
<br />
To add a new boot option using ''efibootmgr'', you need to know three things:<br />
<br />
# The disk containing the [[EFI system partition]] (ESP). E.g.: {{ic|/dev/sda}}, {{ic|/dev/nvme0n1}}.<br />
# The partition number of the ESP on that disk. The {{ic|''Y''}} in {{ic|/dev/sda''Y''}} or {{ic|/dev/nvme0n1p''Y''}}.<br />
# The path to the EFI application (relative to the root of the ESP)<br />
<br />
For example, if you want to add a boot option for {{ic|/efi/EFI/refind/refind_x64.efi}} where {{ic|/efi}} is the mount point of the ESP, run<br />
<br />
{{hc|$ findmnt /efi|2=<br />
TARGET SOURCE FSTYPE OPTIONS<br />
/efi /dev/sda1 vfat rw,flush,tz=UTC<br />
}}<br />
<br />
In this example, {{man|8|findmnt}} indicates that the ESP is on disk {{ic|/dev/sda}} and has partition number 1. The path to the EFI application relative to the root of the ESP is {{ic|/EFI/refind/refind_x64.efi}}. So you would create the boot entry as follows:<br />
<br />
# efibootmgr --create --disk /dev/sda --part 1 --loader /EFI/refind/refind_x64.efi --label "rEFInd Boot Manager" --unicode<br />
<br />
# efibootmgr --create --disk /dev/nvme0n1p1 --loader /EFI/refind/refind_x64.efi --label "rEFInd Boot Manager" --unicode<br />
<br />
See {{man|8|efibootmgr}} or [https://raw.githubusercontent.com/rhinstaller/efibootmgr/master/README efibootmgr README] for more info.<br />
<br />
{{Note|UEFI uses backward slash {{ic|\}} as path separator but ''efibootmgr'' automatically converts UNIX-style {{ic|/}} path separators.}}<br />
<br />
=== Disable UEFI variable access ===<br />
<br />
Access to the UEFI can potentially cause harm beyond the running OS level. Even hardware-level bricking is possible in some cases of poor UEFI implementation. [https://github.com/systemd/systemd/issues/2402#issuecomment-176806817]<br />
<br />
So, as the UEFI variables access is not required for daily system usage, you may want to disable it, to avoid potential security breaches or accidental harm.<br />
<br />
Possible solutions are:<br />
<br />
* Mount {{ic|efivars}} in read-only mode using [[fstab]]. For example: {{bc|efivarfs /sys/firmware/efi/efivars efivarfs ro,nosuid,nodev,noexec 0 0}}<br />
* Use the {{ic|noefi}} [[kernel parameter]] to completely disable OS access to UEFI.<br />
<br />
{{Note|UEFI [[#Userspace tools|userspace tools]] cannot be used with a such setup, so perform the all necessary configurations before. Also UEFI-related commands (e.g. {{ic|systemctl reboot --firmware-setup}}) will not work either.}}<br />
<br />
== UEFI Shell ==<br />
<br />
The UEFI Shell is a shell/terminal for the firmware which allows launching EFI applications which include UEFI bootloaders. Apart from that, the shell can also be used to obtain various other information about the system or the firmware like memory map (memmap), modifying boot manager variables (bcfg), running partitioning programs (diskpart), loading UEFI drivers, editing text files (edit), hexedit etc.<br />
<br />
=== Obtaining UEFI Shell ===<br />
<br />
You can obtain a BSD licensed UEFI Shell from the TianoCore EDK2 project:<br />
<br />
* Shell v2:<br />
** On the Arch install medium: {{ic|/shellx64.efi}}. A copy of {{ic|/usr/share/edk2-shell/x64/Shell_Full.efi}} from the time the ISO was built.<br />
** {{Pkg|edk2-shell}} provides x64 Shell for x64 (64-bit) UEFI and IA32 Shell for IA32 (32-bit) UEFI - compiled directly from latest TianoCore EDK2 release.<br />
** {{AUR|uefi-shell-git}} provides x64 Shell for x64 (64-bit) UEFI and IA32 Shell for IA32 (32-bit) UEFI - compiled directly from latest TianoCore EDK2 source.<br />
* Shell v1:<br />
** [https://github.com/tianocore/edk2/tree/UDK2018/EdkShellBinPkg Precompiled UEFI Shell v1 binaries] from TianoCore (not updated anymore upstream as of Jan 10, 2014).<br />
* Patched shells:<br />
** [https://drive.google.com/uc?export=download&id=1OBXYj6MEs7VAZbYnjD9FxOYcZYIQoq36 Precompiled UEFI Shell v2 binary with bcfg modified to work with UEFI pre-2.3 firmware]{{Dead link|2023|07|30|status=403}} - from Clover EFI bootloader.<br />
** [https://github.com/acidanthera/OpenCorePkg/releases Precompiled UEFI Shell v2 binary for compatibility with a broad range of firmwares] - from the OpenCore bootloader. In the release archive: {{ic|EFI/OC/Tools/OpenShell.efi}}.<br />
<br />
Shell v2 works best in UEFI 2.3+ systems and is recommended over Shell v1 in those systems. Shell v1 should work in all UEFI systems irrespective of the spec. version the firmware follows. More information at [https://github.com/tianocore/tianocore.github.io/wiki/ShellPkg ShellPkg] and the EDK2 mailing list thread—[https://edk2-devel.narkive.com/zCN4CEnb/inclusion-of-uefi-shell-in-linux-distro-iso Inclusion of UEFI shell in Linux distro iso].<br />
<br />
=== Launching UEFI Shell ===<br />
<br />
Few Asus and other AMI Aptio x64 UEFI firmware based motherboards (from Sandy Bridge onwards) provide an option called ''Launch EFI Shell from filesystem device''. For those motherboards, copy the x64 UEFI Shell to the root of your EFI system partition, named as {{ic|shellx64.efi}}.<br />
<br />
{{Tip|<br />
* The Arch Linux installation medium has {{ic|shellx64.efi}} at the root of the volume.<br />
* [[rEFInd]] and [[systemd-boot]] will automatically add a boot menu entry for the UEFI shell if {{ic|shellx64.efi}} is in the root of the EFI system partition.<br />
}}<br />
<br />
Systems with Phoenix SecureCore Tiano UEFI firmware is known to have embedded UEFI Shell which can be launched using either {{ic|F6}}, {{ic|F11}} or {{ic|F12}} key.<br />
<br />
{{Note|If you are unable to launch UEFI Shell from the firmware directly using any of the above mentioned methods, create a [[FAT32]] USB pen drive with the EFI binary copied as {{ic|''/USB_drive_mointpoint''/EFI/BOOT/BOOTx64.EFI}}. This USB should come up in the firmware boot menu. Launching this option will launch the UEFI Shell for you.}}<br />
<br />
=== Important UEFI Shell commands ===<br />
<br />
UEFI Shell commands usually support {{ic|-b}} option which makes output pause after each page. Run {{ic|help -b}} to list available internal commands. Available commands are either built into the shell or discrete EFI applications.<br />
<br />
For more info see [https://software.intel.com/en-us/articles/efi-shells-and-scripting/ Intel Scripting Guide 2008]{{Dead link|2023|07|30|status=404}} and [https://software.intel.com/en-us/articles/uefi-shell Intel "Course" 2011]{{Dead link|2023|07|30|status=404}}.<br />
<br />
==== bcfg ====<br />
<br />
{{ic|bcfg}} modifies the UEFI NVRAM entries which allows the user to change the boot entries or driver options. This command is described in detail in page 96 (Section 5.3) of the [https://uefi.org/sites/default/files/resources/UEFI_Shell_2_2.pdf UEFI Shell Specification 2.2] document.<br />
<br />
{{Note|<br />
* Try {{ic|bcfg}} only if {{ic|efibootmgr}} fails to create working boot entries on your system.<br />
* UEFI Shell v1 official binary does not support {{ic|bcfg}} command. See [[#Obtaining UEFI Shell]] for a modified UEFI Shell v2 binary which may work in UEFI pre-2.3 firmwares.<br />
}}<br />
<br />
To dump a list of current boot entries:<br />
<br />
Shell> bcfg boot dump -v<br />
<br />
To add a boot menu entry for rEFInd (for example) as 4th (numbering starts from zero) option in the boot menu:<br />
<br />
Shell> bcfg boot add 3 FS0:\EFI\refind\refind_x64.efi "rEFInd Boot Manager"<br />
<br />
where {{ic|FS0:}} is the mapping corresponding to the EFI system partition and {{ic|FS0:\EFI\refind\refind_x64.efi}} is the file to be launched.<br />
<br />
To add an entry to boot directly into your system without a bootloader, configure a boot option using your kernel as an [[EFISTUB#bcfg|EFISTUB]]:<br />
<br />
Shell> bcfg boot add '''N''' fs'''V''':\vmlinuz-linux "Arch Linux"<br />
Shell> bcfg boot -opt '''N''' "root='''/dev/sdX#''' initrd=\initramfs-linux.img"<br />
<br />
where {{ic|N}} is the priority, {{ic|V}} is the volume number of your EFI system partition, and {{ic|/dev/sdX#}} is your root partition.<br />
<br />
To remove the 4th boot option:<br />
<br />
Shell> bcfg boot rm 3<br />
<br />
To move the boot option #3 to #0 (i.e. 1st or the default entry in the UEFI Boot menu):<br />
<br />
Shell> bcfg boot mv 3 0<br />
<br />
For bcfg help text:<br />
<br />
Shell> help bcfg -v -b<br />
<br />
or:<br />
<br />
Shell> bcfg -? -v -b<br />
<br />
==== map ====<br />
<br />
{{ic|map}} displays a list of device mappings i.e. the names of available file systems ({{ic|FS0}}) and storage devices ({{ic|blk0}}).<br />
<br />
Before running file system commands such as {{ic|cd}} or {{ic|ls}}, you need to change the shell to the appropriate file system by typing its name:<br />
<br />
Shell> FS0:<br />
FS0:\> cd EFI/<br />
<br />
==== edit ====<br />
<br />
{{ic|edit}} provides a basic text editor with an interface similar to nano, but slightly less functional. It handles UTF-8 encoding and takes care or LF vs CRLF line endings.<br />
<br />
For example, to edit rEFInd's {{ic|refind.conf}} in the EFI system partition ({{ic|FS0:}} in the firmware),<br />
<br />
Shell> edit FS0:\EFI\refind\refind.conf<br />
<br />
Press {{ic|Ctrl+e}} for help.<br />
<br />
== UEFI drivers ==<br />
<br />
{{Expansion|Explain what are and how to use UEFI drivers. Add automatic UEFI driver loading setup with efibootmgr's {{ic|-r}}/{{ic|--driver}} option. Mention rEFInd's file system drivers (and how it loads them), and also [https://github.com/systemd/systemd/issues/15617 systemd-boot's planned feature].}}<br />
<br />
UEFI drivers are pieces of software that support some functionality. For example, access to NTFS formatted partitions is usually not possible from a UEFI shell. The {{Pkg|efifs}} package has drivers that support reading many more file systems from within an EFI shell. A usage example is to copy such driver to a partition that can be accessed from an UEFI shell. Then, from the UEFI shell, issuing commands such as:<br />
<br />
Shell> load ntfs_x64.efi<br />
Shell> map -r<br />
<br />
After the map command has been executed, the user should be able to access NTFS formatted partitions from within a UEFI shell.<br />
<br />
== UEFI bootable media ==<br />
<br />
=== Create UEFI bootable USB from ISO ===<br />
<br />
Follow [[USB flash installation medium#Using the ISO as is (BIOS and UEFI)]].<br />
<br />
=== Remove UEFI boot support from optical media ===<br />
<br />
{{Note|<br />
* This section mentions removing UEFI boot support from a '''CD/DVD only''' (Optical Media booting via EL Torito), not from a USB flash drive.<br />
* In order to hide the UEFI equipment on USB stick, use a partition editor after having copied the ISO to the flash drive. Remove the partition of type {{ic|EF}}. '''Do not''' accept offers to convert to GPT.<br />
}}<br />
<br />
Most of the 32-bit EFI Macs and some 64-bit EFI Macs refuse to boot from a UEFI(X64)+BIOS bootable CD/DVD. If one wishes to proceed with the installation using optical media, it might be necessary to remove UEFI support first.<br />
<br />
Extract the ISO skipping the UEFI-specific directories:<br />
<br />
$ mkdir extracted_iso<br />
$ bsdtar -x --exclude=EFI/ --exclude=loader/ -f archlinux-''version''-x86_64.iso -C extracted_iso<br />
<br />
Then rebuild the ISO, excluding the UEFI optical media booting support, using {{man|1|xorriso}} from {{Pkg|libisoburn}}. Be sure to set the correct volume label, e.g. {{ic|ARCH_202103}}; it can be acquired using {{man|1|file}} on the original ISO.<br />
<br />
{{bc|1=<br />
$ xorriso -as mkisofs \<br />
-iso-level 3 \<br />
-full-iso9660-filenames \<br />
-joliet \<br />
-joliet-long \<br />
-rational-rock \<br />
-volid "ARCH_''YYYYMM''" \<br />
-appid "Arch Linux Live/Rescue CD" \<br />
-publisher "Arch Linux <https://archlinux.org>" \<br />
-preparer "prepared by $USER" \<br />
-eltorito-boot syslinux/isolinux.bin \<br />
-eltorito-catalog syslinux/boot.cat \<br />
-no-emul-boot -boot-load-size 4 -boot-info-table \<br />
-isohybrid-mbr "extracted_iso/syslinux/isohdpfx.bin" \<br />
-output archlinux-''version''-x86_64-noUEFI.iso extracted_iso/<br />
}}<br />
<br />
Burn {{ic|archlinux-''version''-x86_64-noUEFI.iso}} to optical media and proceed with installation normally.<br />
<br />
== Testing UEFI in systems without native support ==<br />
<br />
=== OVMF for virtual machines ===<br />
<br />
[https://github.com/tianocore/tianocore.github.io/wiki/OVMF OVMF] is a TianoCore project to enable UEFI support for Virtual Machines. OVMF contains a sample UEFI firmware and a separate non-volatile variable store for [[QEMU]].<br />
<br />
You can install {{Pkg|edk2-ovmf}} from the extra repository.<br />
<br />
It is [https://www.linux-kvm.org/downloads/lersek/ovmf-whitepaper-c770f8c.txt advised] to make a local copy of the non-volatile variable store for your virtual machine:<br />
<br />
$ cp /usr/share/edk2-ovmf/x64/OVMF_VARS.fd my_uefi_vars.fd<br />
<br />
To use the OVMF firmware and this variable store, add following to your QEMU command:<br />
<br />
-drive if=pflash,format=raw,readonly,file=/usr/share/edk2-ovmf/x64/OVMF_CODE.fd \<br />
-drive if=pflash,format=raw,file=my_uefi_vars.fd<br />
<br />
For example:<br />
<br />
$ qemu-system-x86_64 -enable-kvm -m 1G -drive if=pflash,format=raw,readonly,file=/usr/share/edk2-ovmf/x64/OVMF_CODE.fd -drive if=pflash,format=raw,file=my_uefi_vars.fd …<br />
<br />
=== DUET for BIOS only systems ===<br />
<br />
DUET was a TianoCore project that enabled chainloading a full UEFI environment from a BIOS system, in a way similar to BIOS OS booting. This method is being [https://www.insanelymac.com/forum/topic/186440-linux-and-windows-uefi-boot-using-tianocore-duet-firmware/ discussed] extensively. Pre-build DUET images can be downloaded from one of the [https://gitlab.com/tianocore_uefi_duet_builds/tianocore_uefi_duet_installer repos]{{Dead link|2023|04|07|status=404 Page Not Found}}. Read specific [https://gitlab.com/tianocore_uefi_duet_builds/tianocore_uefi_duet_installer/blob/master/Migle_BootDuet_INSTALL.txt instructions]{{Dead link|2023|04|07|status=404 Page Not Found}} for setting up DUET. However, as of November 2018, the DUET code has been removed from TianoCore git repository.<br />
<br />
You can also try [[Clover]] which provides modified DUET images that may contain some system specific fixes and is more frequently updated compared to the gitlab repos.<br />
<br />
== Troubleshooting ==<br />
<br />
=== Boot back to Arch Linux when stuck with Windows ===<br />
<br />
To boot back into Arch Linux when you are stuck with Windows, reach ''Advanced startup'' in Windows by the Windows PowerShell command {{ic|shutdown /r /o}}, or via ''Settings > Update & Security > Recovery > Advanced startup'' and select ''Restart now''. When you have reached the ''Advanced startup'' menu, choose ''Use a device'', which actually contains your UEFI boot options (not limited to USB or CD, but can also boot operating system in hard drive), and choose "Arch Linux".<br />
<br />
=== Enter firmware setup without function keys ===<br />
<br />
On some laptops, like [[Lenovo XiaoXin 15are 2020]], using keys like {{ic|F2}} or {{ic|F12}} does not do anything. This can possibly be fixed by returning laptops to OEM to repair mainboard information, but sometimes this is not possible or not desired. There are however other means to enter firmware setup:<br />
<br />
* With [[systemd#Power management|systemctl]]: {{bc|$ systemctl reboot --firmware-setup}} This will reboot your computer to firmware setup.<br />
* With [[GRUB]]: Press {{ic|c}} for command line and in GRUB command line use {{ic|fwsetup}} to enter firmware setup.<br />
* In Windows: Enter ''Advanced Startup'', see [[#Boot back to Arch Linux when stuck with Windows]].<br />
<br />
=== Userspace tools are unable to modify UEFI variable data ===<br />
<br />
If any userspace tool is unable to modify UEFI variable data, check for existence of {{ic|/sys/firmware/efi/efivars/dump-*}} files. If they exist, delete them, reboot and retry again.<br />
If the above step does not fix the issue, try booting with {{ic|efi_no_storage_paranoia}} kernel parameter to disable kernel UEFI variable storage space check that may prevent writing/modification of UEFI variables.<br />
<br />
{{Warning|{{ic|efi_no_storage_paranoia}} should only be used when needed and should not be left as a normal boot option. The effect of this kernel command line parameter turns off a safeguard that was put in place to help avoid the bricking of machines when the NVRAM gets too full. See {{Bug|34641}} for more information.}}<br />
<br />
=== Cannot create a new boot entry with efibootmgr ===<br />
<br />
Some kernel and ''efibootmgr'' version combinations might refuse to create new boot entries. This could be due to lack of free space in the NVRAM. You can try the solution at [[#Userspace tools are unable to modify UEFI variable data]]. <br />
<br />
You can also try to [[downgrade]] your ''efibootmgr'' install to version 0.11.0. This version works with Linux version 4.0.6. See the bug discussion {{Bug|34641}}, in particular the [https://bugs.archlinux.org/task/34641#comment111365 closing comment], for more information.<br />
<br />
=== Windows changes boot order ===<br />
<br />
If you [[dual boot with Windows]] and your motherboard just boots Windows immediately instead of your chosen EFI application, there are several possible causes and workarounds.<br />
<br />
* Ensure [[Dual boot with Windows#Fast Startup and hibernation|Fast Startup]] is disabled in your Windows power options<br />
* Ensure [[Secure Boot]] is disabled in your firmware (if you are not using a signed boot loader)<br />
* Ensure your UEFI boot order does not have Windows Boot Manager set first e.g. using [[#efibootmgr|efibootmgr]] and what you see in the configuration tool of the UEFI. Some motherboards override by default any settings set with efibootmgr by Windows if it detects it. This is confirmed in a Packard Bell laptop.<br />
* If your motherboard is booting the default boot path ({{ic|\EFI\BOOT\BOOTx64.EFI}}), this file may have been overwritten with the Windows boot loader. Try setting the correct boot path e.g. using [[#efibootmgr|efibootmgr]].<br />
* If the previous steps do not work, you can tell the Windows boot loader to run a different EFI application. From a Windows administrator command prompt {{ic|bcdedit /set "{bootmgr}" path "\EFI\''path''\''to''\''app.efi''"}}<br />
* Alternatively, deactivate the Windows Boot Manager by running {{ic|efibootmgr -A -b ''bootnumber''}} as root. Replace {{ic|''bootnumber''}} with the actual Windows Boot Manager boot number; you can see it by running {{ic|efibootmgr}} with no options.<br />
* Alternatively, you can set a startup script in Windows that ensures that the boot order is set correctly every time you boot Windows.<br />
*# Open a command prompt with administrator privileges. Run {{ic|bcdedit /enum firmware}} and find your desired boot entry.<br />
*# Copy the identifier, including the brackets, e.g. {{ic|<nowiki>{31d0d5f4-22ad-11e5-b30b-806e6f6e6963}</nowiki>}}<br />
*# Create a batch file with the command {{ic|bcdedit /set "{fwbootmgr}" DEFAULT "''{copied-boot-identifier}''"}}<br />
*# Open ''gpedit.msc'' and under ''Local Computer Policy > Computer Configuration > Windows Settings > Scripts (Startup/Shutdown)'', choose ''Startup''<br />
*# Under the ''Scripts'' tab, choose the ''Add'' button, and select your batch file<br />
:: Note: [https://answers.microsoft.com/en-us/windows/forum/windows_10-performance/how-to-install-gpeditmsc-in-window-10/f5e9c4fa-8d46-444c-acd7-5cabaea9fc71 Windows 10 Home does not officially include gpedit.msc, although there are unsupported workarounds to install it manually.]<br />
* Alternatively, Task Scheduler can be used to run a startup script in Windows:<br />
*# Follow steps 1-3 above to create the batch file.<br />
*# Run ''taskschd.msc'', then choose ''Create Task...'' from the ''Action'' menu.<br />
*# On the ''General'' tab:<br />
*#: Enter any suitable ''Name'' and ''Description''.<br />
*#: Ensure the user account selected is an "Administrator", not a "Standard User".<br />
*#: Select "''Run whether user is logged in or not''".<br />
*#: Select "''Run with highest privileges''". <br />
*# On the ''Triggers'' tab, choose "''At startup''" from the menu, then click ''OK''.<br />
*# On the ''Actions'' tab, click ''New...'', then ''Browse...'', and locate the batch file from step 1.<br />
*# On the ''Conditions tab'', untick the ''Power'' options so the script runs when on battery power (for laptops).<br />
*# Click ''OK'', and enter the password of the user account selected in step 4 when prompted.<br />
<br />
=== USB media gets struck with black screen ===<br />
<br />
This issue can occur due to [[KMS]] issue. Try [[Kernel mode setting#Disabling modesetting|disabling KMS]] while booting the USB.<br />
<br />
=== UEFI boot loader does not show up in firmware menu ===<br />
<br />
Some firmware do not support custom boot entries. They will instead only boot from hardcoded boot entries.<br />
<br />
A typical workaround is to not rely on boot entries in the NVRAM and install the boot loader to one of the common fallback paths on the EFI system partition.<br />
<br />
The following sections describe the fallback paths.<br />
<br />
==== Default boot path for removable drives ====<br />
<br />
The UEFI specification defines default file paths for EFI binaries for booting from removable media. The relevant ones are:<br />
<br />
* {{ic|''esp''/EFI/BOOT/BOOTx64.EFI}} for x64 UEFI<br />
* {{ic|''esp''/EFI/BOOT/BOOTIA.EFI}} for IA32 UEFI.<br />
<br />
While the specification defines these for removable drives only, most firmware support booting these from any drive.<br />
<br />
See the appropriate [[boot loader]] article on how to install or migrate the boot loader to the default/fallback boot path.<br />
<br />
==== Microsoft Windows boot loader location ====<br />
<br />
On certain UEFI motherboards like some boards with an Intel Z77 chipset, adding entries with {{ic|efibootmgr}} or {{ic|bcfg}} from the UEFI Shell will not work because they do not show up on the boot menu list after being added to NVRAM.<br />
<br />
This issue is caused because the motherboards can only load Microsoft Windows. To solve this you have to place the ''.efi'' file in the location that Windows uses.<br />
<br />
Copy the {{ic|BOOTx64.EFI}} file from the Arch Linux installation medium ({{ic|FSO:}}) to the Microsoft directory your [[ESP]] partition on your hard drive ({{ic|FS1:}}). Do this by booting into EFI shell and typing:<br />
<br />
Shell> mkdir FS1:\EFI\Microsoft<br />
Shell> mkdir FS1:\EFI\Microsoft\Boot<br />
Shell> cp FS0:\EFI\BOOT\BOOTx64.EFI FS1:\EFI\Microsoft\Boot\bootmgfw.efi<br />
<br />
After reboot, any entries added to NVRAM should show up in the boot menu.<br />
<br />
=== Boot entries created with efibootmgr fail to show up in UEFI ===<br />
<br />
''efibootmgr'' can fail to detect EDD 3.0 and as a result create unusable boot entries in NVRAM. See [https://github.com/rhboot/efibootmgr/issues/86 efibootmgr issue 86] for the details.<br />
<br />
To work around this, when creating boot entries manually, add the {{ic|-e 3}} option to the ''efibootmgr'' command. E.g.<br />
<br />
# efibootmgr --create --disk /dev/sda --part 1 --loader /EFI/refind/refind_x64.efi --label "rEFInd Boot Manager" --unicode '''-e 3'''<br />
<br />
To fix boot loader installers, like {{ic|grub-install}} and {{ic|refind-install}}, create a wrapper script {{ic|/usr/local/bin/efibootmgr}} and make it [[executable]]:<br />
<br />
{{hc|/usr/local/bin/efibootmgr|<br />
#!/bin/sh<br />
<br />
exec /usr/bin/efibootmgr -e 3 "$@"<br />
}}<br />
<br />
=== UEFI boot entry disappears after removing its referenced drive ===<br />
<br />
Some firmware will remove boot entries referencing drives that are not present during boot. This could be an issue when frequently detaching/attaching drives or when booting from a removable drive.<br />
<br />
The solution is to install the [[boot loader]] to [[#Default boot path for removable drives|the default/fallback boot path]].<br />
<br />
=== Boot entries are randomly removed ===<br />
<br />
Some motherboards may remove boot entries due to lack of free space in the NVRAM instead of giving an error at creation. To prevent this from occurring, reduce the amount of boot entries being added by minimizing your entry creation process, as well as reducing the amount of automatic drive boot entries by the [[Wikipedia:Unified Extensible Firmware Interface#CSM booting|Compatibility Support Module (CSM)]] by disabling it from your UEFI settings. See [https://bbs.archlinux.org/viewtopic.php?pid=1608838#p1608838 BBS#1608838].<br />
<br />
Another reason why boot entries might have been removed is the fact that UEFI specification allows OEMs to do "NVRAM maintenance" during boot process. Those manufacturers do it simply: they just look up for EFI applications in predefined, hardcoded paths on the device. If they fail to find any, they conclude there is no OS on the device and wipe all boot entries from NVRAM associated with it, because they assume the NVRAM contains some corrupted or outdated data. If you do not plan to install Windows and still want to load the Linux kernel directly from the firmware, one possible workaround is to create an empty file {{ic|''esp''/EFI/BOOT/BOOTX64.EFI}}: <br />
<br />
# mkdir -p ''esp''/EFI/BOOT <br />
# touch ''esp''/EFI/BOOT/BOOTX64.EFI<br />
<br />
And restore the deleted boot entry. Now after reboot the motherboard will see the "Fake OS" and should not wipe other boot entries from NVRAM. You can change the fake OS loader with an actual EFI application if you want, of course, as long as you keep the standard fallback name.<br />
<br />
== See also ==<br />
<br />
* [[Wikipedia:UEFI]]<br />
* [https://www.uefi.org/home/ UEFI Forum] - contains the official [https://uefi.org/specifications UEFI Specifications] - GUID Partition Table is part of UEFI Specification<br />
* [https://www.happyassassin.net/2014/01/25/uefi-boot-how-does-that-actually-work-then/ UEFI boot: how does that actually work, then? - A blog post by AdamW]<br />
* [https://docs.kernel.org/arch/x86/x86_64/uefi.html Linux Kernel UEFI documentation for x86_64 platforms]<br />
* [https://www.intel.com/content/www/us/en/architecture-and-technology/unified-extensible-firmware-interface/efi-homepage-general-technology.html Intel's page on EFI]<br />
* [https://firmware.intel.com/ Intel Architecture Firmware Resource Center]{{Dead link|2023|07|30|status=404}}<br />
* [https://web.archive.org/web/20191230095118/https://firmware.intel.com/blog/linux-efi-boot-stub Matt Fleming - The Linux EFI Boot Stub]<br />
* [https://web.archive.org/web/20190319175019/https://firmware.intel.com/blog/accessing-uefi-variables-linux Matt Fleming - Accessing UEFI Variables from Linux]<br />
* [https://www.rodsbooks.com/linux-uefi/ Rod Smith - Linux on UEFI: A Quick Installation Guide]<br />
* [https://lore.kernel.org/lkml/20110608192950.GA29235@srcf.ucam.org/ UEFI Boot problems on some newer machines (LKML)]<br />
* [https://linuxplumbers.ubicast.tv/videos/plumbing-uefi-into-linux/ LPC 2012 Plumbing UEFI into Linux]{{Dead link|2021|05|17|status=domain name not resolved}}<br />
* [https://linuxplumbers.ubicast.tv/videos/uefi-tutorial-part-1/ LPC 2012 UEFI Tutorial : part 1]{{Dead link|2021|05|17|status=domain name not resolved}}<br />
* [https://linuxplumbers.ubicast.tv/videos/uefi-tutorial-part-2/ LPC 2012 UEFI Tutorial : part 2]{{Dead link|2021|05|17|status=domain name not resolved}}<br />
* [https://www.tianocore.org/ Intel's TianoCore Project] for Open-Source UEFI firmware which includes DuetPkg for direct BIOS based booting and OvmfPkg used in QEMU and Oracle VirtualBox<br />
* [http://jdebp.info/FGA/efi-boot-process.html FGA: The EFI boot process]<br />
* [https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/windows-and-gpt-faq Microsoft's Windows and GPT FAQ]<br />
* [https://gitlab.com/tianocore_uefi_duet_builds/tianocore_uefi_duet_installer/wikis/Windows_x64_BIOS_to_UEFI Convert Windows x64 from BIOS-MBR mode to UEFI-GPT mode without Reinstall]<br />
* [https://gitlab.com/tianocore_uefi_duet_builds/tianocore_uefi_duet_installer/wikis/Linux_Windows_BIOS_UEFI_boot_USB Create a Linux BIOS+UEFI and Windows x64 BIOS+UEFI bootable USB drive]<br />
* [https://rodsbooks.com/bios2uefi/ Rod Smith - A BIOS to UEFI Transformation]<br />
* [https://web.archive.org/web/20190404074007/https://software.intel.com/en-us/articles/efi-shells-and-scripting/ EFI Shells and Scripting - Intel Documentation]<br />
* [https://web.archive.org/web/20190117223426/https://software.intel.com/en-us/articles/uefi-shell/ UEFI Shell - Intel Documentation]<br />
* [https://web.archive.org/web/20130929114218/http://www.hpuxtips.es/?q=node/293 UEFI Shell - bcfg command info]<br />
* [https://lwn.net/Articles/632528/ The bootstrap process on EFI systems]</div>Delapouitehttps://wiki.archlinux.org/index.php?title=Arch_boot_process&diff=789691Arch boot process2023-10-10T07:07:13Z<p>Delapouite: add Wikipedia link to ISO 9660</p>
<hr />
<div>[[Category:Boot process]]<br />
[[Category:About Arch]]<br />
[[bs:Arch boot process]]<br />
[[es:Arch boot process]]<br />
[[fr:Arch boot process]]<br />
[[ja:Arch ブートプロセス]]<br />
[[pt:Arch boot process]]<br />
[[ru:Arch boot process]]<br />
[[zh-hans:Arch boot process]]<br />
{{Related articles start}}<br />
{{Related|Master Boot Record}}<br />
{{Related|GUID Partition Table}}<br />
{{Related|Unified Extensible Firmware Interface}}<br />
{{Related|mkinitcpio}}<br />
{{Related|init}}<br />
{{Related|systemd}}<br />
{{Related|fstab}}<br />
{{Related|Autostarting}}<br />
{{Related articles end}}<br />
<br />
In order to boot Arch Linux, a Linux-capable [[#Boot loader|boot loader]] must be set up. The boot loader is responsible for loading the kernel and [[#initramfs|initial ramdisk]] before initiating the boot process. The procedure is quite different for [[Wikipedia:BIOS|BIOS]] and [[UEFI]] systems. A detailed description is given on this or linked pages.<br />
<br />
== Firmware types ==<br />
<br />
The firmware is the very first program that is executed once the system is switched on. <br />
{{Tip|The words BIOS and (U)EFI are often used instead of firmware}}<br />
<br />
=== BIOS ===<br />
<br />
A [[Wikipedia:BIOS|BIOS]] or Basic Input-Output System is in most cases stored in a flash memory in the motherboard itself and independent of the system storage. Originally created for the [[Wikipedia:IBM PC|IBM PC]] to handle hardware initialization and the boot process, it has been replaced progressively since 2010 by the [[#UEFI|UEFI]] which does not suffer from the same technical limitations.<br />
<br />
=== UEFI ===<br />
<br />
The [[Unified Extensible Firmware Interface]] has support for reading both the partition table as well as file systems. UEFI does not launch any [[Partitioning#Master Boot Record (bootstrap code)|boot code from the Master Boot Record (MBR)]] whether it exists or not, instead booting relies on boot entries in the [[Wikipedia:Non-volatile random-access memory|NVRAM]].<br />
<br />
The UEFI specification mandates support for the [[FAT|FAT12, FAT16, and FAT32]] file systems (see [https://uefi.org/specs/UEFI/2.10/13_Protocols_Media_Access.html#file-system-format-1 UEFI specification version 2.10, section 13.3.1.1]), but any conformant vendor can optionally add support for additional file systems; for example, [[Wikipedia:HFS+|HFS+]] or [[Wikipedia:APFS|APFS]] in some Apple's firmwares. UEFI implementations also support [[Wikipedia:ISO_9660|ISO 9660]] for optical discs.<br />
<br />
UEFI launches EFI applications, e.g. [[#Boot loader|boot loaders]], boot managers, [[UEFI shell]], etc. These applications are usually stored as files in the [[EFI system partition]]. Each vendor can store its files in the EFI system partition under the {{ic|/EFI/''vendor_name''}} directory. The applications can be launched by adding a boot entry to the NVRAM or from the UEFI shell.<br />
<br />
The UEFI specification has support for legacy [[#BIOS|BIOS]] booting with its [[Wikipedia:Unified Extensible Firmware Interface#CSM booting|Compatibility Support Module (CSM)]]. If CSM is enabled in the UEFI, the UEFI will generate CSM boot entries for all drives. If a CSM boot entry is chosen to be booted from, the UEFI's CSM will attempt to boot from the drive's MBR bootstrap code.<br />
<br />
{{Note|Intel is phasing out support for CSM, relying on the feature may not be feasible in the future.[https://www.intel.com/content/dam/support/us/en/documents/intel-nuc/Legacy-BIOS-Boot-Support-Removal-for-Intel-Platforms.pdf]}}<br />
<br />
== System initialization ==<br />
<br />
=== Under BIOS ===<br />
<br />
# System switched on, the [[Wikipedia:Power-on self-test|power-on self-test (POST)]] is executed.<br />
# After POST, BIOS initializes the hardware required for booting (disk, keyboard controllers etc.).<br />
# BIOS launches the first 440 bytes ([[Partitioning#Master Boot Record (bootstrap code)|the Master Boot Record bootstrap code area]]) of the first disk in the BIOS disk order.<br />
# The boot loader's first stage in the MBR boot code then launches its second stage code (if any) from either:<br />
#* next disk sectors after the MBR, i.e. the so called post-MBR gap (only on a MBR partition table),<br />
#* a partition's or a partitionless disk's [[Wikipedia:Volume boot record|volume boot record (VBR)]],<br />
#* for [[GRUB]] on a GPT partitioned disk—a GRUB-specific [[BIOS boot partition]] (it is used in place of the post-MBR gap that does not exist in GPT).<br />
# The actual [[#Boot loader|boot loader]] is launched.<br />
# The boot loader then loads an operating system by either chain-loading or directly loading the operating system kernel.<br />
<br />
=== Under UEFI ===<br />
<br />
# System switched on, the [[Wikipedia:Power-on self-test|power-on self-test (POST)]] is executed.<br />
# After POST, UEFI initializes the hardware required for booting (disk, keyboard controllers etc.).<br />
# Firmware reads the boot entries in the NVRAM to determine which EFI application to launch and from where (e.g. from which disk and partition).<br />
#* A boot entry could simply be a disk. In this case the firmware looks for an [[EFI system partition]] on that disk and tries to find an EFI application in the fallback boot path {{ic|\EFI\BOOT\BOOTx64.EFI}} ({{ic|BOOTIA32.EFI}} on [[Unified Extensible Firmware Interface#UEFI firmware bitness|systems with a IA32 (32-bit) UEFI]]). This is how UEFI bootable removable media work.<br />
# Firmware launches the EFI application.<br />
#* This could be a [[#Boot loader|boot loader]] or the Arch [[kernel]] itself using [[EFISTUB]].<br />
#* It could be some other EFI application such as the [[UEFI shell]] or a [[#Boot loader|boot manager]] like [[systemd-boot]] or [[rEFInd]].<br />
<br />
If [[Secure Boot]] is enabled, the boot process will verify authenticity of the EFI binary by signature.<br />
<br />
{{Note|Some UEFI systems can only boot from the fallback boot path.}}<br />
<br />
==== Multibooting in UEFI ====<br />
<br />
Since each OS or vendor can maintain its own files within the [[EFI system partition]] without affecting the other, multi-booting using UEFI is just a matter of launching a different EFI application corresponding to the particular operating system's boot loader. This removes the need for relying on the [[Wikipedia:Chain loading|chain loading]] mechanisms of one [[#Boot loader|boot loader]] to load another OS.<br />
<br />
See also [[Dual boot with Windows]].<br />
<br />
== Boot loader ==<br />
<br />
A boot loader is a piece of software started by the firmware ([[Wikipedia:BIOS|BIOS]] or [[UEFI]]). It is responsible for loading the kernel with the wanted [[kernel parameters]] and any external initramfs images. In the case of UEFI, the kernel itself can be directly launched by the UEFI using the [[EFISTUB|EFI boot stub]]. A separate boot loader or boot manager can still be used for the purpose of editing kernel parameters before booting.<br />
<br />
{{Warning|A boot loader must be able to access the kernel and initramfs image(s), otherwise the system will not boot. Thus, in a typical setup, it must support accessing {{ic|/boot}}. That means it must have support for everything starting from the block devices, stacked block devices (LVM, RAID, dm-crypt, LUKS, etc) and ending with the file system on which the kernel(s) and initramfs image(s) reside.}}<br />
<br />
{{Note|Loading [[Microcode]] updates requires adjustments in boot loader configuration. [https://archlinux.org/news/changes-to-intel-microcodeupdates/]}}<br />
<br />
=== Feature comparison ===<br />
<br />
{{Note|<br />
* As GPT is part of the UEFI specification, all UEFI boot loaders support GPT disks. GPT on BIOS systems is possible, using either "hybrid booting" with [https://www.rodsbooks.com/gdisk/hybrid.html Hybrid MBR], or the new [https://repo.or.cz/syslinux.git/blob/HEAD:/doc/gpt.txt GPT-only] protocol. This protocol may however cause issues with certain BIOS implementations; see [https://www.rodsbooks.com/gdisk/bios.html#bios rodsbooks] for details.<br />
* Encryption mentioned in file system support is [[wikipedia:Filesystem-level encryption|filesystem-level encryption]], it has no bearing on [[dm-crypt|block-level encryption]]. <br />
}}<br />
<br />
{| class="wikitable sortable"<br />
! rowspan="2"| Name<br />
! colspan="2"| Firmware<br />
! colspan="2"| [[Partition table]]<br />
! rowspan="2"| Multi-boot<br />
! colspan="5"| [[File systems]]<br />
! rowspan="2"| Notes<br />
|-<br />
! BIOS !! [[UEFI]]<br />
! [[MBR]] !! [[GPT]]<br />
! [[Btrfs]] !! [[ext4]] !! ReiserFS !! [[VFAT]] !! [[XFS]]<br />
|-<br />
! [[EFISTUB]]<br />
| {{-}} || {{Yes}}<br />
| {{Yes}} || {{Yes}}<br />
| {{-}}<br />
| {{-}} || {{-}} || {{-}} || {{G|Inherited from firmware<sup>1</sup>}} || {{-}}<br />
| The kernel is a valid EFI executable which can be loaded directly from the UEFI firmware with [[efibootmgr]], or another bootloader.<br />
|-<br />
! [[Unified kernel image]]<br />
| {{-}} || {{Yes}}<sup>2</sup><br />
| {{Yes}} || {{Yes}}<br />
| {{-}}<br />
| {{-}} || {{-}} || {{-}} || {{G|Inherited from firmware<sup>1</sup>}} || {{-}}<br />
| {{man|7|systemd-stub}}, a kernel, initramfs and kernel command line packed into EFI executable to be loaded directly from UEFI firmware or another boot loader.<br />
|-<br />
! [[GRUB]]<br />
| {{Yes}} || {{Yes}}<br />
| {{Yes}} || {{Yes}}<br />
| {{Yes}}<br />
| {{Yes}} || {{Yes}} || {{Yes}} || {{Yes}} || {{Yes}}<br />
| On BIOS/GPT configuration requires a [[BIOS boot partition]]. <br/>Supports RAID, LUKS1 and LVM (but not thin provisioned volumes).<br />
|-<br />
! [[Limine]]<br />
| {{Yes}} || {{Yes}}<br />
| {{Yes}} || {{Yes}}<br />
| {{Yes}}<br />
| {{No}} || {{Y|Without encryption}} || {{No}} || {{Yes}} || {{No}}<br />
|<br />
|-<br />
! [[rEFInd]]<br />
| {{No}} || {{Yes}}<br />
| {{Yes}} || {{Yes}}<br />
| {{Yes}}<sup>3</sup><br />
| {{Y|Without encryption}} || {{Y|Without encryption}} || {{Y|Without tail-packing feature}} || {{G|Inherited from firmware<sup>1</sup>}} || {{No}}<br />
| Supports auto-detecting kernels and parameters without explicit configuration, and supports fastboot [https://bbs.archlinux.org/viewtopic.php?id=258805].<br />
|-<br />
! [[Syslinux]]<br />
| {{Yes}} || {{Y|[[Syslinux#UEFI Systems|Limited]]}}<br />
| {{Yes}} || {{Yes}}<br />
| {{Y|[[Syslinux#Chainloading|Partial]]}}<br />
| {{Y|Without: multi-device volumes, compression, encryption}} || {{Y|Without encryption}} || {{No}} || {{Yes}} || {{Y|MBR only; without sparse inodes}}<br />
| No support for certain [[file system]] features.[https://wiki.syslinux.org/wiki/index.php?title=Filesystem] <br/>Does not have file system drivers[https://bugzilla.syslinux.org/show_bug.cgi?id=33], can only access the file system it was installed to.<br />
|-<br />
! [[systemd-boot]]<br />
| {{No}} || {{Yes}}<sup>2</sup><br />
| {{Y|[https://github.com/systemd/systemd/issues/1125 Manual install only]}} || {{Yes}}<br />
| {{Yes}}<sup>3</sup><br />
| {{Y|Can be side-loaded<sup>4</sup>}} || {{Y|Can be side-loaded<sup>4</sup>}} || {{Y|Can be side-loaded<sup>4</sup>}} || {{G|Inherited from firmware<sup>1</sup>}} || {{Y|Can be side-loaded<sup>4</sup>}}<br />
| Cannot launch binaries from partitions other than the [[ESP]] or the Extended Boot Loader Partition (XBOOTLDR partition). <br /> Supports automatically detecting [[Unified kernel image|unified kernel images]] when they are placed into {{ic|''esp''/EFI/Linux}}.<br />
|-<br />
! {{Grey|[[GRUB Legacy]]}}<br />
| {{Yes}} || {{No}}<br />
| {{Yes}} || {{No}}<br />
| {{Yes}}<br />
| {{No}} || {{No}} || {{Yes}} || {{Yes}} || {{Y|XFS v4 only}}<br />
| [https://www.gnu.org/software/grub/grub-legacy.html Discontinued] in favor of [[GRUB]].<br />
|-<br />
! {{Grey|[[LILO]]}}<br />
| {{Yes}} || {{No}}<br />
| {{Yes}} || {{No}}<br />
| {{Yes}}<br />
| {{No}} || {{Y|Without encryption}} || {{Yes}} || {{Yes}} || {{Yes|https://xfs.org/index.php/XFS_FAQ#Q:_Does_LILO_work_with_XFS.3F}}<br />
| [https://web.archive.org/web/20180323163248/http://lilo.alioth.debian.org/ Discontinued] due to limitations (e.g. with Btrfs, GPT, RAID).<br />
|}<br />
<br />
# File system support is inherited from the firmware. The UEFI specification mandates support for the FAT12, FAT16 and FAT32 file systems[https://uefi.org/specs/UEFI/2.10/13_Protocols_Media_Access.html#file-system-format-1], but vendors can optionally add support for additional file systems; for example, the firmware in Apple [[Mac]]s supports the HFS+ file system. If the firmware provides an interface for loading [[Unified Extensible Firmware Interface#UEFI drivers|UEFI drivers]] on startup, then support for additional file systems can be added by loading (independently acquired) file system drivers.<br />
# Supports mixed mode booting on IA32 UEFI. I.e. it can boot a 64-bit x86_64 Linux kernel on [[Unified Extensible Firmware Interface#UEFI firmware bitness|32-bit IA32 UEFI]].<br />
# A [https://www.rodsbooks.com/efi-bootloaders/principles.html boot manager]. It can only launch other EFI applications, for example, Linux kernel images built with {{ic|1=CONFIG_EFI_STUB=y}} and Windows {{ic|bootmgfw.efi}}.<br />
# systemd-boot supports loading [[Unified Extensible Firmware Interface#UEFI drivers|UEFI file system drivers]]. These are provided by {{Pkg|efifs}} and need to be placed into {{ic|''esp''/EFI/systemd/drivers/}}. <br />
<br />
See also [[Wikipedia:Comparison of boot loaders]].<br />
<br />
== Kernel ==<br />
<br />
The [[#Boot loader|boot loader]] boots the [[Wikipedia:vmlinux|vmlinux image]] containing the [[kernel]].<br />
<br />
The kernel functions on a low level (''kernelspace'') interacting between the hardware of the machine and the programs. The kernel initially performs hardware enumeration and initialization before continuing to userspace. See [[Wikipedia:Kernel (operating system)]] and [[Wikipedia:Linux kernel]] for a detailed explanation.<br />
<br />
== initramfs ==<br />
<br />
The root file system at {{ic|/}} starts out as an empty [https://docs.kernel.org/filesystems/ramfs-rootfs-initramfs.html rootfs], which is a special instance of ramfs or tmpfs. This is the temporary root file system where the initramfs (''init''ial ''RAM'' ''f''ile ''s''ystem) images will be unpacked to.<br />
<br />
The purpose of the initramfs is to bootstrap the system to the point where it can access the root file system (see [[FHS]] for details). It does not need to contain every module one would ever want to use; it should only have modules required for the root device like IDE, SCSI, SATA or USB/FW (if booting from an external drive) and encryption. The majority of modules will be loaded later on by [[udev]], during the init process.<br />
<br />
First, the kernel unpacks its builtin initramfs into the temporary root. Arch Linux's [[Kernel#Officially supported kernels|official kernels]] use an empty archive for the builtin initramfs, which is the default when building Linux. Then, the kernel unpacks external initramfs files specified by the command line passed by the [[#Boot loader|boot loader]], overwriting any files from the embedded initramfs. These external initramfs images can be generated with [[mkinitcpio]], [[dracut]] or [[booster]], and are Arch's preferred method for setting up for ''early userspace''.<br />
<br />
== Early userspace ==<br />
<br />
The ''early userspace'' stage takes place while the temporary rootfs is mounted, operating on the files provided by the [[#initramfs]].<br />
<br />
The function of early userspace is [[Mkinitcpio#Common hooks|configurable]], but generally does the following:<br />
<br />
* {{man|8|systemd-modules-load}} loads kernel modules, such as any block device modules needed to mount the real root file system.<br />
* Handle decryption of the real root file system, if applicable.<br />
* Load the DRM module, as [[Kernel mode setting#Early KMS start|early KMS]] is enabled by default for in-tree modules.<br />
<br />
At the final stage of early userspace, the real root is mounted at {{ic|/sysroot}}, and then switched to. The late userspace starts by executing the [[init]] program from the real root file system.<br />
<br />
== Late userspace ==<br />
<br />
The startup of late userspace is executed by the [[init]] process. Arch officially uses [[systemd]] which is built on the concept of units and services, but the functionality described here largely overlaps with other init systems.<br />
<br />
=== getty ===<br />
<br />
The init process calls [[getty]] once for each [[Wikipedia:Virtual console|virtual terminal]] (typically six of them). ''getty'' initializes each terminal and protects it from unauthorized access. When the username and password are provided, ''getty'' checks them against {{ic|/etc/passwd}} and {{ic|/etc/shadow}}, then calls {{man|1|login}}.<br />
<br />
==== Login ====<br />
<br />
The ''login'' program begins a session for the user by setting environment variables and starting the user's shell, based on {{ic|/etc/passwd}}. The ''login'' program displays the contents of [[Wikipedia:motd (Unix)|/etc/motd]] (''m''essage ''o''f ''t''he ''d''ay) after a successful login, just before it executes the login shell. It is a good place to display your Terms of Service to remind users of your local policies or anything you wish to tell them.<br />
<br />
==== Shell ====<br />
<br />
Once the user's [[shell]] is started, it will typically run a runtime configuration file, such as [[bashrc]], before presenting a prompt to the user. If the account is configured to [[start X at login]], the runtime configuration file will call [[startx]] or [[xinit]]. Jump to [[#Graphical session]] for the end.<br />
<br />
=== Display manager ===<br />
<br />
{{Expansion|This section only describes the process with [[Xorg]] but does not explain what happens with [[Wayland]].}}<br />
<br />
Additionally, [[init]] can be configured to start a [[display manager]] instead of ''getty'' on a specific virtual terminal. This requires manually [[enabling]] its [[Systemd#Using units|systemd service file]]. The display manager then starts a graphical session. <br />
<br />
==== Graphical session ====<br />
<br />
[[xinit]] runs the user's [[xinitrc]] runtime configuration file, which normally starts a [[window manager]] or a [[desktop environment]]. When the user is finished and exits, ''xinit'', ''startx'', the shell, and login will terminate in that order, returning to ''getty'' or the display manager.<br />
<br />
== See also ==<br />
<br />
* [https://web.archive.org/web/20150430223035/http://archlinux.me/brain0/2010/02/13/early-userspace-in-arch-linux/ Early Userspace in Arch Linux]<br />
* [https://developer.ibm.com/articles/l-linuxboot/ Inside the Linux boot process]<br />
* [[Wikipedia:Linux startup process]]<br />
* [[Wikipedia:initrd]]<br />
* [https://www.cyberciti.biz/faq/grub-boot-into-single-user-mode/ Boot Linux Grub Into Single User Mode]<br />
* [https://neosmart.net/wiki/mbr-boot-process/ NeoSmart: The BIOS/MBR Boot Process]<br />
* [https://www.linux.com/learn/kernel-newbie-corner-initrd-and-initramfs-whats Kernel Newbie Corner: initrd and initramfs]<br />
* [https://www.rodsbooks.com/efi-bootloaders/ Rod Smith - Managing EFI Boot Loaders for Linux]</div>Delapouitehttps://wiki.archlinux.org/index.php?title=Nginx&diff=640000Nginx2020-10-29T10:37:01Z<p>Delapouite: fix non https link pointing to the nginx.org documentation, as their server does not perform automatic redirection</p>
<hr />
<div>{{Lowercase title}}<br />
[[Category:Web server]]<br />
[[de:Nginx]]<br />
[[ja:Nginx]]<br />
[[ru:Nginx]]<br />
[[zh-hans:Nginx]]<br />
[[Wikipedia:nginx|nginx]] (pronounced "engine X"), is a free, open-source, high-performance HTTP server and reverse proxy, as well as an IMAP/POP3 proxy server, written by Igor Sysoev in 2005. nginx is well known for its stability, rich feature set, simple configuration, and low resource consumption.<br />
<br />
This article describes how to set up nginx and how to optionally integrate it with [[PHP]] via [[#FastCGI]].<br />
<br />
== Installation ==<br />
<br />
[[Install]] the package {{Pkg|nginx-mainline}} (mainline branch: new features, updates, bugfixes) or {{Pkg|nginx}} (stable branch: major bugfixes only).<br />
<br />
Using the mainline branch is recommended. The main reason to use the stable branch is that you are concerned about possible impacts of new features, such as incompatibility with third-party modules or the inadvertent introduction of bugs in [https://nginx.org/en/download.html new features].<br />
<br />
{{Note|All nginx modules available in the [[official repositories]] require the ''nginx'' package (as opposed to ''nginx-mainline'') as a dependency. It may be wise to review the list of modules for any you might need/want before making the ''nginx'' vs ''nginx-mainline'' decision. Modules for ''nginx-mainline'' can be found in the [[Arch User Repository]].}}<br />
<br />
For a chroot-based installation for additional security, see [[#Installation in a chroot]].<br />
<br />
== Running ==<br />
<br />
[[Start/enable]] {{ic|nginx.service}}.<br />
<br />
The default page served at http://127.0.0.1 is {{ic|/usr/share/nginx/html/index.html}}.<br />
<br />
== Configuration ==<br />
<br />
First steps with nginx are described in the [https://nginx.org/en/docs/beginners_guide.html Beginner’s Guide]. You can modify the configuration by editing the files in {{ic|/etc/nginx/}} The main configuration file is located at {{ic|/etc/nginx/nginx.conf}}.<br />
<br />
More details and examples can be found in https://wiki.nginx.org/Configuration and the [https://nginx.org/en/docs/ official documentation].<br />
<br />
The examples below cover the most common use cases. It is assumed that you use the default location for documents ({{ic|/usr/share/nginx/html}}). If that is not the case, substitute your path instead.<br />
<br />
{{Tip|A [https://nginxconfig.io/ Nginx configuration tool] has been provided by DigitalOcean.}}<br />
<br />
=== Configuration example ===<br />
{{hc|/etc/nginx/nginx.conf|<nowiki><br />
user http;<br />
worker_processes auto;<br />
worker_cpu_affinity auto;<br />
<br />
events {<br />
multi_accept on;<br />
worker_connections 1024;<br />
}<br />
<br />
http {<br />
charset utf-8;<br />
sendfile on;<br />
tcp_nopush on;<br />
tcp_nodelay on;<br />
server_tokens off;<br />
log_not_found off;<br />
types_hash_max_size 4096;<br />
client_max_body_size 16M;<br />
<br />
# MIME<br />
include mime.types;<br />
default_type application/octet-stream;<br />
<br />
# logging<br />
access_log /var/log/nginx/access.log;<br />
error_log /var/log/nginx/error.log warn;<br />
<br />
# load configs<br />
include /etc/nginx/conf.d/*.conf;<br />
include /etc/nginx/sites-enabled/*;<br />
}<br />
</nowiki>}}<br />
<br />
=== General configuration ===<br />
<br />
==== Processes and connections ====<br />
<br />
You should choose a fitting value for {{ic|worker_processes}}. This setting ultimately defines how many connections nginx will accept and how many processors it will be able to make use of. Generally, making it the number of hardware threads in your system is a good start. Alternatively, {{ic|worker_processes}} accepts the {{ic|auto}} value since versions 1.3.8 and 1.2.5, which will try to autodetect the optimal value ([https://nginx.org/en/docs/ngx_core_module.html#worker_processes source]).<br />
<br />
The maximum connections nginx will accept is given by {{ic|1=max_clients = worker_processes * worker_connections}}.<br />
<br />
==== Running under different user ====<br />
<br />
By default, {{Pkg|nginx}} runs the master process as {{ic|root}} and worker processes as user {{ic|http}}. To run worker processes as another user, change the {{ic|user}} directive in {{ic|nginx.conf}}:<br />
<br />
{{hc|/etc/nginx/nginx.conf|<br />
user ''user'' [''group''];<br />
}}<br />
<br />
If the group is omitted, a group whose name equals that of ''user'' is used.<br />
<br />
{{Tip|1=It is also possible to run nginx without anything running as {{ic|root}} using [[systemd]]. See [[#Running unprivileged using systemd]].}}<br />
<br />
==== Server blocks ====<br />
<br />
It is possible to serve multiple domains using {{ic|server}} blocks. These are comparable to "VirtualHosts" in [[Apache HTTP Server]]. Also see the [https://www.nginx.com/resources/wiki/start/topics/examples/server_blocks/ upstream examples].<br />
<br />
In the example below the server listens for incoming connections on IPv4 and IPv6 ports 80 for two domains, {{ic|domainname1.dom}} and {{ic|domainname2.dom}}:<br />
<br />
{{hc|/etc/nginx/nginx.conf|<nowiki><br />
...<br />
server {<br />
listen 80;<br />
listen [::]:80;<br />
server_name domainname1.dom;<br />
root /usr/share/nginx/domainname1.dom/html;<br />
location / {<br />
index index.php index.html index.htm;<br />
}<br />
}<br />
<br />
server {<br />
listen 80;<br />
listen [::]:80;<br />
server_name domainname2.dom;<br />
root /usr/share/nginx/domainname2.dom/html;<br />
...<br />
}<br />
</nowiki>}}<br />
<br />
[[Restart]] {{ic|nginx.service}} to apply any changes.<br />
<br />
{{Note|Make sure the hostnames are resolvable by setting up a DNS-server like [[BIND]] or [[dnsmasq]], or have a look at [[Network configuration#Local network hostname resolution]].}}<br />
<br />
===== Managing server entries =====<br />
<br />
It is possible to put different {{ic|server}} blocks in different files. This allows you to easily enable or disable certain sites.<br />
<br />
Create the following directories:<br />
<br />
# mkdir /etc/nginx/sites-available<br />
# mkdir /etc/nginx/sites-enabled<br />
<br />
Create a file inside the {{ic|sites-available}} directory that contains one or more server blocks:<br />
<br />
{{hc|/etc/nginx/sites-available/example.conf|<nowiki><br />
server {<br />
listen 443 ssl http2;<br />
listen [::]:443 ssl http2;<br />
<br />
...<br />
}<br />
</nowiki>}}<br />
<br />
Append include {{ic|sites-enabled/*;}} to the end of the {{ic|http}} block:<br />
<br />
{{hc|/etc/nginx/nginx.conf|<nowiki><br />
http {<br />
...<br />
include sites-enabled/*;<br />
}<br />
</nowiki>}}<br />
<br />
To enable a site, simply create a symlink:<br />
<br />
# ln -s /etc/nginx/sites-available/example.conf /etc/nginx/sites-enabled/example.conf<br />
<br />
To disable a site, unlink the active symlink:<br />
<br />
# unlink /etc/nginx/sites-enabled/example.conf<br />
<br />
[[Reload]]/[[restart]] {{ic|nginx.service}} to enable changes to the sites configuration.<br />
<br />
==== TLS ====<br />
<br />
{{Style|Do not duplicate [[OpenSSL#Certificates]].}}<br />
<br />
[[OpenSSL]] provides TLS support and is installed by default on Arch installations.<br />
<br />
{{Tip|<br />
* You may want to read the [https://nginx.org/en/docs/http/ngx_http_ssl_module.html ngx_http_ssl_module] documentation first before configuring SSL.<br />
* [[Let’s Encrypt]] is a free, automated, and open certificate authority. A plugin is available to request valid SSL certificates straight from the command line and automatic configuration.<br />
* Mozilla has a useful [[MozillaWiki:Security/Server Side TLS|TLS article]] as well as an [https://mozilla.github.io/server-side-tls/ssl-config-generator/ automated tool] to help create a more secure configuration.<br />
* [https://cipherli.st Cipherli.st]{{Dead link|2020|04|01|status=403}} provides strong TLS implementation examples and tutorial for most modern webservers.<br />
}}<br />
<br />
{{Warning|If you plan on implementing TLS, know that some variations and implementations are [[wikipedia:Transport Layer Security#Attacks against TLS/SSL|still vulnerable to attack]][https://weakdh.org/#affected]. For details on these current vulnerabilities within TLS and how to apply appropriate changes to nginx, visit https://weakdh.org/sysadmin.html}}<br />
<br />
Create a private key and self-signed certificate. This is adequate for most installations that do not require a [[OpenSSL#Generate a certificate signing request|CSR]]:<br />
<br />
# mkdir /etc/nginx/ssl<br />
# cd /etc/nginx/ssl<br />
# openssl req -new -x509 -nodes -newkey rsa:4096 -keyout server.key -out server.crt -days 1095<br />
# chmod 400 server.key<br />
# chmod 444 server.crt<br />
<br />
{{Note|The {{ic|-days}} switch is optional and RSA keysize can be as low as 2048 (default).}}<br />
<br />
If you need to create a CSR, follow these instructions instead of the above:<br />
<br />
# mkdir /etc/nginx/ssl<br />
# cd /etc/nginx/ssl<br />
# openssl genpkey -algorithm RSA -pkeyopt rsa_keygen_bits:4096 -out server.key<br />
# chmod 400 server.key<br />
# openssl req -new -sha256 -key server.key -out server.csr<br />
# openssl x509 -req -days 1095 -in server.csr -signkey server.key -out server.crt<br />
<br />
{{Note|For more ''openssl'' options, read its man page {{man|1ssl|openssl}} or peruse its [https://www.openssl.org/docs/ extensive documentation].}}<br />
<br />
Basic example of {{ic|/etc/nginx/nginx.conf}} using TLS:<br />
<br />
{{hc|/etc/nginx/nginx.conf|<nowiki><br />
http {<br />
...<br />
ssl_ciphers "EECDH+AESGCM:EDH+AESGCM:AES256+EECDH:AES256+EDH";<br />
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;<br />
..<br />
<br />
# Redirect to HTTPS<br />
server {<br />
listen 80;<br />
server_name localhost;<br />
return 301 https://$host$request_uri;<br />
}<br />
<br />
server {<br />
#listen 80; # Uncomment to also listen for HTTP requests<br />
listen 443 ssl http2; # HTTP/2 is only possible when using SSL<br />
server_name localhost;<br />
<br />
ssl_certificate ssl/server.crt;<br />
ssl_certificate_key ssl/server.key;<br />
<br />
root /usr/share/nginx/html;<br />
location / {<br />
index index.html index.htm;<br />
}<br />
}<br />
}<br />
</nowiki>}}<br />
<br />
[[Restart]] {{ic|nginx.service}} to apply any changes.<br />
<br />
==== Per-user directories ====<br />
<br />
To replicate Apache-style {{ic|~user}} URLs to users' {{ic|~/public_html}} directories, try the following. (Note: if both rules are used, below, the more-specific PHP rule must come first.)<br />
<br />
{{hc|/etc/nginx/nginx.conf|<nowiki><br />
...<br />
server {<br />
...<br />
# PHP in user directories, e.g. http://example.com/~user/test.php<br />
location ~ ^/~(.+?)(/.+\.php)$ {<br />
alias /home/$1/public_html$2;<br />
fastcgi_pass unix:/run/php-fpm/php-fpm.sock;<br />
fastcgi_index index.php;<br />
include fastcgi.conf;<br />
}<br />
<br />
# User directories, e.g. http://example.com/~user/<br />
location ~ ^/~(.+?)(/.*)?$ {<br />
alias /home/$1/public_html$2;<br />
index index.html index.htm;<br />
autoindex on;<br />
}<br />
...<br />
}<br />
...<br />
</nowiki>}}<br />
<br />
See [[#PHP implementation]] for more information on PHP configuration with {{ic|nginx}}.<br />
<br />
Restart {{ic|nginx.service}} to enable the new configuration.<br />
<br />
=== FastCGI ===<br />
<br />
[[Wikipedia:FastCGI|FastCGI]], also FCGI, is a protocol for interfacing interactive programs with a web server. FastCGI is a variation on the earlier [[Wikipedia:Common Gateway Interface|Common Gateway Interface]] (CGI); FastCGI's main aim is to reduce the overhead associated with interfacing the web server and CGI programs, allowing servers to handle more web page requests at once.<br />
<br />
FastCGI technology is introduced into nginx to work with many external tools, e.g. [[Perl]], [[PHP]] and [[Python]].<br />
<br />
==== PHP implementation ====<br />
<br />
[https://php-fpm.org/ PHP-FPM] is the recommended solution to run as FastCGI server for [[PHP]].<br />
<br />
[[Install]] {{Pkg|php-fpm}} and make sure [[PHP]] has been installed and configured correctly. The main configuration file of PHP-FPM is {{ic|/etc/php/php-fpm.conf}}. For basic usage the default configuration should be sufficient.<br />
<br />
Finally, [[enable]] and [[start]] {{ic|php-fpm.service}}.<br />
<br />
{{Note|<br />
* If you [[#Running under different user|run nginx under a different user]], make sure that the PHP-FPM socket file is accessible by this user, or use a TCP socket.<br />
* If you run nginx in chrooted environment (chroot is {{ic|/srv/nginx-jail}}, web pages are served at {{ic|/srv/nginx-jail/www}}), you must modify the file {{ic|/etc/php/php-fpm.conf}} to include the {{ic|chroot /srv/nginx-jail}} and {{ic|1=listen = /srv/nginx-jail/run/php-fpm/php-fpm.sock}} directives within the pool section (a default one is {{ic|[www]}}). Create the directory for the socket file, if missing. Moreover, for modules that are dynamically linked to dependencies, you will need to copy those dependencies to the chroot (e.g. for php-imagick, you will need to copy the ImageMagick libraries to the chroot, but not imagick.so itself).<br />
* Since {{ic|php-fpm}} version 7.4.0 {{ic|php-fpm.service}} defines {{ic|1=ProtectHome=true}} which restricts access to files located within {{ic|/home}}, {{ic|/root}} and {{ic|/run/user}}, yielding the error message {{ic|No input file specified.}} {{Bug|64683#comment184136}}<br />
}}<br />
<br />
===== nginx configuration =====<br />
<br />
When serving a PHP web-application, a {{ic|location}} for PHP-FPM should to be included in each [[#Server blocks|server block]] [https://www.nginx.com/resources/wiki/start/topics/examples/phpfcgi/], e.g.:<br />
<br />
{{hc|/etc/nginx/sites-available/example.conf|<nowiki><br />
server {<br />
root /usr/share/nginx/html;<br />
<br />
location / {<br />
index index.html index.htm;<br />
}<br />
<br />
location ~ \.php$ {<br />
# 404<br />
try_files $fastcgi_script_name =404;<br />
<br />
# default fastcgi_params<br />
include fastcgi_params;<br />
<br />
# fastcgi settings<br />
fastcgi_pass unix:/run/php-fpm/php-fpm.sock;<br />
fastcgi_index index.php;<br />
fastcgi_buffers 8 16k;<br />
fastcgi_buffer_size 32k;<br />
<br />
# fastcgi params<br />
fastcgi_param DOCUMENT_ROOT $realpath_root;<br />
fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;<br />
#fastcgi_param PHP_ADMIN_VALUE "open_basedir=$base/:/usr/lib/php/:/tmp/";<br />
}<br />
}<br />
</nowiki>}}<br />
<br />
If it is needed to process other extensions with PHP (e.g. ''.html'' and ''.htm''):<br />
<br />
location ~ [^/]\.(php|html|htm)(/|$) {<br />
...<br />
}<br />
<br />
Non ''.php'' extension processing in PHP-FPM should also be explicitly added in {{ic|/etc/php/php-fpm.d/www.conf}}:<br />
<br />
security.limit_extensions = .php .html .htm<br />
<br />
{{Note|Pay attention to the {{ic|fastcgi_pass}} argument, as it must be the TCP or Unix socket defined by the chosen FastCGI server in its config file. The '''default''' (Unix) socket for {{ic|php-fpm}} is:<br />
<br />
fastcgi_pass unix:/run/php-fpm/php-fpm.sock;<br />
<br />
You might use the common TCP socket, '''not default''',<br />
<br />
fastcgi_pass 127.0.0.1:9000;<br />
<br />
Unix domain sockets should however be faster.}}<br />
<br />
{{Tip|To allow multiple {{ic|server}} blocks using the same PHP-FPM configuration, a {{ic|php_fastcgi.conf}} configuration file may be used to ease management:<br />
{{hc|/etc/nginx/php_fastcgi.conf|<nowiki><br />
location ~ \.php$ {<br />
# 404<br />
try_files $fastcgi_script_name =404;<br />
<br />
# default fastcgi_params<br />
include fastcgi_params;<br />
<br />
# fastcgi settings<br />
...<br />
}<br />
</nowiki>}}<br />
<br />
To enable PHP support for a particular server, simply include the {{ic|php_fastcgi.conf}} configuration file:<br />
<br />
{{hc|/etc/nginx/sites-available/example.conf|<nowiki><br />
server {<br />
server_name example.com;<br />
...<br />
<br />
include /etc/nginx/php_fastcgi.conf;<br />
}<br />
</nowiki>}}<br />
}}<br />
<br />
===== Test configuration =====<br />
<br />
You need to [[restart]] the {{ic|php-fpm.service}} and {{ic|nginx.service}} units if the configuration has been changed in order to apply changes.<br />
<br />
To test the FastCGI implementation, create a new PHP file inside the {{ic|root}} folder containing:<br />
<br />
<?php phpinfo(); ?><br />
<br />
Navigate this file inside a browser and you should see the informational page with the current PHP configuration.<br />
<br />
==== CGI implementation ====<br />
<br />
This implementation is needed for CGI applications.<br />
<br />
===== fcgiwrap =====<br />
<br />
[[Install]] {{Pkg|fcgiwrap}}. The configuration file is {{ic|/usr/lib/systemd/system/fcgiwrap.socket}}. [[Enable]] and [[start]] {{ic|fcgiwrap.socket}}.<br />
<br />
====== Multiple worker threads ======<br />
<br />
If you want to spawn multiple worker threads, it is recommended that you use {{AUR|multiwatch}}, which will take care of restarting crashed children. You will need to use {{ic|spawn-fcgi}} to create the unix socket, as multiwatch seems unable to handle the systemd-created socket, even though fcgiwrap itself does not have any trouble if invoked directly in the unit file.<br />
<br />
Copy the unit file from {{ic|/usr/lib/systemd/system/fcgiwrap.service}} to {{ic|/etc/systemd/system/fcgiwrap.service}} (and the {{ic|fcgiwrap.socket}} unit, if present), and modify the {{ic|ExecStart}} line to suit your needs. Here is a unit file that uses {{AUR|multiwatch}}. Make sure {{ic|fcgiwrap.socket}} is not started or enabled, because it will conflict with this unit:<br />
<br />
{{hc|/etc/systemd/system/fcgiwrap.service|2=<br />
[Unit]<br />
Description=Simple CGI Server<br />
After=nss-user-lookup.target<br />
<br />
[Service]<br />
ExecStartPre=/bin/rm -f /run/fcgiwrap.socket<br />
ExecStart=/usr/bin/spawn-fcgi -u http -g http -s /run/fcgiwrap.sock -n -- /usr/bin/multiwatch -f 10 -- /usr/sbin/fcgiwrap<br />
ExecStartPost=/usr/bin/chmod 660 /run/fcgiwrap.sock<br />
PrivateTmp=true<br />
Restart=on-failure<br />
<br />
[Install]<br />
WantedBy=multi-user.target<br />
}}<br />
<br />
Tweak {{ic|-f 10}} to change the number of children that are spawned.<br />
<br />
{{Warning|The {{ic|ExecStartPost}} line is required because of strange behaviour I'm seeing when I use the {{ic|-M 660}} option for {{ic|spawn-fcgi}}. The wrong mode is set. This may be a bug?}}<br />
<br />
===== nginx configuration =====<br />
<br />
In {{ic|/etc/nginx}}, copy the file {{ic|fastcgi_params}} to {{ic|fcgiwrap_params}}. In {{ic|fcgiwrap_params}}, comment or delete the lines which set {{ic|SCRIPT_NAME}} and {{ic|DOCUMENT_ROOT}}.<br />
<br />
Inside each {{ic|server}} block serving a CGI web application should appear a {{ic|location}} block similar to:<br />
<br />
location ~ \.cgi$ {<br />
include fcgiwrap_params;<br />
fastcgi_param DOCUMENT_ROOT /srv/www/cgi-bin/;<br />
fastcgi_param SCRIPT_NAME myscript.cgi;<br />
fastcgi_pass unix:/run/fcgiwrap.sock;<br />
}<br />
<br />
The default socket file for {{ic|fcgiwrap}} is {{ic|/run/fcgiwrap.sock}}.<br />
<br />
Using {{ic|fastcgi_param SCRIPT_FILENAME /srv/www/cgi-bin/myscript.cgi}} is a shortcut alternative to setting {{ic|DOCUMENT_ROOT}} and {{ic|SCRIPT_NAME}}. If you use {{ic|SCRIPT_FILENAME}}, you also will not need to copy {{ic|fastcgi_params}} to {{ic|fcgiwrap_params}} and comment out the {{ic|DOCUMENT_ROOT}} and {{ic|SCRIPT_NAME}} lines.<br />
<br />
{{Warning|If SCRIPT_NAME and DOCUMENT_ROOT are used, fcgiwrap will ''discard'' any other fastcgi_params set in nginx. You must use SCRIPT_FILENAME in order for other params (like PATH_INFO) to be settable through the Nginx configuration. See [https://github.com/gnosek/fcgiwrap/issues/3 this] GitHub issue.}}<br />
<br />
If you keep getting a {{ic|502 - bad Gateway}} error, you should check if your CGI-application first announces the mime-type of the following content. For html this needs to be {{ic|Content-type: text/html}}.<br />
<br />
If you get 403 errors, make sure that the CGI executable is readable and executable by the {{ic|http}} user and that every parent folder is readable by the {{ic|http}} user.<br />
<br />
== Installation in a chroot ==<br />
<br />
Installing nginx in a [[chroot]] adds an additional layer of security. For maximum security the chroot should include only the files needed to run the nginx server and all files should have the most restrictive permissions possible, e.g., as much as possible should be owned by root, directories such as {{ic|/usr/bin}} should be unreadable and unwriteable, etc.<br />
<br />
Arch comes with an {{ic|http}} user and group by default which will run the server. The chroot will be in {{ic|/srv/http}}.<br />
<br />
A perl script to create this jail is available at [https://gist.github.com/4365696 jail.pl gist]. You can either use that or follow the instructions in this article. It expects to be run as root. You will need to uncomment a line before it makes any changes.<br />
<br />
=== Create necessary devices ===<br />
<br />
nginx needs {{ic|/dev/null}}, {{ic|/dev/random}}, and {{ic|/dev/urandom}}. To install these in the chroot create the {{ic|/dev/}} directory and add the devices with ''mknod''. Avoid mounting all of {{ic|/dev/}} to ensure that, even if the chroot is compromised, an attacker must break out of the chroot to access important devices like {{ic|/dev/sda1}}.<br />
<br />
{{Tip|Be sure that {{ic|/srv/http}} is mounted without nodev option}}<br />
{{Tip|See {{man|1|mknod}} and {{ic|<nowiki>ls -l /dev/{null,random,urandom}</nowiki>}} to better understand the ''mknod'' options.}}<br />
<br />
# export JAIL=/srv/http<br />
# mkdir $JAIL/dev<br />
# mknod -m 0666 $JAIL/dev/null c 1 3<br />
# mknod -m 0666 $JAIL/dev/random c 1 8<br />
# mknod -m 0444 $JAIL/dev/urandom c 1 9<br />
<br />
=== Create necessary directories ===<br />
<br />
nginx requires a bunch of files to run properly. Before copying them over, create the folders to store them. This assumes your nginx document root will be {{ic|/srv/http/www}}.<br />
<br />
# mkdir -p $JAIL/etc/nginx/logs<br />
# mkdir -p $JAIL/usr/{lib,bin}<br />
# mkdir -p $JAIL/usr/share/nginx<br />
# mkdir -p $JAIL/var/{log,lib}/nginx<br />
# mkdir -p $JAIL/www/cgi-bin<br />
# mkdir -p $JAIL/{run,tmp}<br />
# cd $JAIL; ln -s usr/lib lib<br />
# cd $JAIL; ln -s usr/lib lib64<br />
# cd $JAIL/usr; ln -s lib lib64<br />
<br />
Then mount {{ic|$JAIL/tmp}} and {{ic|$JAIL/run}} as tmpfs's. The size should be limited to ensure an attacker cannot eat all the RAM.<br />
<br />
# mount -t tmpfs none $JAIL/run -o 'noexec,size=1M'<br />
# mount -t tmpfs none $JAIL/tmp -o 'noexec,size=100M'<br />
<br />
In order to preserve the mounts across reboots, the following entries should be added to {{ic|/etc/fstab}}:<br />
<br />
{{hc|/etc/fstab|<nowiki><br />
tmpfs /srv/http/run tmpfs rw,noexec,relatime,size=1024k 0 0<br />
tmpfs /srv/http/tmp tmpfs rw,noexec,relatime,size=102400k 0 0<br />
</nowiki>}}<br />
<br />
=== Populate the chroot ===<br />
<br />
First copy over the easy files.<br />
<br />
# cp -r /usr/share/nginx/* $JAIL/usr/share/nginx<br />
# cp -r /usr/share/nginx/html/* $JAIL/www<br />
# cp /usr/bin/nginx $JAIL/usr/bin/<br />
# cp -r /var/lib/nginx $JAIL/var/lib/nginx<br />
<br />
Now copy over required libraries. Use ''ldd'' to list them and then copy them all to the correct location. Copying is preferred over hardlinks to ensure that even if an attacker gains write access to the files they cannot destroy or alter the true system files.<br />
<br />
{{hc|$ ldd /usr/bin/nginx|<nowiki><br />
linux-vdso.so.1 (0x00007fffc41fe000)<br />
libpthread.so.0 => /usr/lib/libpthread.so.0 (0x00007f57ec3e8000)<br />
libcrypt.so.1 => /usr/lib/libcrypt.so.1 (0x00007f57ec1b1000)<br />
libstdc++.so.6 => /usr/lib/libstdc++.so.6 (0x00007f57ebead000)<br />
libm.so.6 => /usr/lib/libm.so.6 (0x00007f57ebbaf000)<br />
libpcre.so.1 => /usr/lib/libpcre.so.1 (0x00007f57eb94c000)<br />
libssl.so.1.0.0 => /usr/lib/libssl.so.1.0.0 (0x00007f57eb6e0000)<br />
libcrypto.so.1.0.0 => /usr/lib/libcrypto.so.1.0.0 (0x00007f57eb2d6000)<br />
libdl.so.2 => /usr/lib/libdl.so.2 (0x00007f57eb0d2000)<br />
libz.so.1 => /usr/lib/libz.so.1 (0x00007f57eaebc000)<br />
libGeoIP.so.1 => /usr/lib/libGeoIP.so.1 (0x00007f57eac8d000)<br />
libgcc_s.so.1 => /usr/lib/libgcc_s.so.1 (0x00007f57eaa77000)<br />
libc.so.6 => /usr/lib/libc.so.6 (0x00007f57ea6ca000)<br />
/lib64/ld-linux-x86-64.so.2 (0x00007f57ec604000)</nowiki>}}<br />
<br />
For files residing in {{ic|/usr/lib}} you may try the following one-liner:<br />
<br />
# cp $(ldd /usr/bin/nginx | grep /usr/lib/ | sed -sre 's/(.+)(\/usr\/lib\/\S+).+/\2/g') $JAIL/usr/lib<br />
<br />
And the following for {{ic|ld-linux-x86-64.so}}:<br />
<br />
# cp /lib64/ld-linux-x86-64.so.2 $JAIL/lib<br />
<br />
{{Note|Do not try to copy {{ic|linux-vdso.so}}: it is not a real library and does not exist in {{ic|/usr/lib}}.}}<br />
<br />
Copy over some miscellaneous but necessary libraries and system files.<br />
<br />
# cp /usr/lib/libnss_* $JAIL/usr/lib<br />
# cp -rfvL /etc/{services,localtime,nsswitch.conf,nscd.conf,protocols,hosts,ld.so.cache,ld.so.conf,resolv.conf,host.conf,nginx} $JAIL/etc<br />
<br />
Create restricted user/group files for the chroot. This way only the users needed for the chroot to function exist as far as the chroot knows, and none of the system users/groups are leaked to attackers should they gain access to the chroot.<br />
<br />
{{hc|$JAIL/etc/group|<br />
http:x:33:<br />
nobody:x:99:<br />
}}<br />
<br />
{{hc|$JAIL/etc/passwd|<br />
http:x:33:33:http:/:/bin/false<br />
nobody:x:99:99:nobody:/:/bin/false<br />
}}<br />
<br />
{{hc|$JAIL/etc/shadow|<br />
http:x:14871::::::<br />
nobody:x:14871::::::<br />
}}<br />
<br />
{{hc|$JAIL/etc/gshadow|<br />
http:::<br />
nobody:::<br />
}}<br />
<br />
# touch $JAIL/etc/shells<br />
# touch $JAIL/run/nginx.pid<br />
<br />
Finally make set very restrictive permissions. As much as possible should be owned by root and set unwritable.<br />
<br />
# chown -R root:root $JAIL/<br />
<br />
# chown -R http:http $JAIL/www<br />
# chown -R http:http $JAIL/etc/nginx<br />
# chown -R http:http $JAIL/var/{log,lib}/nginx<br />
# chown http:http $JAIL/run/nginx.pid<br />
<br />
# find $JAIL/ -gid 0 -uid 0 -type d -print | xargs chmod -rw<br />
# find $JAIL/ -gid 0 -uid 0 -type d -print | xargs chmod +x<br />
# find $JAIL/etc -gid 0 -uid 0 -type f -print | xargs chmod -x<br />
# find $JAIL/usr/bin -type f -print | xargs chmod ug+rx<br />
# find $JAIL/ -group http -user http -print | xargs chmod o-rwx<br />
# chmod +rw $JAIL/tmp<br />
# chmod +rw $JAIL/run<br />
<br />
If your server will bind port 80 (or any other port in range [1-1023]), give the chrooted executable permission to bind these ports without root.<br />
<br />
# setcap 'cap_net_bind_service=+ep' $JAIL/usr/bin/nginx<br />
<br />
=== Modify nginx.service to start chroot ===<br />
<br />
Before modifying the {{ic|nginx.service}} unit file, it may be a good idea to copy it to {{ic|/etc/systemd/system/}} since the unit files there take priority over those in {{ic|/usr/lib/systemd/system/}}. This means upgrading nginx would not modify your custom ''.service'' file.<br />
<br />
# cp /usr/lib/systemd/system/nginx.service /etc/systemd/system/nginx.service<br />
<br />
The systemd unit must be changed to start up nginx in the chroot, as the http user, and store the pid file in the chroot.<br />
<br />
{{Note|I'm not sure if the pid file needs to be stored in the chroot jail.}}<br />
<br />
{{hc|/etc/systemd/system/nginx.service|<nowiki><br />
[Unit]<br />
Description=A high performance web server and a reverse proxy server<br />
After=syslog.target network.target<br />
<br />
[Service]<br />
Type=forking<br />
PIDFile=/srv/http/run/nginx.pid<br />
ExecStartPre=/usr/bin/chroot --userspec=http:http /srv/http /usr/bin/nginx -t -q -g 'pid /run/nginx.pid; daemon on; master_process on;'<br />
ExecStart=/usr/bin/chroot --userspec=http:http /srv/http /usr/bin/nginx -g 'pid /run/nginx.pid; daemon on; master_process on;'<br />
ExecReload=/usr/bin/chroot --userspec=http:http /srv/http /usr/bin/nginx -g 'pid /run/nginx.pid; daemon on; master_process on;' -s reload<br />
ExecStop=/usr/bin/chroot --userspec=http:http /srv/http /usr/bin/nginx -g 'pid /run/nginx.pid;' -s quit<br />
<br />
[Install]<br />
WantedBy=multi-user.target</nowiki>}}<br />
<br />
{{Note|Upgrading nginx with pacman will not upgrade the chrooted nginx installation. You have to take care of the updates manually by repeating some of the steps above. Do not forget to also update the libraries it links against.}}<br />
<br />
You can now safely get rid of the non-chrooted nginx installation.<br />
<br />
# pacman -Rsc nginx<br />
<br />
If you do not remove the non-chrooted nginx installation, you may want to make sure that the running nginx process is in fact the chrooted one. You can do so by checking where {{ic|/proc/''PID''/root}} symmlinks to. If should link to {{ic|/srv/http}} instead of {{ic|/}}.<br />
<br />
# ps -C nginx | awk '{print $1}' | sed 1d | while read -r PID; do ls -l /proc/$PID/root; done<br />
<br />
== Tips and tricks ==<br />
<br />
=== Running unprivileged using systemd ===<br />
<br />
[[systemd#Editing_provided_units|Edit nginx.service]] and set the {{ic|User}} and optionally {{ic|Group}} options under {{ic|[Service]}}:<br />
{{hc|/etc/systemd/system/nginx.service.d/user.conf|2=<br />
[Service]<br />
User=''user''<br />
Group=''group''<br />
}}<br />
<br />
We can harden the service against ever elevating privileges:<br />
{{hc|/etc/systemd/system/nginx.service.d/user.conf|2=<br />
[Service]<br />
...<br />
NoNewPrivileges=yes<br />
}}<br />
<br />
{{Tip|See {{man|5|systemd.exec}} for more options of confinement.}}<br />
<br />
Then we need to ensure that {{ic|''user''}} has access to everything it needs. Follow the subsections below and then [[start]] nginx.<br />
<br />
{{Tip|The same setup may be desirable for your [[#FastCGI|FastCGI server]] as well.}}<br />
<br />
<br />
==== Port ====<br />
<br />
Linux does not permit non-{{ic|root}} processes to bind to ports below 1024 by default. A port above 1024 can be used:<br />
<br />
{{hc|/etc/nginx/nginx.conf|<br />
server {<br />
listen 8080;<br />
}<br />
}}<br />
<br />
{{Tip|1=If you want nginx accessible on port 80 or 443, configure your [[firewall]] to redirect requests from 80 or 443 to the ports nginx listens to.}}<br />
<br />
Or you may grant the nginx process the CAP_NET_BIND_SERVICE capability which will allow it to bind to ports below 1024:<br />
<br />
{{hc|/etc/systemd/system/nginx.service.d/user.conf|2=<br />
[Service]<br />
...<br />
CapabilityBoundingSet=<br />
CapabilityBoundingSet=CAP_NET_BIND_SERVICE<br />
AmbientCapabilities=<br />
AmbientCapabilities=CAP_NET_BIND_SERVICE<br />
}}<br />
<br />
Alternatively, you can use systemd socket activation. In this case, systemd will listen on the ports and, when a connection is made, spawn nginx passing the socket as a file descriptor. This means nginx requires no special capabilities as the socket already exists when it is started. This relies on an internal environment variable that nginx uses for passing sockets [https://trac.nginx.org/nginx/ticket/237] and is therefore not officially supported. Instead of setting {{ic|CapabilityBoundingSet}} and {{ic|AmbientCapabilities}}, edit the service override to set the {{ic|NGINX}} environment variable to tell nginx which file descriptors the sockets will be passed as:<br />
<br />
{{hc|/etc/systemd/system/nginx.service.d/user.conf|2=<br />
[Service]<br />
...<br />
Environment=NGINX=3:4;<br />
}}<br />
<br />
There will be one socket per listening port starting at file descriptor 3, so in this example we're telling nginx to expect two sockets. Now create a {{ic|nginx.socket}} unit specifying what ports to listen on:<br />
<br />
{{hc|/etc/systemd/system/nginx.socket|2=<br />
[Socket]<br />
ListenStream=0.0.0.0:80<br />
ListenStream=0.0.0.0:443<br />
After=network.target<br />
Requires=network.target<br />
<br />
[Install]<br />
WantedBy=sockets.target<br />
}}<br />
<br />
The sockets will be passed in the order defined in this unit, so port 80 will be file descriptor 3 and port 443 will be file descriptor 4. If you previously enabled or started the service, you should now stop it, and enable {{ic|nginx.socket}} instead. When your system starts, nginx will not be running, but will be started when you access the website in a browser. With this you can harden the service further; for example, in many cases you can now set {{ic|1=PrivateNetwork=True}} in the service file, blocking nginx from the external network, since the socket created by systemd is sufficient to serve the website over. Note that this will print a warning in the logs of the nginx service: {{ic|2020/08/29 19:33:20 [notice] 254#254: using inherited sockets from "3:4;"}}<br />
<br />
==== PID file ====<br />
<br />
{{Pkg|nginx}} uses {{ic|/run/nginx.pid}} by default. We can create a directory that ''user'' has write access to and place our PID file in there. An example using [[systemd-tmpfiles]]:<br />
<br />
{{hc|/etc/tmpfiles.d/nginx.conf|2=<br />
d /run/nginx 0775 root ''group'' - -<br />
}}<br />
<br />
Run the configuration:<br />
<br />
# systemd-tmpfiles --create<br />
<br />
[[Edit]] the PID values based on the original {{ic|nginx.service}}:<br />
<br />
{{hc|/etc/systemd/system/nginx.service.d/user.conf|2=<br />
[Service]<br />
...<br />
PIDFile=/run/nginx/nginx.pid<br />
ExecStart=<br />
ExecStart=/usr/bin/nginx -g 'pid /run/nginx/nginx.pid; error_log stderr;' <br />
ExecReload=<br />
ExecReload=/usr/bin/nginx -s reload -g 'pid /run/nginx/nginx.pid;'<br />
}}<br />
<br />
==== /var/lib/nginx/* ====<br />
<br />
Some directories under {{ic|/var/lib/nginx}} need to be bootstrapped by nginx running as {{ic|root}}. It is not necessary to start the whole server to do that, nginx will do it on a simple [[#Configuration validation|configuration test]]. So just run one of those and you are good to go.<br />
<br />
==== Log file and directory permissions ====<br />
<br />
The step of running a configuration test will create a dangling {{ic|root}}-owned log. Remove logs in {{ic|/var/log/nginx}} to start fresh. <br />
<br />
The nginx service user needs write permission to {{ic|/var/log/nginx}}. This may require [[File_permissions_and_attributes#Changing_permissions|changing permission]] and/or ownership of this directory on your system.<br />
<br />
=== Alternative script for systemd ===<br />
<br />
On pure systemd you can get advantages of chroot + systemd. [http://0pointer.de/blog/projects/changing-roots.html] Based on set [https://wiki.nginx.org/CoreModule#user user group] and pid with:<br />
<br />
{{hc|/etc/nginx/nginx.conf|2=<br />
user http;<br />
pid /run/nginx.pid;<br />
}}<br />
<br />
the absolute path of the file is {{ic|/srv/http/etc/nginx/nginx.conf}}.<br />
<br />
{{hc|/etc/systemd/system/nginx.service|2=<br />
[Unit]<br />
Description=nginx (Chroot)<br />
After=syslog.target network.target<br />
<br />
[Service]<br />
Type=forking<br />
PIDFile=/srv/http/run/nginx.pid<br />
RootDirectory=/srv/http<br />
ExecStartPre=/usr/sbin/nginx -t -c /etc/nginx/nginx.conf<br />
ExecStart=/usr/sbin/nginx -c /etc/nginx/nginx.conf<br />
ExecReload=/usr/sbin/nginx -c /etc/nginx/nginx.conf -s reload<br />
ExecStop=/usr/sbin/nginx -c /etc/nginx/nginx.conf -s stop<br />
<br />
[Install]<br />
WantedBy=multi-user.target<br />
}}<br />
<br />
It is not necessary to set the default location, nginx loads at default {{ic| -c /etc/nginx/nginx.conf}}, but it is a good idea.<br />
<br />
Alternatively you can run '''only''' {{ic|ExecStart}} as chroot with parameter {{ic|RootDirectoryStartOnly}} set as {{ic|yes}} (see {{man|5|systemd.service}}) or start it before mount point as effective or a systemd path (see {{man|5|systemd.path}}) is available.<br />
<br />
{{hc|/etc/systemd/system/nginx.path|2=<br />
[Unit]<br />
Description=nginx (Chroot) path<br />
[Path]<br />
PathExists=/srv/http/site/Public_html<br />
[Install]<br />
WantedBy=default.target<br />
}}<br />
<br />
[[Enable]] the created {{ic|nginx.path}} and change the {{ic|1=WantedBy=default.target}} to {{ic|1=WantedBy=nginx.path}} in {{ic|/etc/systemd/system/nginx.service}}.<br />
<br />
The {{ic|PIDFile}} in unit file allows systemd to monitor process (absolute path required). If it is undesired, you can change to default one-shot type, and delete the reference from the unit file.<br />
<br />
=== Nginx beautifier ===<br />
<br />
{{AUR|nginxbeautifier}} is a commandline tool used to beautify and format nginx configuration files.<br />
<br />
=== Better headers management ===<br />
<br />
Nginx has a rather unintuitive header management system where headers can only be defined in one context, any other headers are ignored. To remedy this we can install the [https://github.com/openresty/headers-more-nginx-module#more_set_headers headers-more-nginx] module.<br />
<br />
[[Install]] the package {{Pkg|nginx-mod-headers-more}} package. This will install the module to {{ic|/usr/lib/nginx/modules}} directory.<br />
<br />
To load the module add the following to the top of your main nginx configuration file.<br />
<br />
{{hc|/etc/nginx/nginx.conf|2=<br />
load_module "/usr/lib/nginx/modules/ngx_http_headers_more_filter_module.so";<br />
...<br />
}}<br />
<br />
== Troubleshooting ==<br />
<br />
=== Configuration validation ===<br />
<br />
{{hc|# nginx -t|<br />
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok<br />
nginx: configuration file /etc/nginx/nginx.conf test is successful<br />
}}<br />
<br />
=== Accessing local IP redirects to localhost ===<br />
<br />
Solution from the Arch Linux [https://bbs.archlinux.org/viewtopic.php?pid=780561#p780561 forum].<br />
<br />
In {{ic|/etc/nginx/nginx.conf}} locate the {{ic|server_name localhost}} line without a {{ic|#}} in front of it, and add below:<br />
<br />
server_name_in_redirect off;<br />
<br />
Default behavior is that nginx redirects any requests to the value given as {{ic|server_name}} in the config.<br />
<br />
=== Error: The page you are looking for is temporarily unavailable. Please try again later. (502 Bad Gateway) ===<br />
<br />
This is because the FastCGI server has not been started, or the socket used has wrong permissions.<br />
<br />
Try [https://stackoverflow.com/questions/4252368/nginx-502-bad-gateway/16497957#16497957 out this answer] to fix the 502 error.<br />
<br />
In Archlinux, the configuration file mentioned in above link is {{ic|/etc/php/php-fpm.conf}}.<br />
<br />
=== Error: No input file specified ===<br />
<br />
1. Verify that variable {{ic|open_basedir}} in {{ic|/etc/php/php.ini}} contains the correct path specified as {{ic|root}} argument in {{ic|nginx.conf}} (usually {{ic|/usr/share/nginx/}}). When using [http://php-fpm.org/ PHP-FPM] as FastCGI server for PHP, you may add {{ic|<nowiki>fastcgi_param PHP_ADMIN_VALUE "open_basedir=$document_root/:/tmp/:/proc/"</nowiki>;}} in the {{ic|location}} block which aims for processing php file in {{ic|nginx.conf}}.<br />
<br />
2. Another occasion is that, wrong {{ic|root}} argument in the {{ic|location ~ \.php$}} section in {{ic|nginx.conf}}. Make sure the {{ic|root}} points to the same directory as it in {{ic|location /}} in the same server. Or you may just set root as global, do not define it in any location section.<br />
<br />
3. Check permissions: e.g. {{ic|http}} for user/group, {{ic|755}} for directories and {{ic|644}} for files. Remember the entire path to the {{ic|html}} directory should have the correct permissions. See [[File permissions and attributes#Bulk chmod]] to bulk modify a directory tree. <br />
<br />
4. You do not have the {{ic|SCRIPT_FILENAME}} containing the full path to your scripts. If the configuration of nginx ({{ic|fastcgi_param SCRIPT_FILENAME}}) is correct, this kind of error means php failed to load the requested script. Usually it is simply a permissions issue, you can just run php-cgi as root:<br />
<br />
# spawn-fcgi -a 127.0.0.1 -p 9000 -f /usr/bin/php-cgi<br />
<br />
or you should create a group and user to start the php-cgi:<br />
<br />
# groupadd www<br />
# useradd -g www www<br />
# chmod +w /srv/www/nginx/html<br />
# chown -R www:www /srv/www/nginx/html<br />
# spawn-fcgi -a 127.0.0.1 -p 9000 -u www -g www -f /usr/bin/php-cgi<br />
<br />
5. If you are running php-fpm with chrooted nginx ensure {{ic|chroot}} is set correctly within {{ic|/etc/php-fpm/php-fpm.d/www.conf}} (or {{ic|/etc/php-fpm/php-fpm.conf}} if working on older version)<br />
<br />
=== Warning: Could not build optimal types_hash ===<br />
<br />
When starting the {{ic|nginx.service}}, the process might log the message:<br />
<br />
[warn] 18872#18872: could not build optimal types_hash, you should increase either types_hash_max_size: 1024 or types_hash_bucket_size: 64; ignoring types_hash_bucket_size<br />
<br />
To fix this warning, increase the values for these keys inside the {{ic|http}} block [https://nginx.org/en/docs/http/ngx_http_core_module.html#types_hash_max_size] [https://nginx.org/en/docs/http/server_names.html]:<br />
<br />
{{hc|/etc/nginx/nginx.conf|<br />
http {<br />
types_hash_max_size 4096;<br />
server_names_hash_bucket_size 128;<br />
...<br />
}<br />
}}<br />
<br />
=== Cannot assign requested address ===<br />
<br />
The full error from {{ic|systemctl status nginx.service}} is<br />
<br />
[emerg] 460#460: bind() to A.B.C.D:443 failed (99: Cannot assign requested address)<br />
<br />
Even, if your nginx unit-file is configured to run after {{ic|network.target}} with systemd, nginx may attempt to listen at an address that is configured but not added to any interface yet. Verify that this the case by manually running [[start]] for nginx (thereby showing the IP address is configured properly). Configuring nginx to listen to any address will resolve this issue. Now if your use case requires listening to a specific address, one possible solution is to reconfigure systemd.<br />
<br />
To start nginx after all configured network devices are up and assigned an IP address, append {{ic|network-online.target}} to {{ic|After<nowiki>=</nowiki>}} within {{ic|nginx.service}} and [[start/enable]] {{ic|systemd-networkd-wait-online.service}}.<br />
<br />
== See also ==<br />
<br />
* [[WebDAV#Nginx|WebDAV with nginx]]<br />
* [https://www.nginx.com/resources/wiki/start/topics/tutorials/config_pitfalls/ nginx configuration pitfalls]<br />
* [https://calomel.org/nginx.html Very good in-depth 2014 look at nginx security and Reverse Proxying]<br />
* [http://www.tecmint.com/install-nginx-php-mysql-with-mariadb-engine-and-phpmyadmin-in-arch-linux/ Installing LEMP (nginx, PHP, MySQL with MariaDB engine and PhpMyAdmin) in Arch Linux]<br />
* [[Let’s Encrypt|Using SSL certificates generated with Let's Encrypt]]</div>Delapouitehttps://wiki.archlinux.org/index.php?title=D-Bus&diff=595084D-Bus2020-01-15T08:27:30Z<p>Delapouite: fix dead link for busctl</p>
<hr />
<div>[[Category:Daemons]]<br />
[[cs:D-Bus]]<br />
[[es:D-Bus]]<br />
[[ja:D-Bus]]<br />
[[ko:D-Bus]]<br />
[[zh-hans:D-Bus]]<br />
{{Expansion|Mention disabling of dbus services through use of {{ic|systemctl mask}} and overrides in {{ic|/etc/dbus-1/services}}}}<br />
<br />
[[Wikipedia:D-Bus|D-Bus]] is a message bus system that provides an easy way for inter-process communication. It consists of a daemon, which can be run both system-wide and for each user session, and a set of libraries to allow applications to use D-Bus.<br />
<br />
{{Pkg|dbus}} is pulled and installed as a dependency of {{Pkg|systemd}} and user session bus is [https://www.archlinux.org/news/d-bus-now-launches-user-buses/ started automatically] for each user.<br />
<br />
== Alternative Implementations ==<br />
=== dbus-broker ===<br />
{{Pkg|dbus-broker}} is a drop-in replacement for the libdbus reference implementation, which aims "to provide high performance and reliability, while keeping compatibility to the D-Bus reference implementation". [https://github.com/bus1/dbus-broker]<br />
<br />
To enable dbus-broker as the system bus:<br />
<br />
# systemctl enable dbus-broker.service<br />
<br />
To enable as a user bus, run as the desired user:<br />
<br />
$ systemctl --user enable dbus-broker.service<br />
<br />
Or, to enable for all users, run as root:<br />
<br />
# systemctl --global enable dbus-broker.service<br />
<br />
Reboot for these settings to take effect.<br />
<br />
== Debugging ==<br />
<br />
* {{App|D-Feet|Easy to use D-Bus debugger GUI tool. D-Feet can be used to inspect D-Bus interfaces of running programs and invoke methods on those interfaces.|https://wiki.gnome.org/Apps/DFeet|{{Pkg|d-feet}}}}<br />
* {{App|QDbusViewer|GUI D-Bus debugger. Can be used to inspect D-Bus services and invoke methods on them.|https://doc.qt.io/qt-5/qdbusviewer.html|{{Pkg|qt5-tools}}}}<br />
<br />
You can also use {{man|1|busctl}} from [[systemd]].<br />
<br />
== See also ==<br />
<br />
* [https://www.freedesktop.org/wiki/Software/dbus/ D-Bus homepage] – freedesktop.org<br />
* [https://www.freedesktop.org/wiki/IntroductionToDBus/ Introduction to D-Bus] – freedesktop.org</div>Delapouitehttps://wiki.archlinux.org/index.php?title=Ratpoison&diff=591267Ratpoison2019-12-08T19:21:57Z<p>Delapouite: add link to X11</p>
<hr />
<div>[[Category:Tiling WMs]]<br />
[[ja:Ratpoison]]<br />
[[zh-hans:Ratpoison]]<br />
{{Style|Poor style, duplicate content}}<br />
[http://www.nongnu.org/ratpoison/ Ratpoison] is a tiling [[window manager]] written in C that allows the user to manage applications without a mouse. The user interface is inspired by [[GNU Screen]].<br />
<br />
By default, Ratpoison controls in much the same way as Emacs. Commands begin by pressing {{ic|Ctrl t}}, and are then followed by another combination such as {{ic|Ctrl Space}} to move to the next window. <br />
<br />
== Installation ==<br />
<br />
[[Install]] the {{Pkg|ratpoison}} package.<br />
<br />
== Configuration ==<br />
<br />
To use ratpoison as your window manager, you have to create/edit the file {{Ic|~/.xinitrc}}.<br />
<br />
Example .xinitrc:<br />
<br />
{{bc|<nowiki><br />
# The black/white grid as background doesn't suit my taste.<br />
xsetroot -solid black &<br />
# Ratpoison is compatible with xcompmgr! now you can have real transparency<br />
xcompmgr -c -f -D 5 &<br />
#fire up ratpoison!<br />
exec /usr/bin/ratpoison<br />
</nowiki>}}<br />
<br />
== Using ratpoison ==<br />
<br />
After [[X11]] starts up you will see a black screen and a little textbox on the upper right of it that says "Welcome to Ratpoison".<br />
Now type {{ic|Ctrl+t}} and then {{ic|?}} to get a list of keybindings. If you are used to GNU screen, you will feel at home very soon.<br />
<br />
You are able to define custom keystrokes and even override existing ones in {{Ic|~/.ratpoisonrc}}<br />
<br />
Example:<br />
<br />
{{bc|<nowiki><br />
# Overriding CTRL+t 'c' to start aterm instead of xterm<br />
bind c exec aterm<br />
<br />
bind f exec firefox<br />
</nowiki>}}<br />
So, if you type {{ic|Ctrl+t}} and then {{ic|f}}, ratpoison will fire up Firefox.<br />
<br />
{{ic|Ctrl+t}} is the default escape key, the key used to trigger ratpoison commands. To change the mapping of the escape key to the Windows key, use the following line in your {{Ic|~/.ratpoisonrc}}:<br />
<br />
{{bc|<nowiki><br />
# Setting the escape key to the Windows key<br />
escape Super_L<br />
</nowiki>}}<br />
<br />
Here is another .ratpoisonrc i'm using on my computers:<br />
<br />
{{bc|<nowiki><br />
exec xsetroot -cursor_name left_ptr<br />
startup_message off<br />
<br />
escape C-z<br />
<br />
# Make a screenshot<br />
alias sshot exec import -window root ~/screenshot-$(date +%F).jpg<br />
definekey top M-C-Print sshot<br />
<br />
#virtual desks<br />
gnewbg one<br />
gnewbg two<br />
<br />
definekey top M-l exec ratpoison -c "select -" -c "gprev" -c "next"<br />
definekey top M-h exec ratpoison -c "select -" -c "gnext" -c "next"<br />
<br />
#switch between windows<br />
definekey top M-j next<br />
definekey top M-k prev<br />
<br />
#apps<br />
unbind c<br />
bind c exec urxvt -tr<br />
#bind c exec aterm<br />
<br />
bind g exec gftp<br />
bind f exec firefox<br />
</nowiki>}}<br />
<br />
== Tips and tricks ==<br />
<br />
=== Java Swing Applications ===<br />
<br />
Java Swing GUI applications assume tiling window managers, and don't go to fullscreen properly with the default ratpoison configuration. However, there is a way to "trick" the Java swing window into thinking it's in a tiling window manager and getting it to go to fullscreen correctly.<br />
<br />
First, install the <tt>wmname</tt> package. Then add this line to your <tt>.ratpoisonrc</tt>:<br />
<br />
{{hc|~/.ratpoisonrc|<br />
exec wmname LG3D<br />
}}<br />
<br />
Voila! Java Swing applications should properly fullscreen now.<br />
<br />
=== Multiple workspaces ===<br />
<br />
By default, ratpoison only has one workspace, but using a script called rpws (installed by default) you can have more.<br />
<br />
Just edit your .ratpoisonrc, and add:<br />
<br />
{{hc|~/.ratpoisonrc|<br />
exec /usr/bin/rpws init 6 -k<br />
}}<br />
<br />
That creates 6 workspaces. By default, you can access to them by using {{ic|Alt+F1}} to access the first, {{ic|Alt+F2}} to access the second, etc.<br />
<br />
You can also add binds to them, like this:<br />
<br />
bind C-1 exec rpws 1<br />
bind C-2 exec rpws 2<br />
...<br />
<br />
That allows to access them with {{ic|Ctrl+t}} {{ic|Ctrl+1}} (assuming {{ic|Ctrl+t}} as your escape key)<br />
<br />
=== Urxvt and xterm ===<br />
<br />
Urxvt and xterm, as they are installed by default, send resize hints to the window manager. This works in most tiling window managers, but not in ratpoison. The end result is that URxvt/xterm resizes itself in multiples of the font size, rather than resizing to the whole screen, and chances that there are unfilled gaps are high. There are two solutions to this problem, documented below.<br />
<br />
==== Install a Patched URxvt ====<br />
<br />
If you use URxvt, the {{AUR|rxvt-unicode-fontspacing-noinc-vteclear-secondarywheel}} package, among other improvements, sends no resize hints to the window manager. If you install this version of URxvt rather than the default, URxvt will resize properly within ratpoison.<br />
<br />
==== Adjust the Border ====<br />
<br />
We can use the xterm/urxvt option internalBorder and set the border of ratpoison to 0.<br />
<br />
A trial and error process must be done to find the exact number of internalBorder for each combination of resolution and font size. (the border of ratpoison must be set to 0 before doing the tests)<br />
The term command line option -b can be used to test for the correct number and then can be saved on the following files.<br />
<br />
{{hc|~/.Xresources|<br />
urxvt*internalBorder: 8 #change urxvt to xterm if necessary. Using the font terminus in urxvt at 14px size, 8 is the correct number here.<br />
}}<br />
{{hc|~/.ratpoisonrc|<br />
set border 0<br />
}}<br />
<br />
If a combination cannot be found, you could try changing the font size and the font family also. (that changes the required border number)<br />
<br />
=== Launch on startup ===<br />
<br />
Examples for launching programs when ratpoison starts. File {{ic|~/.ratpoisonrc}} is executed by ratpoison on startup.<br />
<br />
{{hc|Launch urxvt with a tmux session|<nowiki><br />
exec urxvt -e bash -c "tmux -q has-session && exec tmux attach-session -d || exec tmux new-session -n$USER -s$USER@$HOSTNAME"<br />
</nowiki>}}<br />
<br />
{{hc|Launch optimized chromium|<nowiki><br />
exec bash -c 'pidof chromium &>/dev/null || exec /usr/bin/chromium --disk-cache-dir=~/tmp/cache'<br />
</nowiki>}}<br />
<br />
=== Wallpaper and transparency ===<br />
<br />
Example for setting transparency using [[xcompmgr]] and nitrogen.<br />
First start nitrogen and set the desired wallpaper. Then use this in your {{ic|~/.ratpoisonrc}}<br />
<br />
{{hc|Wallpaper and transparency|<nowiki><br />
exec xcompmgr -c -f -D 5 &<br />
exec nitrogen --restore</nowiki><br />
}}<br />
<br />
== Useful keybindings ==<br />
<br />
<br />
{| class="wikitable"<br />
| {{ic|Ctrl+t}} {{ic|!}} <''Program Name''> Start any program<br />
|-<br />
| {{ic|Ctrl+t}} {{ic|?}} Show key bindings<br />
|-<br />
| {{ic|Ctrl+t}} {{ic|c}} Start an X terminal<br />
|-<br />
| {{ic|Ctrl+t}} {{ic|n}} Switch to next window<br />
|-<br />
| {{ic|Ctrl+t}} {{ic|p}} Switch to previous window<br />
|-<br />
| {{ic|Ctrl+t}} {{ic|1}}-{{ic|9}} Switch to windows 1-9<br />
|-<br />
| {{ic|Ctrl+t}} {{ic|k}} Close the current window<br />
|-<br />
| {{ic|Ctrl+t}} {{ic|Shift+k}} XKill the current application<br />
|-<br />
| {{ic|Ctrl+t}} {{ic|s}},{{ic|Shift+s}} Split the current frame into two vertical,horizontal ones<br />
|-<br />
| {{ic|Ctrl+t}} {{ic|Tab}}, {{ic|←}}, {{ic|↑}}, {{ic|→}}, {{ic|↓}} Switch to the next, left. top, right, bottom frame.<br />
|-<br />
| {{ic|Ctrl+t}} {{ic|Shift+q}} Make the current frame the only one<br />
|-<br />
| {{ic|Ctrl+t}} {{ic|:}} Execute a ratpoison command<br />
|}<br />
<br />
==Focus follows mouse==<br />
<br />
{{ic|sloppy.c}} is a build script for {{pkg|ratpoison}} and can be found in {{ic|/usr/share/ratpoison/}}. To enable focus follows mouse for {{ic|ratpoison}}, run the following:<br />
<br />
# cd /usr/share/ratpoison/<br />
# gcc -o sloppy sloppy.c -lX11<br />
# ./sloppy<br />
<br />
To autostart focus follows mouse, add the following to {{ic|~/.ratpoisonrc}}:<br />
<br />
exec /usr/share/ratpoison/sloppy<br />
<br />
== Ratpoison and display managers ==<br />
<br />
Many [[display manager|display managers]] (e.g., [[LightDM]]) source the available sessions from {{ic|/usr/share/xsessions/}} and most window managers and desktop environments create .desktop files there. However ratpoison instead creates a {{ic|ratpoison.desktop}} file in {{ic|/etc/X11/sessions/}}. To allow display managers to find ratpoison one may need to copy the ratpoison.desktop file from {{ic|/etc/X11/sessions/ratpoison.desktop}} to {{ic|/usr/share/xsessions/ratpoison.desktop}}. If the {{ic|/usr/share/xsessions}} directory does not exist, create it as root.<br />
<br />
== See also ==<br />
<br />
* [http://ratpoison.wxcvbn.org/ The Ratpoison wiki]<br />
* [http://stumpwm.svkt.org/cgi-bin/ratpoison.pl?action=browse;id=keys X11 Keys in Ratpoison]<br />
* [http://www.ormiret.com/?q=node/11 Ratpoison config sample]<br />
* [https://bbs.archlinux.org/viewtopic.php?id=68622 Share your Ratpoison (experience) forum thread]<br />
* [https://github.com/jbaber/ratpoison_scripts Collection of scripts for the Ratpoison window manager]<br />
* [http://www.nongnu.org/stumpwm/ Stumpwm - a successor to Ratpoison written in Common lisp]</div>Delapouitehttps://wiki.archlinux.org/index.php?title=Nftables&diff=591266Nftables2019-12-08T19:14:26Z<p>Delapouite: add link to netlink</p>
<hr />
<div>{{DISPLAYTITLE:nftables}}<br />
[[Category:Firewalls]]<br />
[[es:Nftables]]<br />
[[ja:Nftables]]<br />
[[ru:Nftables]]<br />
[[zh-hans:Nftables]]<br />
{{Related articles start}}<br />
{{Related|iptables}}<br />
{{Related articles end}}<br />
{{Style|Pseudo-variables should not be words that are part of the nft syntax, like "table", "chain" and "handle" (e.g {{ic|nft add '''table''' ''family'' '''table'''}}, {{ic|nft add rule ''family'' ''table'' ''chain'' '''handle ''handle''''' ''statement''}}). They make the examples very confusing.}}<br />
[https://netfilter.org/projects/nftables/ nftables] is a netfilter project that aims to replace the existing {ip,ip6,arp,eb}tables framework. It provides a new packet filtering framework, a new user-space utility (nft), and a compatibility layer for {ip,ip6}tables. It uses the existing hooks, connection tracking system, user-space queueing component, and logging subsystem of netfilter.<br />
<br />
It consists of three main components: a kernel implementation, the libnl [[Wikipedia:Netlink|netlink]] communication and the nftables user-space front-end.<br />
The kernel provides a netlink configuration interface, as well as run-time rule-set evaluation, libnl contains the low-level functions for communicating with the kernel, and the nftables front-end is what the user interacts with via nft.<br />
<br />
You can also visit the [https://wiki.nftables.org/wiki-nftables/index.php/Main_Page official nftables wiki page] for more information.<br />
<br />
== Installation ==<br />
<br />
{{Expansion|Mention {{Pkg|iptables-nft}}.[https://www.redhat.com/en/blog/using-iptables-nft-hybrid-linux-firewall]}}<br />
<br />
[[Install]] the userspace utilities package {{Pkg|nftables}} or the git version {{AUR|nftables-git}}.<br />
<br />
{{Tip|Most [[iptables#Front-ends|iptables front-ends]] feature no direct or indirect support of nftables, but may introduce it.[https://www.spinics.net/lists/netfilter/msg58215.html] One graphical front-end that supports both, nftables and iptables, is [[firewalld]].[https://firewalld.org/2018/07/nftables-backend]}}<br />
<br />
== Usage ==<br />
<br />
''nftables'' makes a distinction between temporary rules made in the command line and permanent ones loaded from or saved to a file.<br />
The default file is {{ic|/etc/nftables.conf}} which already contains a simple IPv4/IPv6 firewall table named "inet filter".<br />
<br />
To use it [[start/enable]] the {{ic|nftables.service}}.<br />
<br />
You can check the ruleset with<br />
<br />
# nft list ruleset<br />
<br />
{{Note|You may have to create {{ic|/etc/modules-load.d/nftables.conf}} with all of the nftables related modules you require as entries for the systemd service to work correctly. You can get a list of modules using this command: {{bc|$ grep -Eo '^nf\w+' /proc/modules}}<br />
<br />
Otherwise, you could end up with the dreaded {{ic|Error: Could not process rule: No such file or directory}} error.}}<br />
<br />
== Configuration ==<br />
<br />
nftables' user-space utility ''nft'' performs most of the rule-set evaluation before handing rule-sets to the kernel. Rules are stored in chains, which in turn are stored in tables. The following sections indicate how to create and modify these constructs.<br />
<br />
All changes below are temporary. To make changes permanent, save your ruleset to {{ic|/etc/nftables.conf}} which is loaded by {{ic|nftables.service}}:<br />
# nft -s list ruleset > /etc/nftables.conf<br />
<br />
{{Note|{{ic|nft list}} does not output variable definitions, if you have any in {{ic|/etc/nftables.conf}} they will be lost. Any variables used in rules will be replaced by their value.}}<br />
<br />
To read input from a file use the {{ic|-f}}/{{ic|--file}} option:<br />
<br />
# nft -f ''filename''<br />
<br />
Note that any rules already loaded are not automatically flushed.<br />
<br />
See {{man|8|nft}} for a complete list of all commands.<br />
<br />
=== Tables ===<br />
<br />
Tables hold [[#Chains]]. Unlike tables in iptables, there are no built-in tables in nftables. The number of tables and their names is up to the user. However, each table only has one address family and only applies to packets of this family. Tables can have one of five families specified:<br />
<br />
{| class="wikitable"<br />
! nftables family || iptables utility<br />
|-<br />
| ip || iptables<br />
|-<br />
| ip6 || ip6tables<br />
|- <br />
| inet || iptables and ip6tables<br />
|-<br />
| arp || arptables<br />
|-<br />
| bridge || ebtables<br />
|-<br />
|}<br />
<br />
{{ic|ip}} (i.e. IPv4) is the default family and will be used if family is not specified.<br />
<br />
To create one rule that applies to both IPv4 and IPv6, use {{ic|inet}}. {{ic|inet}} allows for the unification of the {{ic|ip}} and {{ic|ip6}} families to make defining rules for both easier.<br />
<br />
See {{man|8|nft|ADDRESS FAMILIES}} for a complete description of address families.<br />
<br />
In all of the following, {{ic|''family''}} is optional, and if not specified is set to {{ic|ip}}.<br />
<br />
==== Create table ====<br />
<br />
The following adds a new table:<br />
<br />
# nft add table ''family'' ''table''<br />
<br />
==== List tables ====<br />
<br />
To list all tables:<br />
<br />
# nft list tables<br />
<br />
==== List chains and rules in a table ====<br />
<br />
To list all chains and rules of a specified table do:<br />
<br />
# nft list table ''family'' ''table''<br />
<br />
For example, to list all the rules of the {{ic|filter}} table of the {{ic|inet}} family:<br />
<br />
# nft list table inet filter<br />
<br />
==== Delete table ====<br />
<br />
To delete a table do:<br />
<br />
# nft delete table ''family'' ''table''<br />
<br />
Tables can only be deleted if there are no chains in them.<br />
<br />
==== Flush table ====<br />
<br />
To flush all rules from a table do:<br />
<br />
# nft flush table ''family'' ''table''<br />
<br />
=== Chains ===<br />
<br />
The purpose of chains is to hold [[#Rules]]. Unlike chains in iptables, there are no built-in chains in nftables. This means that if no chain uses any types or hooks in the netfilter framework, packets that would flow through those chains will not be touched by nftables, unlike iptables.<br />
<br />
Chains have two types. A ''base'' chain is an entry point for packets from the networking stack, where a hook value is specified. A ''regular'' chain may be used as a jump target for better organization.<br />
<br />
In all of the following {{ic|''family''}} is optional, and if not specified is set to {{ic|ip}}.<br />
<br />
==== Create chain ====<br />
<br />
===== Regular chain =====<br />
<br />
The following adds a regular chain named {{ic|''chain''}} to the table named {{ic|''table''}}:<br />
<br />
# nft add chain ''family'' ''table'' ''chain''<br />
<br />
For example, to add a regular chain named {{ic|tcpchain}} to the {{ic|filter}} table of the {{ic|inet}} address family do:<br />
<br />
# nft add chain inet filter tcpchain<br />
<br />
===== Base chain =====<br />
<br />
To add a base chain specify hook and priority values:<br />
<br />
# nft add chain ''family'' ''table'' ''chain'' '{ type ''type'' hook ''hook'' priority ''priority'' ; }'<br />
<br />
{{ic|''type''}} can be {{ic|filter}}, {{ic|route}}, or {{ic|nat}}.<br />
<br />
For IPv4/IPv6/Inet address families {{ic|''hook''}} can be {{ic|prerouting}}, {{ic|input}}, {{ic|forward}}, {{ic|output}}, or {{ic|postrouting}}. See {{man|8|nft|ADDRESS FAMILIES}} for a list of hooks for other families.<br />
<br />
{{ic|''priority''}} takes either a priority name or an its integer value. See {{man|8|CHAINS}} for a list of standard priority names and values. Chains with lower numbers are processed first and can be negative. [https://wiki.nftables.org/wiki-nftables/index.php/Configuring_chains#Base_chain_types]<br />
<br />
For example, to add a base chain that filters input packets:<br />
<br />
# nft add chain inet filter input '{ type filter hook input priority 0; }'<br />
<br />
Replace {{ic|add}} with {{ic|create}} in any of the above to add a new chain but return an error if the chain already exists.<br />
<br />
==== List rules ====<br />
<br />
The following lists all rules of a chain:<br />
<br />
# nft list chain ''family'' ''table'' ''chain''<br />
<br />
For example, the following lists the rules of the chain named {{ic|output}} in the {{ic|inet}} table named {{ic|filter}}:<br />
<br />
# nft list chain inet filter output<br />
<br />
==== Edit a chain ====<br />
<br />
To edit a chain, simply call it by its name and define the rules you want to change.<br />
<br />
# nft chain ''family table chain'' '{ [ type ''type'' hook ''hook'' device ''device'' priority ''priority'' ; policy ''policy'' ; ] }'<br />
<br />
For example, to change the input chain policy of the default table from {{ic|accept}} to {{ic|drop}}<br />
<br />
# nft chain inet filter input '{ policy drop ; }'<br />
<br />
==== Delete a chain ====<br />
<br />
To delete a chain do:<br />
<br />
# nft delete chain ''family'' ''table'' ''chain''<br />
<br />
The chain must not contain any rules or be a jump target.<br />
<br />
==== Flush rules from a chain ====<br />
<br />
To flush rules from a chain do:<br />
<br />
# nft flush chain ''family'' ''table'' ''chain''<br />
<br />
=== Rules ===<br />
<br />
Rules are either constructed from expressions or statements and are contained within chains.<br />
<br />
==== Add rule ====<br />
<br />
{{Tip|The ''iptables-translate'' utility translates [[iptables]] rules to nftables format.}}<br />
<br />
To add a rule to a chain do:<br />
<br />
# nft add rule ''family'' ''table'' ''chain'' handle ''handle'' ''statement''<br />
<br />
The rule is appended at {{ic|''handle''}}, which is optional. If not specified, the rule is appended to the end of the chain.<br />
<br />
To prepend the rule to the position do:<br />
<br />
# nft insert rule ''family'' ''table'' ''chain'' handle ''handle'' ''statement''<br />
<br />
If {{ic|''handle''}} is not specified, the rule is prepended to the chain.<br />
<br />
===== Expressions =====<br />
<br />
Typically a {{ic|''statement''}} includes some expression to be matched and then a verdict statement. Verdict statements include {{ic|accept}}, {{ic|drop}}, {{ic|queue}}, {{ic|continue}}, {{ic|return}}, {{ic|jump ''chain''}}, and {{ic|goto ''chain''}}. Other statements than verdict statements are possible. See {{man|8|nft}} for more information.<br />
<br />
There are various expressions available in nftables and, for the most part, coincide with their iptables counterparts. The most noticeable difference is that there are no generic or implicit matches. A generic match was one that was always available, such as {{ic|--protocol}} or {{ic|--source}}. Implicit matches were protocol-specific, such as {{ic|--sport}} when a packet was determined to be TCP.<br />
<br />
The following is an incomplete list of the matches available:<br />
<br />
* meta (meta properties, e.g. interfaces)<br />
* icmp (ICMP protocol)<br />
* icmpv6 (ICMPv6 protocol)<br />
* ip (IP protocol)<br />
* ip6 (IPv6 protocol)<br />
* tcp (TCP protocol)<br />
* udp (UDP protocol)<br />
* sctp (SCTP protocol)<br />
* ct (connection tracking)<br />
<br />
The following is an incomplete list of match arguments (for a more complete list, see {{man|8|nft}}):<br />
<br />
{{bc|<nowiki><br />
meta:<br />
oif <output interface INDEX><br />
iif <input interface INDEX><br />
oifname <output interface NAME><br />
iifname <input interface NAME><br />
<br />
(oif and iif accept string arguments and are converted to interface indexes)<br />
(oifname and iifname are more dynamic, but slower because of string matching)<br />
<br />
icmp:<br />
type <icmp type><br />
<br />
icmpv6:<br />
type <icmpv6 type><br />
<br />
ip:<br />
protocol <protocol><br />
daddr <destination address><br />
saddr <source address><br />
<br />
ip6:<br />
daddr <destination address><br />
saddr <source address><br />
<br />
tcp:<br />
dport <destination port><br />
sport <source port><br />
<br />
udp:<br />
dport <destination port><br />
sport <source port><br />
<br />
sctp:<br />
dport <destination port><br />
sport <source port><br />
<br />
ct:<br />
state <new | established | related | invalid><br />
</nowiki>}}<br />
<br />
==== Deletion ====<br />
<br />
Individual rules can only be deleted by their handles. The {{ic|nft --handle list}} command must be used to determine rule handles. Note the {{ic|--handle}} switch, which tells {{ic|nft}} to list handles in its output.<br />
<br />
The following determines the handle for a rule and then deletes it. The {{ic|--number}} argument is useful for viewing some numeric output, like unresolved IP addresses.<br />
<br />
{{hc|# nft --handle --numeric list chain inet filter input|2=<nowiki><br />
table inet fltrTable {<br />
chain input {<br />
type filter hook input priority 0;<br />
ip saddr 127.0.0.1 accept # handle 10<br />
}<br />
}<br />
</nowiki>}}<br />
<br />
# nft delete rule inet fltrTable input handle 10<br />
<br />
All the chains in a table can be flushed with the {{ic|nft flush table}} command. Individual chains can be flushed using either the {{ic|nft flush chain}} or {{ic|nft delete rule}} commands.<br />
<br />
# nft flush table foo<br />
# nft flush chain foo bar<br />
# nft delete rule ip6 foo bar<br />
<br />
The first command flushes all of the chains in the ip {{ic|foo}} table. The second flushes the {{ic|bar}} chain in the ip {{ic|foo}} table. The third deletes all of the rules in {{ic|bar}} chain in the ip6 {{ic|foo}} table.<br />
<br />
=== Atomic reloading ===<br />
<br />
Flush the current ruleset:<br />
<br />
# echo "flush ruleset" > /tmp/nftables <br />
<br />
Dump the current ruleset:<br />
<br />
# nft -s list ruleset >> /tmp/nftables<br />
<br />
Now you can edit /tmp/nftables and apply your changes with:<br />
<br />
# nft -f /tmp/nftables<br />
<br />
== Examples ==<br />
<br />
=== Workstation ===<br />
<br />
{{hc|/etc/nftables.conf|2=<nowiki><br />
flush ruleset<br />
<br />
table inet filter {<br />
chain input {<br />
type filter hook input priority 0; policy drop;<br />
<br />
iif lo accept comment "Accept any localhost traffic"<br />
ct state invalid drop comment "Drop invalid connections"<br />
ct state established,related accept comment "Accept traffic originated from us"<br />
<br />
ip6 nexthdr icmpv6 icmpv6 type { destination-unreachable, packet-too-big, time-exceeded, parameter-problem, mld-listener-query, mld-listener-report, mld-listener-reduction, nd-router-solicit, nd-router-advert, nd-neighbor-solicit, nd-neighbor-advert, ind-neighbor-solicit, ind-neighbor-advert, mld2-listener-report } accept comment "Accept ICMPv6"<br />
ip protocol icmp icmp type { destination-unreachable, router-solicitation, router-advertisement, time-exceeded, parameter-problem } accept comment "Accept ICMP"<br />
ip protocol igmp accept comment "Accept IGMP"<br />
<br />
udp dport mdns ip6 daddr ff02::fb accept comment "Accept mDNS"<br />
udp dport mdns ip daddr 224.0.0.251 accept comment "Accept mDNS"<br />
<br />
udp sport 1900 udp dport >= 1024 ip6 saddr { fd00::/8, fe80::/10 } meta pkttype unicast limit rate 4/second burst 20 packets accept comment "Accept UPnP IGD port mapping reply"<br />
udp sport 1900 udp dport >= 1024 ip saddr { 10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16, 169.254.0.0/16 } meta pkttype unicast limit rate 4/second burst 20 packets accept comment "Accept UPnP IGD port mapping reply"<br />
<br />
udp sport netbios-ns udp dport >= 1024 meta pkttype unicast ip6 saddr { fd00::/8, fe80::/10 } accept comment "Accept Samba Workgroup browsing replies"<br />
udp sport netbios-ns udp dport >= 1024 meta pkttype unicast ip saddr { 10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16, 169.254.0.0/16 } accept comment "Accept Samba Workgroup browsing replies"<br />
<br />
counter comment "Count any other traffic"<br />
}<br />
<br />
chain forward {<br />
type filter hook forward priority 0; policy drop;<br />
}<br />
<br />
chain output {<br />
type filter hook output priority 0; policy accept;<br />
}<br />
<br />
}<br />
</nowiki>}}<br />
<br />
=== Server ===<br />
<br />
{{hc|/etc/nftables.conf|2=<nowiki><br />
flush ruleset<br />
<br />
table inet filter {<br />
chain input {<br />
type filter hook input priority 0; policy drop;<br />
<br />
iif lo accept comment "Accept any localhost traffic"<br />
ct state invalid drop comment "Drop invalid connections"<br />
ct state established,related accept comment "Accept traffic originated from us"<br />
<br />
ip6 nexthdr icmpv6 icmpv6 type { destination-unreachable, packet-too-big, time-exceeded, parameter-problem, mld-listener-query, mld-listener-report, mld-listener-reduction, nd-router-solicit, nd-router-advert, nd-neighbor-solicit, nd-neighbor-advert, ind-neighbor-solicit, ind-neighbor-advert, mld2-listener-report } accept comment "Accept ICMPv6"<br />
ip protocol icmp icmp type { destination-unreachable, router-solicitation, router-advertisement, time-exceeded, parameter-problem } accept comment "Accept ICMP"<br />
ip protocol igmp accept comment "Accept IGMP"<br />
<br />
udp dport mdns ip6 daddr ff02::fb accept comment "Accept mDNS"<br />
udp dport mdns ip daddr 224.0.0.251 accept comment "Accept mDNS"<br />
<br />
tcp dport ssh accept comment "Accept SSH on port 22"<br />
<br />
tcp dport { http, https, 8008, 8080 } accept comment "Accept HTTP (ports 80, 443, 8008, 8080)"<br />
<br />
meta l4proto { tcp, udp } th dport 2049 ip6 saddr { fd00::/8, fe80::/10 } accept comment "Accept NFS"<br />
meta l4proto { tcp, udp } th dport 2049 ip saddr { 10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16, 169.254.0.0/16 } accept comment "Accept NFS"<br />
<br />
udp dport netbios-ns ip6 saddr { fd00::/8, fe80::/10 } accept comment "Accept NetBIOS Name Service (nmbd)"<br />
udp dport netbios-ns ip saddr { 10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16, 169.254.0.0/16 } accept comment "Accept NetBIOS Name Service (nmbd)"<br />
udp dport netbios-dgm ip6 saddr { fd00::/8, fe80::/10 } accept comment "Accept NetBIOS Datagram Service (nmbd)"<br />
udp dport netbios-dgm ip saddr { 10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16, 169.254.0.0/16 } accept comment "Accept NetBIOS Datagram Service (nmbd)"<br />
tcp dport netbios-ssn ip6 saddr { fd00::/8, fe80::/10 } accept comment "Accept NetBIOS Session Service (smbd)"<br />
tcp dport netbios-ssn ip saddr { 10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16, 169.254.0.0/16 } accept comment "Accept NetBIOS Session Service (smbd)"<br />
tcp dport microsoft-ds ip6 saddr { fd00::/8, fe80::/10 } accept comment "Accept Microsoft Directory Service (smbd)"<br />
tcp dport microsoft-ds ip saddr { 10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16, 169.254.0.0/16 } accept comment "Accept Microsoft Directory Service (smbd)"<br />
<br />
udp sport bootpc udp dport bootps ip saddr 0.0.0.0 ip daddr 255.255.255.255 accept comment "Accept DHCPDISCOVER (for DHCP-Proxy)"<br />
udp sport { bootpc, 4011 } udp dport { bootps, 4011 } ip saddr { 10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16, 169.254.0.0/16 } accept comment "Accept PXE"<br />
udp dport tftp ip6 saddr { fd00::/8, fe80::/10 } accept comment "Accept TFTP"<br />
udp dport tftp ip saddr { 10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16, 169.254.0.0/16 } accept comment "Accept TFTP"<br />
<br />
}<br />
<br />
chain forward {<br />
type filter hook forward priority 0; policy drop;<br />
}<br />
<br />
chain output {<br />
type filter hook output priority 0; policy accept;<br />
}<br />
<br />
}<br />
</nowiki>}}<br />
<br />
=== Limit rate ===<br />
<br />
{{bc|1=<nowiki><br />
table inet filter {<br />
chain input {<br />
type filter hook input priority 0; policy drop;<br />
<br />
iif lo accept comment "Accept any localhost traffic"<br />
ct state invalid drop comment "Drop invalid connections"<br />
<br />
ip protocol icmp icmp type echo-request limit rate over 10/second burst 4 packets drop comment "No ping floods"<br />
ip6 nexthdr icmpv6 icmpv6 type echo-request limit rate over 10/second burst 4 packets drop comment "No ping floods"<br />
<br />
ct state established,related accept comment "Accept traffic originated from us"<br />
<br />
ip6 nexthdr icmpv6 icmpv6 type { destination-unreachable, packet-too-big, time-exceeded, parameter-problem, mld-listener-query, mld-listener-report, mld-listener-reduction, nd-router-solicit, nd-router-advert, nd-neighbor-solicit, nd-neighbor-advert, ind-neighbor-solicit, ind-neighbor-advert, mld2-listener-report } accept comment "Accept ICMPv6"<br />
ip protocol icmp icmp type { destination-unreachable, router-solicitation, router-advertisement, time-exceeded, parameter-problem } accept comment "Accept ICMP"<br />
ip protocol igmp accept comment "Accept IGMP"<br />
<br />
tcp dport ssh ct state new limit rate 15/minute accept comment "Avoid brute force on SSH"<br />
<br />
}<br />
<br />
}<br />
</nowiki>}}<br />
<br />
=== Jump ===<br />
<br />
When using jumps in config file, it is necessary to define the target chain first. Otherwise one could end up with {{ic|Error: Could not process rule: No such file or directory}}.<br />
<br />
{{bc|1=<nowiki><br />
table inet filter {<br />
chain web {<br />
tcp dport http accept<br />
tcp dport 8080 accept<br />
}<br />
chain input {<br />
type filter hook input priority 0;<br />
ip saddr 10.0.2.0/24 jump web<br />
drop<br />
}<br />
}<br />
</nowiki>}}<br />
<br />
=== Different rules for different interfaces ===<br />
<br />
If your box has more than one network interface, and you would like to use different rules for different interfaces, you may want to use a "dispatching" filter chain, and then interface-specific filter chains. For example, let us assume your box acts as a home router, you want to run a web server accessible over the LAN (interface {{ic|enp3s0}}), but not from the public internet (interface {{ic|enp2s0}}), you may want to consider a structure like this:<br />
<br />
{{bc|<nowiki><br />
table inet filter {<br />
chain input { # this chain serves as a dispatcher<br />
type filter hook input priority 0;<br />
<br />
iif lo accept # always accept loopback<br />
iifname enp2s0 jump input_enp2s0<br />
iifname enp3s0 jump input_enp3s0<br />
<br />
reject with icmp type port-unreachable # refuse traffic from all other interfaces<br />
}<br />
chain input_enp2s0 { # rules applicable to public interface interface<br />
ct state {established,related} accept<br />
ct state invalid drop<br />
udp dport bootpc accept<br />
tcp dport bootpc accept<br />
reject with icmp type port-unreachable # all other traffic<br />
}<br />
chain input_enp3s0 {<br />
ct state {established,related} accept<br />
ct state invalid drop<br />
udp dport bootpc accept<br />
tcp dport bootpc accept<br />
tcp port http accept<br />
tcp port https accept<br />
reject with icmp type port-unreachable # all other traffic<br />
}<br />
chain ouput { # we let everything out<br />
type filter hook output priority 0;<br />
accept<br />
}<br />
}<br />
</nowiki>}}<br />
<br />
Alternatively you could choose only one {{ic|iifname}} statement, such as for the single upstream interface, and put the default rules for all other interfaces in one place, instead of dispatching for each interface.<br />
<br />
=== Masquerading ===<br />
<br />
nftables has a special keyword {{ic|masquerade}} "where the source address is automagically set to the address of the output interface" ([https://wiki.nftables.org/wiki-nftables/index.php/Performing_Network_Address_Translation_%28NAT%29#Masquerading source]). This is particularly useful for situations in which the IP address of the interface is unpredictable or unstable, such as the upstream interface of routers connecting to many ISPs. Without it, the Network Address Translation rules would have to be updated every time the IP address of the interface changed.<br />
<br />
To use it:<br />
<br />
* make sure masquerading is enabled in the kernel (true if you use the default kernel), otherwise during kernel configuration, set {{ic|1=CONFIG_NFT_MASQ=m}}.<br />
* the {{ic|masquerade}} keyword can only be used in chains of type {{ic|nat}}.<br />
* masquerading is a kind of source NAT, so only works in the output path.<br />
<br />
Example for a machine with two interfaces: LAN connected to {{ic|enp3s0}}, and public internet connected to {{ic|enp2s0}}:<br />
<br />
{{bc|<nowiki><br />
table inet nat {<br />
chain prerouting {<br />
type nat hook prerouting priority -100;<br />
}<br />
chain postrouting {<br />
type nat hook postrouting priority 100;<br />
oifname "enp2s0" masquerade<br />
}<br />
}<br />
</nowiki>}}<br />
<br />
Since the table type is {{ic|inet}} both IPv4 and IPv6 packets will be masqueraded. If you want only ipv4 packets to be masqueraded (since extra adress space of IPv6 makes NAT not required) {{ic|meta nfproto ipv4}} expression can be used infront of {{ic|oifname "enp2s0" masquerade}} or the table type can be changed to {{ic|ip}}.<br />
<br />
=== NAT with port forwarding ===<br />
<br />
This example will forward ports 22 and 80 to {{ic|''destination_ip''}}. You will need to set {{ic|net.ipv4.ip_forward}} and {{ic|net.ipv4.conf.''wan_interface''.forwarding}} to {{ic|1}} via [[sysctl]].<br />
<br />
{{bc|<br />
table ip nat {<br />
chain prerouting {<br />
type nat hook prerouting priority -100;<br />
<br />
tcp dport { ssh, http } dnat to ''destination_ip''<br />
}<br />
<br />
chain postrouting {<br />
type nat hook postrouting priority 100;<br />
<br />
ip daddr ''destination_ip'' masquerade<br />
}<br />
}<br />
</nowiki>}}<br />
<br />
== Tips and tricks ==<br />
<br />
=== Simple stateful firewall ===<br />
<br />
See [[Simple stateful firewall]] for more information.<br />
<br />
==== Single machine ====<br />
<br />
Flush the current ruleset:<br />
<br />
# nft flush ruleset<br />
<br />
Add a table:<br />
<br />
# nft add table inet filter<br />
<br />
Add the input, forward, and output base chains. The policy for input and forward will be to drop. The policy for output will be to accept.<br />
<br />
# nft add chain inet filter input '{ type filter hook input priority 0 ; policy drop ; }'<br />
# nft add chain inet filter forward '{ type filter hook forward priority 0 ; policy drop ; }'<br />
# nft add chain inet filter output '{ type filter hook output priority 0 ; policy accept ; }'<br />
<br />
Add two regular chains that will be associated with tcp and udp:<br />
<br />
# nft add chain inet filter TCP<br />
# nft add chain inet filter UDP<br />
<br />
Related and established traffic will be accepted:<br />
<br />
# nft add rule inet filter input ct state related,established accept<br />
<br />
All loopback interface traffic will be accepted:<br />
<br />
# nft add rule inet filter input iif lo accept<br />
<br />
Drop any invalid traffic:<br />
<br />
# nft add rule inet filter input ct state invalid drop<br />
<br />
Accept ICMP and IGMP:<br />
<br />
# nft add rule inet filter input ip6 nexthdr icmpv6 icmpv6 type '{ destination-unreachable, packet-too-big, time-exceeded, parameter-problem, mld-listener-query, mld-listener-report, mld-listener-reduction, nd-router-solicit, nd-router-advert, nd-neighbor-solicit, nd-neighbor-advert, ind-neighbor-solicit, ind-neighbor-advert, mld2-listener-report }' accept<br />
# nft add rule inet filter input ip protocol icmp icmp type '{ destination-unreachable, router-solicitation, router-advertisement, time-exceeded, parameter-problem }' accept<br />
# nft add rule inet filter input ip protocol igmp accept<br />
<br />
New udp traffic will jump to the UDP chain:<br />
<br />
# nft add rule inet filter input ip protocol udp ct state new jump UDP<br />
<br />
New tcp traffic will jump to the TCP chain:<br />
<br />
# nft add rule inet filter input 'ip protocol tcp tcp flags & (fin|syn|rst|ack) == syn ct state new jump TCP'<br />
<br />
Reject all traffic that was not processed by other rules:<br />
<br />
# nft add rule inet filter input ip protocol udp reject<br />
# nft add rule inet filter input ip protocol tcp reject with tcp reset<br />
# nft add rule inet filter input counter reject with icmp type prot-unreachable<br />
<br />
At this point you should decide what ports you want to open to incoming connections, which are handled by the TCP and UDP chains. For example to open connections for a web server add:<br />
<br />
# nft add rule inet filter TCP tcp dport 80 accept<br />
<br />
To accept HTTPS connections for a webserver on port 443:<br />
<br />
# nft add rule inet filter TCP tcp dport 443 accept<br />
<br />
To accept SSH traffic on port 22:<br />
<br />
# nft add rule inet filter TCP tcp dport 22 accept<br />
<br />
To accept incoming DNS requests:<br />
<br />
# nft add rule inet filter TCP tcp dport 53 accept<br />
# nft add rule inet filter UDP udp dport 53 accept<br />
<br />
Be sure to make your changes permanent when satisifed.<br />
<br />
=== Prevent brute-force attacks ===<br />
<br />
[[Sshguard]] is program that can detect brute-force attacks and modify firewalls based on IP addresses it temporarily blacklists. See [[Sshguard#nftables]] on how to set up nftables to be used with it.<br />
<br />
== Troubleshooting ==<br />
<br />
=== Working with Docker ===<br />
<br />
Using nftables can interfere with [[Docker]] networking (and probably other container runtimes as well). In particular the drop policy for the {{ic|forward}} chain will block packets originating in docker containers. If you want to keep the {{ic|forward}} rule in your {{ic|inet}} table, you can use the following:<br />
<br />
# [[Install]] {{Pkg|iptables-nft}} to provide an iptables compatible interface for nftables that docker can use.<br />
# Use the following for the {{ic|forward}} chain in your {{ic|inet}} table:<br />
#:{{bc|<nowiki><br />
chain forward {<br />
type filter hook forward priority security; policy drop<br />
mark 1 accept<br />
</nowiki>}}<br />
# Add a rule to the DOCKER-USER chain in the {{ic|ip filter}} table to mark packets if docker is running:<br />
#:{{bc|<nowiki><br />
table ip filter {<br />
chain DOCKER-USER {<br />
mark set 1<br />
}<br />
}<br />
</nowiki>}}<br />
<br />
This works by marking packets if docker is active, and accepting the packets in this case, since docker has already filtered them (the forward chain defined by docker uses a drop policy).<br />
<br />
== See also ==<br />
<br />
* [https://wiki.nftables.org/ netfilter nftables wiki]<br />
* [[debian:nftables]]<br />
* [[gentoo:nftables]]<br />
* [https://lwn.net/Articles/324251/ First release of nftables]<br />
* [https://home.regit.org/netfilter-en/nftables-quick-howto/ nftables quick howto]<br />
* [https://lwn.net/Articles/564095/ The return of nftables]<br />
* [https://developers.redhat.com/blog/2016/10/28/what-comes-after-iptables-its-successor-of-course-nftables/ What comes after ‘iptables’? Its successor, of course: `nftables`]</div>Delapouitehttps://wiki.archlinux.org/index.php?title=Sudo&diff=591157Sudo2019-12-07T18:38:42Z<p>Delapouite: add link to KDE</p>
<hr />
<div>[[Category:Security]]<br />
[[Category:Commands]]<br />
[[cs:Sudo]]<br />
[[es:Sudo]]<br />
[[fa:sudo]]<br />
[[fr:Sudo]]<br />
[[it:Sudo]]<br />
[[ja:Sudo]]<br />
[[ru:Sudo]]<br />
[[sr:Sudo]]<br />
[[zh-hans:Sudo]]<br />
{{Related articles start}}<br />
{{Related|Users and groups}}<br />
{{Related|su}}<br />
{{Related articles end}}<br />
[https://www.sudo.ws/sudo/ Sudo] allows a system administrator to delegate authority to give certain users—or groups of users—the ability to run commands as root or another user while providing an audit trail of the commands and their arguments.<br />
<br />
Sudo is an alternative to [[su]] for running commands as root. Unlike [[su]], which launches a root shell that allows all further commands root access, sudo instead grants temporary privilege escalation to a single command. By enabling root privileges only when needed, sudo usage reduces the likelihood that a typo or a bug in an invoked command will ruin the system.<br />
<br />
Sudo can also be used to run commands as other users; additionally, sudo logs all commands and failed access attempts for security auditing.<br />
<br />
== Installation ==<br />
<br />
[[Install]] the {{Pkg|sudo}} package.<br />
<br />
== Usage ==<br />
<br />
To begin using {{ic|sudo}} as a non-privileged user, it must be properly configured. See [[#Configuration]].<br />
<br />
To use ''sudo'', simply prefix a command and its arguments with {{ic|sudo}} and a space:<br />
<br />
$ sudo ''cmd''<br />
<br />
For example, to use pacman:<br />
<br />
$ sudo pacman -Syu<br />
<br />
See {{man|8|sudo}} for more information.<br />
<br />
== Configuration ==<br />
<br />
{{Expansion|Move [[#Defaults skeleton]] here, and create an intro discussing {{ic|Defaults}}, perhaps with a table that lists common settings}}<br />
<br />
See {{man|5|sudoers}} for more information, such as configuring the password timeout.<br />
<br />
=== View current settings ===<br />
<br />
Run {{ic|sudo -ll}} to print out the current sudo configuration, or {{ic|sudo -lU ''user''}} for a specific user.<br />
<br />
=== Using visudo ===<br />
<br />
The configuration file for sudo is {{ic|/etc/sudoers}}. It should '''always''' be edited with the {{man|8|visudo}} command. {{ic|visudo}} locks the {{ic|sudoers}} file, saves edits to a temporary file, and checks that file's grammar before copying it to {{ic|/etc/sudoers}}.<br />
<br />
{{Warning|<br />
* It is imperative that {{ic|sudoers}} be free of syntax errors! Any error makes sudo unusable. '''Always''' edit it with {{ic|visudo}} to prevent errors.<br />
* From {{man|8|visudo}}: ''Note that this can be a security hole since it allows the user to execute any program they wish simply by setting VISUAL or EDITOR.''<br />
}}<br />
<br />
The default editor for visudo is {{ic|vi}}. sudo from the core repository is compiled with {{Ic|--with-env-editor}} by default and honors the use of the {{Ic|VISUAL}} and {{Ic|EDITOR}} variables. {{ic|EDITOR}} is not used when {{ic|VISUAL}} is set.<br />
<br />
To establish nano as the '''visudo''' editor for the duration of the current shell session export {{ic|<nowiki>EDITOR=nano</nowiki>}}; to use a different editor just once simply set the variable before calling '''visudo''':<br />
<br />
# EDITOR=nano visudo<br />
<br />
Alternatively you may edit a copy of the {{ic|/etc/sudoers}} file and check it using {{ic|visudo -c -f ''/copy/of/sudoers''}}. This might come in handy in case you want to circumvent locking the file with visudo.<br />
<br />
To change the editor permanently, see [[Environment variables#Per user]]. To change the editor of choice permanently system-wide only for {{ic|visudo}}, add the following to {{ic|/etc/sudoers}} (assuming {{ic|nano}} is your preferred editor):<br />
<br />
# Reset environment by default<br />
Defaults env_reset<br />
# Set default EDITOR to nano, and do not allow visudo to use EDITOR/VISUAL.<br />
Defaults editor=/usr/bin/nano, !env_editor<br />
<br />
=== Example entries ===<br />
<br />
To allow a user to gain full root privileges when he/she precedes a command with {{ic|sudo}}, add the following line:<br />
<br />
USER_NAME ALL=(ALL) ALL<br />
<br />
To allow a user to run all commands as any user but only on the machine with hostname {{ic|HOST_NAME}}:<br />
<br />
USER_NAME HOST_NAME=(ALL) ALL<br />
<br />
To allow members of group {{ic|wheel}} sudo access:<br />
<br />
%wheel ALL=(ALL) ALL<br />
<br />
To disable asking for a password for user {{ic|USER_NAME}}:<br />
<br />
{{Warning|This will let any process running with your user name to use sudo without asking for permission.}}<br />
<br />
Defaults:USER_NAME !authenticate<br />
<br />
Enable explicitly defined commands only for user {{ic|USER_NAME}} on host {{ic|HOST_NAME}}:<br />
<br />
USER_NAME HOST_NAME=/usr/bin/halt,/usr/bin/poweroff,/usr/bin/reboot,/usr/bin/pacman -Syu<br />
<br />
{{Note|The most customized option should go at the end of the file, as the later lines overrides the previous ones. In particular such a line should be after the {{ic|%wheel}} line if your user is in this group.}}<br />
<br />
Enable explicitly defined commands only for user {{ic|USER_NAME}} on host {{ic|HOST_NAME}} without password:<br />
USER_NAME HOST_NAME= NOPASSWD: /usr/bin/halt,/usr/bin/poweroff,/usr/bin/reboot,/usr/bin/pacman -Syu<br />
<br />
A detailed {{ic|sudoers}} example is available at {{ic|/usr/share/doc/sudo/examples/sudoers}}. Otherwise, see the {{man|5|sudoers}} for detailed information.<br />
<br />
=== Sudoers default file permissions ===<br />
<br />
The owner and group for the {{ic|sudoers}} file must both be 0. The file permissions must be set to 0440. These permissions are set by default, but if you accidentally change them, they should be changed back immediately or sudo will fail.<br />
<br />
# chown -c root:root /etc/sudoers<br />
# chmod -c 0440 /etc/sudoers<br />
<br />
== Tips and tricks ==<br />
<br />
=== Disable password ''prompt'' timeout ===<br />
<br />
A common annoyance is a long-running process that runs on a background terminal somewhere that runs with normal permissions and elevates only when needed. This leads to a sudo password prompt which goes unnoticed and times out, at which point the process dies and the work done is lost or, at best, cached. Common advice is to enable passwordless sudo, or extend the timeout of sudo remembering a password. Both of these have negative security implications. The '''prompt''' timeout can also be disabled and since that does not serve any reasonable security purpose it should be the solution here:<br />
<br />
Defaults passwd_timeout=0<br />
<br />
=== Add terminal bell to the password prompt ===<br />
<br />
To draw attention to a sudo prompt in a background terminal, users can simply make it echo a bell character:<br />
<br />
Defaults passprompt="^G[sudo] password for %p: "<br />
<br />
Note the ^G is a literal bell character. E.g. in vim, insert using the sequence ^V ^G.<br />
<br />
=== Disable per-terminal sudo ===<br />
<br />
{{Warning|This will let any process use your sudo session.}}<br />
<br />
If you are annoyed by sudo's defaults that require you to enter your password every time you open a new terminal, disable '''tty_tickets''':<br />
<br />
Defaults !tty_tickets<br />
<br />
=== Environment variables ===<br />
<br />
If you have a lot of environment variables, or you export your proxy settings via {{ic|1=export http_proxy="..."}}, when using sudo these variables do not get passed to the root account unless you run sudo with the {{ic|-E}} option.<br />
<br />
$ sudo -E pacman -Syu<br />
<br />
The recommended way of preserving environment variables is to append them to {{ic|env_keep}}:<br />
<br />
{{hc|/etc/sudoers|<nowiki><br />
Defaults env_keep += "ftp_proxy http_proxy https_proxy no_proxy"<br />
</nowiki>}}<br />
<br />
=== Passing aliases ===<br />
<br />
If you use a lot of aliases, you might have noticed that they do not carry over to the root account when using sudo. However, there is an easy way to make them work. Simply add the following to your {{ic|~/.bashrc}} or {{ic|/etc/bash.bashrc}}:<br />
<br />
alias sudo='sudo '<br />
<br />
=== Root password ===<br />
<br />
Users can configure sudo to ask for the root password instead of the user password by adding {{ic|targetpw}} (target user, defaults to root) or {{ic|rootpw}} to the Defaults line in {{ic|/etc/sudoers}}:<br />
Defaults targetpw<br />
<br />
To prevent exposing your root password to users, you can restrict this to a specific group:<br />
Defaults:%wheel targetpw<br />
%wheel ALL=(ALL) ALL<br />
<br />
=== Disable root login ===<br />
<br />
Users may wish to disable the root login. Without root, attackers must first guess a user name configured as a sudoer as well as the user password. See for example [[OpenSSH#Deny]].<br />
<br />
{{Warning|<br />
* Be careful, you may lock yourself out by disabling root login. Sudo is not automatically installed and its default configuration allows neither passwordless root access nor root access with your own password. Ensure a user is properly configured as a sudoer ''before'' disabling the root account!<br />
* If you have changed your sudoers -file to use rootpw as default, then do not disable root login with any of the following commands!<br />
* If you are already locked out, see [[Password recovery]] for help.}}<br />
<br />
The account can be locked via {{ic|passwd}}:<br />
<br />
# passwd -l root<br />
<br />
A similar command unlocks root.<br />
<br />
$ sudo passwd -u root<br />
<br />
Alternatively, edit {{ic|/etc/shadow}} and replace the root's encrypted password with "!":<br />
<br />
root:!:12345::::::<br />
<br />
To enable root login again:<br />
<br />
$ sudo passwd root<br />
<br />
{{Tip|To get to an interactive root prompt, even after disabling the ''root'' account, use {{ic|sudo -i}}.}}<br />
<br />
==== kdesu ====<br />
<br />
kdesu may be used under [[KDE]] to launch GUI applications with root privileges. It is possible that by default kdesu will try to use su even if the root account is disabled. Fortunately one can tell kdesu to use sudo instead of su. Create/edit the file {{ic|~/.config/kdesurc}}:<br />
<br />
[super-user-command]<br />
super-user-command=sudo<br />
<br />
or use the following command:<br />
<br />
$ kwriteconfig5 --file kdesurc --group super-user-command --key super-user-command sudo<br />
<br />
Alternatively, install {{AUR|kdesudo}}, which has the added advantage of tab-completion for the command following.<br />
<br />
=== Harden with Sudo Example ===<br />
<br />
Let us say you create 3 users: admin, devel, and joe. The user "admin" is used for journalctl, systemctl, mount, kill, and iptables; "devel" is used for installing packages, and editing config files; and "joe" is the user you log in with. To let "joe" reboot, shutdown, and use netctl we would do the following:<br />
<br />
Edit {{ic|/etc/pam.d/su}} and {{ic|/etc/pam.d/su-l}}<br />
Require user be in the wheel group, but do not put anyone in it.<br />
#%PAM-1.0<br />
auth sufficient pam_rootok.so<br />
# Uncomment the following line to implicitly trust users in the "wheel" group.<br />
#auth sufficient pam_wheel.so trust use_uid<br />
# Uncomment the following line to require a user to be in the "wheel" group.<br />
auth required pam_wheel.so use_uid<br />
auth required pam_unix.so<br />
account required pam_unix.so<br />
session required pam_unix.so<br />
<br />
Limit SSH login to the 'ssh' group. Only "joe" will be part of this group.<br />
groupadd -r ssh<br />
gpasswd -a joe ssh<br />
echo 'AllowGroups ssh' >> /etc/ssh/sshd_config<br />
<br />
[[Restart]] {{ic|sshd.service}}.<br />
<br />
Add users to other groups.<br />
for g in power network ;do ;gpasswd -a joe $g ;done<br />
for g in network power storage ;do ;gpasswd -a admin $g ;done<br />
<br />
Set permissions on configs so devel can edit them.<br />
chown -R devel:root /etc/{http,openvpn,cups,zsh,vim,screenrc}<br />
<br />
Cmnd_Alias POWER = /usr/bin/shutdown -h now, /usr/bin/halt, /usr/bin/poweroff, /usr/bin/reboot<br />
Cmnd_Alias STORAGE = /usr/bin/mount -o nosuid\,nodev\,noexec, /usr/bin/umount<br />
Cmnd_Alias SYSTEMD = /usr/bin/journalctl, /usr/bin/systemctl<br />
Cmnd_Alias KILL = /usr/bin/kill, /usr/bin/killall<br />
Cmnd_Alias PKGMAN = /usr/bin/pacman<br />
Cmnd_Alias NETWORK = /usr/bin/netctl<br />
Cmnd_Alias FIREWALL = /usr/bin/iptables, /usr/bin/ip6tables<br />
Cmnd_Alias SHELL = /usr/bin/zsh, /usr/bin/bash<br />
%power ALL = (root) NOPASSWD: POWER<br />
%network ALL = (root) NETWORK<br />
%storage ALL = (root) STORAGE<br />
root ALL = (ALL) ALL<br />
admin ALL = (root) SYSTEMD, KILL, FIREWALL<br />
devel ALL = (root) PKGMAN<br />
joe ALL = (devel) SHELL, (admin) SHELL <br />
<br />
With this setup, you will almost never need to login as the Root user.<br />
<br />
"joe" can connect to his home WiFi.<br />
sudo netctl start home<br />
sudo poweroff<br />
<br />
"joe" can not use netctl as any other user.<br />
sudo -u admin -- netctl start home<br />
<br />
When "joe" needs to use journalctl or kill run away process he can switch to that user.<br />
sudo -i -u devel<br />
sudo -i -u admin<br />
<br />
But "joe" cannot switch to the root user.<br />
sudo -i -u root<br />
<br />
If "joe" want to start a gnu-screen session as admin he can do it like this:<br />
sudo -i -u admin<br />
admin% chown admin:tty `echo $TTY`<br />
admin% screen<br />
<br />
=== Configure sudo using drop-in files in /etc/sudoers.d ===<br />
<br />
''sudo'' parses files contained in the directory {{ic|/etc/sudoers.d/}}. This means that instead of editing {{ic|/etc/sudoers}}, you can change settings in standalone files and drop them in that directory. This has two advantages:<br />
<br />
* There is no need to edit a {{ic|sudoers.pacnew}} file;<br />
* If there is a problem with a new entry, you can remove the offending file instead of editing {{ic|/etc/sudoers}} (but see the warning below).<br />
<br />
The format for entries in these drop-in files is the same as for {{ic|/etc/sudoers}} itself. To edit them directly, use {{ic|visudo -f /etc/sudoers.d/''somefile''}}. See the "Including other files from within sudoers" section of {{man|5|sudoers}} for details.<br />
<br />
The files in {{ic|/etc/sudoers.d/}} directory are parsed in lexicographical order, file names containing {{ic|.}} or {{ic|~}} are skipped. To avoid sorting problems, the file names should begin with two digits, e.g. {{ic|01_foo}}.<br />
<br />
{{Note|The order of entries in the drop-in files is important: make sure that the statements do not override themselves.}}<br />
<br />
{{Warning|The files in {{ic|/etc/sudoers.d/}} are just as fragile as {{ic|/etc/sudoers}} itself: any improperly formatted file will prevent {{ic|sudo}} from working. Hence, for the same reason it is strongly advised to use {{ic|visudo}}}}<br />
<br />
=== Editing files ===<br />
<br />
{{ic|sudo -e}} or {{ic|sudoedit}} lets you edit a file as another user while still running the text editor as your user.<br />
<br />
This is especially useful for editing files as root without elevating the privilege of your text editor, for more details read {{man|8|sudo|e}}.<br />
<br />
Note that you can set the editor to any program, so for example one can use {{Pkg|meld}} to manage [[Pacman/Pacnew_and_Pacsave|pacnew]] files:<br />
<br />
$ SUDO_EDITOR=meld sudo -e /etc/''file''{,.pacnew''}<br />
<br />
=== Enable insults ===<br />
<br />
Users can enable insults easter egg in sudo by adding the following line in sudoers file with {{ic|visudo}}.<br />
<br />
Upon entering an incorrect password this will replace {{ic|Sorry, try again.}} message with humorous insults.<br />
<br />
{{hc|1=/etc/sudoers|2=<br />
Defaults insults<br />
}}<br />
<br />
== Troubleshooting ==<br />
<br />
=== SSH TTY Problems ===<br />
<br />
{{Merge|#Configuration}}<br />
<br />
SSH does not allocate a tty by default when running a remote command. Without a tty, sudo cannot disable echo when prompting for a password. You can use ssh's {{ic|-t}} option to force it to allocate a tty.<br />
<br />
The {{ic|Defaults}} option {{ic|requiretty}} only allows the user to run sudo if they have a tty.<br />
<br />
# Disable "ssh hostname sudo <cmd>", because it will show the password in clear text. You have to run "ssh -t hostname sudo <cmd>".<br />
#<br />
#Defaults requiretty<br />
<br />
=== Permissive umask ===<br />
<br />
{{Merge|#Configuration}}<br />
<br />
Sudo will union the user's [[umask]] value with its own umask (which defaults to 0022). This prevents sudo from creating files with more open permissions than the user's umask allows. While this is a sane default if no custom umask is in use, this can lead to situations where a utility run by sudo may create files with different permissions than if run by root directly. If errors arise from this, sudo provides a means to fix the umask, even if the desired umask is more permissive than the umask that the user has specified. Adding this (using {{ic|visudo}}) will override sudo's default behavior:<br />
<br />
Defaults umask = 0022<br />
Defaults umask_override<br />
<br />
This sets sudo's umask to root's default umask (0022) and overrides the default behavior, always using the indicated umask regardless of what umask the user as set.<br />
<br />
=== Defaults skeleton ===<br />
<br />
{{Merge|#Configuration}}<br />
<br />
The authors site has a [http://www.sudo.ws/sudo/sudoers.man.html#x5355444f455253204f5054494f4e53 list of all the options] that can be used with the {{ic|Defaults}} command in the {{ic|/etc/sudoers}} file.<br />
<br />
See [https://gist.github.com/AladW/7eca9799b9ea624eca31] for a list of options (parsed from the version 1.8.7 source code) in a format optimized for {{ic|sudoers}}.</div>Delapouitehttps://wiki.archlinux.org/index.php?title=Network_bridge&diff=590947Network bridge2019-12-05T07:50:28Z<p>Delapouite: add link to Spanning Tree Protocol</p>
<hr />
<div>[[Category:Networking]]<br />
[[ja:ネットワークブリッジ]]<br />
[[zh-hans:Network bridge]]<br />
{{Related articles start}}<br />
{{Related|Bridge with netctl}}<br />
{{Related|Network_configuration#Bonding_or_LAG}}<br />
{{Related articles end}}<br />
A bridge is a piece of software used to unite two or more network segments. A bridge behaves like a virtual network switch, working transparently (the other machines do not need to know or care about its existence). Any real devices (e.g. {{ic|eth0}}) and virtual devices (e.g. {{ic|tap0}}) can be connected to it.<br />
<br />
This article explains how to create a bridge that contains at least an ethernet device. This is useful for things like the bridge mode of [[QEMU]], setting a software based access point, etc.<br />
<br />
== Creating a bridge ==<br />
<br />
There are a number of ways to create a bridge.<br />
<br />
=== With iproute2 ===<br />
<br />
This section describes the management of a network bridge using the ''ip'' tool from the {{Pkg|iproute2}} package, which is required by the {{Pkg|base}} [[meta package]].<br />
<br />
Create a new bridge and change its state to up:<br />
<br />
# ip link add name ''bridge_name'' type bridge<br />
# ip link set ''bridge_name'' up<br />
<br />
To add an interface (e.g. eth0) into the bridge, its state must be up:<br />
<br />
# ip link set eth0 up<br />
<br />
Adding the interface into the bridge is done by setting its master to {{ic|''bridge_name''}}:<br />
<br />
# ip link set eth0 master ''bridge_name''<br />
<br />
To show the existing bridges and associated interfaces, use the ''bridge'' utility (also part of {{Pkg|iproute2}}). See {{man|8|bridge}} for details.<br />
<br />
# bridge link<br />
<br />
This is how to remove an interface from a bridge:<br />
<br />
# ip link set eth0 nomaster<br />
<br />
The interface will still be up, so you may also want to bring it down:<br />
<br />
# ip link set eth0 down<br />
<br />
To delete a bridge issue the following command:<br />
<br />
# ip link delete ''bridge_name'' type bridge<br />
<br />
This will automatically remove all interfaces from the bridge. The slave interfaces will still be up, though, so you may also want to bring them down after.<br />
<br />
=== With bridge-utils ===<br />
<br />
This section describes the management of a network bridge using the legacy ''brctl'' tool from the {{Pkg|bridge-utils}} package, which is available in the [[official repositories]]. See {{man|8|brctl}} for full listing of options.<br />
<br />
Create a new bridge:<br />
<br />
# brctl addbr ''bridge_name''<br />
<br />
Add a device to a bridge, for example {{ic|eth0}}:<br />
<br />
# brctl addif ''bridge_name'' eth0<br />
<br />
{{Note|Adding an interface to a bridge will cause the interface to lose its existing IP address. If you're connected remotely via the interface you intend to add to the bridge, you will lose your connection. This problem can be worked around by scripting the bridge to be created at system startup.}}<br />
<br />
Show current bridges and what interfaces they are connected to:<br />
<br />
$ brctl show<br />
<br />
Set the bridge device up:<br />
<br />
# ip link set dev ''bridge_name'' up<br />
<br />
Delete a bridge, you need to first set it to ''down'':<br />
<br />
# ip link set dev ''bridge_name'' down<br />
# brctl delbr ''bridge_name''<br />
<br />
{{Note|To enable the [http://ebtables.netfilter.org/documentation/bridge-nf.html bridge-netfilter] functionality, you need to manually load the {{ic|br_netfilter}} module:<br />
<br />
# modprobe br_netfilter<br />
<br />
See also [[Kernel modules#Automatic module loading with systemd]].<br />
}}<br />
<br />
=== With netctl ===<br />
<br />
See [[Bridge with netctl]].<br />
<br />
=== With systemd-networkd ===<br />
<br />
See [[systemd-networkd#Bridge interface]].<br />
<br />
=== With NetworkManager ===<br />
<br />
[[GNOME]]'s Network settings can create bridges, but currently will not auto-connect to them or slave/attached interfaces. Open Network Settings, add a new interface of type Bridge, add a new bridged connection, and select the MAC address of the device to attach to the bridge.<br />
<br />
[[KDE]]'s {{Pkg|plasma-nm}} can't create bridges, another tool must be used for the creation. It can, however, view and modify bridges. "Show and configure virtual connections" must be enabled in the applet configuration (as opposed to the KCM dialog accessed from the applet's configure button or KDE system settings) in order to view and modify bridge interfaces. <br />
<br />
{{Pkg|nm-connection-editor}} can create bridges in the same manner as GNOME's Network settings.<br />
<br />
{{ic|nmcli}} from {{Pkg|networkmanager}} can create bridges. Creating a bridge with [[Wikipedia:Spanning_Tree_Protocol|STP]] disabled (to avoid the bridge being advertised on the network):<br />
<br />
$ nmcli c add type bridge ifname br0 stp no<br />
<br />
Making interface {{ic|enp30s0}} a slave to the bridge:<br />
<br />
$ nmcli c add type bridge-slave ifname enp30s0 master br0<br />
<br />
Setting the existing connection as down:<br />
<br />
$ nmcli c down ''Connection''<br />
<br />
Setting the new bridge as up:<br />
<br />
$ nmcli c up bridge-br0<br />
<br />
If NetworkManager's default interface for the device you added to the bridge connects automatically, you may want to disable that by clicking the gear next to it in Network Settings, and unchecking "Connect automatically" under "Identity."<br />
<br />
== Assigning an IP address ==<br />
<br />
When the bridge is fully set up, it can be assigned an IP address:<br />
<br />
# ip addr add dev ''bridge_name'' 192.168.66.66/24<br />
<br />
{{Expansion|This section needs to be connected to the link-level part described in [[QEMU#Tap networking with QEMU]]. For now, see the instructions given there.}}<br />
<br />
== Tips and tricks ==<br />
<br />
=== Wireless interface on a bridge ===<br />
<br />
To add a wireless interface to a bridge, you first have to assign the wireless interface to an access point or start an access point with [[Software_access_point|hostapd]]. Otherwise the wireless interface will not be added to the bridge.<br />
<br />
See also [https://wiki.debian.org/BridgeNetworkConnections#Bridging_with_a_wireless_NIC Bridging with a wireless NIC] on Debian wiki.<br />
<br />
=== Speeding up traffic destinated to the bridge itself ===<br />
<br />
In some situations the bridge not only serves as a bridge box, but also talks to other hosts. Packets that arrive on a bridge port and that are destinated to the bridge box itself will by default enter the iptables INPUT chain with the logical bridge port as input device. These packets will be queued twice by the network code, the first time they are queued after they are received by the network device. The second time after the bridge code examined the destination MAC address and determined it was a locally destinated packet and therefore decided to pass the frame up to the higher protocol stack.[http://ebtables.netfilter.org/examples/basic.html#ex_speed]<br />
<br />
The way to let locally destinated packets be queued only once is by brouting them in the BROUTING chain of the broute table. Suppose br0 has an IP address and that br0's bridge ports do not have an IP address. Using the following rule should make all locally directed traffic be queued only once: <br />
<br />
# ebtables -t broute -A BROUTING -d $MAC_OF_BR0 -p ipv4 -j redirect --redirect-target DROP<br />
<br />
The replies from the bridge will be sent out through the br0 device (assuming your routing table is correct and sends all traffic through br0), so everything keeps working neatly, without the performance loss caused by the packet being queued twice. <br />
<br />
The redirect target is needed because the MAC address of the bridge port is not necessarily equal to the MAC address of the bridge device. The packets destinated to the bridge box will have a destination MAC address equal to that of the bridge br0, so that destination address must be changed to that of the bridge port.<br />
<br />
== Troubleshooting ==<br />
=== No networking after bridge configuration ===<br />
<br />
{{Style|This problem is pointed out as a note in [[#With bridge-utils]]. It should be made clear in all other sections and running a DHCP client should be added to [[#Assigning an IP address]].}}<br />
<br />
It may help to remove all IP addresses and routes from the interface (e.g. {{ic|eth0}}) that was added to the bridge and configure these parameters for the bridge instead.<br />
<br />
First of all, make sure there is no [[dhcpcd]] instance running for {{ic|eth0}}, otherwise the deleted addresses may be reassigned.<br />
<br />
Remove address and route from the {{ic|eth0}} interface:<br />
<br />
# ip addr del ''address'' dev eth0<br />
# ip route del ''address'' dev eth0<br />
<br />
Now IP address and route for the earlier configured bridge must be set. This is usually done by starting a DHCP client for this interface. Otherwise, consult [[Network configuration]] for manual configuration.<br />
<br />
== See also ==<br />
<br />
* [http://www.linuxfoundation.org/collaborate/workgroups/networking/bridge Official documentation for bridge-utils]<br />
* [http://www.linuxfoundation.org/collaborate/workgroups/networking/iproute2 Official documentation for iproute2]<br />
* [http://ebtables.netfilter.org/br_fw_ia/br_fw_ia.html ebtables/iptables interaction on a Linux-based bridge]</div>Delapouitehttps://wiki.archlinux.org/index.php?title=SSHFS&diff=587618SSHFS2019-11-02T16:08:02Z<p>Delapouite: add mention about fuse2 vs fuse3 for the fusermount3 command</p>
<hr />
<div>[[Category:FUSE]]<br />
[[Category:Secure Shell]]<br />
[[Category:Network sharing]]<br />
[[es:SSHFS]]<br />
[[fr:Sshfs]]<br />
[[ja:Sshfs]]<br />
[[ru:SSHFS]]<br />
[[zh-hans:SSHFS]]<br />
{{Related articles start}}<br />
{{Related|SCP and SFTP}}<br />
{{Related|SFTP chroot}}<br />
{{Related|Pure-FTPd}}<br />
{{Related|sftpman}}<br />
{{Related articles end}}<br />
<br />
[https://github.com/libfuse/sshfs SSHFS] is a [[FUSE]]-based filesystem client for mounting remote directories over a [[Secure Shell]] connection.<br />
<br />
== Installation ==<br />
<br />
[[Install]] the {{Pkg|sshfs}} package.<br />
<br />
{{Tip|<br />
*If you often need to mount sshfs filesystems you may be interested in using an sshfs helper, such as {{AUR|qsshfs}}, [[sftpman]], {{AUR|sshmnt}} or [https://github.com/lahwaacz/Scripts/blob/master/fmount.py fmount.py].<br />
*You may want to use [[Google Authenticator]] providing additional security as in two-step authentication.<br />
*[[SSH keys]] may be used over traditional password authentication.}}<br />
<br />
=== Mounting ===<br />
<br />
In order to be able to mount a directory the SSH user needs to be able to access it. Invoke ''sshfs'' to mount a remote directory:<br />
<br />
$ sshfs ''[user@]host:[dir] mountpoint [options]''<br />
<br />
For example:<br />
<br />
$ sshfs myuser@mycomputer:/remote/path /local/path -C -p 9876<br />
<br />
Here {{ic|-p 9876}} specifies the port number and {{ic|-C}} enables compression. For more options see the [[#Options]] section.<br />
<br />
When not specified, the remote path defaults to the remote user home directory. Default user names and options can be predefined on a host-by-host basis in {{ic|~/.ssh/config}} to simplify the ''sshfs'' usage. For more information see [[OpenSSH#Client usage]].<br />
<br />
SSH will ask for the password, if needed. If you do not want to type in the password multiple times a day, see [[SSH keys]].<br />
<br />
=== Unmounting ===<br />
<br />
To unmount the remote system:<br />
<br />
$ fusermount3 -u ''mountpoint''<br />
<br />
Example:<br />
<br />
$ fusermount3 -u /local/path<br />
<br />
{{Note|There's a {{ic|3}} suffix on the {{ic|fusermount}} command, because as of end of 2019 SSHFS is one of the few projects that have migrated from {{ic|fuse2}} to the newer {{ic|fuse3}}.}}<br />
<br />
== Options ==<br />
<br />
''sshfs'' can automatically convert between local and remote user IDs. Use the {{ic|1=idmap=user}} option to translate the UID of the connecting user to the remote user {{ic|myuser}} (GID remains unchanged):<br />
<br />
$ sshfs myuser@mycomputer:/remote/path /local/path -o idmap=user<br />
<br />
If you need more control over UID and GID translation, look at the options {{ic|1=idmap=file}}, {{ic|uidfile}} and {{ic|gidfile}}.<br />
<br />
A complete list of options can be found in {{man|1|sshfs}}.<br />
<br />
== Chrooting ==<br />
<br />
You may want to restrict a specific user to a specific directory on the remote system. This can be done by editing {{ic|/etc/ssh/sshd_config}}:<br />
<br />
{{hc|/etc/ssh/sshd_config|<br />
.....<br />
Match User ''someuser'' <br />
ChrootDirectory ''/chroot/%u''<br />
ForceCommand internal-sftp<br />
AllowTcpForwarding no<br />
X11Forwarding no<br />
.....<br />
}}<br />
<br />
{{Note|The chroot directory '''must''' be owned by root, otherwise you will not be able to connect.}}<br />
<br />
See also [[SFTP chroot]]. For more information check the {{man|5|sshd_config}} man page for {{ic|Match}}, {{ic|ChrootDirectory}} and {{ic|ForceCommand}}.<br />
<br />
== Automounting ==<br />
<br />
{{Out of date|This requires to install {{Pkg|fuse2}} for {{ic|mount.fuse}}, or create a symbolic link from {{ic|mount.fuse3}}. See {{Bug|55564}}}}<br />
{{Out of date|1=fuse3 API doesn't accept options _netdev and user anymore. [https://bbs.archlinux.org/viewtopic.php?id=230191 Discussion]}}<br />
<br />
Automounting can happen on boot, or on demand (when accessing the directory). For both, the setup happens in the [[fstab]].<br />
<br />
{{Note|Keep in mind that automounting is done through the root user, therefore you cannot use hosts configured in {{ic|.ssh/config}} of your normal user.<br />
<br />
To let the root user use an SSH key of a normal user, specify its full path in the {{ic|IdentityFile}} option.<br />
<br />
'''And most importantly''', use each sshfs mount at least once manually '''while root''' so the host's signature is added to the {{ic|/root/.ssh/known_hosts}} file.<br />
}}<br />
<br />
=== On demand ===<br />
<br />
{{Expansion|Is there a way to make this work with a passphrase-protected private key? E.g. it prompts for the passphrase at first access. Alternatively, clearly state that it's not possible and why.}}<br />
<br />
With systemd on-demand mounting is possible using {{ic|/etc/fstab}} entries.<br />
<br />
Example:<br />
<br />
user@host:/remote/folder /mount/point fuse.sshfs noauto,x-systemd.automount,_netdev,users,idmap=user,IdentityFile=/home/user/.ssh/id_rsa,allow_other,reconnect 0 0<br />
<br />
The important mount options here are ''noauto,x-systemd.automount,_netdev''.<br />
<br />
* ''noauto'' tells it not to mount at boot<br />
* ''x-systemd.automount'' does the on-demand magic<br />
* ''_netdev'' tells it that it is a network device, not a block device (without it "No such device" errors might happen)<br />
<br />
{{Note|After editing {{ic|/etc/fstab}}, (re)start the required service: {{ic|systemctl daemon-reload && systemctl restart <target>}} where {{ic|<target>}} can be found by running {{ic|systemctl list-unit-files --type automount}} }}<br />
<br />
{{Tip|{{AUR|autosshfs-git}}{{Broken package link|package not found}} do not require editing {{ic|/etc/fstab}} to add a new mountpoint. Instead, regular users can create one by simply attempting to access it (with e. g. something like {{ic|ls ~/mnt/ssh/[user@]yourremotehost[:port]}}). {{AUR|autosshfs-git}}{{Broken package link|package not found}} uses AutoFS. Users need to be enabled to use it with {{ic|autosshfs-user}}.}}<br />
<br />
=== On boot ===<br />
<br />
An example on how to use sshfs to mount a remote filesystem through {{ic|/etc/fstab}}<br />
<br />
USERNAME@HOSTNAME_OR_IP:/REMOTE/DIRECTORY /LOCAL/MOUNTPOINT fuse.sshfs defaults,_netdev 0 0<br />
<br />
Take for example the ''fstab'' line<br />
<br />
llib@192.168.1.200:/home/llib/FAH /media/FAH2 fuse.sshfs defaults,_netdev 0 0<br />
<br />
The above will work automatically if you are using an SSH key for the user. See [[Using SSH Keys]].<br />
<br />
If you want to use sshfs with multiple users:<br />
<br />
user@domain.org:/home/user /media/user fuse.sshfs defaults,allow_other,_netdev 0 0<br />
<br />
Again, it is important to set the ''_netdev'' mount option to make sure the network is available before trying to mount.<br />
<br />
=== Secure user access ===<br />
<br />
When automounting via [[fstab]], the filesystem will generally be mounted by root. By default, this produces undesireable results if you wish access as an ordinary user and limit access to other users.<br />
<br />
An example mountpoint configuration:<br />
<br />
USERNAME@HOSTNAME_OR_IP:/REMOTE/DIRECTORY /LOCAL/MOUNTPOINT fuse.sshfs noauto,x-systemd.automount,_netdev,user,idmap=user,follow_symlinks,identityfile=/home/USERNAME/.ssh/id_rsa,allow_other,default_permissions,uid=USER_ID_N,gid=USER_GID_N 0 0<br />
<br />
Summary of the relevant options:<br />
<br />
* ''allow_other'' - Allow other users than the mounter (i.e. root) to access the share.<br />
* ''default_permissions'' - Allow kernel to check permissions, i.e. use the actual permissions on the remote filesystem. This allows prohibiting access to everybody otherwise granted by ''allow_other''.<br />
* ''uid'', ''gid'' - set reported ownership of files to given values; ''uid'' is the numeric user ID of your user, ''gid'' is the numeric group ID of your user.<br />
<br />
== Troubleshooting ==<br />
<br />
=== Checklist ===<br />
<br />
Read [[OpenSSH#Checklist]] first. Further issues to check are:<br />
<br />
1. Is your SSH login sending additional information from server's {{ic|/etc/issue}} file e.g.? This might confuse SSHFS. You should temporarily deactivate server's {{ic|/etc/issue}} file:<br />
<br />
$ mv /etc/issue /etc/issue.orig<br />
<br />
2. Keep in mind that most SSH related troubleshooting articles you will find on the web are '''not''' Systemd related. Often {{ic|/etc/fstab}} definitions wrongly begin with {{ic|''sshfs#''user@host:/mnt/server/folder ... fuse ...}} instead of using the syntax {{ic|user@host:/mnt/server/folder ... fuse.''sshfs'' ... ''x-systemd'', ...}}. <br />
<br />
3. Check that the owner of server's source folder and content is owned by the server's user. <br />
<br />
$ chown -R USER_S: /mnt/servers/folder<br />
<br />
4. The server's user ID can be different from the client's one. Obviously both user names have to be the same. You just have to care for the client's user IDs. SSHFS will translate the UID for you with the following mount options:<br />
<br />
uid=''USER_C_ID'',gid=''GROUP_C_ID''<br />
<br />
5. Check that the client's target mount point (folder) is owned by the client user. This folder should have the same user ID as defined in SSHFS's mount options.<br />
<br />
$ chown -R USER_C: /mnt/client/folder<br />
<br />
6. Check that the client's mount point (folder) is empty. By default you cannot mount SSHFS folders to non-empty folders.<br />
<br />
=== Connection reset by peer ===<br />
<br />
* If you are trying to access the remote system with a hostname, try using its IP address, as it can be a domain name solving issue. Make sure you edit {{ic|/etc/hosts}} with the server details.<br />
* If you are using non-default key names and are passing it as {{ic|-i .ssh/my_key}}, this will not work. You have to use {{ic|-o IdentityFile<nowiki>=</nowiki>/home/user/.ssh/my_key}}, with the full path to the key.<br />
* If your {{ic|/root/.ssh/config}} is a symlink, you will be getting this error as well. See [http://serverfault.com/questions/507748/bad-owner-or-permissions-on-root-ssh-config this serverfault topic]<br />
* Adding the option '{{ic|sshfs_debug}}' (as in '{{ic|sshfs -o sshfs_debug user@server ...}}') can help in resolving the issue.<br />
* If that doesn't reveal anything useful, you might also try adding the option '{{ic|debug}}'<br />
* If you are trying to sshfs into a router running DD-WRT or the like, there is a solution [http://www.dd-wrt.com/wiki/index.php/SFTP_with_DD-WRT here]. (note that the -osftp_server=/opt/libexec/sftp-server option can be used to the sshfs command in stead of patching dropbear)<br />
* If you see this only on boot, it may be that systemd is attempting to mount prior to a network connection being available. Enabling the 'wait-online' service appropriate to your network connection (eg. systemd-networkd-wait-online.service) fixes this.<br />
* Old Forum thread: [https://bbs.archlinux.org/viewtopic.php?id=27613 sshfs: Connection reset by peer]<br />
* Make sure your user can log into the server (especially when using AllowUsers)<br />
* Make sure {{ic|Subsystem sftp /usr/lib/ssh/sftp-server}} is enabled in {{ic|/etc/ssh/sshd_config}}.<br />
<br />
{{Note| When providing more than one option for sshfs, they must be comma separated. Like so: '{{ic|sshfs -o sshfs_debug,IdentityFile<nowiki>=</nowiki></path/to/key> user@server ...}}')}}<br />
<br />
=== Remote host has disconnected ===<br />
<br />
If you receive this message directly after attempting to use ''sshfs'':<br />
<br />
* First make sure that the '''remote''' machine has ''sftp'' installed! It will not work, if not.<br />
* Then, check that the path of the {{ic|Subsystem sftp}} in {{ic|/etc/ssh/sshd_config}} on the remote machine is valid.<br />
<br />
=== fstab mounting issues ===<br />
<br />
To get verbose debugging output, add the following to the mount options:<br />
<br />
ssh_command=ssh\040-vv,sshfs_debug,debug<br />
{{Note|Here, {{ic|\040}} represents a space which fstab uses to separate fields.}}<br />
<br />
To be able to run {{ic|mount -av}} and see the debug output, remove the following:<br />
noauto,x-systemd.automount<br />
<br />
== See also ==<br />
<br />
* [http://wiki.gilug.org/index.php/How_to_mount_SFTP_accesses How to mount chrooted SSH filesystem], with special care with owners and permissions questions.</div>Delapouitehttps://wiki.archlinux.org/index.php?title=Chroot&diff=587612Chroot2019-11-02T15:04:18Z<p>Delapouite: add link to swap</p>
<hr />
<div>{{Lowercase title}}<br />
[[Category:System recovery]]<br />
[[Category:Sandboxing]]<br />
[[Category:Commands]]<br />
[[es:Chroot]]<br />
[[fa:تغییر ریشه]]<br />
[[fr:Chroot]]<br />
[[ja:Chroot]]<br />
[[pt:Chroot]]<br />
[[ru:Chroot]]<br />
[[zh-hans:Chroot]]<br />
{{Related articles start}}<br />
{{Related|PRoot}}<br />
{{Related|Linux Containers}}<br />
{{Related|systemd-nspawn}}<br />
{{Related articles end}}<br />
A [[Wikipedia:Chroot|chroot]] is an operation that changes the apparent root directory for the current running process and their children. A program that is run in such a modified environment cannot access files and commands outside that environmental directory tree. This modified environment is called a ''chroot jail''.<br />
<br />
== Reasoning ==<br />
<br />
Changing root is commonly done for performing system maintenance on systems where booting and/or logging in is no longer possible. Common examples are:<br />
<br />
* Reinstalling the [[bootloader]].<br />
* Rebuilding the [[mkinitcpio|initramfs image]].<br />
* Upgrading or [[downgrading packages]].<br />
* Resetting a [[Password recovery|forgotten password]].<br />
* Building packages in a clean chroot, see [[DeveloperWiki:Building in a clean chroot]].<br />
<br />
See also [[Wikipedia:Chroot#Limitations]].<br />
<br />
== Requirements ==<br />
<br />
* Root privilege.<br />
* Another Linux environment, e.g. a LiveCD or USB flash media, or from another existing Linux distribution.<br />
* Matching architecture environments; i.e. the chroot from and chroot to. The architecture of the current environment can be discovered with: {{ic|uname -m}} (e.g. i686 or x86_64).<br />
* Kernel modules loaded that are needed in the chroot environment.<br />
* [[Swap]] enabled if needed: {{bc|# swapon /dev/sd''xY''}}<br />
* Internet connection established if needed.<br />
<br />
== Usage ==<br />
<br />
{{Note|<br />
* Some [[systemd]] tools such as ''hostnamectl'', ''localectl'' and ''timedatectl'' can not be used inside a chroot, as they require an active [[dbus]] connection. [https://github.com/systemd/systemd/issues/798#issuecomment-126568596]<br />
* The file system that will serve as the new root ({{ic|/}}) of your chroot must be accessible (i.e., decrypted, mounted).<br />
}}<br />
<br />
There are two main options for using chroot, described below.<br />
<br />
=== Using arch-chroot ===<br />
<br />
The bash script {{ic|arch-chroot}} is part of the {{Pkg|arch-install-scripts}} package. Before it runs {{ic|/usr/bin/chroot}}, the script mounts api filesystems like {{ic|/proc}} and makes {{ic|/etc/resolv.conf}} available from the chroot.<br />
<br />
==== Enter a chroot ====<br />
<br />
Run arch-chroot with the new root directory as first argument:<br />
<br />
# arch-chroot ''/location/of/new/root''<br />
<br />
For example, in the [[installation guide]] this directory would be {{ic|/mnt}}:<br />
<br />
# arch-chroot /mnt<br />
<br />
To exit the chroot simply use:<br />
<br />
# exit<br />
<br />
==== Run a single command and exit ====<br />
<br />
To run a command from the chroot, and exit again append the command to the end of the line:<br />
<br />
# arch-chroot ''/location/of/new/root'' ''mycommand''<br />
<br />
For example, to run {{ic|mkinitcpio -p linux}} for a chroot located at {{ic|/mnt/arch}} do:<br />
<br />
# arch-chroot /mnt/arch mkinitcpio -p linux<br />
<br />
=== Using chroot ===<br />
<br />
{{Warning|When using {{ic|--rbind}}, some subdirectories of {{ic|dev/}} and {{ic|sys/}} will not be unmountable. Attempting to unmount with {{ic|umount -l}} in this situation will break your session, requiring a reboot. If possible, use {{ic|-o bind}} instead.}}<br />
<br />
In the following example {{ic|''/location/of/new/root''}} is the directory where the new root resides.<br />
<br />
First, mount the temporary API filesystems:<br />
<br />
# cd ''/location/of/new/root''<br />
# mount -t proc /proc proc/<br />
# mount --rbind /sys sys/<br />
# mount --rbind /dev dev/<br />
<br />
And optionally:<br />
<br />
# mount --rbind /run run/<br />
<br />
Next, in order to use an internet connection in the chroot environment copy over the DNS details:<br />
<br />
# cp /etc/resolv.conf etc/resolv.conf<br />
<br />
Finally, to change root into {{ic|''/location/of/new/root''}} using a bash shell:<br />
<br />
# chroot ''/location/of/new/root'' /bin/bash<br />
<br />
{{Note|If you see the error:<br />
* {{ic|chroot: cannot run command '/usr/bin/bash': Exec format error}}, it is likely that the architectures of the host environment and chroot environment do not match.<br />
* {{ic|chroot: '/usr/bin/bash': permission denied}}, remount with the exec permission: {{ic|mount -o remount,exec ''/location/of/new/root''}}.<br />
}}<br />
<br />
After chrooting it may be necessary to load the local bash configuration:<br />
<br />
# source /etc/profile<br />
# source ~/.bashrc<br />
<br />
{{Tip|Optionally, create a unique prompt to be able to differentiate your chroot environment:<br />
{{bc|1=# export PS1="(chroot) $PS1"}}<br />
}}<br />
<br />
When finished with the chroot, you can exit it via:<br />
<br />
# exit<br />
<br />
Then unmount the temporary file systems:<br />
<br />
# cd /<br />
# umount --recursive ''/location/of/new/root''<br />
<br />
{{Note|If there is an error mentioning something like: {{ic|umount: /path: device is busy}} this usually means that either: a program (even a shell) was left running in the chroot or that a sub-mount still exists. Quit the program and use {{ic|findmnt -R ''/location/of/new/root''}} to find and then {{ic|umount}} sub-mounts. It may be tricky to {{ic|umount}} some things and one can hopefully have {{ic|umount --force}} work, as a last resort use {{ic|umount --lazy}} which just releases them. In either case to be safe, {{ic|reboot}} as soon as possible if these are unresolved to avoid possible future conflicts.}}<br />
<br />
== Run graphical applications from chroot ==<br />
<br />
If you have an [[X server]] running on your system, you can start graphical applications from the chroot environment.<br />
<br />
To allow the chroot environment to connect to an X server, open a virtual terminal inside the X server (i.e. inside the desktop of the user that is currently logged in), then run the [[xhost]] command, which gives permission to anyone to connect to the user's X server (see also [[Xhost]]):<br />
<br />
$ xhost +local:<br />
<br />
Then, to direct the applications to the X server from chroot, set the DISPLAY environment variable inside the chroot to match the DISPLAY variable of the user that owns the X server. So for example, run <br />
<br />
$ echo $DISPLAY<br />
<br />
as the user that owns the X server to see the value of DISPLAY. If the value is ":0" (for example), then in the chroot environment run<br />
<br />
# export DISPLAY=:0<br />
<br />
== Without root privileges ==<br />
<br />
Chroot requires root privileges, which may not be desirable or possible for the user to obtain in certain situations. There are, however, various ways to simulate chroot-like behavior using alternative implementations.<br />
<br />
=== PRoot ===<br />
<br />
[[PRoot]] may be used to change the apparent root directory and use {{ic|mount --bind}} without root privileges. This is useful for confining applications to a single directory or running programs built for a different CPU architecture, but it has limitations due to the fact that all files are owned by the user on the host system. PRoot provides a {{ic|--root-id}} argument that can be used as a workaround for some of these limitations in a similar (albeit more limited) manner to ''fakeroot''.<br />
<br />
=== Fakechroot ===<br />
<br />
{{Pkg|fakechroot}} is a library shim which intercepts the chroot call and fakes the results. It can be used in conjunction with {{Pkg|fakeroot}} to simulate a chroot as a regular user. <br />
<br />
# fakechroot fakeroot chroot ~/my-chroot bash<br />
<br />
== See also ==<br />
<br />
* [https://help.ubuntu.com/community/BasicChroot Basic Chroot]</div>Delapouitehttps://wiki.archlinux.org/index.php?title=Partitioning&diff=587080Partitioning2019-10-23T18:58:20Z<p>Delapouite: add link to wikipedia NVM_Express page</p>
<hr />
<div>[[Category:File systems]]<br />
[[Category:Boot process]]<br />
[[Category:System recovery]]<br />
[[ar:Partitioning]]<br />
[[es:Partitioning]]<br />
[[fa:پارتیشن بندی]]<br />
[[hu:Partitioning]]<br />
[[it:Partitioning]]<br />
[[ja:パーティショニング]]<br />
[[pl:Partitioning]]<br />
[[ru:Partitioning]]<br />
[[tr:Partitioning]]<br />
[[zh-hans:Partitioning]]<br />
{{Related articles start}}<br />
{{Related|File systems}}<br />
{{Related|fdisk}}<br />
{{Related|gdisk}}<br />
{{Related|parted}}<br />
{{Related|fstab}}<br />
{{Related|LVM}}<br />
{{Related|Swap}}<br />
{{Related|Arch boot process}}<br />
{{Related|Unified Extensible Firmware Interface}}<br />
{{Related articles end}}<br />
[[Wikipedia:Disk partitioning|Partitioning]] a hard drive divides the available space into sections that can be accessed independently. An entire drive may be allocated to a single partition, or multiple ones for cases such as dual-booting, maintaining a [[swap]] partition, or to logically separate data such as audio and video files.<br />
<br />
The required information is stored in a [[#Partition table|partition table]] scheme such as MBR or GPT.<br />
<br />
Partition tables are created and modified using one of many partitioning tools which must be compatible to the chosen scheme of partitioning table. Available tools are listed in the [[#Partitioning tools]] section.<br />
<br />
Once created, a partition must be formatted with an appropriate [[file system]] before files can be written to it.<br />
<br />
== Partition table ==<br />
<br />
{{Tip|To print/list existing tables (of a specific device), run {{ic|parted ''/dev/sda'' print}} or {{ic|fdisk -l ''/dev/sda''}}, where {{ic|''/dev/sda''}} is a [[block device]] name.}}<br />
<br />
There are two main types of partition table available. These are described below in the [[#Master Boot Record]] (MBR) and [[#GUID Partition Table]] (GPT) sections along with a discussion on how to choose between the two. A third, less common alternative is using a partitionless disk, which is also discussed.<br />
<br />
=== Master Boot Record ===<br />
<br />
The [[Wikipedia:Master boot record|Master Boot Record]] (MBR) is the first 512 bytes of a storage device. It contains an operating system bootloader and the storage device's partition table. It plays an important role in the [[boot process]] under [[Wikipedia:BIOS|BIOS]] systems. See [[Wikipedia:Master boot record#Disk partitioning]] for the MBR structure.<br />
<br />
{{Note|<br />
* The MBR is not located in a partition; it is located at the first sector of the device (physical offset 0), preceding the first partition.<br />
* The boot sector present on a partitionless device or within an individual partition is called a [[Wikipedia:Volume boot record|volume boot record (VBR)]] instead.<br />
}}<br />
<br />
==== Master Boot Record (bootstrap code) ====<br />
<br />
The first 440 bytes of MBR are the '''bootstrap code area'''. On BIOS systems it usually contains the first stage of the boot loader. The bootstrap code can be backed up, restored from backup or erased [[dd#Backup and restore MBR|using dd]].<br />
<br />
==== Master Boot Record (partition table) ====<br />
<br />
In the MBR partition table (also known as DOS or MS-DOS partition table) there are 3 types of partitions:<br />
<br />
* Primary<br />
* Extended<br />
** Logical<br />
<br />
'''Primary''' partitions can be bootable and are limited to four partitions per disk or RAID volume. If the MBR partition table requires more than four partitions, then one of the primary partitions needs to be replaced by an '''extended''' partition containing '''logical''' partitions within it. <br />
<br />
Extended partitions can be thought of as containers for logical partitions. A hard disk can contain no more than one extended partition. The extended partition is also counted as a primary partition so if the disk has an extended partition, only three additional primary partitions are possible (i.e. three primary partitions and one extended partition). The number of logical partitions residing in an extended partition is unlimited. A system that dual boots with Windows will require for Windows to reside in a primary partition.<br />
<br />
The customary numbering scheme is to create primary partitions ''sda1'' through ''sda3'' followed by an extended partition ''sda4''. The logical partitions on ''sda4'' are numbered ''sda5'', ''sda6'', etc.<br />
<br />
{{Tip|When partitioning a MBR disk consider leaving at least 33 512-byte sectors (16.5 KiB) of free unpartitioned space at the end of the disk in case you ever decide to [[gdisk#Convert between MBR and GPT|convert it to GPT]]. The space will be required for the backup GPT header.}}<br />
<br />
=== GUID Partition Table ===<br />
<br />
[[Wikipedia:GUID Partition Table|GUID Partition Table]] (GPT) is a partitioning scheme that is part of the [[Unified Extensible Firmware Interface]] specification; it uses [[Wikipedia:Globally unique identifier|globally unique identifiers]] (GUIDs), or UUIDs in the Linux world, to define partitions and [[Wikipedia:GUID Partition Table#Partition type GUIDs|partition types]]. It is designed to succeed the [[#Master Boot Record|Master Boot Record]] partitioning scheme method.<br />
<br />
At the start of a GUID Partition Table disk there is a [[Wikipedia:GUID Partition Table#Protective MBR (LBA 0)|protective Master Boot Record]] (PMBR) to protect against GPT-unaware software. This protective MBR just like an ordinary MBR has a [[#Master Boot Record (bootstrap code)|bootstrap code area]] which can be used for BIOS/GPT booting with boot loaders that support it.<br />
<br />
=== Choosing between GPT and MBR ===<br />
<br />
GUID Partition Table (GPT) is an alternative, contemporary, partitioning style; it is intended to replace the old Master Boot Record (MBR) system. GPT has several advantages over MBR which has quirks dating back to MS-DOS times. With the recent developments to the formatting tools, it is equally easy to get good dependability and performance for GPT or MBR. <br />
<br />
{{Note|For GRUB to boot from a GPT-partitioned disk on a BIOS-based system, a [[BIOS boot partition]] is required.}}<br />
<br />
Some points to consider when choosing: <br />
<br />
* To dual-boot with Windows (both 32-bit and 64-bit) using Legacy BIOS, the MBR scheme is required.<br />
* To dual-boot Windows 64-bit using [[UEFI]] mode instead of BIOS, the GPT scheme is required.<br />
* If you are installing on older hardware, especially on old laptops, consider choosing MBR because its BIOS might not support GPT (but [[#Tricking old BIOS into booting from GPT|see below]] how to fix it).<br />
* If you are partitioning a disk of 2 TiB or larger, you need to use GPT.<br />
* It is recommended to always use GPT for [[UEFI]] boot, as some UEFI implementations do not support booting to the MBR while in UEFI mode.<br />
* If none of the above apply, choose freely between GPT and MBR. Since GPT is more modern, it is recommended in this case.<br />
<br />
Some advantages of GPT over MBR are:<br />
<br />
* Provides a unique disk GUID and unique partition GUID ([[PARTUUID]]) for each partition - A good filesystem-independent way of referencing partitions and disks.<br />
* Provides a filesystem-independent partition name ([[PARTLABEL]]).<br />
* Arbitrary number of partitions - depends on space allocated for the partition table - No need for extended and logical partitions. By default the GPT table contains space for defining 128 partitions. However if you want to define more partitions, you can allocate more space to the partition table (currently only ''gdisk'' is known to support this feature).<br />
* Uses 64-bit LBA for storing Sector numbers - maximum addressable disk size is 2 ZiB. MBR is limited to addressing 2 TiB of space per drive.<br />
* Stores a backup header and partition table at the end of the disk that aids in [[gdisk#Recover GPT header|recovery]] in case the primary ones are damaged.<br />
* CRC32 checksums to detect errors and corruption of the header and partition table.<br />
<br />
The section on [[#Partitioning tools]] contains a table indicating which tools are available for creating and modifying GPT and MBR tables.<br />
<br />
{{Tip|It is possible to convert between MBR and GPT. See [[gdisk#Convert between MBR and GPT]].}}<br />
<br />
=== Partitionless disk ===<br />
<br />
{{Expansion|Explain when one might want to use a partitionless disk (e.g. in VMs) and when not and why.}}<br />
<br />
Partitionless disk a.k.a. [https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/windows-and-gpt-faq#what-is-a-superfloppy superfloppy] refers to a storage device without a partition table, having one file system occupying the whole storage device. The boot sector present on a partitionless device is called a [[Wikipedia:Volume boot record|volume boot record (VBR)]].<br />
<br />
==== Btrfs partitioning ====<br />
<br />
[[Btrfs]] can occupy an entire data storage device and replace the [[#Master Boot Record|MBR]] or [[#GUID Partition Table|GPT]] partitioning schemes. See the [[Btrfs#Partitionless Btrfs disk]] instructions for details.<br />
<br />
=== Backup ===<br />
<br />
See [[fdisk#Backup and restore partition table]] or [[gdisk#Backup and restore partition table]].<br />
<br />
=== Recover ===<br />
<br />
{{Style|The available software could be better presented, e.g. in a list, table, etc.}}<br />
<br />
It may be possible to recover a destroyed MBR partition table with {{Pkg|gpart}}. See {{man|8|gpart}} for instructions.<br />
<br />
For GPT it is possible to restore the primary GPT header (located at the start of the disk) from the secondary GPT header (located at the end of the disk) or vice versa. See [[gdisk#Recover GPT header]].<br />
<br />
Another option is [[File recovery#Testdisk and PhotoRec|TestDisk]], which supports recovering lost partitions on both MBR and GPT.<br />
<br />
== Partition scheme ==<br />
<br />
There are no strict rules for partitioning a hard drive, although one may follow the general guidance given below. A disk partitioning scheme is determined by various issues such as desired flexibility, speed, security, as well as the limitations imposed by available disk space. It is essentially personal preference. If you would like to dual boot Arch Linux and a Windows operating system please see [[Dual boot with Windows]].<br />
<br />
{{Note|<br />
* [[UEFI]] systems require an [[EFI system partition]].<br />
* BIOS systems that are partitioned with [[#GUID Partition Table|GPT]] require a [[BIOS boot partition]] if [[GRUB]] is used as the bootloader.<br />
}}<br />
<br />
{{Tip|If using [[Btrfs]], subvolumes can be used to imitate partitions. See the [[Btrfs#Mounting subvolumes]] section.}}<br />
<br />
=== Single root partition ===<br />
<br />
This scheme is the simplest and should be enough for most use cases. A [[swapfile]] can be created and easily resized as needed. It usually makes sense to start by considering a single {{ic|/}} partition and then separate out others based on specific use cases like RAID, encryption, a shared media partition, etc.<br />
<br />
=== Discrete partitions ===<br />
<br />
Separating out a path as a partition allows for the choice of a different filesystem and mount options. In some cases like a media partition, they can also be shared between operating systems.<br />
<br />
Below are some example layouts that can be used when partitioning, and the following subsections detail a few of the directories which can be placed on their own separate partition and then [[mount]]ed at mount points under {{ic|/}}. See {{man|7|file-hierarchy}} for a full description of the contents of these directories.<br />
<br />
==== / ====<br />
<br />
The root directory is the top of the hierarchy, the point where the primary filesystem is mounted and from which all other filesystems stem. All files and directories appear under the root directory {{ic|/}}, even if they are stored on different physical devices. The contents of the root filesystem must be adequate to boot, restore, recover, and/or repair the system. Therefore, certain directories under {{ic|/}} are not candidates for separate partitions.<br />
<br />
The {{ic|/}} partition or root partition is necessary and it is the most important. The other partitions can be replaced by it.<br />
<br />
{{Warning|Directories essential for booting (except for {{ic|/boot}}) '''must''' be on the same partition as {{ic|/}} or mounted in early userspace by the [[initramfs]]. These essential directories are: {{ic|/etc}} and {{ic|/usr}} [https://freedesktop.org/wiki/Software/systemd/separate-usr-is-broken].}}<br />
<br />
{{ic|/}} traditionally contains the {{ic|/usr}} directory, which can grow significantly depending upon how much software is installed. 15–20 GiB should be sufficient for most users with modern hard disks. If you plan to store a swap file here, you might need a larger partition size.<br />
<br />
==== /boot ====<br />
<br />
The {{ic|/boot}} directory contains the kernel and ramdisk images as well as the bootloader configuration file and bootloader stages. It also stores data that is used before the kernel begins executing user-space programs. {{ic|/boot}} is not required for normal system operation, but only during boot and kernel upgrades (when regenerating the initial ramdisk).<br />
<br />
{{Expansion|If {{ic|/boot}} is inside anything more complex than just a file system on a partition (e.g. LUKS, RAID, LVM), the boot loader needs drivers for those layers too.|Talk:EFI system partition#Preffered mount point for LVM users}}<br />
<br />
{{Note|<br />
* A separate {{ic|/boot}} partition is only needed if your [[boot loader]] cannot access your root filesystem. For example, if the boot loader does not have a filesystem driver for it, or if {{ic|/}} is on software [[RAID]], a [[dm-crypt|encrypted volume]] or a [[LVM]] volume.<br />
* If booting using an UEFI [[boot loader]] that does not have drivers for other file systems it is recommended to mount the [[EFI system partition]] to {{ic|/boot}}. See [[EFI system partition#Mount the partition]] for more information.<br />
}}<br />
<br />
A suggested size for {{ic|/boot}} is 200 MiB unless you are using [[EFI system partition]] as {{ic|/boot}}, in which case at least 260 MiB is recommended.<br />
<br />
==== /home ====<br />
<br />
The {{ic|/home}} directory contains user-specific configuration files, caches, application data and media files.<br />
<br />
Separating out {{ic|/home}} allows {{ic|/}} to be re-partitioned separately, but note that you can still reinstall Arch with {{ic|/home}} untouched even if it is not separate—the other top-level directories just need to be removed, and then pacstrap can be run.<br />
<br />
You should not share home directories between users on different distributions, because they use incompatible software versions and patches. Instead, consider sharing a media partition or at least using different home directories on the same {{ic|/home}} partition. The size of this partition varies.<br />
<br />
==== /var ====<br />
<br />
The {{ic|/var}} directory stores variable data such as spool directories and files, administrative and logging data, [[pacman]]'s cache, etc. It is used, for example, for caching and logging, and hence frequently read or written. Keeping it in a separate partition avoids running out of disk space due to flunky logs, etc.<br />
<br />
It exists to make it possible to mount {{ic|/usr}} as read-only. Everything that historically went into {{ic|/usr}} that is written to during system operation (as opposed to installation and software maintenance) must reside under {{ic|/var}}.<br />
<br />
{{Note|{{ic|/var}} contains many small files. The choice of file system type should consider this fact if a separate partition is used.}}<br />
<br />
{{ic|/var}} will contain, among other data, the [[pacman]] cache. Retaining these packages is helpful in case a package upgrade causes instability, requiring a [[downgrade]] to an older, archived package. The pacman cache will grow as the system is expanded and updated, but it can be safely cleared if space becomes an issue. 8–12 GiB on a desktop system should be sufficient for {{ic|/var}}, depending on how much software will be installed.<br />
<br />
==== /data ====<br />
<br />
One can consider mounting a "data" partition to cover various files to be shared by all users. Using the {{ic|/home}} partition for this purpose is fine as well. The size of this partition varies.<br />
<br />
==== Swap ====<br />
<br />
A [[swap]] partition provides memory that can be used as virtual RAM. A [[swap file]] should be considered too, as they do not have any performance overhead compared to a partition but are much easier to resize as needed. A swap partition can ''potentially'' be shared between operating systems, but not if hibernation is used.<br />
<br />
Historically, the general rule for swap partition size was to allocate twice the amount of physical RAM. As computers have gained ever larger memory capacities, this rule is outdated. For example, on average desktop machines with up to 512 MiB RAM, the 2× rule is usually adequate; if a sufficient amount of RAM (more than 1024 MiB) is available, it may be possible to have a smaller swap partition.<br />
<br />
To use hibernation (a.k.a suspend to disk) it is advised to create the swap partition at the size of RAM. Although the kernel will try to compress the suspend-to-disk image to fit the swap space there is no guarantee it will succeed if the used swap space is significantly smaller than RAM. See [[Power management/Suspend and hibernate#Hibernation]] for more information.<br />
<br />
=== Example layouts ===<br />
<br />
{{Expansion|Improve current examples.|section=Table draft 2}}<br />
<br />
The following examples use {{ic|/dev/sda}} as the example disk with {{ic|/dev/sda1}} as the first partition. The block device naming scheme will differ if you are partitioning a [[Wikipedia:NVM_Express|NVMe]] disk (e.g. {{ic|/dev/nvme0n1}} with partitions starting from {{ic|/dev/nvme0n1p1}}) or an SD card or eMMC disk (e.g. {{ic|/dev/mmcblk0}} with partitions starting from {{ic|/dev/mmcblk0p1}}). See [[Device file#Block device names]] for more information.<br />
<br />
{{Note|UEFI booting does not involve any "boot" flag, booting relies solely on the boot entries in NVRAM. [[Parted]] and its front-ends use a "boot" flag on GPT to indicate that a partition is an EFI system partition.}}<br />
<br />
==== UEFI/GPT example layout ====<br />
<br />
{| class="wikitable"<br />
! Mount point on the installed system<br />
! Partition<br />
! [[Wikipedia:GUID Partition Table#Partition type GUIDs|Partition type GUID]]<br />
! [[Wikipedia:GUID Partition Table#Partition entries (LBA 2–33)|Partition attributes]]<br />
! Suggested size<br />
|-<br />
| {{ic|/boot}} or {{ic|/efi}}<br />
| {{ic|/dev/sda1}}<br />
| {{ic|C12A7328-F81F-11D2-BA4B-00A0C93EC93B}}: [[EFI system partition]]<br />
|<br />
| 260 MiB<br />
|-<br />
| {{ic|/}}<br />
| {{ic|/dev/sda2}}<br />
| {{ic|4F68BCE3-E8CD-4DB1-96E7-FBCAF984B709}}: Linux x86-64 root (/)<br />
|<br />
| 23–32 GiB<br />
|-<br />
| {{ic|[SWAP]}}<br />
| {{ic|/dev/sda3}}<br />
| {{ic|0657FD6D-A4AB-43C4-84E5-0933C84B4F4F}}: Linux [[swap]]<br />
|<br />
| More than 512 MiB<br />
|-<br />
| {{ic|/home}}<br />
| {{ic|/dev/sda4}}<br />
| {{ic|933AC7E1-2EB4-4F13-B844-0E14E2AEF915}}: Linux /home<br />
|<br />
| Remainder of the device<br />
|}<br />
<br />
==== BIOS/MBR example layout ====<br />
<br />
{| class="wikitable"<br />
! Mount point on the installed system<br />
! Partition<br />
! [[Wikipedia:Partition type|Partition type ID]]<br />
! [[Wikipedia:Boot flag|Boot flag]]<br />
! Suggested size<br />
|-<br />
| {{ic|/}}<br />
| {{ic|/dev/sda1}}<br />
| {{ic|83}}: Linux<br />
| {{Yes}}<br />
| 23–32 GiB<br />
|-<br />
| {{ic|[SWAP]}}<br />
| {{ic|/dev/sda2}}<br />
| {{ic|82}}: Linux [[swap]]<br />
| {{No}}<br />
| More than 512 MiB<br />
|-<br />
| {{ic|/home}}<br />
| {{ic|/dev/sda3}}<br />
| {{ic|83}}: Linux<br />
| {{No}}<br />
| Remainder of the device<br />
|}<br />
<br />
==== BIOS/GPT example layout ====<br />
<br />
{| class="wikitable"<br />
! Mount point on the installed system<br />
! Partition<br />
! [[Wikipedia:GUID Partition Table#Partition type GUIDs|Partition type GUID]]<br />
! [[Wikipedia:GUID Partition Table#Partition entries (LBA 2–33)|Partition attributes]]<br />
! Suggested size<br />
|-<br />
| {{Grey|None}}<br />
| {{ic|/dev/sda1}}<br />
| {{ic|21686148-6449-6E6F-744E-656564454649}}: [[BIOS boot partition]]<sup>1</sup><br />
|<br />
| 1 MiB<br />
|-<br />
| {{ic|/}}<br />
| {{ic|/dev/sda2}}<br />
| {{ic|4F68BCE3-E8CD-4DB1-96E7-FBCAF984B709}}: Linux x86-64 root (/)<br />
| {{ic|2}}: Legacy BIOS bootable<br />
| 23–32 GiB<br />
|-<br />
| {{ic|[SWAP]}}<br />
| {{ic|/dev/sda3}}<br />
| {{ic|0657FD6D-A4AB-43C4-84E5-0933C84B4F4F}}: Linux [[swap]]<br />
|<br />
| More than 512 MiB<br />
|-<br />
| {{ic|/home}}<br />
| {{ic|/dev/sda4}}<br />
| {{ic|933AC7E1-2EB4-4F13-B844-0E14E2AEF915}}: Linux /home<br />
|<br />
| Remainder of the device<br />
|}<br />
<br />
# A BIOS boot partition is only required when using [[GRUB]] for BIOS booting from a GPT disk. The partition has nothing to do with {{ic|/boot}}, and it must not be formatted with a file system or mounted.<br />
<br />
== Partitioning tools ==<br />
<br />
The following programs are used to create and/or manipulate device partition tables and partitions. See the linked articles for the exact commands to be used.<br />
<br />
This table will help you to choose utility for your needs:<br />
<br />
{| class="wikitable"<br />
!<br />
! MBR<br />
! GPT<br />
|-<br />
! Dialog<br />
| fdisk <br> parted<br />
| fdisk <br> gdisk <br> parted<br />
|-<br />
! Pseudo-graphics<br />
| cfdisk<br />
| cfdisk <br> cgdisk<br />
|-<br />
! Non-interactive<br />
| sfdisk <br> parted<br />
| sfdisk <br> sgdisk <br> parted<br />
|-<br />
! Graphical<br />
| GParted <br> gnome-disk-utility <br> partitionmanager<br />
| GParted <br> gnome-disk-utility <br> partitionmanager<br />
|}<br />
<br />
{{Warning|To partition devices, use a partitioning tool compatible to the chosen type of partition table. Incompatible tools may result in the destruction of that table, along with existing partitions or data.}}<br />
<br />
=== fdisk ===<br />
<br />
''fdisk'' and its related utilities are described in the [[fdisk]] article.<br />
<br />
* [[fdisk]] ({{Pkg|util-linux}})<br />
** {{man|8|fdisk}} – Dialog-driven program for creation and manipulation of partition tables.<br />
** {{man|8|cfdisk}} – [[Wikipedia:curses (programming library)|Curses]]-based variant of fdisk.<br />
** {{man|8|sfdisk}} – Scriptable variant of fdisk.<br />
<br />
=== GPT fdisk ===<br />
<br />
''gdisk'' and its related utilities are described in the [[gdisk]] article.<br />
<br />
* [[GPT fdisk]] ({{Pkg|gptfdisk}})<br />
** {{man|8|gdisk}} – Interactive [[#GUID Partition Table|GUID partition table (GPT)]] manipulator.<br />
** {{man|8|cgdisk}} – Curses-based variant of gdisk.<br />
** {{man|8|sgdisk}} – Scriptable variant of gdisk.<br />
<br />
=== GNU Parted ===<br />
<br />
These group of tools are described in the [[GNU Parted]] article.<br />
<br />
*{{App|[[GNU Parted]]|Terminal partitioning tool.|https://www.gnu.org/software/parted/parted.html|{{pkg|parted}}}}<br />
*{{App|GNOME Disks|Disk management utility for GNOME.|https://wiki.gnome.org/Apps/Disks|{{Pkg|gnome-disk-utility}}}}<br />
*{{App|[[GParted]]|GTK partition editor for graphically managing your disk partitions.|https://gparted.sourceforge.io/|{{Pkg|gparted}}}}<br />
*{{App|KDE Partition Manager|Utility program for KDE to manage the disk devices, partitions and file systems.|https://www.kde.org/applications/system/kdepartitionmanager/|{{Pkg|partitionmanager}}}}<br />
<br />
== Partition alignment ==<br />
<br />
[[fdisk]], [[gdisk]] and [[parted#Alignment|parted]] handle alignment automatically. See [[GNU Parted#Check alignment]] if you want to verify your alignment after partitioning.<br />
<br />
For certain drives [[Advanced Format]] might be able to provide a better-performing alignment.<br />
<br />
== GPT kernel support ==<br />
<br />
The {{ic|CONFIG_EFI_PARTITION}} option in the kernel config enables GPT support in the kernel (despite the name, EFI PARTITION). This option must be built in the kernel and not compiled as a loadable module. This option is required even if GPT disks are used only for data storage and not for booting. This option is enabled by default in all Arch's [[Kernels#Officially supported kernels|officially supported kernels]]. In case of a custom kernel, enable this option by doing {{ic|1=CONFIG_EFI_PARTITION=y}}.<br />
<br />
== Tricking old BIOS into booting from GPT ==<br />
<br />
{{Expansion|Who cares if the specification prohibits it, there is no reason to overcomplicate things, just mark the {{ic|0xEE}} partition as bootable. Both fdisk and parted can do it.}}<br />
<br />
Some old BIOSes (from before year 2010) attempt to parse the boot sector and refuse to boot it if it does not contain a bootable MBR partition. This is a problem if one wants to use GPT on this disk, because, from the BIOS viewpoint, it contains only one, non-bootable, MBR partition of type {{ic|ee}} (i.e., the protective MBR partition). One can mark the protective MBR entry as bootable using {{ic|fdisk -t mbr /dev/sda}}, and it will work on some BIOSes. However, the UEFI specification prohibits the protective MBR partition entry from being bootable, and UEFI-based boards do care about this, even in the legacy boot mode. So, this matters if one wants to create a GPT-based USB flash drive that is supposed to boot both on modern UEFI-based boards and also on old BIOSes that insist on finding a bootable MBR partition. It is not possible to solve this problem using traditional tools such as [[fdisk]] or [[gdisk]], but it is possible to create a fake MBR partition entry suitable for both kinds of BIOSes manually as a sequence of bytes.<br />
<br />
The command below will overwrite the second MBR partition slot and add a bootable partition there of type 0 (i.e. unused), covering only the first sector of the device. It will not interfere with the GPT or with the first MBR partition entry which normally contains a protective MBR partition.<br />
<br />
# printf '\200\0\0\0\0\0\0\0\0\0\0\0\001\0\0\0' | dd of=/dev/sda bs=1 seek=462<br />
<br />
The end result will look like this:<br />
<br />
{{hc|1=# fdisk -t mbr -l /dev/sda|2=Disk /dev/sda: 232.9 GiB, 250059350016 bytes, 488397168 sectors<br />
Disk model: ST3250820AS <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 />
Disklabel type: dos<br />
Disk identifier: 0x00000000<br />
<br />
Device Boot Start End Sectors Size Id Type<br />
/dev/sda1 1 488397167 488397167 232.9G ee GPT<br />
/dev/sda2 * 0 0 1 512B 0 Empty<br />
<br />
Partition table entries are not in disk order.<br />
}}<br />
<br />
== See also ==<br />
<br />
* [[Wikipedia:Disk partitioning]]<br />
* [[Wikipedia:Binary prefix]]<br />
* [https://thestarman.pcministry.com/asm/mbr/DiskTerms.htm Understanding Disk Drive Terminology]<br />
* [https://kb.iu.edu/d/aijw What is a Master Boot Record (MBR)?]<br />
* Rod Smith's page on [https://www.rodsbooks.com/gdisk/whatsgpt.html What's a GPT?] and [https://rodsbooks.com/gdisk/booting.html Booting OSes from GPT]<br />
* [https://www.ibm.com/developerworks/linux/library/l-gpt/index.html?ca=dgr-lnxw07GPT-Storagedth-lx&S_TACT=105AGY83&S_CMP=grlnxw07 Make the most of large drives with GPT and Linux - IBM Developer Works]<br />
* [https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/windows-and-gpt-faq Microsoft's Windows and GPT FAQ]<br />
* [https://www.thomas-krenn.com/en/wiki/Partition_Alignment Partition Alignment] (with examples)</div>Delapouitehttps://wiki.archlinux.org/index.php?title=XDG_Base_Directory&diff=584594XDG Base Directory2019-10-07T06:08:29Z<p>Delapouite: add Kakoune to the list of supported applications</p>
<hr />
<div>[[Category:Freedesktop.org]]<br />
[[Category:Configuration files]]<br />
[[Category:Development]]<br />
[[ja:XDG Base Directory サポート]]<br />
{{Related articles start}}<br />
{{Related|dotfiles}}<br />
{{Related|XDG user directories}}<br />
{{Related articles end}}<br />
<br />
This article summarizes the [https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html XDG Base Directory specification] in [[#Specification]] and tracks software support in [[#Support]].<br />
<br />
== Specification ==<br />
<br />
Please read the [https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html full specification]. This section will attempt to break down the essence of what it tries to achieve.<br />
<br />
Only {{ic|XDG_RUNTIME_DIR}} is set by default through [https://www.freedesktop.org/software/systemd/man/pam_systemd.html pam_systemd]. It is up to the user to explicitly [[define]] the other variables according to the specification.<br />
<br />
=== User directories ===<br />
<br />
* {{ic|XDG_CONFIG_HOME}}<br />
** Where user-specific configurations should be written (analogous to {{ic|/etc}}).<br />
** Should default to {{ic|$HOME/.config}}.<br />
<br />
* {{ic|XDG_CACHE_HOME}}<br />
** Where user-specific non-essential (cached) data should be written (analogous to {{ic|/var/cache}}).<br />
** Should default to {{ic|$HOME/.cache}}.<br />
<br />
* {{ic|XDG_DATA_HOME}}<br />
** Where user-specific data files should be written (analogous to {{ic|/usr/share}}).<br />
** Should default to {{ic|$HOME/.local/share}}.<br />
<br />
* {{ic|XDG_RUNTIME_DIR}}<br />
** Used for non-essential, user-specific data files such as sockets, named pipes, etc.<br />
** Not required to have a default value; warnings should be issued if not set or equivalents provided.<br />
** Must be owned by the user with an access mode of {{ic|0700}}.<br />
** Filesystem fully featured by standards of OS.<br />
** Must be on the local filesystem.<br />
** May be subject to periodic cleanup.<br />
** Modified every 6 hours or set sticky bit if persistence is desired.<br />
** Can only exist for the duration of the user's login.<br />
** Should not store large files as it may be mounted as a tmpfs.<br />
<br />
=== System directories ===<br />
<br />
* {{ic|XDG_DATA_DIRS}}<br />
** List of directories seperated by {{ic|:}} (analogous to {{ic|PATH}}).<br />
** Should default to {{ic|/usr/local/share:/usr/share}}.<br />
<br />
* {{ic|XDG_CONFIG_DIRS}}<br />
** List of directories seperated by {{ic|:}} (analogous to {{ic|PATH}}).<br />
** Should default to {{ic|/etc/xdg}}.<br />
<br />
== Support ==<br />
<br />
This section exists to catalog the growing set of software using the [https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html XDG Base Directory Specification] introduced in 2003. This is here to demonstrate the viability of this specification by listing commonly found dotfiles and their support status. For those not currently supporting the Base Directory Specification, workarounds will be demonstrated to emulate it instead.<br />
<br />
The workarounds will be limited to anything not involving patching the source, executing code stored in [[environment variables]] or compile-time options. The rationale for this is that configurations should be portable across systems and having compile-time options prevent that.<br />
<br />
Hopefully this will provide a source of information about exactly what certain kinds of dotfiles are and where they come from.<br />
<br />
=== Contributing ===<br />
<br />
When contributing make sure to use the correct section.<br />
<br />
Nothing should require code evaluation (such as [[vim]] and {{ic|VIMINIT}}), patches or compile-time options to gain support and anything which does must be deemed hardcoded. Additionally if the process is too error prone or difficult, such as [https://www.haskell.org/cabal/ Haskell's cabal] or Eclipse, they should also be considered as hardcoded.<br />
<br />
* The first column should be either a link to an internal article, a [[Template:Pkg]] or a [[Template:AUR]].<br />
* The second column is for any legacy files and directories the project had (one per line), this is done so people can find them even if they are no longer read.<br />
* In the third, try to find the commit or version a project switched to XDG Base Directory or any open discussions and include them in the next two columns (two per line).<br />
* The last column should include any appropriate workarounds or solutions. Please verify that your solution is correct and functional.<br />
<br />
=== Supported ===<br />
<br />
{| class="wikitable sortable" style="width: 100%"<br />
! Application<br />
! Legacy Path<br />
! Supported Since<br />
! Discussion<br />
! Notes<br />
|-<br />
| {{AUR|aerc-git}}<br />
|<br />
|<br />
|<br />
|<br />
|-<br />
| {{AUR|antimicro}}<br />
| {{ic|~/.antimicro}}<br />
| [https://github.com/Antimicro/antimicro/commit/edba864 edba864]<br />
| [https://github.com/Antimicro/antimicro/issues/5]<br />
|<br />
|-<br />
| [[aria2]]<br />
| {{ic|~/.aria2}}<br />
| [https://github.com/tatsuhiro-t/aria2/commit/8bc1d37 8bc1d37]<br />
| [https://github.com/tatsuhiro-t/aria2/issues/27]<br />
|<br />
|-<br />
| {{Pkg|asunder}}<br />
|<br />
{{ic|~/.asunder<br><br />
~/.asunder_album_artist<br><br />
~/.asunder_album_genre<br><br />
~/.asunder_album_title}}<br />
| [https://littlesvr.ca/bugs/show_bug.cgi?id=31 2.9.0]<br />
| [https://littlesvr.ca/bugs/show_bug.cgi?id=52]<br />
| Uses {{ic|XDG_CONFIG_HOME/asunder/asunder}} for {{ic|~/.asunder}} and {{ic|XDG_CACHE_HOME/asunder/asunder_album_...}} for the other 3 files. Legacy paths are not removed after migration, they have to be deleted manually.<br />
|-<br />
| {{Pkg|binwalk}}<br />
| {{ic|~/.binwalk}}<br />
| [https://github.com/ReFirmLabs/binwalk/commit/2051757 2051757]<br />
| [https://github.com/ReFirmLabs/binwalk/issues/216]<br />
| {{ic|$XDG_CONFIG_HOME/binwalk}}<br><br />
Supported only in Git master branch, there's no updated stable release yet. <br />
|-<br />
| [[Blender]]<br />
| {{ic|~/.blender}}<br />
| [http://git.blender.org/gitweb/gitweb.cgi/blender.git/commit/4293f47 4293f47]<br />
| [https://developer.blender.org/T28943]<br />
|<br />
|-<br />
| {{Pkg|calibre}}<br />
|<br />
|<br />
|<br />
|<br />
|-<br />
| [[Chromium]]<br />
| {{ic|~/.chromium}}<br />
| [https://src.chromium.org/viewvc/chrome?revision=23057&view=revision 23057]<br />
|<br />
[https://groups.google.com/forum/#!topic/chromium-dev/QekVQxF3nho]<br />
[https://code.google.com/p/chromium/issues/detail?id=16976]<br />
|<br />
|-<br />
| {{AUR|citra-git}}<br />
| {{ic|~/.citra-emu}}<br />
| [https://github.com/citra-emu/citra/commit/f7c3193 f7c3193]<br />
| [https://github.com/citra-emu/citra/pull/575]<br />
|<br />
|-<br />
| [[Composer]]<br />
| {{ic|~/.composer}}<br />
| [https://github.com/composer/composer/releases/tag/1.0.0-beta1 1.0.0-beta1]<br />
| [https://github.com/composer/composer/pull/1407]<br />
|<br />
|-<br />
| {{Pkg|d-feet}}<br />
| {{ic|~/.d-feet}}<br />
| [https://gitlab.gnome.org/GNOME/d-feet/commit/7f6104b 7f6104b]<br />
|<br />
|<br />
|-<br />
| {{Pkg|dconf}}<br />
|<br />
|<br />
|<br />
|<br />
|-<br />
| [[Dolphin emulator]]<br />
| {{ic|~/.dolphin-emu}}<br />
| [https://github.com/dolphin-emu/dolphin/commit/a498c68 a498c68]<br />
| [https://github.com/dolphin-emu/dolphin/pull/2304]<br />
|<br />
|-<br />
| {{AUR|dr14_tmeter}}<br />
| <br />
| [https://github.com/simon-r/dr14_t.meter/commit/7e777ca 7e777ca]<br />
| [https://github.com/simon-r/dr14_t.meter/pull/30]<br />
| {{ic|XDG_CONFIG_HOME/dr14tmeter/}}<br />
|-<br />
| {{Pkg|dunst}}<br />
|<br />
| [https://github.com/knopwob/dunst/commit/78b6e2b 78b6e2b]<br />
| [https://github.com/knopwob/dunst/issues/22]<br />
|<br />
|-<br />
| [[dwb]]<br />
|<br />
|<br />
|<br />
|<br />
|-<br />
| {{Pkg|elixir}}<br />
| {{ic|~/.mix}}<br />
| [https://github.com/elixir-lang/elixir/commit/afaf889 afaf889]<br />
| [https://github.com/elixir-lang/elixir/issues/8818]<br />
|<br />
|-<br />
| [[fish]]<br />
|<br />
|<br />
|<br />
|<br />
|-<br />
| [[fontconfig]]<br />
|<br />
{{ic|~/.fontconfig<br><br />
~/.fonts}}<br />
| [https://cgit.freedesktop.org/fontconfig/commit/?id=8c255fb 8c255fb]<br />
|<br />
| Use {{ic|"$XDG_DATA_HOME"/fonts}} to store fonts instead.<br />
|-<br />
| {{Pkg|fontforge}}<br />
|<br />
{{ic|~/.FontForge<br><br />
~/.PfaEdit}}<br />
| [https://github.com/fontforge/fontforge/commit/e4c2cc7 e4c2cc7]<br />
|<br />
[https://github.com/fontforge/fontforge/issues/847]<br />
[https://github.com/fontforge/fontforge/issues/991]<br />
|<br />
|-<br />
| {{Pkg|freerdp}}<br />
| {{ic|~/.freerdp}}<br />
| [https://github.com/FreeRDP/FreeRDP/commit/edf6e72 edf6e72]<br />
|<br />
|<br />
|-<br />
| [[Gajim]]<br />
| {{ic|~/.gajim}}<br />
| [https://dev.gajim.org/gajim/gajim/commit/3e777ea 3e777ea]<br />
| [https://dev.gajim.org/gajim/gajim/issues/2149]<br />
|<br />
|-<br />
| {{Pkg|gconf}}<br />
| {{ic|~/.gconf}}<br />
| [https://gitlab.gnome.org/Archive/gconf/commit/fc28caa fc28caa]<br />
| [https://bugzilla.gnome.org/show_bug.cgi?id=674803]<br />
|<br />
|-<br />
| [[GIMP]]<br />
|<br />
{{ic|~/.gimp-x.y<br><br />
~/.thumbnails}}<br />
|<br />
[https://gitlab.gnome.org/GNOME/gimp/commit/60e0cfe 60e0cfe]<br />
[https://gitlab.gnome.org/GNOME/gimp/commit/483505f 483505f]<br />
|<br />
[https://bugzilla.gnome.org/show_bug.cgi?id=166643]<br />
[https://bugzilla.gnome.org/show_bug.cgi?id=646644]<br />
|<br />
|-<br />
| [[Git]]<br />
| {{ic|~/.gitconfig}}<br />
| [https://github.com/git/git/commit/0d94427 0d94427]<br />
|<br />
|<br />
|-<br />
| [[GStreamer]]<br />
| {{ic|~/.gstreamer-0.10}}<br />
| [https://cgit.freedesktop.org/gstreamer/gstreamer/commit/?id=4e36f93 4e36f93]<br />
| [https://bugzilla.gnome.org/show_bug.cgi?id=518597]<br />
|<br />
|-<br />
| [[GTK]] 3<br />
|<br />
|<br />
|<br />
|<br />
|-<br />
| {{Pkg|htop}}<br />
| {{ic|~/.htoprc}}<br />
| [https://github.com/hishamhm/htop/commit/93233a6 93233a6]<br />
|<br />
|<br />
|-<br />
| [[i3]]<br />
| {{ic|~/.i3}}<br />
| [http://code.stapelberg.de/git/i3/commit/?id=7c130fb 7c130fb]<br />
|<br />
|<br />
|-<br />
| {{Pkg|i3status}}<br />
| {{ic|~/.i3status.conf}}<br />
| [http://code.stapelberg.de/git/i3status/commit/?id=c3f7fc4 c3f7fc4]<br />
|<br />
|<br />
|-<br />
| {{Pkg|imagemagick}}<br />
|<br />
|<br />
|<br />
|<br />
|-<br />
| [[Inkscape]]<br />
| {{ic|~/.inkscape}}<br />
| [http://wiki.inkscape.org/wiki/index.php/Release_notes/0.47#Preferences 0.47]<br />
| [https://bugs.launchpad.net/inkscape/+bug/199720]<br />
|<br />
|-<br />
| [[Kakoune]]<br />
|<br />
|<br />
|<br />
|<br />
|-<br />
| latexmk (in {{Pkg|texlive-core}})<br />
| {{ic|~/.latexmkrc}}<br />
|<br />
|<br />
|<br />
|-<br />
| {{Pkg|lftp}}<br />
| {{ic|~/.lftp}}<br />
| [https://github.com/lavv17/lftp/commit/21dc400 21dc400]<br />
| [https://www.mail-archive.com/lftp@uniyar.ac.ru/msg04301.html]<br />
|<br />
|-<br />
| {{AUR|lgogdownloader}}<br />
| {{ic|~/.gogdownloader}}<br />
| [https://github.com/Sude-/lgogdownloader/commit/d430af6 d430af6]<br />
| [https://github.com/Sude-/lgogdownloader/issues/4]<br />
|<br />
|-<br />
| [[LibreOffice]]<br />
|<br />
|<br />
[https://cgit.freedesktop.org/libreoffice/ure/commit/?id=a6f56f7 a6f56f7]<br />
[https://cgit.freedesktop.org/libreoffice/bootstrap/commit/?id=25bd2ee 25bd2ee]<br />
| [https://bugs.documentfoundation.org/show_bug.cgi?id=32263]<br />
|<br />
|-<br />
| [[Streamlink]]<br />
| {{ic|~/.livestreamerrc}}<br />
| [https://github.com/chrippa/livestreamer/commit/ea80591 ea80591]<br />
| [https://github.com/chrippa/livestreamer/pull/106]<br />
|<br />
|-<br />
| [[llpp]]<br />
|<br />
| [http://repo.or.cz/w/llpp.git/commit/3ab86f0 3ab86f0]<br />
|<br />
| Currently llpp places the configuration directly under {{ic|XDG_CONFIG_HOME}} instead of creating a directory.<br />
|-<br />
| [[mc]]<br />
| {{ic|~/.mc}}<br />
|<br />
[https://github.com/MidnightCommander/mc/commit/1b99570 1b99570]<br />
[https://github.com/MidnightCommander/mc/commit/0b71156 0b71156]<br />
[https://github.com/MidnightCommander/mc/commit/ce401d7 ce401d7]<br />
| [https://www.midnight-commander.org/ticket/1851]<br />
|<br />
|-<br />
| [[Mercurial]]<br />
| {{ic|~/.hgrc}}<br />
|<br />
[https://www.mercurial-scm.org/repo/hg/rev/3540200 3540200]<br />
[https://www.mercurial-scm.org/wiki/Release4.2 4.2]<br />
|<br />
| {{ic|XDG_CONFIG_HOME/hg/hgrc}}.<br />
|-<br />
| [[msmtp]]<br />
| {{ic|~/.msmtprc}}<br />
|<br />
[https://github.com/marlam/msmtp-mirror/commit/af2f409 af2f409]<br />
v1.6.7+<br />
|<br />
| {{ic| $XDG_CONFIG_HOME"/msmtp/config}}.<br />
|-<br />
| {{Pkg|mesa}}<br />
|<br />
| [https://cgit.freedesktop.org/mesa/mesa/commit/?id=87ab26b 87ab26b]<br />
|<br />
| {{ic|XDG_CACHE_HOME/mesa}}<br />
|-<br />
| {{Pkg|milkytracker}}<br />
| {{ic|~/.milkytracker_config}}<br />
| [https://github.com/Deltafire/MilkyTracker/commit/eb487c5 eb487c5]<br />
| [https://github.com/Deltafire/MilkyTracker/issues/12]<br />
|<br />
|-<br />
| [[mpd]]<br />
| {{ic|~/.mpdconf}}<br />
| [https://github.com/MusicPlayerDaemon/MPD/commit/87b7328 87b7328]<br />
|<br />
|<br />
|-<br />
| [[mpv]]<br />
| {{ic|~/.mpv}}<br />
| [https://github.com/mpv-player/mpv/commit/cb250d4 cb250d4]<br />
| [https://github.com/mpv-player/mpv/pull/864]<br />
|<br />
|-<br />
| [[mutt]]<br />
| {{ic|~/.mutt}}<br />
| [https://gitlab.com/muttmua/mutt/commit/b17cd67 b17cd67]<br />
| [https://gitlab.com/muttmua/trac-tickets/raw/master/tickets/closed/3207-Conform_to_XDG_Base_Directory_Specification.txt]<br />
|<br />
|-<br />
| {{Pkg|mypaint}}<br />
| {{ic|~/.mypaint}}<br />
| [https://github.com/mypaint/mypaint/commit/cf723b7 cf723b7]<br />
|<br />
|<br />
|-<br />
| [[nano]]<br />
|<br />
{{ic|~/.nano/<br><br />
~/.nanorc}}<br />
| [http://git.savannah.gnu.org/cgit/nano.git/commit/?id=c16e79b c16e79b]<br />
| [https://savannah.gnu.org/patch/?8523]<br />
|<br />
|-<br />
| [[ncmpcpp]]<br />
| {{ic|~/.ncmpcpp}}<br />
|<br />
[https://github.com/arybczak/ncmpcpp/commit/38d9f81 38d9f81]<br />
[https://github.com/arybczak/ncmpcpp/commit/27cd86e 27cd86e]<br />
|<br />
[https://github.com/arybczak/ncmpcpp/issues/79]<br />
[https://github.com/arybczak/ncmpcpp/issues/110]<br />
| {{ic|ncmpcpp_directory}} should be set to avoid an {{ic|error.log}} file in {{ic|~/.ncmpcpp}}.<br />
|-<br />
| [[Neovim]]<br />
|<br />
{{ic|~/.nvim<br><br />
~/.nvimlog<br><br />
~/.nviminfo}}<br />
| [https://github.com/neovim/neovim/commit/1ca5646 1ca5646]<br />
|<br />
[https://github.com/neovim/neovim/issues/78]<br />
[https://github.com/neovim/neovim/pull/3198]<br />
|<br />
|-<br />
| [[newsbeuter]]<br />
| {{ic|~/.newsbeuter}}<br />
| [https://github.com/akrennmair/newsbeuter/commit/3c57824 3c57824]<br />
| [https://github.com/akrennmair/newsbeuter/pull/39]<br />
| It is required to create both directories [http://newsbeuter.org/doc/newsbeuter.html#_xdg_base_directory_support]:<br />
<br />
{{ic|1=$ mkdir -p "$XDG_DATA_HOME"/newsbeuter "$XDG_CONFIG_HOME"/newsbeuter}}<br />
|-<br />
| [https://github.com/nodejs/node-gyp node-gyp]<br />
| {{ic|~/.node-gyp}}<br />
| [https://github.com/nodejs/node-gyp/commit/2b5ce52a 2b5ce52a]<br />
| [https://github.com/nodejs/node-gyp/pull/1570]<br />
| Only available on master as of 2018-12-04.<br />
|-<br />
| {{AUR|np2kai-git}}<br />
|<br />
{{ic|~/.config/np2kai<br><br />
~/.config/xnp2kai}}<br />
| [https://github.com/AZO234/NP2kai/commit/56a1cc2 56a1cc2]<br />
| [https://github.com/AZO234/NP2kai/pull/50]<br />
|<br />
|-<br />
| {{AUR|nteract-bin}}<br />
|<br />
| [https://github.com/nteract/nteract/commit/4593e72 4593e72]<br />
| [https://github.com/nteract/nteract/issues/180] [https://github.com/nteract/nteract/pull/3870]<br />
| [https://github.com/nteract/nteract/issues/4517 does not recognize workarounds for ipython/jupyter]<br />
|-<br />
| [[OfflineIMAP]]<br />
| {{ic|~/.offlineimaprc}}<br />
| [https://github.com/OfflineIMAP/offlineimap/commit/5150de5 5150de5]<br />
| [https://github.com/OfflineIMAP/offlineimap/issues/32]<br />
|<br />
|-<br />
| {{AUR|opentyrian}}<br />
| {{ic|~/.opentyrian}}<br />
| [https://bitbucket.org/opentyrian/opentyrian/commits/8d45ff2 8d45ff2]<br />
| [https://web.archive.org/web/20140815181350/http://code.google.com/p/opentyrian/issues/detail?id=125]<br />
|<br />
|-<br />
| {{Pkg|pandoc}}<br />
| {{ic|~/.pandoc/}}<br />
| [https://github.com/jgm/pandoc/commit/0bed0ab5a308f5e72a01fa9bee76488556288862 0bed0ab]<br />
| [https://github.com/jgm/pandoc/issues/3582]<br />
|<br />
|-<br />
| {{Pkg|pcsx2}}<br />
| {{ic|~/.pcsx2}}<br />
|<br />
[https://github.com/PCSX2/pcsx2/commit/87f1e8f 87f1e8f]<br />
[https://github.com/PCSX2/pcsx2/commit/a9020c6 a9020c6]<br />
[https://github.com/PCSX2/pcsx2/commit/3b22f0f 3b22f0f]<br />
[https://github.com/PCSX2/pcsx2/commit/0a012ae 0a012ae]<br />
| [https://github.com/PCSX2/pcsx2/issues/352] [https://github.com/PCSX2/pcsx2/issues/381]<br />
|<br />
|-<br />
| [http://pryrepl.org/ Pry]<br />
| {{ic|~/.pryrc<br>~/.pry_history}}<br />
|<br />
[https://github.com/pry/pry/commit/a0be0cc7b2070edff61c0c7f10fa37fce9b730bd a0be0cc7]<br />
[https://github.com/pry/pry/commit/15e1fc929ed84c161abc5afc9be73488a41df397 15e1fc92]<br />
[https://github.com/pry/pry/commit/e9d1be0e17b294318dbb2f70f74a50486cfa044c e9d1be0e]<br />
| [https://github.com/pry/pry/issues/1316]<br />
|<br />
|-<br />
| {{Pkg|python-pip}}<br />
| {{ic|~/.pip}}<br />
| [https://github.com/pypa/pip/blob/548a9136525815dff41acd845c558a0b36eb1c5f/NEWS.rst#60-2014-12-22 6.0]<br />
| [https://github.com/pypa/pip/issues/1733]<br />
|<br />
|-<br />
| {{AUR|powershell}}<br />
|<br />
| [https://docs.microsoft.com/en-us/powershell/scripting/whats-new/what-s-new-in-powershell-core-60#filesystem 6.0]<br />
|<br />
|<br />
|-<br />
| {{Pkg|ppsspp}}<br />
| {{ic|~/.ppsspp}}<br />
| [https://github.com/hrydgard/ppsspp/commit/132fe47 132fe47]<br />
| [https://github.com/hrydgard/ppsspp/issues/4623]<br />
|<br />
|-<br />
| {{Pkg|procps-ng}}<br />
| {{ic|~/.toprc}}<br />
| [https://gitlab.com/procps-ng/procps/commit/af53e17 af53e17]<br />
|<br />
[https://gitlab.com/procps-ng/procps/merge_requests/38]<br />
[https://bugzilla.redhat.com/show_bug.cgi?id=1155265]<br />
|<br />
|-<br />
| {{AUR|orbment-git}}<br />
|<br />
|<br />
|<br />
|<br />
|-<br />
| [[pacman]]<br />
| {{ic|~/.makepkg.conf}}<br />
| [https://projects.archlinux.org/pacman.git/commit/?id=80eca94 80eca94]<br />
| [https://mailman.archlinux.org/pipermail/pacman-dev/2014-July/019178.html]<br />
|<br />
|-<br />
| {{AUR|panda3d}}<br />
| {{ic|~/.panda3d}}<br />
| [https://github.com/panda3d/panda3d/commit/2b537d2 2b537d2]<br />
|<br />
|<br />
|-<br />
| [[PulseAudio]]<br />
|<br />
{{ic|~/.pulse<br><br />
~/.pulse-cookie}}<br />
|<br />
[https://cgit.freedesktop.org/pulseaudio/pulseaudio/commit/?id=59a8618 59a8618]<br />
[https://cgit.freedesktop.org/pulseaudio/pulseaudio/commit/?id=87ae830 87ae830]<br />
[https://cgit.freedesktop.org/pulseaudio/pulseaudio/commit/?id=9ab510a 9ab510a]<br />
[https://cgit.freedesktop.org/pulseaudio/pulseaudio/commit/?id=4c195bc 4c195bc]<br />
| [https://bugzilla.redhat.com/show_bug.cgi?id=845607]<br />
|<br />
|-<br />
| {{AUR|pyroom}}<br />
|<br />
|<br />
|<br />
|<br />
|-<br />
| {{Pkg|quodlibet}}<br />
| {{ic|~/.quodlibet}}<br />
| 3.10.0<br />
| [https://github.com/quodlibet/quodlibet/issues/138]<br />
|<br />
|-<br />
| [[qutebrowser]]<br />
|<br />
|<br />
|<br />
|<br />
|-<br />
| [[qtile]]<br />
|<br />
|<br />
[https://github.com/qtile/qtile/commit/fd8686e fd8686e]<br />
[https://github.com/qtile/qtile/commit/66d704b 66d704b]<br />
[https://github.com/qtile/qtile/commit/51cff01 51cff01]<br />
| [https://github.com/qtile/qtile/pull/835]<br />
| Some optional bar widgets can create files and directories in non-compliant paths, but most often these are still configurable.<br />
|-<br />
| {{Pkg|rclone}}<br />
| {{ic|~/.rclone.conf}}<br />
| [https://github.com/ncw/rclone/commit/9d36258 9d36258]<br />
| [https://github.com/ncw/rclone/issues/868]<br />
|<br />
|-<br />
| {{Pkg|retroarch}}<br />
|<br />
|<br />
|<br />
|<br />
|-<br />
| {{AUR|rr}}<br />
| {{ic|~/.rr}}<br />
| [https://github.com/mozilla/rr/commit/02e7d41 02e7d41]<br />
| [https://github.com/mozilla/rr/issues/1455]<br />
|<br />
|-<br />
| [https://rspec.info RSpec]<br />
| {{ic|~/.rspec}}<br />
| [https://github.com/rspec/rspec-core/commit/5e395e2016f1da19475e6db2817eb26dae828c4c 5e395e2]<br />
| [https://github.com/rspec/rspec-core/issues/1773]<br />
|<br />
|-<br />
| [[rTorrent]]<br />
| {{ic|~/.rtorrent.rc}}<br />
| [https://github.com/rakshasa/rtorrent/commit/6a8d332 6a8d332]<br />
|<br />
|<br />
|-<br />
| [https://www.rubocop.org RuboCop]<br />
| {{ic|~/.rubocop.yml}}<br />
| [https://github.com/rubocop-hq/rubocop/commit/6fe5956c177ca369cfaa70bdf748b70020a56bf4 6fe5956]<br />
| [https://github.com/rubocop-hq/rubocop/issues/6662]<br />
|<br />
|-<br />
| {{AUR|skypeforlinux-stable-bin}}<br />
| {{ic|~/.Skype}}<br />
| 8.0<br />
|<br />
|<br />
|-<br />
| {{Pkg|snes9x}}<br />
| {{ic|~/.snes9x}}<br />
| [https://github.com/snes9xgit/snes9x/commit/93b5f11 93b5f11]<br />
| [https://github.com/snes9xgit/snes9x/issues/194]<br />
| By default, the configuration file is left blank with intention that the user will fill it at their will (through the gui or manually).<br />
|-<br />
| {{AUR|sublime-text-dev}}<br />
|<br />
|<br />
|<br />
| Cache is placed in {{ic|$XDG_CONFIG_HOME/sublime-text-3/Cache}} instead of expected {{ic|$XDG_CACHE_HOME/sublime-text-3}}.<br />
|-<br />
| [[surfraw]]<br />
|<br />
{{ic|~/.surfraw.conf<br><br />
~/.surfraw.bookmarks}}<br />
|<br />
[https://gitlab.com/surfraw/Surfraw/commit/3e4591d 3e4591d]<br />
[https://gitlab.com/surfraw/Surfraw/commit/bd8c427 bd8c427]<br />
[https://gitlab.com/surfraw/Surfraw/commit/f57fc71 f57fc71]<br />
|<br />
|<br />
|-<br />
| [[sway]]<br />
| {{ic|~/.sway/config}}<br />
| [https://github.com/SirCmpwn/sway/commit/614393c 614393c]<br />
| [https://github.com/SirCmpwn/sway/issues/5]<br />
|<br />
|-<br />
| [[systemd]]<br />
|<br />
|<br />
|<br />
|<br />
|-<br />
| [[termite]]<br />
|<br />
|<br />
|<br />
|<br />
|-<br />
| {{Pkg|tig}}<br />
| {{ic|~/.tigrc}}, {{ic|~/.tig_history}}<br />
| [https://github.com/jonas/tig/blob/master/NEWS.adoc#tig-22 2.2]<br />
| [https://github.com/jonas/tig/issues/513]<br />
| {{ic|~/.local/share/tig}} directory must exist, writes to {{ic|~/.tig_history}} otherwise.<br />
|-<br />
| {{AUR|tmuxinator}}<br />
| {{ic|~/.tmuxinator}}<br />
| [https://github.com/tmuxinator/tmuxinator/pull/511/commits/2636923 2636923]<br />
| [https://github.com/tmuxinator/tmuxinator/pull/511]<br />
|<br />
|-<br />
| [[Transmission]]<br />
| {{ic|~/.transmission}}<br />
| [https://github.com/transmission/transmission/commit/b71a298 b71a298]<br />
|<br />
|<br />
|-<br />
| {{Pkg|util-linux}}<br />
|<br />
| [https://git.kernel.org/pub/scm/utils/util-linux/util-linux.git/commit/?id=570b321 570b321]<br />
|<br />
|<br />
|-<br />
| [[Uzbl]]<br />
|<br />
| [https://github.com/uzbl/uzbl/commit/c6fd63a c6fd63a]<br />
| [https://github.com/uzbl/uzbl/pull/150]<br />
|<br />
|-<br />
| {{Pkg|vimb}}<br />
|<br />
|<br />
|<br />
|<br />
|-<br />
| [[VirtualBox]]<br />
| {{ic|~/.VirtualBox}}<br />
| [https://www.virtualbox.org/ticket/5099?action=diff&version=7 4.3]<br />
| [https://www.virtualbox.org/ticket/5099]<br />
|<br />
|-<br />
| {{Pkg|vis}}<br />
| {{ic|~/.vis}}<br />
|<br />
[https://github.com/martanne/vis/commit/68a25c7 68a25c7]<br />
[https://github.com/martanne/vis/commit/d138908 d138908]<br />
| [https://github.com/martanne/vis/pull/303]<br />
|<br />
|-<br />
| [[VLC]]<br />
| {{ic|~/.vlcrc}}<br />
| [http://git.videolan.org/?p=vlc.git;a=commit;h=16f32e1 16f32e1]<br />
| [https://trac.videolan.org/vlc/ticket/1267]<br />
|<br />
|-<br />
| [[Visual Studio Code]]<br />
|<br />
|<br />
|<br />
| Note that extension directory is not moving; see [https://github.com/Microsoft/vscode/issues/3884].<br />
|-<br />
| {{Pkg|warsow}}<br />
| {{ic|~/.warsow-2.x}}<br />
| [https://github.com/Qfusion/qfusion/commit/98ece3f 98ece3f]<br />
| [https://github.com/Qfusion/qfusion/issues/298]<br />
|<br />
|-<br />
| [[Wireshark]]<br />
| {{ic|~/.wireshark}}<br />
| [https://code.wireshark.org/review/gitweb?p=wireshark.git;a=commit;h=b0b53fa b0b53fa]<br />
|<br />
|<br />
|-<br />
| {{AUR|xsettingsd-git}}<br />
| {{ic|~/.xsettingsd}}<br />
| [https://github.com/derat/xsettingsd/commit/b4999f5 b4999f5]<br />
|<br />
|<br />
|-<br />
| [[xmonad]]<br />
| {{ic|~/.xmonad}}<br />
| [https://github.com/xmonad/xmonad/commit/40fc10b 40fc10b]<br />
|<br />
[https://github.com/xmonad/xmonad/issues/61]<br />
[https://code.google.com/p/xmonad/issues/detail?id=484]<br />
| Alternatively the environments {{ic|XMONAD_CONFIG_HOME}}, {{ic|XMONAD_DATA_HOME}}, and {{ic|XMONAD_CACHE_HOME}} are also available.<br />
|-<br />
| {{Pkg|xsel}}<br />
| {{ic|~/.xsel.log}}<br />
| [https://github.com/kfish/xsel/commit/ee7b481 ee7b481]<br />
| [https://github.com/kfish/xsel/issues/10]<br />
|<br />
|-<br />
| {{Pkg|yarn}}<br />
|<br />
{{ic|~/.yarnrc<br><br />
~/.yarn/<br><br />
~/.yarncache/<br><br />
~/.yarn-config/}}<br />
| [https://github.com/yarnpkg/yarn/commit/2d454b5 2d454b5]<br />
| [https://github.com/yarnpkg/yarn/pull/5336]<br />
|<br />
|}<br />
<br />
=== Partial ===<br />
{| class="wikitable sortable" style="width: 100%"<br />
! Application<br />
! Legacy Path<br />
! Supported Since<br />
! Discussion<br />
! Notes<br />
|-<br />
| {{Pkg|abook}}<br />
| {{ic|~/.abook}}<br />
|<br />
|<br />
| {{ic|1=$ abook --config "$XDG_CONFIG_HOME"/abook/abookrc --datafile "$XDG_CACHE_HOME"/abook/addressbook}}<br />
|-<br />
| {{Pkg|ack}}<br />
| {{ic|~/.ackrc}}<br />
|<br />
| [https://github.com/beyondgrep/ack2/issues/516]<br />
| {{ic|1=$ export ACKRC="$XDG_CONFIG_HOME/ack/ackrc"}}<br />
|-<br />
| [[Anki]]<br />
|<br />
{{ic|~/Anki<br><br />
~/Documents/Anki}}<br />
|<br />
| [https://github.com/dae/anki/pull/49] [https://github.com/dae/anki/pull/58]<br />
| {{ic|1=$ anki -b "$XDG_DATA_HOME"/Anki}}<br />
|-<br />
| [[aspell]]<br />
| {{ic|~/.aspell.conf}}<br />
|<br />
|<br />
| {{ic|1=$ export ASPELL_CONF="per-conf $XDG_CONFIG_HOME/aspell/aspell.conf; personal $XDG_CONFIG_HOME/aspell/en.pws; repl $XDG_CONFIG_HOME/aspell/en.prepl"}}<br />
|-<br />
| [[Atom]]<br />
| {{ic|~/.atom}}<br />
|<br />
| [https://github.com/atom/atom/issues/8281]<br />
| {{ic|1=$ export ATOM_HOME="$XDG_DATA_HOME"/atom}}<br />
|-<br />
| {{Pkg|aws-cli}}<br />
| {{ic|~/.aws}}<br />
| [https://github.com/aws/aws-cli/commit/fc5961ea2cc0b5976ac9f777e20e4236fd7540f5 1.7.45]<br />
| [https://github.com/aws/aws-cli/issues/2433]<br />
|<br />
{{ic|1=$ export AWS_SHARED_CREDENTIALS_FILE="$XDG_CONFIG_HOME"/aws/credentials<br><br />
$ export AWS_CONFIG_FILE="$XDG_CONFIG_HOME"/aws/config}}<br />
|-<br />
| {{Pkg|bash-completion}}<br />
| {{ic|~/.bash_completion}}<br />
|<br />
| <br />
| {{ic|1=$ export BASH_COMPLETION_USER_FILE="$XDG_CONFIG_HOME"/bash-completion/bash_completion}}<br />
|-<br />
| [[bazaar]]<br />
|<br />
{{ic|~/.bazaar<br><br />
~/.bzr.log}}<br />
| [https://bugs.launchpad.net/bzr/+bug/195397/comments/15 2.3.0]<br />
| [https://bugs.launchpad.net/bzr/+bug/195397]<br />
| Discussion in upstream bug states that bazaar wil use {{ic|~/.config/bazaar}} if it exists. The logfile {{ic|~/.bzr.log}} might still be written.<br />
|-<br />
| {{Aur|buchhaltung-git}}<br />
|<br />
{{ic|~/.buchhaltung}}<br />
| <br />
| [https://github.com/johannesgerer/buchhaltung/issues/44]<br />
| {{ic|1=$ export BUCHHALTUNG="$XDG_CONFIG_HOME"/buchhaltung}}<br />
|-<br />
| [[Ruby#Bundler]]<br />
| {{ic|~/.bundle}}<br />
|<br />
| [https://github.com/bundler/bundler/pull/6024] [https://github.com/bundler/bundler/issues/4333]<br />
| {{ic|1=$ export BUNDLE_USER_CONFIG="$XDG_CONFIG_HOME"/bundle BUNDLE_USER_CACHE="$XDG_CACHE_HOME"/bundle BUNDLE_USER_PLUGIN="$XDG_DATA_HOME"/bundle}}<br />
|-<br />
| {{Pkg|calcurse}}<br />
| {{ic|~/.calcurse}}<br />
|<br />
|<br />
| {{ic|1=$ calcurse -C "$XDG_CONFIG_HOME"/calcurse -D "$XDG_DATA_HOME"/calcurse}}<br />
|-<br />
| [[Rust#Cargo]]<br />
| {{ic|~/.cargo}}<br />
|<br />
| [https://github.com/rust-lang/cargo/issues/1734] [https://github.com/rust-lang/rfcs/pull/1615] [https://github.com/rust-lang/cargo/pull/5183] [https://github.com/rust-lang/cargo/pull/148]<br />
| {{ic|1=$ export CARGO_HOME="$XDG_DATA_HOME"/cargo}}<br />
|-<br />
| [[ccache]]<br />
| {{ic|~/.ccache}}<br />
|<br />
|<br />
| {{ic|1=$ export CCACHE_CONFIGPATH="$XDG_CONFIG_HOME"/ccache.config}}<br><br />
{{ic|1=$ export CCACHE_DIR="$XDG_CACHE_HOME"/ccache}}<br />
|-<br />
| {{AUR|chez-scheme}}<br />
| {{ic|~/.chezscheme_history}}<br />
|<br />
|<br />
| {{ic|1=$ petite --eehistory "$XDG_DATA_HOME"/chezscheme/history}}<br />
|-<br />
| [[conky]]<br />
| {{ic|~/.conkyrc}}<br />
| [https://github.com/brndnmtthws/conky/commit/00481ee9a97025e8e2acd7303d080af1948f7980 00481ee]<br />
| [https://github.com/brndnmtthws/conky/issues/144]<br />
| {{ic|1=$ conky --config="$XDG_CONFIG_HOME"/conky/conkyrc}}<br />
|-<br />
| [[coreutils]]<br />
| {{ic|~/.dircolors}}<br />
|<br />
|<br />
| {{ic|1=$ source $(dircolors "$XDG_CONFIG_HOME"/dircolors)}}<br />
|-<br />
| [http://www.dungeoncrawl.org/ crawl]<br />
| {{ic|~/.crawl}}<br />
|<br />
|<br />
| The trailing slash is required:<br />
<br />
{{ic|1=$ export CRAWL_DIR="$XDG_DATA_HOME"/crawl/}}<br />
|-<br />
| [[CUDA]]<br />
| {{ic|~/.nv}}<br />
|<br />
|<br />
| {{ic|1=$ export CUDA_CACHE_PATH="$XDG_CACHE_HOME"/nv}}<br />
|-<br />
| [[dict]]<br />
| {{ic|~/.dictrc}}<br />
|<br />
|<br />
| {{ic|1=$ dict -c "$XDG_CONFIG_HOME"/dict/dictrc}}<br />
|-<br />
| [[Docker]]<br />
| {{ic|~/.docker}}<br />
|<br />
|<br />
| {{ic|1=$ export DOCKER_CONFIG="$XDG_CONFIG_HOME"/docker}}<br />
|-<br />
| {{Pkg|docker-machine}}<br />
| {{ic|~/.docker/machine}}<br />
|<br />
|<br />
| {{ic|1=$ export MACHINE_STORAGE_PATH="$XDG_DATA_HOME"/docker-machine}}<br />
|-<br />
| [[DOSBox]]<br />
| {{ic|~/.dosbox/dosbox-0.74-2.conf}}<br />
|<br />
| [https://www.vogons.org/viewtopic.php?t=29599]<br />
| {{ic|1=$ dosbox -conf "$XDG_CONFIG_HOME"/dosbox/dosbox.conf}}<br />
|-<br />
| [[ELinks]]<br />
| {{ic|~/.elinks}}<br />
|<br />
|<br />
| {{ic|1=$ export ELINKS_CONFDIR="$XDG_CONFIG_HOME"/elinks}}<br />
|-<br />
| {{Pkg|emscripten}}<br />
|<br />
{{ic|~/.emscripten<br><br />
~/.emscripten_sanity<br><br />
~/.emscripten_ports<br><br />
~/.emscripten_cache__last_clear}}<br />
|<br />
| [https://github.com/kripken/emscripten/issues/3624]<br />
|<br />
{{ic|1=$ export EM_CONFIG="$XDG_CONFIG_HOME"/emscripten/config<br><br />
$ export EM_CACHE="$XDG_CACHE_HOME"/emscripten/cache<br><br />
$ export EM_PORTS="$XDG_DATA_HOME"/emscripten/cache<br><br />
$ emcc --em-config "$XDG_CONFIG_HOME"/emscripten/config --em-cache "$XDG_CACHE_HOME"/emscripten/cache}}<br />
|-<br />
| {{AUR|freecad}}<br />
| {{ic|~/.FreeCAD}}<br />
|<br />
| [https://www.freecadweb.org/tracker/view.php?id=2956]<br />
| {{ic|1=$ freecad -u "$XDG_CONFIG_HOME"/FreeCAD/user.cfg -s "$XDG_CONFIG_HOME"/FreeCAD/system.cfg}}<br />
<br />
Despite these options, {{AUR|freecad}} will still create the file {{ic|.FreeCAD/cookie}} as the web module has it [https://github.com/FreeCAD/FreeCAD/blob/master/src/Mod/Web/Gui/CookieJar.cpp#L55 hard coded]<br />
|-<br />
| [[GDB]]<br />
| {{ic|~/.gdbinit}}<br />
|<br />
|<br />
| {{ic|1=$ gdb -nh -x "$XDG_CONFIG_HOME"/gdb/init}}<br />
|-<br />
| {{AUR|get_iplayer}}<br />
| {{ic|~/.get_iplayer}}<br />
|<br />
|<br />
| {{ic|1=$ export GETIPLAYERUSERPREFS="$XDG_DATA_HOME"/get_iplayer}}<br />
|-<br />
| [[getmail]]<br />
| {{ic|~/.getmail/getmailrc}}<br />
|<br />
|<br />
| {{ic|1=$ getmail --rcfile="$XDG_CONFIG_HOME/getmail/getmailrc" --getmaildir="$XDG_DATA_HOME/getmail"}}<br />
|-<br />
| {{AUR|gliv}}<br />
| {{ic|~/.glivrc}}<br />
|<br />
|<br />
| {{ic|1=$ gliv --glivrc="$XDG_CONFIG_HOME"/gliv/glivrc}}<br />
|-<br />
| [[GnuPG]]<br />
| {{ic|~/.gnupg}}<br />
|<br />
| [https://bugs.gnupg.org/gnupg/issue1456] [https://bugs.gnupg.org/gnupg/issue1018]<br />
|<br />
{{ic|1=$ export GNUPGHOME="$XDG_DATA_HOME"/gnupg<br><br />
$ gpg2 --homedir "$XDG_DATA_HOME"/gnupg}}<br />
|-<br />
| [[Google Earth]]<br />
| {{ic|~/.googleearth}}<br />
|<br />
|<br />
| Some paths can be changed with the {{ic|KMLPath}} and {{ic|CachePath}} options in {{ic|~/.config/Google/GoogleEarthPlus.conf}}<br />
|-<br />
| {{Pkg|gopass}}<br />
| {{ic|~/.password-store}}<br />
|<br />
|<br />
| Override settings in {{ic|~/.config/gopass/config.yml}}:<br />
{{hc|~/.config/gopass/config.yml|<br />
root:<br />
path: gpgcli-gitcli-fs+file:///home/<userid>/.config/password-store<br />
}}<br />
|-<br />
| [https://sourceforge.net/projects/gqclient GQ LDAP client]<br />
|<br />
{{ic|~/.gq<br><br />
~/.gq-state}}<br />
| [https://sourceforge.net/p/gqclient/mailman/message/2053978 1.51]<br />
|<br />
|<br />
{{ic|1=$ export GQRC="$XDG_CONFIG_HOME"/gqrc<br><br />
$ export GQSTATE="$XDG_DATA_HOME"/gq/gq-state<br><br />
$ mkdir -p "$(dirname "$GQSTATE")"}}<br />
|-<br />
| [[Gradle]]<br />
| {{ic|~/.gradle}}<br />
|<br />
| [https://discuss.gradle.org/t/be-a-nice-freedesktop-citizen-move-the-gradle-to-the-appropriate-location-in-linux/2199]<br />
| {{ic|1=$ export GRADLE_USER_HOME="$XDG_DATA_HOME"/gradle}}<br />
|-<br />
| [[GTK]] 1<br />
| {{ic|~/.gtkrc}}<br />
|<br />
|<br />
| {{ic|1=$ export GTK_RC_FILES="$XDG_CONFIG_HOME"/gtk-1.0/gtkrc}}<br />
|-<br />
| [[GTK]] 2<br />
| {{ic|~/.gtkrc-2.0}}<br />
|<br />
|<br />
| {{ic|1=$ export GTK2_RC_FILES="$XDG_CONFIG_HOME"/gtk-2.0/gtkrc}}<br />
|-<br />
| {{Pkg|hledger}}<br />
| {{ic|~/.hledger.journal}}<br />
|<br />
| [https://github.com/simonmichael/hledger/issues/1081]<br />
| {{ic|1=$ export LEDGER_FILE="$XDG_DATA_HOME"/hledger.journal}}<br />
|-<br />
| {{Pkg|httpie}}<br />
| {{ic|~/.httpie}}<br />
|<br />
| [https://github.com/jakubroztocil/httpie/issues/145]<br />
| {{ic|1=$ export HTTPIE_CONFIG_DIR="$XDG_CONFIG_HOME"/httpie}}<br />
|-<br />
| {{AUR|intellij-idea-ce}}<br />
| {{ic|~/.IntelliJIdea*}}<br />
|<br />
| [https://youtrack.jetbrains.com/issue/IDEA-22407]<br />
| {{bc|1=$ mkdir -p "${XDG_CONFIG_HOME}"/intellij-idea<br />
$ cp /opt/intellij-idea-ce/bin/{idea.properties,idea64.vmoptions} "${XDG_CONFIG_HOME}"/intellij-idea/<br />
$ export IDEA_PROPERTIES="${XDG_CONFIG_HOME}"/intellij-idea/idea.properties<br />
$ export IDEA_VM_OPTIONS="${XDG_CONFIG_HOME}"/intellij-idea/idea.vmoptions}}<br />
{{hc|$XDG_CONFIG_HOME/idea.properties|<nowiki><br />
# these are hardcoded but you get the idea<br />
idea.config.path=${user.home}/.config/intellij-idea<br />
idea.system.path=${user.home}/.cache/intellij-idea<br />
idea.log.path=${user.home}/.cache/intellij-idea/log<br />
idea.plugins.path=${user.home}/.local/share/intellij-idea/plugins<br />
</nowiki>}}<br />
|-<br />
| [http://ipython.org ipython]/[[jupyter]]<br />
| {{ic|~/.ipython}}<br />
|<br />
| [https://github.com/ipython/ipython/pull/4457 won't fix]<br />
|<br />
{{ic|1=$ export IPYTHONDIR="$XDG_CONFIG_HOME"/jupyter<br><br />
$ export JUPYTER_CONFIG_DIR="$XDG_CONFIG_HOME"/jupyter}}<br />
|-<br />
| [https://ruby-doc.org/stdlib/libdoc/irb/rdoc/IRB.html irb]<br />
| {{ic|~/.irbrc}}<br />
|<br />
|<br />
| {{hc|1=~/.profile|2=$ export IRBRC="$XDG_CONFIG_HOME"/irb/irbrc}}<br />
{{hc|1="$XDG_CONFIG_HOME"/irb/irbrc|2=IRB.conf[:SAVE_HISTORY] {{!}}{{!}}= 1000<br />
IRB.conf[:HISTORY_FILE] {{!}}{{!}}= File.join(ENV["XDG_DATA_HOME"], "irb", "history")}}<br />
|-<br />
| [[irssi]]<br />
| {{ic|~/.irssi}}<br />
|<br />
| [https://github.com/irssi/irssi/pull/511]<br />
| {{ic|1=$ irssi --config="$XDG_CONFIG_HOME"/irssi/config --home="$XDG_DATA_HOME"/irssi}}<br />
|-<br />
| [[isync]]<br />
| {{ic|~/.mbsyncrc}}<br />
|<br />
|<br />
| {{ic|1=$ mbsync -c "$XDG_CONFIG_HOME"/isync/mbsyncrc}}<br />
|-<br />
| [[Java#OpenJDK]]<br />
| {{ic|~/.java/.userPrefs}}<br />
|<br />
| [https://bugzilla.redhat.com/show_bug.cgi?id=1154277]<br />
| {{ic|1=$ export _JAVA_OPTIONS=-Djava.util.prefs.userRoot="$XDG_CONFIG_HOME"/java}}<br />
|-<br />
| [[ledger]]<br />
| {{ic|~/.ledgerrc}}, {{ic|~/.pricedb}}<br />
|<br />
| [https://github.com/ledger/ledger/issues/1820]<br />
| {{ic|1=$ ledger --init-file "$XDG_CONFIG_HOME"/ledgerrc}}<br />
|-<br />
| [[Core utilities|less]]<br />
| {{ic|~/.lesshst}}<br />
|<br />
|<br />
|<br />
{{ic|1=$ mkdir -p "$XDG_CACHE_HOME"/less<br><br />
$ export LESSKEY="$XDG_CONFIG_HOME"/less/lesskey<br><br />
$ export LESSHISTFILE="$XDG_CACHE_HOME"/less/history}}<br />
<br />
{{ic|1=$ export LESSHISTFILE=-}} can be used to disable this feature.<br />
|-<br />
| {{Pkg|libdvdcss}}<br />
| {{ic|~/.dvdcss}}<br />
|<br />
| [https://mailman.videolan.org/pipermail/libdvdcss-devel/2014-August/001022.html]<br />
| {{ic|1=$ export DVDCSS_CACHE="$XDG_DATA_HOME"/dvdcss}}<br />
|-<br />
| {{Pkg|libice}}<br />
| {{ic|~/.ICEauthority}}<br />
|<br />
| [https://gitlab.freedesktop.org/xorg/lib/libice/issues/2]<br />
| {{ic|1=$ export ICEAUTHORITY="$XDG_CACHE_HOME"/ICEauthority}}<br />
Make sure {{ic|XDG_CACHE_HOME}} is set beforehand to directory user running [[Xorg]] has write access to.<br />
<br />
'''Do not''' use {{ic|XDG_RUNTIME_DIR}} as it is available '''after''' login. Display managers that launch [[Xorg]] (like [[GDM]]) will repeatedly fail otherwise.<br />
|-<br />
| [[Xorg|libx11]]<br />
|<br />
{{ic|~/.XCompose<br><br />
~/.compose-cache}}<br />
|<br />
|<br />
|<br />
{{ic|1=$ export XCOMPOSEFILE="$XDG_CONFIG_HOME"/X11/xcompose<br><br />
$ export XCOMPOSECACHE="$XDG_CACHE_HOME"/X11/xcompose}}<br />
|-<br />
| {{Pkg|ltrace}}<br />
| {{ic|~/.ltrace.conf}}<br />
|<br />
|<br />
| {{ic|1=$ ltrace -F "$XDG_CONFIG_HOME"/ltrace/ltrace.conf}}<br />
|-<br />
| {{Pkg|maven}}<br />
| {{ic|~/.m2}}<br />
|<br />
| [https://issues.apache.org/jira/browse/MNG-6603]<br />
| {{ic|1=$ mvn -gs "$XDG_CONFIG_HOME"/maven/settings.xml}}<br />
{{hc|[http://maven.apache.org/settings.html settings.xml]|<nowiki><settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"<br />
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"<br />
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0<br />
https://maven.apache.org/xsd/settings-1.0.0.xsd"><br />
...<br />
<localRepository>${env.XDG_CACHE_HOME}/maven/repository</localRepository><br />
...<br />
</settings></nowiki>}}<br />
|-<br />
| [[Mathematica]]<br />
| {{ic|~/.Mathematica}}<br />
|<br />
|<br />
| {{ic|1=$ export MATHEMATICA_USERBASE="$XDG_CONFIG_HOME"/mathematica}}<br />
|-<br />
| {{Pkg|mednafen}}<br />
| {{ic|~/.mednafen}}<br />
|<br />
|<br />
| {{ic|1=$ export MEDNAFEN_HOME="$XDG_CONFIG_HOME"/mednafen}}<br />
|-<br />
| [[MOC]]<br />
| {{ic|~/.moc}}<br />
|<br />
|<br />
|<br />
{{ic|1=$ mocp -M "$XDG_CONFIG_HOME"/moc<br><br />
$ mocp -O MOCDir="$XDG_CONFIG_HOME"/moc}}<br />
|-<br />
| {{Aur|monero}}<br />
| {{ic|~/.bitmonero}}<br />
|<br />
|<br />
| {{ic|1=$ monerod --data-dir "$XDG_DATA_HOME"/bitmonero}}<br />
|-<br />
| {{Pkg|most}}<br />
| {{ic|~/.mostrc}}<br />
|<br />
|<br />
| {{ic|1=$ export MOST_INITFILE="$XDG_CONFIG_HOME"/mostrc}}<br />
|-<br />
| [[MPlayer]]<br />
| {{ic|~/.mplayer}}<br />
|<br />
|<br />
| {{ic|1=$ export MPLAYER_HOME="$XDG_CONFIG_HOME"/mplayer}}<br />
|-<br />
| [[MySQL]]<br />
| {{ic|~/.mysql_history}}<br />
|<br />
|<br />
| {{ic|1=$ export MYSQL_HISTFILE="$XDG_DATA_HOME"/mysql_history}}<br />
|-<br />
| {{Pkg|ncurses}}<br />
| {{ic|~/.terminfo}}<br />
|<br />
|<br />
| Precludes system path searching:<br />
<br />
{{ic|1=$ export TERMINFO="$XDG_DATA_HOME"/terminfo<br><br />
$ export TERMINFO_DIRS="$XDG_DATA_HOME"/terminfo:/usr/share/terminfo}}<br />
|-<br />
| {{Pkg|ncmpc}}<br />
| {{ic|~/.ncmpc}}<br />
|<br />
|<br />
| {{ic|ncmpc -f "$XDG_CONFIG_HOME"/ncmpc/config}}<br />
|-<br />
| [[Netbeans]]<br />
| {{ic|~/.netbeans}}<br />
|<br />
| [https://netbeans.org/bugzilla/show_bug.cgi?id=215961]<br />
| {{ic|1=$ netbeans --userdir "${XDG_CONFIG_HOME}"/netbeans}}<br />
|-<br />
| [[Node.js]]<br />
| {{ic|~/.node_repl_history}}<br />
|<br />
|<br />
| {{ic|1=$ export NODE_REPL_HISTORY="$XDG_DATA_HOME"/node_repl_history}} [https://nodejs.org/api/repl.html#repl_environment_variable_options]<br />
|-<br />
| [[notmuch]]<br />
| {{ic|~/.notmuch-config}}<br />
|<br />
| [http://notmuchmail.org/pipermail/notmuch/2011/007007.html]<br />
|<br />
{{ic|1=$ export NOTMUCH_CONFIG="$XDG_CONFIG_HOME"/notmuch/notmuchrc<br><br />
$ export NMBGIT="$XDG_DATA_HOME"/notmuch/nmbug}}<br />
|-<br />
| {{Pkg|npm}}<br />
|<br />
{{ic|~/.npm<br><br />
~/.npmrc}}<br />
|<br />
| [https://github.com/npm/npm/issues/6675]<br />
| {{ic|1=$ export NPM_CONFIG_USERCONFIG=$XDG_CONFIG_HOME/npm/npmrc}}<br />
{{hc|npmrc|<nowiki><br />
prefix=${XDG_DATA_HOME}/npm<br />
cache=${XDG_CACHE_HOME}/npm<br />
tmp=${XDG_RUNTIME_DIR}/npm<br />
init-module=${XDG_CONFIG_HOME}/npm/config/npm-init.js<br />
</nowiki>}}<br />
{{ic|prefix}} is unnecessary (and unsupported) if Node.js is installed by {{AUR|nvm}}.<br />
|-<br />
| {{Pkg|nuget}}<br />
| {{ic|~/.nuget/packages}}<br />
|<br />
| [https://docs.microsoft.com/en-us/nuget/consume-packages/managing-the-global-packages-and-cache-folders]<br />
| {{ic|1=$ export NUGET_PACKAGES="$XDG_CACHE_HOME"/NuGetPackages}}<br />
|-<br />
| [[NVIDIA]]<br />
| {{ic|~/.nv}}<br />
|<br />
|<br />
| Uses XDG_CACHE_HOME if set, otherwise improperly falls back to ~/.nv instead of ~/.cache.<br />
|-<br />
| {{Pkg|nvidia-settings}}<br />
| {{ic|~/.nvidia-settings-rc}}<br />
|<br />
|<br />
| {{ic|1=$ nvidia-settings --config="$XDG_CONFIG_HOME"/nvidia/settings}}<br />
|-<br />
| {{AUR|nvm}}<br />
| {{ic|~/.nvm}}<br />
|<br />
|<br />
| {{ic|1=$ export NVM_DIR="$XDG_DATA_HOME"/nvm}}<br />
|-<br />
| [[Octave]]<br />
|<br />
{{ic|~/octave<br><br />
~/.octave_packages<br><br />
~/.octave_hist}}<br />
|<br />
|<br />
|<br />
{{ic|1=$ export OCTAVE_HISTFILE="$XDG_CACHE_HOME/octave-hsts"<br><br />
$ export OCTAVE_SITE_INITFILE="$XDG_CONFIG_HOME/octave/octaverc"}}<br />
<br />
{{hc|$XDG_CONFIG_HOME/octave/octaverc|<nowiki><br />
source /usr/share/octave/site/m/startup/octaverc;<br />
pkg prefix ~/.local/share/octave/packages ~/.local/share/octave/packages;<br />
pkg local_list /home/<your username>/.local/share/octave/octave_packages;<br />
</nowiki>}}<br />
The {{ic|local_list}} option must be given an absolute path.<br />
|-<br />
| {{Pkg|openscad}}<br />
| {{ic|~/.OpenSCAD}}<br />
| [https://github.com/openscad/openscad/commit/7c3077b0f 7c3077b0f]<br />
| [https://github.com/openscad/openscad/issues/125]<br />
| Does not fully honour XDG Base Directory Specification, see [https://github.com/openscad/openscad/issues/373]<br />
<br />
Currently it [https://github.com/openscad/openscad/blob/master/src/PlatformUtils-posix.cc#L20 hard-codes] {{ic|~/.local/share}}.<br />
|-<br />
| [[OpenSSL]]<br />
| {{ic|~/.rnd}}<br />
|<br />
|<br />
| Seeding file .rnd's location can be set with RANDFILE environment variable per [https://www.openssl.org/docs/faq.html FAQ].<br />
|-<br />
| {{Pkg|parallel}}<br />
| {{ic|~/.parallel}}<br />
| [https://git.savannah.gnu.org/cgit/parallel.git/commit/?id=685018f532f4e2d24b84eb28d5de3d759f0d1af1 20170422]<br />
|<br />
| {{ic|1=$ export PARALLEL_HOME="$XDG_CONFIG_HOME"/parallel}}<br />
|-<br />
| [[Pass]]<br />
| {{ic|~/.password-store}}<br />
|<br />
|<br />
| {{ic|1=$ export PASSWORD_STORE_DIR="$XDG_DATA_HOME"/pass}}<br />
|-<br />
| [[Pidgin]]<br />
| {{ic|~/.purple}}<br />
|<br />
| [https://developer.pidgin.im/ticket/4911]<br />
| {{ic|1=$ pidgin --config="$XDG_DATA_HOME"/purple}}<br />
|-<br />
| [[PostgreSQL]]<br />
|<br />
{{ic|~/.psqlrc<br><br />
~/.psql_history<br><br />
~/.pgpass<br><br />
~/.pg_service.conf}}<br />
| 9.2<br />
| [https://www.postgresql.org/docs/current/static/app-psql.html] [https://www.postgresql.org/docs/current/static/libpq-envars.html]<br />
|<br />
{{ic|1=$ export PSQLRC="$XDG_CONFIG_HOME/pg/psqlrc"<br><br />
$ export PSQL_HISTORY="$XDG_CACHE_HOME/pg/psql_history"<br><br />
$ export PGPASSFILE="$XDG_CONFIG_HOME/pg/pgpass"<br><br />
$ export PGSERVICEFILE="$XDG_CONFIG_HOME/pg/pg_service.conf"}}<br />
<br />
It is required to create both directories {{ic|1=$ mkdir "$XDG_CONFIG_HOME/pg" && mkdir "$XDG_CACHE_HOME/pg"}}<br />
|-<br />
| [[PulseAudio]]<br />
| {{ic|~/.esd_auth}}<br />
|<br />
|<br />
| Very likely generated by the {{ic|module-esound-protocol-unix.so}} module. It can be configured to use a different location but it makes much more sense to just comment out this module in {{ic|/etc/pulse/default.pa}} or {{ic|"$XDG_CONFIG_HOME"/pulse/default.pa}}.<br />
|-<br />
| {{aur|python-azure-cli}}<br />
| {{ic|~/.azure}}<br />
|<br />
|<br />
| {{ic|1=$ export AZURE_CONFIG_DIR=$XDG_DATA_HOME/azure}}<br />
|-<br />
| {{Pkg|python-setuptools}}<br />
| {{ic|~/.python-eggs}}<br />
|<br />
|<br />
| {{ic|1=$ export PYTHON_EGG_CACHE="$XDG_CACHE_HOME"/python-eggs}}<br />
|-<br />
| {{Pkg|python-pylint}}<br />
| {{ic|~/.pylint.d}}<br />
|<br />
| [https://github.com/PyCQA/pylint/issues/1364 won't fix]<br />
| {{ic|1=$ export PYLINTHOME="$XDG_CACHE_HOME"/pylint}}<br />
|-<br />
| {{Pkg|racket}}<br />
| {{ic|~/.racketrc<br><br />
~/.racket}}<br />
|<br />
| [https://github.com/racket/racket/issues/2740]<br />
| {{ic|1=$ export PLTUSERHOME="$XDG_DATA_HOME"/racket}}<br />
|-<br />
| [[readline]]<br />
| {{ic|~/.inputrc}}<br />
|<br />
|<br />
| {{ic|1=$ export INPUTRC="$XDG_CONFIG_HOME"/readline/inputrc}}<br />
|-<br />
| {{Pkg|rlwrap}}<br />
| {{ic|~/.*_history}}<br />
|<br />
| [https://github.com/hanslub42/rlwrap/issues/25]<br />
| {{ic|1=$ export RLWRAP_HOME="$XDG_DATA_HOME"/rlwrap}}<br />
|-<br />
| [[Ruby#RubyGems]]<br />
| {{ic|~/.gem}}<br />
|<br />
|<br />
|<br />
{{ic|1=$ export GEM_HOME="$XDG_DATA_HOME"/gem<br><br />
$ export GEM_SPEC_CACHE="$XDG_CACHE_HOME"/gem}}<br />
Make sure to remove {{ic|gem: --user-install}} from {{ic|/etc/gemrc}}<br />
|-<br />
| [[Rust#Rustup]]<br />
| {{ic|~/.rustup}}<br />
|<br />
| [https://github.com/rust-lang-nursery/rustup.rs/issues/247]<br />
| {{ic|1=$ export RUSTUP_HOME="$XDG_DATA_HOME"/rustup}}<br />
|-<br />
| {{Pkg|sbt}}<br />
| {{ic|~/.sbt}}<br />
{{ic|~/.ivy2}}<br />
|<br />
| [https://github.com/sbt/sbt/issues/3681]<br />
| {{ic|1=$ sbt -ivy "$XDG_DATA_HOME"/ivy2 -sbt-dir "$XDG_DATA_HOME"/sbt}} (beware [https://github.com/sbt/sbt/issues/3598])<br />
|-<br />
| [[GNU Screen]]<br />
| {{ic|~/.screenrc}}<br />
|<br />
|<br />
| {{ic|1=$ export SCREENRC="$XDG_CONFIG_HOME"/screen/screenrc}}<br />
|-<br />
| [[Haskell#Stack]]<br />
| {{ic|~/.stack}}<br />
|<br />
| [https://github.com/commercialhaskell/stack/issues/342]<br />
| {{ic|1=$ export STACK_ROOT="$XDG_DATA_HOME"/stack}}<br />
|-<br />
| [[subversion]]<br />
| {{ic|~/.subversion}}<br />
|<br />
| [https://issues.apache.org/jira/browse/SVN-4599] [https://mail-archives.apache.org/mod_mbox/subversion-users/201204.mbox/%3c4F8FBCC6.4080205@ritsuka.org%3e][http://mail-archives.apache.org/mod_mbox/subversion-dev/201509.mbox/%3c20150917222954.GA20331@teapot%3e]<br />
| {{ic|1=$ svn --config-dir "$XDG_CONFIG_HOME"/subversion}}<br />
|-<br />
| {{Pkg|task}}<br />
|<br />
{{ic|~/.task<br><br />
~/.taskrc}}<br />
|<br />
|<br />
|<br />
{{ic|1=$ export TASKDATA="$XDG_DATA_HOME"/task<br><br />
$ export TASKRC="$XDG_CONFIG_HOME"/task/taskrc}}<br />
|-<br />
| {{AUR|tiptop}}<br />
| {{ic|~/.tiptoprc}}<br />
|<br />
|<br />
| This will still expect the {{ic|.tiptoprc}} file.<br />
{{ic|$ tiptop -W "$XDG_CONFIG_HOME"/tiptop}}<br />
|-<br />
| [[tmux]]<br />
| {{ic|~/.tmux.conf}}<br />
|<br />
| [https://github.com/tmux/tmux/issues/142]<br />
| {{ic|1=$ tmux -f "$XDG_CONFIG_HOME"/tmux/tmux.conf}}<br />
<br />
{{ic|1=$ export TMUX_TMPDIR="$XDG_RUNTIME_DIR"}}<br />
|-<br />
| {{Pkg|uncrustify}}<br />
| {{ic|~/.uncrustify.cfg}}<br />
|<br />
|<br />
| {{ic|1=$ export UNCRUSTIFY_CONFIG="$XDG_CONFIG_HOME"/uncrustify/uncrustify.cfg}}<br />
|-<br />
| [[Unison]]<br />
| {{ic|~/.unison}}<br />
|<br />
|<br />
| {{ic|1=$ export UNISON="$XDG_DATA_HOME"/unison}}<br />
|-<br />
| [[Rxvt-unicode/Tips_and_tricks#Daemon-client|urxvtd]]<br />
| {{ic|~/.urxvt/urxvtd-hostname}}<br />
|<br />
|<br />
| {{ic|1=$ export RXVT_SOCKET="$XDG_RUNTIME_DIR"/urxvtd}}<br />
|-<br />
| [[Vagrant]]<br />
|<br />
{{ic|~/.vagrant.d<br><br />
~/.vagrant.d/aliases}}<br />
|<br />
| [https://www.vagrantup.com/docs/other/environmental-variables.html]<br />
|<br />
{{ic|1=$ export VAGRANT_HOME="$XDG_DATA_HOME"/vagrant<br><br />
$ export VAGRANT_ALIAS_FILE="$XDG_DATA_HOME"/vagrant/aliases}}<br />
|-<br />
| [[WeeChat]]<br />
| {{ic|~/.weechat}}<br />
|<br />
| [http://savannah.nongnu.org/task/?10934] [https://github.com/ipython/ipython/pull/4457]<br />
|<br />
{{ic|1=$ export WEECHAT_HOME="$XDG_CONFIG_HOME"/weechat<br><br />
$ weechat -d "$XDG_CONFIG_HOME"/weechat}}<br />
|-<br />
| [[wget]]<br />
|<br />
{{ic|~/.wgetrc<br><br />
~/.wget-hsts}}<br />
|<br />
|<br />
| <br />
{{ic|1=$ export WGETRC="$XDG_CONFIG_HOME/wgetrc"<br><br />
and add the following as an alias for wget:<br><br />
$ wget --hsts-file="$XDG_CACHE_HOME/wget-hsts"<br><br />
or set the hsts-file variable with an absolute path as wgetrc does not support environment variables:<br><br />
$ echo hsts-file \= "$XDG_CACHE_HOME"/wget-hsts >> "$XDG_CONFIG_HOME/wgetrc"}}<br />
|-<br />
| [[wine]]<br />
| {{ic|~/.wine}}<br />
|<br />
| [https://bugs.winehq.org/show_bug.cgi?id=20888]<br />
| [[Wine#Winetricks|Winetricks]] uses XDG-alike location below for [[Wine#WINEPREFIX|WINEPREFIX]] management:<br />
{{ic|1=$ mkdir -p "$XDG_DATA_HOME"/wineprefixes<br><br />
$ export WINEPREFIX="$XDG_DATA_HOME"/wineprefixes/default}}<br />
|-<br />
| [[xbindkeys]]<br />
| {{ic|~/.xbindkeysrc}}<br />
|<br />
|<br />
| {{ic|1=$ xbindkeys -f "$XDG_CONFIG_HOME"/xbindkeys/config}}<br />
|-<br />
| {{Pkg|xorg-xauth}}<br />
| {{ic|~/.Xauthority}}<br />
|<br />
|<br />
| {{ic|1=$ export XAUTHORITY="$XDG_RUNTIME_DIR"/Xauthority}}<br />
|-<br />
| [[xinit]]<br />
|<br />
{{ic|~/.xinitrc<br><br />
~/.xserverrc}}<br />
|<br />
| [https://gitlab.freedesktop.org/xorg/app/xinit/issues/14]<br />
|<br />
{{ic|1=$ export XINITRC="$XDG_CONFIG_HOME"/X11/xinitrc<br><br />
$ export XSERVERRC="$XDG_CONFIG_HOME"/X11/xserverrc}}<br />
<br />
Note that these variables are respected by ''xinit'', but not by ''startx''. Instead, specify the filename as an argument:<br />
<br />
{{ic|1=$ startx "$XDG_CONFIG_HOME/X11/xinitrc" -- "$XDG_CONFIG_HOME/X11/xserverrc" vt1}}<br />
|-<br />
| {{Pkg|xorg-xrdb}}<br />
|<br />
{{ic|~/.Xresources<br><br />
~/.Xdefaults}}<br />
|<br />
|<br />
| Ultimately you [https://superuser.com/questions/243914/xresources-or-xdefaults should be] using {{ic|Xresources}} and since these resources are loaded via {{ic|xrdb}} you can specify a path such as {{ic|1=$ xrdb -load ~/.config/X11/xresources}}.<br />
|-<br />
| {{Pkg|z}}<br />
|<br />
{{ic|~/.z}}<br />
|<br />
| [https://github.com/rupa/z/issues/267]<br />
| {{ic|1=$ export _Z_DATA="$XDG_DATA_HOME/z"}}<br />
|}<br />
<br />
=== Hardcoded ===<br />
<br />
{| class="wikitable sortable" style="width: 100%"<br />
! Application<br />
! Legacy Path<br />
! Discussion<br />
! Notes<br />
|-<br />
| [[adb]]<br />
| {{ic|~/.android/}}<br />
| [https://developer.android.com/studio/command-line/variables.html#android_sdk_root]<br />
| {{ic|1=$ export ANDROID_SDK_HOME="$XDG_CONFIG_HOME"/android}}<br />
|-<br />
| [[AMule]]<br />
| {{ic|~/.aMule}}<br />
|<br />
|<br />
|-<br />
| [https://developer.android.com/studio/index.html Android Studio]<br />
|<br />
{{ic|~/.AndroidStudio2.3<br><br />
~/.android/<br><br />
~/.java/}}<br />
|<br />
|<br />
|-<br />
| [https://osdn.net/projects/anthy/ anthy]<br />
| {{ic|~/.anthy}}<br />
| [https://osdn.net/ticket/browse.php?group_id=14&tid=28397]<br />
|<br />
|-<br />
| [https://directory.apache.org/studio/ Apache Directory Studio]<br />
| {{ic|~/.ApacheDirectoryStudio}}<br />
|<br />
|<br />
|-<br />
| [https://christian.amsuess.com/tools/arandr/ ARandR]<br />
| {{ic|~/.screenlayout}}<br />
|<br />
|<br />
|-<br />
| [[Arduino]]<br />
|<br />
{{ic|~/.arduino15<br><br />
~/.jssc}} <br />
| [https://github.com/arduino/Arduino/issues/3915 won't fix]<br />
|<br />
|-<br />
| [https://www.audacityteam.org/ Audacity]<br />
| {{ic|~/.audacity-data/}}<br />
|<br />
|<br />
|-<br />
| [http://fixounet.free.fr/avidemux/ Avidemux]<br />
| {{ic|~/.avidemux6}}<br />
|<br />
|<br />
|-<br />
| [[Bash]]<br />
|<br />
{{ic|~/.bashrc<br><br />
~/.bash_history<br><br />
~/.bash_profile<br><br />
~/.bash_login<br><br />
~/.bash_logout}}<br />
| [http://savannah.gnu.org/support/?108134 won't fix]<br />
| {{ic|1=$ export HISTFILE="$XDG_DATA_HOME"/bash/history}}<br />
A specified {{ic|bashrc}} can be sourced from {{ic|/etc/bashrc}}.<br />
<br />
Specify {{ic|--init-file <file>}} as an alternative to {{ic|~/.bashrc}} for interactive shells.<br />
|-<br />
| [https://www.haskell.org/cabal/ cabal]<br />
| {{ic|~/.cabal/}}<br />
| [https://github.com/haskell/cabal/issues/680]<br />
| See discussion for potential workarounds. It is not very easy or straightforward but may be possible to emulate Base Directory compliance.<br />
|-<br />
| {{AUR|chatty}}<br />
| {{ic|~/.chatty/}}<br />
| [https://github.com/chatty/chatty/issues/273]<br />
|<br />
|-<br />
| {{Pkg|cmake}}<br />
| {{ic|~/.cmake/}}<br />
|<br />
| Used for the user package registry {{ic|~/.cmake/packages/<package>}}, detailed in {{man|7|cmake-packages|User Package Registry}} and [https://gitlab.kitware.com/cmake/community/wikis/doc/tutorials/Package-Registry the Package registry wiki page]. Looks like it's hardcoded, for example in [https://gitlab.kitware.com/cmake/cmake/blob/v3.12.1/Source/cmFindPackageCommand.cxx#L1221 cmFindPackageCommand.cxx].<br />
|-<br />
| [[Cinnamon]]<br />
| {{ic|~/.cinnamon/}}<br />
| [https://github.com/linuxmint/Cinnamon/issues/7807]<br />
|<br />
|-<br />
| {{AUR|cryptomator}}<br />
| {{ic|~/.Cryptomator}}<br />
| [https://github.com/cryptomator/cryptomator/issues/710]<br />
|<br />
|-<br />
| [[CUPS]]<br />
| {{ic|~/.cups/}}<br />
| [https://github.com/apple/cups/issues/4243 won't fix]<br />
|<br />
|-<br />
| [[darcs]]<br />
| {{ic|~/.darcs/}}<br />
| [http://bugs.darcs.net/issue2453]<br />
|<br />
|-<br />
| [[dbus]]<br />
| {{ic|~/.dbus/}}<br />
| [https://gitlab.freedesktop.org/dbus/dbus/issues/46]<br />
| This should be avoidable with kdbus [citation needed].<br />
|-<br />
| {{Pkg|devede}}<br />
| {{ic|~/.devedeng}}<br />
|<br />
| Hardcoded [https://gitlab.com/rastersoft/devedeng/blob/f0893b3ff7b14723bd148db35bdfe2d284156d19/src/devedeng/configuration_data.py#L111 here]<br />
|-<br />
| [https://wiki.gnome.org/Apps/Dia Dia]<br />
| {{ic|~/.dia/}}<br />
|<br />
|<br />
|-<br />
| {{Pkg|dotnet-sdk}}<br />
| {{ic|~/.dotnet/}}<br />
| [https://github.com/dotnet/cli/issues/7569]<br />
|<br />
|-<br />
| [[Eclipse]]<br />
| {{ic|~/.eclipse/}}<br />
| [https://bugs.eclipse.org/bugs/show_bug.cgi?id=200809]<br />
| Option {{ic|1=-Dosgi.configuration.area=@user.home/.config/..}} overrides but must be added to {{ic|"$ECLIPSE_HOME"/eclipse.ini"}} rather than command line which means you must have write access to {{ic|$ECLIPSE_HOME}}. (Arch Linux hard-codes {{ic|$ECLIPSE_HOME}} in {{ic|/usr/bin/eclipse}})<br />
|-<br />
| [[Emacs]]<br />
|<br />
{{ic|~/.emacs<br><br />
~/.emacs.d/}}<br />
| [http://debbugs.gnu.org/cgi/bugreport.cgi?bug=583]<br />
| It's possible to set {{ic|HOME}}, but it has unexpected side effects. So far the most promising approach is modifying another Emacs environment variable to alter the load path and author your own site file which can manually load up your init file, but it changes the load process significantly.<br />
|-<br />
| [http://www.fetchmail.info/ Fetchmail]<br />
| {{ic|~/.fetchmailrc}}<br />
|<br />
|<br />
|-<br />
| [[Firefox]]<br />
| {{ic|~/.mozilla/}}<br />
| [https://bugzil.la/259356]<br />
|<br />
|-<br />
| [[Flatpak]]<br />
| {{ic|~/.var/}}<br />
| [https://github.com/flatpak/flatpak/issues/46] [https://github.com/flatpak/flatpak.github.io/issues/191] [https://github.com/flatpak/flatpak/issues/1651 won't fix]<br />
|<br />
|-<br />
| [https://www.haskell.org/ghc/ GHC]<br />
| {{ic|~/.ghc}}<br />
| [https://ghc.haskell.org/trac/ghc/ticket/6077]<br />
|<br />
|-<br />
| {{Aur|ghidra}}<br />
|<br />
| [https://github.com/NationalSecurityAgency/ghidra/issues/908]<br />
|<br />
|-<br />
| [[Goldendict]]<br />
| {{ic|~/.goldendict/}}<br />
| [https://github.com/goldendict/goldendict/issues/151]<br />
|<br />
|-<br />
| {{Pkg|gramps}}<br />
| {{ic|~/.gramps/}}<br />
| [https://gramps-project.org/bugs/view.php?id=8025]<br />
| <br />
|-<br />
| {{Pkg|grsync}}<br />
| {{ic|~/.grsync/}}<br />
| [https://sourceforge.net/p/grsync/feature-requests/15/]<br />
|<br />
|-<br />
| [http://recordmydesktop.sourceforge.net/about.php gtk-recordMyDesktop]<br />
| {{ic|~/.gtk-recordmydesktop}}<br />
|<br />
|<br />
|-<br />
| {{Pkg|hplip}}<br />
| {{ic|~/.hplip/}}<br />
| [https://bugs.launchpad.net/hplip/+bug/307152]<br />
|<br />
|-<br />
| [http://www.idris-lang.org/ idris]<br />
| {{ic|~/.idris}}<br />
| [https://github.com/idris-lang/Idris-dev/pull/3456]<br />
|<br />
|-<br />
| [[Java]] OpenJDK<br />
| {{ic|~/.java/fonts}}<br />
| [https://bugzilla.redhat.com/show_bug.cgi?id=1154277]<br />
|<br />
|-<br />
| [[Java]] OpenJFX<br />
| {{ic|~/.java/webview}}<br />
|<br />
|<br />
|-<br />
| [http://julialang.org/ julia]<br />
|<br />
{{ic|~/.juliarc.jl<br><br />
~/.julia_history}}<br />
| [https://github.com/JuliaLang/julia/issues/4630] [https://github.com/JuliaLang/julia/issues/10016]<br />
|<br />
|-<br />
| [http://www.linux-pam.org/ Linux PAM]<br />
| {{ic|~/.pam_environment}}<br />
| [https://github.com/linux-pam/linux-pam/issues/7]<br />
| Hardcoded in [https://github.com/linux-pam/linux-pam/blob/master/modules/pam_env/pam_env.c modules/pam_env/pam_env.c]<br />
|-<br />
| [http://lldb.llvm.org/ lldb]<br />
|<br />
{{ic|~/.lldb<br><br />
~/.lldbinit}}<br />
|<br />
|<br />
|-<br />
| [http://www.mathomatic.org/ mathomatic]<br />
|<br />
{{ic|~/.mathomaticrc<br><br />
~/.matho_history}}<br />
|<br />
| History can be moved by using {{ic|rlwrap mathomatic -r}} with the {{ic|RLWRAP_HOME}} environment set appropriately.<br />
|-<br />
| [[Minecraft]]<br />
| {{ic|~/.minecraft/}}<br />
| [https://bugs.mojang.com/browse/MCL-2563]<br />
|<br />
|-<br />
| [[Minetest]]<br />
| {{ic|~/.minetest/}}<br />
| [https://github.com/minetest/minetest/issues/864 won't fix] [https://github.com/minetest/minetest/issues/8151]<br />
|<br />
|-<br />
| [https://www.mongodb.org/ mongodb]<br />
|<br />
{{ic|~/.mongorc.js<br><br />
~/.dbshell}}<br />
| [https://jira.mongodb.org/browse/DOCS-5652?jql=text%20~%20%22.mongorc.js%22]<br />
| [https://stackoverflow.com/questions/22348604/the-mongorc-js-is-not-found-but-there-is-one/22349050#22349050 This Stack Overflow thread] suggests a partial workaround using command-line switch {{ic|--norc}}.<br />
|-<br />
| [http://0ldsk00l.ca/nestopia/ Nestopia UE]<br />
| {{ic|~/.nestopia/}}<br />
| [https://github.com/0ldsk00l/nestopia/pull/292 won't fix]<br />
|<br />
|-<br />
|<br />
| {{ic|~/.netrc}}<br />
|<br />
| Like {{ic|~/.ssh}}, many programs expect this file to be here. These include projects like curl ({{ic|CURLOPT_NETRC_FILE}}), ftp ({{ic|NETRC}}), s-nail ({{ic|NETRC}}), etc. While some of them offer alternative configurable locations, many do not such as w3m, wget and lftp.<br />
|-<br />
| [[Networkmanager-openvpn]]<br />
| {{ic|~/.cert/nm-openvpn}}<br />
| [https://gitlab.gnome.org/GNOME/NetworkManager-openvpn/issues/35]<br />
|<br />
|-<br />
| [https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSS NSS]<br />
| {{ic|~/.pki}}<br />
| [https://bugzilla.mozilla.org/show_bug.cgi?id=818686]<br />
|<br />
|-<br />
| [[OpenSSH]]<br />
| {{ic|~/.ssh}}<br />
| [https://bugzilla.mindrot.org/show_bug.cgi?id=2050 won't fix]<br />
| Assumed to be present by many ssh daemons and clients such as DropBear and OpenSSH.<br />
|-<br />
| [https://www.palemoon.org/ palemoon]<br />
| {{ic|~/.moonchild productions}}<br />
| [https://forum.palemoon.org/viewtopic.php?f=5&t=9639]<br />
|<br />
|-<br />
| {{AUR|parsec-bin}}<br />
| {{ic|~/.parsec}}<br />
|<br />
|<br />
|-<br />
| {{AUR|pcsxr}}<br />
| {{ic|~/.pcsxr}}<br />
|<br />
| A {{ic|-cfg}} flag exists, but can only be set relative to {{ic|~/.pcsxr}}.<br />
|-<br />
| [https://perf.wiki.kernel.org/index.php/Main_Page perf]<br />
| {{ic|~/.debug}}<br />
|<br />
| Hardcoded in [https://github.com/torvalds/linux/blob/master/tools/perf/util/config.c#L29 tools/perf/util/config.c:29].<br />
|-<br />
| various [[shell]]s and [[display manager]]s<br />
| {{ic|~/.profile}}<br />
|<br />
|<br />
|-<br />
| [[python]]<br />
| {{ic|~/.python_history}}<br />
|<br />
| All history from interactive sessions is saved to {{ic|~/.python_history}} by default since [https://bugs.python.org/issue5845 version 3.4], custom path can still be set the same way as in older versions (see [https://docs.python.org/3/library/readline.html?highlight=readline#example this example]).<br />
|-<br />
| [https://doc.qt.io/qt-5/qtdesigner-manual.html Qt Designer]<br />
| {{ic|~/.designer}}<br />
|<br />
|<br />
|-<br />
| [http://rednotebook.sourceforge.net/ RedNotebook]<br />
| {{ic|~/.rednotebook}}<br />
|<br />
|<br />
|-<br />
| [https://remarkableapp.github.io/linux.html Remarkable]<br />
| {{ic|~/.remarkable}}<br />
|<br />
|<br />
|-<br />
| [https://www.renpy.org/ Ren'Py]<br />
| {{ic|~/.renpy}}<br />
| [https://github.com/renpy/renpy/issues/1377]<br />
|<br />
|-<br />
| [[SANE]]<br />
| {{ic|~/.sane/}}<br />
|<br />
| {{ic|scanimage}} creates a {{ic|.cal}} file there<br />
|-<br />
| {{Pkg|scribus}}<br />
| {{ic|~/.scribus}}<br />
|<br />
|<br />
|-<br />
| {{Pkg|sdcv}}<br />
| {{ic|~/.stardict/}}<br />
| [https://github.com/Dushistov/sdcv/issues/51]<br />
| Only workaround is modifying {{ic|HOME}}<br />
|-<br />
| [http://www.seamonkey-project.org/ SeaMonkey]<br />
| {{ic|~/.mozilla/}}<br />
| [https://bugzil.la/726939]<br />
|<br />
|-<br />
| {{Pkg|simplescreenrecorder}}<br />
| {{ic|~/.ssr/}}<br />
| [https://github.com/MaartenBaert/ssr/issues/407]<br />
| Author seems against this feature.<br />
|-<br />
| [https://www.gnu.org/software/solfege/solfege.html Solfege]<br />
|<br />
{{ic|~/.solfege<br><br />
~/.solfegerc<br><br />
~/lessonfiles}}<br />
| [https://savannah.gnu.org/bugs/index.php?50251]<br />
|<br />
|-<br />
| [https://spacemacs.org/ spacemacs]<br />
|<br />
{{ic|~/.spacemacs<br><br />
~/.spacemacs.d}}<br />
| [https://github.com/syl20bnr/spacemacs/issues/3589]<br />
|<br />
|-<br />
| [https://spamassassin.apache.org/ SpamAssassin]<br />
| {{ic|~/.spamassassin}}<br />
|<br />
|<br />
|-<br />
| [[spectrwm]]<br />
| {{ic|~/.spectrwm}}<br />
|<br />
|<br />
|-<br />
| [[SQLite]]<br />
|<br />
{{ic|~/.sqlite_history<br><br />
~/.sqliterc}}<br />
| [https://www.sqlite.org/src/info/696e82f7c82d1720]<br />
| {{ic|1=$ export SQLITE_HISTORY=$XDG_DATA_HOME/sqlite_history<br><br />
$ sqlite3 -init "$XDG_CONFIG_HOME"/sqlite3/sqliterc}}<br />
|-<br />
| [[Steam]]<br />
|<br />
{{ic|~/.steam<br><br />
~/.steampath<br><br />
~/.steampid}}<br />
| [https://github.com/ValveSoftware/steam-for-linux/issues/1890]<br />
| Many game engines (Unity 3D, Unreal) follow the specification, but then individual game publishers hardcode the paths in [https://www.ctrl.blog/entry/flatpak-steamcloud-xdg Steam Auto-Cloud] causing game-saves to sync to the wrong directory.<br />
|-<br />
| [[TeamSpeak]]<br />
| {{ic|~/.ts3client}}<br />
|<br />
|<br />
|-<br />
| {{pkg|texinfo}}<br />
| {{ic|~/.infokey}}<br />
|<br />
| {{ic|$ info --init-file "$XDG_CONFIG_HOME/infokey"}}<br />
|-<br />
| [http://www.texmacs.org/ TeXmacs]<br />
| {{ic|~/.TeXmacs}}<br />
|<br />
|<br />
|-<br />
| [[Thunderbird]]<br />
| {{ic|~/.thunderbird/}}<br />
| [https://bugzil.la/735285]<br />
|<br />
|-<br />
| [https://git.archlinux.org/users/remy/texlive-localmanager.git/ tllocalmgr]<br />
| {{ic|~/.texlive}}<br />
|<br />
|<br />
|-<br />
| [[vim]]<br />
|<br />
{{ic|~/.vim<br><br />
~/.vimrc<br><br />
~/.viminfo}}<br />
| [https://github.com/vim/vim/issues/2034]<br />
| Since [https://github.com/vim/vim/commit/6a459902592e2a4ba68 7.3.1178] vim will search for {{ic|~/.vim/vimrc}} if {{ic|~/.vimrc}} is not found.<br />
<br />
{{ic|1=<nowiki>$ mkdir -p "$XDG_DATA_HOME"/vim/{undo,swap,backup}</nowiki>}}<br />
<br />
{{hc|"$XDG_CONFIG_HOME"/vim/vimrc|<br />
set undodir&#61;$XDG_DATA_HOME/vim/undo<br />
set directory&#61;$XDG_DATA_HOME/vim/swap<br />
set backupdir&#61;$XDG_DATA_HOME/vim/backup<br />
set viminfo+&#61;'1000,n$XDG_DATA_HOME/vim/viminfo<br />
set runtimepath&#61;$XDG_CONFIG_HOME/vim,$VIMRUNTIME,$XDG_CONFIG_HOME/vim/after<br />
}}<br />
<br />
{{hc|~/.profile|<br />
export VIMINIT&#61;":source $XDG_CONFIG_HOME"/vim/vimrc<br />
}}<br />
<br />
* https://tlvince.com/vim-respect-xdg<br />
|-<br />
| [http://www.vimperator.org/ vimperator]<br />
| {{ic|~/.vimperatorrc}}<br />
| [http://www.mozdev.org/pipermail/vimperator/2009-October/004848.html]<br />
| {{ic|1=$ export VIMPERATOR_INIT=":source $XDG_CONFIG_HOME/vimperator/vimperatorrc"}}<br />
<br />
{{ic|1=$ export VIMPERATOR_RUNTIME="$XDG_CONFIG_HOME"/vimperator}}<br />
|-<br />
| {{Pkg|w3m}}<br />
| {{ic|~/.w3m}}<br />
| [https://sourceforge.net/p/w3m/feature-requests/31/]<br />
|<br />
|-<br />
| [https://w1.fi/ wpa_cli]<br />
| {{ic|~/.wpa_cli_history}}<br />
|<br />
|<br />
|-<br />
| {{Pkg|xdg-utils}}<br />
| {{ic|~/.gnome}}<br />
| [https://bugs.freedesktop.org/show_bug.cgi?id=90775]<br />
| For some reason the script {{ic|xdg-desktop-menu}} hard-codes {{ic|gnome_user_dir&#61;"$HOME/.gnome/apps"}}. This is used by [[chromium]] among others.<br />
|-<br />
| [https://opensource.conformal.com/wiki/xombrero xombrero]<br />
| {{ic|~/.xombrero}}<br />
| [https://github.com/conformal/xombrero/issues/74]<br />
|<br />
|-<br />
| [https://yardoc.org YARD]<br />
| {{ic|~/.yard}}<br />
| [https://github.com/lsegal/yard/issues/1230]<br />
| Would accept Pull Request if anyone want to implement it.<br />
|-<br />
| [https://nmap.org/zenmap/ zenmap] {{Pkg|nmap}}<br />
| {{ic|~/.zenmap}}<br />
| [http://seclists.org/nmap-dev/2012/q2/163] [https://github.com/nmap/nmap/issues/590]<br />
|<br />
|-<br />
| [[zsh]]<br />
|<br />
{{ic|~/.zshrc<br><br />
~/.zprofile<br><br />
~/.zshenv<br><br />
~/.zlogin<br><br />
~/.zlogout<br><br />
~/.histfile<br><br />
~/.zcompdump}}<br />
| [http://www.zsh.org/mla/workers/2013/msg00692.html]<br />
| Consider exporting {{ic|1=ZDOTDIR=$HOME/.config/zsh}} in {{ic|~/.zshenv}} (this is hardcoded due to the bootstrap problem). You could also add this to {{ic|/etc/zsh/zshenv}} and avoid the need for any dotfiles in your {{ic|HOME}}. Doing this however requires root privilege which may not be viable and is system-wide.<br />
<br />
{{ic|1=$ export HISTFILE="$XDG_DATA_HOME"/zsh/history}}<br />
<br />
{{ic| $ compinit -d $XDG_CACHE_HOME/zsh/zcompdump-$ZSH_VERSION}} [https://unix.stackexchange.com/questions/391641/separate-path-for-zcompdump-files] /!\ The folder needs to exist<br />
<br />
|}<br />
<br />
== Libraries ==<br />
<br />
; C<br />
: [https://github.com/Cloudef/chck/tree/master/chck/xdg C99: Cloudef's simple implementation].<br />
<br />
; JVM: Java, Kotlin, Clojure, Scala, ...<br />
: [https://github.com/soc/directories-jvm directories-jvm]<br />
<br />
; Go<br />
: [https://github.com/ProtonMail/go-appdir go-appdir]<br />
<br />
; Haskell<br />
: Officially in [https://hackage.haskell.org/package/directory directory] since 1.2.3.0 [https://github.com/haskell/directory/commit/ab9d0810ce ab9d0810ce].<br />
: [https://hackage.haskell.org/package/xdg-basedir xdg-basedir]<br />
<br />
; Perl<br />
: [http://search.cpan.org/dist/File-BaseDir/lib/File/BaseDir.pm File-BaseDir]<br />
: [https://github.com/Aerdan/perl-file-xdg perl-file-xdg]<br />
<br />
; Ruby<br />
: [https://github.com/rubyworks/xdg rubyworks/xdg]<br />
<br />
; Rust<br />
: [https://github.com/soc/directories-rs directories-rs]<br />
: [https://github.com/whitequark/rust-xdg rust-xdg]<br />
<br />
; Python<br />
: [https://freedesktop.org/wiki/Software/pyxdg/ pyxdg]<br />
<br />
; Vala<br />
: Builtin support via [http://valadoc.org/#!api=glib-2.0/GLib.Environment GLib.Environment].<br />
: See {{ic|get_user_cache_dir}}, {{ic|get_user_data_dir}}, {{ic|get_user_config_dir}}, etc.<br />
<br />
==See also==<br />
<br />
* [https://wiki.gnome.org/Initiatives/GnomeGoals/XDGConfigFolders GNOME Goal: XDG Base Directory Specification Usage]<br />
* [https://plus.google.com/+RobPikeTheHuman/posts/R58WgWwN9jp Rob Pike: "Dotfiles" being hidden is a UNIXv2 mistake].<br />
* [https://www.freedesktop.org/software/systemd/man/systemd-path.html systemd-path(1)]<br />
* [https://www.freedesktop.org/software/systemd/man/file-hierarchy.html file-hierarchy(7)]<br />
* [https://github.com/grawity/dotfiles/blob/master/.dotfiles.notes Grawity's notes on dotfiles].<br />
* [https://github.com/grawity/dotfiles/blob/master/.environ.notes Grawity's notes on environment variables].<br />
* [https://ploum.net/207-modify-your-application-to-use-xdg-folders/ ploum.net: Modify Your Application to use XDG Folders].<br />
* The [https://pcgamingwiki.com/wiki/Home PCGamingWiki] attempts to document whether or not Linux PC games follow the XDG Base Directory Specification.</div>Delapouitehttps://wiki.archlinux.org/index.php?title=Matrix&diff=580461Matrix2019-08-19T15:38:04Z<p>Delapouite: add link to IRC on Wikipedia</p>
<hr />
<div>[[Category:Instant messaging]]<br />
[[Category:Voice over IP]]<br />
[[ja:Matrix]]<br />
[https://matrix.org/ Matrix] is an ambitious new ecosystem for open federated instant messaging and VoIP. It consists of servers, clients and bridge software to connect to existing messaging solutions like [[wikipedia:Internet Relay Chat|IRC]].<br />
<br />
== Installation ==<br />
<br />
The reference server implementation '''Synapse''' is available in the community repository as {{Pkg|matrix-synapse}}. The community package creates a ''synapse'' user.<br />
<br />
== Configuration ==<br />
<br />
After installation, a configuration file needs to be generated. It should be readable by the ''synapse'' user:<br />
{{bc|<nowiki><br />
$ cd /etc/synapse<br />
$ sudo -u synapse python -m synapse.app.homeserver \<br />
--server-name my.domain.name \<br />
--config-path /etc/synapse/homeserver.yaml \<br />
--generate-config \<br />
--report-stats=yes<br />
</nowiki>}}<br />
<br />
Note that this will generate corresponding SSL keys and self-signed certificates for the specified server name. You have to regenerate those if you change the server name.<br />
<br />
== Service ==<br />
<br />
A systemd service named {{ic|synapse.service}} will be installed by the matrix-synapse package. It will start the synapse server as user ''synapse'' and use the configuration file {{ic|/etc/synapse/homeserver.yaml}}.<br />
<br />
== User management ==<br />
<br />
You need at least one user on your fresh synapse server. You may create one as your normal non-root user with the command<br />
{{bc|$ register_new_matrix_user -c /etc/synapse/homeserver.yaml https://localhost:8448}}<br />
or using one of the [https://matrix.org/docs/projects/try-matrix-now.html matrix clients], for example {{pkg|riot-desktop}}, or the {{AUR|purple-matrix-git}} plug-in for {{pkg|libpurple}}.<br />
<br />
== Spider Webcrawler ==<br />
To enable the webcrawler, for server generated link previews, the additional packages {{Pkg|python-lxml}} and {{Pkg|python-netaddr}} have to be installed.<br />
After that the config option {{ic|url_preview_enabled: True}} can be set in your {{ic|homeserver.yaml}}.<br />
To prevent the synapse server from issuing arbitrary GET requests to internal hosts the {{ic|url_preview_ip_range_blacklist:}} has to be set.<br />
{{Warning|There are no defaults! By default the synapse server can crawl all your internal hosts.}}<br />
There are some examples that can be uncommented.<br />
Add your local IP ranges to that list to prevent the synapse server from trying to crawl them.<br />
After changing the {{ic|homeserver.yaml}} the service has to be restarted.</div>Delapouitehttps://wiki.archlinux.org/index.php?title=Backlight&diff=579259Backlight2019-08-09T14:59:03Z<p>Delapouite: add link to DDC/CI on Wikipedia</p>
<hr />
<div>[[Category:Laptops]]<br />
[[Category:Power management]]<br />
[[ru:Backlight]]<br />
[[ja:バックライト]]<br />
Screen brightness might be tricky to control. On some machines physical hardware switches are missing and software solutions may not work well. However, it is generally possible to find a functional method for a given hardware. This article aims to summarize all possible ways to adjust the backlight.<br />
<br />
== Overview ==<br />
<br />
There are many ways to control brightness of a monitor, laptop or integrated panel (such as the iMac). According to [https://bugs.launchpad.net/ubuntu/+source/xserver-xorg-video-intel/+bug/397617 these] [https://lore.kernel.org/patchwork/patch/528936/#708706 discussions] and this [https://wiki.ubuntu.com/Kernel/Debugging/Backlight wiki page] the control method can be divided into these categories:<br />
<br />
* brightness is controlled by vendor-specified hotkey and there is no interface for the OS to adjust the brightness.<br />
* brightness is controlled by either the ACPI, graphic or platform driver.<br />
* brightness is controlled by HW register through setpci.<br />
<br />
All methods are exposed to the user through {{ic|/sys/class/backlight}} and [[xrandr]]/xbacklight can choose one method to control brightness. It is still not very clear which one xbacklight prefers by default.<br />
<br />
{{Note|On some new laptops with an OLED screen you can't use xbacklight since OLED screens have no backlight so while you will be able to change the brightness values this will not have any affect on the actual screen brightness. In this case see, [[#OLED screen brightness]]}}<br />
<br />
== ACPI ==<br />
<br />
The brightness of the screen backlight is adjusted by setting the power level of the backlight LEDs or cathodes. The power level can often be controlled using the ACPI kernel module for video. An interface to this module is provided via a sysfs directory at {{ic|/sys/class/backlight/}}.<br />
<br />
The name of the directory depends on the graphics card model.<br />
<br />
{{hc|$ ls /sys/class/backlight/|<br />
acpi_video0<br />
}}<br />
<br />
In this case, the backlight is managed by an ATI graphics card. In the case of an Intel card, the directory is called {{ic|intel_backlight}}. In the following examples, {{ic|acpi_video0}} is used. If you use an Intel card, simply replace {{ic|acpi_video0}} with {{ic|intel_backlight}} in the examples.<br />
<br />
The directory contains the following files and subdirectories:<br />
<br />
{{hc|$ ls /sys/class/backlight/acpi_video0/|<br />
actual_brightness brightness max_brightness subsystem/ uevent <br />
bl_power device/ power/ type<br />
}}<br />
<br />
The maximum brightness can be displayed by reading from {{ic|max_brightness}}, which is often 15.<br />
<br />
{{hc|$ cat /sys/class/backlight/acpi_video0/max_brightness|<br />
15<br />
}}<br />
<br />
The brightness can be set by writing a number to {{ic|brightness}}. Attempting to set a brightness greater than the maximum results in an error.<br />
<br />
# echo 5 > /sys/class/backlight/acpi_video0/brightness<br />
<br />
By default, only {{ic|root}} can change the brightness by this method. To allow users in the {{ic|video}} group to change the brightness, a [[udev]] rule such as the following can be used:<br />
<br />
{{hc|/etc/udev/rules.d/backlight.rules|<nowiki><br />
ACTION=="add", SUBSYSTEM=="backlight", KERNEL=="acpi_video0", RUN+="/bin/chgrp video /sys/class/backlight/%k/brightness"<br />
ACTION=="add", SUBSYSTEM=="backlight", KERNEL=="acpi_video0", RUN+="/bin/chmod g+w /sys/class/backlight/%k/brightness"<br />
</nowiki>}}<br />
<br />
=== Kernel command-line options ===<br />
<br />
Sometimes ACPI does not work well due to different motherboard implementations and ACPI quirks. This results in, for instance, inaccurate brightness notifications. This includes some laptops with dual graphics (e.g., Nvidia/Radeon dedicated GPU with Intel/AMD integrated GPU). Additionally, ACPI sometimes needs to register its own {{ic|acpi_video0}} backlight even if one already exists (such as {{ic|intel_backlight}}), which can be done by adding one of the following [[kernel parameters]]:<br />
<br />
acpi_backlight=video<br />
acpi_backlight=vendor<br />
acpi_backlight=native<br />
<br />
If you find that changing the {{ic|acpi_video0}} backlight does not actually change the brightness, you may need to use {{ic|1=acpi_backlight=none}}.<br />
<br />
{{Tip|<br />
* On Nvidia Optimus laptops, the kernel parameter {{ic|nomodeset}} can interfere with the ability to adjust the backlight.<br />
* On an Asus notebooks you might also need to load the {{ic|asus-nb-wmi}} [[kernel module]].<br />
* Disabling legacy boot on Dell XPS13 breaks backlight support.<br />
}}<br />
<br />
=== Udev rule ===<br />
<br />
If the ACPI interface is available, the backlight level can be set at boot using a [[udev]] rule:<br />
<br />
{{hc|/etc/udev/rules.d/81-backlight.rules|<nowiki><br />
# Set backlight level to 8<br />
SUBSYSTEM=="backlight", ACTION=="add", KERNEL=="acpi_video0", ATTR{brightness}="8"</nowiki>}}<br />
<br />
{{Note|The systemd-backlight service restores the previous backlight brightness level at boot. To prevent conflicts for the above rules, see [[#Save/Restore_functionality]].}}<br />
<br />
{{Tip|To set the backlight depending on power state, see [[Power management#Using a script and an udev rule]] and use your favourite [[#Backlight utilities|backlight utility]] in the script.}}<br />
<br />
== OLED screen brightness ==<br />
<br />
If using a desktop environment or a laptop with an OLED screen, you may notice the backlight does not function (the brightness control keys toggles the on-screen display and the brightness values can be manually adjusted in {{ic|/sys/class/backlight/intel_backlight}}, but it doesn't change the actual brightness level of the screen). Since on some models the screen is OLED (which do not have physical backlights) and until brightness control is supported by the kernel, you may need to shim the ACPI backlight functions to update Xrandr's "--backlight" option. This is done by monitoring the acpi_video0 levels, and updating the xrandr brightness levels accordingly.<br />
<br />
For this to work, you must first install {{Pkg|inotify-tools}} and {{Pkg|bc}}. Then, create the following file:<br />
<br />
$ cat /usr/local/bin/xbacklightmon<br />
<br />
#!/bin/sh<br />
#use LC_NUMERIC if you are using an European LC, else printf will not work because it expects an comma instead of a decimal point<br />
LC_NUMERIC="en_US.UTF-8"<br />
<br />
# modify this path to the location of your backlight class<br />
path=/sys/class/backlight/intel_backlight<br />
<br />
luminance() {<br />
read -r level < "$path"/actual_brightness<br />
factor=$((max))<br />
new_brightness="$(bc -l <<< "scale = 2; $level / $factor")"<br />
printf '%f\n' $new_brightness<br />
}<br />
<br />
read -r max < "$path"/max_brightness<br />
<br />
xrandr --output eDP-1 --brightness "$(luminance)"<br />
<br />
inotifywait -me modify --format <nowiki>''</nowiki> "$path"/actual_brightness | while read; do<br />
xrandr --output eDP-1 --brightness "$(luminance)"<br />
done<br />
<br />
Then make this file executable and owned by root:<br />
<br />
$ chown root:root /usr/local/bin/xbacklightmon<br />
$ chmod 755 /usr/local/bin/xbacklightmon<br />
<br />
You may test this by running the file, and using the backlight keys to test if the brightness updates. Finally, configure the script to run when you display manager starts.<br />
<br />
'''Please note:''' If you are using the xf86-video-intel driver, you will need to replace 'eDP-1' in the script above with 'eDP1'<br />
You also have to change the path to 'path=/sys/class/backlight/intel_backlight/' if you are using xf86-video-intel<br />
<br />
== Switch off the backlight ==<br />
<br />
Switching off the backlight (for example when one locks a notebook) can be useful to conserve battery energy. Ideally the following command should work for any [[Xorg]] graphical session:<br />
<br />
xset dpms force off<br />
<br />
The backlight should switch on again on mouse movement or keyboard input. Alternately {{ic|xset s}} could be used.<br />
<br />
The following example will toggle the screen saver timeout for a similar result (should be bound to a key):<br />
<br />
{{hc|~/.local/bin/xlcd.sh|<br />
#!/usr/bin/dash<br />
read lcd < /tmp/lcd<br />
if [ "$lcd" -eq "0" ]; then<br />
xset s<br />
echo 1 > /tmp/lcd<br />
sleep 1<br />
notify-send -t 2000 LCD\ ON<br />
else<br />
xset s 3<br />
echo 0 > /tmp/lcd<br />
notify-send -t 2000 LCD\ OFF<br />
fi<br />
}}<br />
<br />
If the previous commands do not work, there is a chance that ''vbetool'' may work. Note, however, that in this case the backlight must be manually activated again. The command is as follows:<br />
<br />
$ vbetool dpms off<br />
<br />
To activate the backlight again:<br />
<br />
$ vbetool dpms on<br />
<br />
For example, this can be put to use when closing the notebook lid using [[Acpid]].<br />
<br />
== Save/Restore functionality ==<br />
<br />
The [[systemd]] package includes the service {{ic|systemd-backlight@.service}}, which is enabled by default and "static". It saves the backlight brightness level at shutdown and restores it at boot. The service uses the ACPI method described in [[#ACPI]], generating services for each folder found in {{ic|/sys/class/backlight/}}. For example, if there is a folder named {{ic|acpi_video0}}, it generates a service called {{ic|systemd-backlight@backlight:acpi_video0.service}}. When using other methods of setting the backlight at boot, it is recommended to stop systemd-backlight from restoring the backlight by setting the [[kernel parameters]] parameter {{ic|1=systemd.restore_state=0}}. See {{man|8|systemd-backlight@.service}} for details.<br />
<br />
{{Note|Some laptops have multiple video cards (e.g. Optimus) and the backlight restoration fails. Try [[systemd#Using units|masking]] an instance of the service (e.g. {{ic|systemd-backlight@backlight:acpi_video1}} for {{ic|acpi_video1}}).}}<br />
<br />
The {{AUR|relight}} package provides an alternative systemd-based method of saving and restoring screen brightness.<br />
<br />
Additionally, the {{AUR|brillo}} and {{Pkg|light}} utilities support save/restore functionality. These two may be more useful if one wishes to restore the screen brightness on a per-user basis, however no systemd units are provided to accomplish this.<br />
<br />
== Backlight utilities ==<br />
<br />
The utilities in the following table can be used to control screen brightness. All of them are compatible with Wayland and do not require X.<br />
<br />
{| class="wikitable sortable"<br />
!| Name<br />
! Controls keyboard backlights<br />
! Reacts to ambient brightness<br />
! Language<br />
! License<br />
! Notes<br />
! Package<br />
! Homepage<br />
|-<br />
| acpilight<br />
| {{Yes}}<br />
| {{No}}<br />
| Python3<br />
| GPL-3.0-or-later<br />
| "xbacklight" compatible<br />
| {{Pkg|acpilight}}<br />
| https://gitlab.com/wavexx/acpilight<br />
|-<br />
| brightd<br />
| {{No}}<br />
| {{No}}<br />
| C<br />
| GPL-2.0<br />
| Dims the screen when there is no user input for some time.<br />
| {{AUR|brightd}}<br />
| http://www.pberndt.com/Programme/Linux/brightd<br />
|-<br />
| brillo<br />
| {{Yes}}<br />
| {{No}}<br />
| C<br />
| GPL-3.0-only<br />
| Supports smooth and relative adjustments.<br />
| {{AUR|brillo}}<br />
| https://gitlab.com/cameronnemo/brillo<br />
|-<br />
| brightnessctl<br />
| {{Yes}}<br />
| {{No}}<br />
| C<br />
| MIT<br />
| {{Y|Binary is setuid unless otherwise configured.}}<br />
| {{Pkg|brightnessctl}}<br />
| https://github.com/Hummer12007/brightnessctl<br />
|-<br />
| Calise<br />
| {{No}}<br />
| {{Yes}}<br />
| Python2<br />
| GPL-3.0<br />
| -<br />
| {{AUR|calise}}<br />
| http://calise.sourceforge.net<br />
|-<br />
| Clight<br />
| {{Yes}}<br />
| {{Yes}}<br />
| C<br />
| GPL-3.0-or-later<br />
| Manages screen temperature and smoothly dims brightness after a timeout. Turns webcam into an ambient light sensor.<br />
| {{AUR|clight}}<br />
| https://github.com/FedeDP/Clight<br />
|-<br />
| macbook-lighter<br />
| {{Yes}}<br />
| {{Yes}}<br />
| Bash,Perl<br />
| GPL<br />
| Macbook screen/keyboard backlight CLI and auto-adjust on ambient light.<br />
| {{AUR|macbook-lighter}}<br />
| https://github.com/harttle/macbook-lighter<br />
|-<br />
| enlighten<br />
| {{No}}<br />
| {{No}}<br />
| C<br />
| GPL-3.0-or-later<br />
| -<br />
| {{AUR|enlighten-git}}<br />
| https://github.com/HalosGhost/enlighten<br />
|-<br />
| illum<br />
| {{No}}<br />
| {{No}}<br />
| C<br />
| AGPL-3.0<br />
| Reacts to key presses.<br />
| {{AUR|illum-git}}<br />
| https://github.com/jmesmon/illum<br />
|-<br />
| Light<br />
| {{Yes}}<br />
| {{No}}<br />
| C<br />
| GPL-3.0-only<br />
| {{Y|Binary is setuid unless otherwise configured.}}<br />
| {{Pkg|light}}<br />
| https://haikarainen.github.io/light<br />
|-<br />
| Lux<br />
| {{No}}<br />
| {{No}}<br />
| Shell<br />
| MIT<br />
| -<br />
| {{AUR|lux}}<br />
| https://github.com/Ventto/lux<br />
|}<br />
<br />
=== xbacklight ===<br />
<br />
Brightness can be set using the {{Pkg|xorg-xbacklight}} package.<br />
<br />
{{Note|1=<nowiki></nowiki><br />
* xbacklight only works with [[Intel]]. Other drivers (e.g. [[Radeon]]) did not add support for the RandR backlight property. <br />
* xbacklight currently does not work with the modesetting driver [https://gitlab.freedesktop.org/xorg/xserver/issues/47].<br />
}}<br />
<br />
To set brightness to 50% of maximum:<br />
<br />
$ xbacklight -set 50<br />
<br />
Increments can be used instead of absolute values, for example to increase or decrease brightness by 10%:<br />
<br />
$ xbacklight -inc 10<br />
$ xbacklight -dec 10<br />
<br />
Gamma can be set using either the {{Pkg|xorg-xrandr}} or {{Pkg|xorg-xgamma}} package. The following commands create the same effect:<br />
<br />
$ xrandr --output LVDS1 --gamma 1.0:1.0:1.0<br />
$ xgamma -rgamma 1 -ggamma 1 -bgamma 1<br />
<br />
{{Tip|These commands can be bound to keyboard keys as described in [[Keyboard shortcuts#Xorg]].}}<br />
<br />
If you get the "No outputs have backlight property" error, it is because xrandr/xbacklight does not choose the right directory in {{ic|/sys/class/backlight}}. You can specify the directory by setting the {{ic|Backlight}} option of the device section in {{ic|/etc/X11/xorg.conf.d/20-''video''.conf}}. For instance, if the name of the directory is {{ic|intel_backlight}} and using the [[Intel]] driver, the device section may be configured as follows:<br />
<br />
{{hc|/etc/X11/xorg.conf.d/20-intel.conf|<br />
Section "Device"<br />
Identifier "Intel Graphics" <br />
Driver "intel"<br />
Option "Backlight" "intel_backlight"<br />
EndSection}}<br />
<br />
See {{Bug|27677}} and https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=651741 for details.<br />
<br />
If you have enabled [[Intel graphics#Fastboot|Intel Fastboot]] you might also get the {{ic|No outputs have backlight property}} error. In this case, trying the above method may cause Xorg to crash on start up. You should disable it to fix the issue. It is [https://bugs.freedesktop.org/show_bug.cgi?id=108225 known] to cause issues with brightness control.<br />
<br />
=== setpci ===<br />
<br />
It is possible to set the register of the graphic card to adjust the backlight. It means you adjust the backlight by manipulating the hardware directly, which can be risky and generally is not a good idea. Not all of the graphic cards support this method.<br />
<br />
When using this method, you need to use {{ic|lspci}} first to find out where your graphic card is.<br />
# setpci -s 00:02.0 F4.B=0<br />
<br />
=== Using DBus with Gnome ===<br />
<br />
Brightness can also be adjusted as the gnome controls do. Changes are reflected in the gnome UI using this method.<br />
gdbus call --session --dest org.gnome.SettingsDaemon.Power --object-path /org/gnome/SettingsDaemon/Power --method org.freedesktop.DBus.Properties.Set org.gnome.SettingsDaemon.Power.Screen Brightness "<int32 50>"<br />
<br />
Steps in brightness for keyboard contol can be implemented with this method as well.<br />
gdbus call --session --dest org.gnome.SettingsDaemon.Power --object-path /org/gnome/SettingsDaemon/Power --method org.gnome.SettingsDaemon.Power.Screen.StepUp<br />
gdbus call --session --dest org.gnome.SettingsDaemon.Power --object-path /org/gnome/SettingsDaemon/Power --method org.gnome.SettingsDaemon.Power.Screen.StepDown<br />
<br />
== Color correction ==<br />
<br />
* {{App|Clight|User daemon utility that aims to fully manage your display. It can manage the screen temperature depending on the current time of the day, just like redshift does. It tries to use {{Pkg|geoclue}} to retrieve the user position if neither latitude or longitude are set in the configuration file. It also supports fixed times for sunrise and sunset.|https://github.com/FedeDP/Clight|{{AUR|clight-git}}}}<br />
* {{App|Monica|Monitor calibration tool. It works as frontend to xgamma to alter the gamma correction.|https://web.archive.org/web/20090815224839/http://www.pcbypaul.com/software/monica.html|{{Pkg|monica}}}}<br />
* {{App|[[Redshift]]|Color temperature adjustment tool. It 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 [[Wikipedia:f.lux|f.lux]].|http://jonls.dk/redshift/|{{Pkg|redshift}}}}<br />
* {{App|xcalib|Lightweight monitor calibration loader which can load an ICC monitor profile to be shared across desktop applications.|https://github.com/OpenICC/xcalib|{{AUR|xcalib}}}}<br />
* {{App|xgamma|Alter a monitor's gamma correction.|https://xorg.freedesktop.org/|{{Pkg|xorg-xgamma}}}}<br />
<br />
=== xcalib ===<br />
<br />
{{Note|''xcalib'' does ''not'' change the backlight power, it just modifies the video LUT table: this means that your battery life will be unaffected by the change. Nevertheless, it could be useful when no backlight control is available (Desktop PCs). Use {{ic|xcalib -clear}} to reset the LUT.}}<br />
<br />
The package {{AUR|xcalib}} ([http://xcalib.sourceforge.net/ upstream URL]) is available in the [[AUR]] and can be used to dim the screen. A demonstration video is available on [https://www.youtube.com/watch?v=A9xsvntT6i4 YouTube]. This program can correct gamma, invert colors, and reduce contrast, the latter of which we use in this case. For example, to dim down:<br />
<br />
$ xcalib -co 40 -a<br />
<br />
This program uses ICC technology to interact with X11 and while the screen is dimmed, you may find that the mouse cursor is just as bright as before.<br />
<br />
=== NVIDIA settings ===<br />
<br />
Users of [[NVIDIA|NVIDIA's proprietary drivers]] users can change display brightness via the nvidia-settings utility under "X Server Color Correction." However, note that this has absolutely nothing to do with backlight (intensity), it merely adjusts the color output. (Reducing brightness this way is a power-inefficient last resort when all other options fail; increasing brightness spoils your color output completely, in a way similar to overexposed photos.)<br />
<br />
=== Increase brightness above maximum level ===<br />
<br />
You can use [[xrandr]] to increase perceived brightness above its maximum level (the same caveats mentioned above for Nvidia apply):<br />
<br />
$ xrandr --output ''output_name'' --brightness 2<br />
<br />
This should roughly double luma in the image. It will sacrifice color quality for brightness, nevertheless it is particularly suited for situations where the ambient light is very bright (e.g. sunlight).<br />
<br />
== External monitors ==<br />
<br />
[[Wikipedia:https://en.wikipedia.org/wiki/Display_Data_Channel#DDC.2FCI|DDC/CI]] (Display Data Channel Command Interface) can be used to communicate with external monitors implementing MCCS (Monitor Control Command Set) over I2C. DDC can control brightness, contrast, inputs, etc on supported monitors. Settings available via the OSD (On-Screen Display) panel can usually also be managed via DDC. The [[kernel module]] {{ic|i2c-dev}} may need to be loaded if the {{ic|/dev/i2c-*}} devices do not exist.<br />
<br />
[http://www.ddcutil.com/ ddcutil] can be used to query and set brightness settings:<br />
<br />
{{hc|# ddcutil capabilities {{!}} grep "Feature: 10"|<br />
Feature: 10 (Brightness)<br />
}}<br />
<br />
{{hc|1=# ddcutil getvcp 10|2=<br />
VCP code 0x10 (Brightness ): current value = 60, max value = 100<br />
}}<br />
<br />
# ddcutil setvcp 10 70<br />
<br />
Alternatively, one may use {{AUR|ddcci-driver-linux-dkms}} to expose external monitors in sysfs. Then, after loading the {{ic|ddcci}} [[kernel module]], one can use any [[#Backlight utilities|backlight utility]].<br />
<br />
== Troubleshooting ==<br />
<br />
=== Backlight PWM modulation frequency (Intel i915 only) ===<br />
<br />
Laptops with LED backlight are known to have screen flicker sometimes. This is because the most efficient way of controlling LED backlight brightness is by turning the LED's on and off very quickly varying the amount of time they are on. <br />
<br />
However, the frequency of the switching, so-called PWM (pulse-width modulation) frequency, may not be high enough for the eye to perceive it as a single brightness and instead see flickering. This causes some people to have symptoms such as headaches and eyestrain.<br />
<br />
If you have an Intel i915 GPU, then it may be possible to adjust PWM frequency to eliminate flicker.<br />
<br />
Period of PWM (inverse to frequency) is stored in 2 higher bytes of {{ic|0xC8254}} register (if you are using the Intel GM45 chipset use address {{ic|0x61254}} instead). To manipulate registers values install {{Pkg|intel-gpu-tools}} from the official repositories.<br />
<br />
To increase the frequency, period must be reduced. For example:<br />
<br />
{{hc|# intel_reg read 0xC8254|<br />
0xC8254 : 0x12281228|<br />
}}<br />
<br />
Then to double PWM frequency divide 2 higher bytes (4 higher hex digits) by 2 and write back resulting value, keeping lower bytes unchanged:<br />
<br />
# intel_reg write 0xC8254 0x09141228<br />
<br />
You can use online calculator to calculate desired value http://devbraindom.blogspot.com/2013/03/eliminate-led-screen-flicker-with-intel.html<br />
<br />
To set new frequency automatically, consider writing an udev rule or install {{AUR|intelpwm-udev}}.<br />
<br />
=== Inverted Brightness (Intel i915 only) ===<br />
<br />
Symptoms:<br />
* after installing {{ic|xf86-video-intel}} systemd-backlight.service turns off the backlight during boot<br />
** possible solution: mask systemd-backlight.service<br />
* switching from X to another VT turns the backlight off<br />
* the brightness keys are inverted (i.e. turning up the brightness makes the screen darker)<br />
<br />
This problem may be solved by adding {{ic|i915.invert_brightness&#61;1}} to the list of [[kernel parameters]].<br />
<br />
=== Unable to control eDP Panel brightness (Intel i915 only) ===<br />
<br />
Embedded Display Port (eDP) v1.2 introduced a new display panel control protocol for backlight and other controls that works through the AUX channel.[https://www.vesa.org/wp-content/uploads/2010/12/DisplayPort-DevCon-Presentation-eDP-Dec-2010-v3.pdf]<br />
<br />
By default the i915 driver tries to use PWM to control backlight brightness, which might not work.<br />
<br />
To set the backlight through writes to DPCD registers using the AUX channel set {{ic|1=i915.enable_dpcd_backlight}} as [[kernel parameter]] or set in {{ic|/etc/modprobe.d/i915.conf}}:<br />
<br />
{{hc|/etc/modprobe.d/i915.conf|<nowiki><br />
options i915 enable_dpcd_backlight<br />
</nowiki>}}<br />
<br />
=== sysfs modified but no brightness change ===<br />
<br />
{{Note|This behavior and their workarounds have been confirmed on the Dell M6700 with Nvidia K5000m (BIOS version prior to A10) and Clevo P750ZM (Eurocom P5 Pro Extreme) with Nvidia 980m.}}<br />
<br />
On some systems, the brightness hotkeys on your keyboard correctly modify the values of the acpi interface in {{ic|/sys/class/backlight/acpi_video0/actual_brightness}} but the brightness of the screen is not changed. Brightness applets from [[desktop environments]] may also show changes to no effect.<br />
<br />
If you have tested the recommended kernel parameters and only {{ic|xbacklight}} works, then you may be facing an incompatibility between your BIOS and kernel driver.<br />
<br />
In this case the only solution is to wait for a fix either from the BIOS or GPU driver manufacturer.<br />
<br />
A workaround is to use the inotify kernel api to trigger {{ic|xbacklight}} each time the value of {{ic|/sys/class/backlight/acpi_video0/actual_brightness}} changes.<br />
<br />
First [[install]] {{Pkg|inotify-tools}}. Then create a script around inotify that will be launched upon each boot or through [[autostart]].<br />
<br />
{{hc|/usr/local/bin/xbacklightmon|<nowiki><br />
#!/bin/sh<br />
<br />
path=/sys/class/backlight/acpi_video0<br />
<br />
luminance() {<br />
read -r level < "$path"/actual_brightness<br />
factor=$((100 / max))<br />
printf '%d\n' "$((level * factor))"<br />
}<br />
<br />
read -r max < "$path"/max_brightness<br />
<br />
xbacklight -set "$(luminance)"<br />
<br />
inotifywait -me modify --format '' "$path"/actual_brightness | while read; do<br />
xbacklight -set "$(luminance)"<br />
done<br />
</nowiki>}}</div>Delapouitehttps://wiki.archlinux.org/index.php?title=Backlight&diff=579257Backlight2019-08-09T14:49:43Z<p>Delapouite: add link to xrandr</p>
<hr />
<div>[[Category:Laptops]]<br />
[[Category:Power management]]<br />
[[ru:Backlight]]<br />
[[ja:バックライト]]<br />
Screen brightness might be tricky to control. On some machines physical hardware switches are missing and software solutions may not work well. However, it is generally possible to find a functional method for a given hardware. This article aims to summarize all possible ways to adjust the backlight.<br />
<br />
== Overview ==<br />
<br />
There are many ways to control brightness of a monitor, laptop or integrated panel (such as the iMac). According to [https://bugs.launchpad.net/ubuntu/+source/xserver-xorg-video-intel/+bug/397617 these] [https://lore.kernel.org/patchwork/patch/528936/#708706 discussions] and this [https://wiki.ubuntu.com/Kernel/Debugging/Backlight wiki page] the control method can be divided into these categories:<br />
<br />
* brightness is controlled by vendor-specified hotkey and there is no interface for the OS to adjust the brightness.<br />
* brightness is controlled by either the ACPI, graphic or platform driver.<br />
* brightness is controlled by HW register through setpci.<br />
<br />
All methods are exposed to the user through {{ic|/sys/class/backlight}} and [[xrandr]]/xbacklight can choose one method to control brightness. It is still not very clear which one xbacklight prefers by default.<br />
<br />
{{Note|On some new laptops with an OLED screen you can't use xbacklight since OLED screens have no backlight so while you will be able to change the brightness values this will not have any affect on the actual screen brightness. In this case see, [[#OLED screen brightness]]}}<br />
<br />
== ACPI ==<br />
<br />
The brightness of the screen backlight is adjusted by setting the power level of the backlight LEDs or cathodes. The power level can often be controlled using the ACPI kernel module for video. An interface to this module is provided via a sysfs directory at {{ic|/sys/class/backlight/}}.<br />
<br />
The name of the directory depends on the graphics card model.<br />
<br />
{{hc|$ ls /sys/class/backlight/|<br />
acpi_video0<br />
}}<br />
<br />
In this case, the backlight is managed by an ATI graphics card. In the case of an Intel card, the directory is called {{ic|intel_backlight}}. In the following examples, {{ic|acpi_video0}} is used. If you use an Intel card, simply replace {{ic|acpi_video0}} with {{ic|intel_backlight}} in the examples.<br />
<br />
The directory contains the following files and subdirectories:<br />
<br />
{{hc|$ ls /sys/class/backlight/acpi_video0/|<br />
actual_brightness brightness max_brightness subsystem/ uevent <br />
bl_power device/ power/ type<br />
}}<br />
<br />
The maximum brightness can be displayed by reading from {{ic|max_brightness}}, which is often 15.<br />
<br />
{{hc|$ cat /sys/class/backlight/acpi_video0/max_brightness|<br />
15<br />
}}<br />
<br />
The brightness can be set by writing a number to {{ic|brightness}}. Attempting to set a brightness greater than the maximum results in an error.<br />
<br />
# echo 5 > /sys/class/backlight/acpi_video0/brightness<br />
<br />
By default, only {{ic|root}} can change the brightness by this method. To allow users in the {{ic|video}} group to change the brightness, a [[udev]] rule such as the following can be used:<br />
<br />
{{hc|/etc/udev/rules.d/backlight.rules|<nowiki><br />
ACTION=="add", SUBSYSTEM=="backlight", KERNEL=="acpi_video0", RUN+="/bin/chgrp video /sys/class/backlight/%k/brightness"<br />
ACTION=="add", SUBSYSTEM=="backlight", KERNEL=="acpi_video0", RUN+="/bin/chmod g+w /sys/class/backlight/%k/brightness"<br />
</nowiki>}}<br />
<br />
=== Kernel command-line options ===<br />
<br />
Sometimes ACPI does not work well due to different motherboard implementations and ACPI quirks. This results in, for instance, inaccurate brightness notifications. This includes some laptops with dual graphics (e.g., Nvidia/Radeon dedicated GPU with Intel/AMD integrated GPU). Additionally, ACPI sometimes needs to register its own {{ic|acpi_video0}} backlight even if one already exists (such as {{ic|intel_backlight}}), which can be done by adding one of the following [[kernel parameters]]:<br />
<br />
acpi_backlight=video<br />
acpi_backlight=vendor<br />
acpi_backlight=native<br />
<br />
If you find that changing the {{ic|acpi_video0}} backlight does not actually change the brightness, you may need to use {{ic|1=acpi_backlight=none}}.<br />
<br />
{{Tip|<br />
* On Nvidia Optimus laptops, the kernel parameter {{ic|nomodeset}} can interfere with the ability to adjust the backlight.<br />
* On an Asus notebooks you might also need to load the {{ic|asus-nb-wmi}} [[kernel module]].<br />
* Disabling legacy boot on Dell XPS13 breaks backlight support.<br />
}}<br />
<br />
=== Udev rule ===<br />
<br />
If the ACPI interface is available, the backlight level can be set at boot using a [[udev]] rule:<br />
<br />
{{hc|/etc/udev/rules.d/81-backlight.rules|<nowiki><br />
# Set backlight level to 8<br />
SUBSYSTEM=="backlight", ACTION=="add", KERNEL=="acpi_video0", ATTR{brightness}="8"</nowiki>}}<br />
<br />
{{Note|The systemd-backlight service restores the previous backlight brightness level at boot. To prevent conflicts for the above rules, see [[#Save/Restore_functionality]].}}<br />
<br />
{{Tip|To set the backlight depending on power state, see [[Power management#Using a script and an udev rule]] and use your favourite [[#Backlight utilities|backlight utility]] in the script.}}<br />
<br />
== OLED screen brightness ==<br />
<br />
If using a desktop environment or a laptop with an OLED screen, you may notice the backlight does not function (the brightness control keys toggles the on-screen display and the brightness values can be manually adjusted in {{ic|/sys/class/backlight/intel_backlight}}, but it doesn't change the actual brightness level of the screen). Since on some models the screen is OLED (which do not have physical backlights), you may need to shim the ACPI backlight functions to update Xrandr's "--backlight" option. This is done by monitoring the acpi_video0 levels, and updating the xrandr brightness levels accordingly.<br />
<br />
For this to work, you must first install {{Pkg|inotify-tool}}{{Broken package link|package not found}} and {{Pkg|bc}}. Then, create the following file:<br />
<br />
$ cat /usr/local/bin/xbacklightmon<br />
<br />
#!/bin/sh<br />
#use LC_NUMERIC if you are using an European LC, else printf will not work because it expects an comma instead of a decimal point<br />
LC_NUMERIC="en_US.UTF-8"<br />
<br />
# modify this path to the location of your backlight class<br />
path=/sys/class/backlight/intel_backlight<br />
<br />
luminance() {<br />
read -r level < "$path"/actual_brightness<br />
factor=$((max))<br />
new_brightness="$(bc -l <<< "scale = 2; $level / $factor")"<br />
printf '%f\n' $new_brightness<br />
}<br />
<br />
read -r max < "$path"/max_brightness<br />
<br />
xrandr --output eDP-1 --brightness "$(luminance)"<br />
<br />
inotifywait -me modify --format <nowiki>''</nowiki> "$path"/actual_brightness | while read; do<br />
xrandr --output eDP-1 --brightness "$(luminance)"<br />
done<br />
<br />
Then make this file executable and owned by root:<br />
<br />
$ chown root:root /usr/local/bin/xbacklightmon<br />
$ chmod 755 /usr/local/bin/xbacklightmon<br />
<br />
You may test this by running the file, and using the backlight keys to test if the brightness updates. Finally, configure the script to run when you display manager starts.<br />
<br />
'''Please note:''' If you are using the xf86-video-intel driver, you will need to replace 'eDP-1' in the script above with 'eDP1'<br />
You also have to change the path to 'path=/sys/class/backlight/intel_backlight/' if you are using xf86-video-intel<br />
<br />
== Switch off the backlight ==<br />
<br />
Switching off the backlight (for example when one locks a notebook) can be useful to conserve battery energy. Ideally the following command should work for any [[Xorg]] graphical session:<br />
<br />
xset dpms force off<br />
<br />
The backlight should switch on again on mouse movement or keyboard input. Alternately {{ic|xset s}} could be used.<br />
<br />
The following example will toggle the screen saver timeout for a similar result (should be bound to a key):<br />
<br />
{{hc|~/.local/bin/xlcd.sh|<br />
#!/usr/bin/dash<br />
read lcd < /tmp/lcd<br />
if [ "$lcd" -eq "0" ]; then<br />
xset s<br />
echo 1 > /tmp/lcd<br />
sleep 1<br />
notify-send -t 2000 LCD\ ON<br />
else<br />
xset s 3<br />
echo 0 > /tmp/lcd<br />
notify-send -t 2000 LCD\ OFF<br />
fi<br />
}}<br />
<br />
If the previous commands do not work, there is a chance that ''vbetool'' may work. Note, however, that in this case the backlight must be manually activated again. The command is as follows:<br />
<br />
$ vbetool dpms off<br />
<br />
To activate the backlight again:<br />
<br />
$ vbetool dpms on<br />
<br />
For example, this can be put to use when closing the notebook lid using [[Acpid]].<br />
<br />
== Save/Restore functionality ==<br />
<br />
The [[systemd]] package includes the service {{ic|systemd-backlight@.service}}, which is enabled by default and "static". It saves the backlight brightness level at shutdown and restores it at boot. The service uses the ACPI method described in [[#ACPI]], generating services for each folder found in {{ic|/sys/class/backlight/}}. For example, if there is a folder named {{ic|acpi_video0}}, it generates a service called {{ic|systemd-backlight@backlight:acpi_video0.service}}. When using other methods of setting the backlight at boot, it is recommended to stop systemd-backlight from restoring the backlight by setting the [[kernel parameters]] parameter {{ic|1=systemd.restore_state=0}}. See {{man|8|systemd-backlight@.service}} for details.<br />
<br />
{{Note|Some laptops have multiple video cards (e.g. Optimus) and the backlight restoration fails. Try [[systemd#Using units|masking]] an instance of the service (e.g. {{ic|systemd-backlight@backlight:acpi_video1}} for {{ic|acpi_video1}}).}}<br />
<br />
The {{AUR|relight}} package provides an alternative systemd-based method of saving and restoring screen brightness.<br />
<br />
Additionally, the {{AUR|brillo}} and {{Pkg|light}} utilities support save/restore functionality. These two may be more useful if one wishes to restore the screen brightness on a per-user basis, however no systemd units are provided to accomplish this.<br />
<br />
== Backlight utilities ==<br />
<br />
The utilities in the following table can be used to control screen brightness. All of them are compatible with Wayland and do not require X.<br />
<br />
{| class="wikitable sortable"<br />
!| Name<br />
! Controls keyboard backlights<br />
! Reacts to ambient brightness<br />
! Language<br />
! License<br />
! Notes<br />
! Package<br />
! Homepage<br />
|-<br />
| acpilight<br />
| {{Yes}}<br />
| {{No}}<br />
| Python3<br />
| GPL-3.0-or-later<br />
| "xbacklight" compatible<br />
| {{Pkg|acpilight}}<br />
| https://gitlab.com/wavexx/acpilight<br />
|-<br />
| brightd<br />
| {{No}}<br />
| {{No}}<br />
| C<br />
| GPL-2.0<br />
| Dims the screen when there is no user input for some time.<br />
| {{AUR|brightd}}<br />
| http://www.pberndt.com/Programme/Linux/brightd<br />
|-<br />
| brillo<br />
| {{Yes}}<br />
| {{No}}<br />
| C<br />
| GPL-3.0-only<br />
| Supports smooth and relative adjustments.<br />
| {{AUR|brillo}}<br />
| https://gitlab.com/cameronnemo/brillo<br />
|-<br />
| brightnessctl<br />
| {{Yes}}<br />
| {{No}}<br />
| C<br />
| MIT<br />
| {{Y|Binary is setuid unless otherwise configured.}}<br />
| {{Pkg|brightnessctl}}<br />
| https://github.com/Hummer12007/brightnessctl<br />
|-<br />
| Calise<br />
| {{No}}<br />
| {{Yes}}<br />
| Python2<br />
| GPL-3.0<br />
| -<br />
| {{AUR|calise}}<br />
| http://calise.sourceforge.net<br />
|-<br />
| Clight<br />
| {{Yes}}<br />
| {{Yes}}<br />
| C<br />
| GPL-3.0-or-later<br />
| Manages screen temperature and smoothly dims brightness after a timeout. Turns webcam into an ambient light sensor.<br />
| {{AUR|clight}}<br />
| https://github.com/FedeDP/Clight<br />
|-<br />
| macbook-lighter<br />
| {{Yes}}<br />
| {{Yes}}<br />
| Bash,Perl<br />
| GPL<br />
| Macbook screen/keyboard backlight CLI and auto-adjust on ambient light.<br />
| {{AUR|macbook-lighter}}<br />
| https://github.com/harttle/macbook-lighter<br />
|-<br />
| enlighten<br />
| {{No}}<br />
| {{No}}<br />
| C<br />
| GPL-3.0-or-later<br />
| -<br />
| {{AUR|enlighten-git}}<br />
| https://github.com/HalosGhost/enlighten<br />
|-<br />
| illum<br />
| {{No}}<br />
| {{No}}<br />
| C<br />
| AGPL-3.0<br />
| Reacts to key presses.<br />
| {{AUR|illum-git}}<br />
| https://github.com/jmesmon/illum<br />
|-<br />
| Light<br />
| {{Yes}}<br />
| {{No}}<br />
| C<br />
| GPL-3.0-only<br />
| {{Y|Binary is setuid unless otherwise configured.}}<br />
| {{Pkg|light}}<br />
| https://haikarainen.github.io/light<br />
|-<br />
| Lux<br />
| {{No}}<br />
| {{No}}<br />
| Shell<br />
| MIT<br />
| -<br />
| {{AUR|lux}}<br />
| https://github.com/Ventto/lux<br />
|}<br />
<br />
=== xbacklight ===<br />
<br />
Brightness can be set using the {{Pkg|xorg-xbacklight}} package.<br />
<br />
{{Note|1=<nowiki></nowiki><br />
* xbacklight only works with [[Intel]]. Other drivers (e.g. [[Radeon]]) did not add support for the RandR backlight property. <br />
* xbacklight currently does not work with the modesetting driver [https://gitlab.freedesktop.org/xorg/xserver/issues/47].<br />
}}<br />
<br />
To set brightness to 50% of maximum:<br />
<br />
$ xbacklight -set 50<br />
<br />
Increments can be used instead of absolute values, for example to increase or decrease brightness by 10%:<br />
<br />
$ xbacklight -inc 10<br />
$ xbacklight -dec 10<br />
<br />
Gamma can be set using either the {{Pkg|xorg-xrandr}} or {{Pkg|xorg-xgamma}} package. The following commands create the same effect:<br />
<br />
$ xrandr --output LVDS1 --gamma 1.0:1.0:1.0<br />
$ xgamma -rgamma 1 -ggamma 1 -bgamma 1<br />
<br />
{{Tip|These commands can be bound to keyboard keys as described in [[Keyboard shortcuts#Xorg]].}}<br />
<br />
If you get the "No outputs have backlight property" error, it is because xrandr/xbacklight does not choose the right directory in {{ic|/sys/class/backlight}}. You can specify the directory by setting the {{ic|Backlight}} option of the device section in {{ic|/etc/X11/xorg.conf.d/20-''video''.conf}}. For instance, if the name of the directory is {{ic|intel_backlight}} and using the [[Intel]] driver, the device section may be configured as follows:<br />
<br />
{{hc|/etc/X11/xorg.conf.d/20-intel.conf|<br />
Section "Device"<br />
Identifier "Intel Graphics" <br />
Driver "intel"<br />
Option "Backlight" "intel_backlight"<br />
EndSection}}<br />
<br />
See {{Bug|27677}} and https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=651741 for details.<br />
<br />
If you have enabled [[Intel graphics#Fastboot|Intel Fastboot]] you might also get the {{ic|No outputs have backlight property}} error. In this case, trying the above method may cause Xorg to crash on start up. You should disable it to fix the issue. It is [https://bugs.freedesktop.org/show_bug.cgi?id=108225 known] to cause issues with brightness control.<br />
<br />
=== setpci ===<br />
<br />
It is possible to set the register of the graphic card to adjust the backlight. It means you adjust the backlight by manipulating the hardware directly, which can be risky and generally is not a good idea. Not all of the graphic cards support this method.<br />
<br />
When using this method, you need to use {{ic|lspci}} first to find out where your graphic card is.<br />
# setpci -s 00:02.0 F4.B=0<br />
<br />
=== Using DBus with Gnome ===<br />
<br />
Brightness can also be adjusted as the gnome controls do. Changes are reflected in the gnome UI using this method.<br />
gdbus call --session --dest org.gnome.SettingsDaemon.Power --object-path /org/gnome/SettingsDaemon/Power --method org.freedesktop.DBus.Properties.Set org.gnome.SettingsDaemon.Power.Screen Brightness "<int32 50>"<br />
<br />
Steps in brightness for keyboard contol can be implemented with this method as well.<br />
gdbus call --session --dest org.gnome.SettingsDaemon.Power --object-path /org/gnome/SettingsDaemon/Power --method org.gnome.SettingsDaemon.Power.Screen.StepUp<br />
gdbus call --session --dest org.gnome.SettingsDaemon.Power --object-path /org/gnome/SettingsDaemon/Power --method org.gnome.SettingsDaemon.Power.Screen.StepDown<br />
<br />
== Color correction ==<br />
<br />
* {{App|Clight|User daemon utility that aims to fully manage your display. It can manage the screen temperature depending on the current time of the day, just like redshift does. It tries to use {{Pkg|geoclue}} to retrieve the user position if neither latitude or longitude are set in the configuration file. It also supports fixed times for sunrise and sunset.|https://github.com/FedeDP/Clight|{{AUR|clight-git}}}}<br />
* {{App|Monica|Monitor calibration tool. It works as frontend to xgamma to alter the gamma correction.|https://web.archive.org/web/20090815224839/http://www.pcbypaul.com/software/monica.html|{{Pkg|monica}}}}<br />
* {{App|[[Redshift]]|Color temperature adjustment tool. It 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 [[Wikipedia:f.lux|f.lux]].|http://jonls.dk/redshift/|{{Pkg|redshift}}}}<br />
* {{App|xcalib|Lightweight monitor calibration loader which can load an ICC monitor profile to be shared across desktop applications.|https://github.com/OpenICC/xcalib|{{AUR|xcalib}}}}<br />
* {{App|xgamma|Alter a monitor's gamma correction.|https://xorg.freedesktop.org/|{{Pkg|xorg-xgamma}}}}<br />
<br />
=== xcalib ===<br />
<br />
{{Note|''xcalib'' does ''not'' change the backlight power, it just modifies the video LUT table: this means that your battery life will be unaffected by the change. Nevertheless, it could be useful when no backlight control is available (Desktop PCs). Use {{ic|xcalib -clear}} to reset the LUT.}}<br />
<br />
The package {{AUR|xcalib}} ([http://xcalib.sourceforge.net/ upstream URL]) is available in the [[AUR]] and can be used to dim the screen. A demonstration video is available on [https://www.youtube.com/watch?v=A9xsvntT6i4 YouTube]. This program can correct gamma, invert colors, and reduce contrast, the latter of which we use in this case. For example, to dim down:<br />
<br />
$ xcalib -co 40 -a<br />
<br />
This program uses ICC technology to interact with X11 and while the screen is dimmed, you may find that the mouse cursor is just as bright as before.<br />
<br />
=== NVIDIA settings ===<br />
<br />
Users of [[NVIDIA|NVIDIA's proprietary drivers]] users can change display brightness via the nvidia-settings utility under "X Server Color Correction." However, note that this has absolutely nothing to do with backlight (intensity), it merely adjusts the color output. (Reducing brightness this way is a power-inefficient last resort when all other options fail; increasing brightness spoils your color output completely, in a way similar to overexposed photos.)<br />
<br />
=== Increase brightness above maximum level ===<br />
<br />
You can use [[xrandr]] to increase perceived brightness above its maximum level (the same caveats mentioned above for Nvidia apply):<br />
<br />
$ xrandr --output ''output_name'' --brightness 2<br />
<br />
This should roughly double luma in the image. It will sacrifice color quality for brightness, nevertheless it is particularly suited for situations where the ambient light is very bright (e.g. sunlight).<br />
<br />
== External monitors ==<br />
<br />
DDC/CI (Display Data Channel Command Interface) can be used to communicate with external monitors implementing MCCS (Monitor Control Command Set) over I2C. DDC can control brightness, contrast, inputs, etc on supported monitors. Settings available via the OSD (On-Screen Display) panel can usually also be managed via DDC. The [[kernel module]] {{ic|i2c-dev}} may need to be loaded if the {{ic|/dev/i2c-*}} devices do not exist.<br />
<br />
[http://www.ddcutil.com/ ddcutil] can be used to query and set brightness settings:<br />
<br />
{{hc|# ddcutil capabilities {{!}} grep "Feature: 10"|<br />
Feature: 10 (Brightness)<br />
}}<br />
<br />
{{hc|1=# ddcutil getvcp 10|2=<br />
VCP code 0x10 (Brightness ): current value = 60, max value = 100<br />
}}<br />
<br />
# ddcutil setvcp 10 70<br />
<br />
Alternatively, one may use {{AUR|ddcci-driver-linux-dkms}} to expose external monitors in sysfs. Then, after loading the {{ic|ddcci}} [[kernel module]], one can use any [[#Backlight utilities|backlight utility]].<br />
<br />
== Troubleshooting ==<br />
<br />
=== Backlight PWM modulation frequency (Intel i915 only) ===<br />
<br />
Laptops with LED backlight are known to have screen flicker sometimes. This is because the most efficient way of controlling LED backlight brightness is by turning the LED's on and off very quickly varying the amount of time they are on. <br />
<br />
However, the frequency of the switching, so-called PWM (pulse-width modulation) frequency, may not be high enough for the eye to perceive it as a single brightness and instead see flickering. This causes some people to have symptoms such as headaches and eyestrain.<br />
<br />
If you have an Intel i915 GPU, then it may be possible to adjust PWM frequency to eliminate flicker.<br />
<br />
Period of PWM (inverse to frequency) is stored in 2 higher bytes of {{ic|0xC8254}} register (if you are using the Intel GM45 chipset use address {{ic|0x61254}} instead). To manipulate registers values install {{Pkg|intel-gpu-tools}} from the official repositories.<br />
<br />
To increase the frequency, period must be reduced. For example:<br />
<br />
{{hc|# intel_reg read 0xC8254|<br />
0xC8254 : 0x12281228|<br />
}}<br />
<br />
Then to double PWM frequency divide 2 higher bytes (4 higher hex digits) by 2 and write back resulting value, keeping lower bytes unchanged:<br />
<br />
# intel_reg write 0xC8254 0x09141228<br />
<br />
You can use online calculator to calculate desired value http://devbraindom.blogspot.com/2013/03/eliminate-led-screen-flicker-with-intel.html<br />
<br />
To set new frequency automatically, consider writing an udev rule or install {{AUR|intelpwm-udev}}.<br />
<br />
=== Inverted Brightness (Intel i915 only) ===<br />
<br />
Symptoms:<br />
* after installing {{ic|xf86-video-intel}} systemd-backlight.service turns off the backlight during boot<br />
** possible solution: mask systemd-backlight.service<br />
* switching from X to another VT turns the backlight off<br />
* the brightness keys are inverted (i.e. turning up the brightness makes the screen darker)<br />
<br />
This problem may be solved by adding {{ic|i915.invert_brightness&#61;1}} to the list of [[kernel parameters]].<br />
<br />
=== Unable to control eDP Panel brightness (Intel i915 only) ===<br />
<br />
Embedded Display Port (eDP) v1.2 introduced a new display panel control protocol for backlight and other controls that works through the AUX channel.[https://www.vesa.org/wp-content/uploads/2010/12/DisplayPort-DevCon-Presentation-eDP-Dec-2010-v3.pdf]<br />
<br />
By default the i915 driver tries to use PWM to control backlight brightness, which might not work.<br />
<br />
To set the backlight through writes to DPCD registers using the AUX channel set {{ic|1=i915.enable_dpcd_backlight}} as [[kernel parameter]] or set in {{ic|/etc/modprobe.d/i915.conf}}:<br />
<br />
{{hc|/etc/modprobe.d/i915.conf|<nowiki><br />
options i915 enable_dpcd_backlight<br />
</nowiki>}}<br />
<br />
=== sysfs modified but no brightness change ===<br />
<br />
{{Note|This behavior and their workarounds have been confirmed on the Dell M6700 with Nvidia K5000m (BIOS version prior to A10) and Clevo P750ZM (Eurocom P5 Pro Extreme) with Nvidia 980m.}}<br />
<br />
On some systems, the brightness hotkeys on your keyboard correctly modify the values of the acpi interface in {{ic|/sys/class/backlight/acpi_video0/actual_brightness}} but the brightness of the screen is not changed. Brightness applets from [[desktop environments]] may also show changes to no effect.<br />
<br />
If you have tested the recommended kernel parameters and only {{ic|xbacklight}} works, then you may be facing an incompatibility between your BIOS and kernel driver.<br />
<br />
In this case the only solution is to wait for a fix either from the BIOS or GPU driver manufacturer.<br />
<br />
A workaround is to use the inotify kernel api to trigger {{ic|xbacklight}} each time the value of {{ic|/sys/class/backlight/acpi_video0/actual_brightness}} changes.<br />
<br />
First [[install]] {{Pkg|inotify-tools}}. Then create a script around inotify that will be launched upon each boot or through [[autostart]].<br />
<br />
{{hc|/usr/local/bin/xbacklightmon|<nowiki><br />
#!/bin/sh<br />
<br />
path=/sys/class/backlight/acpi_video0<br />
<br />
luminance() {<br />
read -r level < "$path"/actual_brightness<br />
factor=$((100 / max))<br />
printf '%d\n' "$((level * factor))"<br />
}<br />
<br />
read -r max < "$path"/max_brightness<br />
<br />
xbacklight -set "$(luminance)"<br />
<br />
inotifywait -me modify --format '' "$path"/actual_brightness | while read; do<br />
xbacklight -set "$(luminance)"<br />
done<br />
</nowiki>}}</div>Delapouitehttps://wiki.archlinux.org/index.php?title=Arch_boot_process&diff=579233Arch boot process2019-08-09T12:40:11Z<p>Delapouite: add link to MBR</p>
<hr />
<div>[[Category:Boot process]]<br />
[[Category:About Arch]]<br />
[[ar:Arch boot process]]<br />
[[cs:Arch boot process]]<br />
[[es:Arch boot process]]<br />
[[fr:Processus de boot]]<br />
[[it:Arch boot process]]<br />
[[ja:Arch ブートプロセス]]<br />
[[pt:Arch boot process]]<br />
[[ru:Arch boot process]]<br />
[[zh-hans:Arch boot process]]<br />
{{Related articles start}}<br />
{{Related|Master Boot Record}}<br />
{{Related|GUID Partition Table}}<br />
{{Related|Unified Extensible Firmware Interface}}<br />
{{Related|mkinitcpio}}<br />
{{Related|init}}<br />
{{Related|systemd}}<br />
{{Related|fstab}}<br />
{{Related|Autostarting}}<br />
{{Related articles end}}<br />
<br />
In order to boot Arch Linux, a Linux-capable [[#Boot loader|boot loader]] must be set up. The boot loader is responsible for loading the kernel and [[initial ramdisk]] before initiating the boot process. The procedure is quite different for [[Wikipedia:BIOS|BIOS]] and [[UEFI]] systems, the detailed description is given on this or linked pages.<br />
<br />
== Firmware types ==<br />
<br />
=== BIOS ===<br />
<br />
A [[Wikipedia:BIOS|BIOS]] or Basic Input-Output System is the very first program (firmware) that is executed once the system is switched on. In most cases it is stored in a flash memory in the motherboard itself and independent of the system storage.<br />
<br />
=== UEFI ===<br />
<br />
[[Unified Extensible Firmware Interface]] has support for reading both the partition table as well as file systems. UEFI does not launch any boot code in the Master Boot Record ([[MBR]]) whether it exists or not, instead booting relies on boot entries in [[Wikipedia:Non-volatile random-access memory|NVRAM]].<br />
<br />
The UEFI specification mandates support for the [[FAT|FAT12, FAT16, and FAT32]] file systems (see [http://www.uefi.org/sites/default/files/resources/UEFI%20Spec%202_7_A%20Sept%206.pdf#G17.1019485 UEFI specification version 2.7, section 13.3.1.1]), but any conformant vendor can optionally add support for additional filesystems; for example, Apple [[Mac]]s support (and by default use) their own HFS+ filesystem drivers. UEFI implementations also support ISO-9660 for optical discs.<br />
<br />
UEFI launches EFI applications, e.g. [[#Boot loader|boot loaders]], boot managers, [[Unified Extensible Firmware Interface#UEFI Shell|UEFI shell]], etc. These applications are usually stored as files in the [[EFI system partition]]. Each vendor can store its files in the EFI system partition under the {{ic|/EFI/''vendor_name''}} folder. The applications can be launched by adding a boot entry to the NVRAM or from the UEFI shell.<br />
<br />
The UEFI specification has support for legacy BIOS booting with its [[Wikipedia:Unified Extensible Firmware Interface#CSM booting|CSM (Compatibility Support Module)]]. If CSM is enabled in the UEFI, the UEFI will generate CSM boot entries for all drives. If a CSM boot entry is chosen to be booted from, the UEFI's CSM will attempt to boot from the drive's MBR.<br />
<br />
== System initialization ==<br />
<br />
=== Under BIOS ===<br />
<br />
# System switched on, the [[Wikipedia:Power-on self-test|power-on self-test (POST)]] is executed.<br />
# After POST, BIOS initializes the necessary system hardware for booting (disk, keyboard controllers etc.).<br />
# BIOS launches the first 440 bytes ([[Partitioning#Master Boot Record (bootstrap code)|the Master Boot Record bootstrap code area]]) of the first disk in the BIOS disk order.<br />
# The boot loader's first stage in the MBR boot code then launches its second stage code (if any) from either:<br />
#* next disk sectors after the MBR, i.e. the so called post-MBR gap (only on a MBR partition table).<br />
#* a partition's or a partitionless disk's [[Wikipedia:Volume boot record|volume boot record (VBR)]].<br />
#* the [[BIOS boot partition]] ([[GRUB]] on BIOS/GPT only).<br />
# The actual [[#Boot loader|boot loader]] is launched.<br />
# The boot loader then loads an operating system by either chain-loading or directly loading the operating system kernel.<br />
<br />
=== Under UEFI ===<br />
<br />
# System switched on, the [[Wikipedia:Power-on self-test|power-on self-test (POST)]] is executed.<br />
# UEFI initializes the hardware required for booting.<br />
# Firmware reads the boot entries in the NVRAM to determine which EFI application to launch and from where (e.g. from which disk and partition).<br />
#* A boot entry could simply be a disk. In this case the firmware looks for an [[EFI system partition]] on that disk and tries to find an EFI application in the fallback boot path {{ic|\EFI\BOOT\BOOTX64.EFI}} ({{ic|BOOTIA32.EFI}} on [[Unified Extensible Firmware Interface#UEFI firmware bitness|systems with a IA32 (32-bit) UEFI]]). This is how UEFI bootable removable media work.<br />
# Firmware launches the EFI application.<br />
#* This could be a [[#Boot loader|boot loader]] or the Arch [[kernel]] itself using [[EFISTUB]].<br />
#* It could be some other EFI application such as a UEFI shell or a [[#Boot loader|boot manager]] like [[systemd-boot]] or [[rEFInd]].<br />
<br />
If [[Secure Boot]] is enabled, the boot process will verify authenticity of the EFI binary by signature.<br />
<br />
{{Note|Some UEFI systems can only boot from the fallback boot path.}}<br />
<br />
=== Multibooting in UEFI ===<br />
<br />
Since each OS or vendor can maintain its own files within the [[EFI system partition]] without affecting the other, multi-booting using UEFI is just a matter of launching a different EFI application corresponding to the particular operating system's boot loader. This removes the need for relying on [[Wikipedia:Chain loading|chain loading]] mechanisms of one [[#Boot loader|boot loader]] to load another OS.<br />
<br />
See also [[Dual boot with Windows]].<br />
<br />
== Boot loader ==<br />
<br />
A boot loader is a piece of software started by the [[Wikipedia:BIOS|BIOS]] or [[UEFI]]. It is responsible for loading the kernel with the wanted [[kernel parameters]], and [[mkinitcpio|initial RAM disk]] based on configuration files. In the case of UEFI, the kernel itself can be directly launched by the UEFI using the EFI boot stub. A separate boot loader or boot manager can still be used for the purpose of editing kernel parameters before booting.<br />
<br />
{{Note|Loading [[Microcode]] updates requires adjustments in boot loader configuration. [https://www.archlinux.org/news/changes-to-intel-microcodeupdates/]}}<br />
<br />
=== Feature comparison ===<br />
<br />
{{Note|<br />
* Boot loaders only need to support the file system on which kernel and initramfs reside (the file system on which {{ic|/boot}} is located).<br />
* As GPT is part of the UEFI specification, all UEFI boot loaders support GPT disks. GPT on BIOS systems is possible, using either "hybrid booting" with [https://www.rodsbooks.com/gdisk/hybrid.html Hybrid MBR], or the new [http://repo.or.cz/syslinux.git/blob/HEAD:/doc/gpt.txt GPT-only] protocol. This protocol may however cause issues with certain BIOS implementations; see [http://www.rodsbooks.com/gdisk/bios.html#bios rodsbooks] for details.<br />
* Encryption mentioned in file system support is [[wikipedia:Filesystem-level encryption|filesystem-level encryption]], it has no bearing on [[dm-crypt|block-level encryption]]. <br />
}}<br />
<br />
{| class="wikitable sortable"<br />
! rowspan="2"| Name<br />
! colspan="2"| Firmware<br />
! colspan="2"| [[Partition table]]<br />
! rowspan="2"| Multi-boot<br />
! colspan="5"| [[File systems]]<br />
! rowspan="2"| Notes<br />
|-<br />
! BIOS !! [[UEFI]]<br />
! [[MBR]] !! [[GPT]]<br />
! [[Btrfs]] !! [[ext4]] !! ReiserFS !! [[VFAT]] !! [[XFS]]<br />
|-<br />
! [[EFISTUB]]<br />
| {{-}} || {{Yes}}<br />
| {{Yes}} || {{Yes}}<br />
| {{-}}<br />
| {{-}} || {{-}} || {{-}} || {{Y|ESP only}} || {{-}}<br />
| Kernel turned into EFI executable to be loaded directly from [[UEFI]] firmware or another boot loader.<br />
|-<br />
! [[Clover]]<br />
| {{G|emulates UEFI}} || {{Yes}}<br />
| {{Yes}} || {{Yes}}<br />
| {{Yes}}<sup>1</sup><br />
| {{No}} || {{Y|without encryption}} || {{No}} || {{Yes}} || {{No}}<br />
| Fork of rEFIt modified to run [[wikipedia:Hackintosh|macOS on non-Apple hardware]].<br />
|-<br />
! [[GRUB]]<br />
| {{Yes}} || {{Yes}}<br />
| {{Yes}} || {{Yes}}<br />
| {{Yes}}<br />
| {{Y|without zstd compression}} || {{Yes}} || {{Yes}} || {{Yes}} || {{Yes}}<br />
| On BIOS/GPT configuration requires a [[BIOS boot partition]]. <br/>Supports RAID, LUKS1 and LVM (but not thin provisioned volumes).<br />
|-<br />
! [[rEFInd]]<br />
| {{No}} || {{Yes}}<br />
| {{Yes}} || {{Yes}}<br />
| {{Yes}}<sup>1</sup><br />
| {{Y|without: encryption, zstd compression}} || {{Y|without encryption}} || {{Y|without tail-packing feature}} || {{Yes}} || {{No}}<br />
| Supports auto-detecting kernels and parameters without explicit configuration.<br />
|-<br />
! [[Syslinux]]<br />
| {{Yes}} || {{Y|[[Syslinux#Limitations of UEFI Syslinux|Partial]]}}<br />
| {{Yes}} || {{Yes}}<br />
| {{Y|[[Syslinux#Chainloading|Partial]]}}<br />
| {{Y|without: multi-device volumes, compression, encryption}} || {{Y|without encryption}} || {{No}} || {{Yes}} || {{Y|MBR only; without sparse inodes}}<br />
| No support for certain [[file system]] features [https://wiki.syslinux.org/wiki/index.php?title=Filesystem] <br/>The boot loader can only access the file system it is installed to.[https://bugzilla.syslinux.org/show_bug.cgi?id=33]<br />
|-<br />
! [[systemd-boot]]<br />
| {{No}} || {{Yes}}<br />
| {{Y|[https://github.com/systemd/systemd/issues/1125 Manual install only]}} || {{Yes}}<br />
| {{Yes}}<sup>1</sup><br />
| {{No}} || {{No}} || {{No}} || {{Y|ESP only}} || {{No}}<br />
| Cannot launch binaries from partitions other than [[ESP]].<br />
|-<br />
! {{Grey|[[GRUB Legacy]]}}<br />
| {{Yes}} || {{No}}<br />
| {{Yes}} || {{No}}<br />
| {{Yes}}<br />
| {{No}} || {{No}} || {{Yes}} || {{Yes}} || {{Y|v4 only}}<br />
| [https://www.gnu.org/software/grub/grub-legacy.html Discontinued] in favor of [[GRUB]].<br />
|-<br />
! {{Grey|[[LILO]]}}<br />
| {{Yes}} || {{No}}<br />
| {{Yes}} || {{No}}<br />
| {{Yes}}<br />
| {{No}} || {{Y|without encryption}} || {{Yes}} || {{Yes}} || {{Yes|http://xfs.org/index.php/XFS_FAQ#Q:_Does_LILO_work_with_XFS.3F}}<br />
| [http://web.archive.org/web/20180323163248/http://lilo.alioth.debian.org/ Discontinued] due to limitations (e.g. with Btrfs, GPT, RAID).<br />
|}<br />
<br />
# A [https://www.rodsbooks.com/efi-bootloaders/principles.html boot manager]. It can only launch other EFI applications, for example, Linux kernel images built with {{ic|1=CONFIG_EFI_STUB=y}} and Windows {{ic|bootmgfw.efi}}.<br />
<br />
See also [[Wikipedia:Comparison of boot loaders]].<br />
<br />
== Kernel ==<br />
<br />
The [[kernel]] is the core of an operating system. It functions on a low level (''kernelspace'') interacting between the hardware of the machine and the programs which use the hardware to run. To make efficient use of the CPU, the kernel uses a scheduler to arbitrate which tasks take priority at any given moment, creating the illusion of many tasks being executed simultaneously.<br />
<br />
== initramfs ==<br />
<br />
After the [[#Boot loader|boot loader]] loads the [[kernel]] and possible initramfs files and executes the kernel, the kernel unpacks the initramfs (initial RAM filesystem) archives into the (then empty) rootfs (initial root filesystem, specifically a ramfs or tmpfs). The first extracted initramfs is the one embedded in the kernel binary during the kernel build, then possible external initramfs files are extracted. Thus files in the external initramfs overwrite files with the same name in the embedded initramfs. The kernel then executes {{ic|/init}} (in the rootfs) as the first process. The ''early userspace'' starts.<br />
<br />
Arch Linux uses an empty archive for the builtin initramfs (which is the default when building Linux). See [[mkinitcpio]] for more and Arch-specific info about the external initramfs.<br />
<br />
The purpose of the initramfs is to bootstrap the system to the point where it can access the root filesystem (see [[FHS]] for details). This means that any modules that are required for devices like IDE, SCSI, SATA, USB/FW (if booting from an external drive) must be loadable from the initramfs if not built into the kernel; once the proper modules are loaded (either explicitly via a program or script, or implicitly via [[udev]]), the boot process continues. For this reason, the initramfs only needs to contain the modules necessary to access the root filesystem; it does not need to contain every module one would ever want to use. The majority of modules will be loaded later on by udev, during the init process.<br />
<br />
== init process ==<br />
<br />
At the final stage of early userspace, the real root is mounted, and then replaces the initial root filesystem. {{ic|/sbin/init}} is executed, replacing the {{ic|/init}} process. Arch uses [[systemd]] as the default [[init]].<br />
<br />
== getty ==<br />
<br />
[[init]] calls [[getty]] once for each [[Wikipedia:Virtual console|virtual terminal]] (typically six of them), which initializes each tty and asks for a username and password. Once the username and password are provided, getty checks them against {{ic|/etc/passwd}} and {{ic|/etc/shadow}}, then calls [[#Login|login]]. Alternatively, getty may start a display manager if one is present on the system.<br />
<br />
== Display manager ==<br />
<br />
A [[display manager]] can be configured to replace the getty login prompt on a tty.<br />
<br />
In order to automatically initialize a display manager after booting, it is necessary to manually enable the service unit through [[systemd]]. For more information on enabling and starting service units, see [[systemd#Using units]]. <br />
<br />
== Login ==<br />
<br />
The ''login'' program begins a session for the user by setting environment variables and starting the user's shell, based on {{ic|/etc/passwd}}.<br />
<br />
The ''login'' program displays the contents of [[Wikipedia:motd (Unix)|/etc/motd]] (''m''essage ''o''f ''t''he ''d''ay) after a successful login, just before it executes the login shell. It is a good place to display your Terms of Service to remind users of your local policies or anything you wish to tell them.<br />
<br />
== Shell ==<br />
<br />
Once the user's [[shell]] is started, it will typically run a runtime configuration file, such as [[bashrc]], before presenting a prompt to the user. If the account is configured to [[Start X at login]], the runtime configuration file will call [[startx]] or [[xinit]].<br />
<br />
== GUI, xinit or wayland ==<br />
<br />
[[xinit]] runs the user's [[xinitrc]] runtime configuration file, which normally starts a [[window manager]]. When the user is finished and exits the window manager, ''xinit'', ''startx'', the shell, and login will terminate in that order, returning to [[#Getty|getty]].<br />
<br />
== See also ==<br />
<br />
* [https://web.archive.org/web/20150430223035/http://archlinux.me/brain0/2010/02/13/early-userspace-in-arch-linux/ Early Userspace in Arch Linux]<br />
* [http://www.ibm.com/developerworks/linux/library/l-linuxboot/ Inside the Linux boot process]<br />
* [[Wikipedia:Linux startup process]]<br />
* [[Wikipedia:initrd]]<br />
* [http://www.cyberciti.biz/faq/grub-boot-into-single-user-mode/ Boot Linux Grub Into Single User Mode]<br />
* [https://neosmart.net/wiki/mbr-boot-process/ NeoSmart: The BIOS/MBR Boot Process]<br />
* [https://www.linux.com/learn/kernel-newbie-corner-initrd-and-initramfs-whats Kernel Newbie Corner: initrd and initramfs]<br />
* [http://www.rodsbooks.com/efi-bootloaders/ Rod Smith - Managing EFI Boot Loaders for Linux]</div>Delapouitehttps://wiki.archlinux.org/index.php?title=Zswap&diff=579232Zswap2019-08-09T11:56:07Z<p>Delapouite: add link to LRU on Wikipedia</p>
<hr />
<div>[[Category:Kernel]]<br />
[[ja:Zswap]]<br />
{{Related articles start}}<br />
{{Related|Kernel parameters}}<br />
{{Related|Mkinitcpio}}<br />
{{Related articles end}}<br />
[[Wikipedia:zswap|Zswap]] is a kernel feature that provides a compressed RAM cache for swap pages. <br />
Pages which would otherwise be swapped out to disk are instead compressed and stored into a memory pool in RAM. Once the pool is full or the RAM is exhausted, the least recently used ([[Wikipedia:Cache_replacement_policies#Least_recently_used_(LRU)|LRU]]) page is decompressed and written to disk, as if it had not been intercepted. After the page has been decompressed into the swap cache, the compressed version in the pool can be freed.<br />
<br />
The [[Improving performance#Zram_or_zswap|difference compared to zram]] is that zswap works in conjunction with a [[swap]] device while ''zram'' is a swap device in RAM that does not require a backing swap device.<br />
<br />
==Enabling zswap==<br />
<br />
To enable zswap at runtime, execute the following command:<br />
# echo 1 > /sys/module/zswap/parameters/enabled<br />
<br />
To enable zswap permanently:<br />
* Either add to your [[kernel parameters#Configuration|kernel parameters]] {{ic|1=zswap.enabled=1}}<br />
<br />
* Alternatively, you can use {{pkg|systemd-swap}} which is a script to manage swap spaces, in this case the line {{ic|1=zswap_enabled=1}} must be present in {{ic|/etc/systemd/swap.conf}} and you must [[start/enable]] {{ic|systemd-swap.service}}.<br />
<br />
==Customizing zswap==<br />
=== Current parameters ===<br />
<br />
Zswap has several customizable parameters. The live settings can be displayed using:<br />
<br />
{{hc|$ grep -R . /sys/module/zswap/parameters|<br />
/sys/module/zswap/parameters/same_filled_pages_enabled:Y<br />
/sys/module/zswap/parameters/enabled:Y<br />
/sys/module/zswap/parameters/max_pool_percent:25<br />
/sys/module/zswap/parameters/compressor:lz4<br />
/sys/module/zswap/parameters/zpool:z3fold<br />
}}<br />
<br />
See the [https://www.kernel.org/doc/Documentation/vm/zswap.txt zswap documentation] for the description of the different parameters.<br />
<br />
The boot time load message showing the initial configuration can be retrieved with:<br />
<br />
{{hc|$ dmesg {{!}} grep zswap:|<br />
[ 0.317569] zswap: loaded using pool lz4/z3fold<br />
}}<br />
<br />
=== Set parameters ===<br />
==== Using sysfs ====<br />
Each setting can be changed at runtime via the [[Wikipedia:sysfs|sysfs]] interface. For example using the following command to amend the first parameter of the list, {{ic|compressor}}:<br />
# echo lz4 > /sys/module/zswap/parameters/compressor<br />
<br />
==== Using kernel boot parameters ====<br />
To set the parameter permanently, the corresponding option, for example {{ic|1=zswap.compressor=lz4}}, must be added to the kernel boot parameter. Therefore to set permanently all the above settings, the following kernel parameters must be added: {{ic|1=zswap.enabled=1 zswap.compressor=lz4 zswap.max_pool_percent=20 zswap.zpool=z3fold}}.<br />
<br />
When changing the compression algorithm via boot parameter the corresponding kernel modules must be available, at least when using ''lz4'' (refer to [[#Compression algorithm]]).<br />
<br />
==== Using systemd-swap ====<br />
For the ones using the ''systemd-swap'' script, it modifies the ''sysfs'' parameters at a later stage of the boot process based on its [https://github.com/Nefelim4ag/systemd-swap/blob/master/swap.conf configuration] stored in {{ic|/etc/systemd/swap.conf}}.<br />
<br />
===Maximum pool size===<br />
The memory pool is not preallocated, it is allowed to grow up to a certain limit in percentage of the total memory available, by default up to 20% of the total RAM. Once this threshold is reached, pages are evicted from the pool into the swap device.<br />
The maximum compressed pool size is controlled with the parameter {{ic|max_pool_percent}}.<br />
<br />
===Compressed memory pool allocator===<br />
The ''zpool'' parameter controls the management of the compressed memory pool, it is by default set to {{ic|zbud}}.<br />
With the ''zbud'' data allocator, 2 compressed objects are stored into 1 page which limits the compression ratio to 2 or less. The superior [https://www.kernel.org/doc/Documentation/vm/z3fold.txt z3fold] allocator allows up to 3 compressed objects by page. The compression ratio with ''z3fold'' typically averages 2.7 while it is 1.7 for ''zbud''.<br />
<br />
A ''zpool'' of type ''zbud'' is created by default, use the kernel parameter {{ic|1=zswap.zpool=z3fold}} to select the ''z3fold'' method instead. The data allocator can also be changed at a later stage via the ''sysfs'' interface.<br />
<br />
===Compression algorithm===<br />
For page compression, zswap uses compressor modules provided by the kernel's cryptographic API. It uses by default the ''lzo'' compression algorithm but this can be changed with {{ic|1=zswap.compressor}}. ''Lz4'' can be used instead of ''lzo'' for faster compression and decompression for a slightly lower compression ratio. Other possible choices are ''lz4hc'' or ''deflate''.<br />
<br />
There is no issue setting the compression to ''lz4'' at runtime using ''sysfs'' or via ''systemd-swap'' but zswap starts in this case with ''lzo'' and switches at a later stage to ''lz4''. To use zswap with ''lz4'' straight away, this must be defined in the kernel boot parameter and the ''lz4'' module must be loaded early by the kernel. This can be achieved by following these steps:<br />
<br />
#Add {{ic|1=lz4 lz4_compress}} to the [[mkinitcpio#MODULES]] array.<br />
#Replace the ramdisk environment with a newly generated one: {{bc|# mkinitcpio -g /boot/''initramfs''.img}}<br />
#Add {{ic|1=zswap.compressor=lz4}} to your [[kernel parameters]].<br />
<br />
On next reboot, see [[#Current parameters]] to check if zswap now uses ''lz4'' as compressor.<br />
<br />
== See also ==<br />
<br />
* [https://lkml.org/lkml/2013/7/17/147 zswap: How to determine whether it is compressing swap pages?].<br />
* [https://www.ibm.com/developerworks/community/blogs/fe313521-2e95-46f2-817d-44a4f27eba32/entry/new_linux_zswap_compression_functionality7?lang=en IBM Developer Works Article (with benchmarks)].<br />
* [http://askubuntu.com/questions/471912/zram-vs-zswap-vs-zcache-ultimate-guide-when-to-use-which-one Ask Ubuntu: zram vs. zswap vs. zcache].<br />
* [https://bbs.archlinux.org/viewtopic.php?id=169585 Archlinux forum thread].<br />
* [https://lwn.net/Articles/537422/ LWN.net technical article by the main developer of zswap].</div>Delapouitehttps://wiki.archlinux.org/index.php?title=SSHFS&diff=579216SSHFS2019-08-09T07:53:47Z<p>Delapouite: add link to FUSE</p>
<hr />
<div>[[Category:FUSE]]<br />
[[Category:Secure Shell]]<br />
[[Category:Network sharing]]<br />
[[es:SSHFS]]<br />
[[fr:Sshfs]]<br />
[[ja:Sshfs]]<br />
[[ru:SSHFS]]<br />
[[zh-hans:SSHFS]]<br />
{{Related articles start}}<br />
{{Related|SCP and SFTP}}<br />
{{Related|SFTP chroot}}<br />
{{Related|Pure-FTPd}}<br />
{{Related|sftpman}}<br />
{{Related articles end}}<br />
<br />
[https://github.com/libfuse/sshfs SSHFS] is a [[FUSE]]-based filesystem client for mounting remote directories over a [[Secure Shell]] connection.<br />
<br />
== Installation ==<br />
<br />
[[Install]] the {{Pkg|sshfs}} package.<br />
<br />
{{Tip|<br />
*If you often need to mount sshfs filesystems you may be interested in using an sshfs helper, such as {{AUR|qsshfs}}, [[sftpman]], {{AUR|sshmnt}} or [https://github.com/lahwaacz/Scripts/blob/master/fmount.py fmount.py].<br />
*You may want to use [[Google Authenticator]] providing additional security as in two-step authentication.<br />
*[[SSH keys]] may be used over traditional password authentication.}}<br />
<br />
=== Mounting ===<br />
<br />
In order to be able to mount a directory the SSH user needs to be able to access it. Invoke ''sshfs'' to mount a remote directory:<br />
<br />
$ sshfs ''[user@]host:[dir] mountpoint [options]''<br />
<br />
For example:<br />
<br />
$ sshfs myuser@mycomputer:/remote/path /local/path -C -p 9876<br />
<br />
Here {{ic|-p 9876}} specifies the port number and {{ic|-C}} enables compression. For more options see the [[#Options]] section.<br />
<br />
When not specified, the remote path defaults to the remote user home directory. Default user names and options can be predefined on a host-by-host basis in {{ic|~/.ssh/config}} to simplify the ''sshfs'' usage. For more information see [[OpenSSH#Client usage]].<br />
<br />
SSH will ask for the password, if needed. If you do not want to type in the password multiple times a day, see [[SSH keys]].<br />
<br />
=== Unmounting ===<br />
<br />
To unmount the remote system:<br />
<br />
$ fusermount3 -u ''mountpoint''<br />
<br />
Example:<br />
<br />
$ fusermount3 -u /local/path<br />
<br />
== Options ==<br />
<br />
''sshfs'' can automatically convert between local and remote user IDs. Use the {{ic|1=idmap=user}} option to translate the UID of the connecting user to the remote user {{ic|myuser}} (GID remains unchanged):<br />
<br />
$ sshfs myuser@mycomputer:/remote/path /local/path -o idmap=user<br />
<br />
If you need more control over UID and GID translation, look at the options {{ic|1=idmap=file}}, {{ic|uidfile}} and {{ic|gidfile}}.<br />
<br />
A complete list of options can be found in {{man|1|sshfs}}.<br />
<br />
== Chrooting ==<br />
<br />
You may want to restrict a specific user to a specific directory on the remote system. This can be done by editing {{ic|/etc/ssh/sshd_config}}:<br />
<br />
{{hc|/etc/ssh/sshd_config|<br />
.....<br />
Match User ''someuser'' <br />
ChrootDirectory ''/chroot/%u''<br />
ForceCommand internal-sftp<br />
AllowTcpForwarding no<br />
X11Forwarding no<br />
.....<br />
}}<br />
<br />
{{Note|The chroot directory '''must''' be owned by root, otherwise you will not be able to connect.}}<br />
<br />
See also [[SFTP chroot]]. For more information check the {{man|5|sshd_config}} man page for {{ic|Match}}, {{ic|ChrootDirectory}} and {{ic|ForceCommand}}.<br />
<br />
== Automounting ==<br />
<br />
{{Out of date|This requires to install {{Pkg|fuse2}} for {{ic|mount.fuse}}, or create a symbolic link from {{ic|mount.fuse3}}. See {{Bug|55564}}}}<br />
{{Out of date|1=fuse3 API doesn't accept options _netdev and user anymore. [https://bbs.archlinux.org/viewtopic.php?id=230191 Discussion]}}<br />
<br />
Automounting can happen on boot, or on demand (when accessing the directory). For both, the setup happens in the [[fstab]].<br />
<br />
{{Note|Keep in mind that automounting is done through the root user, therefore you cannot use hosts configured in {{ic|.ssh/config}} of your normal user.<br />
<br />
To let the root user use an SSH key of a normal user, specify its full path in the {{ic|IdentityFile}} option.<br />
<br />
'''And most importantly''', use each sshfs mount at least once manually '''while root''' so the host's signature is added to the {{ic|/root/.ssh/known_hosts}} file.<br />
}}<br />
<br />
=== On demand ===<br />
<br />
{{Expansion|Is there a way to make this work with a passphrase-protected private key? E.g. it prompts for the passphrase at first access. Alternatively, clearly state that it's not possible and why.}}<br />
<br />
With systemd on-demand mounting is possible using {{ic|/etc/fstab}} entries.<br />
<br />
Example:<br />
<br />
user@host:/remote/folder /mount/point fuse.sshfs noauto,x-systemd.automount,_netdev,users,idmap=user,IdentityFile=/home/user/.ssh/id_rsa,allow_other,reconnect 0 0<br />
<br />
The important mount options here are ''noauto,x-systemd.automount,_netdev''.<br />
<br />
* ''noauto'' tells it not to mount at boot<br />
* ''x-systemd.automount'' does the on-demand magic<br />
* ''_netdev'' tells it that it is a network device, not a block device (without it "No such device" errors might happen)<br />
<br />
{{Note|After editing {{ic|/etc/fstab}}, (re)start the required service: {{ic|systemctl daemon-reload && systemctl restart <target>}} where {{ic|<target>}} can be found by running {{ic|systemctl list-unit-files --type automount}} }}<br />
<br />
{{Tip|{{AUR|autosshfs-git}}{{Broken package link|package not found}} do not require editing {{ic|/etc/fstab}} to add a new mountpoint. Instead, regular users can create one by simply attempting to access it (with e. g. something like {{ic|ls ~/mnt/ssh/[user@]yourremotehost[:port]}}). {{AUR|autosshfs-git}}{{Broken package link|package not found}} uses AutoFS. Users need to be enabled to use it with {{ic|autosshfs-user}}.}}<br />
<br />
=== On boot ===<br />
<br />
An example on how to use sshfs to mount a remote filesystem through {{ic|/etc/fstab}}<br />
<br />
USERNAME@HOSTNAME_OR_IP:/REMOTE/DIRECTORY /LOCAL/MOUNTPOINT fuse.sshfs defaults,_netdev 0 0<br />
<br />
Take for example the ''fstab'' line<br />
<br />
llib@192.168.1.200:/home/llib/FAH /media/FAH2 fuse.sshfs defaults,_netdev 0 0<br />
<br />
The above will work automatically if you are using an SSH key for the user. See [[Using SSH Keys]].<br />
<br />
If you want to use sshfs with multiple users:<br />
<br />
user@domain.org:/home/user /media/user fuse.sshfs defaults,allow_other,_netdev 0 0<br />
<br />
Again, it is important to set the ''_netdev'' mount option to make sure the network is available before trying to mount.<br />
<br />
=== Secure user access ===<br />
<br />
When automounting via [[fstab]], the filesystem will generally be mounted by root. By default, this produces undesireable results if you wish access as an ordinary user and limit access to other users.<br />
<br />
An example mountpoint configuration:<br />
<br />
USERNAME@HOSTNAME_OR_IP:/REMOTE/DIRECTORY /LOCAL/MOUNTPOINT fuse.sshfs noauto,x-systemd.automount,_netdev,user,idmap=user,follow_symlinks,identityfile=/home/USERNAME/.ssh/id_rsa,allow_other,default_permissions,uid=USER_ID_N,gid=USER_GID_N 0 0<br />
<br />
Summary of the relevant options:<br />
<br />
* ''allow_other'' - Allow other users than the mounter (i.e. root) to access the share.<br />
* ''default_permissions'' - Allow kernel to check permissions, i.e. use the actual permissions on the remote filesystem. This allows prohibiting access to everybody otherwise granted by ''allow_other''.<br />
* ''uid'', ''gid'' - set reported ownership of files to given values; ''uid'' is the numeric user ID of your user, ''gid'' is the numeric group ID of your user.<br />
<br />
== Troubleshooting ==<br />
<br />
=== Checklist ===<br />
<br />
Read [[OpenSSH#Checklist]] first. Further issues to check are:<br />
<br />
1. Is your SSH login sending additional information from server's {{ic|/etc/issue}} file e.g.? This might confuse SSHFS. You should temporarily deactivate server's {{ic|/etc/issue}} file:<br />
<br />
$ mv /etc/issue /etc/issue.orig<br />
<br />
2. Keep in mind that most SSH related troubleshooting articles you will find on the web are '''not''' Systemd related. Often {{ic|/etc/fstab}} definitions wrongly begin with {{ic|''sshfs#''user@host:/mnt/server/folder ... fuse ...}} instead of using the syntax {{ic|user@host:/mnt/server/folder ... fuse.''sshfs'' ... ''x-systemd'', ...}}. <br />
<br />
3. Check that the owner of server's source folder and content is owned by the server's user. <br />
<br />
$ chown -R USER_S: /mnt/servers/folder<br />
<br />
4. The server's user ID can be different from the client's one. Obviously both user names have to be the same. You just have to care for the client's user IDs. SSHFS will translate the UID for you with the following mount options:<br />
<br />
uid=''USER_C_ID'',gid=''GROUP_C_ID''<br />
<br />
5. Check that the client's target mount point (folder) is owned by the client user. This folder should have the same user ID as defined in SSHFS's mount options.<br />
<br />
$ chown -R USER_C: /mnt/client/folder<br />
<br />
6. Check that the client's mount point (folder) is empty. By default you cannot mount SSHFS folders to non-empty folders.<br />
<br />
=== Connection reset by peer ===<br />
<br />
* If you are trying to access the remote system with a hostname, try using its IP address, as it can be a domain name solving issue. Make sure you edit {{ic|/etc/hosts}} with the server details.<br />
* If you are using non-default key names and are passing it as {{ic|-i .ssh/my_key}}, this will not work. You have to use {{ic|-o IdentityFile<nowiki>=</nowiki>/home/user/.ssh/my_key}}, with the full path to the key.<br />
* If your {{ic|/root/.ssh/config}} is a symlink, you will be getting this error as well. See [http://serverfault.com/questions/507748/bad-owner-or-permissions-on-root-ssh-config this serverfault topic]<br />
* Adding the option '{{ic|sshfs_debug}}' (as in '{{ic|sshfs -o sshfs_debug user@server ...}}') can help in resolving the issue.<br />
* If that doesn't reveal anything useful, you might also try adding the option '{{ic|debug}}'<br />
* If you are trying to sshfs into a router running DD-WRT or the like, there is a solution [http://www.dd-wrt.com/wiki/index.php/SFTP_with_DD-WRT here]. (note that the -osftp_server=/opt/libexec/sftp-server option can be used to the sshfs command in stead of patching dropbear)<br />
* If you see this only on boot, it may be that systemd is attempting to mount prior to a network connection being available. Enabling the 'wait-online' service appropriate to your network connection (eg. systemd-networkd-wait-online.service) fixes this.<br />
* Old Forum thread: [https://bbs.archlinux.org/viewtopic.php?id=27613 sshfs: Connection reset by peer]<br />
* Make sure your user can log into the server (especially when using AllowUsers)<br />
* Make sure {{ic|Subsystem sftp /usr/lib/ssh/sftp-server}} is enabled in {{ic|/etc/ssh/sshd_config}}.<br />
<br />
{{Note| When providing more than one option for sshfs, they must be comma separated. Like so: '{{ic|sshfs -o sshfs_debug,IdentityFile<nowiki>=</nowiki></path/to/key> user@server ...}}')}}<br />
<br />
=== Remote host has disconnected ===<br />
<br />
If you receive this message directly after attempting to use ''sshfs'':<br />
<br />
* First make sure that the '''remote''' machine has ''sftp'' installed! It will not work, if not.<br />
* Then, check that the path of the {{ic|Subsystem sftp}} in {{ic|/etc/ssh/sshd_config}} on the remote machine is valid.<br />
<br />
=== fstab mounting issues ===<br />
<br />
To get verbose debugging output, add the following to the mount options:<br />
<br />
ssh_command=ssh\040-vv,sshfs_debug,debug<br />
{{Note|Here, {{ic|\040}} represents a space which fstab uses to separate fields.}}<br />
<br />
To be able to run {{ic|mount -av}} and see the debug output, remove the following:<br />
noauto,x-systemd.automount<br />
<br />
== See also ==<br />
<br />
* [http://wiki.gilug.org/index.php/How_to_mount_SFTP_accesses How to mount chrooted SSH filesystem], with special care with owners and permissions questions.</div>Delapouitehttps://wiki.archlinux.org/index.php?title=Fbpanel&diff=578471Fbpanel2019-07-31T12:40:30Z<p>Delapouite: add link to NETWM spec</p>
<hr />
<div>[[Category:Application launchers]]<br />
[[Category:Eye candy]]<br />
[[Category:System monitors]]<br />
[[de:Fbpanel]]<br />
[[ja:Fbpanel]]<br />
[[ko:Fbpanel]]<br />
[[ru:Fbpanel]]<br />
[http://aanatoly.github.io/fbpanel/ fbpanel] is a lightweight [https://www.freedesktop.org/wiki/Specifications/wm-spec/ NETWM] compliant desktop panel. This article describes the installation and configuration of fbpanel.<br />
<br />
== Installing ==<br />
<br />
[[Install]] the {{AUR|fbpanel}} package from the [[official repositories]].<br />
<br />
== Starting ==<br />
<br />
If you want to start fbpanel with your X session, add the following line to your .xinitrc,<br />
before the line where you start your window manager.<br />
<br />
fbpanel &<br />
<br />
== Configuration ==<br />
<br />
You can find the configuration file in {{ic|~/.config/fbpanel}}<br />
<br />
If it doesn't exist, copy over the default configuration file:<br />
<br />
$ mkdir ~/.config/fbpanel<br />
$ cp /usr/share/fbpanel/default ~/.config/fbpanel<br />
<br />
=== wincmd plugin (show desktop button) ===<br />
<br />
This plugin is enabled by default, but it might not show up because it cannot find an existing icon.<br />
In that case, change the icon path to one that points to an existing icon.<br />
You can also use an image as its icon. In that case, replace the "icon" key with "image".<br />
Plugin {<br />
type = wincmd<br />
config {<br />
image = ~/images/my_image.png<br />
tooltip = Left click to iconify all windows. Middle click to shade them.<br />
}<br />
}</div>Delapouitehttps://wiki.archlinux.org/index.php?title=Cairo-Dock&diff=578470Cairo-Dock2019-07-31T12:29:44Z<p>Delapouite: add link to Cairo homepage</p>
<hr />
<div>[[Category:Application launchers]]<br />
[[Category:Eye candy]]<br />
[[ja:Cairo-Dock]]<br />
Cairo-Dock is a highly customizable dock written in C.<br />
<br />
== Installation ==<br />
<br />
Install {{Pkg|cairo-dock}} from the [[official repositories]]. The core package provides only the strict minimum to run Cairo-Dock - to use applets, animations, views, effects and dialogs you will also need {{Pkg|cairo-dock-plug-ins}}.<br />
<br />
You can also try the development branch with {{AUR|cairo-dock-git}} and {{AUR|cairo-dock-plug-ins-git}}.<br />
<br />
=== Plugin dependencies ===<br />
<br />
The applets in {{Pkg|cairo-dock-plug-ins}} require quite a lot of dependencies, therefore all of them have been made optional not to bloat your system if you do not use a particular applet. Please refer to the optdepends list and install those you need.<br />
<br />
{{Note|If for some reason an applet is not working, make sure you have GVFS installed, it is required for several applets as well as GNOME, XFCE and KDE integration.}}<br />
<br />
== Configuration ==<br />
=== Running the dock ===<br />
Run the dock in the background:<br />
$ cairo-dock &<br />
This will generate a startup message that will ask you to choose a backend for the current session (OpenGL or [https://www.cairographics.org/ Cairo]). There is an option to remember the choice and if not choosing to remember the choice, a startup message will be generated each time Cairo-Dock is run without backend options. To supress the startup message, you can specify which backend to use when running Cairo-Dock by specifying it as an option.<br />
<br />
Run the dock with OpenGL backend:<br />
$ cairo-dock -o &<br />
Run the dock with Cairo backend:<br />
$ cairo-dock -c &<br />
{{Tip|All using ATI graphics cards should use this option. Some cards/drivers do not support OpenGL, which may prevent Cairo-Dock from running correctly.}}<br />
<br />
=== Running the dock at startup ===<br />
This depends on which desktop environment or window manager that is being used and which backend Cairo-Dock should be run with. The following section shows how to run Cairo-Dock at startup without forcing a backend.<br />
<br />
==== Cairo-Dock method ====<br />
Run Cairo-Dock and right-click the dock and go to '''Cairo-Dock > Launch Cairo-Dock on startup'''. The settings will be stored in {{Ic|~/.config/autostart/}} and sourced the next time you login.<br />
<br />
==== Openbox/Fluxbox ====<br />
Add the following to {{Ic|~/.config/openbox/autostart}} or {{Ic|~/.fluxbox/startup}} accordingly:<br />
cairo-dock &<br />
<br />
==== Xfce ====<br />
If you have {{Ic|xfce4-autostart-editor}} installed, simply run it and add an entry for Cairo-Dock. If you are not using a session manager you can add the following to {{Ic|~/.config/xfce4/xinitrc}} or {{Ic|~/Desktop/Autostart}}:<br />
cairo-dock &<br />
<br />
==== GNOME ====<br />
Add a Cairo-Dock entry to Startup Programs using<br />
$ gnome-session-properties<br />
<br />
=== Configuring the dock ===<br />
To configure the dock, right-click the dock and go to '''Cairo-Dock > Configure'''.<br />
<br />
== Troubleshooting ==<br />
=== Two Cairo-Docks are running ===<br />
This is most likely a result of saved sessions being runned at login. If you are using a desktop environment like [[GNOME]], [[KDE]] or [[Xfce]] you need to disable automatic startup of sessions in your session manager settings. You may also need to delete the sessions cache:<br />
$ rm ~/.cache/sessions/x*<br />
<br />
If you are not using a desktop environment with a session manager or choose to have Cairo-Dock startup by itself, you need to remove autostart files generated by Cairo-Dock:<br />
$ rm ~/.config/autostart/cairo-dock*<br />
<br />
=== The background is black ===<br />
This is most likely caused by not running a composite manager, like [[Xcompmgr]]. Cairo-Dock uses the transparency feature of the composite manager to display the dock, and without it the dock will be displayed with a black background. If you are using a desktop environment, simply enable the composite manager or desktop effects in the settings. <br />
<br />
An alternative solution that does not require a composite manager is to enable fake transparency in Cairo-Dock. To do this, right-click the dock and go to '''Cairo-Dock > Configure > Advanced Mode > System > Composition'''. Then enable both '''Emulate composition with fake transparency''' and '''Make the config panel transparent'''.<br />
<br />
=== Wifi plugin does not show the network strength ===<br />
If you added the wifi plugin, and it isn't showing the network strength, you have to certify that you have iwconfig installed (the plugin depends on it) and that you have permission to read the full output of iwconfig.<br />
<br />
To install iwconfig:<br />
# pacman -S wireless_tools<br />
<br />
And to get the permission to read the full output of the iwconfig as a normal user (read more about [[Capabilities]]):<br />
<br />
# setcap cap_net_raw,cap_net_admin=eip /usr/bin/iwconfig<br />
<br />
== See also ==<br />
* [http://www.glx-dock.org/index.php glx-dock.org]<br />
* [https://launchpad.net/cairo-dock/ Launchpad]</div>Delapouitehttps://wiki.archlinux.org/index.php?title=Redshift&diff=578467Redshift2019-07-31T12:20:07Z<p>Delapouite: add link to color temperature on Wikipedia</p>
<hr />
<div>[[Category:X server]]<br />
[[Category:Eye candy]]<br />
[[ja:Redshift]]<br />
[[ru:Redshift]]<br />
[[zh-hans:Redshift]]<br />
From the [http://jonls.dk/redshift/ Redshift project web page]:<br />
<br />
:[[Wikipedia:Redshift (software)|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|Redshift does not support [[Wayland]] since it offers no way to adjust the color temperature [https://github.com/jonls/redshift/issues/55]. See [[Wayland#Gamma]] for more.}}<br />
<br />
== Installation ==<br />
<br />
[[Install]] the {{Pkg|redshift}} package. Alternatively, install the {{AUR|redshift-minimal}} package, for a version with minimal dependencies.<br />
<br />
=== Front ends ===<br />
<br />
The ''redshift-gtk'' command comes with the {{Pkg|redshift}} package and provides a system tray icon for controlling Redshift. See optional dependencies.<br />
<br />
Alternatives are {{AUR|redshiftgui-bin}} (GTK) and {{AUR|redshift-qt}}, {{AUR|redshiftconf}} or {{Pkg|plasma5-applets-redshift-control}} and {{AUR|plasma5-applets-redshift-control-git}} (Qt).<br />
<br />
== Usage ==<br />
<br />
Redshift will at least need your location to start (unless {{ic|-O}} is used), 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.<br />
<br />
=== Quick start ===<br />
<br />
To just get it up and running with a basic setup, issue:<br />
<br />
$ redshift -l ''LATITUDE'':''LONGITUDE''<br />
<br />
where ''LATITUDE'' is the latitude and ''LONGITUDE'' is the longitude of your location.<br />
<br />
{{Tip|You can get the coordinates of a place with [http://www.geonames.org/ GeoNames.org].}}<br />
<br />
To instantly adjusts the color temperature of your screen use:<br />
<br />
$ redshift -P -O ''TEMPERATURE''<br />
<br />
where ''TEMPERATURE'' is the desired [[Wikipedia:Color_temperature|color temperature]] (between {{ic|1000}} and {{ic|25000}}).<br />
<br />
=== Autostart ===<br />
<br />
There are several options to have Redshift automatically started:<br />
<br />
* By right-clicking the system tray icon and selecting ''Autostart'' when ''redshift-gtk'' or ''plasma5-applets-redshift-control'' is already launched.<br />
* By placing a Redshift [[desktop entry]] in {{ic|~/.config/autostart/}} or by adding {{ic|redshift}} to your window manager or desktop environment's [[autostarting]] method. <br />
* By using [[systemd/User]]. Two services are provided: {{ic|redshift.service}} and {{ic|redshift-gtk.service}}. Activate only one of them depending on whether or not you want the system tray icon.<br />
<br />
{{Note|<br />
* The Redshift service files contain {{ic|1=Restart=always}} so they will restart infinitely. See {{man|5|systemd.service}}.<br />
* When using a systemd user service, [[Xorg]] must be started before execution of the service, which is not the case without a [[display manager]]. Otherwise you will get {{ic|RANDR Query Version' returned error -1}} and {{ic|Initialization of randr failed}}.}}<br />
<br />
== Configuration ==<br />
<br />
Redshift reads the configuration file {{ic|~/.config/redshift/redshift.conf}} [https://github.com/jonls/redshift/releases/tag/v1.12] if it exists. However, Redshift does not create that configuration file, so you may want to create it manually. See [https://raw.githubusercontent.com/jonls/redshift/master/redshift.conf.sample redshift.conf.sample].<br />
<br />
=== Automatic location based on GeoClue2 ===<br />
<br />
In order to allow access Redshift to use GeoClue2, add the following lines to {{ic|/etc/geoclue/geoclue.conf}}:<br />
<br />
{{hc|/etc/geoclue/geoclue.conf|2=<br />
[redshift]<br />
allowed=true<br />
system=false<br />
users=<br />
}}<br />
<br />
[[Restart]] {{ic|redshift.service}} and/or any other Redshift instance to apply the changes.<br />
<br />
{{Note|<br />
* This workaround is not needed with Geoclue2 version 2.5.0 and above.<br />
* If using [[GNOME]], also toggle Location Services to "On" in ''Settings > Privacy''.<br />
* Due possible bugs with geoclue2 and Redshift [https://github.com/jonls/redshift/issues/318], it may be required to use the {{ic|manual}} location-provider instead, e.g. for Paris:<br />
<br />
{{hc|~/.config/redshift/redshift.conf|2=<br />
[redshift]<br />
...<br />
; Set the location-provider: 'geoclue2', '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 />
...<br />
<br />
; Keep in mind that longitudes west of Greenwich (e.g. the Americas)<br />
; are negative numbers.<br />
[manual]<br />
lat=48.853<br />
lon=2.349<br />
}}<br />
<br />
* If using [[i3wm]] or similar, you will also need to enable the geoclue agent on startup. As well as {{ic|systemctl --user enable redshift-gtk}} or {{ic|redshift}} user service.<br />
<br />
{{hc|~/.i3/config|2=<br />
...<br />
exec --no-startup-id /usr/lib/geoclue-2.0/demos/agent<br />
...}}<br />
}}<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 />
=== 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 />
<br />
{{hc|~/.config/redshift/hooks/brightness.sh|output=<br />
#!/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 />
if [ "$1" = period-changed ]; then<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 />
fi<br />
}}<br />
<br />
Make it [[executable]]:<br />
<br />
$ chmod +x ~/.config/redshift/hooks/brightness.sh<br />
<br />
[[Restart]] the {{ic|redshift.service}} 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 does not work ===<br />
<br />
Install {{Pkg|libappindicator-gtk3}}. See [https://github.com/jonls/redshift/issues/363 redshift issue 363] and {{Bug|49971}}.<br />
<br />
=== Redshift makes the screen quickly flicker between the set color value of the screen and the default color value ===<br />
<br />
Make sure there are not multiple instances of redshift running.<br />
<br />
=== Redshift works fine when invoked as a command but fails when run as a systemd service ===<br />
<br />
The [[systemd]] unit has a line in the {{ic|redshift.service}} file that makes the service wait until the {{ic|display-manager.service}} unit is started by a [[display manager]] before the unit will invoke {{ic|redshift}}. If you do not use a display manager, [[edit]] the {{ic|redshift.service}} user service and delete the {{ic|1=After=display-manager.service}} line. Run {{ic|systemctl --user daemon-reload}} and the service should initialize properly.<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 />
<br />
{{hc|HKEY_CURRENT_USER\Software\Wine\X11 Driver|2=<br />
UseXVidMode="N"<br />
}}<br />
<br />
using the registry editor, or import/set it otherwise.<br />
<br />
=== Redshift GDBus.Error:org.freedesktop.DBus.Error.AccessDenied on start ===<br />
<br />
If running {{ic|$ redshift}} and you are getting:<br />
<br />
{{hc|$ redshift|<br />
Trying location provider `geoclue2'...<br />
Using provider `geoclue2'.<br />
Unable to start GeoClue client: GDBus.Error:org.freedesktop.DBus.Error.AccessDenied: 'redshift' disallowed, no agent for UID 1000.<br />
Unable to connect to GeoClue.<br />
Unable to get location from provider.<br />
}}<br />
<br />
or running {{ic|$ redshift-gtk}} and getting the similar error:<br />
<br />
{{hc|$ redshift-gtk|<br />
Failed to run Redshift<br />
Trying location provider `geoclue2'...<br />
Unable to start GeoClue client:<br />
GDBus.Error:org.freedesktop.DBus.Error.AccessDenied:<br />
'redshift' disallowed, no agent for UID 1000.<br />
Unable to connect to GeoClue.<br />
Unable to get location from provider.<br />
}}<br />
<br />
You can create a [[systemd]] unit file in {{ic|~/.config/systemd/user/geoclue-agent.service}} with the following config:<br />
<br />
{{hc|~/.config/systemd/user/geoclue-agent.service|2=<br />
[Unit]<br />
Description=redshift needs to get a (geo)clue<br />
<br />
[Service]<br />
ExecStart=/usr/lib/geoclue-2.0/demos/agent<br />
<br />
[Install]<br />
WantedBy=default.target<br />
}}<br />
<br />
Start and enable the service with systemctl: {{ic|$ systemctl --user enable --now geoclue-agent.service}} and try running redshift again.<br />
<br />
If you still get the same error, it may be because of geoclue being locked down to a few programs by default. Try adding the following lines to {{ic|/etc/geoclue/geoclue.conf}} (see [https://github.com/jonls/redshift/issues/158#issuecomment-71329118 redshift issue 158] and {{Bug|40360}}) and run {{ic|$ redshift}} again:<br />
<br />
{{hc|/etc/geoclue/geoclue.conf|2=<br />
[redshift]<br />
allowed=true<br />
system=false<br />
users=<br />
}}<br />
<br />
== See also ==<br />
<br />
* [http://jonls.dk/redshift Redshift website]<br />
* [http://github.com/jonls/redshift Redshift on github]<br />
* [[Wikipedia:Redshift (software)]]<br />
* Similar software: [https://github.com/jumper149/blugon] {{AUR|blugon}}, {{AUR|xflux-gui-git}}</div>Delapouitehttps://wiki.archlinux.org/index.php?title=Bluetooth&diff=578411Bluetooth2019-07-30T17:14:23Z<p>Delapouite: add link to lp group</p>
<hr />
<div>[[Category:Bluetooth]]<br />
[[cs:Bluetooth]]<br />
[[de:Bluetooth]]<br />
[[es:Bluetooth]]<br />
[[fr:Bluetooth]]<br />
[[it:Bluetooth]]<br />
[[ja:Bluetooth]]<br />
[[ru:Bluetooth]]<br />
[[zh-hans:Bluetooth]]<br />
{{Related articles start}}<br />
{{Related|Bluetooth mouse}}<br />
{{Related|Bluetooth keyboard}}<br />
{{Related|Bluetooth headset}}<br />
{{Related|Blueman}}<br />
{{Related|ObexFTP}}<br />
{{Related articles end}}<br />
[[Wikipedia:Bluetooth|Bluetooth]] is a standard for the short-range wireless interconnection of cellular phones, computers, and other electronic devices. In Linux, the canonical implementation of the Bluetooth protocol stack is [http://www.bluez.org/ BlueZ].<br />
<br />
== Installation ==<br />
<br />
# [[Install]] the {{Pkg|bluez}} package, providing the Bluetooth protocol stack.<br />
# [[Install]] the {{Pkg|bluez-utils}} package, providing the {{ic|bluetoothctl}} utility. Alternatively install {{AUR|bluez-utils-compat}} to additionally have the [[#Deprecated BlueZ tools|deprecated BlueZ tools]].<br />
# The generic Bluetooth driver is the {{ic|btusb}} Kernel module. [[Kernel_module#Obtaining_information|Check]] whether that module is loaded. If it's not, then [[Kernel_module#Manual_module_handling|load the module]].<br />
# [[Start/enable]] {{ic|bluetooth.service}}.<br />
<br />
{{Note|<br />
* By default the bluetooth daemon will only give out bnep0 devices to users that are a member of the [https://wiki.archlinux.org/index.php/Users_and_groups#System_groups {{ic|lp}} group]. Make sure to add your user to that group if you intend to connect to a bluetooth tether. You can change the group that is required in the file {{ic|/usr/share/dbus-1/system.d/bluetooth.conf}}.<br />
* Some Bluetooth adapters are bundled with a Wi-Fi card (e.g. [http://www.intel.com/content/www/us/en/wireless-products/centrino-advanced-n-6235.html Intel Centrino]). These require that the Wi-Fi card is firstly enabled (typically a keyboard shortcut on a laptop) in order to make the Bluetooth adapter visible to the kernel.<br />
* Some Bluetooth cards (e.g. Broadcom) conflict with the network adapter. Thus, you need to make sure that your Bluetooth device get connected before the network service boot.<br />
* Some tools such as hcitool and hciconfig have been deprecated upstream, and are no longer included in {{Pkg|bluez-utils}}. Since these tools will no longer be updated, it is recommended that scripts be updated to avoid using them. If you still desire to use them, install {{AUR|bluez-utils-compat}}. See {{Bug|53110}} and [https://www.spinics.net/lists/linux-bluetooth/msg69239.html the Bluez mailing list] for more information. }}<br />
<br />
=== Front-ends ===<br />
<br />
==== Console ====<br />
<br />
* {{App|bluetoothctl|Pairing a device from the shell is one of the simplest and most reliable options.|http://www.bluez.org/|{{Pkg|bluez-utils}}}}<br />
<br />
{{Tip|To automate bluetoothctl commands, use {{ic|echo -e "<command1>\n<command2>\n" {{!}} bluetoothctl}} or {{ic|bluetoothctl -- command}}}}<br />
<br />
==== Graphical ====<br />
<br />
The following packages allow for a graphical interface to customize Bluetooth.<br />
<br />
* {{App|GNOME Bluetooth|[[GNOME]]'s Bluetooth tool.<br />
** {{Pkg|gnome-bluetooth}} provides the back-end<br />
** {{Pkg|gnome-shell}} provides the status monitor applet<br />
** {{Pkg|gnome-control-center}} provides the configuration front-end GUI that can be accessed by typing Bluetooth on the Activities overview, or with the {{ic|gnome-control-center bluetooth}} command. <br />
** You can also launch the {{ic|bluetooth-sendto}} command directly to send files to a remote device.<br />
** To receive files, open the Bluetooth settings panel; you can only receive whilst the Bluetooth panel is open.<br />
** To add a Bluetooth entry to the ''Send To'' menu in Thunar's file properties menu, see instructions [http://docs.xfce.org/xfce/thunar/send-to here]. (The command that needs to be configured is {{ic|bluetooth-sendto %F}}).<br />
|https://wiki.gnome.org/Projects/GnomeBluetooth|}}<br />
* {{App|Bluedevil|[[KDE]]'s Bluetooth tool. If there is no Bluetooth icon visible in Dolphin and in the system tray, enable it in the system tray options or add a widget. You can configure Bluedevil and detect Bluetooth devices by clicking the icon. An interface is also available from the KDE System Settings.|https://projects.kde.org/projects/kde/workspace/bluedevil|{{Pkg|bluedevil}}}}<br />
* {{App|Blueberry|Linux Mint's spin-off of GNOME Bluetooth, which works in all desktop environments. ''Blueberry'' does not support receiving files through Obex Object Push.|https://github.com/linuxmint/blueberry|{{Pkg|blueberry}}}}<br />
* {{App|[[Blueman]]|A full featured Bluetooth manager.|https://github.com/blueman-project/blueman|{{Pkg|blueman}}}}<br />
* {{App|[[ObexFTP]]|A tool for transferring files to/from any OBEX enabled device.|http://dev.zuckschwerdt.org/openobex/wiki/ObexFtp|{{AUR|obexftp}}}}<br />
<br />
== Pairing ==<br />
<br />
{{Expansion|Step 5 is unclear. What are Bluetooth agents?}}<br />
<br />
{{Note|Before using the bluetooth device, make sure that it is not blocked by [[rfkill]].}}<br />
<br />
This section describes directly configuring ''bluez5'' via the ''bluetoothctl'' CLI, which might not be necessary if you are using an alternative front-end tool (such as GNOME Bluetooth).<br />
<br />
The exact procedure depends on the devices involved and their input functionality. What follows is a general outline of pairing a device using {{ic|bluetoothctl}}.<br />
<br />
Start the {{ic|bluetoothctl}} interactive command. Input {{ic|help}} to get a list of available commands.<br />
<br />
# (optional) Select a default controller with {{ic|select ''MAC_address''}}.<br />
# Enter {{ic|power on}} to turn the power to the controller on. It is off by default and will turn off again each reboot, see [[#Auto power-on after boot]].<br />
# Enter {{ic|devices}} to get the MAC Address of the device with which to pair.<br />
# Enter device discovery mode with {{ic|scan on}} command if device is not yet on the list.<br />
# Turn the agent on with {{ic|agent on}} or choose a specific agent: if you press tab twice after {{ic|agent}} you should see a list of available agents, e.g. DisplayOnly KeyboardDisplay NoInputNoOutput DisplayYesNo KeyboardOnly off on.<br />
# Enter {{ic|pair ''MAC_address''}} to do the pairing (tab completion works).<br />
# If using a device without a PIN, one may need to manually trust the device before it can reconnect successfully. Enter {{ic|trust ''MAC_address''}} to do so.<br />
# Enter {{ic|connect ''MAC_address''}} to establish a connection.<br />
<br />
An example session may look this way:<br />
<br />
# bluetoothctl <br />
[NEW] Controller 00:10:20:30:40:50 pi [default]<br />
[bluetooth]# agent KeyboardOnly <br />
Agent registered<br />
[bluetooth]# default-agent <br />
Default agent request successful<br />
[bluetooth]# power on<br />
Changing power on succeeded<br />
[CHG] Controller 00:10:20:30:40:50 Powered: yes<br />
[bluetooth]# scan on<br />
Discovery started<br />
[CHG] Controller 00:10:20:30:40:50 Discovering: yes<br />
[NEW] Device 00:12:34:56:78:90 myLino<br />
[CHG] Device 00:12:34:56:78:90 LegacyPairing: yes<br />
[bluetooth]# pair 00:12:34:56:78:90<br />
Attempting to pair with 00:12:34:56:78:90<br />
[CHG] Device 00:12:34:56:78:90 Connected: yes<br />
[CHG] Device 00:12:34:56:78:90 Connected: no<br />
[CHG] Device 00:12:34:56:78:90 Connected: yes<br />
Request PIN code<br />
[agent] Enter PIN code: 1234<br />
[CHG] Device 00:12:34:56:78:90 Paired: yes<br />
Pairing successful<br />
[CHG] Device 00:12:34:56:78:90 Connected: no<br />
[bluetooth]# connect 00:12:34:56:78:90<br />
Attempting to connect to 00:12:34:56:78:90<br />
[CHG] Device 00:12:34:56:78:90 Connected: yes<br />
Connection successful<br />
<br />
== Configuration ==<br />
<br />
=== Auto power-on after boot ===<br />
<br />
By default, your Bluetooth adapter will not power on after a reboot. The former method by using {{ic|hciconfig hci0 up}} is deprecated, see the [http://www.bluez.org/release-of-bluez-5-35/ release note]. Now you just need to add the line {{ic|1=AutoEnable=true}} in {{ic|/etc/bluetooth/main.conf}} at the bottom in the {{ic|[Policy]}} section:<br />
<br />
{{hc|1=/etc/bluetooth/main.conf|2=<br />
[Policy]<br />
AutoEnable=true<br />
}}<br />
<br />
== Audio ==<br />
<br />
In order to be able to use audio equipment like bluetooth headphones or speakers, you need to install the additional {{Pkg|pulseaudio-bluetooth}} package. With a default PulseAudio installation you should immediately be able to stream audio from a bluetooth device to your speakers.<br />
<br />
If you have a system-wide PulseAudio setup make sure the user running the daemon (usually {{ic|pulse}}) is in the {{ic|lp}} group and you load the bluetooth modules in your PulseAudio config:<br />
<br />
{{hc|/etc/pulse/system.pa|2=<br />
...<br />
load-module module-bluetooth-policy<br />
load-module module-bluetooth-discover<br />
...<br />
}}<br />
<br />
Please have a look at the [[Bluetooth headset]] page for more information about bluetooth audio and bluetooth headsets.<br />
<br />
== Bluetooth serial ==<br />
To get bluetooth serial communication working on Bluetooth-to-Serial modules (HC-05, HC-06) do the following steps:<br />
<br />
Pair your bluetooth device using {{ic|bluetoothctl}} as described [[#Pairing|above]].<br />
<br />
Install {{AUR|bluez-rfcomm}} and {{AUR|bluez-hcitool}}, as they provide certain functionality which is missing from newer tools.<br />
<br />
Bind paired device MAC address to tty terminal:<br />
# rfcomm bind rfcomm0 <MAC address of bluetooth device><br />
<br />
Now you can open {{ic|/dev/rfcomm0}} for serial communication.<br />
<br />
== Troubleshooting ==<br />
<br />
{{Out of date|Replace hciconfig with newer commands.}}<br />
<br />
=== Deprecated BlueZ tools ===<br />
<br />
Eight BlueZ tools [https://git.kernel.org/pub/scm/bluetooth/bluez.git/commit/?id=b1eb2c4cd057624312e0412f6c4be000f7fc3617 were deprecated] and removed from {{Pkg|bluez-utils}}, although not all of them were superseded by newer tools. The {{AUR|bluez-utils-compat}} package provides an alternative version of {{Pkg|bluez-utils}} with the deprecated tools.<br />
<br />
{| class="wikitable" style="max-width: 50em;"<br />
|-<br />
! Deprecated tool<br />
! Most likely replacement<br />
|-<br />
| [https://manpages.debian.org/stretch/bluez/gatttool.1.en.html gatttool] || btgatt-client, [https://git.kernel.org/cgit/bluetooth/bluez.git/tree/doc/gatt-api.txt D-Bus Gatt API]<br />
|-<br />
| [https://manpages.debian.org/stretch/bluez/hciattach.1.en.html hciattach] || btattach<br />
|-<br />
| [https://manpages.debian.org/stretch/bluez/hciconfig.1.en.html hciconfig] || btmgmt (and bluetoothctl?)<br />
|-<br />
| [https://manpages.debian.org/stretch/bluez-hcidump/hcidump.1.en.html hcidump] || btmon (and btsnoop)<br />
|-<br />
| [https://manpages.debian.org/stretch/bluez/hcitool.1.en.html hcitool] || missing, [https://git.kernel.org/cgit/bluetooth/bluez.git/tree/doc/device-api.txt D-Bus Device API] available<br />
|-<br />
| [https://manpages.debian.org/stretch/bluez/rfcomm.1.en.html rfcomm]<br />
| rowspan="2" | missing, implement with [https://git.kernel.org/cgit/bluetooth/bluez.git/tree/doc/profile-api.txt D-Bus Profile1 API]?<br />
|-<br />
| [https://manpages.debian.org/stretch/bluez/ciptool.1.en.html ciptool]<br />
|-<br />
| style="vertical-align: top;" | [https://manpages.debian.org/stretch/bluez/sdptool.1.en.html sdptool]<br />
| missing, functionality seems to be scattered over different D-Bus objects: [https://git.kernel.org/cgit/bluetooth/bluez.git/tree/doc/profile-api.txt Profile], [https://git.kernel.org/cgit/bluetooth/bluez.git/tree/doc/advertising-api.txt Advertising], and the UUIDs arrays in [https://git.kernel.org/cgit/bluetooth/bluez.git/tree/doc/device-api.txt device] and [https://git.kernel.org/cgit/bluetooth/bluez.git/tree/doc/adapter-api.txt adapter]. <br />
|}<br />
<br />
=== gnome-bluetooth ===<br />
<br />
If you see this when trying to enable receiving files in bluetooth-properties:<br />
<br />
Bluetooth OBEX start failed: Invalid path<br />
Bluetooth FTP start failed: Invalid path<br />
<br />
Then make sure that the [[XDG user directories]] exist.<br />
<br />
=== Bluetooth USB Dongle ===<br />
<br />
If you are using a USB dongle, you should check that your Bluetooth dongle is recognized. You can do that by running {{ic|journalctl -f}} when you have plugged in the USB dongle (or inspecting {{ic|/var/log/messages.log}}). It should look something like the following (look out for hci):<br />
<br />
{{bc|<br />
Feb 20 15:00:24 hostname kernel: [ 2661.349823] usb 4-1: new full-speed USB device number 3 using uhci_hcd<br />
Feb 20 15:00:24 hostname bluetoothd[4568]: HCI dev 0 registered<br />
Feb 20 15:00:24 hostname bluetoothd[4568]: Listening for HCI events on hci0<br />
Feb 20 15:00:25 hostname bluetoothd[4568]: HCI dev 0 up<br />
Feb 20 15:00:25 hostname bluetoothd[4568]: Adapter /org/bluez/4568/hci0 has been enabled<br />
}}<br />
<br />
If you only get the first two lines, you may see that it found the device but you need to bring it up.<br />
Example:<br />
<br />
{{hc|hciconfig -a hci0|<br />
hci0: Type: USB<br />
BD Address: 00:00:00:00:00:00 ACL MTU: 0:0 SCO MTU: 0:0<br />
DOWN <br />
RX bytes:0 acl:0 sco:0 events:0 errors:0<br />
TX bytes:0 acl:0 sco:0 commands:0 errors:<br />
}}<br />
<br />
# hciconfig hci0 up<br />
<br />
{{hc|hciconfig -a hci0|<br />
hci0: Type: USB<br />
BD Address: 00:02:72:C4:7C:06 ACL MTU: 377:10 SCO MTU: 64:8<br />
UP RUNNING <br />
RX bytes:348 acl:0 sco:0 events:11 errors:0<br />
TX bytes:38 acl:0 sco:0 commands:11 errors:0<br />
}}<br />
<br />
To verify that the device was detected you can use {{ic|hcitool}} which is part of the {{ic|bluez-utils}}. You can get a list of available devices and their identifiers and their MAC address by issuing:<br />
<br />
{{hc|$ hcitool dev|<br />
Devices:<br />
hci0 00:1B:DC:0F:DB:40<br />
}}<br />
<br />
More detailed information about the device can be retrieved by using {{ic|hciconfig}}.<br />
<br />
{{hc|$ hciconfig -a hci0|<br />
hci0: Type: USB<br />
BD Address: 00:1B:DC:0F:DB:40 ACL MTU: 310:10 SCO MTU: 64:8<br />
UP RUNNING PSCAN ISCAN<br />
RX bytes:1226 acl:0 sco:0 events:27 errors:0<br />
TX bytes:351 acl:0 sco:0 commands:26 errors:0<br />
Features: 0xff 0xff 0x8f 0xfe 0x9b 0xf9 0x00 0x80<br />
Packet type: DM1 DM3 DM5 DH1 DH3 DH5 HV1 HV2 HV3<br />
Link policy: RSWITCH HOLD SNIFF PARK<br />
Link mode: SLAVE ACCEPT <br />
Name: 'BlueZ (0)'<br />
Class: 0x000100<br />
Service Classes: Unspecified<br />
Device Class: Computer, Uncategorized<br />
HCI Ver: 2.0 (0x3) HCI Rev: 0xc5c LMP Ver: 2.0 (0x3) LMP Subver: 0xc5c<br />
Manufacturer: Cambridge Silicon Radio (10)<br />
}}<br />
<br />
==== Audio devices start to skip at short distance from dongle ====<br />
<br />
If other devices share the same USB host, they can [https://bbs.archlinux.org/viewtopic.php?pid=1440161#p1440161 interrupt communication with audio devices]. Make sure it is the only device attached to its bus. For example:<br />
<br />
{{hc|$ lsusb|<br />
Bus 002 Device 002: ID 0a12:0001 Cambridge Silicon Radio, Ltd Bluetooth Dongle (HCI mode)<br />
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub<br />
Bus 001 Device 004: ID 048d:1345 Integrated Technology Express, Inc. Multi Cardreader<br />
Bus 001 Device 003: ID 0424:a700 Standard Microsystems Corp. 2 Port Hub<br />
Bus 001 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub<br />
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub<br />
}}<br />
<br />
=== Logitech Bluetooth USB Dongle ===<br />
<br />
There are Logitech dongles (ex. Logitech MX5000) that can work in two modes: Embedded and HCI. In embedded mode dongle emulates a USB device so it seems to your PC that you are using a normal USB mouse/keyoard.<br />
<br />
If you hold the little red Button on the USB BT mini-receiver it will enable the other mode. Hold the red button on the BT dongle and plug it into the computer, and after 3-5 seconds of holding the button, the Bluetooth icon will appear in the system tray. [http://ubuntuforums.org/showthread.php?t=1332197 Discussion]<br />
<br />
Alternatively, you can install the {{Pkg|bluez-hid2hci}} package. When you connect your Logitech dongle it will automatically switch.<br />
<br />
=== hcitool scan: Device not found ===<br />
<br />
* On some laptops (e.g. Dell Studio 15, Lenovo Thinkpad X1) you have to switch the Bluetooth mode from HID to HCI. Install the {{Pkg|bluez-hid2hci}} package, then [[udev]] should do this automatically. Alternatively, you can run this command to switch to HCI manually:<br />
<br />
# /usr/lib/udev/hid2hci<br />
<br />
* If the device will not show up and you have a Windows operating system on your machine, try booting it and enable the bluetooth adapter from windows.<br />
<br />
* Sometimes also this simple command helps:<br />
<br />
# hciconfig hci0 up<br />
<br />
=== rfkill unblock: Do not unblock ===<br />
<br />
If your device still soft blocked and you run connman, try this:<br />
<br />
$ connmanctl enable bluetooth<br />
<br />
=== My computer is not visible ===<br />
<br />
Cannot discover computer from your phone? Enable PSCAN and ISCAN:<br />
<br />
# enable PSCAN and ISCAN<br />
$ hciconfig hci0 piscan <br />
# check it worked<br />
<br />
{{hc|$ hciconfig|<br />
hci0: Type: USB<br />
BD Address: 00:12:34:56:78:9A ACL MTU: 192:8 SCO MTU: 64:8<br />
'''UP RUNNING PSCAN ISCAN'''<br />
RX bytes:20425 acl:115 sco:0 events:526 errors:0<br />
TX bytes:5543 acl:84 sco:0 commands:340 errors:0<br />
}}<br />
<br />
{{Note|Check DiscoverableTimeout and PairableTimeout in {{ic|/etc/bluetooth/main.conf}}}}<br />
<br />
Try changing device class in {{ic|/etc/bluetooth/main.conf}} as following:<br />
<br />
# Default device class. Only the major and minor device class bits are<br />
# considered.<br />
#Class = 0x000100 (from default config)<br />
Class = 0x100100<br />
<br />
This was the only solution to make my computer visible for my phone.<br />
<br />
=== Logitech keyboard does not pair ===<br />
<br />
If you do not get the passkey when you try to pair your Logitech keyboard, type the following command:<br />
<br />
# hciconfig hci0 sspmode 0<br />
<br />
If after pairing, the keyboard still does not connect, check the output of {{ic|hcidump -at}}. If the latter indicates repeatedly connections-disconnections like the following message:<br />
<br />
status 0x00 handle 11 reason 0x13<br />
Reason: Remote User Terminated Connection<br />
<br />
then, the only solution for now is to install [[bluez4|the old Bluetooth stack]].<br />
<br />
=== HSP/HFP profiles ===<br />
<br />
bluez5 removed support for the HSP/HFP profiles (telephony headset for [[TeamSpeak]], [[Skype]], etc.). You need to install [[PulseAudio]] (>= version 6) or another application that implements HSP/HFP itself.<br />
<br />
=== Foxconn / Hon Hai / Lite-On Broadcom device ===<br />
<br />
Some of these devices require the firmware to be flashed into the device at boot. The firmware is not provided but can converted from a Microsoft Windows ''.hex'' file into a ''.hcd'' using [https://github.com/jessesung/hex2hcd hex2hcd] (which is installed with {{Pkg|bluez-utils}}).<br />
<br />
In order to get the right ''.hex'' file, try searching the device vendor:product code obtained with ''lsusb'', for example:<br />
<br />
...<br />
Bus 002 Device 004: ID '''04ca:2006''' Lite-On Technology Corp. Broadcom BCM43142A0 Bluetooth Device<br />
...<br />
<br />
or<br />
<br />
Bus 004 Device 004: Id '''0489:e031''' Foxconn / Hon Hai<br />
<br />
Alternatively, boot into Windows (a virtual machine installation will suffice) and get the firmware name from the Device Manager utility. If you want to know the model of your device but cannot see it in ''lsusb'', you might see it in ''lsusb -v'' as {{ic|iProduct}}.<br />
<br />
The ''.hex'' file can be extracted from the downloaded Windows driver without having to run Windows for it. Download the right driver, for example [http://www.fujitsupc.com/downloads/mobile/BLUETOOTH_WIDCOMM_V6.5.0.3100_WIN7-32_FPC46-1771-01.EXE Bluetooth Widcomm] (listed among the drivers for [http://support.fujitsupc.com/CS/Portal/supportsearch.do?srch=DOWNLOADS&Series=P%20Series&Model=P771&ProductType=Notebook%20PC Lifebook P771]), which contains the drivers for many Broadcomm devices. In case of Bluetooth Widcomm, the driver is a self-extracting RAR archive, so it can be extracted using ''{{Pkg|unrar}} x''. To find out which of the many ''.hex'' files is the right one for you, look in the file {{ic|Win32/bcbtums-win7x86-brcm.inf}} and search for {{ic|[RAMUSB'''E031'''.CopyList]}}, where {{ic|E031}} should be replaced with the product code (the second hex number in ''lsusb'') of your device in upper-case. Underneath you should see the file name of the right ''.hex'' file.<br />
<br />
Once you have the ''.hcd'' file, copy it into {{ic|/lib/firmware/brcm/BCM.hcd}} - this filename is suggested by {{ic|dmesg}} and it may change in your case so check your ''dmesg'' output in order to verify. Then reload the ''btusb'' module:<br />
<br />
# rmmod btusb<br />
# modprobe btusb<br />
<br />
The device should now be available. See [https://bbs.archlinux.org/viewtopic.php?id=162688 BBS#162688] for information on making these changes persistent.<br />
<br />
=== Intel combined wifi and bluetooth cards ===<br />
<br />
See [[Wireless network configuration#Bluetooth coexistence]].<br />
<br />
=== Device connects, then disconnects after a few moments ===<br />
<br />
If you see messages like the following in {{ic|journalctl}} output, and your device fails to connect or disconnects shortly after connecting:<br />
<br />
bluetoothd: Unable to get connect data for Headset Voice gateway: getpeername: Transport endpoint is not connected (107)<br />
bluetoothd: connect error: Connection refused (111)<br />
<br />
This may be because you have already paired the device with another operating system using the same bluetooth adapter (e.g., dual-booting). Some devices cannot handle multiple pairings associated with the same MAC address (i.e., bluetooth adapter). You can fix this by re-pairing the device. Start by removing the device:<br />
<br />
$ bluetoothctl<br />
[bluetooth]# devices<br />
Device XX:XX:XX:XX:XX:XX My Device<br />
[bluetooth]# remove XX:XX:XX:XX:XX:XX<br />
<br />
Then [[restart]] {{ic|bluetooth.service}}, turn on your bluetooth adapter, make your device discoverable, re-scan for devices, and re-pair your device. Depending on your bluetooth manager, you may need to perform a full reboot in order to re-discover the device.<br />
<br />
=== Device does not connect with an error in journal ===<br />
<br />
If you see a message like the following in {{ic|journalctl}} output while trying to connect to a device:<br />
<br />
a2dp-source profile connect failed for 9C:64:40:22:E1:3F: Protocol not available<br />
<br />
try installing {{Pkg|pulseaudio-bluetooth}} and restarting [[PulseAudio]]. This error can manifest even while using only file transfer.<br />
<br />
=== Device does not show up in scan ===<br />
<br />
Some devices using bluetooth low energy do not appear when scanning with bluetoothctl, for example the Logitech MX Master. The simplest way I have found to connect them is by installing {{aur|bluez-utils-compat}}, then [[start]] {{ic|bluetooth.service}} and do:<br />
<br />
# bluetoothctl<br />
[NEW] Controller (MAC) myhostname [default]<br />
[bluetooth]# power on<br />
[CHG] Controller (MAC) Class: 0x0c010c<br />
Changing power on succeeded<br />
[CHG] Controller (MAC) Powered: yes<br />
[bluetooth]# scan on<br />
Discovery started<br />
[CHG] Controller (MAC) Discovering: yes<br />
<br />
In another terminal:<br />
<br />
# hcitool lescan<br />
<br />
Wait until your device shows up, then Ctrl+C hcitool. bluetoothctl should now see your device and pair normally.<br />
<br />
=== Interference between Headphones and Mouse ===<br />
<br />
If you experience audio stuttering while using a bluetooth mouse and keyboard simultaneously, you can try the following as referenced in #23 https://bugs.launchpad.net/ubuntu/+source/bluez/+bug/424215<br />
<br />
# hciconfig hci0 lm ACCEPT,MASTER<br />
# hciconfig hci0 lp HOLD,SNIFF,PARK<br />
<br />
=== Failed to pair: org.bluez.Error.ConnectionAttemptFailed ===<br />
<br />
{{Remove|This is overreacting, you could simply restart your bluetooth service, it would have the same effect}}<br />
<br />
When getting this error on pairing via {{ic|bluetoothctl}}, among other things (search the internet), rebooting can help.</div>Delapouitehttps://wiki.archlinux.org/index.php?title=Gitolite&diff=568078Gitolite2019-03-07T11:34:16Z<p>Delapouite: add link to git</p>
<hr />
<div>[[Category:Version Control System]]<br />
[[ja:Gitolite]]<br />
[https://github.com/sitaramc/gitolite Gitolite] allows you to host [[Git]] repositories for multiple users easily and securely.<br />
<br />
== Installation ==<br />
[[Install]] the {{Pkg|gitolite}} package.<br />
<br />
== Configuration ==<br />
Installing gitolite automatically adds the ''gitolite'' user to the system, with home directory {{ic|/var/lib/gitolite}}.<br />
<br />
=== Admin SSH access ===<br />
<br />
To give yourself admin access, copy your SSH public key to {{ic|/var/lib/gitolite/''username''.pub}}, where {{ic|username}} is your username.<br />
# install -o gitolite -g gitolite ~/.ssh/id_rsa.pub /var/lib/gitolite/''username''.pub<br />
<br />
Then run the Gitolite setup script as the ''gitolite'' user.<br />
# sudo -u gitolite gitolite setup -pk /var/lib/gitolite/''username''.pub<br />
<br />
This puts your public key into the gitolite-admin keydir and gives your username RW+ access to the gitolite-admin repository<br />
<br />
You can now remove the copy of your SSH public key<br />
# rm /var/lib/gitolite/''username''.pub<br />
<br />
Now as your user you can check that everything went correctly<br />
{{hc|$ ssh gitolite@''hostname'' info|<br />
hello ''username'', this is gitolite@''hostname'' running gitolite3 v3.6.2 on git 2.3.3<br />
<br />
R W gitolite-admin<br />
R W testing<br />
}}<br />
<br />
Do '''not''' add repositories or users directly as ''gitolite'' on the server! The server '''must''' be managed by cloning the special ''gitolite-admin'' repository<br />
$ git clone gitolite@''hostname'':gitolite-admin<br />
<br />
For reference see [https://github.com/sitaramc/gitolite/ Gitolite].<br />
<br />
=== Create a repository ===<br />
<br />
To create a repository, first check out the {{ic|gitolite-admin}} repository as a client.<br />
<br />
$ git clone gitolite@''server'':gitolite-admin<br />
<br />
Append a new repository to {{ic|gitolite-admin/conf/gitolite.conf}}:<br />
<br />
repo ''repository_name''<br />
RW+ = @all<br />
<br />
Commit and push the changes and gitolite will automatically generate the necessary files on the server.<br />
<br />
=== Adding http(s) access via Apache (with basic authentication) ===<br />
<br />
We need to create an suEXEC wrapper script. To satisfy suEXEC's security requirements, the script and the directory containing it must be owned by {{ic|gitolite:gitolite}} and below {{ic|/srv/http}} in the directory hierarchy. For this example, we create the directory as {{ic|/srv/http/git/cgi-bin}}.<br />
# install -o gitolite -g gitolite -d /srv/http/git/cgi-bin<br />
<br />
Create an suEXEC wrapper for the gitolite shell with the contents below. For this example, we create it as {{ic|/srv/http/git/cgi-bin/gitolite-suexec-wrapper}}.<br />
{{hc|/srv/http/git/cgi-bin/gitolite-suexec-wrapper|2=<br />
#!/usr/bin/bash<br />
#<br />
# suEXEC wrapper for gitolite-shell<br />
#<br />
<br />
export GIT_PROJECT_ROOT=/var/lib/gitolite/repositories<br />
export GITOLITE_HTTP_HOME=/var/lib/gitolite<br />
<br />
exec /usr/lib/gitolite/gitolite-shell<br />
}}<br />
<br />
Make the wrapper executable and owned by {{ic|gitolite:gitolite}}.<br />
# chown gitolite:gitolite /srv/http/git/cgi-bin/gitolite-suexec-wrapper<br />
# chmod 0755 /srv/http/git/cgi-bin/gitolite-suexec-wrapper<br />
<br />
Create an empty password database file, owned by {{ic|gitolite:http}}<br />
# install -o gitolite -g http -m 0640 /dev/null /srv/http/git/htpasswd<br />
<br />
Apache's basic authentication mechanism is separate from ssh, and therefore requires a separate set of credentials. Create your web users using {{ic|htpasswd}}.<br />
# htpasswd /srv/http/git/htpasswd ''username''<br />
<br />
Add the following to your Apache vhost configuration:<br />
{{bc|<br />
SuexecUserGroup gitolite gitolite<br />
ScriptAlias /git/ /srv/http/git/cgi-bin/gitolite-suexec-wrapper/<br />
<br />
<Directory /srv/http/git/cgi-bin><br />
Require all granted<br />
</Directory><br />
<br />
<Location /git><br />
AuthType Basic<br />
AuthName "Git Access"<br />
AuthBasicProvider file<br />
AuthUserFile /srv/http/git/htpasswd<br />
Require valid-user<br />
</Location><br />
}}<br />
<br />
Restart {{ic|httpd.service}}.<br />
<br />
Finally, in the gitolite-admin repository you cloned in the previous section, edit {{ic|conf/gitolite.conf}}, add an {{ic|1=R = daemon}} access rule to all repositories you want to make available via http, and push the changes.<br />
<br />
== Add users ==<br />
<br />
=== ssh users ===<br />
<br />
Ask each user who will get access to send you an [[SSH keys|SSH public key]]. Rename each public key to {{ic|''username''.pub}}, where {{ic|''username''}} is the user name which will be used in {{ic|gitolite.conf}}. Then move all new public keys to the {{ic|keydir}} directory in the cloned {{ic|gitolite-admin}} repo. You can also organise them into various subdirectories of {{ic|keydir}} if you wish, since the entire tree is searched.<br />
<br />
Finally commit and push the changes.<br />
<br />
See the [http://gitolite.com/gitolite/basic-admin/#addremove-users add/remove users] in the official documentation for details.<br />
<br />
To grant access rights to the new users, edit the config file ({{ic|conf/gitolite.conf}} in the {{ic|gitolite-admin}} repo). See [http://gitolite.com/gitolite/conf/ the "conf" file] in the official documentation for details.<br />
<br />
=== http(s) users ===<br />
<br />
User management for http(s) is more suitable for single-user setups. To add a new user or to change an existing user's password:<br />
# htpasswd /srv/http/git/htpasswd ''username''<br />
<br />
== Troubleshooting ==<br />
In case you cannot log in with the gitolite account, it may be caused by the account being locked, and depending of your ssh configuration.<br />
<br />
If you have done some SSH hardening, it may be the cause of this behavior, as noted in [http://arlimus.github.io/articles/usepam/ SSH and locked users Article] and [http://unix.stackexchange.com/questions/193066/how-to-unlock-account-for-public-key-ssh-authorization-but-not-for-password-aut Unix & Linux StackExchange - How to unlock account for public key ssh authorization, but not for password authorization].<br />
<br />
To solve this you have to allow PAM in {{ic|sshd_config}} or unlock the account by:<br />
<br />
# usermod -p '*' gitolite<br />
<br />
{{hc|/etc/passwd|<br />
...<br />
gitolite:*:16199:0:99999:7:::<br />
...<br />
}}<br />
<br />
{{Warning|Do not leave the account in the state left by {{ic|passwd -u}} (with a blank password field). Doing that will allow logins without entering a password!}}<br />
<br />
== See also ==<br />
* [http://sitaramc.github.com/gitolite/index.html Gitolite Site]<br />
* [http://arlimus.github.io/articles/usepam/ SSH and locked users Article]<br />
* [http://unix.stackexchange.com/questions/193066/how-to-unlock-account-for-public-key-ssh-authorization-but-not-for-password-aut Unix & Linux StackExchange - How to unlock account for public key ssh authorization, but not for password authorization]</div>Delapouitehttps://wiki.archlinux.org/index.php?title=Limits.conf&diff=567532Limits.conf2019-02-28T16:20:29Z<p>Delapouite: add link to fork-bomb on wikipedia</p>
<hr />
<div>{{Lowercase title}}<br />
[[Category:Authentication]]<br />
[[ja:Limits.conf]]<br />
{{Related articles start}}<br />
{{Related|Cgroups}}<br />
{{Related|Security}}<br />
{{Related articles end}}<br />
<br />
{{ic|/etc/security/limits.conf}} allows setting resource limits for users logged in via [[PAM]]. This is a useful way of preventing, for example, [[Wikipedia:Fork_bomb|fork-bombs]] from using up all system resources. <br />
<br />
{{Note|The file does not affect system services. For [[systemd]] services the files {{ic|/etc/systemd/system.conf}}, {{ic|/etc/systemd/user.conf}}, and {{ic|/etc/systemd/<systemd_unit>/override.conf}} control the limit. See the {{man|5|systemd-system.conf}} man page for details.}}<br />
<br />
== Syntax ==<br />
<br />
The default file comes well-commented, but extra information can be gleaned by checking the {{man|5|limits.conf}} man page.<br />
<br />
== Recommendations ==<br />
<br />
=== core ===<br />
<br />
Corefiles are useful for debugging, but annoying when normally using your system. You should have a soft limit of 0 and a hard limit of unlimited, and then temporarily raise your limit for the current shell with {{ic|$ ulimit -c unlimited}} when you need corefiles for debugging.<br />
<br />
* soft core 0 # Prevent corefiles from being generated by default.<br />
* hard core unlimited # Allow corefiles to be temporarily enabled.<br />
<br />
=== nice ===<br />
<br />
You should disallow everyone except for root from having processes of minimal niceness (-20), so that root can fix an unresponsive system.<br />
<br />
* hard nice -19 # Prevent non-root users from running a process at minimal niceness.<br />
root hard nice -20 # Allows root to run a process at minimal niceness to fix the system when unresponsive.<br />
<br />
=== nofile ===<br />
<br />
This limits the number of file descriptors any process owned by the specified domain can have open at any one time. You may need to increase this value to something as high as {{ic|8192}} [https://appdb.winehq.org/objectManager.php?sClass=version&iId=21080&iTestingId=89787 for certain games to work].<br />
<br />
* hard nofile 8192 # Required for certain games to run.<br />
<br />
=== nproc ===<br />
<br />
Having an nproc limit is important, because this will limit how many times a fork-bomb can replicate. However, having it too low can make your system unstable or even unusable, as new processes will not be able to be created.<br />
<br />
A value of {{ic|300}} is too low for even the most minimal of Window-managers to run more than a few desktop applications and daemons, but is often fine for an X-less server (in fact, {{ic|300}} is the value that the University of Georgia uses for the undergrad process limit on its Linux server).<br />
<br />
Here is an example nproc limit for all users on a system:<br />
<br />
* hard nproc 2048 # Prevent fork-bombs from taking out the system.<br />
<br />
Note that this value of {{ic|2048}} is just an example, and you may need to set yours higher. On the flipside, you also may be able to do with it being lower.<br />
<br />
Whatever you set your nproc to, make sure to allow your root user to create as many processes as it wants; else, you might make your system inoperable by setting the normal nproc limit too low. Note that this line has to come after the global hardlimit, and that the value below ({{ic|65536}}) is arbitrary.<br />
<br />
root hard nproc 65536 # Prevent root from not being able to launch enough processes<br />
<br />
=== priority ===<br />
<br />
The default niceness should generally be 0, but you can set individual users and groups to have different default priorities using this parameter.<br />
<br />
* soft priority 0 # Set the default priority to neutral niceness.</div>Delapouitehttps://wiki.archlinux.org/index.php?title=Tmux&diff=567155Tmux2019-02-23T12:01:06Z<p>Delapouite: add links to vi and emacs</p>
<hr />
<div>{{lowercase title}}<br />
[[Category:Terminal multiplexers]]<br />
[[es:Tmux]]<br />
[[ja:Tmux]]<br />
[[ru:Tmux]]<br />
[[zh-hans:Tmux]]<br />
[http://tmux.github.io/ tmux] is a "terminal multiplexer: it enables a number of terminals (or windows), each running a separate program, to be created, accessed, and controlled from a single screen. tmux may be detached from a screen and continue running in the background, then later reattached." <br />
<br />
tmux is an ISC-licensed alternative to [[GNU Screen]]. Although similar, there are many differences between the programs, as noted on the [https://github.com/tmux/tmux/wiki/FAQ tmux FAQ page].<br />
<br />
== Installation ==<br />
[[Install]] the {{Pkg|tmux}} package.<br />
Optionally, install {{Aur|tmux-bash-completion}} to provide bash completion functions for tmux.<br />
<br />
== Configuration ==<br />
A user-specific configuration file should be located at {{ic|~/.tmux.conf}}, while a global configuration file should be located at {{ic|/etc/tmux.conf}}.<br />
<br />
=== Key bindings ===<br />
<br />
By default, command key bindings are prefixed by {{Ic|Ctrl-b}}. For example, to vertically split a window type {{Ic|Ctrl-b+%}}.<br />
<br />
After splitting a window into multiple panes, a pane can be resized by the hitting prefix key (e.g. {{Ic|Ctrl-b}}) and, while continuing to hold Ctrl, press Left/Right/Up/Down. Swapping panes is achieved in the same manner, but by hitting ''o'' instead of a directional key.<br />
<br />
Key bindings may be changed with the bind and unbind commands in {{ic|tmux.conf}}. For example, the default prefix binding of {{Ic|Ctrl-b}} can be changed to {{Ic|Ctrl-a}} by adding the following commands in your configuration file:<br />
<br />
{{bc|<br />
unbind C-b<br />
set -g prefix C-a<br />
bind C-a send-prefix<br />
}}<br />
<br />
{{Tip|Quote special characters to use them as prefix. You may also use {{ic|Alt}} (called Meta) instead of {{ic|Ctrl}}. For example: {{ic|set -g prefix m-'\'}}}}<br />
<br />
Additional ways to move between windows include the following:<br />
<br />
Ctrl-b l (Move to the previously selected window)<br />
Ctrl-b w (List all windows / window numbers)<br />
Ctrl-b <window number> (Move to the specified window number, the default bindings are from 0 – 9)<br />
Ctrl-b q (Show pane numbers, when the numbers show up type the key to goto that pane)<br />
<br />
tmux has a find-window option & key binding to ease navigation of many windows:<br />
<br />
Ctrl-b f <window name> (Search for window name)<br />
Ctrl-b w (Select from interactive list of windows)<br />
<br />
==== Copy Mode ====<br />
<br />
A tmux window may be in one of several modes. The default permits direct access to the terminal attached to the window; the other is copy mode. Once in copy mode you can navigate the buffer including scrolling the history. Use [[vi]] or [[emacs]]-style key bindings in copy mode. The default is emacs, unless VISUAL or EDITOR contains ‘vi’<br />
<br />
To enter copy mode do the following:<br />
<br />
Ctrl-b [<br />
<br />
You can navigate the buffer as you would in your default editor.<br />
<br />
To quit copy mode, use one of the following keybindings:<br />
<br />
vi mode:<br />
q<br />
emacs mode:<br />
Esc<br />
<br />
=== Browsing URLs ===<br />
To browse URLs inside tmux you must have {{AUR|urlview}} installed and configured.<br />
<br />
Inside a new terminal:<br />
bind-key u capture-pane \; save-buffer /tmp/tmux-buffer \; run-shell "$TERMINAL -e urlview /tmp/tmux-buffer"<br />
<br />
Or inside a new tmux window (no new terminal needed):<br />
bind-key u capture-pane \; save-buffer /tmp/tmux-buffer \; new-window -n "urlview" '$SHELL -c "urlview < /tmp/tmux-buffer"'<br />
<br />
=== Setting the correct term ===<br />
==== 256 colors ====<br />
If you are using a 256 colour terminal, you will need to set the correct term in tmux. As of [https://raw.githubusercontent.com/tmux/tmux/master/CHANGES tmux 2.1], this is now ''tmux'', or ''tmux-256color''. You can do this in {{ic|tmux.conf}}:<br />
<br />
set -g default-terminal "tmux-256color" <br />
<br />
Other, older alternatives, include ''screen'', or ''screen-256color'':<br />
<br />
set -g default-terminal "screen-256color"<br />
<br />
Also, if tmux messes up, you can force tmux to assume that the terminal support 256 colors, by adding this in your .bashrc:<br />
<br />
alias tmux="tmux -2"<br />
<br />
==== 24-bit color ====<br />
<br />
tmux supports 24-bit color as of version 2.2 [https://github.com/tmux/tmux/commit/427b8204268af5548d09b830e101c59daa095df9]. If your terminal supports 24-bit color (see this [https://gist.github.com/XVilka/8346728 gist]), add your terminal to the {{ic|terminal-overrides}} setting. For example, if you use [[Termite]], you would add:<br />
<br />
set -ga terminal-overrides ",xterm-termite:Tc"<br />
<br />
For other terminals, replace {{ic|xterm-termite}} with the relevant terminal type (stored in {{ic|$TERM}}). See the {{man|1|tmux}} man page for details about the {{ic|Tc}} terminfo extension.<br />
<br />
==== xterm-keys ====<br />
To enable xterm-keys in your {{ic|tmux.conf}}, you have to add the following line<br />
<br />
set-option -g xterm-keys on<br />
<br />
If you enable xterm-keys in your {{ic|tmux.conf}}, then you need to build a custom terminfo to declare the new escape codes or applications will not know about them. Compile the following with {{ic|tic}} and you can use "xterm-screen-256color" as your TERM:<br />
<br />
# A screen- based TERMINFO that declares the escape sequences<br />
# enabled by the tmux config "set-window-option -g xterm-keys".<br />
#<br />
# Prefix the name with xterm- since some applications inspect<br />
# the TERM *name* in addition to the terminal capabilities advertised.<br />
xterm-screen-256color|GNU Screen with 256 colors bce and tmux xterm-keys,<br />
<br />
# As of Nov'11, the below keys are picked up by<br />
# .../tmux/blob/master/trunk/xterm-keys.c:<br />
kDC=\E[3;2~, kEND=\E[1;2F, kHOM=\E[1;2H,<br />
kIC=\E[2;2~, kLFT=\E[1;2D, kNXT=\E[6;2~, kPRV=\E[5;2~,<br />
kRIT=\E[1;2C,<br />
<br />
# Change this to screen-256color if the terminal you run tmux in<br />
# doesn't support bce:<br />
use=screen-256color-bce,<br />
<br />
=== Other Settings ===<br />
To limit the scrollback buffer to 10000 lines:<br />
set -g history-limit 10000<br />
<br />
Mouse can be toggled with<br />
bind-key m set-option -g mouse on \; display 'Mouse: ON'<br />
bind-key M set-option -g mouse off \; display 'Mouse: OFF'<br />
<br />
=== Autostart with systemd ===<br />
<br />
There are some notable advantages to starting a tmux server at startup.<br />
Notably, when you start a new tmux session, having the service already running reduces any delays in the startup.<br />
<br />
Furthermore, any customization attached to your tmux session will be retained and your tmux session can be made to persist even if you have never logged in, if you have some reason to do that (like a heavily scripted tmux configuration or shared user tmux sessions).<br />
<br />
The service below starts ''tmux'' for the specified user (i.e. start with {{ic|tmux@''username''.service}}):<br />
<br />
{{hc|/etc/systemd/system/tmux@.service|<nowiki><br />
[Unit]<br />
Description=Start tmux in detached session<br />
<br />
[Service]<br />
Type=forking<br />
User=%I<br />
ExecStart=/usr/bin/tmux new-session -s %u -d<br />
ExecStop=/usr/bin/tmux kill-session -t %u<br />
<br />
[Install]<br />
WantedBy=multi-user.target<br />
</nowiki>}}<br />
<br />
{{Tip|You may want to add {{ic|1=WorkingDirectory=''custom_path''}} to customize working directory.}}<br />
<br />
Alternatively, you can place this file within your [[systemd/User]] directory (without {{ic|1=User=%I}}), for example {{ic|~/.config/systemd/user/tmux.service}}. This way the tmux service will start when you log in, unless you also enable [[systemd/User#Automatic start-up of systemd user instances]].<br />
<br />
== Session initialization ==<br />
You can have tmux open a session with preloaded windows by including those details in your {{ic|~/.tmux.conf}}:<br />
<br />
new -n WindowName Command<br />
neww -n WindowName Command<br />
neww -n WindowName Command<br />
<br />
To start a session with split windows (multiple panes), include the splitw command below the neww you would like to split; thus:<br />
<br />
new -s SessionName -n WindowName Command<br />
neww -n foo/bar foo<br />
splitw -v -p 50 -t 0 bar<br />
selectw -t 1 <br />
selectp -t 0<br />
<br />
would open 2 windows, the second of which would be named foo/bar and would be split vertically in half (50%) with foo running above bar. Focus would be in window 2 (foo/bar), top pane (foo).<br />
<br />
{{Note|Numbering for sessions, windows and panes starts at zero, unless you have specified a base-index of 1 in your {{ic|.conf}} }}<br />
<br />
To manage multiple sessions, source separate session files from your conf file:<br />
<br />
# initialize sessions<br />
bind F source-file ~/.tmux/foo<br />
bind B source-file ~/.tmux/bar<br />
<br />
== X clipboard integration ==<br />
<br />
{{Tip|The tmux plugin [https://github.com/tmux-plugins/tmux-yank tmux-yank] provides similar functionality.}}<br />
<br />
It is possible to copy a tmux selection to the X clipboard (and to X primary/secondary selections), and paste from the X clipboard into tmux. The following tmux config file snippet integrates the X clipboard/selection with the current tmux selection using the program {{Pkg|xsel}}:<br />
<br />
# Emacs style<br />
bind-key -T copy-mode y send-keys -X copy-pipe-and-cancel "xsel -i -p && xsel -o -p | xsel -i -b"<br />
bind-key C-y run "xsel -o | tmux load-buffer - ; tmux paste-buffer"<br />
<br />
# Vim style<br />
bind-key -T copy-mode-vi y send-keys -X copy-pipe-and-cancel "xsel -i -p && xsel -o -p | xsel -i -b"<br />
bind-key p run "xsel -o | tmux load-buffer - ; tmux paste-buffer"<br />
<br />
Note that it may be necessary to unbind the previous window shortcut with {{ic|unbind p}} for the latter to work.<br />
<br />
{{pkg|xclip}} could also be used for this purpose. Unlike xsel, it works better when printing a raw bitstream that does not fit the current locale. Nevertheless, it is neater to use xsel because xclip does not close {{ic|STDOUT}} after it has read from the tmux buffer. As such, tmux does not know that the copy task has completed, and continues to wait for xclip to terminate, thereby rendering tmux unresponsive. A workaround is to redirect {{ic|STDOUT} to {{ic|/dev/null}}:<br />
<br />
# Vim style<br />
bind-key -T copy-mode-vi y send-keys -X copy-pipe-and-cancel "xclip -i -sel clip > /dev/null"<br />
bind-key p run "xclip -o -sel clip | tmux load-buffer - ; tmux paste-buffer"<br />
<br />
=== Urxvt middle click ===<br />
<br />
{{Note|To use this, you need to enable mouse support}}<br />
<br />
There is an unofficial perl extension ([https://github.com/tmux/tmux/wiki/FAQ#how-do-i-copy-a-selection-from-tmux-to-the-systems-clipboard mentioned] in the official [https://github.com/tmux/tmux/wiki/FAQ FAQ]) to enable copying/pasting in and out of urxvt with tmux via Middle Mouse Clicking.<br />
<br />
First, you will need to download the perl script and place it into urxvts perl lib:<br />
<br />
{{bc|wget http://anti.teamidiot.de/static/nei/*/Code/urxvt/osc-xterm-clipboard<br />
mv osc-xterm-clipboard /usr/lib/urxvt/perl/|<br />
}}<br />
<br />
You will also need to enable that perl script in your .Xdefaults:<br />
<br />
{{hc|~/.Xdefaults|<br />
...<br />
*URxvt.perl-ext-common: osc-xterm-clipboard<br />
...<br />
}}<br />
<br />
Next, you want to tell tmux about the new function and enable mouse support (if you haven't already):<br />
<br />
{{hc|~/.tmux.conf|<br />
...<br />
set-option -ga terminal-override ',rxvt-uni*:XT:Ms<nowiki>=</nowiki>\E]52;%p1%s;%p2%s\007'<br />
set -g mouse on<br />
...<br />
}}<br />
<br />
That's it. Be sure to end all instances of tmux before trying the new MiddleClick functionality.<br />
<br />
While in tmux, Shift+MiddleMouseClick will paste the clipboard selection while just MiddleMouseClick will paste your tmux buffer.<br />
Outside of tmux, just use MiddleMouseClick to paste your tmux buffer and your standard Ctrl-c to copy.<br />
<br />
== Tips and tricks ==<br />
=== Start tmux with default session layout ===<br />
Session managers like tmuxinator and [[tmuxp]] make it easy to manage common session configurations.<br />
<br />
For tmuxinator, install {{AUR|tmuxinator}} from [[AUR]]. Test your installation with<br />
<br />
tmuxinator doctor<br />
<br />
==== Get the default layout values ====<br />
Start tmux as usual and configure your windows and panes layout as you like. When finished, get the current layout values by executing (while you are still within the current tmux session)<br />
<br />
tmux list-windows<br />
<br />
The output may look like this (two windows with 3 panes and 2 panes layout)<br />
<br />
0: default* (3 panes) [274x83] [layout 20a0,274x83,0,0{137x83,0,0,3,136x83,138,0[136x41,138,0,5,136x41,138,42,6]}] @2 (active)<br />
1: remote- (2 panes) [274x83] [layout e3d3,274x83,0,0[274x41,0,0,4,274x41,0,42,7]] @3 <br />
<br />
The Interesting part you need to copy for later use begins after '''[layout...''' and excludes '''... ] @2 (active)'''. For the first window layout you need to copy e.g. '''20a0,274x83,0,0{137x83,0,0,3,136x83,138,0[136x41,138,0,5,136x41,138,42,6]}'''<br />
<br />
==== Define the default tmux layout ====<br />
<br />
Knowing this, you can exit the current tmux session. Following this, you create your default tmux session layout by editing tmuxinator's config file (Don't copy the example, get your layout values as described above)<br />
<br />
{{hc|~/.tmuxinator/default.yml|<nowiki><br />
name: default<br />
root: ~/<br />
windows:<br />
- default:<br />
layout: 20a0,274x83,0,0{137x83,0,0,3,136x83,138,0[136x41,138,0,5,136x41,138,42,6]}<br />
panes:<br />
- clear<br />
- vim<br />
- clear && emacs -nw<br />
- remote:<br />
layout: 24ab,274x83,0,0{137x83,0,0,3,136x83,138,0,4}<br />
panes:<br />
- <br />
- <br />
</nowiki>}}<br />
<br />
The example defines two windows named "default" and "remote". With your determined layout values. For each pane you have to use at least one {{ic|-}} line. Within the first window panes you start the commandline "clear" in pane one, "vim" in pane two and "clear && emacs -nw" executes two commands in pane three on each tmux start. The second window layout has two panes without defining any start commmands.<br />
<br />
Test the new default layout with (yes, it is "mux"):<br />
<br />
mux default<br />
<br />
==== Autostart tmux with default tmux layout ====<br />
<br />
If you like to start your terminal session with your default tmux session layout edit<br />
{{hc|~/.bashrc|<nowiki><br />
if [ -z "$TMUX" ]; then<br />
mux default <br />
fi <br />
</nowiki>}}<br />
<br />
====Alternate approach for default session====<br />
Instead of using the above method, one can just write a bash script that when run, will create the default session and attach to it.<br />
Then you can execute it from a terminal to get the pre-designed configuration in that terminal<br />
<br />
#!/bin/bash<br />
tmux new-session -d -n WindowName Command<br />
tmux new-window -n NewWindowName<br />
tmux split-window -v<br />
tmux selectp -t 1<br />
tmux split-window -h<br />
tmux selectw -t 1<br />
tmux -2 attach-session -d<br />
<br />
===Start tmux in urxvt===<br />
Use this command to start urxvt with a started tmux session. I use this with the exec command from my .ratpoisonrc file.<br />
{{bc|<nowiki>urxvt -e bash -c "tmux -q has-session && exec tmux attach-session -d || exec tmux new-session -n$USER -s$USER@$HOSTNAME"</nowiki>}}<br />
<br />
=== Start tmux on every shell login ===<br />
<br />
==== Bash ====<br />
<br />
For bash, simply add the following line of bash code to your .bashrc before your aliases; the code for other shells is very similar:<br />
<br />
{{hc|~/.bashrc|<nowiki><br />
# If not running interactively, do not do anything<br />
[[ $- != *i* ]] && return<br />
[[ -z "$TMUX" ]] && exec tmux<br />
</nowiki>}}<br />
<br />
{{note|This snippet ensures that tmux is not launched inside of itself (something tmux usually already checks for anyway). tmux sets $TMUX to the socket it is using whenever it runs, so if $TMUX isn't set or is length 0, we know we aren't already running tmux.}}<br />
<br />
Note that the above snippet will cause tmux to launch upon login to the virtual console as well as upon launching a terminal emulator inside X, thus preventing you from launching X manually with {{ic|startx}}. To only launch tmux automatically when there's a graphical environment running, enclose the code in an if statement:<br />
<br />
{{hc|~/.bashrc|<nowiki><br />
if [[ $DISPLAY ]]; then<br />
# If not running interactively, do not do anything<br />
[[ $- != *i* ]] && return<br />
[[ -z "$TMUX" ]] && exec tmux<br />
fi<br />
</nowiki>}}<br />
<br />
Add the following snippet to start only one session (unless you start some manually), on login, try attach at first, only create a session if no tmux is running.<br />
<br />
{{bc|<nowiki><br />
# TMUX<br />
if which tmux >/dev/null 2>&1; then<br />
#if not inside a tmux session, and if no session is started, start a new session<br />
test -z "$TMUX" && (tmux attach || tmux new-session)<br />
fi<br />
</nowiki>}}<br />
<br />
The following snippet does the same thing, but also checks tmux is installed before trying to launch it. It also tries to reattach you to an existing tmux session at logout, so that you can shut down every tmux session quickly from the same terminal at logout.<br />
{{bc|<nowiki><br />
# TMUX<br />
if which tmux >/dev/null 2>&1; then<br />
# if no session is started, start a new session<br />
test -z ${TMUX} && tmux<br />
<br />
# when quitting tmux, try to attach<br />
while test -z ${TMUX}; do<br />
tmux attach || break<br />
done<br />
fi<br />
</nowiki>}}<br />
<br />
Another possibility is to try to attach to existing detached session or start a new session:<br />
<br />
{{bc|<nowiki><br />
if [[ -z "$TMUX" ]] ;then<br />
ID="$( tmux ls | grep -vm1 attached | cut -d: -f1 )" # get the id of a deattached session<br />
if [[ -z "$ID" ]] ;then # if not available create a new one<br />
tmux new-session<br />
else<br />
tmux attach-session -t "$ID" # if available attach to it<br />
fi<br />
fi<br />
</nowiki>}}<br />
<br />
=== Start a non-login shell ===<br />
<br />
tmux starts a [http://unix.stackexchange.com/questions/38175 login shell] [http://comments.gmane.org/gmane.comp.terminal-emulators.tmux.user/5997 by default], which may result in multiple negative side effects:<br />
<br />
* Users of [[Wikipedia:fortune (Unix)|fortune]] may notice that quotes are printed when creating a new panel.<br />
* The configuration files for login shells such as {{ic|~/.profile}} are interpreted each time a new panel is created, so commands intended to be run on session initialization (e.g. setting audio level) are executed.<br />
<br />
To disable this behaviour, add to {{ic|~/.tmux.conf}}:<br />
<br />
set -g default-command "${SHELL}"<br />
<br />
=== Use tmux windows like tabs ===<br />
<br />
The following settings added to {{ic|~/.tmux.conf}} allow to use tmux windows like tabs, such as those provided by the reference of these hotkeys — [[Rxvt-unicode/Tips_and_tricks#urxvtq_with_tabbing|urxvt's tabbing extensions]]. An advantage thereof is that these virtual “tabs” are independent of the terminal emulator.<br />
<br />
#urxvt tab like window switching (-n: no prior escape seq)<br />
bind -n S-down new-window<br />
bind -n S-left prev<br />
bind -n S-right next<br />
bind -n C-left swap-window -t -1<br />
bind -n C-right swap-window -t +1<br />
<br />
Of course, those should not overlap with other applications' hotkeys, such as the terminal's. Given that they substitute terminal tabbing that might as well be deactivated, though.<br />
<br />
It can also come handy to supplement the EOT hotkey {{ic|Ctrl+d}} with one for tmux's detach:<br />
<br />
bind-key -n C-j detach<br />
<br />
=== Clients simultaneously interacting with various windows of a session ===<br />
<br />
In [http://mutelight.org/articles/practical-tmux Practical Tmux], Brandur Leach writes:<br />
<br />
: Screen and tmux's behaviour for when multiple clients are attached to one session differs slightly. In Screen, each client can be connected to the session but view different windows within it, but in tmux, all clients connected to one session must view the same window.<br />
: This problem can be solved in tmux by spawning two separate sessions and synchronizing the second one to the windows of the first, then pointing a second new session to the first.<br />
<br />
The script “{{Ic|tmx}}” below implements this — the version here is slightly modified to execute “{{Ic|tmux new-window}}” if “1” is its second parameter. Invoked as {{Ic|tmx <base session name> [1]}} it launches the base session if necessary. Otherwise a new “client” session linked to the base, optionally add a new window and attach, setting it to kill itself once it turns “zombie”.<br />
<br />
{{hc|tmx|2=<nowiki><br />
#!/bin/bash<br />
<br />
#<br />
# Modified TMUX start script from:<br />
# http://forums.gentoo.org/viewtopic-t-836006-start-0.html<br />
#<br />
# Store it to `~/bin/tmx` and issue `chmod +x`.<br />
#<br />
<br />
# Works because bash automatically trims by assigning to variables and by <br />
# passing arguments<br />
trim() { echo $1; }<br />
<br />
if [[ -z "$1" ]]; then<br />
echo "Specify session name as the first argument"<br />
exit<br />
fi<br />
<br />
# Only because I often issue `ls` to this script by accident<br />
if [[ "$1" == "ls" ]]; then<br />
tmux ls<br />
exit<br />
fi<br />
<br />
base_session="$1"<br />
# This actually works without the trim() on all systems except OSX<br />
tmux_nb=$(trim `tmux ls | grep "^$base_session" | wc -l`)<br />
if [[ "$tmux_nb" == "0" ]]; then<br />
echo "Launching tmux base session $base_session ..."<br />
tmux new-session -s $base_session<br />
else<br />
# Make sure we are not already in a tmux session<br />
if [[ -z "$TMUX" ]]; then<br />
echo "Launching copy of base session $base_session ..."<br />
# Session id is date and time to prevent conflict<br />
session_id=`date +%Y%m%d%H%M%S`<br />
# Create a new session (without attaching it) and link to base session <br />
# to share windows<br />
tmux new-session -d -t $base_session -s $session_id<br />
if [[ "$2" == "1" ]]; then<br />
# Create a new window in that session<br />
tmux new-window<br />
fi<br />
# Attach to the new session & kill it once orphaned<br />
tmux attach-session -t $session_id \; set-option destroy-unattached<br />
fi<br />
fi<br />
</nowiki>}}<br />
<br />
A useful setting for this is<br />
<br />
setw -g aggressive-resize on<br />
<br />
added to {{ic|~/.tmux.conf}}. It causes tmux to resize a window based on the smallest client actually viewing it, not on the smallest one attached to the entire session.<br />
<br />
An alternative taken from [http://comments.gmane.org/gmane.comp.terminal-emulators.tmux.user/2632] is to put the following ~/.bashrc:<br />
<br />
{{hc|.bashrc|2=<nowiki><br />
function rsc() {<br />
CLIENTID=$1.`date +%S`<br />
tmux new-session -d -t $1 -s $CLIENTID \; set-option destroy-unattached \; attach-session -t $CLIENTID<br />
}<br />
<br />
function mksc() {<br />
tmux new-session -d -s $1<br />
rsc $1<br />
}<br />
</nowiki>}}<br />
<br />
Citing the author:<br />
<br />
: "mksc foo" creates a always detached permanent client named "foo". It also calls "rsc foo" to create a client to newly created session. "rsc foo" creates a new client grouped by "foo" name. It has destroy-unattached turned on so when I leave it, it kills client.<br />
: Therefore, when my computer looses network connectivity, all "foo.something" clients are killed while "foo" remains. I can then call "rsc foo" to continue work from where I stopped.<br />
<br />
=== Correct the TERM variable according to terminal type ===<br />
Instead of [[#Setting_the_correct_term|setting a fixed TERM variable in tmux]], it is possible to set the proper TERM (either {{ic|screen}} or {{ic|screen-256color}}) according to the type of your terminal emulator:<br />
<br />
{{hc|~/.tmux.conf|<br />
## set the default TERM<br />
set -g default-terminal screen<br />
<br />
## update the TERM variable of terminal emulator when creating a new session or attaching a existing session<br />
set -g update-environment 'DISPLAY SSH_ASKPASS SSH_AGENT_PID SSH_CONNECTION WINDOWID XAUTHORITY TERM'<br />
## determine if we should enable 256-colour support<br />
if "[[ ${TERM} =~ 256color || ${TERM} == fbterm ]]" 'set -g default-terminal screen-256color'<br />
}}<br />
<br />
{{hc|1=~/.zshrc|2=<br />
## workaround for handling TERM variable in multiple tmux sessions properly from http://sourceforge.net/p/tmux/mailman/message/32751663/ by Nicholas Marriott<br />
if [[ -n ${TMUX} && -n ${commands[tmux]} ]];then<br />
case $(tmux showenv TERM 2>/dev/null) in<br />
*256color) ;&<br />
TERM=fbterm)<br />
TERM=screen-256color ;;<br />
*)<br />
TERM=screen<br />
esac<br />
fi<br />
}}<br />
<br />
=== Reload an updated configuration without restarting tmux ===<br />
<br />
By default tmux reads {{ic|~/.tmux.conf}} only if it was not already running. To have tmux load a configuration file afterwards, execute:<br />
<br />
tmux source-file <path><br />
<br />
This can be added to {{ic|~/.tmux.conf}} as e. g.:<br />
<br />
bind r source-file <path><br />
<br />
You can also do ^: and type :<br />
source .tmux.conf<br />
<br />
===Template script to run program in new session resp. attach to existing one===<br />
<br />
This script checks for a program presumed to have been started by a previous run of itself. Unless found it creates a new tmux session and attaches to a window named after and running the program. If however the program was found it merely attaches to the session and selects the window.<br />
<br />
#!/bin/bash<br />
<br />
PID=$(pidof $1)<br />
<br />
if [ -z "$PID" ]; then<br />
tmux new-session -d -s main ;<br />
tmux new-window -t main -n $1 "$*" ;<br />
fi<br />
tmux attach-session -d -t main ;<br />
tmux select-window -t $1 ;<br />
exit 0<br />
<br />
A derived version to run ''irssi'' with the ''nicklist'' plugin can be found on [[Irssi#irssi_with_nicklist_in_tmux|its ArchWiki page]].<br />
<br />
=== Terminal emulator window titles ===<br />
If you SSH into a host in a tmux window, you'll notice the window title of your terminal emulator remains to be {{ic|user@localhost}} rather than {{ic|user@server}}. To allow the title bar to adapt to whatever host you connect to, set the following in {{ic|~/.tmux.conf}}<br />
<br />
set -g set-titles on<br />
set -g set-titles-string "#T"<br />
<br />
For {{ic|set-titles-string}}, {{ic|#T}} will display {{ic|user@host:~}} and change accordingly as you connect to different hosts.<br />
<br />
=== Automatic layouting ===<br />
When creating new splits or destroying older ones the currently selected layout isn't applied. To fix that, add following binds which will apply the currently selected layout to new or remaining panes:<br />
<br />
bind-key -n M-c kill-pane \; select-layout<br />
bind-key -n M-n split-window \; select-layout<br />
<br />
=== Vim colorscheme not loading ===<br />
<br />
See the following if your vim colorscheme isn't loading in tmux: [https://stackoverflow.com/a/47994805/1766555] [https://github.com/vim/vim/issues/993#issuecomment-255651605]<br />
<br />
=== Vim friendly configuration ===<br />
<br />
See [https://gist.github.com/Lartza/6a7a62466a8a3e436234412d9b1c5066] for a configuration friendly to [[vim]] users.<br />
<br />
=== Friendly pane splitting ===<br />
<br />
The default key-binding for splitting a pane vertically is {{ic|Ctrl}} + {{ic|b}} {{ic|%}} and for splitting a pane horizontally is {{ic|Ctrl}} + {{ic|b}} {{ic|"}}. That can be difficult to type depending of your keyboard layout and it is also hard to remember.<br />
<br />
A more friendly key-binding is to use {{ic|Ctrl}} + {{ic|b}} {{ic|h}} for splitting horizontally and {{ic|Ctrl}} + {{ic|b}} {{ic|v}} for splitting a pane vertically, it is also very convenient to remember.<br />
<br />
To make this change, add these lines in {{ic|~/.tmux.conf}}:<br />
<br />
{{bc|<br />
# More friendly split pane<br />
bind-key h split-window -h<br />
bind-key v split-window -v<br />
}}<br />
<br />
== Troubleshooting ==<br />
<br />
=== Scrolling issues ===<br />
<br />
If you have issues scrolling with Shift-Page Up/Down in your terminal, the following will remove the smcup and rmcup capabilities for any term that reports itself as anything beginning with {{ic|xterm}}:<br />
<br />
set -ga terminal-overrides ',xterm*:smcup@:rmcup@'<br />
<br />
This tricks the terminal emulator into thinking tmux is a full screen application like pico or mutt[http://superuser.com/questions/310251/use-terminal-scrollbar-with-tmux], which will make the scrollback be recorded properly. Beware however, it will get a bit messed up when switching between windows/panes. Consider using tmux's native scrollback instead.<br />
<br />
=== Mouse scrolling ===<br />
<br />
{{Note|This interferes with selection buffer copying and pasting. To copy/paste to/from the selection buffer hold the shift key.}}<br />
<br />
If you want to scroll with your mouse wheel, ensure mode-mouse is on in .tmux.conf<br />
set -g mouse on<br />
<br />
You can set scroll History with:<br />
set -g history-limit 30000<br />
<br />
For mouse wheel scrolling as from tmux 2.1 try adding one or both of these to ~/.tmux.conf<br />
bind -T root WheelUpPane if-shell -F -t = "#{alternate_on}" "send-keys -M" "select-pane -t =; copy-mode -e; send-keys -M"<br />
bind -T root WheelDownPane if-shell -F -t = "#{alternate_on}" "send-keys -M" "select-pane -t =; send-keys -M"<br />
<br />
Though the above will only scroll one line at a time, add this solution to scroll an entire page instead<br />
bind -t vi-copy WheelUpPane page-up<br />
bind -t vi-copy WheelDownPane page-down<br />
bind -t emacs-copy WheelUpPane page-up<br />
bind -t emacs-copy WheelDownPane page-down<br />
<br />
=== Terminal emulator does not support UTF-8 mouse events ===<br />
<br />
When the terminal emulator does not support the UTF-8 mouse events and the {{ic|mouse on}} tmux option is set, left-clicking inside the terminal window might paste strings like {{ic|[M#}} or {{ic|[Ma}} into the promt.<br />
<br />
To solve this issue set:<br />
<br />
set -g mouse-utf8 off<br />
<br />
=== Shift+F6 not working in Midnight Commander ===<br />
<br />
See [[Midnight Commander#Broken shortcuts]].<br />
<br />
== See also ==<br />
<br />
* [https://bbs.archlinux.org/viewtopic.php?id=84157&p=1 BBS topic]<br />
* [http://www.dayid.org/os/notes/tm.html Screen and tmux feature comparison]<br />
* [https://github.com/Lokaltog/powerline powerline], a dynamic statusbar for tmux<br />
* [https://github.com/tmux-plugins Plugins for tmux]<br />
<br />
'''Tutorials'''<br />
<br />
* [http://mutelight.org/articles/practical-tmux Practical Tmux]<br />
* [http://www.openbsd.org/cgi-bin/man.cgi?query=tmux man page (OpenBSD)]<br />
* [http://blog.hawkhost.com/2010/06/28/tmux-the-terminal-multiplexer/ Tmux tutorial Part 1] and [http://blog.hawkhost.com/2010/07/02/tmux-%E2%80%93-the-terminal-multiplexer-part-2 Part 2]<br />
* [https://leanpub.com/the-tao-of-tmux/read ''The Tao of tmux''], an ebook by Tony Narlock, author of [https://tmuxp.git-pull.com tmuxp] and [https://libtmux.git-pull.com libtmux]</div>Delapouitehttps://wiki.archlinux.org/index.php?title=Gajim&diff=567154Gajim2019-02-23T11:54:13Z<p>Delapouite: add link to XMPP</p>
<hr />
<div>[[Category:XMPP]]<br />
[[ja:Gajim]]<br />
[https://gajim.org/index.php?lang=en Gajim] is a full featured and easy to use [[Wikipedia:XMPP|XMPP]] client.<br />
<br />
== Installation ==<br />
<br />
[[Install]] the {{Pkg|gajim}} package.<br />
<br />
== D-Bus remote control ==<br />
<br />
To enable D-Bus remote control support, go to ''Preferences > Advanced > Advanced Configuration Editor'', open the 'Advanced Configuration Editor', enable ''remote_control'', and then restart Gajim.<br />
<br />
== Show/hide roster ==<br />
<br />
If you would like to be able to show/hide the roster using a script or your wm, you can use the following command from the terminal.<br />
$ gajim-remote toggle_roster_appearance<br />
<br />
It may be necessary to restart Gajim if this doesn't work.<br />
== OMEMO Support ==<br />
<br />
[https://conversations.im/omemo/ OMEMO Multi-End Message and Object Encryption] is an XMPP Extension Protocol (XEP) for secure multi-client end-to-end encryption. It is an open standard based on Axolotl and PEP which can be freely used and implemented by anyone.<br />
<br />
In order to use OMEMO in Gajim, follow these steps:<br />
<br />
# [[Install]] the {{Pkg|python-axolotl}} and {{Pkg|python-qrcode}} packages.<br />
# Open Gajim and go to menu ''Gajim'' => ''Plugins'';<br />
# Go to the ''Available'' tab;<br />
# Mark the "OMEMO" plugin and click the ''Install/Update Plugin'' button;<br />
# Go back to the ''Installed'' tab;<br />
# Activate the "OMEMO" plugin;<br />
# Close dialogs to save the changes;<br />
# Restart Gajim;<br />
# Please refer to the official documentation for [https://dev.gajim.org/gajim/gajim-plugins/wikis/OmemoGajimPlugin#running running instructions]<br />
<br />
== Advanced configuration ==<br />
<br />
Settings in ''Preferences > Advanced > Advanced Configuration Editor'' can be adjusted in order to increase Gajim's usability.<br />
<br />
=== Minimize / Close to tray ===<br />
<br />
By default Gajim remains in the taskbar (for Docks) instead of minimizing to tray when closing it, to disable this behavior '''enable''' the '''hide_on_roster_x_button''' preference.<br />
<br />
=== Hide chat banner ===<br />
<br />
To hide the avatar banner that normally resides close to top of the two-person chat window '''enable''' the '''hide_chat_banner''' preference.</div>Delapouitehttps://wiki.archlinux.org/index.php?title=Lemonbar&diff=567153Lemonbar2019-02-23T11:51:04Z<p>Delapouite: add link to XCB</p>
<hr />
<div>[[Category:Eye candy]]<br />
[[ja:Lemonbar]]<br />
[https://github.com/LemonBoy/bar lemonbar] is a lightweight bar based on [https://xcb.freedesktop.org/ XCB]. It provides foreground/background color switching along with text alignment and colored under/overlining of text, full UTF-8 support and reduced memory footprint. Nothing less and nothing more.<br />
<br />
== Installation ==<br />
<br />
[[Install]] the {{AUR|lemonbar-git}} package.<br />
<br />
== Configuration ==<br />
<br />
Configuration of lemonbar is now completely done via {{ic|screenrc}}-like format strings and command line options as opposed to older versions, where configuration took place at compile-time.<br />
<br />
See the man page for a short overview of those configuration options.<br />
<br />
== Usage ==<br />
<br />
{{ic|lemonbar}} prints no information on its own. To get any text into {{ic|lemonbar}} you need to pipe text into it. The following example would write the text "Hello World" into your bar.<br />
<br />
{{bc|<br />
#!/bin/bash<br />
<br />
# Echo the text<br />
echo "Hello World"<br />
}}<br />
<br />
If you want the text in {{ic|lemonbar}} to update through a script, you need to add the {{ic|-p}} option. This prevents {{ic|lemonbar}} from exiting after stdin is closed.<br />
<br />
==== Colors ====<br />
<br />
{{ic|lemonbar}} uses the following commands to color the text, background or the under/overline. Colors can be specified via the formats {{ic|#RRGGBB}}, {{ic|#AARRGGBB}} (with an alpha channel; this requires a compositor to be running), or even {{ic|#RGB}}.<br />
<br />
The special color {{ic|-}} indicates the default color (which is set by command-line flags, or is otherwise the default white text on a black background).<br />
<br />
{| border="1"<br />
! Command !! Meaning<br />
|-<br />
| {{ic|%{F''color''} }} || Use ''color'' as the foreground/font color<br />
|-<br />
| {{ic|%{B''color''} }} || Use ''color'' as the background<br />
|-<br />
| {{ic|%{U''color''} }} || Use ''color'' for under/overlining the text<br />
|}<br />
<br />
==== Text alignment ====<br />
<br />
{{ic|lemonbar}} also supports alignment of text. It uses the following commands to align the text<br />
<br />
{| border="1"<br />
! Command !! Meaning<br />
|-<br />
| {{ic|%{l} }} || Aligns the text to the left<br />
|-<br />
| {{ic|%{c} }} || Aligns the text to the center<br />
|-<br />
| {{ic|%{r} }} || Aligns the text to the right<br />
|}<br />
<br />
==== Examples ====<br />
<br />
The following example prints the date and time in the middle of the bar, the font's color being {{ic|yellow}} and the background {{ic|blue}} and changes the font/background color back to the default color afterwards. Run it with {{ic|/path/to/script/example.sh &#124; lemonbar -p}}<br />
<br />
{{hc|example.sh|<br />
#!/usr/bin/bash<br />
<br />
# Define the clock<br />
Clock() {<br />
DATETIME&#61;$(date "+%a %b %d, %T")<br />
<br />
echo -n "$DATETIME"<br />
}<br />
<br />
# Print the clock<br />
<br />
while true; do<br />
echo "%{c}%{F#FFFF00}%{B#0000FF} $(Clock) %{F-}%{B-}"<br />
sleep 1<br />
done<br />
}}<br />
<br />
Another example showing the battery percentage. To use this script you need to install {{Pkg|acpi}}.<br />
<br />
{{hc|example.sh|<br />
#!/usr/bin/bash<br />
<br />
#Define the battery<br />
Battery() {<br />
BATPERC&#61;$(acpi --battery &#124; cut -d, -f2)<br />
echo "$BATPERC"<br />
}<br />
<br />
# Print the percentage<br />
while true; do<br />
echo "%{r}$(Battery)"<br />
sleep 1;<br />
done<br />
}}<br />
<br />
==== XFT fonts ====<br />
<br />
The default lemonbar version does not support XFT fonts. To get support for XFT fonts, you need to install {{AUR|lemonbar-xft-git}}, which replaces {{AUR|lemonbar-git}}.<br />
<br />
To use different font with lemonbar, you need to pass {{ic|-f}} option when starting lemonbar e.g. {{ic|lemonbar -f "Roboto Medium"}}.<br />
<br />
===== Font Awesome icons =====<br />
<br />
With XFT support, you can also add [http://fontawesome.io/ font-awesome icons] to your bar. You need to install {{Pkg|ttf-font-awesome}} before using the icons and pass {{ic|-f "Font Awesome"}} to lemonbar. Please note, that you also need to specify one more font (e.g. {{ic|-f "Roboto Medium"}}) to be used for other symbols than font awesome icons if you want something else visible in your lemonbar as font awesome does not contain other symbols.<br />
<br />
Before adding an icon to lemonbar, you need to look up its unicode id on the [http://fontawesome.io/icons/ icon list] and pass it to lemonbar string. Here is a script that displays icon with unicode id {{ic|f242}} in lemonbar: <br />
<br />
{{hc|fontawesome.sh|<br />
#!/usr/bin/bash<br />
echo -e "\uf242 Battery: 0"<br />
}}<br />
<br />
Pay extra attention to {{ic|echo -e}} flag, as it is necessary to properly use echo with escape sequences.<br />
<br />
And corresponding lemonbar command: {{ic|lemonbar -f "Roboto Medium" -f "Font Awesome"}}</div>Delapouitehttps://wiki.archlinux.org/index.php?title=Fish&diff=567009Fish2019-02-21T13:39:40Z<p>Delapouite: add link to tmux</p>
<hr />
<div>{{lowercase title}}<br />
[[Category:Command shells]]<br />
[[de:Fish]]<br />
[[ja:Fish]]<br />
[[ru:Fish]]<br />
[[zh-hans:Fish]]<br />
<br />
[https://fishshell.com fish], the '''''f'''riendly '''i'''nteractive '''sh'''ell'', is a [[command-line shell|commandline shell]] intended to be interactive and user-friendly.<br />
<br />
''fish'' is intentionally not fully [[Wikipedia:POSIX|POSIX]] compliant, it aims at addressing POSIX inconsistencies (as perceived by the creators) with a simplified or a different syntax. This means that even simple POSIX compliant scripts may require some significant adaptation or even full rewriting to run with fish.<br />
<br />
== Installation ==<br />
<br />
[[Install]] the {{Pkg|fish}} package. For the development version, install the {{AUR|fish-git}} package.<br />
<br />
Once installed, simply type {{ic|fish}} to drop into the fish shell.<br />
<br />
Documentation can be found by typing {{ic|help}} from fish; it will be opened in a web browser. It is recommended to read at least the "Syntax overview" section, since fish's syntax is different from many other shells.<br />
<br />
== System integration ==<br />
<br />
One must decide whether fish is going to be the default user's shell, which means that the user falls directly in fish at login, or whether it is used in interactive terminal mode as a child process of the current default shell, here we will assume the latter is [[Bash]]. To elaborate on these two setups:<br />
<br />
* fish used as the '''default shell''': this mode requires some basic understanding of the fish functioning and its scripting language. The user's current initialization scripts and environment variables need to be migrated to the new fish environment. To configure the system in this mode, follow [[#Setting fish as default shell]].<br />
<br />
* fish used as an '''interactive shell only''': this is the less disruptive mode, all the Bash initialization scripts are run as usual and fish runs on top of Bash in interactive mode connected to a terminal. To setup fish in this mode, follow [[#Setting fish as interactive shell only]].<br />
<br />
=== Setting fish as default shell ===<br />
If you decide to set fish as the default user shell, the first step is to set the shell of this particular user to {{ic|/usr/bin/fish}}. This can be done by following the instructions in [[Command-line shell#Changing your default shell]].<br />
<br />
The next step is to port the current needed actions and configuration performed in the various Bash initialization scripts, namely {{ic|/etc/profile}}, {{ic|~/.bash_profile}}, {{ic|/etc/bash.bashrc}} and {{ic|~/.bashrc}}, into the fish framework.<br />
<br />
In particular, the content of the {{ic|$PATH}} environment variable, once directly logged under fish, should be checked and adjusted to one's need. In fish, {{ic|$PATH}} is defined as a ''global environment variable'': it has a ''global'' scope across all functions, it is lost upon reboot and it is an ''environment variable'' which means it is exported to child processes.<br />
The recommended way of adding permanently additional locations to the path is by assigning them to the {{ic|fish_user_paths}} universal variable. This variable is automatically added to {{ic|$PATH}} and is preserved across restarts of the shell. For example by setting:<br />
<br />
$ set -U fish_user_paths ''/first/path'' ''/second/path'' ''/third/one''<br />
<br />
These three locations will be permanently prepended to the path. This is an easy way to complement the path without the need to add any instruction in scripts.<br />
<br />
=== Setting fish as interactive shell only ===<br />
Not setting fish as system wide or user default allows the current Bash scripts to run on startup. It ensures the current user's environment variables are unchanged and are exported to fish which then runs as a Bash child. Below are several ways of running fish in interactive mode without setting it as the default shell.<br />
<br />
==== Modify .bashrc to drop into fish ====<br />
Keep the default shell as Bash and simply add the line {{ic|exec fish}} to the appropriate [[Bash#Configuration files]], such as {{ic|.bashrc}}. This will allow Bash to properly source {{ic|/etc/profile}} and all files in {{ic|/etc/profile.d}}. Because fish replaces the Bash process, exiting fish will also exit the terminal. Compared to the following options, this is the most universal solution, since it works both on a local machine and on a SSH server.<br />
<br />
{{Tip|<br />
* In this setup, use {{ic|bash --norc}} to manually enter Bash without executing the commands from {{ic|~/.bashrc}} which would run {{ic|exec fish}} and drop back into fish.<br />
* To have commands such as {{ic|bash -c 'echo test'}} run the command in Bash instead of starting fish, you can write {{ic|if [ -z "$BASH_EXECUTION_STRING" ]; then exec fish; fi}} instead.}}<br />
<br />
==== Use terminal emulator options ====<br />
<br />
Another option is to open your terminal emulator with a command line option that executes fish. For most terminals this is the {{ic|-e}} switch, so for example, to open gnome-terminal using fish, change your shortcut to use:<br />
<br />
gnome-terminal -e fish<br />
<br />
With terminal emulators that do not support setting the shell, for example {{aur|lilyterm-git}}, it would look like this:<br />
<br />
SHELL=/usr/bin/fish lilyterm<br />
<br />
Also, depending on the terminal, you may be able to set fish as the default shell in either the terminal configuration or the terminal profile.<br />
<br />
==== Use terminal multiplexer options ====<br />
<br />
To set fish as the shell started in [[tmux]], put this into your {{ic|~/.tmux.conf}}:<br />
<br />
set-option -g default-shell "/usr/bin/fish"<br />
<br />
Whenever you run ''tmux'', you will be dropped into fish.<br />
<br />
== Configuration ==<br />
<br />
The configuration file runs at every login and is located at {{ic|~/.config/fish/config.fish}}. Adding commands or functions to the file will execute/define them when opening a terminal, similar to {{ic|.bashrc}}. Note that whenever a variable needs to be preserved, it be set as ''universal'' rather than defined in the aforementioned configuration file.<br />
<br />
The user's functions are located in the directory {{ic|~/.config/fish/functions}} under the filenames {{ic|''function_name''.fish}}.<br />
<br />
=== Web interface ===<br />
<br />
The fish terminal colors, prompt, functions, variables, history, bindings and abbreviations can be set with the interactive web interface:<br />
<br />
fish_config<br />
<br />
=== Command completion ===<br />
<br />
fish can generate autocompletions from man pages. Completions are written to {{ic|~/.local/share/fish/generated_completions/}} and can be generated by calling:<br />
<br />
fish_update_completions<br />
<br />
You can also define your own completions in {{ic|~/.config/fish/completions/}}. See {{ic|/usr/share/fish/completions/}} for a few examples.<br />
<br />
Context-aware completions for Arch Linux-specific commands like ''pacman'', ''pacman-key'', ''makepkg'', ''cower'', ''pbget'', ''pacmatic'' are built into fish, since the policy of the fish development is to include all the existent completions in the upstream tarball. The memory management is clever enough to avoid any negative impact on resources.<br />
<br />
==Tips and tricks==<br />
<br />
===Command substitution===<br />
''fish'' does not implement Bash style history substitution (e.g. {{ic|sudo !!}}), and the developers recommend in the [http://fishshell.com/docs/current/faq.html#faq-history fish faq] to use the interactive history recall interface instead: the {{ic|Up}} arrow recalls whole past lines and {{ic|Alt+Up}} recalls individual arguments.<br />
<br />
However some workarounds are described in the [https://github.com/fish-shell/fish-shell/wiki/Bash-Style-Command-Substitution-and-Chaining-(!!-!$-&&-%7C%7C) fish wiki]: while not providing complete history substitution, some functions replace {{ic|!!}} with the previous command or {{ic|!$}} with the previous last argument.<br />
<br />
===Command chaining===<br />
Command chaining {{ic|&&}} and {{ic|{{!}}{{!}}}} is not implemented in versions older than 3.0 and the recommended syntax to achieve similar results in ''fish'' is respectively {{ic|; and}} and {{ic|; or}}.<br />
Some keybindings can be set for automatic substitution as described in the [https://github.com/fish-shell/fish-shell/wiki/Bash-Style-Command-Substitution-and-Chaining-(!!-!$-&&-%7C%7C)#getting--and- fish wiki].<br />
<br />
===Disable greeting===<br />
<br />
By default, fish prints a greeting message at startup. To disable it, run once:<br />
<br />
$ set -U fish_greeting<br />
<br />
This clears the universal {{ic|fish_greeting}} variable, shared with all fish instances and which is preserved upon restart of the shell.<br />
<br />
=== Make su launch fish ===<br />
<br />
If ''su'' starts with Bash because Bash is the target user's (''root'' if no username is provided) default shell, one can define a function to redirect it to fish whatever the user's shell:<br />
{{hc|~/.config/fish/functions/su.fish|2=<br />
function su<br />
command su --shell=/usr/bin/fish $argv<br />
end}}<br />
<br />
=== Start X at login ===<br />
<br />
Add the following to the bottom of your {{ic|~/.config/fish/config.fish}}.<br />
<br />
{{bc|1=<nowiki><br />
# Start X at login<br />
if status is-login<br />
if test -z "$DISPLAY" -a $XDG_VTNR = 1<br />
exec startx -- -keeptty<br />
end<br />
end<br />
</nowiki>}}<br />
<br />
=== Use liquidprompt ===<br />
<br />
[https://github.com/nojhan/liquidprompt Liquidprompt] is a popular "full-featured & carefully designed adaptive prompt for Bash & Zsh" and has no plans to make it compatible with fish [https://github.com/nojhan/liquidprompt/pull/230]. [https://github.com/wesbarnett/fish-lp This project] implements it for fish.<br />
<br />
=== Put git status in prompt ===<br />
<br />
If you would like fish to display the branch and dirty status when you are in a git directory, you can define the following {{ic|fish_prompt}} function:<br />
{{hc|~/.config/fish/functions/fish_prompt.fish|<br />
<nowiki>function fish_prompt<br />
set -l last_status $status<br />
<br />
if not set -q __fish_git_prompt_show_informative_status<br />
set -g __fish_git_prompt_show_informative_status 1<br />
end<br />
if not set -q __fish_git_prompt_color_branch<br />
set -g __fish_git_prompt_color_branch brmagenta<br />
end<br />
if not set -q __fish_git_prompt_showupstream<br />
set -g __fish_git_prompt_showupstream "informative"<br />
end<br />
if not set -q __fish_git_prompt_showdirtystate<br />
set -g __fish_git_prompt_showdirtystate "yes"<br />
end<br />
if not set -q __fish_git_prompt_color_stagedstate<br />
set -g __fish_git_prompt_color_stagedstate yellow<br />
end<br />
if not set -q __fish_git_prompt_color_invalidstate<br />
set -g __fish_git_prompt_color_invalidstate red<br />
end<br />
if not set -q __fish_git_prompt_color_cleanstate<br />
set -g __fish_git_prompt_color_cleanstate brgreen<br />
end<br />
<br />
printf '%s%s %s%s%s%s ' (set_color $fish_color_host) (prompt_hostname) (set_color $fish_color_cwd) (prompt_pwd) (set_color normal) (__fish_git_prompt)<br />
<br />
if not test $last_status -eq 0<br />
set_color $fish_color_error<br />
end<br />
echo -n '$ '<br />
set_color normal<br />
end<br />
</nowiki>}}<br />
More explanations about the parameters can be found in the [https://github.com/fish-shell/fish-shell/blob/master/share/functions/__fish_git_prompt.fish fish-shell git].<br />
Alternatively, the [http://mariuszs.github.io/blog/2013/informative_git_prompt.html Informative Git Prompt] has now been built into fish and can be activated from fish_config if so desired.<br />
<br />
===Color the hostname in the prompt in SSH===<br />
To color the hostname in the prompt dynamically whenever connected through SSH, add the following lines in either the {{ic|fish_prompt}} function or the fish configuration file, here using the red color:<br />
<br />
{{hc|~/.config/fish/functions/fish_prompt.fish|<br />
...<br />
if set -q SSH_TTY<br />
set -g fish_color_host brred<br />
end<br />
...}}<br />
<br />
=== Evaluate ssh-agent ===<br />
<br />
In fish, {{ic|eval (ssh-agent)}} generate errors due to how variables are set. To work around this, use the csh-style option {{ic|-c}}:<br />
<br />
$ eval (ssh-agent -c)<br />
<br />
=== The "command not found" hook ===<br />
<br />
[[pkgfile]] includes a "command not found" hook that will automatically search the official repositories, when entering an unrecognized command. This hook will be run by default if {{Pkg|pkgfile}} is installed.<br />
<br />
=== Remove a process from the list of jobs ===<br />
<br />
''fish'' terminates any jobs put into the background when fish terminates. To keep a job running after fish terminates, first use the {{ic|disown}} builtin. For example, the following starts {{ic|firefox}} in the background and then disowns it:<br />
<br />
$ firefox &<br />
$ disown<br />
<br />
This means firefox will not be closed when the fish process is closed. See {{man|1|disown|url=}} in ''fish'' for more details.<br />
<br />
=== Set a persistent alias ===<br />
<br />
To quickly make a persistent alias, one can simply use the method showed in this example:<br />
$ alias lsl "ls -l"<br />
$ funcsave lsl<br />
<br />
This will create the function:<br />
function lsl<br />
ls -l $argv<br />
end<br />
<br />
and will set the alias as a persistent shell function. To see all functions and/or edit them, one can simply use {{ic|fish_config}} and look into the ''Function'' tab in the web configuration page.<br />
<br />
For more detailed information, refer to [https://fishshell.com/docs/current/commands.html#alias fish - alias].<br />
<br />
== See also ==<br />
<br />
* http://fishshell.com/ - Home page<br />
* http://fishshell.com/docs/current/index.html - Documentation<br />
* http://hyperpolyglot.org/unix-shells - Shell grammar correspondence table<br />
* https://github.com/fish-shell/fish-shell - fish on GitHub</div>Delapouitehttps://wiki.archlinux.org/index.php?title=Logwatch&diff=567008Logwatch2019-02-21T13:30:47Z<p>Delapouite: add link to cron and perl</p>
<hr />
<div>[[Category:Logging]]<br />
[[ja:Logwatch]]<br />
{{Style|Use [[Template:ic]].}}<br />
[http://www.logwatch.org/ Logwatch] is a powerful and versatile log parser and analyzer. Logwatch is designed to give a unified report of all activity on a server, which can be delivered through the command line or email.<br />
<br />
== Installation ==<br />
<br />
[[Install]] {{pkg|logwatch}}.<br />
<br />
In addition to the logwatch binaries, scripts and config files, the pacman package also includes a [[cron]] job that<br />
is installed as {{ic|/etc/cron.daily/0logwatch}}. Also note that logwatch scripts use [[perl]], which is a dependency of the logwatch package.<br />
<br />
==Configuration==<br />
Logwatch has a tiered configuration approach. There are several locations where configuration details can be specified, with each one superseding the previous one:<br />
* /usr/share/logwatch/default.conf/*<br />
* /etc/logwatch/conf/dist.conf/*<br />
* /etc/logwatch/conf/*<br />
* The script / command line arguments<br />
Logwatch will parse all these location when called.<br />
<br />
Within these directories, there are several areas of configuration. The logwatch.conf files are where most of the high-level settings are, which allow you to set where your reports are sent, how they are formatted, etc. The conf file at /usr/share/logwatch/default.conf/logwatch.conf contains all the default settings and comments on what they do. It is recommended to leave the default conf alone and instead re-define a setting variable you want to change in /etc/logwatch/conf/logwatch.conf. <br />
<br />
Within the logfiles/ directory of any of the conf locations are config files detailing specific log files. By default, most of the common log files found in a Linux system are already accounted for. If you have some esoteric application that does not have a log file conf already, copy an existing one from the default.conf/logfiles/ directory and customize it for your application.<br />
<br />
The services/ folder contains similar conf definitions, but these one define the various services reported by logwatch. This is necessary because often multiple services will report to the same log (e.g. messages, dmesg, boot, etc.). For more information, examine some of the default services/ conf files.<br />
<br />
Note that if you want logwatch messages delivered by email, you need to install a package that provides a sendmail frontend. [[Postfix]] is a good choice.<br />
<br />
There is a helpful document supplied with the package to give further information on configuration. It is located at /usr/share/logwatch/HOWTO-Customize-LogWatch.<br />
<br />
==Cron Job==<br />
The default install also includes a cron job, placed in cron.daily. This job will use the configuration settings from all the config locations, as detailed above. The script can be moved to a different cron folder for different report frequencies or set up as a custom cron job in a crontab file.<br />
<br />
==systemd journal support==<br />
{{Note|Logwatch 7.5.0 now supports querying the systemd journal via journalctl.}}<br />
<br />
Older versions of Logwatch do not support querying the systemd journal directly. For this reason, a logger like syslog-ng is required to duplicate the journal output into external log files (such as in {{ic|/var/log}}). A [http://sourceforge.net/p/logwatch/patches/34/ patch] is under development to support the systemd journal. Alternately, a custom script could duplicate some of the logwatch functionality by directly querying the journal and sending email(s), as done in a Python script in [https://tim.siosm.fr/blog/2014/02/24/journald-log-scanner-python/ this blog post].</div>Delapouitehttps://wiki.archlinux.org/index.php?title=Readline&diff=567006Readline2019-02-21T12:35:40Z<p>Delapouite: add link to emacs</p>
<hr />
<div>[[Category:Command-line]]<br />
[[Category:GNU]]<br />
[[es:Readline]]<br />
[[it:Readline]]<br />
[[ja:Readline]]<br />
[[ru:Readline]]<br />
[[zh-hans:Readline]]<br />
{{Expansion|Recommend bracketed paste mode.}}<br />
[https://www.gnu.org/software/readline/ Readline] is a library by the [[GNU Project]], used by [[Bash]] and other CLI-interface programs to edit and interact with the command line. See {{man|3|readline}} for more information.<br />
<br />
== Installation ==<br />
<br />
The {{Pkg|readline}} package is most likely already installed as a dependency of [[Bash]].<br />
<br />
== Editing mode ==<br />
<br />
By default Readline uses [[Emacs]] style shortcuts for interacting with command line. However, [[vi]] style editing interface is also supported by adding the following to {{ic|~/.inputrc}}:<br />
<br />
{{hc|~/.inputrc|<br />
set editing-mode vi}}<br />
<br />
Alternatively, to set it only for [[Bash]] by adding the following line to {{ic|~/.bashrc}}:<br />
<br />
{{hc|~/.bashrc|<br />
set -o vi}}<br />
<br />
=== Mode indicator in prompt ===<br />
<br />
Vi-style editing has two modes: command and insert. You can display which one is currently active by adding the following option:<br />
<br />
{{hc|~/.inputrc|<br />
set show-mode-in-prompt on<br />
}}<br />
<br />
This will print a string in your prompt ({{ic|(cmd)}}/{{ic|(ins)}} by default) that can be customized with the {{ic|vi-ins-mode-string}} and {{ic|vi-cmd-mode-string}} variables.<br />
<br />
=== Different cursor shapes for each mode ===<br />
<br />
You can set a different cursor shape for each mode by using [https://www.gnu.org/software/bash/manual/html_node/Readline-Init-File-Syntax.html#index-vi_002dcmd_002dmode_002dstring "\1 .. \2" escapes]:<br />
<br />
{{hc|~/.inputrc|<br />
set vi-ins-mode-string \1\e[6 q\2<br />
set vi-cmd-mode-string \1\e[2 q\2<br />
}}<br />
<br />
This will set a block shaped cursor when in command mode and a pipe cursor when in insert mode. Note that you must have the mode indicator enabled for this to work (see [[#Mode indicator in prompt]].<br />
<br />
The Virtual Console uses different escape codes, so you should check first which term is being used:<br />
<br />
{{hc|~/.inputrc|2=<br />
$if term=linux<br />
set vi-ins-mode-string \1\e[?0c\2<br />
set vi-cmd-mode-string \1\e[?8c\2<br />
$else<br />
set vi-ins-mode-string \1\e[6 q\2<br />
set vi-cmd-mode-string \1\e[2 q\2<br />
$endif<br />
}}<br />
<br />
See [https://www.kernel.org/doc/Documentation/admin-guide/vga-softcursor.rst software cursor for VGA] for further details.<br />
<br />
== Fast word movement ==<br />
<br />
[[Xterm]] supports moving between words with {{ic|Ctrl+Left}} and {{ic|Ctrl+Right}} [http://stackoverflow.com/a/7783928 by default]. To achieve this effect with other terminal emulators, find the correct [http://wiki.bash-hackers.org/scripting/terminalcodes terminal codes], and bind them to {{ic|backward-word}} and {{ic|forward-word}} in {{ic|~/.inputrc}}.<br />
<br />
For example, for [[urxvt]]:<br />
<br />
{{hc|~/.inputrc|<br />
"\e[1;5D": backward-word<br />
"\e[1;5C": forward-word}}<br />
<br />
== History ==<br />
<br />
Usually, pressing the up arrow key will cause the last command to be shown regardless of the command that has been typed so far. However, users may find it more practical to list only past commands that match the current input.<br />
<br />
For example, if the user has typed the following commands:<br />
<br />
* {{Ic|ls /usr/src/linux-2.6.15-ARCH/kernel/power/Kconfig}}<br />
* {{Ic|who}}<br />
* {{Ic|mount}}<br />
* {{Ic|man mount}}<br />
<br />
In this situation, when typing {{Ic|ls}} and pressing the up arrow key, current input will be replaced with {{Ic|man mount}}, the last performed command. If the history search has been enabled, only past commands beginning with {{Ic|ls}} (the current input) will be shown, in this case {{Ic|ls /usr/src/linux-2.6.15-ARCH/kernel/power/Kconfig}}.<br />
<br />
You can enable the history search mode by adding the following lines to {{Ic|/etc/inputrc}} or {{Ic|~/.inputrc}}:<br />
<br />
"\e[A": history-search-backward<br />
"\e[B": history-search-forward<br />
<br />
If you are using vi mode, you can add the following lines to {{Ic|~/.inputrc}} (from [https://bbs.archlinux.org/viewtopic.php?pid=428760#p428760 this post]):<br />
<br />
set editing-mode vi<br />
$if mode=vi<br />
set keymap vi-command<br />
# these are for vi-command mode<br />
"\e[A": history-search-backward<br />
"\e[B": history-search-forward<br />
j: history-search-forward<br />
k: history-search-backward<br />
set keymap vi-insert<br />
# these are for vi-insert mode<br />
"\e[A": history-search-backward<br />
"\e[B": history-search-forward<br />
$endif<br />
<br />
If you chose to add these lines to {{Ic|~/.inputrc}}, it is recommended that you also add the following line at the beginning of this file to avoid strange things like [https://bbs.archlinux.org/viewtopic.php?id=112537 this]:<br />
<br />
$include /etc/inputrc<br />
<br />
Alternatively, one can use reverse-search-history (incremental search) by pressing {{ic|Ctrl+R}}, which does not search based on previous input but instead jumps backwards in the history buffer as commands are typed in a search term. Pressing {{ic|Ctrl+R}} again during this mode will display the previous line in the buffer that matches the current search term, while pressing {{ic|Ctrl+G}} (abort) will cancel the search and restore the current input line. So in order to search through all previous {{Ic|mount}} commands, press {{ic|Ctrl+R}}, type 'mount' and keep pressing {{ic|Ctrl+R}} until the desired line is found.<br />
<br />
The forward equivalent to this mode is called forward-search-history and is bound to {{ic|Ctrl+S}} by default. Beware that most terminals override {{ic|Ctrl+S}} to suspend execution until {{ic|Ctrl+Q}} is entered. (This is called XON/XOFF flow control). For activating forward-search-history, either disable flow control by issuing:<br />
<br />
$ stty -ixon<br />
<br />
or use a different key in {{Ic|inputrc}}. For example, to use {{ic|Alt+S}} which is not bound by default:<br />
<br />
"\es": forward-search-history<br />
<br />
== Faster completion ==<br />
<br />
When performing tab completion, a single tab attempts to partially complete the current word. If no partial completions are possible, a double tab shows all possible completions.<br />
<br />
The double tab can be changed to a single tab by setting:<br />
<br />
{{hc|~/.inputrc|<br />
set show-all-if-unmodified on<br />
}}<br />
<br />
Or you can set it such that a single tab will perform both steps: partially complete the word ''and'' show all possible completions if it is still ambiguous:<br />
<br />
{{hc|~/.inputrc|<br />
set show-all-if-ambiguous on<br />
}}<br />
<br />
== Colorized completion ==<br />
<br />
You can enable coloring of completion of filenames with the {{ic|colored-stats}} option. You can also color the identical prefix of completion-lists with {{ic|colored-completion-prefix}}. For example:<br />
<br />
{{hc|~/.inputrc|<br />
# Color files by types<br />
set colored-stats On<br />
# Append char to indicate type<br />
set visible-stats On<br />
# Mark symlinked directories<br />
set mark-symlinked-directories On<br />
# Color the common prefix<br />
set colored-completion-prefix On<br />
# Color the common prefix in menu-complete<br />
set menu-complete-display-prefix On<br />
}}<br />
<br />
== Macros ==<br />
<br />
Readline also supports binding keys to keyboard macros. For simple example, run this command in Bash:<br />
bind '"\ew": "\C-e # macro"'<br />
<br />
or add the part within single quotes to inputrc:<br />
"\ew": "\C-e # macro"<br />
<br />
Now type a line and press {{ic|Alt}}+{{ic|W}}. Readline will act as though {{ic|Ctrl+E}} (end-of-line) had been pressed, appended with '{{Ic| # macro}}'.<br />
<br />
Use any of the existing keybindings within a readline macro, which can be quite useful to automate frequently used idioms. For example, this one makes {{ic|Ctrl+Alt+L}} append "| less" to the line and run it ({{ic|Ctrl+M}} is equivalent to {{ic|Enter}}):<br />
"\e\C-l": "\C-e | less\C-m"<br />
<br />
The next one prefixes the line with 'yes |' when pressing {{ic|Ctrl+Alt+Y}}, confirming any yes/no question the command might ask:<br />
"\e\C-y": "\C-ayes | \C-m"<br />
<br />
This example wraps the line in {{Ic|su -c &#39;&#39;}}, if {{ic|Alt+S}} is pressed:<br />
"\es": "\C-a su -c '\C-e'\C-m"<br />
<br />
This example prefixes the line with {{Ic|sudo }}, if {{ic|Alt+S}} is pressed. It's safer because it won't input the {{ic|Enter}} key.<br />
"\es": "\C-asudo \C-e"<br />
<br />
As a last example, quickly send a command in the background with {{ic|Ctrl+Alt+B}}, discarding all of its output:<br />
"\e\C-b": "\C-e > /dev/null 2>&1 &\C-m"<br />
<br />
== Disabling control echo ==<br />
<br />
Readline causes the terminal to echo {{Ic|^C}} after {{ic|Ctrl+C}} is pressed. For users who wish to disable this, simply add the following to {{Ic|~/.inputrc}}:<br />
<br />
set echo-control-characters off<br />
<br />
== See also ==<br />
<br />
* [http://www.catonmat.net/download/bash-vi-editing-mode-cheat-sheet.pdf vi readline editing cheat sheat]<br />
* [http://www.catonmat.net/download/readline-emacs-editing-mode-cheat-sheet.pdf emacs readline editing cheat sheet]</div>Delapouitehttps://wiki.archlinux.org/index.php?title=Back_In_Time&diff=566830Back In Time2019-02-17T20:15:31Z<p>Delapouite: add link to rsync</p>
<hr />
<div>[[Category:Backup]]<br />
[[ja:Back In Time]]<br />
From the [https://backintime.readthedocs.io/en/latest/ documentation]:<br />
<br />
:Back In Time is a simple backup solution for Linux desktops. It is based on [[rsync]] and uses hard-links to reduce space used for unchanged files. It comes with a Qt4 GUI which will run on both Gnome and KDE based Desktops. Back In Time is written in Python3 and is licensed under GPL2.<br />
<br />
== Installation ==<br />
<br />
[[Install]] {{AUR|backintime}}, {{AUR|backintime-cli}} for a CLI-only version, or {{AUR|backintime-git}} for the development version.<br />
<br />
Alternatively, pre-compiled binary packages can be installed from [https://coderkun.de/arch/ coderkun's repo].<br />
<br />
Back In Time will automatically install a startup entry in {{ic|/etc/xdg/autostart}}. If you want to launch the GUI, then run {{ic|backintime-qt4}}. If you want to backup files other than your home user files, then consider starting Back In Time with {{ic|pkexec backintime-qt4}} instead.<br />
<br />
== Configuration ==<br />
<br />
The configuration can be done entirely via the GUI. All you have to do is configure:<br />
<br />
* Where to save snapshot<br />
* What directories to backup<br />
* When backup should be done (manual, every hour, every day, every week, every month)<br />
<br />
== Troubleshooting ==<br />
<br />
=== Can't find snapshots folder ===<br />
<br />
If you see the error message in the status bar that BIT cannot find the snapshots folder although the snapshots are visible in the sidebar and the backup process is working correctly, then you are likely to have leftovers from a previous failed backup cron job. The status bar displays the content of the file {{ic|~/.local/share/backintime/worker.message}}. Thus deleting or renaming this file will remove the error message.<br />
<br />
== See also ==<br />
<br />
* [https://github.com/bit-team/backintime GitHub repository]<br />
* [https://backintime.readthedocs.io/en/latest/ Documentation]</div>Delapouitehttps://wiki.archlinux.org/index.php?title=Sysctl&diff=566604Sysctl2019-02-14T12:13:59Z<p>Delapouite: add link to procfs</p>
<hr />
<div>{{Lowercase title}}<br />
[[Category:Kernel]]<br />
[[Category:Commands]]<br />
[[ja:Sysctl]]<br />
[[Wikipedia:sysctl|sysctl]] is a tool for examining and changing [[kernel parameters]] at runtime (package {{Pkg|procps-ng}} in [[official repositories]]). sysctl is implemented in [[Wikipedia:procfs|procfs]], the virtual process file system at {{ic|/proc/}}.<br />
<br />
== Configuration ==<br />
<br />
{{Note|From version 207 and 21x, [[systemd]] only applies settings from {{Ic|/etc/sysctl.d/*.conf}} and {{Ic|/usr/lib/sysctl.d/*.conf}}. If you had customized {{Ic|/etc/sysctl.conf}}, you need to rename it as {{Ic|/etc/sysctl.d/99-sysctl.conf}}. If you had e.g. {{Ic|/etc/sysctl.d/foo}}, you need to rename it to {{Ic|/etc/sysctl.d/foo.conf}}.}}<br />
<br />
The '''sysctl''' preload/configuration file can be created at {{Ic|/etc/sysctl.d/99-sysctl.conf}}. For [[systemd]], {{Ic|/etc/sysctl.d/}} and {{Ic|/usr/lib/sysctl.d/}} are drop-in directories for kernel sysctl parameters. The naming and source directory decide the order of processing, which is important since the last parameter processed may override earlier ones. For example, parameters in a {{ic|/usr/lib/sysctl.d/50-default.conf}} will be overriden by equal parameters in {{ic|/etc/sysctl.d/50-default.conf}} and any configuration file processed later from both directories. <br />
<br />
To load all configuration files manually, execute <br />
# sysctl --system <br />
which will also output the applied hierarchy. A single parameter file can also be loaded explicitly with <br />
# sysctl -p ''filename.conf''<br />
<br />
See [http://0pointer.de/blog/projects/the-new-configuration-files the new configuration files] and more specifically {{man|5|sysctl.d}} for more information.<br />
<br />
The parameters available are those listed under {{Ic|/proc/sys/}}. For example, the {{Ic|kernel.sysrq}} parameter refers to the file {{Ic|/proc/sys/kernel/sysrq}} on the file system. The {{Ic|sysctl -a}} command can be used to display all currently available values.<br />
<br />
{{Note|If you have the kernel documentation installed ({{Pkg|linux-docs}}), you can find detailed information about sysctl settings in {{Ic|/usr/lib/modules/$(uname -r)/build/Documentation/sysctl/}}. It is highly recommended reading these before changing sysctl settings.}}<br />
<br />
Settings can be changed through file manipulation or using the {{Ic|sysctl}} utility. For example, to temporarily enable the [[Wikipedia:Magic_SysRq_key|magic SysRq key]]:<br />
<br />
# sysctl kernel.sysrq=1<br />
<br />
or:<br />
<br />
# echo "1" > /proc/sys/kernel/sysrq<br />
<br />
To preserve changes between reboots, add or modify the appropriate lines in {{Ic|/etc/sysctl.d/99-sysctl.conf}} or another applicable parameter file in {{Ic|/etc/sysctl.d/}}.<br />
{{Tip|Some parameters that can be applied may depend on kernel modules which in turn might not be loaded. For example parameters in {{ic|/proc/sys/net/bridge/*}} depend on the {{ic|br_netfilter}} module. If it is not loaded at runtime (or after a reboot), those will ''silently'' not be applied. See [[Kernel modules]].}}<br />
<br />
== Security ==<br />
<br />
See [[Security#Kernel hardening]].<br />
<br />
== Networking ==<br />
<br />
=== Improving performance ===<br />
<br />
==== Increasing the size of the receive queue. ====<br />
The received frames will be stored in this queue after taking them from the ring buffer on the network card.<br />
<br />
Increasing this value for high speed cards may help prevent losing packets:<br />
<br />
net.core.netdev_max_backlog = 100000<br />
net.core.netdev_budget = 50000<br />
net.core.netdev_budget_usecs = 5000<br />
<br />
{{Note|In real time application like SIP routers, this option requires a high speed CPU otherwise the data in the queue will be out of date.}}<br />
<br />
==== Increase the maximum connections ====<br />
<br />
The upper limit on how many connections the kernel will accept (default 128):<br />
<br />
net.core.somaxconn = 1024<br />
<br />
{{Warning|Increasing this value may only increase performance on high-loaded servers and may cause as slow processing rate (e.g. a single threaded blocking server) or insufficient number of worker threads/processes [https://serverfault.com/questions/518862/will-increasing-net-core-somaxconn-make-a-difference/519152].}}<br />
<br />
==== Increase the memory dedicated to the network interfaces ====<br />
<br />
The default the Linux network stack is not configured for high speed large file transfer across WAN links (i.e. handle more network packets) and setting the correct values may save memory resources:<br />
<br />
net.core.rmem_default = 1048576<br />
net.core.rmem_max = 16777216<br />
net.core.wmem_default = 1048576<br />
net.core.wmem_max = 16777216<br />
net.core.optmem_max = 65536<br />
net.ipv4.tcp_rmem = 4096 1048576 2097152<br />
net.ipv4.tcp_wmem = 4096 65536 16777216<br />
<br />
It is also possible increase the default {{ic|4096}} UDP limits:<br />
<br />
net.ipv4.udp_rmem_min = 8192<br />
net.ipv4.udp_wmem_min = 8192<br />
<br />
See the following sources for more information and recommend values:<br />
* http://www.nateware.com/linux-network-tuning-for-2013.html<br />
* https://blog.cloudflare.com/the-story-of-one-latency-spike/<br />
<br />
==== Enable TCP Fast Open ====<br />
<br />
TCP Fast Open is an extension to the transmission control protocol (TCP) that helps reduce network latency by enabling data to be exchanged during the sender’s initial TCP SYN [https://www.keycdn.com/support/tcp-fast-open/]. Using the value {{ic|3}} instead of the default {{ic|1}} allows TCP Fast Open for both incoming and outgoing connections:<br />
<br />
net.ipv4.tcp_fastopen = 3<br />
<br />
==== Tweak the pending connection handling ====<br />
<br />
{{ic|tcp_max_syn_backlog}} is the maximum queue length of pending connections 'Waiting Acknowledgment'.<br />
<br />
In the event of a synflood DOS attack, this queue can fill up pretty quickly, at which point tcp_syncookies will kick in allowing your system to continue to respond to legitimate traffic, and allowing you to gain access to block malicious IPs.<br />
<br />
If the server suffers from overloads at peak times, you may want to increase this value a little bit:<br />
<br />
net.ipv4.tcp_max_syn_backlog = 30000<br />
<br />
{{ic|tcp_max_tw_buckets}} is the maximum number of sockets in 'TIME_WAIT' state.<br />
<br />
After reaching this number the system will start destroying the socket that are in this state.<br />
<br />
Increase this to prevent simple DOS attacks:<br />
<br />
net.ipv4.tcp_max_tw_buckets = 2000000<br />
<br />
{{ic|tcp_tw_reuse}} sets whether TCP should reuse an existing connection in the TIME-WAIT state for a new outgoing connection if the new timestamp is strictly bigger than the most recent timestamp recorded for the previous connection.<br />
<br />
This helps avoid from running out of available network sockets:<br />
<br />
net.ipv4.tcp_tw_reuse = 1<br />
<br />
Specify how many seconds to wait for a final FIN packet before the socket is forcibly closed. This is strictly a violation of the TCP specification, but required to prevent denial-of-service attacks. In Linux 2.2, the default value was 180 [https://access.redhat.com/solutions/41776]:<br />
<br />
net.ipv4.tcp_fin_timeout = 10<br />
<br />
{{ic|tcp_slow_start_after_idle}} sets whether TCP should start at the default window size only for new connections or also for existing connections that have been idle for too long.<br />
<br />
This setting kills persistent single connection performance and could be turned off:<br />
<br />
net.ipv4.tcp_slow_start_after_idle = 0<br />
<br />
==== Change TCP keepalive parameters ====<br />
<br />
* TCP keepalive is a mechanism for TCP connections that help to determine whether the other end has stopped responding or not.<br />
* TCP will send the keepalive probe contains null data to the network peer several times after a period of idle time. If the peer does not respond, the socket will be closed automatically.<br />
* By default, TCP keepalive process waits for two hours (7200 secs) for socket activity before sending the first keepalive probe, and then resend it every 75 seconds. As long as there is TCP/IP socket communications going on and active, no keepalive packets are needed.<br />
{{Note|With the following settings, your application will detect dead TCP connections after 120 seconds (60s + 10s + 10s + 10s + 10s + 10s + 10s)}}<br />
<br />
net.ipv4.tcp_keepalive_time = 60<br />
net.ipv4.tcp_keepalive_intvl = 10<br />
net.ipv4.tcp_keepalive_probes = 6<br />
<br />
==== Enable MTU probing ====<br />
<br />
The longer the MTU the better for performance, but the worse for reliability.<br />
<br />
This is because a lost packet means more data to be retransmitted and because many routers on the Internet can't deliver very long packets:<br />
<br />
net.ipv4.tcp_mtu_probing = 1<br />
<br />
See https://blog.cloudflare.com/path-mtu-discovery-in-practice/ for more information.<br />
<br />
==== TCP Timestamps ====<br />
{{Warning|TCP timestamps protect against wrapping sequence numbers (at gigabit speeds) and round trip time calculation implemented in TCP. It is not recommended to turn off TCP timestamps as it may cause a security risk [https://access.redhat.com/sites/default/files/attachments/20150325_network_performance_tuning.pdf].}}<br />
<br />
Disabling timestamp generation will reduce spikes and may give a performance boost on gigabit networks:<br />
<br />
net.ipv4.tcp_timestamps = 0<br />
<br />
=== TCP/IP stack hardening ===<br />
<br />
The following specifies a parameter set to tighten network security options of the kernel for the IPv4 protocol and related IPv6 parameters where an equivalent exists. <br />
<br />
For some use-cases, for example using the system as a [[router]], other parameters may be useful or required as well. <br />
<br />
==== TCP SYN cookie protection ====<br />
Helps protect against SYN flood attacks. Only kicks in when {{ic|net.ipv4.tcp_max_syn_backlog}} is reached:<br />
net.ipv4.tcp_syncookies = 1<br />
<br />
==== TCP rfc1337 ====<br />
<br />
{{Accuracy|This doesn't seem to be part of the TCP standard? [https://serverfault.com/questions/787624/why-isnt-net-ipv4-tcp-rfc1337-enabled-by-default]}}<br />
<br />
Protect against tcp time-wait assassination hazards, drop RST packets for sockets in the time-wait state. Not widely supported outside of Linux, but conforms to RFC:<br />
net.ipv4.tcp_rfc1337 = 1<br />
<br />
==== Reverse path filtering ====<br />
<br />
Sets the kernels reverse path filtering mechanism to value 1 (on). Will do source validation of the packet's received from all the interfaces on the machine. Protects from attackers that are using ip spoofing methods to do harm (default):<br />
net.ipv4.conf.default.rp_filter = 1<br />
net.ipv4.conf.all.rp_filter = 1<br />
<br />
==== Log martian packets ====<br />
<br />
A Martian packet is an IP packet which specifies a source or destination address that is reserved for special-use by Internet Assigned Numbers Authority (IANA). See [[wikipedia:Reserved_IP_addresses|Reserved IP addresses]] for more details.<br />
<br />
Often martian and unroutable packet may be used for a dangerous purpose. Logging these packets for further inspection may be useful [https://www.cyberciti.biz/faq/linux-log-suspicious-martian-packets-un-routable-source-addresses/]:<br />
<br />
net.ipv4.conf.default.log_martians = 1<br />
net.ipv4.conf.all.log_martians = 1<br />
<br />
{{Note|This can fill up your logs with a lot of information, it is advisable to only enable this for testing.}}<br />
<br />
==== Disable ICMP redirecting ====<br />
<br />
To disable ICMP redirect acceptance:<br />
<br />
net.ipv4.conf.all.accept_redirects = 0<br />
net.ipv4.conf.default.accept_redirects = 0<br />
net.ipv4.conf.all.secure_redirects = 0<br />
net.ipv4.conf.default.secure_redirects = 0<br />
net.ipv6.conf.all.accept_redirects = 0<br />
net.ipv6.conf.default.accept_redirects = 0<br />
<br />
To disable ICMP redirect sending when on a non router:<br />
<br />
net.ipv4.conf.all.send_redirects = 0<br />
net.ipv4.conf.default.send_redirects = 0<br />
<br />
==== Enable Ignoring to ICMP Request ====<br />
<br />
To disable ICMP echo 'ping' requests:<br />
<br />
net.ipv4.icmp_echo_ignore_all = 1<br />
<br />
{{Note|Beware this may cause issues with monitoring tools and/or applications relying on ICMP echo responses.}}<br />
<br />
== Virtual memory ==<br />
<br />
There are several key parameters to tune the operation of the virtual memory (VM) subsystem of the Linux kernel and the write out of dirty data to disk. See the official [https://www.kernel.org/doc/Documentation/sysctl/vm.txt Linux kernel documentation] for more information. For example:<br />
<br />
* {{ic|1=vm.dirty_ratio = 10}}<br />
: Contains, as a percentage of total available memory that contains free pages and reclaimable pages, the number of pages at which a process which is generating disk writes will itself start writing out dirty data.<br />
<br />
* {{ic|1=vm.dirty_background_ratio = 5}}<br />
: Contains, as a percentage of total available memory that contains free pages and reclaimable pages, the number of pages at which the background kernel flusher threads will start writing out dirty data.<br />
<br />
As noted in the comments for the parameters, one needs to consider the total amount of RAM when setting these values. For example, simplifying by taking the installed system RAM instead of available memory:<br />
<br />
{{Warning|<br />
* Higher ratio values may increase performance, it also increases the risk of data loss.<br />
* Setting this value to {{ic|0}} may cause higher latency on disks and spikes.<br />
See https://lonesysadmin.net/2013/12/22/better-linux-disk-caching-performance-vm-dirty_ratio/ for more information.}}<br />
<br />
* Consensus is that setting {{ic|vm.dirty_ratio}} to 10% of RAM is a sane value if RAM is say 1 GB (so 10% is {{#expr: 1000/10 round 0}} MB). But if the machine has much more RAM, say 16 GB (10% is {{#expr: 16/10 round 1 }} GB), the percentage may be out of proportion as it becomes several seconds of writeback on spinning disks. A more sane value in this case may be {{ic|3}} (3% of 16 GB is approximately 491 MB).<br />
* Similarly, setting {{ic|vm.dirty_background_ratio}} to {{ic|5}} may be just fine for small memory values, but again, consider and adjust accordingly for the amount of RAM on a particular system.<br />
<br />
Decreasing the VFS cache parameter value may improve system responsiveness:<br />
* {{ic|1=vm.vfs_cache_pressure = 50}}<br />
: The value controls the tendency of the kernel to reclaim the memory which is used for caching of directory and inode objects (VFS cache). Lowering it from the default value of 100 makes the kernel less inclined to reclaim VFS cache (do not set it to 0, this may produce out-of-memory conditions).<br />
<br />
== MDADM ==<br />
<br />
When the kernel performs a resync operation of a software raid device it tries not to create a high system load by restricting the speed of the operation. Using sysctl it is possible to change the lower and upper speed limit.<br />
<br />
{{bc|1=<br />
# Set maximum and minimum speed of raid resyncing operations<br />
dev.raid.speed_limit_max = 10000<br />
dev.raid.speed_limit_min = 1000<br />
}}<br />
<br />
If mdadm is compiled as a module {{ic|md_mod}}, the above settings are available only after the module has been loaded. If the settings shall be loaded on boot via {{ic|/etc/sysctl.d}}, the module {{ic|md_mod}} may be loaded beforehand through {{ic|/etc/modules-load.d}}.<br />
<br />
== Troubleshooting ==<br />
<br />
=== Small periodic system freezes ===<br />
<br />
Set dirty bytes to small enough value (for example 4M):<br />
<br />
vm.dirty_background_bytes = 4194304<br />
vm.dirty_bytes = 4194304<br />
<br />
{{Note|The {{ic|dirty_background_bytes}} and {{ic|dirty_bytes}} parameters are counterparts of {{ic|dirty_background_ratio}} and {{ic|dirty_ratio}} (as seen in [[#Virtual memory]]). Only one of the parameters may be specified at a time.}}<br />
<br />
Try to change {{ic|kernel.io_delay_type}} (x86 only):<br />
* 0 - IO_DELAY_TYPE_0X80<br />
* 1 - IO_DELAY_TYPE_0XED<br />
* 2 - IO_DELAY_TYPE_UDELAY<br />
* 3 - IO_DELAY_TYPE_NONE<br />
<br />
=== Long system freezes while swapping to disk ===<br />
Increase {{ic|vm.min_free_kbytes}} to improve desktop responsiveness and reduce long pauses due to swapping to disk. One should increase this to {{ic|installed_mem / num_of_cores * 0.05}}. See [https://askubuntu.com/a/45009] and [https://www.linbit.com/en/kernel-min_free_kbytes/] for more details.<br />
<br />
== See also ==<br />
<br />
* {{man|8|sysctl}} and {{man|5|sysctl.conf}}<br />
* [https://www.kernel.org/doc/Documentation/sysctl/ Linux kernel documentation for /proc/sys/]<br />
* Kernel Documentation: [https://www.kernel.org/doc/Documentation/networking/ip-sysctl.txt IP Sysctl]<br />
* [http://tldp.org/HOWTO/Adv-Routing-HOWTO/lartc.kernel.html Kernel network parameters for sysctl]<br />
* [https://sysctl-explorer.net sysctl-explorer.net – an initiative to facilitate the access of Linux' sysctl reference documentation]<br />
* [https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/6/html/security_guide/sect-security_guide-server_security-disable-source-routing Disable Source Routing - Red Hat Customer Portal]<br />
* [https://www.suse.com/documentation/sles11/book_hardening/data/sec_sec_prot_general_kernel.html SUSE handbook about Security Features in the Kernel]</div>Delapouitehttps://wiki.archlinux.org/index.php?title=X_Logical_Font_Description&diff=559211X Logical Font Description2018-12-16T12:57:16Z<p>Delapouite: add link to X11</p>
<hr />
<div>[[Category:Fonts]]<br />
[[ja:X Logical Font Description]]<br />
{{Related articles start}}<br />
{{Related|Fonts}}<br />
{{Related|Font configuration}}<br />
{{Related articles end}}<br />
Two different font systems are used by [[X11]]: the older or core X Logical Font Description, ''XLFD, ''and the newer X FreeType, ''Xft, ''systems (see [http://keithp.com/~keithp/render/Xft.tutorial An Xft Tutorial] for font names format). XLFD was originally designed for bitmap fonts and support for scalable fonts (Type1, TrueType and OpenType) was added later. XLFD does not support anti‑aliasing and sub‑pixel rasterization. Xft uses the FreeType and Fontconfig libraries and is more suitable when the smooth appearance of fonts is desired. A guide for using Fontconfig and Xft may be found at [[Font configuration]].<br />
<br />
==Font names==<br />
Font names are complex when using XLFD:<br />
<br />
-misc-fixed-medium-r-semicondensed--13-120-75-75-c-60-iso8859-1<br />
<br />
The name contains fourteen elements, with each element field preceded by a hyphen, {{ic|-}}. Not all elements are required to be present in a font name and a field may be empty. Names can be simplified for the user by the wildcards {{ic|*}} and {{ic|?}}. On the command line, surround the font name with quotes to prevent the shell from interpreting the wildcards and to avoid backslashing whitespace.<br />
<br />
$ xterm -fn "-*-fixed-medium-r-s*--12-87-*-*-*-*-iso10???-1"<br />
$ xterm -fn "-*-dejavu sans mono-medium-r-normal--*-80-*-*-*-*-iso10646-1"<br />
<br />
Names can be simplified even more by using [[#Aliases|aliases]]:<br />
<br />
$ xterm -fn 12x24<br />
<br />
Two nearly indispensible utilities for working with XLFD names are ''xfontsel,'' {{Pkg|xorg-xfontsel}}, and ''xlsfonts,'' {{Pkg|xorg-xlsfonts}}. Xfontsel uses dropdown menus for selecting parts of a font name and previews the font selected. Xlsfonts can list fonts by name, with selectable degrees of detail, and can show how wildcards and aliases will be interpreted by the XLFD system. If a fontname is not working, check for a match with xlsfonts.<br />
<br />
$ xlsfonts -fn "*-fixed-medium-r-n*--13-120-75-*-iso1*-1"<br />
$ xlsfonts -ll -fn fixed<br />
<br />
===Font name elements===<br />
The following table provides a description of the font name fields. The elements are listed in the same order as they appear in a font name. The names used by xfontsel are listed below the longer uppercase names.<br />
<br />
{| class="wikitable"<br />
|-<br />
| align="center" | FOUNDRY<br />''fndry'' || The supplier of the font.<br />
Specify this field when two different fonts share the same FAMILY_NAME, for example, {{ic|courier}}. Otherwise the wildcard, {{ic|*}}, may be substituted.<br />
|-<br />
| align="center" | FAMILY_NAME<br />''fmly'' || The typeface name, defined by the foundry. Usually, fonts with the same family name are visually similar.<br />
|-<br />
| align="center" | WEIGHT_NAME<br />''wght'' || The degree of blackness of the glyphs, defined by the foundry. Common values are {{ic|bold}} and {{ic|medium}}.<br />
|-<br />
| align="center" | SLANT<br />''slant'' || Common values are {{ic|r}} for Roman or upright, and {{ic|i}} and {{ic|o}} for the slanted italic and oblique typefaces.<br />
Usually this needs to be specified.<br />
|-<br />
| align="center" | SETWIDTH_NAME<br />''sWdth'' || Values are set by the designer, examples are {{ic|normal}}, {{ic|narrow}} or {{ic|condensed}} identifying the width.<br />
A value should be set, not wildcarded, when there are two or more possible values.<br />
|-<br />
| align="center" | ADD_STYLE<br />''adstyl'' || Often an empty field, but values may be supplied by the foundry.<br />
In xfontsel, an empty field is chosen by selecting {{ic|(nil)}} from the dropdown box. It's often safe to wildcard this field with {{ic|*}}.<br />
|-<br />
| align="center" | PIXEL_SIZE<br />''pxlsz'' || The body size of a font for a particular POINT_SIZE and RESOLUTION_Y. Changes the height of a font independent of the point size for which the font was designed.<br />
A zero, {{ic|0}}, or a {{ic|*}} may be used for scalable fonts if you specify POINT_SIZE.<br />
|-<br />
| align="center" | POINT_SIZE<br />''ptSz'' || The body heighth for which the font was designed. Values are expressed as tenths of a point (one point is nominally one seventy-secondth of an inch).<br />
<br />
See [[#Font sizes]].<br />
|-<br />
| align="center" | RESOLUTION_X<br />''resx'' || The horizontal resolution as an integer-string for which the font was designed. The values are expressed as pixels or dpi.<br />
For scalable fonts this may safely be set to zero or {{ic|*}}, bitmap fonts usually use {{ic|75}} or {{ic|100}}.<br />
|-<br />
| align="center" | RESOLUTION_Y<br />''resy'' || The vertical dpi for which the font was designed.<br />
Similar to RESOLUTION_X, scalable fonts can have this value set to zero or {{ic|*}}. For bitmaps, only one of RESOLUTION_X or RESOLUTION_Y needs to be identified. The other may be wildcarded.<br />
|-<br />
| align="center" | SPACING<br />''spc'' || {{ic|p}}– For proportional fonts<br />
{{ic|m}} – Monospace; all the glyphs have the same logical width.<br />
<br />
{{ic|c}} – Character cell; each glyph occupies a "frame" and the frames all have equal width. This is typewriter spacing.<br />
Some older applications may leave glyph fragments when the display is refreshed if fonts with the {{ic|m}} spacing are used. For these applications, try using a font with {{ic|c}} spacing.<br />
|-<br />
| align="center" | AVERAGE_WIDTH<br />''avgWdth'' || Arithmetic mean of the widths of all glyphs. Zero is used for proportional fonts.<br />
It is safe to wildcard this value with *.<br />
|-<br />
| align="center" | CHARSET_REGISTRY<br />''rgstry'' || Always paired with the next field, this names the registration authority for the character encoding used. Examples are {{ic|iso10646}} and {{ic|koi8}}.<br />
It's always safe to choose an available registry that is compatible with the user's locale settings.<br />
|-<br />
| align="center" | CHARSET_ENCODING<br />''encdng'' || An identifier for the character set encoding.<br />
|}<br />
<br />
==Font sizes==<br />
Font names are stored in the ''fonts.dir'' file in each font directory. For more information about these files, see [[#Font search path]] below. In a font name, the pixel and point sizes, and the x and y resolution values, may be changed and the changes will affect a font's displayed size and also the spacing between characters and between lines.<br />
<br />
As a general rule, bitmap fonts have their best appearance at the sizes the designers specified. For these fonts, changing the size-related values from those stored in the font names may give unexpected or ugly distortions or an unmatchable font pattern.<br />
<br />
Scalable fonts were designed to be resized. A scalable font name, as shown in the example below, has zeroes in the pixel and point size fields, the two resolution fields, and the average width field.<br />
-misc-liberation serif-medium-r-normal--0-0-0-0-p-0-iso10646-1<br />
To specify a scalable font at a particular size you only need to provide a value for the POINT_SIZE field, the other size related values can remain at zero. The POINT_SIZE value is in tenths of a point, so the entered value must be the desired point size multiplied by ten. As an example, the following line specifies ''Liberation Serif'' at 9 points.<br />
-misc-liberation serif-medium-r-normal--0-90-0-0-p-0-iso8859-1<br />
<br />
==Font search path==<br />
<br />
Please see [[Fonts]] for a guide to installing font files and modifying the font path. For a font to be available to the X server, the directory containing the font file must be on the user's font path. You can check your current font path with:<br />
$ xset q<br />
<br />
When a font is requested, the X server searches the font directories in the order given in the font path. Each font directory will contain a file named ''fonts.dir'' that serves as an index connecting a font's XLFD name to the file containing the font. The search ends when the first matching font is found.<br />
<br />
The first line in a ''fonts.dir'' file is the number of fonts listed in the file. The following lines then list the fonts in that directory: filename first, followed by a single space, and finally the font name. Below are the first four lines of an example fonts.dir:<br />
{{bc|1894<br />
UTBI__10-ISO8859-1.pcf.gz -adobe-utopia-bold-i-normal--14-100-100-100-p-78-iso8859-1<br />
UTBI__10-ISO8859-10.pcf.gz -adobe-utopia-bold-i-normal--14-100-100-100-p-78-iso8859-10<br />
UTBI__10-ISO8859-13.pcf.gz -adobe-utopia-bold-i-normal--14-100-100-100-p-78-iso8859-13}}<br />
<br />
===mkfontscale and mkfontdir===<br />
To create a ''fonts.dir'' file, two programs are required, {{ic|mkfontscale}} and {{ic|mkfontdir}}. These programs were probably installed when you installed [[Xorg]]. Mkfontdir reads all the bitmap font files in a directory for the font names, and creates the fonts.dir file using the font and file names it has found. It also adds the entries from a file named ''fonts.scale.''<br />
<br />
Because mkfontdir cannot read scalable font files, the program mkfontscale is used to create the names for TrueType, OpenType and Type1 fonts. The font names and font filenames are stored in the file named ''fonts.scale. ''The structure of a fonts.scale file is identical to a fonts.dir file. The first line is the number of font names listed; the following lines contain the filename first, followed by a single space, and finally the font name.<br />
<br />
Both ''fonts.scale'' and ''fonts.dir'' can be hand edited. However, every time mkfontscale or mkfontdir is run, any existing fonts.scale or fonts.dir is overwritten. Your edits are easily lost.<br />
<br />
Any time mkfontdir is run, the font database should be updated, using the command:<br />
$ xset fp rehash<br />
<br />
{{Note|Filenames that include spaces cannot be parsed correctly from the ''fonts.dir'' and ''fonts.scale'' files. Quoting or escaping these spaces will not work. The only solutions are to rename the files using filenames that do not contain spaces or to delete the font listings in the fonts.dir and fonts.scale files.}}<br />
<br />
==Aliases==<br />
Using aliases can greatly simplify the use of XLFD names. Aliases are stored in files named ''fonts.alias'' in the directories along the font path.<br />
<br />
The package {{Pkg|xorg-fonts-alias}} provides some common aliases that have become standard on X servers. This package provides fonts.alias files for fonts in the directories ''100dpi, 75dpi, cyrillic, and misc.'' Some applications depend on these standard aliases: the default font for ''xterm'' is coded to use the font matched by the alias "fixed". Changing these standardized aliases is not recommended, particularly for multi-user machines.<br />
<br />
You can add aliases to your system by writing your own ''fonts.alias'' file or by adding to an existing one. The format is simple. Comments are restricted to lines beginning with an exclamation point, {{ic|!}}. Blank lines are ignored. Each alias is defined on a single line. First is the alias name, followed by any amount of whitespace, and finally the font name or the alias name to be matched (an alias may refer to another alias). If an alias name or a font name includes spaces, that name must be enclosed within quotes. Here is a constructed example:<br />
{{bc|! This is a comment.<br />
<br />
djvsm9 "-misc-dejavu sans mono-medium-r-normal--0-90-0-0-m-0-iso10646-1"<br />
djvsm8 "-misc-dejavu sans mono-medium-r-normal--0-80-0-0-m-0-iso10646-1"<br />
"djvsm 8" djvsm8}}<br />
The location of a ''fonts.alias'' file may be in any directory on the font path. The font referred to by an alias may also be in any directory along the font path; the font file does not have to be in the same directory as the fonts.alias file.<br />
<br />
For new font aliases to be available to the user, the font database must be updated, again with<br />
$ xset fp rehash</div>Delapouitehttps://wiki.archlinux.org/index.php?title=Arch_boot_process&diff=557430Arch boot process2018-11-26T20:25:02Z<p>Delapouite: add link to NVRAM</p>
<hr />
<div>[[Category:Boot process]]<br />
[[Category:About Arch]]<br />
[[ar:Arch boot process]]<br />
[[cs:Arch boot process]]<br />
[[es:Arch boot process]]<br />
[[fr:Processus de boot]]<br />
[[it:Arch boot process]]<br />
[[ja:Arch ブートプロセス]]<br />
[[pt:Arch boot process]]<br />
[[ru:Arch boot process]]<br />
[[zh-hans:Arch boot process]]<br />
{{Related articles start}}<br />
{{Related|Master Boot Record}}<br />
{{Related|GUID Partition Table}}<br />
{{Related|Unified Extensible Firmware Interface}}<br />
{{Related|mkinitcpio}}<br />
{{Related|init}}<br />
{{Related|systemd}}<br />
{{Related|fstab}}<br />
{{Related|Autostarting}}<br />
{{Related articles end}}<br />
<br />
In order to boot Arch Linux, a Linux-capable [[#Boot loader|boot loader]] must be set up. The boot loader is responsible for loading the kernel and [[initial ramdisk]] before initiating the boot process. The procedure is quite different for [[Wikipedia:BIOS|BIOS]] and [[UEFI]] systems, the detailed description is given on this or linked pages.<br />
<br />
== Firmware types ==<br />
<br />
=== BIOS ===<br />
<br />
{{Expansion|Add information about [[Wikipedia:Unified Extensible Firmware Interface#CSM booting|CSM]].}}<br />
<br />
A [[Wikipedia:BIOS|BIOS]] or Basic Input-Output System is the very first program (firmware) that is executed once the system is switched on. In most cases it is stored in a flash memory in the motherboard itself and independent of the system storage.<br />
<br />
=== UEFI ===<br />
<br />
[[Unified Extensible Firmware Interface]] has support for reading both the partition table as well as file systems. UEFI does not launch any boot code in the MBR whether it exists or not, instead booting relies on boot entries in [[Wikipedia:Non-volatile_random-access_memory|NVRAM]].<br />
<br />
The UEFI specification mandates support for the [[FAT|FAT12, FAT16, and FAT32]] file systems (see [http://www.uefi.org/sites/default/files/resources/UEFI%20Spec%202_7_A%20Sept%206.pdf#G17.1019485 UEFI specification version 2.7, section 13.3.1.1]), but any conformant vendor can optionally add support for additional filesystems; for example, Apple [[Mac]]s support (and by default use) their own HFS+ filesystem drivers. UEFI implementations also support ISO-9660 for optical discs.<br />
<br />
UEFI launches EFI applications, e.g. [[#Boot loader|boot loaders]], boot managers, [[Unified Extensible Firmware Interface#UEFI Shell|UEFI shell]], etc. These applications are usually stored as files in the [[EFI system partition]]. Each vendor can store its files in the EFI system partition under the {{ic|/EFI/''vendor_name''}} folder. The applications can be launched by adding a boot entry to the NVRAM or from the UEFI shell.<br />
<br />
== System initialization ==<br />
<br />
=== Under BIOS ===<br />
<br />
# System switched on, the [[Wikipedia:Power-on self-test|power-on self-test (POST)]] is executed.<br />
# After POST, BIOS initializes the necessary system hardware for booting (disk, keyboard controllers etc.).<br />
# BIOS launches the first 440 bytes ([[Partitioning#Master Boot Record (bootstrap code)|the Master Boot Record bootstrap code area]]) of the first disk in the BIOS disk order.<br />
# The boot loader's first stage in the MBR boot code then launches its second stage code (if any) from either:<br />
#* next disk sectors after the MBR, i.e. the so called post-MBR gap (only on a MBR partition table).<br />
#* a partition's or a partitionless disk's [[Wikipedia:Volume boot record|volume boot record (VBR)]].<br />
#* the [[BIOS boot partition]] ([[GRUB]] on BIOS/GPT only).<br />
# The actual [[#Boot loader|boot loader]] is launched.<br />
# The boot loader then loads an operating system by either chain-loading or directly loading the operating system kernel.<br />
<br />
=== Under UEFI ===<br />
<br />
# System switched on, the [[Wikipedia:Power-on self-test|power-on self-test (POST)]] is executed.<br />
# UEFI initializes the hardware required for booting.<br />
# Firmware reads the boot entries in the NVRAM to determine which EFI application to launch and from where (e.g. from which disk and partition).<br />
#* A boot entry could simply be a disk. In this case the firmware looks for an [[EFI system partition]] on that disk and tries to find a EFI application in the fallback boot path {{ic|\EFI\BOOT\BOOTX64.EFI}} ({{ic|BOOTIA32.EFI}} on [[Unified Extensible Firmware Interface#UEFI firmware bitness|systems with a IA32 (32-bit) UEFI]]). This is how UEFI bootable removable media work.<br />
# Firmware launches the EFI application.<br />
#* This could be a [[#Boot loader|boot loader]] or the Arch [[kernel]] itself using [[EFISTUB]].<br />
#* It could be some other EFI application such as a UEFI shell or a [[#Boot loader|boot manager]] like [[systemd-boot]] or [[rEFInd]].<br />
<br />
If [[Secure Boot]] is enabled, the boot process will verify authenticity of the EFI binary by signature.<br />
<br />
{{Note|Some UEFI systems can only boot from the fallback boot path.}}<br />
<br />
=== Multibooting in UEFI ===<br />
<br />
Since each OS or vendor can maintain its own files within the EFI system partition without affecting the other, multi-booting using UEFI is just a matter of launching a different EFI application corresponding to the particular OS's boot loader. This removes the need for relying on chainloading mechanisms of one [[#Boot loader|boot loader]] to load another OS.<br />
<br />
See also [[Dual boot with Windows]].<br />
<br />
== Boot loader ==<br />
<br />
{{Expansion|Explain the difference between a boot loader and a boot manager.}}<br />
<br />
The boot loader is the first piece of software started by the [[Wikipedia:BIOS|BIOS]] or [[UEFI]]. It is responsible for loading the kernel with the wanted [[kernel parameters]], and [[mkinitcpio|initial RAM disk]] based on config files.<br />
<br />
{{Note|Loading [[Microcode]] updates requires adjustments in boot loader configuration. [https://www.archlinux.org/news/changes-to-intel-microcodeupdates/]}}<br />
<br />
=== Feature comparison ===<br />
<br />
{{Note|<br />
* Boot loaders only need to support the file system on which kernel and initramfs reside (the file system on which {{ic|/boot}} is located).<br />
* As GPT is part of the UEFI specification, all UEFI boot loaders support GPT disks. GPT on BIOS systems is possible, using either "hybrid booting" with [https://www.rodsbooks.com/gdisk/hybrid.html Hybrid MBR], or the new [http://repo.or.cz/syslinux.git/blob/HEAD:/doc/gpt.txt GPT-only] protocol. This protocol may however cause issues with certain BIOS implementations; see [http://www.rodsbooks.com/gdisk/bios.html#bios rodsbooks] for details.<br />
* Encryption mentioned in file system support is [[wikipedia:Filesystem-level encryption|filesystem-level encryption]], it has no bearing on [[dm-crypt|block-level encryption]]. <br />
}}<br />
<br />
{| class="wikitable sortable"<br />
! rowspan="2"| Name<br />
! colspan="2"| Firmware<br />
! rowspan="2"| Multi-boot<br />
! colspan="5"| [[File systems]]<br />
! rowspan="2"| Notes<br />
|-<br />
! BIOS !! [[UEFI]]<br />
! [[Btrfs]] !! [[ext4]] !! ReiserFS v3 !! [[VFAT]] !! [[XFS]]<br />
|-<br />
! [[EFISTUB]]<br />
| {{-}} || {{Yes}}<br />
| {{-}}<br />
| {{-}} || {{-}} || {{-}} || {{Y|ESP only}} || {{-}}<br />
| Kernel turned into EFI executable to be loaded directly from [[UEFI]] firmware or another boot loader.<br />
|-<br />
! [[Clover]]<br />
| {{G|emulates UEFI}} || {{Yes}}<br />
| {{Yes}}<br />
| {{No}} || {{Y|without encryption}} || {{No}} || {{Yes}} || {{No}}<br />
| Fork of rEFIt modified to run [[wikipedia:Hackintosh|macOS on non-Apple hardware]].<br />
|-<br />
! [[GRUB]]<br />
| {{Yes}} || {{Yes}}<br />
| {{Yes}}<br />
| {{Y|without zstd compression}} || {{Yes}} || {{Yes}} || {{Yes}} || {{Yes}}<br />
| On BIOS/GPT configuration requires a [[BIOS boot partition]]. <br/>Supports RAID, LUKS1 and LVM (but not thin provisioned volumes).<br />
|-<br />
! [[rEFInd]]<br />
| {{No}} || {{Yes}}<br />
| {{Yes}}<br />
| {{Y|without: encryption, zstd compression}} || {{Y|without encryption}} || {{Y|without tail-packing feature}} || {{Yes}} || {{No}}<br />
| Supports auto-detecting kernels and parameters without explicit configuration.<br />
|-<br />
! [[Syslinux]]<br />
| {{Yes}} || {{Y|[[Syslinux#Limitations_of_UEFI_Syslinux|Partial]]}}<br />
| {{Y|[[Syslinux#Chainloading|Partial]]}}<br />
| {{Y|without: multi-device volumes, compression, encryption}} || {{Y|without encryption}} || {{No}} || {{Yes}} || {{Y|v4 on [[MBR]] only}}<br />
| No support for certain [[file system]] features [http://www.syslinux.org/wiki/index.php?title=Filesystem]<br />
|-<br />
! [[systemd-boot]]<br />
| {{No}} || {{Yes}}<br />
| {{Yes}}<br />
| {{No}} || {{No}} || {{No}} || {{Y|ESP only}} || {{No}}<br />
| Cannot launch binaries from partitions other than [[ESP]].<br />
|-<br />
! {{Grey|[[GRUB Legacy]]}}<br />
| {{Y|without GPT}} || {{No}}<br />
| {{Yes}}<br />
| {{No}} || {{No}} || {{Yes}} || {{Yes}} || {{Y|v4 only}}<br />
| [https://www.gnu.org/software/grub/grub-legacy.html Discontinued] in favor of [[GRUB]].<br />
|-<br />
! {{Grey|[[LILO]]}}<br />
| {{Y|without GPT}} || {{No}}<br />
| {{Yes}}<br />
| {{No}} || {{Y|without encryption}} || {{Yes}} || {{Yes}} || {{Y|MBR only [http://xfs.org/index.php/XFS_FAQ#Q:_Does_LILO_work_with_XFS.3F]}}<br />
| [http://web.archive.org/web/20180323163248/http://lilo.alioth.debian.org/ Discontinued] due to limitations (e.g. with Btrfs, GPT, RAID).<br />
|}<br />
<br />
See also [[Wikipedia:Comparison of boot loaders]].<br />
<br />
== Kernel ==<br />
<br />
The [[kernel]] is the core of an operating system. It functions on a low level (''kernelspace'') interacting between the hardware of the machine and the programs which use the hardware to run. To make efficient use of the CPU, the kernel uses a scheduler to arbitrate which tasks take priority at any given moment, creating the illusion of many tasks being executed simultaneously.<br />
<br />
== initramfs ==<br />
<br />
After the kernel is loaded, it unpacks the [[initramfs]] (initial RAM filesystem), which becomes the initial root filesystem. The kernel then executes {{ic|/init}} as the first process. The ''early userspace'' starts.<br />
<br />
The purpose of the initramfs is to bootstrap the system to the point where it can access the root filesystem (see [[FHS]] for details). This means that any modules that are required for devices like IDE, SCSI, SATA, USB/FW (if booting from an external drive) must be loadable from the initramfs if not built into the kernel; once the proper modules are loaded (either explicitly via a program or script, or implicitly via [[udev]]), the boot process continues. For this reason, the initramfs only needs to contain the modules necessary to access the root filesystem; it does not need to contain every module one would ever want to use. The majority of modules will be loaded later on by udev, during the init process.<br />
<br />
== Init process ==<br />
<br />
At the final stage of early userspace, the real root is mounted, and then replaces the initial root filesystem. {{ic|/sbin/init}} is executed, replacing the {{ic|/init}} process. Arch uses [[systemd]] as the default [[init]].<br />
<br />
== Getty ==<br />
<br />
[[init]] calls [[getty]] once for each [[Wikipedia:Virtual console|virtual terminal]] (typically six of them), which initializes each tty and asks for a username and password. Once the username and password are provided, getty checks them against {{ic|/etc/passwd}} and {{ic|/etc/shadow}}, then calls [[#Login|login]]. Alternatively, getty may start a display manager if one is present on the system.<br />
<br />
== Display Manager ==<br />
<br />
{{Style|A display manager is also a GUI, see [[#GUI, xinit or wayland]]}}<br />
<br />
A [[display manager]] can be configured to replace the getty login prompt on a tty.<br />
<br />
== Login ==<br />
<br />
The ''login'' program begins a session for the user by setting environment variables and starting the user's shell, based on {{ic|/etc/passwd}}.<br />
<br />
The ''login'' program displays the contents of [[Wikipedia:motd (Unix)|/etc/motd]] (''m''essage ''o''f ''t''he ''d''ay) after a successful login, just before it executes the login shell. It is a good place to display your Terms of Service to remind users of your local policies or anything you wish to tell them.<br />
<br />
== Shell ==<br />
<br />
Once the user's [[shell]] is started, it will typically run a runtime configuration file, such as [[bashrc]], before presenting a prompt to the user. If the account is configured to [[Start X at login]], the runtime configuration file will call [[startx]] or [[xinit]].<br />
<br />
== GUI, xinit or wayland ==<br />
<br />
[[xinit]] runs the user's [[xinitrc]] runtime configuration file, which normally starts a [[window manager]]. When the user is finished and exits the window manager, xinit, startx, the shell, and login will terminate in that order, returning to getty.<br />
<br />
== See also ==<br />
<br />
* [https://web.archive.org/web/20150430223035/http://archlinux.me/brain0/2010/02/13/early-userspace-in-arch-linux/ Early Userspace in Arch Linux]<br />
* [http://www.ibm.com/developerworks/linux/library/l-linuxboot/ Inside the Linux boot process]<br />
* [[Wikipedia:Linux startup process]]<br />
* [[Wikipedia:initrd]]<br />
* [http://www.cyberciti.biz/faq/grub-boot-into-single-user-mode/ Boot Linux Grub Into Single User Mode]<br />
* [https://neosmart.net/wiki/mbr-boot-process/ NeoSmart: The BIOS/MBR Boot Process]<br />
* [https://www.linux.com/learn/kernel-newbie-corner-initrd-and-initramfs-whats Kernel Newbie Corner: initrd and initramfs]<br />
* [http://www.rodsbooks.com/efi-bootloaders/ Rod Smith - Managing EFI Boot Loaders for Linux]</div>Delapouitehttps://wiki.archlinux.org/index.php?title=Xrandr&diff=557322Xrandr2018-11-25T18:02:08Z<p>Delapouite: add explicit randr meaning</p>
<hr />
<div>{{Lowercase title}}<br />
[[Category:Xorg commands]]<br />
[[ru:Xrandr]]<br />
[[ja:Xrandr]]<br />
[[zh-hans:Xrandr]]<br />
{{Related articles start}}<br />
{{Related|Xorg}}<br />
{{Related|Multihead}}<br />
{{Related articles end}}<br />
<br />
''xrandr'' is an official configuration utility to the [[Wikipedia:RandR|RandR]] (''Resize and Rotate'') [[Wikipedia:X Window System|X Window System]] extension. It can be used to set the size, orientation or reflection of the outputs for a screen. For configuring multiple monitors see the [[Multihead]] page.<br />
<br />
== Installation ==<br />
<br />
[[Install]] {{Pkg|xorg-xrandr}}.<br />
<br />
=== Graphical front-ends ===<br />
<br />
* {{App|ARandR|Provide a simple visual front end for XRandR. Relative monitor positions are shown graphically and can be changed in a drag-and-drop way.|https://christian.amsuess.com/tools/arandr/|{{Pkg|arandr}}}}<br />
* {{App|LXRandR|Screen resolution and external monitors management tool for LXDE.|https://wiki.lxde.org/en/LXRandR|GTK+ 2: {{Pkg|lxrandr}}, GTK+ 3: {{Pkg|lxrandr-gtk3}}}}<br />
<br />
== Testing configuration ==<br />
<br />
When run without any option, ''xrandr'' shows the names of different outputs available on the system ({{ic|VGA-1}}, {{ic|HDMI-1}}, etc.) and resolutions available on each, with a '''*''' after the current one and a '''+''' after the preferred one :<br />
<br />
{{hc|xrandr|<br />
Screen 0: minimum 320 x 200, current 3200 x 1080, maximum 8192 x 8192<br />
VGA-1 disconnected (normal left inverted right x axis y axis)<br />
HDMI-1 connected primary 1920x1080+0+0 (normal left inverted right x axis y axis) 531mm x 299mm<br />
1920x1080 59.93 + 60.00* 50.00 59.94 <br />
1920x1080i 60.00 50.00 59.94 <br />
1680x1050 59.88 <br />
…<br />
}}<br />
{{Note|If your resolution is not present in the above list, see [[#Adding undetected resolutions]]}}<br />
<br />
You can use ''xrandr'' to set different resolution (must be present in the above list) on some output:<br />
<br />
$ xrandr --output HDMI-1 --mode 1920x1080<br />
<br />
When multiple refresh rates are present in the list, it may be changed by the {{ic|--rate}} option, either at the same time or independently. For example:<br />
<br />
$ xrandr --output HDMI-1 --mode 1920x1080 --rate 60<br />
<br />
The {{ic|--auto}} option will turn the specified output on if it is off and set the preferred (maximum) resolution:<br />
<br />
$ xrandr --output HDMI-1 --auto<br />
<br />
It is possible to specify multiple outputs in one command, e.g. to turn off {{ic|HDMI-1}} and turn on {{ic|HDMI-2}} with preferred resolution:<br />
<br />
$ xrandr --output HDMI-1 --off --output HDMI-2 --auto<br />
<br />
{{Note|<br />
* Changes you make using ''xrandr'' will only last through the current session.<br />
* ''xrandr'' has a lot more capabilities - see {{man|1|xrandr}} for details.<br />
}}<br />
<br />
== Configuration ==<br />
<br />
''xrandr'' is just a simple interface to the RandR extension and has no configuration file. However, there are multiple ways of achieving persistent configuration:<br />
<br />
# The RandR extension can be configured via [[Xorg#Configuration|X configuration files]], see [[Multihead#RandR]] for details. This method provides only static configuration.<br />
# If you need dynamic configuration, you need to execute ''xrandr'' commands each time X server starts. See [[Autostarting#On Xorg startup]] for details. This method has the disadvantage of occurring fairly late in the startup process, thus it will not alter the resolution of the [[display manager]] if you use one.<br />
# Custom scripts calling ''xrandr'' can be bound to events (for example when external monitor is plugged in), see [[acpid]] for details. The [[#Scripts]] section provides you with some example scripts that might be useful for this purpose.<br />
<br />
{{Tip|Both KDM and GDM have startup scripts that are executed when X is initiated. For GDM, these are in {{ic|/etc/gdm/}}, while for KDM this is done at {{ic|/usr/share/config/kdm/Xsetup}} and for SDDM at {{ic|/usr/share/sddm/scripts/Xsetup}}. This method requires root access and mucking around in system config files, but will take effect earlier in the startup process than using xprofile.}}<br />
<br />
=== Scripts ===<br />
<br />
==== Toggle external monitor ====<br />
<br />
This script toggles between an external monitor (specified by {{ic|$extern}}) and a default monitor (specified by {{ic|$intern}}), so that only one monitor is active at a time.<br />
<br />
The default monitor should be connected when running the script, which is always true for a laptop.<br />
<br />
{{bc|<nowiki><br />
#!/bin/bash<br />
intern=LVDS1<br />
extern=VGA1<br />
<br />
if xrandr | grep "$extern disconnected"; then<br />
xrandr --output "$extern" --off --output "$intern" --auto<br />
else<br />
xrandr --output "$intern" --off --output "$extern" --auto<br />
fi<br />
</nowiki>}}<br />
<br />
{{Note|To leave the external monitor enabled, replace the ''else'' clause with {{ic|xrandr --output "$intern" --primary --auto --output "$extern" --right-of "$intern" --auto}}.}}<br />
<br />
==== Automatically switch configurations with autorandr ====<br />
<br />
{{Pkg|autorandr}} allows you to easily configure xrandr "profiles" that will activate automatically when you connect/disconnect displays. See the [https://github.com/phillipberndt/autorandr homepage] for usage examples.<br />
<br />
==== Manage 2-monitors ====<br />
<br />
{{AUR|mons}} is a POSIX-compliant shell script to quickly manage 2-monitors display.<br />
<br />
It provides well-known modes like computer, duplicate, extend and projector mode as well as selecting and positioning one or two monitors among those plugged in (for more details, see [https://github.com/Ventto/mons mons]).<br />
<br />
==== Example 3 ====<br />
<br />
{{Accuracy|1=Basic shell mistakes: relying on quoting errors to relay arguments (instead of using arrays), convoluted grep+sed pipes (instead of awk), echo -e (instead of printf), ancient backtick format (instead of {{ic|$()}})}}<br />
<br />
This script iterates through connected monitors, selects currently active monitor, turns next one on and the others off:<br />
<br />
{{bc|<nowiki><br />
# get info from xrandr<br />
connectedOutputs=$(xrandr | grep " connected" | sed -e "s/\([A-Z0-9]\+\) connected.*/\1/")<br />
activeOutput=$(xrandr | grep -E " connected (primary )?[1-9]+" | sed -e "s/\([A-Z0-9]\+\) connected.*/\1/")<br />
<br />
# initialize variables<br />
execute="xrandr "<br />
default="xrandr "<br />
i=1<br />
switch=0<br />
<br />
for display in $connectedOutputs<br />
do<br />
# build default configuration<br />
if [ $i -eq 1 ]<br />
then<br />
default=$default"--output $display --auto "<br />
else<br />
default=$default"--output $display --off "<br />
fi<br />
<br />
# build "switching" configuration<br />
if [ $switch -eq 1 ]<br />
then<br />
execute=$execute"--output $display --auto "<br />
switch=0<br />
else<br />
execute=$execute"--output $display --off "<br />
fi<br />
<br />
# check whether the next output should be switched on<br />
if [ $display = $activeOutput ]<br />
then<br />
switch=1<br />
fi<br />
<br />
i=$(( $i + 1 ))<br />
done<br />
<br />
# check if the default setup needs to be executed then run it<br />
echo "Resulting Configuration:"<br />
if [ -z "$(echo $execute | grep "auto")" ]<br />
then<br />
echo "Command: $default"<br />
`$default`<br />
else<br />
echo "Command: $execute"<br />
`$execute`<br />
fi<br />
echo -e "\n$(xrandr)"<br />
</nowiki>}}<br />
<br />
==== Avoid X crash with xrasengan ====<br />
<br />
Use this workaround to turn on connected outputs that may be in suspend mode and hence shown as disconnected, as is often the case of DisplayPort monitors:<br />
<br />
{{bc|<nowiki><br />
declare -i count=2<br />
declare -i seconds=1<br />
<br />
while ((count)); do<br />
xrandr >/dev/null<br />
sleep $seconds<br />
((count--))<br />
done<br />
</nowiki>}}<br />
<br />
{{AUR|xrasengan}} is an xrandr wrapper with this workaround built in.<br />
<br />
$ xrasengan --force -on DisplayPort-0 -off HDMI-0<br />
<br />
With the {{ic|--force}} option, ''xrasengan'' will update status of all outputs before HDMI-0 is turned off, avoiding an X crash if they were the only connected/active outputs.<br />
<br />
To force reload current settings, ''xrasengan'' provides a {{ic|--try-reload-active-layout}} option, which uses {{ic|--force}} and ''unxrandr'' from the {{Pkg|arandr}} package to assemble the command line:<br />
<br />
$ xrasengan --try-reload-active-layout<br />
<br />
This can be used in systemd unit or in a keyboard binding to avoid blank screen when resuming DisplayPort monitors from suspend.<br />
<br />
== Troubleshooting ==<br />
<br />
=== Adding undetected resolutions ===<br />
<br />
Due to buggy hardware or drivers, your monitor's correct resolutions may not always be detected by xrandr. For example, the EDID data block queried from the monitor may be incorrect. However, we can add the desired resolutions to xrandr. Also, this same procedure can be used to add refresh rates you know are supported, but not enabled by your driver.<br />
<br />
First we run {{ic|gtf}} or {{ic|cvt}} to get the '''Modeline''' for the resolution we want:<br />
<br />
{{hc|$ cvt 1280 1024|<br />
# 1280x1024 59.89 Hz (CVT 1.31M4) hsync: 63.67 kHz; pclk: 109.00 MHz<br />
Modeline "1280x1024_60.00" 109.00 1280 1368 1496 1712 1024 1027 1034 1063 -hsync +vsync<br />
}}<br />
<br />
{{Tip|1=For some LCD screens (e.g. Samsung 2343NW, Acer XB280HK), the command {{ic|cvt -r}} (= with reduced blanking) is to be used.}}<br />
<br />
{{Tip|1=If you find that the screen goes blank when the modeline is applied, try lower refresh rate (e.g. 30 or 45 instead of 60). The refresh rate should be passed as the third argument: {{ic|cvt 2560 1440 45}}}}<br />
<br />
{{Note|If the Intel video driver {{pkg|xf86-video-intel}} is used, it may report the desired resolution along with its properties in {{ic|/var/log/Xorg.0.log}} — use that first if it is different from the output of {{ic|gtf}} or {{ic|cvt}}. For instance, the log and its use with xrandr:<br />
[ 45.063] (II) intel(0): clock: 241.5 MHz Image Size: 597 x 336 mm<br />
[ 45.063] (II) intel(0): h_active: 2560 h_sync: 2600 h_sync_end 2632 h_blank_end 2720 h_border: 0<br />
[ 45.063] (II) intel(0): v_active: 1440 v_sync: 1443 v_sync_end 1448 v_blanking: 1481 v_border: 0<br />
<br />
xrandr --newmode "2560x1440" 241.50 2560 2600 2632 2720 1440 1443 1448 1481 -hsync +vsync<br />
}}<br />
<br />
Then we create a new xrandr mode. Note that the Modeline keyword needs to be ommited.<br />
<br />
$ xrandr --newmode "1280x1024_60.00" 109.00 1280 1368 1496 1712 1024 1027 1034 1063 -hsync +vsync<br />
<br />
After creating it we need an extra step to add this new mode to our current output (VGA1). We use just the name of the mode, since the parameters have been set previously.<br />
<br />
$ xrandr --addmode VGA1 1280x1024_60.00<br />
<br />
Now we change the resolution of the screen to the one we just added:<br />
<br />
$ xrandr --output VGA1 --mode 1280x1024_60.00<br />
<br />
Note that these settings only take effect during this session. <br />
<br />
If you are not sure about the resolution you will test, you may add a {{ic|sleep 5}} and a safe resolution command line following, like this:<br />
<br />
$ xrandr --output VGA1 --mode 1280x1024_60.00 && sleep 5 && xrandr --newmode "1024x768-safe" 65.00 1024 1048 1184 1344 768 771 777 806 -HSync -VSync && xrandr --addmode VGA1 1024x768-safe && xrandr --output VGA1 --mode 1024x768-safe<br />
<br />
Also, change {{ic|VGA1}} to correct output name.<br />
<br />
==== EDID checksum is invalid ====<br />
<br />
If the previous method results in an {{ic|*ERROR* EDID checksum is invalid}} error during boot, see [[KMS#Forcing modes and EDID]] and [http://askubuntu.com/questions/201081/how-can-i-make-linux-behave-better-when-edid-is-unavailable].<br />
<br />
Or {{ic|xrandr --addmode}} might give you the error {{ic|X Error of failed request: BadMatch}}. NVIDIA users should read [[NVIDIA/Troubleshooting#xrandr BadMatch]]. {{ic|BadMatch}} could indicate an invalid EDID checksum. To verify that this is the case, run X in verbose mode (e.g. {{ic|startx -- -logverbose 6}}) and check your Xorg log for messages about a bad EDID.<br />
<br />
==== Screen resolution reverts back after a blink ====<br />
<br />
If you use [[GNOME]] and your monitor doesn't have an EDID, above [[#Adding undetected resolutions]] might not work, with your screen just blinking once, after {{ic|xrandr --output}}.<br />
<br />
Poke around with {{ic|~/.config/monitors.xml}}, or delete the file completely, and then reboot.<br />
<br />
It is better explained in [http://unix.stackexchange.com/questions/184941/gnome-prevents-high-resolution-vga-without-edid-info-over-vga this] article.<br />
<br />
=== Permanently adding undetected resolutions ===<br />
<br />
Once a suitable resolution is found using {{ic|xrandr}}, the mode can be permanently added by creating an entry in {{ic|/etc/X11/xorg.conf.d/}}:<br />
<br />
{{hc|/etc/X11/xorg.conf.d/10-monitor.conf|<br />
Section "Monitor"<br />
Identifier "VGA1"<br />
Modeline "1280x1024_60.00" 109.00 1280 1368 1496 1712 1024 1027 1034 1063 -hsync +vsync<br />
Option "PreferredMode" "1280x1024_60.00"<br />
EndSection<br />
<br />
Section "Screen"<br />
Identifier "Screen0"<br />
Monitor "VGA1"<br />
DefaultDepth 24<br />
SubSection "Display"<br />
Modes "1280x1024_60.00"<br />
EndSubSection<br />
EndSection<br />
<br />
Section "Device"<br />
Identifier "Device0"<br />
Driver "intel"<br />
EndSection}}<br />
<br />
Replace {{ic|intel}} with the right driver, e.g. {{ic|nvidia}}. When the X server is restarted, you should be able to set the new resolution.<br />
<br />
If this doesn't work for you, try removing the Screen and Device sections and just leaving the Monitor section. [https://bbs.archlinux.org/viewtopic.php?id=225134]<br />
<br />
=== Resolution lower than expected ===<br />
<br />
{{Tip|Try [[#Adding undetected resolutions]] first, if it doesn't work, you may try this method.}}<br />
<br />
If your video card is recognized but the resolution is lower than you expect, you may try this.<br />
<br />
Background: ATI X1550 based video card and two LCD monitors DELL 2408(up to 1920x1200) and Samsung 206BW(up to 1680x1050). Upon first login after installation, the resolution default to 1152x864. xrandr does not list any resolution higher than 1152x864. You may want to try editing /etc/X11/xorg.conf, add a section about virtual screen, logout, login and see if this helps. If not then read on.<br />
<br />
Change xorg.conf<br />
{{hc|/etc/X11/xorg.conf|<br />
Section "Screen"<br />
...<br />
SubSection "Display"<br />
Virtual 3600 1200<br />
EndSubSection<br />
EndSection<br />
}}<br />
<br />
About the numbers: DELL on the left and Samsung on the right. So the virtual width is of sum of both LCD width 3600=1920+1680; Height then is figured as the max of them, which is max(1200,1050)=1200. If you put one LCD above the other, use this calculation instead: (max(width1, width2), height1+height2).<br />
<br />
=== Correction of overscan tv resolutions via the underscan property ===<br />
<br />
With a flat panel TV, [[w:overscan]] looks like the picture is "zoomed in" so the edges are cut off.<br />
<br />
Check your TV if there is a parameter to change. If not check if the output has support for the underscan property (xrandr --prop), if so apply an {{ic|underscan}} and change border values. <br />
The required {{ic|underscan vborder}} and {{ic|underscan hborder}} values can be different for you, just check it and change it by more or less.<br />
<br />
$ xrandr --output HDMI-0 --set underscan on --set "underscan vborder" 25 --set "underscan hborder" 40<br />
<br />
=== Correction of overscan tv resolutions via --transform ===<br />
<br />
If underscan is not available another solution is using {{ic|xrandr --transform ''a,b,c,d,e,f,g,h,i''}}, which applies a transformation matrix on the output. See the {{man|1|xrandr|RandR_version_1.3_options}} manual page for the explanation of the transformation.<br />
<br />
For example, the transformation scaling horizontal coordinates by {{ic|0.8}}, vertical coordinates by {{ic|1.04}} and moving the screen by 35 pixels right and 19 pixels down, is:<br />
<br />
$ xrandr --output HDMI1 --transform 0.80,0,-35,0,1.04,-19,0,0,1<br />
<br />
=== Full RGB in HDMI ===<br />
<br />
It may occur that the [[Intel]] driver will not configure correctly the output of the HDMI monitor. It will set a limited color range (16-235) using the [https://patchwork.kernel.org/patch/1972181/ Broadcast RGB property], and the black will not look black, it will be grey.<br />
<br />
See [[Intel graphics#Weathered colors (color range problem)]].<br />
<br />
== See also ==<br />
* https://wiki.ubuntu.com/X/Config/Resolution<br />
* [[debian:XStrikeForce/HowToRandR12|Debian Wiki - RandR 1.2 tutorial]]<br />
* [http://www.thinkwiki.org/wiki/Xorg_RandR_1.2 Xorg RandR 1.2 on ThinkWiki]<br />
* [http://www.x.org/wiki/FAQVideoModes#ObtainingmodelinesfromWindowsprogramPowerStrip FAQVideoModes - more information about modelines]</div>Delapouitehttps://wiki.archlinux.org/index.php?title=PowerDNS&diff=554205PowerDNS2018-11-10T10:46:22Z<p>Delapouite: add link to BIND</p>
<hr />
<div>[[Category:Domain Name System]]<br />
[[ja:PowerDNS]]<br />
[https://www.powerdns.com/ PowerDNS] is a DNS server, written in C++ and licensed under the GPL. PowerDNS features a large number of different backends ranging from simple [[BIND]] style zonefiles to relational databases and load balancing/failover algorithms.<br />
<br />
== Installation ==<br />
<br />
[[Install]] the {{Pkg|powerdns}} package.<br />
<br />
Next you can review the configuration file located at {{ic|/etc/powerdns/pdns.conf}}.<br />
<br />
== Backends ==<br />
<br />
To configure PowerDNS to use specific backend you will need to set then {{ic|launch}} option in configuration file.<br />
Also depending on particular backend you use, you will have to configure it.<br />
<br />
For [[PostgreSQL]], [[MySQL]] and [[SQLite]] you can find database table creation SQL files located at {{ic|/usr/share/doc/powerdns}}.<br />
<br />
=== PostgreSQL backend ===<br />
<br />
Firstly you will need to create a user and database where PowerDNS can store data.<br />
<br />
Then execute "schema.pgsql.sql" file to create tables.<br />
psql -U <user> -d <database name> -a -f /usr/share/doc/powerdns/schema.pgsql.sql<br />
<br />
And finally update configuration file<br />
<br />
launch=gpgsql<br />
gpgsql-host=/run/postgresql # if PostgreSQL is listening to unix socket<br />
# gpgsql-host=127.0.0.1<br />
# gpgsql-port=5432<br />
gpgsql-dbname=<database name><br />
gpgsql-user=<user to use><br />
gpgsql-password=<br />
<br />
=== MySQL backend ===<br />
<br />
Install and run a [[MySQL]] server. Create a new user, and a new database and import the schema into the db:<br />
<br />
{{bc|<nowiki><br />
mysql -u root -p pdns < /usr/share/doc/powerdns/schema.mysql.sql</nowiki>}}<br />
<br />
Then, configure Powerdns to use MySQL:<br />
{{hc|/etc/powerdns/pdns.conf|<nowiki><br />
launch=gmysql<br />
gmysql-host=127.0.0.1<br />
gmysql-socket=/run/mysqld/mysqld.sock<br />
gmysql-user=pdns<br />
gmysql-password=Pa$$w0rd<br />
gmysql-dbname=pdns<br />
# Add this for dnssec support<br />
# gmysql-dnssec=yes</nowiki>}}<br />
<br />
You could also use localhost instead of 127.0.0.1, but this causes PowerDNS to use the socket file. As PowerDNS runs in a chroot by default, the socket file is not available.<br />
<br />
=== SQLite backend ===<br />
<br />
{{Expansion|TODO}}<br />
<br />
== Startup ==<br />
<br />
[[Start/enable]] the {{ic|powerdns}} service.<br />
<br />
== See also ==<br />
<br />
* [http://doc.powerdns.com/ PowerDNS manual]</div>Delapouitehttps://wiki.archlinux.org/index.php?title=Dvorak&diff=553861Dvorak2018-11-09T18:51:00Z<p>Delapouite: add link to dvorak page on wikipedia</p>
<hr />
<div>[[Category:Keyboard configuration]]<br />
[[da:Dvorak]]<br />
[[fr:Dvorak]]<br />
[[ja:Dvorak]]<br />
[[zh-hans:Dvorak]]<br />
This is a quick blurb for setting or converting your keymaps to [https://en.wikipedia.org/wiki/Dvorak_Simplified_Keyboard dvorak] instead of qwerty.<br />
<br />
== Setting Dvorak Layout ==<br />
See [[Keyboard configuration in console]] or [[Keyboard configuration in Xorg]] for configuration details.<br />
<br />
For the virtual terminal, dvorak and the regional keyboard are combined into one keymap. But Xorg lists dvorak as varian of your regional keymap. <br />
<br />
The {{ic|us}} Dvorak keymaps for the virtual terminal are:<br />
<br />
* {{ic|dvorak}}, Standard<br />
* {{ic|dvorak-l}}, Left handed Dvorak<br />
* {{ic|dvorak-r}}, Right handed Dvorak<br />
* {{ic|dvorak-programmer}}, Programmer Dvorak<br />
<br />
The {{ic|us}} Dvorak keymaps for Xorg are:<br />
<br />
* {{ic|dvorak}}, Standard<br />
* {{ic|dvorak-l}}, Left Handed Dvorak<br />
* {{ic|dvorak-r}}, Right Handed Dvorak<br />
* {{ic|dvp}}, Programmer Dvorak<br />
* {{ic|dvorak-intl}}, International Dvorak<br />
* {{ic|dvorak-classic}}<br />
* {{ic|dvorak-alt-intl}}<br />
<br />
{{Note|For console, these are standalone keymaps, but for Xorg these are variants of the {{ic|us}} layout, you need to pass them to {{ic|XkbVariant}} variable. See [[Keyboard configuration in Xorg#Setting keyboard layout]] for an explanation.}}<br />
<br />
== For international users ==<br />
<br />
=== Swedish ===<br />
<br />
Swedish people interested in trying dvorak can find the swedish "version", called svorak, at [http://www.aoeu.info aoeu.info]! To convert to svorak in X you do not need to download any additional files from www.aoeu.info.<br />
<br />
=== Spanish ===<br />
<br />
In console, specify {{ic|dvorak-es}} instead of {{ic|dvorak}} to use the Spanish dvorak variant.<br />
<br />
In Xorg, specify {{ic|es}} as {{ic|XkbLayout}} and {{ic|dvorak}} as {{ic|XkbVariant}}.<br />
<br />
=== United Kingdom ===<br />
<br />
In console, specify {{ic|dvorak-ukp}} (available from {{AUR|dvorak-ukp}}) instead of {{ic|dvorak}} to use the United Kingdom dvorak variant with ISO/IEC 9995-1 punctuation.<br />
<br />
In Xorg, specify {{ic|gb}} as {{ic|XkbLayout}} and {{ic|dvorakukp}} as {{ic|XkbVariant}}.<br />
<br />
== Typing tutors ==<br />
<br />
; Console<br />
* {{AUR|dvorakng}}<br />
<br />
; GUI<br />
* {{Pkg|ktouch}} (includes Dvorak lessons in English, French, German & Spanish)<br />
* {{pkg|klavaro}} Dvorak lessons: (BG; BR; DE_neo2; EO; FR; FR_bépo; TR; UK; US; US_BR; US_ES; US_SE)</div>Delapouitehttps://wiki.archlinux.org/index.php?title=List_of_applications/Utilities&diff=553467List of applications/Utilities2018-11-06T18:44:51Z<p>Delapouite: add link to kitty page</p>
<hr />
<div><noinclude><br />
[[Category:Applications]]<br />
[[Category:Lists of software]]<br />
[[es:List of applications/Utilities]]<br />
[[it:List of applications/Utilities]]<br />
[[ja:アプリケーション一覧/ユーティリティ]]<br />
[[ru:List of applications/Utilities]]<br />
[[zh-hans:List of applications/Utilities]]<br />
[[zh-hant:List of applications/Utilities]]<br />
{{List of applications navigation}}<br />
</noinclude><br />
== Utilities ==<br />
<br />
=== Terminal ===<br />
<br />
==== Command shells ====<br />
<br />
See the main article: [[Command-line shell]].<br />
<br />
See also [[Wikipedia:Comparison of command shells]].<br />
<br />
==== Terminal emulators ====<br />
<br />
Terminal emulators show a GUI Window that contains a terminal. Most emulate Xterm, which in turn emulates VT102, which emulates typewriter. For further background information, see [[Wikipedia:Terminal emulator]].<br />
<br />
For a comprehensive list, see [[Wikipedia:List of terminal emulators]].<br />
<br />
* {{App|Alacritty|A cross-platform, GPU-accelerated terminal emulator.|https://github.com/jwilm/alacritty|{{Pkg|alacritty}}}}<br />
* {{App|aterm|Xterm replacement with transparency support. It has been deprecated in favour of urxvt since 2008.|http://aterm.sourceforge.net/|{{AUR|aterm}}}}<br />
* {{App|Cool Retro Term|A good looking terminal emulator which mimics the old cathode display.|https://github.com/Swordfish90/cool-retro-term|{{Pkg|cool-retro-term}}}}<br />
* {{App|Eterm|Terminal emulator intended as a replacement for xterm and designed for the [[Enlightenment]] desktop.|http://eterm.org|{{AUR|eterm}}}}<br />
* {{App|Gate One|Web-based terminal emulator and SSH client.|https://github.com/liftoff/GateOne|{{AUR|gateone-git}}}}<br />
* {{App|Hyper|A terminal with JS/CSS support.|https://github.com/zeit/hyper|{{AUR|hyper}}}}<br />
* {{App|[[Wikipedia:Konsole|Konsole]]|Terminal emulator included in the [[KDE]] desktop.|https://www.kde.org/applications/system/konsole/|{{Pkg|konsole}}}}<br />
* {{App|[[kitty]]|A modern, hackable, featureful, OpenGL based terminal emulator|https://github.com/kovidgoyal/kitty|{{Pkg|kitty}}}}<br />
* {{App|mlterm|A multi-lingual terminal emulator supporting various character sets and encodings in the world.|https://sourceforge.net/projects/mlterm/|{{AUR|mlterm}}}}<br />
* {{App|[[PuTTY]]|Highly configurable ssh/telnet/serial console program.|https://www.chiark.greenend.org.uk/~sgtatham/putty/|{{Pkg|putty}}}}<br />
* {{App|QTerminal|Lightweight Qt-based terminal emulator.|https://github.com/qterminal/qterminal|{{Pkg|qterminal}}}}<br />
* {{App|[[Wikipedia:Rxvt|rxvt]]|Popular replacement for the xterm.|http://rxvt.sourceforge.net/|{{AUR|rxvt}}}}<br />
* {{App|shellinabox|A web-based SSH Terminal|https://github.com/shellinabox/shellinabox|{{AUR|shellinabox-git}}}}<br />
* {{App|[[st]]|Simple terminal implementation for X.|http://st.suckless.org|{{AUR|st}}}}<br />
* {{App|Terminology|Terminal emulator by the Enlightenment project team with innovative features: file thumbnails and media play like a media player.|https://www.enlightenment.org/about-terminology|{{Pkg|terminology}}}}<br />
* {{App|[[urxvt]]|Highly extendable (with Perl) unicode enabled rxvt-clone terminal emulator featuring tabbing, url launching, a Quake style drop-down mode and pseudo-transparency.|http://software.schmorp.de/pkg/rxvt-unicode.html|{{Pkg|rxvt-unicode}}}}<br />
* {{App|[[xterm]]|Simple terminal emulator for the X Window System. It provides DEC VT102 and Tektronix 4014 compatible terminals for programs that can't use the window system directly.|http://invisible-island.net/xterm/|{{Pkg|xterm}}}}<br />
* {{App|[[Yakuake]]|Drop-down terminal (Quake style) emulator based on Konsole.|https://yakuake.kde.org/|{{Pkg|yakuake}}}}<br />
<br />
===== VTE-based =====<br />
<br />
[http://developer.gnome.org/vte/unstable/ VTE] (Virtual Terminal Emulator) is a widget developed during early GNOME days for use in the GNOME Terminal. It has since given birth to many terminals with similar capabilities.<br />
<br />
* {{App|Deepin Terminal|Terminal emulation application for Deepin desktop.|https://www.deepin.org/en/original/deepin-terminal/|{{Pkg|deepin-terminal}}}}<br />
* {{App|evilvte|Very lightweight and highly customizable terminal emulator with support for tabs, auto-hiding and different encodings.|http://calno.com/evilvte/|{{AUR|evilvte-git}}}}<br />
* {{App|Germinal|Minimalist terminal emulator which provides a borderless maximized terminal, attached to a tmux session by default, hence providing tabs and panels.|http://www.imagination-land.org/tags/germinal.html|{{AUR|germinal}}}}<br />
* {{App|[[Wikipedia:GNOME Terminal|GNOME Terminal]]|A terminal emulator included in the [[GNOME]] desktop with support for Unicode and pseudo-transparency.|https://wiki.gnome.org/Apps/Terminal|{{Pkg|gnome-terminal}}}}<br />
* {{App|[[Guake]]|Drop-down terminal for the GNOME desktop.|http://guake-project.org/|{{Pkg|guake}}}}<br />
* {{App|LXTerminal|Desktop independent terminal emulator for [[LXDE]].|http://wiki.lxde.org/en/LXTerminal|{{Pkg|lxterminal}}}}<br />
* {{App|MATE terminal|A fork of [[Wikipedia:GNOME terminal]] for the [[MATE]] desktop.|http://www.mate-desktop.org/|{{Pkg|mate-terminal}}}}<br />
* {{App|Pantheon Terminal|A super lightweight, beautiful, and simple terminal emulator. It's designed to be setup with sane defaults and little to no configuration.|https://github.com/elementary/terminal|{{Pkg|pantheon-terminal}}}}<br />
* {{App|ROXTerm|Tabbed terminal emulator with a small footprint.|http://roxterm.sourceforge.net/|{{AUR|roxterm}}}}<br />
* {{App|sakura|Terminal emulator based on GTK+ and VTE.|http://www.pleyades.net/david/projects/sakura|{{Pkg|sakura}}}}<br />
* {{App|[[Terminator]]|Terminal emulator supporting multiple resizable terminal panels.|https://gnometerminator.blogspot.com/|{{Pkg|terminator}}}}<br />
* {{App|[[Termite]]|Keyboard-centric VTE-based terminal, aimed at use within a window manager with tiling and/or tabbing support.|https://github.com/thestinger/termite|{{Pkg|termite}}}}<br />
* {{App|[[Tilda]]|Configurable drop down terminal emulator.|https://github.com/lanoxx/tilda/|{{Pkg|tilda}}}}<br />
* {{App|Tilix|Tiling terminal emulator for GNOME.|https://gnunn1.github.io/tilix-web/|{{Pkg|tilix}}}}<br />
* {{App|tinyterm|Very lightweight terminal emulator based on VTE.|https://github.com/lahwaacz/tinyterm|{{AUR|tinyterm-git}}}}<br />
* {{App|[[Wikipedia:Terminal (Xfce)|Xfce Terminal]]|Terminal emulator included in the [[Xfce]] desktop with support for a colorized prompt and a tabbed interface.|https://docs.xfce.org/apps/terminal/start|{{Pkg|xfce4-terminal}}}}<br />
<br />
===== KMS-based =====<br />
<br />
The following terminal emulators are based on the [[kernel mode setting]] that could be invoked without X.<br />
* {{App|[[KMSCON]]|A KMS/DRM-based system console(getty) with an integrated terminal emulator for Linux operating systems.|https://github.com/dvdhrm/kmscon|{{Pkg|kmscon}}}}<br />
<br />
===== framebuffer-based =====<br />
<br />
In GNU/Linux world, the [[Wikipedia:Framebuffer|framebuffer]] could be refered to a virtual device in the Linux kernel ('''fbdev''') or the virtual framebuffer system for X ('''xvfb'''). This section mainly lists the terminal emulators that based on the in-kernel virtual device, i.e. '''fbdev'''.<br />
<br />
* {{App|yaft|A simple terminal emulator for living without X, with UCS2 glyphs, wallpaper and 256color support.|https://github.com/uobikiemukot/yaft|{{aur|yaft}}}}<br />
<br />
==== Terminal pagers ====<br />
<br />
See also [[Wikipedia:Terminal pager]].<br />
<br />
* {{App|[[Wikipedia:More_(command)|more]]|A simple and feature-light pager. It is a part of util-linux.|https://git.kernel.org/pub/scm/utils/util-linux/util-linux.git/about/|{{Pkg|util-linux}}}}<br />
* {{App|[[Core_utilities#Essentials|less]]|A program similar to more, but with support for both forward and backward scrolling, as well as partial loading of files.|https://www.gnu.org/software/less/|{{Pkg|less}}}}<br />
* {{App|[[Wikipedia:Most_(Unix)|most]]|A pager with support for multiple windows, left and right scrolling, and built-in colour support|http://www.jedsoft.org/most/|{{Pkg|most}}}}<br />
* {{App|mcview|A pager with mouse and colour support. It is bundled with midnight commander.|http://midnight-commander.org/|{{Pkg|mc}}}}<br />
* [[Vim]] can [[Vim#Vim as a pager|also be used as a pager]].<br />
<br />
==== Terminal multiplexers ====<br />
<br />
See also [[Wikipedia:Terminal multiplexer]].<br />
<br />
* {{App|abduco|Tool for session attach and detach support which allows a process to run independently from its controlling terminal.|http://www.brain-dump.org/projects/abduco/|{{Pkg|abduco}}}}<br />
* {{App|[[Wikipedia:Byobu (software)|byobu]]|An GPLv3 licensed addon for tmux or screen. It requires a terminal multiplexer installed.|http://byobu.co/|{{AUR|byobu}}}}<br />
* {{App|[[dtach]]|Program that emulates the detach feature of [[GNU Screen]].|http://dtach.sourceforge.net/|{{Pkg|dtach}}}}<br />
* {{App|dvtm|[[dwm]]-style window manager in the console.|http://brain-dump.org/projects/dvtm/|{{Pkg|dvtm}}}}<br />
* {{App|[[GNU Screen]]|Full-screen window manager that multiplexes a physical terminal.|https://www.gnu.org/software/screen/|{{Pkg|screen}}}}<br />
* {{App|mtm|Simple terminal multiplexer with just four commands: change focus, split, close, and screen redraw.|https://github.com/deadpixi/mtm|{{AUR|mtm-git}}}}<br />
* {{App|[[tmux]]|BSD licensed terminal multiplexer.|http://tmux.github.io/|{{Pkg|tmux}}}}<br />
<br />
=== Files ===<br />
<br />
==== File managers ====<br />
<br />
See also [[Wikipedia:Comparison of file managers]].<br />
<br />
===== Console =====<br />
<br />
* {{App|Clex|File manager with full-screen user interface|http://www.clex.sk/|{{Aur|clex}}}}<br />
* {{App|[[Wikipedia:Dired|Dired]]|Directory editor integrated with [[Emacs]].|https://www.gnu.org/software/emacs/manual/html_node/emacs/Dired.html|{{pkg|emacs}}}}<br />
* {{app|dired|Ancient DIRectory EDitor since 1980.|http://fossies.org/linux/misc/old/|{{aur|dired}}{{Broken package link|package not found}}}}<br />
* {{App|Last File Manager|Powerful file manager written in Python 3 with a curses interface.|https://inigo.katxi.org/devel/lfm/|{{AUR|lfm3-hg}}}}<br />
* {{App|lf|Terminal file manager written in Go using server/client architecture.|https://github.com/gokcehan/lf|{{aur|lf-git}}}}<br />
* {{App|[[Midnight Commander]]|Console-based, dual-paneled file manager.|http://www.midnight-commander.org|{{Pkg|mc}}}}<br />
* {{App|nffm|"Nothing Fancy File Manager", a mouseless ncurses file manager written in C.|https://github.com/mariostg/nffm|{{AUR|nffm-git}}}}<br />
* {{App|Pilot|File manager that comes with the [[Alpine]] email client.|https://www.washington.edu/alpine/|{{AUR|alpine}}}}<br />
* {{App|[[Ranger]]|Console-based file manager with vi bindings, customizability, and lots of features.|https://ranger.github.io/|{{Pkg|ranger}}}}<br />
* {{App|[[Vifm]]|Ncurses-based two-panel file manager with vi-like keybindings.|http://vifm.info|{{Pkg|vifm}}}}<br />
<br />
===== Graphical =====<br />
<br />
* {{App|Caja|The file manager for the MATE desktop.|https://github.com/mate-desktop/caja|{{Pkg|caja}}}}<br />
* {{App|Deepin File Manager|File manager developed for [[Deepin]].|https://www.deepin.org/en/original/dde-file-manager/|{{Pkg|deepin-file-manager}}}}<br />
* {{App|[[Dolphin]]|File manager included in the KDE desktop.|https://userbase.kde.org/Dolphin|{{Pkg|dolphin}}}}<br />
* {{App|Gentoo|A lightweight file manager for GTK.|https://sourceforge.net/projects/gentoo/|{{AUR|gentoo}}}}<br />
* {{App|[[GNOME Files]]|Extensible, heavyweight file manager used by default in GNOME with support for custom scripts.|https://wiki.gnome.org/Apps/Files|{{Pkg|nautilus}}}}<br />
* {{App|[[Wikipedia:Konqueror|Konqueror]]|File manager and web browser for the KDE desktop.|http://www.konqueror.org/|{{Pkg|konqueror}}}}<br />
* {{App|Liri Files|The file manager for Liri.|https://github.com/lirios/files|{{Pkg|liri-files}}}}<br />
* {{App|[[Nemo]]|Nemo is the file manager of the Cinnamon desktop. A fork of Nautilus.|http://cinnamon.linuxmint.com/|{{Pkg|nemo}}}}<br />
* {{App|Pantheon Files|File browser designed for elementary OS.|https://github.com/elementary/files|{{Pkg|pantheon-files}}}}<br />
* {{App|[[Wikipedia:Fox_toolkit|PathFinder]]|File browser that comes with the FOX toolkit.|http://fox-toolkit.org/|{{Pkg|fox}}}}<br />
* {{App|[[PCManFM]]|Very fast and lightweight file manager which can also optionally manage the desktop icons and background.|http://wiki.lxde.org/en/PCManFM|{{Pkg|pcmanfm}}}}<br />
* {{App|qtFM|Small, lightweight filemanager for Linux desktops based on pure Qt.|http://www.qtfm.org/|{{AUR|qtfm}}}}<br />
* {{App|ROX|Small and fast file manager which can optionally manage the desktop background and panels.|http://rox.sourceforge.net|{{Pkg|rox}}}}<br />
* {{App|[[Thunar]]|File manager that can be run as a daemon with excellent start up and directory load times.|http://docs.xfce.org/xfce/thunar/start|{{Pkg|thunar}}}}<br />
<br />
====== Twin-panel ======<br />
<br />
Note that some of these twin-panel file managers can also be set to have only one pane.<br />
<br />
* {{App|Double Commander|File manager with two panels side by side. It is inspired by Total Commander and features some new ideas.|http://doublecmd.sourceforge.net//|GTK+: {{Pkg|doublecmd-gtk2}}, Qt5: {{Pkg|doublecmd-qt5}}}}<br />
* {{App|[[Wikipedia:emelFM2|emelFM2]]|File manager that implements the popular two-panel design.|http://emelfm2.net/|{{Pkg|emelfm2}}}}<br />
* {{App|[[Wikipedia:GNOME Commander|GNOME Commander]]|A dual-paned file manager for the GNOME Desktop.|http://gcmd.github.io/|{{AUR|gnome-commander}}}}<br />
* {{App|[[Wikipedia:Krusader|Krusader]]|Advanced twin panel (Midnight Commander style) file manager for the KDE desktop.|http://www.krusader.org/|{{Pkg|krusader}}}}<br />
* {{App|muCommander|A lightweight, cross-platform file manager with a dual-pane interface written in Java.|http://www.mucommander.com/|{{AUR|mucommander}}}}<br />
* {{App|[[SpaceFM]]|GTK+ multi-panel tabbed file manager.|http://ignorantguru.github.com/spacefm/|{{AUR|spacefm}}}}<br />
* {{App|Sunflower|Small and highly customizable twin-panel file manager for Linux with support for plugins.|http://sunflower-fm.org/|{{AUR|sunflower}}}}<br />
* {{App|trolCommander|Lightweight, dual-pane file manager written in Java. Fork of muCommander.|https://github.com/trol73/mucommander|{{AUR|trolcommander}}}}<br />
* {{App|Tux Commander|Windowed file manager with two panels side by side similar to popular Total Commander or Midnight Commander file managers.|http://tuxcmd.sourceforge.net/description.php|{{Pkg|tuxcmd}}}}<br />
* {{App|Worker|Fast, lightweight and feature-rich file manager for the X Window System.|http://www.boomerangsworld.de/worker/|{{AUR|worker}}}}<br />
* {{App|[[Wikipedia:Xfe|Xfe]]|Microsoft Explorer-like file manager for X (X File Explorer).|http://roland65.free.fr/xfe/|{{AUR|xfe}}}}<br />
<br />
==== Trash management ====<br />
<br />
* {{App|trash-cli|A command-line interface implementing FreeDesktop.org's Trash specification.|https://github.com/andreafrancia/trash-cli|{{Pkg|trash-cli}}}}<br />
<br />
==== File synchronization ====<br />
<br />
{{Merge|Synchronization and backup programs#Data synchronization|There's a dedicated article.}}<br />
<br />
See also [[Synchronization and backup programs#Data synchronization]] and [[Wikipedia:Comparison of file synchronization software]].<br />
<br />
* {{App|[[Wikipedia:FreeFileSync|FreeFileSync]]|Folder comparison and synchronization software that creates and manages backup copies of all your important files.|https://www.freefilesync.org/|{{AUR|freefilesync}}}}<br />
* {{App|[[Wikipedia:git-annex|git-annex]]|Manage files with git, without checking the file contents into git.|https://git-annex.branchable.com/|{{Pkg|git-annex}}}}<br />
* {{App|hsync|Command line program to sync only those files that have been renamed/moved but otherwise unchanged. It works by issuing simple move operations at the destination without actually transferring the files, and is meant to be used in conjunction with other synchronization programs that lack this capability.|https://ambrevar.bitbucket.io/hsync/|{{AUR|hsync}}}}<br />
* {{App|rclone|Command line program to sync files and directories to and from Amazon S3, Dropbox, Google Drive, Microsoft OneDrive, Yandex Disk and many other cloud storage services as well as between local paths.|https://rclone.org/|{{Pkg|rclone}}}}<br />
* {{App|[[rsync]]|File transfer program that uses the "rsync algorithm" which provides a very fast method for bringing remote files into sync. It does this by sending just the differences in the files across the link, without requiring that both sets of files are present at one of the ends of the link beforehand.|https://rsync.samba.org/|{{Pkg|rsync}}}}<br />
* {{App|[[Wikipedia:SparkleShare|SparkleShare]]|File sharing and collaboration application written in C#. It can sync with any Git server over SSH.|http://sparkleshare.org/|{{Pkg|sparkleshare}}}}<br />
* {{App|[[Syncthing]]|Continuous file synchronization program. It synchronizes files between two or more computers in a simple way without advanced configuration.|https://syncthing.net/|Web: {{Pkg|syncthing}}, GTK+: {{Pkg|syncthing-gtk}}}}<br />
* {{App|Syncany|Cloud storage and filesharing application with a focus on security and abstraction of storage.|https://www.syncany.org/|{{AUR|syncany}}}}<br />
* {{App|[[Wikipedia:Synkron|Synkron]]|Application that helps you keep your files and folders always updated. You can easily sync your documents, music or pictures to have their latest versions everywhere.|http://synkron.sourceforge.net/|{{AUR|synkron}}}}<br />
* {{App|[[Unison]]|File synchronization tool that allows two replicas of a collection of files and directories to be stored on different hosts (or different disks on the same host), modified separately, and then brought up to date by propagating the changes in each replica to the other.|https://www.cis.upenn.edu/~bcpierce/unison/|{{Pkg|unison}}}}<br />
<br />
==== Archiving and compression tools ====<br />
<br />
For archiving and compression command-line tools, see [[Archiving and compression]].<br />
<br />
===== Archive managers =====<br />
<br />
* {{App|[[Wikipedia:Ark (software)|Ark]]|Archiving tool included in the KDE desktop.|https://www.kde.org/applications/utilities/ark/|{{Pkg|ark}}}}<br />
* {{App|Engrampa|Archive manager for [[MATE]]|https://github.com/mate-desktop/engrampa|{{Pkg|engrampa}}}}<br />
* {{App|[[Wikipedia:File Roller|File Roller]]|Archive manager included in the GNOME desktop.|http://fileroller.sourceforge.net/|{{Pkg|file-roller}}}}<br />
* {{App|p7zip-gui|The GUI belonging to the p7zip software.|http://p7zip.sourceforge.net/|{{AUR|p7zip-gui}}}}<br />
* {{App|[[Wikipedia:PeaZip|PeaZip]]|Open source file and archive manager.|http://www.peazip.org/peazip-linux.html|GTK+: {{AUR|peazip-gtk2}}, Qt: {{AUR|peazip-qt}}}}<br />
* {{App|Squeeze|Featherweight front-end for commandline archiving tools.|http://squeeze.xfce.org/|{{AUR|squeeze-git}}}}<br />
* {{App|[[Wikipedia:Xarchiver|Xarchiver]]|Lightweight desktop independent archive manager built with GTK+.|https://github.com/ib/xarchiver|GTK+ 3: {{Pkg|xarchiver}}, GTK+ 2: {{Pkg|xarchiver-gtk2}}}}<br />
<br />
==== Comparison, diff, merge ====<br />
<br />
See also [[Wikipedia:Comparison of file comparison tools]].<br />
<br />
For managing ''pacnew''/''pacsave'' files, specialised tools exist. See [[Pacnew and Pacsave files#Managing .pacnew files]].<br />
<br />
* {{App|colordiff|A Perl script wrapper for 'diff' that produces the same output but with pretty 'syntax' highlighting.|http://www.colordiff.org/|{{Pkg|colordiff}}}}<br />
* {{App|Diffuse|Small and simple text merge tool written in Python.|http://diffuse.sourceforge.net/|{{Pkg|diffuse}}}}<br />
* {{App|KDiff3|File and directory diff and merge tool for the KDE desktop.|http://kdiff3.sourceforge.net/|{{Pkg|kdiff3}}}}<br />
* {{App|[[Wikipedia:Kompare|Kompare]]|GUI front-end program for viewing and merging differences between source files. It supports a variety of diff formats and provides many options to customize the information level displayed.|https://www.kde.org/applications/development/kompare/|{{Pkg|kompare}}}}<br />
* {{App|[[Wikipedia:Meld (software)|Meld]]|Visual diff and merge tool that can compare files, directories, and version controlled projects.|http://meldmerge.org/|{{Pkg|meld}}}}<br />
* {{App|xxdiff|A graphical browser for file and directory differences.|http://furius.ca/xxdiff/|{{AUR|xxdiff}}}}<br />
<br />
[[Vim]] and [[Emacs]] provide merge functionality with [[Vim#Merging_files|vimdiff]] and {{ic|ediff}}.<br />
<br />
==== Batch renamers ====<br />
<br />
* {{App|[[Wikipedia:GPRename|GPRename]]|GTK+ batch renamer for files and directories.|http://gprename.sourceforge.net|{{Pkg|gprename}}}}<br />
* {{App|[[Wikipedia:KRename|KRename]]|Very powerful batch file renamer for the KDE desktop.|http://www.krename.net|{{Pkg|krename}}}}<br />
* {{App|metamorphose2|wxPython based batch renamer with support for regular expressions, renaming multimedia files according to their metadata, etc.|http://file-folder-ren.sourceforge.net|{{AUR|metamorphose2}}}}<br />
* {{App|pyRenamer|Application for the mass renaming of files.|https://github.com/SteveRyherd/pyRenamer|{{AUR|pyrenamer}}}}<br />
* {{App|rename.pl|Batch renamer based on perl regex.|http://search.cpan.org/~pederst/rename/bin/rename.PL|{{Pkg|perl-rename}}}}<br />
* {{App|[[Thunar]] Bulk Rename|Change the name of multiple files at once using some criterion that applies to at least one of the files. Run with {{ic|thunar -B}}.|https://docs.xfce.org/xfce/thunar/bulk-renamer/start|{{Pkg|thunar}}}}<br />
<br />
==== File searching ====<br />
<br />
This section lists utilities for file searching based on filename, file path or metadata. For full-text searching, see the next section.<br />
<br />
See also [[Wikipedia:List of search engines#Desktop search engines]].<br />
<br />
===== Console =====<br />
<br />
See [[find]] and its alternatives.<br />
<br />
===== Graphical =====<br />
<br />
* {{App|Catfish|Versatile file searching tool by Xfce, can be powered by find, locate and Zeitgeist.|https://launchpad.net/catfish-search|{{Pkg|catfish}}}}<br />
* {{App|GNOME Search Tool|GNOME utility to search for files, depends on [[GNOME/Files]].|https://gitlab.gnome.org/GNOME/gnome-search-tool|{{Pkg|gnome-search-tool}}}}<br />
* {{App|KFind|Search tool for KDE to find files by name, type or content. Has internal search and supports locate.|https://www.kde.org/applications/utilities/kfind/|{{Pkg|kfind}}}}<br />
* {{App|MATE Search Tool|MATE utility to search for files.|https://github.com/mate-desktop/mate-utils|{{Pkg|mate-utils}}}}<br />
* {{App|regexxer|Interactive search and replace tool featuring Perl-style regular expressions.|http://regexxer.sourceforge.net/|{{Pkg|regexxer}}}}<br />
* {{App|Searchmonkey|Powerful GUI search utility for matching regex patterns.|http://searchmonkey.sourceforge.net/|{{AUR|searchmonkey}}}}<br />
<br />
====== File indexers ======<br />
<br />
These programs index your files to allow for quick searching.<br />
<br />
* {{App|Basenji|Volume indexing tool designed for easy and fast indexing of CD/DVD and other type of volume collections.|https://github.com/pulb/basenji|{{AUR|basenji}}}}<br />
* {{App|fsearch|A fast file search utility for Unix-like systems based on GTK+3.|https://github.com/cboxdoerfer/fsearch|{{AUR|fsearch-git}}}}<br />
<br />
==== Full-text searching ====<br />
<br />
[[Grep]] and its alternatives provide non-indexed [[Wikipedia:Full-text search|full-text search]].<br />
<br />
===== Full-text indexers =====<br />
<br />
* {{App|[[Baloo]]|KDE's file indexing and search solution, has a CLI and is used by [[KRunner]].|https://community.kde.org/Baloo|{{Pkg|baloo}}}}<br />
* {{App|[[Wikipedia:DocFetcher|DocFetcher]]|Graphical Java desktop search application.|http://docfetcher.sourceforge.net|{{AUR|docfetcher}}}}<br />
* {{App|[[Wikipedia:Recoll|Recoll]]|Full text search tool based on Xapian, has CLI and GUI.|https://lesbonscomptes.com/recoll/|{{Pkg|recoll}}}}<br />
* {{App|[[Wikipedia:Tracker (search software)|Tracker]]|All-in-one indexer, search tool and metadata database, used by [[GNOME]] Documents, Music, Photos and Videos.|https://wiki.gnome.org/Projects/Tracker|{{Pkg|tracker}}}}<br />
* {{App|[[Zeitgeist]]|Event aggregation framework for the user's activities and notifications (files opened, websites visited, conversations had, etc.), has several third-party front-ends.|https://launchpad.net/zeitgeist-project|{{Pkg|zeitgeist}}}}<br />
<br />
=== Development ===<br />
<br />
==== Version control systems ====<br />
<br />
See also [[Wikipedia:Comparison of revision control software]].<br />
<br />
* {{App|[[Bazaar]]|Distributed version control system that helps you track project history over time and to collaborate easily with others.|https://bazaar.canonical.com/|{{Pkg|bzr}}}}<br />
* {{App|[[CVS]]|Concurrent Versions System, a client-server revision control system.|http://cvs.nongnu.org/|{{Pkg|cvs}}}}<br />
* {{App|[[Wikipedia:Darcs|Darcs]]|Distributed revision control system that was designed to replace traditional, centralized source control systems such as CVS and Subversion.|http://darcs.net/|{{Pkg|darcs}}}}<br />
* {{App|[[Wikipedia:Fossil (software)|Fossil]]|Distributed VCS with bug tracking, wiki, forum, and technotes.|https://www.fossil-scm.org/|{{Pkg|fossil}}}}<br />
* {{App|[[Git]]|Distributed revision control and source code management system with an emphasis on speed.|https://git-scm.com/|{{Pkg|git}}}}<br />
* {{App|[[Mercurial]]|Distributed version control system written in Python and similar in many ways to Git.|https://www.mercurial-scm.org/|{{Pkg|mercurial}}}}<br />
* {{App|[[Subversion]]|Full-featured centralized version control system originally designed to be a better CVS.|https://subversion.apache.org/|{{Pkg|subversion}}}}<br />
<br />
==== Build automation ====<br />
<br />
See also [[Wikipedia:List of build automation software]].<br />
<br />
* {{App|[[Wikipedia:Apache Ant|Apache Ant]]|Java library and command-line tool whose mission is to drive processes described in build files as targets and extension points dependent upon each other.|http://ant.apache.org/|{{Pkg|ant}}}}<br />
* {{App|[[Wikipedia:Apache Maven|Apache Maven]]|Build automation tool used primarily for Java.|http://maven.apache.org/|{{Pkg|maven}}}}<br />
* {{App|[[Wikipedia:CMake|CMake]]|Family of tools designed to build, test and package software.|https://cmake.org/|{{Pkg|cmake}}}}<br />
* {{App|[[Wikipedia:Make (software)|GNU make]]|GNU make utility to maintain groups of programs.|http://www.gnu.org/software/make|{{Pkg|make}} (part of {{Grp|base-devel}})}}<br />
* {{App|[[Wikipedia:Gradle|Gradle]]|Powerful build system for the JVM.|https://gradle.org/|{{Pkg|gradle}}}}<br />
* {{App|Phing|PHP program designed to automate tasks of all kinds.|https://www.phing.info/|{{AUR|phing}}}}<br />
<br />
==== Integrated development environments ====<br />
<br />
See also [[Wikipedia:Comparison of integrated development environments]].<br />
<br />
* {{App|[[Wikipedia:Anjuta|Anjuta]]|Versatile IDE with project management, an application wizard, an interactive debugger, a source editor, version control support and many more tools.|http://anjuta.org/|{{Pkg|anjuta}}}}<br />
* {{App|[[Wikipedia:Aptana#Aptana_Studio|Aptana Studio]]|IDE based on Eclipse, but geared towards web development, with support for HTML, CSS, Javascript, Ruby on Rails, PHP, Adobe AIR and others.|http://www.aptana.com/|{{AUR|aptana-studio}}}}<br />
* {{App|[[Wikipedia:Bluefish (software)|Bluefish]]|Powerful editor targeted towards programmers and webdevelopers, with many options to write websites, scripts and programming code. It supports many programming and markup languages.|http://bluefish.openoffice.nl/|{{Pkg|bluefish}}}}<br />
* {{App|[[Wikipedia:Code::Blocks|Code::Blocks]]|C, C++ and Fortran IDE built to meet the most demanding needs of its users. It is designed to be very extensible and fully configurable.|http://codeblocks.org/|{{Pkg|codeblocks}}}}<br />
* {{App|[[Wikipedia:JetBrains#CLion|CLion]]|A cross-platform IDE for C and C++.|http://www.jetbrains.com/clion|{{AUR|clion}}}}<br />
* {{App|[[Wikipedia:CodeLite|CodeLite]]|Open source and cross-platform C/C++/PHP and Node.js IDE written in C++ .|http://www.codelite.org/|{{AUR|codelite}}}}<br />
* {{App|[[Wikipedia:Cloud9 IDE|Cloud9]]|State-of-the-art IDE that runs in your browser and lives in the cloud, allowing you to run, debug and deploy applications from anywhere, anytime.|https://c9.io/|{{AUR|c9.core}}}}<br />
* {{App|[[Eclipse]]|IDE for Java, C/C++, PHP, Perl and Python with subversion support and task management.|https://www.eclipse.org/|Java EE: {{Pkg|eclipse-jee}}, Java: {{Pkg|eclipse-java}}, C/C++: {{Pkg|eclipse-cpp}}, PHP: {{Pkg|eclipse-php}}, JavaScript and Web: {{Pkg|eclipse-javascript}}}}<br />
* {{App|[[Wikipedia:Eric (software)|Eric]]|Full-featured Python and Ruby IDE written in PyQt5.|https://eric-ide.python-projects.org/|{{Pkg|eric}}}}<br />
* {{App|[[Gambas]]|IDE based on a Basic interpreter with object extensions.|http://gambas.sourceforge.net/en/main.html|{{Pkg|gambas3-ide}}}}<br />
* {{App|[[Wikipedia:Geany|Geany]]|Small and lightweight IDE with many supported many programming and markup languages including C, Java, PHP, HTML, Python, Perl, Pascal.|https://geany.org/|{{Pkg|geany}}}}<br />
* {{App|[[Wikipedia:GNOME Builder|GNOME Builder]]|Tool to write and contribute to great GNOME-based applications.|https://wiki.gnome.org/Apps/Builder|{{Pkg|gnome-builder}}}}<br />
* {{App|[[Wikipedia:KDevelop|KDevelop]]|Feature-full, plugin extensible IDE for C/C++ and other programming languages.|https://www.kdevelop.org/|{{Pkg|kdevelop}}}}<br />
* {{App|[[Wikipedia:Komodo_Edit|Komodo Edit]]|A free, multi-language editor.|http://www.activestate.com/komodo-edit|{{AUR|komodo-edit}}}}<br />
* {{App|[[Wikipedia:Lazarus (IDE)|Lazarus]]|Delphi (Object Pascal) compatible IDE for Rapid Application Development. It has variety of components ready for use and a graphical form designer to easily create complex graphical user interfaces.|https://www.lazarus-ide.org/|{{Pkg|lazarus}}}}<br />
* {{App|LiteIDE|Simple Go IDE.|https://github.com/visualfc/liteide|{{Pkg|liteide}}}}<br />
* {{App|[[Wikipedia:MonoDevelop|MonoDevelop]]|Cross-platform IDE targeted for the Mono and .NET frameworks.|http://monodevelop.com/|{{AUR|monodevelop-git}}}}<br />
* {{App|[[Wikipedia:MPLAB|MPLAB]]|IDE for Microchip PIC and dsPIC development.|http://www.microchip.com/mplabx|{{AUR|microchip-mplabx-bin}}}}<br />
* {{App|[[Netbeans]]|IDE for developing with Java, JavaScript, PHP, Python, Ruby, Groovy, C, C++, Scala, Clojure, and other languages.|https://netbeans.org/|{{Pkg|netbeans}}}}<br />
* {{App|[[PHPStorm]]|JetBrains PhpStorm is a commercial, cross-platform IDE for PHP built on JetBrains' IntelliJ IDEA platform, providing an editor for PHP, HTML and JavaScript with on-the-fly code analysis, error prevention and automated refactorings for PHP and JavaScript code.|https://www.jetbrains.com/phpstorm/|{{Aur|phpstorm}} {{Aur|phpstorm-eap}}}}<br />
* {{App|[[Wikipedia:Qt Creator|Qt Creator]]|Lightweight, cross-platform C++ integrated development environment with a focus on Qt.|https://www.qt.io/ide/|{{Pkg|qtcreator}}}}<br />
<br />
===== Java IDEs =====<br />
<br />
* {{App|[[Wikipedia:Bluej|Bluej]]|Fully featured Java IDE used mainly for educational and beginner purposes.|https://bluej.org/|{{AUR|bluej}}}}<br />
* {{App|[[Wikipedia:IntelliJ IDEA|IntelliJ IDEA]]|IDE for Java, Groovy and other programming languages with advanced refactoring features.|http://www.jetbrains.com/idea/|{{Pkg|intellij-idea-community-edition}}}}<br />
<br />
===== Python IDEs =====<br />
<br />
* {{App|[[Wikipedia:Ninja-IDE|Ninja-IDE]]|IDE for Python development.|http://ninja-ide.org/|{{AUR|ninja-ide}}}}<br />
* {{App|[[Wikipedia:PyCharm|PyCharm]]|Python IDE with support for code analysis, debugging, unit testing, version control and web development with Django.|http://www.jetbrains.com/pycharm/|{{Pkg|pycharm-community-edition}}}}<br />
* {{App|[[Wikipedia:Spyder (software)|Spyder]]|Scientific Python Development Environment providing MATLAB-like features.|https://github.com/spyder-ide/spyder|{{Pkg|spyder2}} (Python 2) or {{Pkg|spyder3}} (Python 3)}}<br />
* {{App|[[Wikipedia:Thonny|Thonny]]|Python IDE for beginners.|http://thonny.org/|{{AUR|thonny}}}}<br />
* {{App|[[Wikipedia:Wing IDE|WingIDE]]|Proprietary Python development environment. It is fully featured and meant for professional use.|http://www.wingware.com|{{Aur|wingide}}}}<br />
<br />
===== Educational IDEs =====<br />
<br />
* {{App|[[Wikipedia:Etoys (programming language)|Etoys]]|Educational tool and media-rich authoring environment for teaching children.|http://squeakland.org/|{{AUR|etoys}}}}<br />
* {{App|[[Wikipedia:KTurtle|KTurtle]]|Educational programming environment that aims to make learning how to program as easily as possible. Part of {{Grp|kdeedu}}.|https://www.kde.org/applications/education/kturtle/|{{Pkg|kturtle}}}}<br />
* {{App|[[Wikipedia:Processing (programming language)|Processing]]|Playground for teaching non-programmers the fundamentals of computer programming in a visual context.|https://processing.org/|{{Pkg|processing}}}}<br />
* {{App|[[Wikipedia:Scratch (programming language)|Scratch]]|Programming system and content development tool for educational and entertainment purposes, such as creating interactive projects and simple sprite-based games. It is used primarly by unskilled users (such as children) as an entry to [[Wikipedia:Event-driven_programming|event-driven programming]].|https://scratch.mit.edu/|{{Pkg|scratch}}}}<br />
<br />
==== Debuggers ====<br />
<br />
* {{App|Accerciser|Interactive Python accessibility explorer. It uses the AT-SPI library to inspect, examine, and interact with widgets, allowing you to check if an application is providing correct information to assistive technologies and automated testing frameworks.|https://wiki.gnome.org/Apps/Accerciser|{{Pkg|accerciser}}}}<br />
* {{App|Alleyoop|Find memory-management problems in your programs using the valgrind tool.|http://alleyoop.sourceforge.net/|{{Pkg|alleyoop}}}}<br />
* {{App|Bustle|Draws sequence diagrams of D-Bus activity. It shows signal emissions, method calls and their corresponding returns, with time stamps for each individual event and the duration of each method call.|https://www.freedesktop.org/wiki/Software/Bustle/|{{AUR|bustle-git}}}}<br />
* {{App|[[Wikipedia:Data Display Debugger|Data Display Debugger]]|Graphical front-end for command-line debuggers such as GDB.|https://www.gnu.org/software/ddd/|{{AUR|ddd}}}}<br />
* {{App|D-Feet|Easy to use D-Bus debugger to inspect D-Bus interfaces of running programs and invoke methods on those interfaces.|https://wiki.gnome.org/Apps/DFeet|{{Pkg|d-feet}}}}<br />
* {{App|GammaRay|Qt-application inspection and manipulation tool.|https://www.kdab.com/development-resources/qt-tools/gammaray/|{{Pkg|gammaray}}}}<br />
* {{App|KCachegrind|Profile data visualization tool, used to determine the most time consuming execution parts of program.|https://www.kde.org/applications/development/kcachegrind/|KDE: {{Pkg|kcachegrind}}, Qt: {{Pkg|qcachegrind}}}}<br />
* {{App|[[Wikipedia:KDbg|KDbg]]|Graphical user interface to GDB, the GNU debugger. It provides an intuitive interface for setting breakpoints, inspecting variables, and stepping through code.|http://kdbg.org/|{{Pkg|kdbg}}}}<br />
* {{App|Massif-Visualizer|Visualizer for Valgrind Massif data files.|https://phabricator.kde.org/source/massif-visualizer/|{{Pkg|massif-visualizer}}}}<br />
* {{App|[[Wikipedia:Nemiver|Nemiver]]|Easy to use standalone C/C++ debugger (GDB front-end) that integrates well in the GNOME environment.|https://wiki.gnome.org/Apps/Nemiver|{{Pkg|nemiver}}}}<br />
* {{App|Qt QDbusViewer|Tool to introspect D-Bus objects and messages.|http://doc.qt.io/qt-5/qdbusviewer.html|{{Pkg|qt5-tools}}}}<br />
* {{App|scanmem|Debugging utility designed to isolate the address of an arbitrary variable in an executing process.|https://github.com/scanmem/scanmem|CLI: {{Pkg|scanmem}}, GUI: {{Pkg|gameconqueror}}}}<br />
* {{App|Sysprof|Profiling tool that helps in finding the functions in which a program uses most of its time.|https://wiki.gnome.org/Apps/Sysprof|{{Pkg|sysprof}}}}<br />
<br />
==== Lexing and parsing ====<br />
<br />
[[Wikipedia:Lex (software)|Lex]] and [[Wikipedia:Yacc|Yacc]] are part of POSIX.<br />
<br />
* {{App|[[Wikipedia:Flex (lexical analyser generator)|flex]]|A tool for generating text-scanning programs, alternative to Lex.|https://github.com/westes/flex|{{Pkg|flex}}}}<br />
* {{App|[[Wikipedia:Berkeley Yacc|Berkeley Yacc]]|Berkeley reimplementation of the Unix parser generator Yacc.|https://invisible-island.net/byacc/|{{Pkg|byacc}}}}<br />
* {{App|[[Wikipedia:GNU bison|GNU Bison]]|The GNU general-purpose parser generator, alternative to ''byacc''.|https://www.gnu.org/software/bison/|{{Pkg|bison}}}}<br />
<br />
And then there are also:<br />
<br />
* {{App|[[Wikipedia:ANTLR|ANTLR]]|Parser generator, written in Java, for parsing structured text or binary files.|http://www.antlr.org/|{{Pkg|antlr4}}}}<br />
* {{App|LPeg|Pattern-matching library, based on PEGs, for Lua.|http://www.inf.puc-rio.br/~roberto/lpeg/|{{Pkg|lua-lpeg}}, {{Pkg|lua52-lpeg}}, {{Pkg|lua51-lpeg}}}}<br />
* {{App|peg/leg|Recursive-descent parser generators for C.|http://piumarta.com/software/peg/|{{Pkg|peg}}}}<br />
* {{App|Ragel|Compiles finite state machines from regular languages into executable C, C++, Objective-C, or D code.|http://www.colm.net/open-source/ragel/|{{Pkg|ragel}}}}<br />
<br />
==== GUI builders ====<br />
<br />
* {{App|[[Wikipedia:FLUID|FLUID]]|FLTK GUI designer.|http://www.fltk.org/|{{Pkg|fltk}}}}<br />
* {{App|[[Wikipedia:Glade Interface Designer|Glade]]|Create or open user interface designs for GTK+ applications.|https://glade.gnome.org/|{{Pkg|glade}}}}<br />
* {{App|KUIViewer|Quick viewer for Qt Designer UI File.|https://userbase.kde.org/KUIViewer|{{Pkg|kde-dev-utils}}}}<br />
* {{App|Qt Designer|Tool for designing and building graphical user interfaces (GUIs) with Qt Widgets.|http://doc.qt.io/qt-5/qtdesigner-manual.html|{{Pkg|qt5-tools}}}}<br />
<br />
==== Hex editors ====<br />
<br />
See also [[Wikipedia:Comparison of hex editors]].<br />
<br />
* {{App|Bless|High quality, full featured hex editor.|https://web.archive.org/web/20170503150524/http://home.gna.org/bless/|{{Pkg|bless}}}}<br />
* {{App|GHex|Hex editor for GNOME, which allows the user to load data from any file, view and edit it in either hex or ascii.|https://wiki.gnome.org/Apps/Ghex|{{Pkg|ghex}}}}<br />
* {{App|hyx|Minimalistic but powerful console hex editor.|https://yx7.cc/code/|{{AUR|hyx}}}}<br />
* {{App|Okteta|KDE hex editor for viewing and editing the raw data of files.|https://www.kde.org/applications/utilities/okteta/|{{Pkg|okteta}}}}<br />
<br />
==== JSON tools ====<br />
<br />
* {{App|gron|gron transforms JSON into discrete assignments to make it easier to grep.|https://github.com/tomnomnom/gron|{{AUR|gron-bin}}}}<br />
* {{App|jid|JSON incremental digger|https://github.com/simeji/jid|{{AUR|jid}}}}<br />
* {{App|jo|A command to create JSON.|https://github.com/jpmens/jo|{{AUR|jo-git}}}}<br />
* {{App|jq|Command-line JSON processor|https://stedolan.github.io/jq/|{{Pkg|jq}}}}<br />
* {{App|jsawk|Like awk, but for JSON.|https://github.com/micha/jsawk|{{AUR|jsawk-git}}}}<br />
* {{App|jshon|A JSON parser for the shell.|http://kmkeen.com/jshon/|{{Pkg|jshon}}}}<br />
* the [[Elvish]] shell has built-in support for JSON<br />
<br />
==== UML modelers ====<br />
<br />
See also [[Wikipedia:List of Unified Modeling Language tools]].<br />
<br />
* {{App|[[Wikipedia:ArgoUML|ArgoUML]]|UML modeling tool with support for all standard UML 1.4 diagrams.|http://argouml.tigris.org/|{{AUR|argouml}}}}<br />
* {{App|[[Eclipse]] Modeling Tools|Tools and runtimes for building model-based applications.|https://www.eclipse.org/|{{AUR|eclipse-modeling-tools}}}}<br />
* {{App|[[Wikipedia:Modelio|Modelio]]|Modeling environment supporting the main standards: UML, BPMN, MDA, SysML.|https://www.modelio.org/|{{AUR|modelio-bin}}}}<br />
* {{App|[[Wikipedia:Papyrus (software)|Papyrus]]|Model-based engineering tool based on Eclipse.|https://www.eclipse.org/papyrus/|{{AUR|papyrus}}}}<br />
* {{App|[[Wikipedia:PlantUML|PlantUML]]|Tool to create UML diagrams from a plain text language.|http://plantuml.com/|{{AUR|plantuml}}}}<br />
* {{App|PlantUML QEditor|PlantUML editor written in Qt.|https://github.com/borco/plantumlqeditor|{{AUR|plantumlqeditor-git}}}}<br />
* {{App|[[Wikipedia:Umbrello UML Modeller|Umbrello]]|Unified Modelling Language (UML) diagram program based on KDE Technology.|https://umbrello.kde.org/|{{Pkg|umbrello}}}}<br />
* {{App|[[Wikipedia:UML Designer|UML Designer]]|Graphical tool based on Eclipse to edit and visualize UML models.|http://www.umldesigner.org/|{{AUR|umldesigner}}}}<br />
* {{App|[[Wikipedia:UMLet|UMLet]]|UML tool with a simple user interface: draw UML diagrams fast, build sequence and activity diagrams from plain text, export diagrams to eps, pdf, jpg, svg, and clipboard, share diagrams using Eclipse, and create new, custom UML elements.|http://umlet.com/|{{AUR|umlet}}}}<br />
* {{App|UML/INTERLIS-editor|Facilitate the application of the model driven approach to a greater number of users.|http://www.umleditor.org/|{{AUR|umleditor}}}}<br />
* {{App|Violet|Very easy to learn and use UML editor that draws nice-looking diagrams.|https://sourceforge.net/projects/violet/|{{AUR|violetumleditor}}}}<br />
<br />
==== API documentation browsers ====<br />
<br />
* {{App|[[Wikipedia:GNOME Devhelp|Devhelp]]|Developer tool for browsing and searching API documentation.|https://wiki.gnome.org/Apps/Devhelp|{{Pkg|devhelp}}}}<br />
* {{App|Doc Browser|API documentation browser with support for DevDocs and Hoogle.|https://github.com/qwfy/doc-browser|{{AUR|doc-browser-git}}}}<br />
* {{App|Qt Assistant|Tool for viewing on-line documentation in Qt help file format.|http://doc.qt.io/qt-5/qtassistant-index.html|{{Pkg|qt5-tools}}}}<br />
* {{App|quickDocs|Fast developer docs reader for reading Valadoc and DevDocs.|https://github.com/mdh34/quickDocs|{{AUR|quickdocs}}}}<br />
* {{App|Zeal|Offline API documentation browser for software developers.|https://zealdocs.org/|{{Pkg|zeal}}}}<br />
<br />
==== Issue tracking systems ====<br />
<br />
See [[:Category:Issue tracking systems]].<br />
<br />
==== Game development ====<br />
<br />
See also [[Wikipedia:List of game engines]].<br />
<br />
* {{App|GDevelop|Game creator designed to be used by everyone - no programming skills required.|https://gdevelop-app.com/|{{AUR|gdevelop}}}}<br />
* {{App|[[Godot Engine|Godot]]|Advanced, feature-packed, multi-platform 2D and 3D game engine. Create games with ease, using Godot's unique approach to game development.|https://godotengine.org/|{{AUR|godot}}}}<br />
* {{App|LibreSprite|Animated sprite editor and pixel art tool lets you create 2D animations for videogames.|https://github.com/LibreSprite/LibreSprite|{{AUR|libresprite}}}}<br />
* {{App|Tiled|General purpose 2D level editor with powerful tile map editing features. It’s built to be easy to use and is suitable for many type of games.|https://subversion.apache.org/|{{Pkg|tiled}}}}<br />
<br />
=== Text input ===<br />
<br />
==== Character selectors ====<br />
<br />
* {{App|GNOME Characters|Character map application for GNOME.|https://gitlab.gnome.org/GNOME/gnome-characters|{{Pkg|gnome-characters}}}}<br />
* {{App|[[Wikipedia:GNOME Character Map|gucharmap]]|GTK+ 3 character selector for GNOME.|https://wiki.gnome.org/Apps/Gucharmap|{{pkg|gucharmap}}}}<br />
* {{App|KCharSelect|Tool to select special characters from all installed fonts and copy them into the clipboard. Part of {{Grp|kdeutils}}.|https://utils.kde.org/projects/kcharselect/|{{Pkg|kcharselect}}}}<br />
<br />
==== On-screen keyboards ====<br />
<br />
* {{App|CellWriter|Grid-entry handwriting recognition input panel.|https://github.com/risujin/cellwriter|{{Pkg|cellwriter}}}}<br />
* {{App|eekboard|Easy to use virtual keyboard toolkit.|https://github.com/ueno/eekboard|{{AUR|eekboard}}}}<br />
* {{App|Florence|Extensible scalable on-screen virtual keyboard for GNOME that stays out of your way when not needed.|https://sourceforge.net/projects/florence/|{{AUR|florence}}}}<br />
* {{App|Onboard|Onscreen keyboard useful for tablet PC users and for mobility impaired users.|https://launchpad.net/onboard|{{Pkg|onboard}}}}<br />
* {{App|qtvkbd|Virtual keyboard written in Qt, a fork of kvkbd.|https://github.com/Alexander-r/qtvkbd|{{AUR|qtvkbd}}}}<br />
* {{App|QVKbd|Virtual keyboard written in Qt.|https://github.com/KivApple/qvkbd|{{Pkg|qvkbd}}}}<br />
* {{App|theShell On Screen Keyboard|Touchscreen keyboard for theShell.|https://github.com/vicr123/ts-kbd|{{AUR|ts-kbd}}}}<br />
* {{App|xvkbd|Virtual keyboard for X window system.|http://t-sato.in.coocan.jp/xvkbd/|{{AUR|xvkbd}}}}<br />
<br />
==== Keyboard layout switchers ====<br />
<br />
* {{App|fbxkb|A NETWM compliant keyboard indicator and switcher. It shows a flag of current keyboard in a systray area and allows you to switch to another one.|http://fbxkb.sourceforge.net/|{{AUR|fbxkb}}}}<br />
* {{App|xxkb|A lightweight keyboard layout indicator and switcher.|https://sourceforge.net/projects/xxkb/|{{Pkg|xxkb}}}}<br />
* {{App|qxkb|A keyboard switcher written in Qt.|https://github.com/disels/qxkb|{{AUR|qxkb}}}}<br />
* {{App|[[Wikipedia:X Neural Switcher|X Neural Switcher]]|A text analyser, it detects the language of the input and corrects the keyboard layout if needed.|http://www.xneur.ru/|{{AUR|xneur}}, {{AUR|gxneur}} (GUI)}}<br />
<br />
==== Input methods ====<br />
<br />
See the main article: [[Internationalization#Input methods]].<br />
<br />
=== Disks ===<br />
<br />
==== Partitioning tools ====<br />
<br />
See [[Partitioning#Partitioning tools]].<br />
<br />
==== Formatting tools ====<br />
<br />
See [[File systems#Types of file systems]].<br />
<br />
==== Cloning tools ====<br />
<br />
See [[Disk cloning#Disk cloning software]].<br />
<br />
==== Mount tools ====<br />
<br />
See also [[udisks#Mount helpers]].<br />
<br />
* {{App|9mount|Mount 9p filesystems.|http://sqweek.net/code/9mount/|{{AUR|9mount}}}}<br />
* {{App|cryptmount|Mount an encrypted file system as a regular user.|https://sourceforge.net/projects/cryptmount/|{{AUR|cryptmount}}}}<br />
* {{App|KDiskFree|Displays information about hard disks and other storage devices. It also allows to mount and unmount drives and view them in a file manager.|https://www.kde.org/applications/system/kdiskfree/|{{Pkg|kdf}}}}<br />
* {{App|ldm|A lightweight daemon that mounts drives automagically using ''udev''|https://github.com/LemonBoy/ldm|{{AUR|ldm}}}}<br />
* {{App|pmount|Mount ''source'' as a regular user to an automatically created destination {{ic|/media/''source_name''}}.|https://pmount.alioth.debian.org/|{{AUR|pmount}}}}<br />
* {{App|pmount-safe-removal|Mount removable devices as regular user with safe removal|https://mywaytoarch.tumblr.com/post/13111098534/pmount-safe-removal-of-usb-device|{{AUR|pmount-safe-removal}}}}<br />
* {{App|udevil|Mounts removable devices as a regular user, show device info, and monitor device changes. Only depends on ''udev'' and glib.|https://ignorantguru.github.io/udevil|{{Pkg|udevil}}}}<br />
* {{App|ws|Mount Windows network shares ([[Wikipedia:Server Message Block|CIFS]] and [[Wikipedia:Virtual file system|VFS]]).|https://sourceforge.net/projects/winshares/|{{AUR|ws}}}}<br />
* {{App|zulucrypt|A GUI frontend for cryptsetup to create, manage and mount encrypted volumes; supports encfs as well|https://mhogomchungu.github.io/zuluCrypt/|{{AUR|zulucrypt}}}}<br />
<br />
==== Disk usage display ====<br />
<br />
* {{App|duc|A library and suite of tools for inspecting disk usage.|http://duc.zevv.nl/|{{AUR|duc}}}}<br />
* {{App|[[Wikipedia:Filelight|Filelight]]|Disk usage analyzer that creates an interactive map of concentric, segmented rings that help visualise disk usage on your computer.|https://www.kde.org/applications/utilities/filelight|{{Pkg|filelight}}}}<br />
* {{App|[[Wikipedia:Disk Usage Analyzer|GNOME Disk Usage Analyzer]]|Disk usage analyzer for the [[GNOME]] desktop to check folder sizes and available disk space.|https://wiki.gnome.org/Apps/DiskUsageAnalyzer|{{Pkg|baobab}}}}<br />
* {{App|Graphical Disk Map|Disk usage analyzer that draws a map of rectangles sized according to file or dir sizes.|http://gdmap.sourceforge.net/|{{Pkg|gdmap}}}}<br />
* {{App|gt5|Diff-capable "du-browser".|http://gt5.sourceforge.net|{{AUR|gt5}}}}<br />
* {{App|MATE Disk Usage Analyzer|Disk usage analyzing tool for MATE Desktop.|https://github.com/mate-desktop/mate-utils|{{Pkg|mate-utils}}}}<br />
* {{App|ncdu|Simple ncurses disk usage analyzer.|http://dev.yorhel.nl/ncdu|{{Pkg|ncdu}}}}<br />
* {{App|qdirstat|Qt-based directory statistics (KDirStat/K4DirStat without any KDE - from the original KDirStat author).|https://github.com/shundhammer/qdirstat|{{AUR|qdirstat}}}}<br />
<br />
==== Disk health status ====<br />
<br />
See [[S.M.A.R.T.#GUI Applications]].<br />
<br />
==== File recovery tools ====<br />
<br />
See [[File recovery#List of utilities]].<br />
<br />
==== Disk cleaning ====<br />
<br />
* {{App|[[Wikipedia:BleachBit|BleachBit]]|Frees disk space and guards your privacy; frees cache, deletes cookies, clears Internet history, shreds temporary files, deletes logs, and discards junk you didn't know was there.|https://www.bleachbit.org/|{{Pkg|bleachbit}}}}<br />
* {{App|[[Wikipedia:fdupes|fdupes]]|Program for identifying or deleting duplicate files residing within specified directories.|https://github.com/adrianlopezroche/fdupes|{{Pkg|fdupes}}}}<br />
* {{App|fslint|A utility to find and clean various forms of lint on a filesystem.|https://www.pixelbeat.org/fslint/|{{AUR|fslint}}}}<br />
* {{App|gconf-cleaner|cleans up the unknown/invalid GConf keys that still sitting down on your GConf database.|https://code.google.com/archive/p/gconf-cleaner/|{{AUR|gconf-cleaner}}}}<br />
* {{App|rmlint|Tool to quickly find (and optionally remove) duplicate files and other lint.|https://github.com/sahib/rmlint|CLI: {{Pkg|rmlint}}, GUI: {{Pkg|rmlint-shredder}}}}<br />
* {{App|Sweeper|System cleaning utility for KDE.|http://utils.kde.org/projects/sweeper/|{{Pkg|sweeper}}}}<br />
<br />
==== Disk image writing ====<br />
<br />
See also [[Wikipedia:List of tools to create Live USB systems]].<br />
<br />
* {{App|Deepin Boot Maker|Tool to make boot disk for Deepin OS.|https://www.deepin.org/en/original/deepin-boot-maker/|{{Pkg|deepin-boot-maker}}}}<br />
* {{App|Etcher|Flash OS images to SD cards & USB drives, safely and easily. Based on the [https://electronjs.org/ Electron] platform.|https://etcher.io/|{{AUR|etcher}}}}<br />
* {{App|[[Wikipedia:Fedora Media Writer|Fedora Media Writer]]|Tool that helps users put Fedora images on their portable drives such as flash disks.|https://github.com/FedoraQt/MediaWriter|{{AUR|mediawriter}}}}<br />
* {{App|GNOME MultiWriter|Write an ISO file to multiple USB devices at once.|https://wiki.gnome.org/Apps/MultiWriter|{{Pkg|gnome-multi-writer}}}}<br />
* {{App|ISOImageWriter|Tool to write a .iso file to a USB disk.|https://community.kde.org/ISOImageWriter|{{AUR|isoimagewriter}}}}<br />
* {{App|LiveUSB Install|Install various Linux distributions and operating systems on removable flash drive or external disk drive.|http://live.learnfree.eu/|{{AUR|live-usb-install}}}}<br />
* {{App|MultiBootUSB|Install multiple live Linux on a USB disk non destructively and option to uninstall distros.|http://multibootusb.org/|{{AUR|multibootusb}}}}<br />
* {{App|MultiSystem|GUI tool to create a USB system that can boot multiple distro's.|http://liveusb.info/|{{AUR|multisystem}}}}<br />
* {{App|[[Wikipedia:SUSE Studio ImageWriter|SUSE Studio ImageWriter]]|Utility for writing raw disk images & hybrid isos to USB keys.|https://github.com/openSUSE/imagewriter|{{AUR|imagewriter}}}}<br />
* {{App|[[Wikipedia:UNetbootin|UNetbootin]]|Installs Linux/BSD distributions to a partition or USB drive.|https://unetbootin.github.io/|{{AUR|unetbootin}}}}<br />
* {{App|WoeUSB|Simple tool to create USB stick windows installer from an ISO image or a real DVD. (Fork of WinUSB).|https://github.com/slacka/WoeUSB|{{AUR|woeusb}}}}<br />
<br />
=== System ===<br />
<br />
==== Task managers ====<br />
<br />
* {{App|Deepin System Monitor|Monitor system process status for Deepin desktop.|https://www.deepin.org/en/original/deepin-system-monitor/|{{Pkg|deepin-system-monitor}}}}<br />
* {{App|GNOME System Monitor|System monitor for [[GNOME]] to view and manage system resources.|https://wiki.gnome.org/Apps/SystemMonitor|{{Pkg|gnome-system-monitor}}}}<br />
* {{App|GNOME Usage|View information about use of system resources, like memory and disk space.|https://wiki.gnome.org/Apps/Usage|{{Pkg|gnome-usage}}}}<br />
* {{App|[[Wikipedia:Htop|htop]]|Simple, ncurses interactive process viewer.|http://htop.sourceforge.net/|{{Pkg|htop}}}}<br />
* {{App|[[Wikipedia:KDE System Guard|KSysGuard]]|System monitor for [[KDE]] to monitor running processes and system performance.|https://userbase.kde.org/KSysGuard|{{Pkg|ksysguard}}}}<br />
* {{App|Linux Process Explorer|Graphical process explorer for Linux.|https://sourceforge.net/projects/procexp/|{{AUR|procexp}}}}<br />
* {{App|LXTask|Lightweight task manager for [[LXDE]].|http://wiki.lxde.org/en/LXTask|{{Pkg|lxtask}}}}<br />
* {{App|MATE System Monitor|System monitor for [[MATE]].|https://github.com/mate-desktop/mate-system-monitor|{{Pkg|mate-system-monitor}}}}<br />
* {{App|Task Manager|GTK2 process management application for [[Xfce]].|http://goodies.xfce.org/projects/applications/xfce4-taskmanager|{{Pkg|xfce4-taskmanager}}}}<br />
<br />
==== System monitors ====<br />
<br />
See also [[:Category:Status monitoring and notification]]<br />
<br />
* {{App|[[Conky]]|Lightweight, scriptable system monitor.|https://github.com/brndnmtthws/conky|{{Pkg|conky}}}}<br />
* {{App|Collectd|Simple, extensible system monitoring daemon based on [http://oss.oetiker.ch/rrdtool/ rrdtool]. It has a small footprint and can be set up either stand-alone or as a server/client application.|https://collectd.org/|{{Pkg|collectd}}}}<br />
* {{App|collectl|Collectl is a light-weight performance monitoring tool capable of reporting interactively as well as logging to disk. It reports statistics on cpu, disk, infiniband, lustre, memory, network, nfs, process, quadrics, slabs and more in easy to read format.|http://collectl.sourceforge.net/|{{AUR|collectl}}}}<br />
* {{App|dstat|Versatile resource statistics tool.|http://dag.wieers.com/home-made/dstat/|{{Pkg|dstat}}}}<br />
* {{App|[[Fsniper]]|Daemon to run scripts based on changes in files monitored by inotify.|http://projects.l3ib.org/fsniper/|{{AUR|fsniper}}}}<br />
* {{App|[[Wikipedia:GKrellM|GKrellM]]|Simple, flexible system monitor package for [[GTK+]] with many plug-ins.|http://billw2.github.io/gkrellm/gkrellm.html|{{Pkg|gkrellm}}}}<br />
* {{App|glances|CLI curses-based monitoring tool in Python.|http://nicolargo.github.io/glances|{{Pkg|glances}}}}<br />
* {{App|netdata|Web-based real-time performance monitor.|https://github.com/firehol/netdata/wiki|{{Pkg|netdata}}}}<br />
* {{App|[[Telegraf]]|Agent written in Go for collecting, processing, aggregating, and writing metrics.|https://docs.influxdata.com/telegraf/latest/|{{AUR|telegraf}}}}<br />
* {{App|[[Paramano]]|Light battery monitor and a CPU frequency scaler. Forked from [http://trayfreq.sourceforge.net/ trayfreq]|https://github.com/phillid/paramano|{{AUR|paramano}}}}<br />
* {{app|Sysstat|Collection of resource monitoring tools: iostat, isag, mpstat, pidstat, sadf, sar.|http://pagesperso-orange.fr/sebastien.godard/|{{Pkg|sysstat}}}}<br />
* {{App|xosview|System monitor that resembles gr_osview from SGI IRIX.|http://www.pogo.org.uk/~mark/xosview/|{{AUR|xosview}}}}<br />
<br />
==== Hardware sensor monitoring ====<br />
<br />
See [[lm_sensors#Graphical front-ends]].<br />
<br />
==== System information viewers ====<br />
<br />
===== Console =====<br />
<br />
* {{App|alsi|A system information tool for Arch Linux. It can be configured for every other system without even touching the source code of the script.|http://trizenx.blogspot.ro/2012/08/alsi.html|{{AUR|alsi}}}}<br />
* {{App|archey2|Simple python script that displays the arch logo and some basic information. Python 2.x version.|https://github.com/djmelik/archey|{{AUR|archey2}}}}<br />
* {{App|[[archey3]]|Python script to display system infomation alongside the Arch Linux logo.|https://lclarkmichalek.github.io/archey3|{{pkg|archey3}}}}<br />
* {{App|dmidecode|It reports information about your system's hardware as described in your system BIOS according to the SMBIOS/DMI standard.|http://www.nongnu.org/dmidecode/|{{Pkg|dmidecode}}}}<br />
* {{App|hwdetect|Simple script to list modules that are exported in {{ic|/sys/}}.|https://projects.archlinux.org/|{{pkg|hwdetect}}}}<br />
* {{App|hwinfo|Powerful hardware detection tool come from openSUSE.|https://github.com/openSUSE/hwinfo|{{pkg|hwinfo}}}}<br />
* {{App|inxi|A script to get system information.|https://github.com/smxi/inxi|{{AUR|inxi}}}}<br />
* {{App|neofetch|A fast, highly customizable system info script that supports displaying images with w3m.|https://github.com/dylanaraps/neofetch|{{Pkg|neofetch}}}}<br />
* {{App|screenfetch|Similar to archey but has an option to take a screenshot. Written in bash.|https://github.com/KittyKatt/screenFetch|{{Pkg|screenfetch}}}}<br />
<br />
===== Graphical =====<br />
<br />
* {{App|hardinfo|A small application that displays information about your hardware and operating system, it looks like the Device Manager in Windows.|http://hardinfo.berlios.de/HomePage|{{Pkg|hardinfo}}}}<br />
* {{App|i-Nex|An application that gathers information for hardware components available on your system and displays it using an user interface similar to the popular Windows tool CPU-Z.|http://i-nex.linux.pl/|{{AUR|i-nex-git}}}}<br />
* {{App|lshw|A small tool to provide detailed information on the hardware configuration of the machine with CLI and GTK interfaces.|http://ezix.org/project/wiki/HardwareLiSter|{{Pkg|lshw}}}}<br />
* {{App|KDE Info Center|Centralized and convenient overview of system information for KDE.|https://www.kde.org/applications/system/kinfocenter/|{{Pkg|kinfocenter}}}}<br />
* {{App|USBView|Display the topology of devices on the USB bus.|http://www.kroah.com/linux/usb/|{{Pkg|usbview}}}}<br />
<br />
==== System log viewers ====<br />
<br />
* {{App|GNOME Logs|Viewer for the systemd journal. Part of {{Grp|gnome}}.|https://wiki.gnome.org/Apps/Logs|{{Pkg|gnome-logs}}}}<br />
* {{App|GNOME System Log|System log viewer for GNOME.|https://gitlab.gnome.org/GNOME/gnome-system-log|{{Pkg|gnome-system-log}}}}<br />
* {{App|KSystemLog|System log viewer tool for KDE.|https://www.kde.org/applications/system/ksystemlog/|{{Pkg|ksystemlog}}}}<br />
* {{App|MATE System Log|System log viewer for MATE.|https://github.com/mate-desktop/mate-utils|{{Pkg|mate-utils}}}}<br />
* {{App|Pacman Log Viewer|Tool used to inspect pacman log file, in particular it lists installed, removed and upgraded packages letting you to filter by package's name and/or date.|https://www.opendesktop.org/content/show.php?content&#61;150484|{{Pkg|pacmanlogviewer}}}}<br />
<br />
==== Font viewers ====<br />
<br />
See also [[Wikipedia:Font management software]].<br />
* {{App|Font Manager|Simple font management for GTK+ desktop environments.|https://fontmanager.github.io/|{{AUR|font-manager}}}}<br />
* {{App|Fonty Python|Manage, view and find your fonts.|https://savannah.nongnu.org/projects/fontypython|{{AUR|fontypython}}}}<br />
* {{App|GNOME Fonts|Font viewer for GNOME.|https://gitlab.gnome.org/GNOME/gnome-font-viewer|{{Pkg|gnome-font-viewer}}}}<br />
* {{App|KFontview|KDE application to view and install different types of fonts.|https://docs.kde.org/trunk5/en/kde-workspace/kfontview/index.html|{{Pkg|plasma-desktop}}}}<br />
* {{App|MATE Font Viewer|Font viewer for MATE.|https://github.com/mate-desktop/mate-control-center|{{Pkg|mate-utils}}}}<br />
* {{App|Waterfall|GTK+ application to view all characters of font in all sizes.|https://keithp.com/cgit/gwaterfall.git|{{Pkg|gwaterfall}}}}<br />
<br />
==== Help viewers ====<br />
<br />
See [[man page#Viewer applications]].<br />
<br />
==== Command schedulers ====<br />
<br />
See also [[Cron]].<br />
<br />
* {{App|FcronQ|Fcron GUI, an advanced periodic command scheduler.|http://fcronq.xavion.name/|{{AUR|fcronq}}}}<br />
* {{App|GNOME Schedule|Graphical interface to crontab and at for GNOME.|http://gnome-schedule.sourceforge.net/|{{Pkg|gnome-schedule}}}}<br />
* {{App|KCron|Tool for KDE to run applications in the background at regular intervals. It's a graphical interface to the Cron command.|https://userbase.kde.org/KCron|{{Pkg|kcron}}}}<br />
* {{App|KTimer|Little tool for KDE to execute programs after some time. It allows you to enter several tasks and to set a timer for each of them. The timers for each task can be started, stopped, changed, or looped.|https://www.kde.org/applications/utilities/ktimer/|{{Pkg|ktimer}}}}<br />
<br />
==== Shutdown timers ====<br />
<br />
* {{App|GShutdown|Advanced shutdown utility which allows you to schedule the shutdown or the restart of your computer, or logout your actual session.|https://gshutdown.tuxfamily.org/|{{AUR|gshutdown}}}}<br />
* {{App|Hsiu-Ming's Timer|Graphical shutdown timer, which enables you to shutdown, turn off monitor, reboot or play sound after a period of time.|https://cges30901.github.io/hmtimer-website/|{{AUR|hmtimer}}}}<br />
* {{App|KShutdown|Graphical shutdown utility, which allows you to turn off or suspend a computer at a specified time. It features various time and delay options, command-line support, and notifications.|https://kshutdown.sourceforge.io/|{{Pkg|kshutdown}}}}<br />
<br />
==== Clock synchronization ====<br />
<br />
See [[Time synchronization]].<br />
<br />
==== Screen management ====<br />
<br />
See [[Xrandr#Graphical front-ends]].<br />
<br />
==== Backlight management ====<br />
<br />
See [[Backlight#Backlight utilities]].<br />
<br />
==== Color management ====<br />
<br />
See [[ICC profiles#Utilities]] and [[Backlight#Color correction]].<br />
<br />
==== Printer management ====<br />
<br />
See [[CUPS#GUI applications]].<br />
<br />
==== Bluetooth management ====<br />
<br />
See [[Bluetooth#Front-ends]].<br />
<br />
==== Power management ====<br />
<br />
See [[Power management#Userspace tools]].<br />
<br />
==== Package management ====<br />
<br />
See [[pacman tips#Utilities]].</div>Delapouitehttps://wiki.archlinux.org/index.php?title=Kitty&diff=553253Kitty2018-11-05T18:27:06Z<p>Delapouite: add basic info about kitty</p>
<hr />
<div>[[Category:Terminal emulators]]<br />
[https://sw.kovidgoyal.net/kitty/index.html Kitty] is a scriptable OpenGL based terminal emulator with tiling capabilities and protocol extensions for keyboard input and rendering.<br />
<br />
== Installation ==<br />
<br />
[[Install]] the {{Pkg|kitty}} package.<br />
<br />
== Usage ==<br />
<br />
New tabs and windows can be created and resized through various {{ic|ctrl+shift}} shortcuts. Layouts are switchable through {{ic|ctrl+shift+l}} and can be saved/restored.<br />
A ''full keyboard mode'' provides distinction between ambiguous keys like {{ic|ctrl+i}} vs {{ic|tab}}. Moreover, new text effects like curly-underline are also<br />
available for applications that support it.<br />
<br />
== Configuration ==<br />
<br />
Kitty is configurable in {{ic|~/.config/kitty/kitty.conf}}. Fonts, colors, cursors and scrollback behaviors can be adjusted.<br />
<br />
== See also ==<br />
<br />
* [https://github.com/kovidgoyal/kitty GitHub repository]</div>Delapouitehttps://wiki.archlinux.org/index.php?title=TLP&diff=552624TLP2018-11-02T21:19:32Z<p>Delapouite: add link to GTK</p>
<hr />
<div>[[Category:Power management]]<br />
[[ja:TLP]]<br />
[[zh-hans:TLP]]<br />
{{Related articles start}}<br />
{{Related|Laptop}}<br />
{{Related|Laptop Mode Tools}}<br />
{{Related articles end}}<br />
<br />
From the [http://linrunner.de/en/tlp/tlp.html project page]:<br />
<br />
:TLP brings you the benefits of advanced power management for Linux without the need to understand every technical detail. TLP comes with a default configuration already optimized for battery life, so you may just install and forget it. Nevertheless TLP is highly customizable to fulfill your specific requirements.<br />
<br />
== Installation ==<br />
<br />
[[Install]] {{Pkg|tlp}} from the [[official repositories]] - pay attention to its optional dependencies that may help provide additional power saving.<br />
<br />
To complete TLP's install, you must [[enable]] the systemd services {{ic|tlp.service}} and {{ic|tlp-sleep.service}}. You should also [[mask]] the systemd service {{ic|systemd-rfkill.service}} and socket {{ic|systemd-rfkill.socket}} to avoid conflicts and assure proper operation of TLP's radio device switching options.<br />
<br />
{{Note|{{ic|tlp.service}} starts {{ic|NetworkManager.service}} if it is available: {{bug|43733}}. If you use a different [[List_of_applications#Network_managers|network manager]], [[mask]] {{ic|NetworkManager.service}} or [[edit]] {{ic|tlp.service}} and remove the service out of line {{ic|1=Wants=}}.}}<br />
<br />
=== ThinkPads only ===<br />
<br />
For advanced battery functions, i.e. charge thresholds and recalibration, install the following package(s):<br />
<br />
* {{Pkg|tp_smapi}} – tp-smapi is needed for battery charge thresholds, recalibration and specific status output of tlp-stat<br />
* {{Pkg|acpi_call}} – acpi-call is needed for battery charge thresholds and recalibration on Sandy Bridge and newer models (X220/T420, X230/T430 et al.)<br />
<br />
See the TLP FAQ, section [http://linrunner.de/en/tlp/docs/tlp-faq.html#kernmod "Which kernel module?"], for details.<br />
<br />
Controlling the charge thresholds using D-Bus without root privileges is possible using {{AUR|threshy}} and it's example Qt user interface {{AUR|threshy-gui}}.<br />
<br />
=== Graphical interface ===<br />
<br />
{{AUR|tlpui-git}} is a [[GTK]] user interface for TLP written in Python. As of 31 October 2018, the software is still in beta.<br />
<br />
== Configuration ==<br />
<br />
The configuration file is located at {{ic|/etc/default/tlp}} and provides a "largely" optimized power saving by default. For a full explanation of options see: [http://linrunner.de/en/tlp/docs/tlp-configuration.html TLP configuration].<br />
<br />
=== Force battery (BAT) configuration ===<br />
When no power supply can be detected, the setting for AC will be used (e.g. on desktops and embedded hardware).<br />
<br />
You may want to force the battery (BAT) settings when using TLP on these devices to enable more power saving:<br />
<br />
{{hc|/etc/default/tlp|2=<br />
# Operation mode when no power supply can be detected: AC, BAT.<br />
TLP_DEFAULT_MODE=BAT<br />
<br />
# Operation mode select: 0=depend on power source, 1=always use TLP_DEFAULT_MODE<br />
TLP_PERSISTENT_DEFAULT=1}}<br />
<br />
=== Btrfs ===<br />
<br />
{{Accuracy|Hardware/kernel-specific quirk|section=Btrfs}}<br />
<br />
To avoid filesystem corruption on btrfs formatted partitions, set:<br />
<br />
SATA_LINKPWR_ON_BAT=max_performance<br />
<br />
See also these links for discussion on this topic: [https://github.com/linrunner/TLP/issues/128 Github bug report], [https://www.reddit.com/r/archlinux/comments/4f5xvh/saving_power_is_the_btrfs_dataloss_warning_still/ Reddit follow-up discussion].<br />
<br />
=== Bumblebee with NVIDIA driver ===<br />
<br />
If you're running [[Bumblebee]] with NVIDIA driver, you need to disable power management for the GPU in TLP in order to make Bumblebee control the power of the GPU.<br />
<br />
Run {{ic|lspci}} to determine the address of the GPU (such as 01:00.0), then set the value:<br />
<br />
RUNTIME_PM_BLACKLIST="01:00.0"<br />
<br />
=== Radio Device Wizard ===<br />
<br />
The Radio Device Wizard allows a more sophisticated management of radio devices depending on network connect/disconnect events. It requires [[NetworkManager]], {{Pkg|tlp-rdw}} and [[enabling]] {{ic|NetworkManager-dispatcher.service}}.<br />
<br />
See [http://linrunner.de/en/tlp/docs/tlp-configuration.html#rdw TLP configuration] for details.<br />
<br />
=== Command line ===<br />
<br />
TLP provides several command line tools. See [http://linrunner.de/en/tlp/docs/tlp-linux-advanced-power-management.html#commands TLP commands].<br />
<br />
== Debugging ==<br />
You can display information about the currently used Mode(AC/BAT) and applied configurations:<br />
<br />
# tlp-stat<br />
<br />
== Features intentionally excluded ==<br />
<br />
* Fan control. See [[Fan speed control]]<br />
<br />
* Backlight brightness. See [[Backlight]]<br />
<br />
== See also ==<br />
<br />
* [http://linrunner.de/tlp TLP - Linux Advanced Power Management] - Project homepage & documentation.</div>Delapouitehttps://wiki.archlinux.org/index.php?title=Radicale&diff=549953Radicale2018-10-22T16:59:11Z<p>Delapouite: add link to Apache</p>
<hr />
<div>[[Category:WebDAV]]<br />
[[ja:Radicale]]<br />
{{Related articles start}}<br />
{{Related|DAViCal}}<br />
{{Related|Kcaldav}}<br />
{{Related|AgenDAV}}<br />
{{Related articles end}}<br />
<br />
[http://radicale.org/ Radicale] is a server designed to support the CalDav and CardDav protocols. It requires at least Python 3.3.<br />
<br />
== Installation ==<br />
<br />
{{warning|Radicale got a major release change. You need to export old version 1.x calendars *before* you install version 2.x. Please, [http://radicale.org/1to2/ read].}}<br />
<br />
[[Install]] the {{Pkg|radicale}} package.<br />
<br />
== Configuration ==<br />
<br />
The main configuration file is located at {{ic|/etc/radicale/config}}.<br />
<br />
Many of the configuration options can be changed on the command-line:<br />
<br />
$ radicale --help<br />
<br />
=== Integration ===<br />
<br />
Radicale can be integrated with HTTP webservers like [[Apache]] which support the mod_wgsi interface.<br />
This causes several options for the configuration of Radicale to be ignored, including: hosts, daemon, pid, ssl, certificate, key, protocol and ciphers keys in the [server] section of the config.<br />
Install the radicale module in the python path and write the .wgsi file (to document root).<br />
<br />
{{bc|1=<br />
# import radicale<br />
# radicale.log.start()<br />
# application = radicale.Application()}}<br />
<br />
The next step is to set up a virtual host for radicale.<br />
An example:<br />
<br />
{{bc|1=<br />
<VirtualHost *:80><br />
ServerName cal.yourdomain.org<br />
<br />
WSGIDaemonProcess radicale user=http group=http threads=1<br />
WSGIScriptAlias / /srv/http/radicale.wsgi<br />
<br />
<Directory /var/www><br />
WSGIProcessGroup radicale<br />
WSGIApplicationGroup %{GLOBAL}<br />
AllowOverride None<br />
Order allow,deny<br />
allow from all<br />
</Directory><br />
</VirtualHost>}}<br />
<br />
== Client support ==<br />
Since it uses the CalDav and CardDav protocols, it should support most clients. Currently, the officially supported list is this:<br />
* [[Thunderbird#Extensions|Thunderbird Lightning extension]]<br />
* [[GNOME/Evolution]]<br />
* KOrganizer {{Pkg|korganizer}}<br />
* InfCloud {{Aur|infcloud}}, CalDavZAP {{Aur|caldavzap}}, CardDavMATE {{Aur|carddavmate}}<br />
* syncEvolution {{Aur|syncevolution}}<br />
* aCal, ContactSync, CalendarSync, CalDAV-Sync CardDAV-Sync and DAVdroid for Google Android<br />
* Apple iOS<br />
* Mac OSX Calendar/Contacts<br />
<br />
== See also ==<br />
* [http://radicale.org/ Project Website radicale.org]</div>Delapouitehttps://wiki.archlinux.org/index.php?title=Node.js&diff=549564Node.js2018-10-21T20:34:54Z<p>Delapouite: add link to yarn</p>
<hr />
<div>[[Category:Development]]<br />
[[ja:Node.js]]<br />
[[zh-hans:Node.js]]<br />
[http://nodejs.org/ Node.js] is a JavaScript runtime environment combined with useful libraries. It uses [https://code.google.com/p/v8/ Google's V8 engine] to execute code outside of the browser. Due to its event-driven, non-blocking I/O model, it is suitable for real-time web applications.<br />
<br />
== Installation ==<br />
<br />
[[Install]] the {{Pkg|nodejs}} package.<br />
<br />
=== Alternate installations ===<br />
<br />
It is not uncommon to need or desire to work in different versions of {{Pkg|nodejs}}. A preferred method among node users is to use [https://github.com/creationix/nvm NVM] (Node Version Manager). {{AUR|nvm}} allows for cheap and easy alternative installs.<br />
<br />
You can set it up by adding this to your shell's startup file:<br />
# Set up Node Version Manager<br />
source /usr/share/nvm/init-nvm.sh<br />
<br />
Or this if you want to use a custom nvm directory:<br />
<br />
# Set up Node Version Manager<br />
export NVM_DIR="$HOME/.nvm" # You can change this if you want.<br />
export NVM_SOURCE="/usr/share/nvm" # The AUR package installs it to here.<br />
[ -s "$NVM_SOURCE/nvm.sh" ] && . "$NVM_SOURCE/nvm.sh" # Load NVM<br />
<br />
Usage is well documented on the project's GitHub but is as simple as:<br />
<br />
$ nvm install 8.0<br />
Downloading and installing node v8.0.0...<br />
[..]<br />
<br />
$ nvm use 8.0<br />
Now using node v8.0.0 (npm v5.0.0)<br />
<br />
If you decide to use {{AUR|nvm}}, previously it was suggested to use {{ic|nodejs-fake}} package from AUR. Which is now [https://lists.archlinux.org/pipermail/aur-requests/2018-January/021828.html| deleted].<br />
Suggested way to use {{ic|1=--assume-installed nodejs=<version>}}, as per [https://www.archlinux.org/pacman/pacman.8.html#_transaction_options_apply_to_em_s_em_em_r_em_and_em_u_em| pacman] manual.<br />
<br />
== Node Packaged Modules ==<br />
<br />
[https://www.npmjs.org/ npm] is the official package manager for node.js. It can be [[install]]ed with the {{Pkg|npm}} package.<br />
<br />
=== Managing packages with npm ===<br />
<br />
==== Installing packages ====<br />
<br />
Any package can be installed using:<br />
<br />
$ npm install packageName<br />
<br />
This command installs the package in the current directory under {{ic|node_modules}} and executables under {{ic|node_modules/.bin}}.<br />
<br />
For a system-wide installation global switch {{ic|-g}} can be used:<br />
<br />
# npm -g install packageName<br />
<br />
By default this command installs the package under {{ic|/usr/lib/node_modules/npm}} and requires root privileges to do so.<br />
<br />
===== Allow user-wide installations =====<br />
<br />
To allow ''global'' package installations for the current [[user]], set the {{ic|npm_config_prefix}} [[Environment_variables#Per_user|environment variable]]. This is used by both npm and [https://yarnpkg.com/en/ yarn].<br />
<br />
{{hc|~/.profile|2=<br />
PATH="$HOME/.node_modules/bin:$PATH"<br />
export npm_config_prefix=~/.node_modules<br />
}}<br />
<br />
Re-login or ''source'' to update changes.<br />
<br />
You can also specify the {{ic|--prefix}} parameter for {{ic|npm install}}. However, this is '''not''' recommended, since you'll need to add it every time you install a global package.<br />
<br />
$ npm -g install packageName --prefix ~/.node_modules<br />
<br />
==== Updating packages ====<br />
<br />
Updating packages is as simple as <br />
<br />
$ npm update packageName<br />
<br />
For the case of globally installed packages ({{ic|-g}})<br />
<br />
# npm update -g packageName<br />
<br />
{{Note|Remember that globally installed packages require administrator privileges unless {{ic|prefix}} is set to a user-writable directory}}<br />
<br />
===== Updating all packages =====<br />
<br />
However, sometimes you may just wish to update all packages, either locally or globally. Leaving off the packageName {{ic|npm}} will attempt to update all packages<br />
<br />
$ npm update<br />
<br />
or add the {{ic|-g}} flag to update globally installed packages<br />
<br />
# npm update -g<br />
<br />
==== Removing packages ====<br />
<br />
To remove a package installed with the {{ic|-g}} switch simply use:<br />
<br />
# npm -g uninstall packageName<br />
<br />
{{Note|Remember that globally installed packages require administrator privileges}}<br />
<br />
to remove a local package drop the switch and run:<br />
<br />
$ npm uninstall packageName<br />
<br />
==== Listing packages ====<br />
<br />
To show a tree view of the installed globally packages use:<br />
<br />
$ npm -g list<br />
<br />
This tree is often quite deep. To only display the top level packages use:<br />
<br />
$ npm list --depth=0<br />
<br />
To display obsolete packages that may need to be updated:<br />
<br />
$ npm outdated<br />
<br />
=== Managing packages with pacman ===<br />
<br />
Some node.js packages can be found in [[Arch User Repository]] with the name {{ic|nodejs-packageName}}.<br />
<br />
== Troubleshooting ==<br />
<br />
=== node-gyp python errors ===<br />
<br />
Some node modules use the {{ic|node-gyp}} utility which does not support Python 3, which in most cases will be the default system-wide Python executable. To resolve such errors, make sure you have {{Pkg|python2}} installed, then set the default npm Python like so:<br />
<br />
$ npm config set python /usr/bin/python2<br />
<br />
In case of errors like {{ic|gyp WARN EACCES user "root" does not have permission to access the ... dir}}, {{ic|--unsafe-perm}} option might help:<br />
<br />
# npm install --unsafe-perm -g node-inspector<br />
<br />
=== Cannot find module ... errors ===<br />
<br />
Since npm 5.x.x. package-lock.json file is generated along with the package.json file. Conflictions may arise when the two files refer to different package versions. A temporary method to solving this problem has been:<br />
$ rm package-lock.json<br />
$ npm install<br />
<br />
However, fixes were made after npm 5.1.0 or above. For further information, see: <br />
[https://github.com/npm/npm/pull/17508 missing dependencies]<br />
<br />
== Additional resources ==<br />
<br />
For further information on Node.js and the use of its official package manager NPM you may wish to consult the following external resources<br />
<br />
* [https://nodejs.org/en/docs/ Node.js documentation]<br />
* [https://docs.npmjs.com/ NPM documentation]<br />
* IRC channel #node.js on irc.freenode.net</div>Delapouitehttps://wiki.archlinux.org/index.php?title=Atom_(text_editor)&diff=548146Atom (text editor)2018-10-17T21:32:50Z<p>Delapouite: add link to Node.js</p>
<hr />
<div>[[Category:Text editors]]<br />
[[ja:Atom]]<br />
[[zh-hans:Atom]]<br />
[https://atom.io/ Atom] is an open-source, cross-platform text editor developed by GitHub that is licensed under the MIT License. It is written predominantly in CoffeeScript and JavaScript and uses [[Node.js]] as its runtime environment. It is extensively extensible via use of over 5,000 available packages and 1,000 themes. It uses its own package manager for managing these packages and themes, apm.<br />
<br />
== Installation ==<br />
<br />
The following packages provide Atom:<br />
<br />
* {{Pkg|atom}}<br />
* {{AUR|atom-editor-bin}}<br />
* {{AUR|atom-editor-git}}<br />
* {{AUR|atom-editor-beta}}<br />
* {{AUR|atom-editor-beta-bin}}<br />
<br />
== Packages ==<br />
Its packages can be installed from within Atom itself or from the command-line using the apm command. The correct syntax of apm is:<br />
<br />
$ apm install ''package_name1'' ''package_name2'' ''package_name3'' ...<br />
<br />
Several packages come preinstalled with Atom, notable packages that are not, include:<br />
* [https://atom.io/packages/build build] which enables Atom to compile source code. <br />
* [https://atom.io/packages/git-plus git-plus] which allows one to manage git repositories from within Atom.<br />
* [https://atom.io/packages/language-archlinux language-archlinux] which provides syntax-highlighting for PKGBUILDs (if installed along with the [https://atom.io/packages/language-unix-shell language-unix-shell] package) along with support for running several tests and other actions on PKGBUILDs without a terminal (including [[makepkg]], [[namcap]], ''updpkgsums'', etc.).<br />
* [https://atom.io/packages/markdown-writer markdown-writer] which turns Atom into an efficient Markdown writer. <br />
* [https://atom.io/packages/script script] which enables Atom the ability to run scripts, based on file names.<br />
<br />
== Troubleshooting ==<br />
=== Environment variables not sourced ===<br />
You may experience some problems with packages using environments variables, like [https://atom.io/packages/go-plus go-plus] ({{ic|$GOPATH not found}}). Moreover, it only appears when atom is opened by your file manager. (Because this one is DBUS-spawned, thus it does not inherit variables defined in {{ic|.bashrc}}). <br />
A solution is to make available your variables to DBUS-spawned processes, by following [[Systemd/User#Environment variables]].<br />
<br />
More info on this issue in [[Environment variables#Per user]].<br />
<br />
=== Unable to delete files ===<br />
By default, [https://electron.atom.io/ Electron] apps use {{ic|gvfs-trash}} to delete files. This command is deprecated and no longer exists, so the {{ic|ELECTRON_TRASH}} environment variable must be used instead to specify which trash utility should be used.<br />
<br />
For example, for deleting files under [[Plasma]]:<br />
$ ELECTRON_TRASH=kioclient5 atom<br />
<br />
At the time of writing, Electron supports {{ic|kioclient5}}, {{ic|kioclient}}, {{ic|trash-cli}}, {{ic|gio}} and {{ic|gvfs-trash}} (default). More info is available at this [https://github.com/electron/electron/pull/7178 Github pull request page].<br />
<br />
=== Black window content on startup ===<br />
With some video devices, such as the one for [[VirtualBox]] guests, Atom wont render the window content without GPU acceleration disabled by starting it with the {{ic|--disable-gpu}} flag, or by editing {{ic|.atom/config.cson}} and adding/changing the config parameter {{ic|useHardwareAcceleration: false}} under the {{ic|editor}} section.<br />
<br />
=== Spell Checker not working ===<br />
Make sure you have hunspell installed with a [https://www.archlinux.org/packages/?sort=&q=hunspell&maintainer=&flagged= suitable dictionary pack].</div>Delapouitehttps://wiki.archlinux.org/index.php?title=Roundcube&diff=548144Roundcube2018-10-17T21:26:46Z<p>Delapouite: add link to PostgreSQL</p>
<hr />
<div>[[Category:Mail server]]<br />
[[Category:Web applications]]<br />
[[ja:Roundcube]]<br />
[https://roundcube.net Roundcube] is a full-featured, [[PHP]] web-based mail client.<br />
<br />
== Installation ==<br />
<br />
Install the {{pkg|roundcubemail}} package.<br />
Further you will need a database (e.g. [[MariaDB]]) and a [[web server]] with [[PHP]]-support (this guide will assume the [[Apache HTTP Server]]).<br />
<br />
== Configuration ==<br />
<br />
=== MariaDB ===<br />
<br />
Here's an example on how you could setup a database for Roundcube with [[MariaDB]] called {{ic|roundcubemail}} for the user {{ic|roundcube}} identified by the password {{ic|password}}:<br />
<br />
{{hc|$ mysql -u root -p|<br />
CREATE DATABASE roundcubemail;<br />
GRANT ALL PRIVILEGES ON roundcubemail.* TO 'roundcube'@'localhost' IDENTIFIED BY 'password';<br />
}}<br />
<br />
For any database you use, you will need to initialize the roundcubemail database tables. Here is an example of how to do this with [[MariaDB]]:<br />
<br />
$ mysql -u root -p roundcubemail < /usr/share/webapps/roundcubemail/SQL/mysql.initial.sql<br />
<br />
=== SQLite ===<br />
<br />
A SQLite DB will be created automagically by Roundcube. Ensure the file specified in the configuration is located in a basedir location. Consider adding /var/lib/roundcubemail to your basedir definition. This implies creating the directory and chowning it to http.<br />
<br />
=== Other Databases ===<br />
<br />
Roundcubemail has installation scripts for mssql, Oracle, and [[PostgreSQL]].<br />
<br />
=== Roundcube ===<br />
<br />
Copy the example configuration file and adjust it to your configuration:<br />
<br />
# cp /etc/webapps/roundcubemail/config/config.inc.php.sample /etc/webapps/roundcubemail/config/config.inc.php<br />
<br />
Set your mail server settings, and set {{ic|enable_installer}} to enable the setup wizard:<br />
<br />
{{hc|/etc/webapps/roundcubemail/config/config.inc.php|<nowiki><br />
$config['db_dsnw'] = 'mysql://roundcube:****@localhost/roundcubemail';<br />
$config['default_host'] = 'tls://localhost'; // IMAP host<br />
$config['smtp_server'] = 'tls://localhost';<br />
$config['smtp_port'] = 587;<br />
$config['des_key'] = 'some_awesome_long_semi_random_string';<br />
$config['enable_installer'] = true;<br />
</nowiki>}}<br />
<br />
For roundcube to be able to detect mime-types from filename extensions you need to point it to a mime.types file. Apache usually comes with one.<br />
<br />
# cp /etc/httpd/conf/mime.types /etc/webapps/roundcubemail/config/mime.types<br />
# chown http:http /etc/webapps/roundcubemail/config/mime.types<br />
<br />
{{hc|/etc/webapps/roundcubemail/config/config.inc.php|<nowiki><br />
$config['mime_types'] = '/etc/webapps/roundcubemail/config/mime.types';<br />
</nowiki>}}<br />
<br />
If you are not using Apache, check the information available in /etc/webapps/roundcubemail/config/defaults.inc.php .<br />
<br />
=== PHP ===<br />
<br />
Make sure to adjust following variables to these minimal values in your PHP configuration:<br />
<br />
{{hc|/etc/php/php.ini|<nowiki><br />
date.timezone = "UTC"<br />
</nowiki>}}<br />
<br />
and uncomment<br />
extension=iconv<br />
<br />
'''If''' you have configured {{ic|open_basedir}} in {{ic|php.ini}}, make sure it includes {{ic|/etc/webapps}} and {{ic|/usr/share/webapps}}, so PHP can open the required Roundcube files. If {{ic|open_basedir}} is disabled/commented out (the default setting), you don't have to do anything.<br />
<br />
=== Webserver (Apache) ===<br />
<br />
Copy the configuration file for Apache to its configuration directory:<br />
<br />
# cp /etc/webapps/roundcubemail/apache.conf /etc/httpd/conf/extra/roundcube.conf<br />
<br />
And include it at the bottom of<br />
<br />
{{hc|/etc/httpd/conf/httpd.conf|<nowiki><br />
Include conf/extra/roundcube.conf<br />
</nowiki>}}<br />
<br />
Restart Apache ({{ic|httpd.service}}).<br />
<br />
=== Webserver (Nginx) ===<br />
<br />
{{Warning|This is an example configuration of RoundCube running in an subdirectory of the web root and has been compiled based on experiments with information from multiple sources, proceed with caution}}<br />
<br />
{{Note|This assumes you already have a working [[nginx]] server setup with [[Nginx#FastCGI|php-fpm]].}}<br />
<br />
Add a location block for RoundCube<br />
<br />
{{hc|/etc/nginx.conf|<nowiki><br />
location /webmail {<br />
alias /usr/share/webapps/roundcubemail;<br />
access_log /var/log/nginx/roundcube_access.log;<br />
error_log /var/log/nginx/roundcube_error.log;<br />
# Favicon<br />
location ~ ^/webmail/favicon.ico$ {<br />
root /usr/share/webapps/roundcubemail/skins/classic/images;<br />
log_not_found off;<br />
access_log off;<br />
expires max;<br />
}<br />
# Robots file<br />
location ~ ^/webmail/robots.txt {<br />
allow all;<br />
log_not_found off;<br />
access_log off;<br />
}<br />
# Deny Protected directories <br />
location ~ ^/webmail/(config|temp|logs)/ {<br />
deny all;<br />
}<br />
location ~ ^/webmail/(README|INSTALL|LICENSE|CHANGELOG|UPGRADING)$ {<br />
deny all;<br />
}<br />
location ~ ^/webmail/(bin|SQL)/ {<br />
deny all;<br />
}<br />
# Hide .md files<br />
location ~ ^/webmail/(.+\.md)$ {<br />
deny all;<br />
}<br />
# Hide all dot files<br />
location ~ ^/webmail/\. {<br />
deny all;<br />
access_log off;<br />
log_not_found off;<br />
}<br />
#Roundcube fastcgi config<br />
location ~ /webmail(/.*\.php)$ {<br />
include fastcgi.conf;<br />
fastcgi_pass unix:/run/php-fpm/php-fpm.sock;<br />
fastcgi_split_path_info ^/webmail/(.+\.php)(/.*)$;<br />
fastcgi_index index.php;<br />
fastcgi_param SCRIPT_FILENAME /usr/share/webapps/roundcubemail/$fastcgi_script_name;<br />
fastcgi_param PATH_INFO $fastcgi_path_info;<br />
fastcgi_param PHP_VALUE open_basedir="/tmp/:/var/cache/roundcubemail:/usr/share/webapps/roundcubemail:/etc/webapps/roundcubemail:/usr/share/pear/:/var/log/roundcubemail";<br />
}<br />
}<br />
</nowiki>}}<br />
<br />
Finally [[restart]] the {{ic|nginx.service}} unit.<br />
<br />
== Install Roundcube ==<br />
<br />
Finally you can visit the Roundcube installation wizard in your browser: http://localhost/roundcube/installer<br />
<br />
For security reasons, you should '''disable the installer when you have completed the wizard''': remove {{ic|1=$config['enable_installer'] = true;}} from {{ic|config.inc.php}}. <br />
<br />
Because the {{ic|~/roundcube/config}} directory contains sensitive information about your server, it's also a good idea to disallow access to this directory by adding these lines, too.<br />
<br />
{{hc|/etc/httpd/conf/extra/roundcube.conf|<nowiki><br />
<Directory /usr/share/webapps/roundcubemail/config><br />
Options -FollowSymLinks<br />
AllowOverride None<br />
Require all denied<br />
</Directory><br />
</nowiki>}}<br />
<br />
== Tips and tricks ==<br />
<br />
=== Setting Roundcube up for use with an IMAP/SMTP server that only allows TLS authentication ===<br />
<br />
It is quite common for modern IMAP/SMTP servers to only allow encrypted authentication, say using STARTTLS. '''If you are setting Roundcube up for TLS authentication, the web-based installer won't help you.''' You will need to edit the {{ic|/etc/webapps/roundcubemail/config/config.inc.php}} by hand, adding the following lines:<br />
<br />
$config['default_host'] = 'tls://mail.my_domain.org';<br />
// For STARTTLS IMAP<br />
$config['imap_conn_options'] = array(<br />
'ssl' => array(<br />
'verify_peer' => true,<br />
// certificate is not self-signed if cafile provided<br />
'allow_self_signed' => false,<br />
'cafile' => '/etc/ssl/certs/Your_CA_certificate.pem',<br />
// For Letsencrypt use the following two lines and remove the 'cafile' option above.<br />
//'ssl_cert => '/etc/letsencrypt/live/mail.my_domain.org/fullchain.pem'<br />
//'ssl_key' => '/etc/letsencrypt/live/mail.my_domain.org/privkey.pem'<br />
// probably optional parameters<br />
'ciphers' => 'TLSv1+HIGH:!aNull:@STRENGTH',<br />
'peer_name' => 'mail.my_domain.org',<br />
),<br />
);<br />
// For STARTTLS SMTP<br />
$config['smtp_conn_options'] = array(<br />
'ssl' => array(<br />
'verify_peer' => true,<br />
// certificate is not self-signed if cafile provided<br />
'allow_self_signed' => false,<br />
'cafile' => '/etc/ssl/certs/Your_CA_certificate.pem',<br />
// For Letsencrypt use the following two lines and remove the 'cafile' option above.<br />
//'ssl_cert => '/etc/letsencrypt/live/mail.my_domain.org/fullchain.pem'<br />
//'ssl_key' => '/etc/letsencrypt/live/mail.my_domain.org/privkey.pem'<br />
// probably optional parameters<br />
'ciphers' => 'TLSv1+HIGH:!aNull:@STRENGTH',<br />
'peer_name' => 'mail.my_domain.org',<br />
),<br />
);<br />
<br />
<br />
where {{ic|mail.my_domain.org}} is the {{ic|CN}} host name in your SSL certificate (i.e. the hostname of your IMAP server), and {{ic|/etc/ssl/certs/Your_CA_certificate.pem}} is the path to your SSL certificate. You might need to adjust the {{ic|ciphers}} element to correspond to the ciphers allowed by your IMAP server.<br />
<br />
A complete list of PHP SSL configuration options [http://php.net/manual/en/context.ssl.php can be found here].<br />
<br />
=== PDF and OpenDocument file preview ===<br />
<br />
The following Roundcube extensions enable you to preview PDF or OpenDocument file attachements.<br />
<br />
Install the {{AUR|roundcubemail-plugins-kolab}} package and adjust following configuration file to enable the extensions.<br />
<br />
{{hc|/etc/webapps/roundcubemail/config/config.inc.php|<nowiki><br />
$config['plugins'] = array(<br />
'pdfviewer',<br />
'odfviewer'<br />
);<br />
</nowiki>}}<br />
<br />
If you encounter any file permission issues, than try this command:<br />
{{bc|chown -R http:http /usr/share/webapps/roundcubemail/plugins/odfviewer/files}}<br />
<br />
=== Calendar Support ===<br />
<br />
Install the {{AUR|roundcubemail-plugins-kolab}} package.<br />
<br />
==== Update the roundcube database ====<br />
<br />
# mysql -u root -p roundcubemail < /usr/share/webapps/roundcubemail/plugins/calendar/drivers/database/SQL/mysql.initial.sql<br />
<br />
==== Configure the calendar service ====<br />
<br />
The default configuration should suffice for most applications, however we still need to move it into place.<br />
# cp /usr/share/webapps/roundcubemail/plugins/calendar/config.inc.php.dist /usr/share/webapps/roundcubemail/plugins/calendar/config.inc.php<br />
<br />
==== Sabre\VObject\Property\Text Not Found ====<br />
<br />
If you get this error, it means that either Sabre was not included with the plugin or it is out of date<br />
# cd /usr/share/webapps/roundcubemail ; composer update ; composer require sabre/dav ~3.1.3<br />
<br />
==== Enable the Plugin ====<br />
<br />
{{hc|/etc/webapps/roundcubemail/config/config.inc.php|<nowiki><br />
$config['plugins'] = array(<br />
'calendar'<br />
);<br />
</nowiki>}}<br />
<br />
=== Synchronize address book with CardDav contacts ===<br />
<br />
It's useful to use the Roundcube address book to have auto-completion features for address fields etc. If you have your contacts stored somewhere else and the remote application offers a CardDav server for synchronization, then you can use the {{AUR|roundcube-rcmcarddav}} extension from the [[AUR]] to access your remote address book in Roundcube. To enable it, adjust following lines in your config file:<br />
{{hc|/etc/webapps/roundcubemail/config/config.inc.php|<nowiki><br />
$config['plugins'] = array(<br />
'carddav'<br />
);</nowiki>}}<br />
Further usage instructions can be found [https://github.com/blind-coder/rcmcarddav here].<br />
<br />
== Troubleshooting ==<br />
<br />
=== SMTP Error: Authentication failure ===<br />
You may first try to disable(comment) the following settings in ''config.inc.php'' as shown:<br />
//$config['smtp_user'] = '%u';<br />
//$config['smtp_pass'] = '%p';<br />
<br />
== See also ==<br />
* [https://github.com/roundcube/roundcubemail/wiki/Configuration The Roundcube Howto Config Wiki page]<br />
* [http://roundcube.net Offical web page]<br />
* [https://github.com/roundcube/roundcubemail/wiki/Installation Official installation manual]</div>Delapouitehttps://wiki.archlinux.org/index.php?title=X_keyboard_extension&diff=545674X keyboard extension2018-10-02T19:24:46Z<p>Delapouite: add link to rxvt</p>
<hr />
<div>[[Category:X server]]<br />
[[Category:Keyboard configuration]]<br />
[[ja:X KeyBoard extension]]<br />
The [[Wikipedia:X keyboard extension|X keyboard extension]], or XKB, defines the way keyboards codes are handled in X,<br />
and provides access to internal translation tables.<br />
It is the basic mechanism that allows using multiple keyboard layouts in X.<br />
<br />
This article describes how to modify and create keyboard layouts.<br />
If you are looking for how to configure your keyboard,<br />
see [[Keyboard configuration in Xorg]].<br />
<br />
== Precautions and preparations ==<br />
<br />
It is easy to end up disabling some keys on your keyboard for the current X session<br />
while working with XKB.<br />
Make sure you have some way to terminate the session without using your keyboard.<br />
<br />
While it is rare, changing XKB configuration can sometimes hang or crash X server.<br />
Make sure you can handle it.<br />
Having some way to killall X or reboot the host remotely may be a good idea.<br />
<br />
Stop {{pkg|xxkb}}, or any other layout switching applications. xxkb actively changes XKB state.<br />
Debugging both at the same time is not a good idea.<br />
<br />
== Getting and setting XKB layout ==<br />
<br />
=== Using rules ===<br />
<br />
Look inside {{ic|/usr/share/X11/xkb/rules/}} for {{ic|*.lst}} files or the [http://www.x.org/wiki/XKB/ XKB Homepage] to get ideas on how to configure rules. Your own configurations can go in {{ic|/etc/X11/xorg.conf.d/}}.<br />
<br />
For example one may want to remap their {{ic|Caps Lock}} key to {{ic|Escape}}:<br />
<br />
{{hc|90-custom-kbd.conf|<br />
Section "InputClass"<br />
Identifier "keyboard defaults"<br />
MatchIsKeyboard "on"<br />
<br />
Option "XKbOptions" "caps:escape"<br />
EndSection<br />
}}<br />
<br />
=== Using keymap ===<br />
<br />
Use {{man|1|xkbcomp}} (package {{Pkg|xorg-xkbcomp}}) to manipulate XKB data. To get current configuration, run<br />
<br />
xkbcomp $DISPLAY output.xkb<br />
<br />
To upload the data back to the server, run<br />
<br />
xkbcomp input.xkb $DISPLAY<br />
<br />
Note that without {{ic|$DISPLAY}} argument xkbcomp will try to compile .xkb file into (mostly useless) .xkm<br />
file, without uploading anything to the server. It will, however, check the syntax and report errors.<br />
<br />
Once the layout is ready, save it as {{ic|~/.Xkeymap}} and make {{ic|~/.xinitrc}} load it on startup:<br />
<br />
test -f ~/.Xkeymap && xkbcomp ~/.Xkeymap $DISPLAY<br />
<br />
The actual file name is irrelevant. Note that unlike standard system-wide configuration via {{ic|xorg.conf}},<br />
this is a per-user keymap.<br />
Also, there is no problem changing XKB configuration while X is running.<br />
<br />
== Basic information on XKB ==<br />
<br />
The core XKB functionality is quite simple, and it's necessary to have a some ideas on<br />
how it works before starting working on the keymaps.<br />
<br />
=== Tools and values ===<br />
<br />
Use xev (package {{pkg|xorg-xev}}) to get keycodes and to check how your keymap works. <br />
<br />
$ xev -event keyboard<br />
<br />
Sample output:<br />
<br />
KeyPress event, serial 45, synthetic NO, window 0x2200001,<br />
root 0xad, subw 0x0, time 183176240, (796,109), root:(867,413),<br />
state 0x1, keycode 21 (keysym 0x2b, plus), same_screen YES,<br />
XLookupString gives 1 bytes: (2b) "+"<br />
XmbLookupString gives 1 bytes: (2b) "+"<br />
XFilterEvent returns: False<br />
<br />
Note keycode 21, state 0x1 and keysym 0x2b aka plus.<br />
Keycode 21 is what input device supplied to X, typically a physical key index of some sort.<br />
The state represents modifier keys, 0x01 is Shift.<br />
Keycode together with the state value is what X sends to the application in XKeyEvent(3) structure.<br />
Keysym and corresponding string is what the client obtained using XLookupString(3) and friends.<br />
<br />
The bits in the state field have pre-defined names: {{ic|Shift}}, {{ic|Lock}}, {{ic|Control}}, {{ic|Mod1}}, {{ic|Mod2}},<br />
{{ic|Mod3}}, {{ic|Mod4}} and {{ic|Mod5}},<br />
lowest to highest. Thus, {{ic|Ctrl+Shift}} is 0x05, and so on. Client applications typically only check the bits<br />
they need, so an application with normal keyboard input and {{ic|Ctrl+key}} shortcuts usually<br />
makes no distinction between {{ic|Control}} and {{ic|Control+Mod3}} states.<br />
<br />
Keysyms are numeric, too. A lot of them have names, declared in {{ic|/usr/include/X11/keysymdef.h}}<br />
with {{ic|KP_}} prefix. However, the number is what clients actually receive.<br />
Keysyms are only important when an application expects some particular values; typically<br />
that is keys like arrows, Enter, Backspace, F-keys, and various shortcuts.<br />
For the rest, the string is used.<br />
<br />
=== Keycode translation ===<br />
<br />
XKB works mostly at the XLookupString stage,<br />
transforming incoming keycode into keysym according to its own internal state, which is <br />
group and state values:<br />
<br />
(keycode, group, state) → keysym<br />
<br />
Group typically represents a "layout", as in US-English, French-AZERTY, Russian, Greek etc.<br />
There can be at most 4 groups.<br />
<br />
Internally, the translation involves additional steps:<br />
<br />
(keycode [, group]) → type<br />
(state, type) → level<br />
(keycode, group, level) → S[keycode][group][level]<br />
<br />
with {{ic|S}} being the translation table (actually called {{ic|xkb_symbols}}, see below).<br />
<br />
Types are used to tell which modifiers affect which keys; essentially it's a way to reduce the third dimension<br />
of {{ic|S}}. For example, a typical alphanumeric key is only affected by {{ic|Shift}}, so its type is set to {{ic|TWO_LEVEL}}, and<br />
<br />
(state, TWO_LEVEL) → level = ((state >> 0) & 0x01) = state & 0x01<br />
<br />
is either 0 or 1. Thus it's {{ic|S[keycode][0..4][0..1]}} instead of {{ic|S[keycode][0..4][0..256]}}.<br />
<br />
=== Keysyms and states ===<br />
<br />
In X terms, {{ic|a}} and {{ic|Ctrl+a}} means same keysym and different states,<br />
but {{ic|a}} and {{ic|A}} are different keysyms.<br />
<br />
Generally it is XKB task to provide different keysyms, but states are handled later<br />
by individual applications.<br />
<br />
Also, states in XKB have somewhat delayed effect, that is, you must have the state set<br />
prior to pressing a key.<br />
<br />
Example: {{ic|Ctrl+h}} can be configured to act as backspace in [[rxvt]] (application setting). This<br />
way rxvt will receive {{ic|h}} keysym with {{ic|Control}} bit set in the state value, and it will be clearly<br />
different from {{ic|Backspace}} keysym.<br />
Alternatively, XKB can be used to make {{ic|Ctrl+h}} combination generate {{ic|Backspace}} keysym with {{ic|Control}} bit set;<br />
in this case, rxvt will not see any difference between physical {{ic|Backspace}} key and {{ic|h}} key as<br />
long as {{ic|Ctrl}} key is pressed.<br />
Making {{ic|Ctrl+h}} combination generate {{ic|Backspace}} keysym with no {{ic|Control}} bit set is an XKB task, too,<br />
but it's much more difficult to implement than {{ic|Control+Backspace}}.<br />
<br />
=== Actions ===<br />
<br />
Keysym obtained from the table above can also trigger some action:<br />
<br />
(keysym, state) → action<br />
<br />
For XKB, setting or locking a modifier bit is an action, and so is any X server interaction<br />
like switching consoles, terminating the server, moving pointer etc.<br />
Actions do not generally affect keysyms, and generating a keysym is not an action.<br />
<br />
There is only one possible action for each (keysym, state) pair.<br />
<br />
== Editing the layout ==<br />
<br />
Start with whatever default configuration your server has. Whenever possible, make the changes<br />
gradually and test them.<br />
<br />
The .xkb file produced by xkbcomp is a simple text file.<br />
C++ style comments, // till the end of line, are allowed. <br />
Section names, as in xkb_keycodes "name-here", are irrelevant at this point and can be omitted.<br />
<br />
=== xkb_keycodes ===<br />
<br />
Keycode definition. The rest of the file does not use numeric keycodes, only symbolic keylabels<br />
defined in this section.<br />
<br />
It's a good idea to leave only those keys the keyboard in question actually has here.<br />
<br />
The labels themselves are arbitrary. They are only used in xkb_symbols section later.<br />
<br />
=== xkb_types ===<br />
<br />
This section comes before xkb_symbols, so take a look, but try not to make changes yet.<br />
Standard types depend a lot on virtual modifiers, which will be explained later.<br />
For now, just find the types you need. <br />
Start with the following: ONE_LEVEL, TWO_LEVEL, ALPHABETIC.<br />
<br />
ONE_LEVEL keys are not affected by modifiers; typically it's Enter, Space, Escape, F keys,<br />
Shift/Alt/Ctrl keys and so on.<br />
TWO_LEVEL and ALPHABETIC keys produce different keysyms depending on Shift state. All<br />
alphanumeric keys are of these types. ALPHABETIC additionally respects CapsLock.<br />
<br />
Type description themselves are quite simple. The line<br />
<br />
modifiers= Shift+NumLock+LevelThree;<br />
<br />
means keys of this type are affected by Shift, NumLock and LevelThree bits only.<br />
Map lines like<br />
<br />
map[Shift+LevelThree]= Level4;<br />
<br />
define which combination corresponds to which level value. xkbcomp uses "LevelN"<br />
when dumping the data, but short and much more convenient "N" can be used as well.<br />
<br />
level_name lines are irrelevant and can be ignored.<br />
<br />
=== xkb_compatibility ===<br />
<br />
Action definitions ({{ic|interpret}}) and keyboard LEDs ({{ic|indicator}}) among other things.<br />
You can remove stuff you do not have or do not use, like keypad actions, mouse<br />
control or extra modifiers.<br />
<br />
Note that {{ic|key+AnyOfOrNone(all)}} is equivalent to just {{ic|key}}, but {{ic|key}} is much easier<br />
to read.<br />
<br />
Check groups switching if you need it. {{ic|1=LockGroup(group=N)}} can be useful if you have<br />
four groups, otherwise {{ic|ISO_Next_Group}}/{{ic|ISO_Prev_Group}} are enough. {{ic|LatchGroup}} can be<br />
useful for unusual setups.<br />
<br />
=== xkb_symbols ===<br />
<br />
The main section that defines what each key does. Syntax:<br />
<br />
key <LABL> { [ G1L1, G1L2, G1L3, ... ], [ G2L1, G2L2, G2L3, ... ], ... }<br />
<br />
{{ic|<LABL>}} is keylabel from xkb_keycodes section, {{ic|GiLj}} is keysym for group i level j.<br />
The number of keysyms in each group must match the number of levels defined for this type<br />
({{ic|xkbcomp}} will warn you if it does not).<br />
<br />
Check {{ic|/usr/include/X11/keysymdef.h}} for the list of possible keysyms.<br />
Aside from those listed, you can also use {{ic|Unnnn}} for Unicode symbol with hex code nnnn, e.g.<br />
{{ic|U0301}} for combining acute accent. Note that {{ic|a}} and {{ic|U0061}} are treated differently (for instance,<br />
most applications expect {{ic|Ctrl+a}}, not {{ic|Ctrl+U0061}} because their numeric values are different.<br />
<br />
Key types are also specified here, either as<br />
<br />
key.type = "T1";<br />
key <...> { ... };<br />
key <...> { ... };<br />
key <...> { ... };<br />
key.type = "T2";<br />
key <...> { ... };<br />
key <...> { ... };<br />
<br />
or individually for each key:<br />
<br />
key <...> { type = "T", [ .... ], [ .... ] };<br />
<br />
Key type may be different in different groups. This is somewhat counter-intuitive, but<br />
actually has some useful applications. To set types for each group, use this:<br />
<br />
key <...> { type[1] = "T1", type[2] = "T2", [ ... ], [ ... ] };<br />
<br />
You can set labels for the groups using<br />
<br />
name[1] = "EN"; // group 1<br />
name[2] = "RU"; // group 2<br />
name[3] = "UA"; // group 3<br />
<br />
This is what xxkb will show if labels are enabled there.<br />
<br />
The section also contains {{ic|modifier_map}} lines. Leave them alone for now,<br />
or check Virtual Modifiers below.<br />
<br />
=== xkb_geometry ===<br />
<br />
A completely irrelevant section describing physical keyboard layout.<br />
Can be deleted without any consequences.<br />
<br />
== Basic examples ==<br />
<br />
Check your existing layout first, as it likely contains standard definition for many common keys.<br />
<br />
Thoughout the text, "xkb_keycodes { text }" means "text" should be added<br />
to xkb_keycodes section.<br />
Whenever it's clear from context, section names are omitted.<br />
<br />
=== Simple key assignment ===<br />
<br />
Enabling additional (aka multimedia) keys:<br />
<br />
xkb_keycodes {<br />
<VOL-> = 122; // check with xev<br />
<VOL+> = 123;<br />
}<br />
<br />
xkb_symbols {<br />
key.type = "ONE_LEVEL";<br />
key <VOL-> { [ XF86AudioLowerVolume ] };<br />
key <VOL+> { [ XF86AudioRaiseVolume ] };<br />
}<br />
<br />
Escape on CapsLock, for Vim users mostly:<br />
<br />
key.type = "ONE_LEVEL";<br />
key <CAPS> { [ Escape ] };<br />
<br />
Exchanging Ins and PrintScreen (in case they are reversed — happens on Dell laptop keyboards):<br />
<br />
key.type = "ONE_LEVEL";<br />
key <IN?> { [ Print ] };<br />
key <PRSC> { [ Insert ] };<br />
<br />
On some HP laptop keyboards, the above does not work. Instead, the keycodes themselves must be redefined:<br />
<br />
partial xkb_keycodes "insert" {<br />
alias <I118> = <IN?>;<br />
&lt;INS&gt; = 218;<br />
<I218> = 118;<br />
};<br />
<br />
Changing shift to a sticky key version:<br />
<br />
replace<br />
<br />
key <LFSH> { [ Shift_L ] };<br />
<br />
with<br />
<br />
key <LFSH> { [ ISO_Level2_Latch ] };<br />
<br />
=== Multiple layouts ===<br />
<br />
For regular alphanumeric keys, just add a second/third/fourth [ ] section to the key definition:<br />
<br />
key.type = "ALPHABETIC";<br />
key <AD01> { [ q, Q ], [ a, A ] }; // QWERTY-AZERTY<br />
<br />
key <AC02> { [ s, S ], // two cyrillic layouts<br />
[ U044B, U042B ],<br />
[ U0456, U0406 ] };<br />
<br />
Layout switching is done by triggering action LockGroup:<br />
<br />
interpret ISO_Next_Group { action = LockGroup(group=+1); };<br />
interpret ISO_Prev_Group { action = LockGroup(group=-1); };<br />
<br />
Typically this means placing ISO_Next_Group and ISO_Prev_Group<br />
keysyms in correct group/level positions. Note that groups wrap, so if you have two groups and hit<br />
ISO_Next_Group twice, you will return to the group you started with.<br />
<br />
Cyclic switching between two or more layouts with a dedicated key:<br />
<br />
key.type = "ONE_LEVEL";<br />
key <RWIN> { [ ISO_Next_Group ] }<br />
<br />
If you have more than two layouts and some keys to spare, it may be a better idea to have a dedicated<br />
key for each layout. Example for three layouts:<br />
<br />
key.type = "ONE_LEVEL";<br />
key <RCTL> { [ ISO_Next_Group ], // g1: switch to g2<br />
[ ISO_Prev_Group ], // g2: switch back to g1<br />
[ ISO_Prev_Group ] }; // g3: switch to g2<br />
<br />
key <MENU> { [ ISO_Prev_Group ], // g1: switch to g3<br />
[ ISO_Next_Group ], // g2: switch to g3<br />
[ ISO_Next_Group ] }; // g3: switch back to g1<br />
<br />
With four layouts, you will likely have to use ISO_First_Group and ISO_Last_Group.<br />
<br />
The same idea can be implemented with only one key by utilizing TWO_LEVEL type:<br />
<br />
key.type = "TWO_LEVEL";<br />
key <MENU> { [ ISO_Next_Group, ISO_Prev_Group ], <br />
[ ISO_Prev_Group, ISO_Next_Group ], <br />
[ ISO_Prev_Group, ISO_Next_Group ] }; <br />
<br />
This way it's Menu for group 2 and Shift-Menu for group 3. To use Ctrl or Alt instead of Shift,<br />
replace TWO_LEVEL with PC_CONTROL_LEVEL2 or PC_ALT_LEVEL2 types respectively.<br />
<br />
Switching using two modifier keys (Shift+Shift, Ctrl+Shift etc) can be done by using something other<br />
than ONE_LEVEL for these keys. Shift+Shift example:<br />
<br />
key.type = "TWO_LEVEL";<br />
key <LFSH> { [ Shift_L, ISO_Prev_Group ] };<br />
key <RTSH> { [ Shift_R, ISO_Next_Group ] };<br />
<br />
To latch a group (aka toggle; set for the time you hold the key only), use LatchGroup action typically<br />
bound to ISO_Group_Latch keysym:<br />
<br />
key <RCTL> { [ ISO_Group_Latch ] }<br />
<br />
Adjust ISO_Group_Latch definition in xkb_compatibility section to use the right group:<br />
<br />
interpret ISO_Group_Latch { action = LatchGroup(group=3); };<br />
<br />
Check /usr/share/X11/xkb/symbols/group for more standard examples.<br />
<br />
=== Additional symbols ===<br />
<br />
Typing more with the same keys.<br />
<br />
==== Compose key ====<br />
<br />
Easy to set up and extremely useful for entering common Unicode characters.<br />
<br />
key <RALT> { [ Multi_key ] };<br />
<br />
==== Level3 ====<br />
<br />
The idea is similar to Alt or AltGr in their original meaning: alphanumeric keys<br />
get additional characters, activated by holding down some modifier key.<br />
<br />
First of all, setting up the modifier.<br />
<br />
xkb_symbols { <br />
key <LWIN> { [ISO_Level3_Shift ] };<br />
modifier_map Mod5 { ISO_Level3_Shift };<br />
}<br />
<br />
Also, the following should already be defined in the relevant sections, but in case it is not:<br />
<br />
xkb_compatibility {<br />
interpret ISO_Level3_Shift { action= SetMods(modifiers=Mod5); };<br />
}<br />
<br />
xkb_types {<br />
type "THREE_LEVEL" {<br />
modifiers= Shift+Mod5;<br />
map[Shift]= Level2;<br />
map[Mod5]= Level3;<br />
map[Shift+Mod5]= Level3;<br />
level_name[Level1]= "Base";<br />
level_name[Level2]= "Shift";<br />
level_name[Level3]= "Level3";<br />
};<br />
type "FOUR_LEVEL" {<br />
modifiers= Shift+LevelThree;<br />
map[Shift]= Level2;<br />
map[LevelThree]= Level3;<br />
map[Shift+LevelThree]= Level4;<br />
level_name[Level1]= "Base";<br />
level_name[Level2]= "Shift";<br />
level_name[Level3]= "Alt Base";<br />
level_name[Level4]= "Shift Alt";<br />
};<br />
}<br />
<br />
Note standard definitions have LevelThree instead of Mod5 in xkb_compatibility and xkb_types.<br />
As long as modifier_map above uses Mod5, there is no practical difference, you will end up using Mod5<br />
bit anyway.<br />
<br />
Now, the keys themselves, vi-style cursors in this case:<br />
<br />
key.type = "THREE_LEVEL";<br />
key <AC06> { [ h, H, Left ] };<br />
key <AC07> { [ j, J, Down ] };<br />
key <AC08> { [ k, K, Up ] };<br />
key <AC09> { [ l, L, Right ] };<br />
<br />
As you may find out using xev, this produces Mod5+Left instead of just Left. But that is ok as most<br />
applications ignore state bits they do not use. For an alternative solution, check Overlays below.<br />
<br />
=== Meta, Super and Hyper ===<br />
<br />
==== Real modifiers ====<br />
<br />
Some applications (notably Emacs) allow meaningful use of higher state bits. It is usually assumed<br />
there are modifier keys called Meta, Super and Hyper on the keyboard beside standard Shift, Ctrl and Alt,<br />
which control these bits.<br />
<br />
From XKB point of view this means setting Mod2, Mod3, Mod4 and Mod5 modifier bits. Because all<br />
you need is the bits themselves, there is no need to edit types like in the Level3 example above.<br />
<br />
xkb_compatibility {<br />
interpret Super_L { action = SetMods(modifiers=Mod3); };<br />
}<br />
<br />
xkb_symbols {<br />
key <LWIN> { [ Super_L ] };<br />
modifier_map Mod3 { Super_L };<br />
}<br />
<br />
Standard definitions use Super modifier instead of Mod3 in {{ic|xkb_compatibility}}.<br />
You can keep that, just make sure {{ic|modifier_map}} line is in place.<br />
<br />
Keep in mind there is no strict correspondence between ModN and named modifiers like Super, Hyper or even Alt.<br />
Mod1 is the only one that is widely used; some applications call it Meta, some Alt. For the others,<br />
check how particular application treats state bits, and/or check Virtual modifiers below.<br />
<br />
==== Keysym tracking ====<br />
<br />
At least one application (openbox) is known to track KeyPress/KeyRelease events for Meta_[LR], Super_[LR]<br />
and Hyper_[LR] keysyms instead of relying on the state bits. In such case<br />
<br />
xkb_symbols {<br />
key <LWIN> { [ Super_L ] };<br />
}<br />
<br />
is enough and you can omit {{ic|interpret}} and {{ic|modifier_map}} lines.<br />
<br />
Speaking of Openbox, note it actually allows both methods: "S-h" tracks Super_[LR] events<br />
while "Mod3-h" checks relevant state bit.<br />
<br />
== Preset configuration ==<br />
<br />
XKB is often configured by specifying XkbTypes/XkbCompat/XkbSymbols,<br />
or XkbModel/XkbLayout (+XkbVariant/XkbOptions), or XkbKeymap, typically in<br />
/etc/X11/xorg.conf or /etc/X11/xorg.conf.d/*.conf, like this:<br />
<br />
Option "XkbModel" "thinkpad60" <br />
Option "XkbLayout" "us,sk,de" <br />
Option "XkbVariant" "altgr-intl,qwerty," <br />
Option "XkbOptions" "grp:menu_toggle,grp_led:caps" <br />
<br />
These values define full XKB map (the one that can be dumped by xkbcomp) by combining<br />
several files from {{ic|/usr/share/X11/xkb}}. In fact, equivalent .xkb<br />
file for xkbcomp can be obtained using {{ic|setxkbmap -print}}:<br />
<br />
setxkbmap -model thinkpad60 -layout us,sk,de -variant altgr-intl,qwerty \<br />
-option -option grp:menu_toggle -option grp_led:caps -print<br />
<br />
Note include statements in the output. The files for each section are fetched from<br />
relevant subdirectories under {{ic|/usr/share/X11/xkb}}, i.e.<br />
<br />
xkb_types { include "complete" };<br />
<br />
means xkbcomp will look for {{ic|/usr/share/X11/xkb/types/complete}}. Plus signs mean<br />
concatenation, so<br />
<br />
xkb_keycodes { include "evdev+aliases(qwerty)" };<br />
<br />
means <br />
<br />
xkb_keycodes {<br />
include "evdev";<br />
include "aliases(qwerty)";<br />
};<br />
<br />
Parenthesis select named section from the file. Check<br />
{{ic|/usr/share/X11/xkb/keycodes/aliases}} and note<br />
<br />
xkb_keycodes "qwerty" { ... };<br />
<br />
this is the part {{ic|aliases(qwerty)}} refers to. Finally, colons allow shifting<br />
parts of layout to another group.<br />
<br />
Unlike XkbTypes/XkbCompat/XkbSymbols/XkbGeometry values, which define relevant<br />
.xkb file sections directly, XkbModel, XkbLayout and XkbRules refer to<br />
additional non-xkb files found under {{ic|/usr/share/X11/xkb/rules/}} that match model<br />
and layout values to specific symbols and geometry. XkbKeymap refers to complete<br />
keymaps. Check Ivan Pascal page for detailed description.<br />
<br />
Just like with xkbcomp approach, this kind of configuration can be done<br />
on the fly: use setxkbmap without -print option.<br />
<br />
The files from {{ic|/usr/share/X11/xkb}} are a good source of examples, especially when it<br />
comes to standard keyboard features with nontrivial XKB implementation<br />
(e.g. keypad/NumLock handling). Also, these are the files you have to edit to push<br />
your changes upstream. Check [http://www.freedesktop.org/wiki/Software/XKeyboardConfig/Rules X Keyboard Config Rules] before doing it though.<br />
<br />
=== xmodmap ===<br />
<br />
While sometimes used in conjunction with preset configuration,<br />
[[xmodmap]] is not directly related to XKB. This tool uses different (pre-XKB)<br />
ideas on how keycodes are processed within X; in particular, xmodmap lacks the notion<br />
of groups and types, so trying to set more than one keysym per key is not likely<br />
to work.<br />
<br />
Generally it is not recommended to use xmodmap, except maybe for the simplest tasks.<br />
XKB-compatible equivalent of xmodmap is xkbcomp; however,<br />
xkbcomp lacks -e option, so it is not that simple.<br />
Anyway, whenever possible, xkbcomp should be preferred.<br />
<br />
== Indicators ==<br />
<br />
As in "keyboard LEDs".<br />
Indicator names are used to match the to the physical LEDs in xkb_keycodes section.<br />
Otherwise, they are irrelevant. Indicators not matched to any LED are called "virtual";<br />
xkbvleds (package {{Pkg|xorg-xkbutils}}) can be used to check their state. Example:<br />
<br />
xkb_keycodes {<br />
indicator 1 = "LED1"; // first physical LED<br />
}<br />
<br />
Indicators always reflect specified part of XKB internal state. Two common modes is showing<br />
modifier state:<br />
<br />
xkb_compatibility {<br />
indicator "LED1" { modifiers = Lock; }; // CapsLock indicator<br />
}<br />
<br />
or current group:<br />
<br />
xkb_compatibility {<br />
indicator "LED1" { groups = 0x06; }; // "group 2 or group 3 is active"<br />
}<br />
<br />
The values are bitmasks. For groups, bit 1 is group 1, bit 2 is group 2 and so on.<br />
<br />
== Modifiers and types ==<br />
<br />
At some point it may become necessary to clean up types section, and/or to introduce<br />
unusual types.<br />
<br />
Types and modifiers are tightly connected, so it makes a lot of sense to start with<br />
the modifier bits first, before doing anything with the type descriptions.<br />
<br />
Decide which bits you will use. There are only eight of them, and of those,<br />
Shift, Control and Mod1 are widely used in applications, and Lock (aka CapsLock)<br />
has pre-defined meaning which also may be hard to override.<br />
The remaining four, however, are fair play.<br />
<br />
Warning: four standard types, ONE_LEVEL, TWO_LEVEL, ALPHABETIC and KEYPAD, receive<br />
special treatment in xkbcomp. They may work differently just because they are named<br />
this way. Avoid deleting them. If some changes do not work as expected, try adding a new<br />
type instead.<br />
<br />
=== Using real modifiers in standard types ===<br />
<br />
Depending of your base configuration, there may be a lot of unused standard types<br />
like EIGHT_LEVEL or PC_RCONTROL_LEVEL2.<br />
Remove them to avoid doing unnecessary work.<br />
<br />
Now, some standard types use virtual modifiers. If you decide to use them, check<br />
Virtual modifiers below and skip this section. Otherwise, it's a good idea<br />
to get rid of them completely. Check the types you need, and either replace them<br />
with corresponding real ones, or remove relevant definitions. Example:<br />
<br />
type "KEYPAD" {<br />
modifiers= Shift+NumLock;<br />
map[Shift]= Level2;<br />
map[NumLock]= Level2;<br />
level_name[Level1]= "Base";<br />
level_name[Level2]= "Number";<br />
};<br />
<br />
if you use Mod2 for NumLock, change the type to<br />
<br />
type "KEYPAD" {<br />
modifiers= Shift+Mod2;<br />
map[Shift]= Level2;<br />
map[Mod2]= Level2;<br />
level_name[Level1]= "Base";<br />
level_name[Level2]= "Number";<br />
};<br />
<br />
if you are not going to have NumLock modifier, change it to<br />
<br />
type "KEYPAD" {<br />
modifiers= Shift;<br />
map[Shift]= Level2;<br />
level_name[Level1]= "Base";<br />
level_name[Level2]= "Number";<br />
};<br />
<br />
Do the same in xkb_compatibility section too.<br />
Once it's done, you should be able to remove all "virtual_modifiers" lines in the file.<br />
<br />
=== Switching a single modifier bit ===<br />
<br />
Basically all you need is a keysym with a relevant interpretation entry.<br />
Example for Mod5 switching with {{ic|LWIN}} key, with {{ic|ISO_Level3_Shift}} for keysym:<br />
<br />
xkb_compatibility {<br />
interpret ISO_Level3_Shift { action = SetMods(modifiers=Mod5); };<br />
}<br />
<br />
xkb_symbols {<br />
key <LWIN> { [ISO_Level3_Shift ] };<br />
}<br />
<br />
Aside from {{ic|SetMods}}, you can also use {{ic|LockMods}} or {{ic|LatchMods}}.<br />
{{ic|SetMods}} makes a regular "on while pressed" modifier key.<br />
{{ic|LockMods}} makes an "on/off" switch like CapsLock or NumLock.<br />
{{ic|LatchMods}} means "on until next keypress" aka sticky modifier<br />
<br />
=== modifier_map ===<br />
<br />
Modifier map is a table that maps each of eight modifier bits to at most<br />
4 keys:<br />
<br />
modifier_map Mod1 { Alt_L, Alt_R };<br />
<br />
In the core protocol, without XKB, it means more or less the same thing<br />
as<br />
<br />
interpret Alt_L { action = SetMods(modifiers=Mod1); };<br />
interpret Alt_R { action = SetMods(modifiers=Mod1); };<br />
<br />
XKB does not use modifier map in its original meaning. Within XKB, its<br />
only function is to map virtual modifiers (see below).<br />
<br />
However, the table is easily accessible by clients, and there is one<br />
counter-intuitive (but well-known) trick involving it:<br />
modifier map is used to tell which of ModX bits is Alt.<br />
Because of this, it is a good idea to have one modifier mapped<br />
to Alt_L or Alt_R as shown above. Unless you have very good reasons<br />
to do otherwise, it should be Mod1.<br />
<br />
== Multiple keyboards ==<br />
<br />
XKB allows setting keymap for a single connected physical keyboard only.<br />
This feature can be extremely useful for multi-keyboard setups when keyboards<br />
in question are different; consider a laptop with a full-size USB keyboard attached.<br />
<br />
First of all, use xinput (package {{Pkg|xorg-xinput}}) to get device IDs:<br />
<br />
AT Translated Set 2 keyboard id=11 [slave keyboard (3)]<br />
<br />
Now,<br />
<br />
xkbcomp -i 11 file.xkb $DISPLAY<br />
<br />
or<br />
setxkbmap -device 11 ...<br />
<br />
will set keymap for specified keyboard only. Dumping XKB configuration works too:<br />
<br />
xkbcomp -i 11 $DISPLAY file.xkb<br />
<br />
Note {{ic|xkbcomp -i11}} will not work and will not give a clear error message either. Make sure<br />
you have space after {{ic|-i}}.<br />
<br />
== Debugging XKB ==<br />
<br />
When keys do not work as expected, the first thing to check is XKB internal state:<br />
modifiers, effective group and control bits. All three can be used to drive LEDs;<br />
use xkbvleds to check them<br />
<br />
indicator "LED1" { modifiers = Lock; };<br />
indicator "LED2" { groups = 2; };<br />
indicator "LED3" { controls = audiblebell; };<br />
<br />
Additionally, xkbwatch shows all (real) modifiers together with their lock/latch status.<br />
Modifiers are also reported by xev. Xxkb can be used to monitor effective group, but<br />
make sure two_state mode is off.<br />
<br />
In case interpretations section does not work well, make sure to check for duplicated<br />
"interpret" blocks. Better yet, try commenting out anything related to specific keysym.<br />
See section 9.2 for explanation.<br />
<br />
It also makes sense to check what exactly the server got by downloading the keymap back with<br />
<br />
xkbcomp $DISPLAY out.xkb<br />
<br />
The results tend to be different from the input file. There is no known work-around for this.<br />
<br />
== Virtual Modifiers ==<br />
<br />
One of the most troublesome parts of XKB, virtual modifiers appear prominently<br />
in all standard keymaps, despite being a relatively minor and mostly useless feature.<br />
The term itself is grossly misleading, and most of the docs do not help much either.<br />
<br />
So, first of all: virtual modifiers are not modifiers in the same way real modifiers are.<br />
If anything, it is a way to name some of the real modifiers. They are not 16 more bits<br />
that can be used in level definitions. They are 16 possible names, each referring<br />
to one (or some, or none) of the 8 modifier bits.<br />
<br />
Real modifier bits are called Shift, Lock, Control and Mod1-Mod5. There are no<br />
Alt among them. Virtual modifiers were introduced to allow saying something like<br />
<br />
#define Alt Mod1<br />
<br />
to applications willing to use this information.<br />
<br />
It is possible to make a usable layout without defining virtual modifiers at all.<br />
Among standard modifiers, only Alt/Meta actually need such treatment, because<br />
Shift and Control are real modifiers anyway and NumLock is not normally used as a modifier.<br />
<br />
Also, unlike most of the keymap-related things that affect any application using<br />
basic Xlib functions, virtual modifiers must be queried explicitly using XKBlib<br />
calls. Not all applications actually do that.<br />
<br />
=== Defining virtual modifiers ===<br />
<br />
The mapping between virtual and real modifiers is defined in a rather weird way<br />
using keysyms as a medium. Refer to XKBproto for some reasons behind this.<br />
Real modifiers M are assigned to a key using<br />
<br />
modifier_map M { <keysym> };<br />
<br />
Virtual modifiers V can be assigned to a key using<br />
<br />
interpret <keysym> { virtualMod = V; };<br />
<br />
If a virtual modifier V shares at least one keysym with a real modifier M,<br />
it is bound to M.<br />
<br />
Note that virtual modifier names are not pre-defined and must be declared in <br />
xkb_compatibility and xkb_types sections before using them:<br />
<br />
xkb_compatibility "complete" {<br />
virtual_modifiers LevelThree,NumLock,Alt;<br />
}<br />
<br />
=== Keysym interpretation ===<br />
<br />
Virtual modifiers can be used in interpret <keysym> blocks as if they were<br />
defined to the respective real modifiers. For a virtual modifier V not bound<br />
to any real modifier, this means<br />
<br />
#define V<br />
<br />
type declaration, and <br />
<br />
interpret <key> { }<br />
interpret <key>+V { }<br />
<br />
blocks will be treated as duplicates. Only one of them, the last one in the file, will work.<br />
xkbcomp usually gives a warning in cases like this.<br />
<br />
=== Client side notes ===<br />
<br />
Handling XKB virtual modifiers on the client side requires some non-trivial server interaction.<br />
Most applications just do not bother, sticking with 8 real modifiers supplied in XKeyEvent.state.<br />
<br />
However, it is possible for an application to obtain virtual modifiers associated with a key press.<br />
Gtk, for instance, has [http://www.gtk.org/api/2.6/gdk/gdk-Keyboard-Handling.html#gdk-keymap-translate-keyboard-state gdk-keymap-translate-keyboard-state()]<br />
which may or may not be used in particular application.<br />
<br />
Some others may implement something that looks like virtual modifier support, but actually is not.<br />
Check Openbox example in section 5.3.3.2. Regarding Alt handling, check section 8.3.<br />
<br />
== XKB control bits ==<br />
<br />
A bunch of bit flags affecting various aspects of XKB functionality.<br />
To control them, use {Set,Latch,Lock}Controls actions.<br />
<br />
=== Mouse control ===<br />
<br />
XKB allows controlling mouse pointer from keyboard. When set up properly, it can be extremely<br />
useful. However, its usability depends a lot on particular physical keyboard layout and on<br />
user's individual preferences.<br />
<br />
From XKB point of view it is relatively simple to implement, one should just trigger<br />
relevant actions. Fairly complete implementation can be found in<br />
{{ic|/usr/share/X11/xkb/compat/mousekeys}}.<br />
<br />
Note that the actions will not work unless {{ic|MouseKeys}} control bit is set:<br />
<br />
interpret Pointer_EnableKeys { action= LockControls(controls=MouseKeys); };<br />
<br />
Because most keyboards do not have dedicated mouse control keys, <br />
combining {{ic|MouseKeys}} and one of the {{ic|Overlay}} flags may be a good idea:<br />
<br />
interpret Pointer_EnableKeys { action= LockControls(controls=MouseKeys+Overlay1); };<br />
<br />
This allows moving pointer control keys to appropriate overlay block:<br />
<br />
xkb_keycodes {<br />
<MUP> = 218;<br />
<MDWN> = 212;<br />
<MLFT> = 214;<br />
<MRHT> = 216;<br />
}<br />
<br />
xkb_symbols {<br />
key <UP> { [ Up ], overlay1 = <MUP> };<br />
key <LEFT> { [ Left ], overlay1 = <MLFT> };<br />
key <RGHT> { [ Right ], overlay1 = <MRHT> };<br />
key <DOWN> { [ Down ], overlay1 = <MDWN> };<br />
<br />
key <MUP> { [ Pointer_Up ] };<br />
key <MDWN> { [ Pointer_Down ] };<br />
key <MLFT> { [ Pointer_Left ] };<br />
key <MRHT> { [ Pointer_Right ] };<br />
}<br />
<br />
This way it is possible to assign non-mouse actions to the keys used to control mouse,<br />
and thus, for example, use modifier keys to generate mouse buttons events.<br />
<br />
== Local XKB folder ==<br />
<br />
You can set an X keymap from a local file using the following command:<br />
<br />
$ xkbcomp keymap.xkb $DISPLAY<br />
<br />
where {{ic|keymap.xkb}} must have a structure like<br />
<br />
{{hc|keymap.xkb|<br />
xkb_keymap {<br />
xkb_keycodes { ... };<br />
xkb_types { ... };<br />
xkb_compat { ... };<br />
xkb_symbols { ... };<br />
<br />
// Geometry is completely optional.<br />
// xkb_geometry { include "pc(pc104)" };<br />
};<br />
}}<br />
<br />
You can use ''includes'' from this file, where the inclusion refer to a local folder instead of {{ic|/usr/share/X11/xkb}}. You need to use the {{ic|-I/path/}} parameter of xkbcomp for that. Full example:<br />
<br />
$ xkbcomp -I$HOME/.xkb $HOME/.keymap.xkb $DISPLAY<br />
<br />
{{hc|$HOME/.keymap.xkb|<br />
xkb_keymap {<br />
xkb_keycodes { include "evdev+aliases(qwerty)" };<br />
xkb_types { include "complete" };<br />
xkb_compat { include "complete" };<br />
xkb_symbols { include "pc+custom+inet(evdev)" };<br />
};<br />
}}<br />
<br />
The symbol file must have the same name as specified in the {{ic|xkb_symbols}} right above.<br />
{{hc|$HOME/.xkb/symbols/custom|<br />
partial alphanumeric_keys xkb_symbols "custom" { ... };<br />
}}<br />
<br />
== Troubleshooting ==<br />
<br />
=== I have an USB keyboard and the settings get lost upon unplugging it ===<br />
<br />
Using [[#Using rules|rules]] instead of static keymap configuration will give you a more flexible and permanent key mapping that doesn't need to be reloaded manually (or by a script).<br />
<br />
== See also ==<br />
<br />
* [https://www.x.org/releases/current/doc/xorg-docs/input/XKB-Config.html The XKB Configuration Guide]<br />
* http://www.x.org/wiki/XKB<br />
* [http://www.charvolant.org/~doug/xkb/html/index.html An Unreliable Guide To XKB Configuration].<br />
* [http://pascal.tsu.ru/en/xkb/ Ivan Pascal XKB docs]. One of the oldest and most well-known guides. Focuses a lot on details, and explains some of exotic XKB features.<br />
* [http://www.x.org/releases/current/doc/kbproto/xkbproto.pdf XKB protocol specification]. Comprehensive description of all XKB features. Extremely useful for understating how XKB works, includes a good description of virtual modifiers among other things. Some practice with xkbcomp is strongly recommended though, because the features are described on protocol level.</div>Delapouitehttps://wiki.archlinux.org/index.php?title=Copying_text_from_a_terminal&diff=536873Copying text from a terminal2018-08-23T06:37:02Z<p>Delapouite: add link to tee</p>
<hr />
<div>[[Category:Terminal emulators]]<br />
[[ja:ターミナルからテキストをコピー]]<br />
Most mature terminal emulators permit users to copy or save their contents.<br />
<br />
== General approach ==<br />
<br />
In graphical terminal emulators, contents are typically selectable by mouse, and can then be copied using the context menu, ''Edit'' menu or a key combination such as {{ic|Ctrl+Shift+C}}.<br />
<br />
=== Terminals without CLIPBOARD selection ===<br />
<br />
Some emulators do not support the [[Clipboard#Background|CLIPBOARD selection]] natively, and copy data to the PRIMARY selection. For them {{Pkg|xclip}} may be used:<br />
<br />
$ xclip -o | xclip -selection clipboard -i<br />
<br />
The above command reads data from the PRIMARY selection and writes it to CLIPBOARD selection.<br />
<br />
Other [[clipboard manager]]s such as {{Pkg|autocutsel}} provide automatic synchronization between selection buffers.<br />
<br />
=== Intercepting commands’s output ===<br />
<br />
Use [https://en.wikipedia.org/wiki/Tee_(command) tee] to intercept the output of a command.<br />
<br />
$ command 2>&1 | tee output-file<br />
<br />
After the {{ic|command}} is executed, {{ic|output-file}} will contain its output.<br />
<br />
=== Accessing Linux terminal backlog ===<br />
<br />
The backlog of a native terminal named {{ic|/dev/ttyN}} may be accessed via {{ic|/dev/vcsN}}.<br />
Hence, if one is working in {{ic|/dev/tty1}}, the following snippet will let store the backlog in a file {{ic|output-file}}:<br />
<br />
# cat /dev/vcs1 >output-file<br />
<br />
== A cheatsheet for common emulators ==<br />
<br />
{{Accuracy|Some "No" entries in this table may be wrong.|section=A cheatsheet for common emulators: "No" entries factual accuracy}}<br />
<br />
Unless the ''Key combination'' column states otherwise, the key combination is {{ic|Ctrl+Shift+c}}.<br />
<br />
{| class="wikitable sortable"<br />
! rowspan="2" | Emulator !! rowspan="2" | Select to PRIMARY<br />
! colspan="5" |CLIPBOARD<br />
|-<br />
! Key combination !! Context menu !! Window menu !! Select<br />
|-<br />
| {{AUR|aterm}} || {{Yes}} || {{No}} || {{No}} || {{No}}|| {{No}}<br />
|-<br />
| {{AUR|eterm}} || {{Yes}} || {{No}} || {{No}} || {{No}}|| {{No}}<br />
|-<br />
| {{AUR|germinal}} || {{Yes}} || {{Yes}} || {{Yes}} || {{No}}|| {{No}}<br />
|-<br />
| [[Guake]] || {{Yes}} || {{Yes}} || {{Yes}} || {{No}}|| {{No}}<br />
|-<br />
| {{Pkg|konsole}} || {{Yes}} || {{Yes}} || {{Yes}} || {{Yes}}|| {{Y|Optional}}<br />
|-<br />
| {{AUR|lilyterm-git}} || {{Yes}} || {{Yes}} {{ic|Ctrl+Delete}} || {{Yes}} || {{No}}|| {{No}}<br />
|-<br />
| {{Pkg|lxterminal}} || {{Yes}} || {{Yes}} || {{Yes}} || {{Yes}}|| {{No}}<br />
|-<br />
| {{Pkg|mate-terminal}} || {{Yes}} || {{Yes}} || {{Yes}} || {{Yes}}|| {{No}}<br />
|-<br />
| {{AUR|mlterm}} || {{Yes}} || {{No}} || {{No}} || {{No}}|| {{Yes}}<br />
|-<br />
| {{Pkg|pantheon-terminal}} || {{Yes}} || {{Yes}} || {{Yes}} || {{No}}|| {{No}}<br />
|-<br />
| [[PuTTY]] || {{Yes}} || {{No}} || {{No}} || {{No}}|| {{No}}<br />
|-<br />
| {{Pkg|qterminal}} || {{Yes}} || {{Yes}} || {{Yes}} || {{Yes}}|| {{No}}<br />
|-<br />
| {{AUR|roxterm}} || {{Yes}} || {{Yes}} || {{Yes}} || {{Yes}}|| {{No}}<br />
|-<br />
| {{AUR|rxvt}} || {{Yes}} || {{No}} || {{No}} || {{No}}|| {{No}}<br />
|-<br />
| {{Pkg|sakura}} || {{Yes}} || {{Yes}} || {{Yes}} || {{Yes}}|| {{No}}<br />
|-<br />
| [[st]] || {{Yes}} || {{Yes}} || {{No}} || {{No}}|| {{No}}<br />
|-<br />
| [[Terminator]] || {{Yes}} || {{Yes}} || {{Yes}} || {{No}}|| {{No}}<br />
|-<br />
| {{Pkg|terminology}} || {{Yes}} || {{Yes}} || {{Yes}} || {{No}}|| {{No}}<br />
|-<br />
| [[Termite]] || {{Yes}} || {{Yes}} || {{No}} || {{No}}|| {{No}}<br />
|-<br />
| [[Tilda]] || {{Yes}} || {{Yes}} || {{Yes}} || {{No}}|| {{No}}<br />
|-<br />
| {{AUR|tinyterm-git}} || {{Yes}} || {{Yes}} || {{No}} || {{No}}|| {{No}}<br />
|-<br />
| [[urxvt]] || {{Yes}} || {{Yes}} {{ic|Ctrl+Alt+c}} || {{No}} || {{No}}||{{Y|Optional}}<br />
|-<br />
| {{Pkg|xfce4-terminal}} || {{Yes}} || {{Yes}} || {{Yes}} || {{Yes}}|| {{No}}<br />
|-<br />
| [[xterm]] || {{Yes}} ||{{Y|Optional}}[https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=588785]|| {{No}} || {{No}}|| {{Yes}}<br />
|-<br />
| [[Yakuake]] || {{Yes}} || {{Yes}} || {{Yes}} || {{No}}|| {{Y|Optional}}<br />
|}<br />
<br />
== Special cases ==<br />
<br />
=== putty ===<br />
<br />
The [[#Terminals without CLIPBOARD selection|xclip approach]] works for ''putty'': one just has to remember that the ''xclip'' invocation should be done on the local computer (in another terminal), not on the remote machine to which ''putty'' is connected.<br />
<br />
=== urxvt ===<br />
<br />
Selecting text to CLIPBOARD requires the {{ic|selection-to-clipboard}} perl extension. See [[Rxvt-unicode#Cut and paste]] for details.<br />
<br />
=== xterm ===<br />
<br />
Access to the CLIPBOARD selection in ''xterm'' requires [[Xterm#PRIMARY_or_CLIPBOARD|additional steps]].</div>Delapouitehttps://wiki.archlinux.org/index.php?title=Creating_packages&diff=535661Creating packages2018-08-16T16:32:38Z<p>Delapouite: add link to xz</p>
<hr />
<div>[[Category:About Arch]]<br />
[[Category:Package development]]<br />
[[cs:Creating packages]]<br />
[[es:Creating packages]]<br />
[[fa:ایجاد بستهها]]<br />
[[fr:Standard paquetage]]<br />
[[it:Creating packages]]<br />
[[ja:パッケージの作成]]<br />
[[pt:Creating packages]]<br />
[[ru:Creating packages]]<br />
[[zh-hans:Creating packages]]<br />
{{Related articles start}}<br />
{{Related|Arch Build System}}<br />
{{Related|Arch packaging standards}}<br />
{{Related|Arch User Repository}}<br />
{{Related|Creating packages for other distributions}}<br />
{{Related|makepkg}}<br />
{{Related|pacman}}<br />
{{Related|Patching in ABS}}<br />
{{Related|PKGBUILD}}<br />
{{Related|.SRCINFO}}<br />
{{Related|DeveloperWiki:Building in a Clean Chroot}}<br />
{{Related articles end}}<br />
<br />
This article aims to assist users creating their own packages using the Arch Linux "ports-like" [[Arch Build System|build system]], also for submission in [[AUR]]. It covers creation of a [[PKGBUILD]] &ndash; a package build description file sourced by {{ic|makepkg}} to create a binary package from source. If already in possession of a {{ic|PKGBUILD}}, see [[makepkg]]. For instructions regarding existing rules and ways to improve package quality see [[Arch packaging standards]].<br />
<br />
== Overview == <br />
<br />
Packages in Arch Linux are built using the [[makepkg]] utility and the information stored in a [[PKGBUILD]] file. When {{ic|makepkg}} runs, it searches for a {{ic|PKGBUILD}} in the current directory and follows the instructions in it to acquire the required files and/or compile them to be packed within a package file ({{ic|pkgname.pkg.tar.xz}}). The resulting package contains binary files and installation instructions ready to be installed by [[pacman]].<br />
<br />
An Arch package is no more than a tar archive, or 'tarball', compressed using [https://tukaani.org/xz/ xz], which contains the following files generated by makepkg:<br />
<br />
* The binary files to install.<br />
* {{ic|.PKGINFO}}: contains all the metadata needed by pacman to deal with packages, dependencies, etc.<br />
* {{ic|.BUILDINFO}}: contains information needed for reproducible builds. This file is present only if a package is built with pacman 5.1 or newer.<br />
* {{ic|.MTREE}}: contains hashes and timestamps of the files, which are included in the local database so that pacman can verify the integrity of the package.<br />
* {{ic|.INSTALL}}: an optional file used to execute commands after the install/upgrade/remove stage. (This file is present only if specified in the {{ic|PKGBUILD}}.)<br />
* {{ic|.Changelog}}: an optional file kept by the package maintainer documenting the changes of the package. (It is not present in all packages.)<br />
<br />
=== Meta packages and groups ===<br />
<br />
A package group is a set of related packages, defined by the packager, which can be installed or uninstalled simultaneously by using the group name as a substitute for each individual package name. While a group is not a package, it can be installed in a similar fashion to a package (see [[Pacman#Installing package groups]] and [[PKGBUILD#groups]]).<br />
<br />
A meta package, often (though not always) titled with the ''-meta'' suffix, provides similar functionality to a package group in that it enables multiple related packages to be installed or uninstalled simultaneously. Meta packages can be installed just like any other package (see [[Pacman#Installing specific packages]]). The only difference between a meta package and a regular package is that a meta package is empty and exists purely to link related packages together via dependencies. <br />
<br />
The advantage of a meta package, compared to a group, is that any new member packages will be installed when the meta package itself is updated with a new set of dependencies. This is in contrast to a group where new group members will not be automatically installed. The disadvantage of a meta package is that it is not as flexible as a group; you can choose which group members you wish to install but you cannot choose which meta package dependencies you wish to install. Likewise, you can uninstall group members without having to remove the entire group. However, you cannot remove meta package dependencies without having to uninstall the meta package itself.<br />
<br />
== Preparation ==<br />
<br />
===Prerequisite software===<br />
<br />
First, ensure that the necessary tools are [[install]]ed: the package group {{Grp|base-devel}} should be sufficient, it includes {{ic|make}} and additional tools needed for compiling from source.<br />
<br />
The key tool for building packages is [[makepkg]] (provided by {{Pkg|pacman}}), which does the following:<br />
#Checks if package dependencies are installed.<br />
#Downloads the source file(s) from the specified server(s).<br />
#Unpacks the source file(s).<br />
#Compiles the software and installs it under a fakeroot environment.<br />
#Strips symbols from binaries and libraries.<br />
#Generates the package meta file which is included with each package.<br />
#Compresses the fakeroot environment into a package file.<br />
#Stores the package file in the configured destination directory, which is the current working directory by default.<br />
<br />
=== Download and test the installation ===<br />
<br />
Download the source tarball of the software you want to package, extract it, and follow the author's steps to install the program. Make a note of all commands and/or steps needed to compile and install it. You will be repeating those same commands in the {{ic|PKGBUILD}} file.<br />
<br />
Most software authors stick to the 3-step build cycle:<br />
<br />
./configure<br />
make<br />
make install<br />
<br />
This is a good time to make sure the program is working correctly.<br />
<br />
== Creating a PKGBUILD ==<br />
When {{ic|makepkg}} is run, it looks for a {{ic|PKGBUILD}} file in the current working directory. If it finds one, it downloads the software's source code and compile it according to the instructions specified in the {{ic|PKGBUILD}} file. The instructions must be fully interpretable by the [[Wikipedia:Bash_(Unix_shell)|Bash]] shell. After successful completion, the resulting binaries and metadata of the package, i.e. package version and dependencies, are packed in a {{ic|pkgname.pkg.tar.xz}} package file. The newly created package can be installed by simply using {{ic|makepkg --install}} which will call pacman in the background, or by directly using {{ic|pacman -U ''pkgname.pkg.tar.xz''}}.<br />
<br />
To start building a new package, first create a new directory for the package and change current directory into this one. Then, a {{ic|PKGBUILD}} file needs to be created: a prototype PKGBUILD found in {{ic|/usr/share/pacman/}} can be used or you can start from a {{ic|PKGBUILD}} from another package. The latter may be a good choice if a similar package already exists.<br />
<br />
=== Defining PKGBUILD variables ===<br />
<br />
Example PKGBUILDs are located in {{Ic|/usr/share/pacman/}}. An explanation of possible {{ic|PKGBUILD}} variables can be found in the [[PKGBUILD]] article.<br />
<br />
''makepkg'' defines two variables that you should use as part of the build and install process:<br />
; {{ic|srcdir}}: This points to the directory where ''makepkg'' extracts or symlinks all files in the source array.<br />
; {{ic|pkgdir}}: This points to the directory where ''makepkg'' bundles the installed package, which becomes the root directory of your built package.<br />
They contain ''absolute'' paths, which means you do not have to worry about your working directory if you use these variables properly.<br />
<br />
{{Note|''makepkg'', and thus the {{ic|build()}} and {{ic|package()}} functions, are intended to be non-interactive. Interactive utilities or scripts called in those functions may break ''makepkg'', particularly if it is invoked with build-logging enabled ({{ic|-L}}). (See {{Bug|13214}}.)}}<br />
<br />
=== PKGBUILD functions ===<br />
<br />
There are five functions, listed here in the order they are executed. Beside the fifth function, {{ic|package()}}, which is required in every PKGBUILD, if one function does not exist it is simply skipped.<br />
<br />
==== prepare() ====<br />
<br />
This function, commands that are used to prepare sources for building are run, such as [[Patching in ABS|patching]]. This function runs right after package extraction, before [[#pkgver()|pkgver()]] and the build function. If extraction is skipped ({{ic|makepkg -e}}), then {{ic|prepare()}} is not run. <br />
<br />
{{Note| (From {{man|5|PKGBUILD}}) The function is run in {{ic|bash -e}} mode, meaning any command that exits with a non-zero status will cause the function to exit.}}<br />
<br />
==== pkgver() ====<br />
<br />
{{ic|pkgver()}} runs after the sources are fetched, extracted and [[#prepare()|prepare()]] executed. So you can update the pkgver variable during a makepkg stage.<br />
<br />
This is particularly useful if you are [[VCS PKGBUILD Guidelines|making git/svn/hg/etc. packages]], where the build process may remain the same, but the source could be updated every day, even every hour. The old way of doing this was to put the date into the pkgver field which, if the software was not updated, makepkg would still rebuild it thinking the version had changed. Some useful commands for this are {{ic|git describe}}, {{ic|hg identify -ni}}, etc. Please test these before submitting a PKGBUILD, as a failure in the {{ic|pkgver()}} function can stop a build in its tracks. <br />
{{Note|pkgver cannot contain spaces or hyphens ({{ic|-}}). Using sed to correct this is common.}}<br />
<br />
==== build() ====<br />
<br />
Now you need to implement the {{ic|build()}} function in the {{ic|PKGBUILD}} file. This function uses common shell commands in [[Wikipedia:Bash_(Unix_shell)|Bash]] syntax to automatically compile software and create a {{ic|pkg}} directory to install the software to. This allows ''makepkg'' to package files without having to sift through your file system.<br />
<br />
The first step in the {{ic|build()}} function is to change into the directory created by uncompressing the source tarball. ''makepkg'' will change the current directory to {{ic|$srcdir}} before executing the {{ic|build()}} function. Therefore, in most cases, like suggested in {{ic|/usr/share/pacman/PKGBUILD.proto}}, the first command will look like this:<br />
<br />
cd "$pkgname-$pkgver"<br />
<br />
Now, you need to list the same commands you used when you manually compiled the software. The {{ic|build()}} function in essence automates everything you did by hand and compiles the software in the fakeroot build environment. If the software you are packaging uses a configure script, it is good practice to use {{ic|1=--prefix=/usr}} when building packages for pacman. A lot of software installs files relative to the {{ic|/usr/local}} directory, which should only be done if you are manually building from source. All Arch Linux packages should use the {{ic|/usr}} directory. As seen in the {{ic|/usr/share/pacman/PKGBUILD.proto}} file, the next two lines often look like this:<br />
<br />
./configure --prefix=/usr<br />
make<br />
<br />
{{Note|If your software does not need to build anything, do not use the {{ic|build()}} function. The {{ic|build()}} function is not required, but the {{ic|package()}} function is.}}<br />
<br />
==== check() ====<br />
<br />
Place for calls to {{Ic|make check}} and similar testing routines. It is highly recommended to have {{Ic|check()}} as it helps to make sure software has been built correctly and works fine with its dependencies.<br />
<br />
Users who do not need it (and occasionally maintainers who can not fix a package for this to pass) can disable it using {{ic|1=BUILDENV+=('!check')}} in PKGBUILD/makepkg.conf or call {{ic|makepkg}} with {{ic|--nocheck}} flag.<br />
<br />
==== package() ====<br />
<br />
The final step is to put the compiled files in a directory where ''makepkg'' can retrieve them to create a package. This by default is the {{ic|pkg}} directory—a simple fakeroot environment. The {{ic|pkg}} directory replicates the hierarchy of the root file system of the software's installation paths. If you have to manually place files under the root of your filesystem, you should install them in the {{ic|pkg}} directory under the same directory structure. For example, if you want to install a file to {{ic|/usr/bin}}, it should instead be placed under {{ic|$pkgdir/usr/bin}}. Very few install procedures require the user to copy dozens of files manually. Instead, for most software, calling {{ic|make install}} will do so. The final line should look like the following in order to correctly install the software in the {{ic|pkg}} directory:<br />
<br />
make DESTDIR="$pkgdir/" install<br />
<br />
{{Note|It is sometimes the case where {{ic|DESTDIR}} is not used in the {{ic|Makefile}}; you may need to use {{ic|prefix}} instead. If the package is built with ''autoconf'' / ''automake'', use {{ic|DESTDIR}}; this is what is [https://www.gnu.org/software/automake/manual/automake.html#Install documented] in the manuals. If {{ic|DESTDIR}} does not work, try building with {{ic|1=make prefix="$pkgdir/usr/" install}}. If that does not work, you will have to look further into the install commands that are executed by "{{ic|make <...> install}}".}}<br />
<br />
{{ic|makepkg --repackage}} runs only the {{ic|package()}} function, so it creates a package without building. This may save time e.g. if you have changed just the {{ic|depends}} variable of the package.<br />
<br />
== Testing the PKGBUILD and package ==<br />
<br />
As you are writing the {{ic|build()}} function, you will want to test your changes frequently to ensure there are no bugs. You can do this using the {{ic|makepkg}} command in the directory containing the {{ic|PKGBUILD}} file. With a properly formatted {{ic|PKGBUILD}}, makepkg will create a package; with a broken or unfinished {{ic|PKGBUILD}}, it will raise an error.<br />
<br />
If makepkg finishes successfully, it will place a file named {{ic|pkgname-pkgver.pkg.tar.xz}} in your working directory. This package can be installed with the {{ic|pacman -U}} command. However, just because a package file was built does not imply that it is fully functional. It might conceivably contain only the directory and no files whatsoever if, for example, a prefix was specified improperly. You can use pacman's query functions to display a list of files contained in the package and the dependencies it requires with {{ic|pacman -Qlp [package file]}} and {{ic|pacman -Qip [package file]}} respectively.<br />
<br />
If the package looks sane, then you are done! However, if you plan on releasing the {{ic|PKGBUILD}} file, it is imperative that you check and double-check the contents of the {{ic|depends}} array. <br />
<br />
Also ensure that the package binaries actually ''run'' flawlessly! It is annoying to release a package that contains all necessary files, but crashes because of some obscure configuration option that does not quite work well with the rest of the system. If you are only going to compile packages for your own system, though, you do not need to worry too much about this quality assurance step, as you are the only person suffering from mistakes, after all.<br />
<br />
=== Checking package sanity ===<br />
<br />
After testing package functionality check it for errors using [[namcap]]:<br />
$ namcap PKGBUILD<br />
$ namcap ''<package file name>''.pkg.tar.xz<br />
<br />
Namcap will:<br />
# Check PKGBUILD contents for common errors and package file hierarchy for unnecessary/misplaced files<br />
# Scan all ELF files in package using {{ic|ldd}}, automatically reporting which packages with required shared libraries are missing from {{Ic|depends}} and which can be omitted as transitive dependencies<br />
# Heuristically search for missing and redundant dependencies<br />
and much more.<br />
Get into the habit of checking your packages with namcap to avoid having to fix the simplest mistakes after package submission.<br />
<br />
== Submitting packages to the AUR ==<br />
<br />
Please read [[AUR User Guidelines#Submitting packages]] for a detailed description of the submission process.<br />
<br />
== Summary ==<br />
<br />
#Download the source tarball of the software to package.<br />
#Try compiling the package and installing it into an arbitrary directory.<br />
#Copy over the prototype {{ic|/usr/share/pacman/PKGBUILD.proto}} and rename it to {{ic|PKGBUILD}} in a temporary working directory.<br />
#Edit the {{ic|PKGBUILD}} according to the needs of your package.<br />
#Run {{ic|makepkg}} and check whether the package builds correctly.<br />
#If not, repeat the last two steps.<br />
<br />
=== Warnings ===<br />
<br />
* Before you can automate the package building process, you should have done it manually at least once unless you know ''exactly'' what you are doing ''in advance'', in which case you would not be reading this in the first place. Unfortunately, although a good bunch of program authors stick to the 3-step build cycle of "{{ic|./configure}}; {{ic|make}}; {{ic|make install}}", this is not always the case, and things can get real ugly if you have to apply patches to make everything work at all. Rule of thumb: If you cannot get the program to compile from the source tarball, and make it install itself to a defined, temporary subdirectory, you do not even need to try packaging it. There is not any magic pixie dust in {{ic|makepkg}} that makes source problems go away.<br />
* In a few cases, the packages are not even available as source and you have to use something like {{ic|sh installer.run}} to get it to work. You will have to do quite a bit of research (read READMEs, INSTALL instructions, man pages, perhaps ebuilds from Gentoo or other package installers, possibly even the MAKEFILEs or source code) to get it working. In some really bad cases, you have to edit the source files to get it to work at all. However, {{ic|makepkg}} needs to be completely autonomous, with no user input. Therefore if you need to edit the makefiles, you may have to bundle a custom patch with the {{ic|PKGBUILD}} and install it from inside the {{ic|prepare()}} function, or you might have to issue some {{ic|sed}} commands from inside the {{ic|prepare()}} function.<br />
<br />
== More detailed guidelines ==<br />
{{Package guidelines}}<br />
<br />
== PKGBUILD generators ==<br />
<br />
PKGBUILDs for some packages can be generated automatically.<br />
<br />
{{Note|Users are still responsible for ensuring that the package meets the high quality standards before submitting the generated files to the [[AUR]].}}<br />
<br />
* [[Go]]: [https://github.com/seletskiy/go-makepkg go-makepkg]<br />
* [[Haskell]]: [https://github.com/magthe/cblrepo cblrepo]<br />
* [[Python]]: {{AUR|pipman-git}}, {{AUR|pip2arch-git}}, {{AUR|python-pypi2pkgbuild}}<br />
* [[Ruby]]: {{AUR|gem2arch}}, {{AUR|pacgem}}<br />
<br />
==See also==<br />
* [https://bbs.archlinux.org/viewtopic.php?id=91408 How to correctly create a patch file].<br />
* [https://archwomen.org/media/project_classroom/classlogs/ Arch Linux Classroom IRC Logs of classes about creating PKGBUILDs].<br />
* [http://www.linuxfromscratch.org/hints/downloads/files/fakeroot.txt Fakeroot approach for package installation]</div>Delapouitehttps://wiki.archlinux.org/index.php?title=List_of_applications/Documents&diff=523108List of applications/Documents2018-05-25T17:18:10Z<p>Delapouite: /* Vi text editors */ update kakoune install link</p>
<hr />
<div><noinclude><br />
[[Category:Applications]]<br />
[[es:List of applications/Documents]]<br />
[[it:List of applications/Documents]]<br />
[[ja:アプリケーション一覧/ドキュメント]]<br />
[[ru:List of applications/Documents]]<br />
[[zh-hans:List of applications/Documents]]<br />
[[zh-hant:List of applications/Documents]]<br />
{{List of applications navigation}}<br />
</noinclude><br />
== Documents and texts ==<br />
<br />
=== Office suites ===<br />
<br />
See also [[Wikipedia:Comparison of office suites]].<br />
<br />
* {{App|[[Wikipedia:Calligra Suite|Calligra]]|Actively developed fork of KOffice, the [[KDE]] office suite. It offers most of the features of OpenOffice while also having versions for smartphones (Calligra Mobile) and tablets (Calligra Active).|https://www.calligra.org/|{{Pkg|calligra}}}}<br />
* {{App|[[LibreOffice]]|More actively developed fork of OpenOffice.|https://www.libreoffice.org/|{{Pkg|libreoffice-still}} or {{Pkg|libreoffice-fresh}}}}<br />
* {{App|[[OpenOffice]]|Open-source office software suite for word processing, spreadsheets, presentations, graphics, databases and more, under the Apache Licence.|http://www.openoffice.org/|{{AUR|openoffice}}}}<br />
* {{App|[[Wikipedia:SoftMaker Office|SoftMaker Office]]|A complete, reliable, lightning-fast and Microsoft Office-compatible office suite with a word processor, spreadsheet, and presentation graphics software.|http://www.freeoffice.com/|{{AUR|freeoffice}}}}<br />
* {{App|Unoconv|Libreoffice-based document converter.|http://dag.wiee.rs/home-made/unoconv/|{{Pkg|unoconv}}}}<br />
* {{App|[[Wikipedia:Kingsoft Office|WPS Office]]|Proprietary office productivity suite, previously known as Kingsoft Office.|http://www.wps.com/|{{AUR|wps-office}}}}<br />
<br />
=== Word processors ===<br />
<br />
See also [[Wikipedia:Comparison of word processors]].<br />
<br />
* {{App|[[Abiword]]|Full-featured word processor.|http://www.abisource.com/|{{Pkg|abiword}}}}<br />
* {{App|Antiword|MS Word reader.|http://www.winfield.demon.nl/|{{Pkg|antiword}}}}<br />
* {{App|[[Wikipedia:BlueGriffon|BlueGriffon]]|WYSIWYG content editor for the World Wide Web.|http://www.bluegriffon.com/|{{Pkg|bluegriffon}}}}<br />
* {{App|[[Wikipedia:Calligra Words|Calligra Words]]|Powerful word processor included in the Calligra Suite.|https://www.calligra.org/words/|{{Pkg|calligra}}}}<br />
* {{App|gLabels|Program for creating labels and business cards.|http://glabels.org/|{{Pkg|glabels}}}}<br />
* {{App|[[Wikipedia:KompoZer|KompoZer]]|A Dreamweaver style WYSIWYG web editor; Nvu unofficial bug-fix release.|http://kompozer.net/|{{Pkg|kompozer}}}}<br />
* {{App|[[LibreOffice|LibreOffice Writer]]|Full-featured word processor included in the LibreOffice suite.|https://www.libreoffice.org/discover/writer|{{Pkg|libreoffice-still}} or {{Pkg|libreoffice-fresh}}}}<br />
* {{App|[[OpenOffice|OpenOffice Writer]]|Full-featured word processor included in the OpenOffice suite.|http://www.openoffice.org/|{{AUR|openoffice}}}}<br />
* {{App|[[Wikipedia:Scribus|Scribus]]|Desktop publishing program.|http://www.scribus.net/canvas/Scribus|{{Pkg|scribus}}}}<br />
* {{App|[[Wikipedia:SeaMonkey#Composer|SeaMonkey Composer]]|Powerful yet simple HTML editor included in the SeaMonkey suite.|http://www.seamonkey-project.org/|{{Pkg|seamonkey}}}}<br />
* {{App|[[Wikipedia:Ted (word processor)|Ted]]|Easy to use GTK+-based rich text processor (with footnote support).|http://www.nllgg.nl/Ted/|{{AUR|ted}}}}<br />
<br />
=== Document markup languages ===<br />
<br />
See also [[Wikipedia:Comparison of document markup languages]].<br />
<br />
* {{App|[[Wikipedia:AsciiDoc|asciidoc]]|Human-readable text document format. Used by Arch for generating ''pacman'' 's man pages[https://www.archlinux.org/pacman/pacman.8.html].|http://asciidoc.org/|{{Pkg|asciidoc}}}}<br />
* {{App|Asciidoctor|An asciidoc implementation written in Ruby, with many extra features.|http://asciidoctor.org/|{{Pkg|asciidoctor}}}}<br />
* {{App|[[Wikipedia:Markdown|Markdown]]|Text-to-HTML conversion tool that allows you to write using a simple plain text format.|http://daringfireball.net/projects/markdown|{{Pkg|discount}}}}<br />
* {{App|[[Wikipedia:Pandoc|Pandoc]]|Swiss-army knife for converting one markup format into another.|http://johnmacfarlane.net/pandoc|{{pkg|pandoc}}}}<br />
* {{App|[[Wikipedia:Sphinx_(documentation_generator)|Sphinx]]| A documentation generation system using [[Wikipedia:ReStructuredText|reStructuredText]] to generate output in multiple formats (primary documentation system for the Python project).|http://sphinx-doc.org|{{Pkg|python-sphinx}}}}<br />
* {{App|[[Wikipedia:Txt2tags|txt2tags]]|Dead-simple, KISS-compliant lightweight, human-readable markup language to produce rich format content out of plain text files.|http://txt2tags.sourceforge.net|{{Pkg|txt2tags}}}}<br />
<br />
=== Spreadsheets ===<br />
<br />
See also [[Wikipedia:Comparison of spreadsheet software]].<br />
<br />
* {{App|[[Wikipedia:Calligra Sheets|Calligra Sheets]]|Powerful spreadsheet application included in the Calligra Suite|https://www.calligra.org/sheets/|{{Pkg|calligra}}}}<br />
* {{App|[[Gnumeric]]|Spreadsheet program that is part of the GNOME desktop.|http://www.gnumeric.org/|{{Pkg|gnumeric}}}}<br />
* {{App|[[LibreOffice|LibreOffice Calc]]|Full-featured spreadsheet application included in the LibreOffice suite.|https://www.libreoffice.org/discover/calc/|{{Pkg|libreoffice-still}} or {{Pkg|libreoffice-fresh}}}}<br />
* {{App|[[OpenOffice|OpenOffice Calc]]|Full-featured spreadsheet application included in the OpenOffice suite.|http://openoffice.org/product/calc.html|{{AUR|openoffice}}}}<br />
* {{App|Pyspread|Pyspread is a non-traditional spreadsheet application that is based on and written in the programming language Python.|http://manns.github.io/pyspread/index.html|{{AUR|pyspread}}}}<br />
* {{App|sc|curses-based lightweight spreadsheet.|http://ibiblio.org/pub/linux/apps/financial/spreadsheet/!INDEX.html|{{Pkg|sc}}}}<br />
* {{App|sc-im|spreadsheet program based on sc.|https://github.com/andmarti1424/sc-im/|{{AUR|sc-im}}}}<br />
<br />
=== Database editors ===<br />
<br />
* {{App|[[LibreOffice|LibreOffice Base]]|Full-featured desktop database front end, designed to meet the needs of a broad array of users.|https://www.libreoffice.org/discover/base/|{{Pkg|libreoffice-still}} or {{Pkg|libreoffice-fresh}}}}<br />
* {{App|DB Browser for SQLite|High quality, visual, open source tool to create, design, and edit database files compatible with SQLite.|http://sqlitebrowser.org/|{{Pkg|sqlitebrowser}}}}<br />
* {{App|[[Wikipedia:DBeaver|DBeaver]]|Java-based graphical database editor with support for many database types.|https://dbeaver.jkiss.org/|{{Pkg|dbeaver}}}}<br />
* {{App|[[Wikipedia:Kexi|Kexi]]|Visual database applications creator tool by KDE, designed to fill the gap between spreadsheets and database solutions requiring more sophisticated development.|http://www.kexi-project.org/|{{Pkg|kexi}}}}<br />
* {{App|Symphytum|Personal database software for everyone who desires to manage and organize data in an easy and intuitive way, without having to study complex database languages and software user interfaces.|https://giowck.github.io/symphytum/|{{AUR|symphytum}}}}<br />
<br />
=== Typesetting systems ===<br />
<br />
* {{App|GNU [[Wikipedia:troff|troff]]|Heirloom Unix document processing system, the default formatter for man pages.|https://www.gnu.org/software/groff/groff.html|{{Pkg|groff}}}}<br />
* {{App|[[Lout]]|A lightware document formatting system. Reads a high-level description of a document similar in style to LaTeX and produces a PostScript.|http://savannah.nongnu.org/projects/lout|{{pkg|lout}}}}<br />
* {{App|SILE|Modern typesetting system inspired by TeX.|http://sile-typesetter.org/|{{AUR|sile}}}}<br />
* {{App|[[TeX Live|TeX]]|A high-quality typesetting system popular in academia.|https://tug.org/|{{Pkg|texlive-core}}}}<br />
<br />
=== TeX software ===<br />
<br />
With [[TeX Live|TeX, LaTeX and friends]], creation of any scientific document, article, journal, etc. is made commonplace.<br />
<br />
See also [[Wikipedia:Comparison of TeX editors]] and [https://en.wikibooks.org/wiki/LaTeX/Installation#Editors the LaTeX Wikibook].<br />
<br />
* {{App|[[Wikipedia:AUCTEX|AUCTeX]]|Together with RefTex, AUCTeX provices an extensible environment for writing and formatting TeX files in Emacs.|https://www.gnu.org/software/auctex/|{{Pkg|auctex}}}}<br />
* {{App|EqualX|LaTeX equation editor with real time preview.|http://equalx.sourceforge.net/index.html|{{AUR|equalx}}}}<br />
* {{App|gedit-latex|Add code-completion to gedit and allows for compiling LaTeX documents and managing BibTeX bibliographies.|http://www.gnome.org/|{{AUR|gedit-latex}}}}<br />
* {{App|[[Wikipedia:GNOME-LaTeX|GNOME LaTeX]]|LaTeX editor for the GNOME Desktop including support for code completion, compiling and project management.|https://wiki.gnome.org/Apps/GNOME-LaTeX|{{Pkg|gnome-latex}}}}<br />
* {{App|[[Wikipedia:Gummi (software)|Gummi]]|Lightweight TeX/LaTeX GTK+-based editor. It features a continuous preview mode, integrated BibTeX support, extendable snippet interface and multi-document support.|https://github.com/alexandervdm/gummi/|{{Pkg|gummi}}}}<br />
* {{App|[[Wikipedia:JabRef|JabRef]]|Java GUI frontend for managing BibTeX and other bibliographies.|https://www.jabref.org/|{{AUR|jabref}} {{AUR|jabref-git}}}}<br />
* {{App|[[Wikipedia:Kile|Kile]]|User-friendly TeX/LaTeX editor for the KDE desktop with many features.|http://kile.sourceforge.net/|{{Pkg|kile}}}}<br />
* {{App|Ktikz|GUI making diagrams with [http://pgf.sourceforge.net/ PGF/TikZ] easier.|http://www.hackenberger.at/blog/ktikz-editor-for-the-tikz-language/|{{AUR|ktikz}}}}<br />
* {{App|[[Wikipedia:LyX|LyX]]|Document processor that encourages an approach to writing based on the structure of your documents (WYSIWYM) and not simply their appearance (WYSIWYG).|http://www.lyx.org/|{{Pkg|lyx}}}}<br />
* {{App|[[Wikipedia:GNU TeXmacs|TeXmacs]]|WYSIWYW (what you see is what you want) editing platform with special features for scientists.|http://www.texmacs.org/|{{Pkg|texmacs}}}}<br />
* {{App|[[Wikipedia:Texmaker|Texmaker]]|Cross-platform, light and easy-to-use LaTeX IDE. It integrates many tools needed to develop documents with LaTeX, in just one application|http://www.xm1math.net/texmaker/|{{Pkg|texmaker}}}}<br />
* {{App|[[Wikipedia:TeXstudio|TeXstudio]]|Fork of TeXMaker including support for code completion of bibtex items, grammar check and automatic detection of the need for multiple LaTeX runs.|http://texstudio.sourceforge.net/|{{pkg|texstudio}}}}<br />
* {{App|[[Vim|Vim-LaTeX-suite]]|Customizable LaTeX environment for Vim.|http://vim-latex.sourceforge.net/|{{Pkg|vim-latexsuite}}}}<br />
* {{App|[[Vim|Vimtex]]|This vim plugin is a fork of [https://github.com/LaTeX-Box-Team/LaTeX-Box LaTeX-Box]. It provides automatic syntax-based folding, omni-completion (for citations and labels), latexmk-based compilation and synctex functionality for {{Pkg|zathura}} and {{Pkg|mupdf}}.|https://github.com/lervag/vimtex/|}}<br />
* {{App|[[Wikipedia:Zotero|Zotero]]|An easy-to-use tool to help you collect, organize, cite, and share your research sources. Can import and export BibTeX and has browser extensions.|https://www.zotero.org/|{{AUR|zotero}}}}<br />
<br />
=== Bibliographic reference managers ===<br />
<br />
See also [[Wikipedia:Comparison of reference management software]].<br />
<br />
* {{App|Bibus|A bibliographic database that can directly insert references in OpenOffice.org/LibreOffice and generate the bibliographic index.|http://bibus-biblio.sourceforge.net|{{AUR|bibus}}}}<br />
* {{App|DocEar|Docear is an academic literature suite for searching, organizing and creating academic literature, built upon the mind mapping software Freeplane and the reference manager JabRef.|https://www.docear.org|{{AUR|docear}}}}<br />
* {{App|[[Wikipedia:JabRef|JabRef]]|Java GUI frontend for managing BibTeX and other bibliographies.|https://www.jabref.org/|{{AUR|jabref}} {{AUR|jabref-git}}}}<br />
* {{App|[[Wikipedia:Zotero|Zotero]]|An easy-to-use tool to help you collect, organize, cite, and share your research sources. Can import and export BibTeX and has browser extensions.|https://www.zotero.org/|{{AUR|zotero}}}}<br />
<br />
=== Translation and localization ===<br />
<br />
* {{App|[[Wikipedia:Apertium|Apertium]]|Free and open source rule-based machine translation platform with available language data. It supports the following formats: HTML, Microsoft Office 2007 XML, OpenDocument, TMX, MediaWiki and others.|http://apertium.org/|{{AUR|apertium}}}}<br />
* {{App|[[Wikipedia:Gtranslator|Gtranslator]]|Enhanced gettext po file editor for the GNOME. It handles all forms of gettext po files and includes very useful features.|https://wiki.gnome.org/Apps/Gtranslator|{{Pkg|gtranslator}}}}<br />
* {{App|Lokalize|Standard [[KDE]] tool for software translation. It includes basic editing of PO files, support for glossary, translation memory, project managing, etc. It belongs to {{Grp|kdesdk}}|https://userbase.kde.org/Lokalize|{{Pkg|lokalize}}}}<br />
* {{App|[[Wikipedia:Moses (machine translation)|Moses]]|Statistical machine translation tool (language data not included).|http://statmt.org/moses|{{AUR|mosesdecoder}} {{AUR|mosesdecoder-git}}}}<br />
* {{App|[[Wikipedia:OmegaT|OmegaT]]|General translator's tool which contains a lot of translation memory features and can give suggestions from Google Translate. It supports the following formats: HTML, Microsoft Office 2007 XML, OpenDocument, XLIFF/Okapi, MediaWiki, plain text, TMX and others.|http://omegat.org|{{AUR|omegat}}}}<br />
* {{App|[[Wikipedia:Poedit|Poedit]]|Simple gettext/po-based translation tool.|http://poedit.net|{{Pkg|poedit}}}}<br />
* {{App|Pology|Set of Python tools for dealing with gettext/po-files.|https://techbase.kde.org/Localization/Tools/Pology|{{AUR|pology}}}}<br />
* {{App|[[Wikipedia:Virtaal|Virtaal]]|Editor for translation of both software and other text, based on [[Wikipedia:Translate Toolkit|Translate Toolkit]]. It supports the following formats: [[Wikipedia:gettext|gettext]], [[Wikipedia:XLIFF|XLIFF]] , TMX, TBX, [[Wikipedia:Wordfast|Wordfast]], Qt Linguist , Qt Phrase Book, [[Wikipedia:OmegaT|OmegaT glossary]] and others. It can also show suggestions from [[Wikipedia:Apertium|Apertium]], [[Wikipedia:Google Translate|Google Translate]], [[Wikipedia:Bing Translator|Bing Translator]], [[Wikipedia:Moses (machine translation)|Moses]] and others.|http://virtaal.translatehouse.org/|{{AUR|virtaal}}}}<br />
<br />
=== Text editors ===<br />
<br />
See also [[Wikipedia:Comparison of text editors]].<br />
<br />
Some of the lighter-weight [[List_of_applications/Utilities#Integrated_development_environments|Integrated development environments]] can also serve as text editors.<br />
<br />
==== Console ====<br />
<br />
* {{App|e3|Tiny editor without dependencies, written in assembly.|http://sites.google.com/site/e3editor/|{{Pkg|e3}}}}<br />
* {{App|ee|A classic curse-based text editor. Born in HP-UX, used in FreeBSD.|http://www.users.qwest.net/~hmahon/|{{aur|ee-editor}}}}<br />
* {{App|dte|Small, easy to use editor with multi-tabbed interface, syntax highlighting, ctags navigation, etc.|https://github.com/craigbarnes/dte|{{AUR|dte}}}}<br />
* {{App|[[Emacs|Emacs-nox]]|The extensible, customizable, self-documenting real-time display editor, without X11 support.|https://www.gnu.org/software/emacs/emacs.html|{{Pkg|emacs-nox}}}}<br />
* {{App|[[Wikipedia:JED (text editor)|JED]]|Text editor that makes extensive use of the [[Wikipedia:S-Lang (programming library)|S-Lang library]]. Includes a console version (jed) and an X-window version (xjed).|http://jedsoft.org/jed/|{{AUR|jed}}}}<br />
* {{App|Joe (Joe's Own Editor)|Terminal-based text editor designed to be easy to use.|http://joe-editor.sourceforge.net/|{{Pkg|joe}}}}<br />
* {{App|[[Wikipedia:Midnight Commander|mcedit]]|Useful text editor that comes with Midnight Commander file manager.|http://www.ibiblio.org/mc/|{{Pkg|mc}}}}<br />
* {{App|micro|A modern and intuitive terminal-based text editor, written in go and extensible through plugins|https://micro-editor.github.io|{{AUR|micro}}}}<br />
* {{App|[[Wikipedia:MicroEMACS|MicroEmacs]]|Ncurses-based text editor. Includes a console version (me -n) and an X-window version (me).|http://www.jasspa.com/|{{AUR|jasspa-me}}}}<br />
* {{App|[[Wikipedia:mg (editor)|mg]]|Small, fast, and portable Emacs-like editor.|http://homepage.boetes.org/software/mg|{{Pkg|mg}}}}<br />
* {{App|mp|Minimum Profit is a text editor for programmers. It helps you definitively abandon vi, emacs and other six-legged freaks.|http://triptico.com/software/mp.html|{{AUR|mp}}}}<br />
* {{App|[[nano]]|Console text editor based on pico with on-screen key bindings help.|http://nano-editor.org/|{{Pkg|nano}}}}<br />
* {{App|Ne|Minimalist text editor with Windows-like key-bindings.|http://ne.di.unimi.it/|{{AUR|ne}}}}<br />
* {{App|Slap|Sublime-like terminal-based text editor.|https://github.com/slap-editor/slap|{{AUR|slap}}}}<br />
* {{App|Tilde|An intuitive text editor with Windows-like key bindings.|http://os.ghalkes.nl/tilde/|{{AUR|tilde}}}}<br />
* {{App|[[Wikipedia:Vile (editor)|vile]]|A lightweight Emacs clone with ''vi''-like key bindings.|http://invisible-island.net/vile/vile.html|{{AUR|vile}}}}<br />
* {{App|[[Wikipedia:Zile (editor)|Zile]]|A lightweight Emacs clone.|https://www.gnu.org/software/zile/|{{Pkg|zile}}}}<br />
<br />
===== Vi text editors =====<br />
<br />
* {{App|Amp|A text editor written in Rust, that aims to take the core interaction model of Vim, simplify it, and bundle in the essential features required for a modern text editor.|https://amp.rs|{{AUR|amp}}}}<br />
* {{App|[[Kakoune]]|Modal editor. Fewer keystrokes. Selection based, multi-cursor editing. Orthogonal design.|https://github.com/mawww/kakoune|{{Pkg|kakoune}}}}<br />
* {{App|[[Neovim]]|Vim's rebirth for the 21st century|http://neovim.io/|{{Pkg|neovim}}}}<br />
* {{App|[[Vi]]|The original ex/vi text editor.|http://ex-vi.sourceforge.net/|{{Pkg|vi}}}}<br />
* {{App|[[Vim]] (Vi IMproved)|Advanced text editor that seeks to provide the power of the de-facto Unix editor 'vi', with a more complete feature set.|http://www.vim.org/|{{Pkg|vim}}}}<br />
* {{App|Vis|modern, legacy free, simple yet efficient vim-like editor.|http://www.brain-dump.org/projects/vis/|{{Pkg|vis}}}}<br />
<br />
==== Graphical ====<br />
<br />
* {{App|[[Wikipedia:Acme (text editor)|Acme]]|Minimalist and flexible programming environment developed by Rob Pike for the Plan 9 operating system.|http://acme.cat-v.org|{{Pkg|plan9port}}}}<br />
* {{App|[[Atom]]|A promising text editor developed by GitHub. With support for plug-ins written in Node.js and embedded [[Git]] Control.|https://atom.io|{{Pkg|atom}}}}<br />
* {{App|Beaver|A GTK+ editor designed to be modular, lightweight and stylish.|http://beaver-editor.sourceforge.net|{{Pkg|beaver}}}}<br />
* {{App|[[w:Brackets (text editor)|Brackets]]|An open source code editor for the web, written in JavaScript, HTML and CSS.|http://brackets.io|{{AUR|brackets}}}}<br />
* {{App|Deepin Editor|Simple text editor for Deepin desktop.|https://github.com/linuxdeepin/deepin-editor|{{Pkg|deepin-editor}}}}<br />
* {{App|FeatherPad|Minimal Qt5 plain text editor featuring a native dark theme and support for tabs, printing and syntax highlighting.|https://github.com/tsujan/FeatherPad|{{AUR|featherpad}}}}<br />
* {{App|[[Wikipedia:Geany|Geany]]|A text editor using the GTK2 toolkit with basic features of an integrated development environment. It has support for TeX-based documents.|https://www.geany.org|{{Pkg|geany}}}}<br />
* {{App|[[Wikipedia:Gedit|Gedit]]|GTK+ editor for the GNOME desktop with syntax highlighting, automatic indentation, matching brackets, etc., and a number of add-ons to increase functionality.|https://wiki.gnome.org/Apps/Gedit|{{Pkg|gedit}}}}<br />
* {{App|[[GNU Emacs]]|The extensible, customizable, self-documenting real-time display editor.|https://www.gnu.org/software/emacs/|{{Pkg|emacs}}}}<br />
* {{App|[[gVim]]|Graphical interface for Vim.|http://www.vim.org|{{Pkg|gvim}}}}<br />
* {{App|Jedit|Text editor for programmers, written in Java.|http://www.jedit.org|{{Pkg|jedit}}}}<br />
* {{App|[[Wikipedia:JuffEd|JuffEd]]|Simple tabbed text editor with syntax highlighting, written in Qt.|http://juffed.com/en/index.html|{{AUR|juffed}}}}<br />
* {{App|[[Wikipedia:Kate (text editor)|Kate]]|Full-featured programmer's editor for the KDE desktop with MDI and a filesystem browser.|https://kate-editor.org|{{Pkg|kate}}}}<br />
* {{App|[[Wikipedia:KWrite|KWrite]]|Lightweight text editor for the KDE desktop that uses the same editor widget as Kate.|https://www.kde.org/applications/utilities/kwrite|{{Pkg|kwrite}}}}<br />
* {{App|L3afpad| Simple text editor forked from Leafpad, supports GTK+ 3.|https://github.com/stevenhoneyman/l3afpad|{{Pkg|l3afpad}}}}<br />
* {{App|[[Wikipedia:Leafpad|Leafpad]]|Notepad clone for GTK+ that emphasizes simplicity.|http://tarot.freeshell.org/leafpad|{{Pkg|leafpad}}}}<br />
* {{App|[[w:Light Table (software)|LightTable]]|A modern open source text editor.|http://lighttable.com|{{AUR|lighttable-bin}}{{AUR|lighttable-git}}}}<br />
* {{App|Liri Text|Text editor for Liri.|https://github.com/lirios/text|{{Pkg|liri-text}}}}<br />
* {{App|Marker|Simple yet robust markdown editor for the Linux desktop.|https://fabiocolacio.github.io/Marker/|{{AUR|marker}}}}<br />
* {{App|Medit|Programming and around-programming text editor.|http://mooedit.sourceforge.net|{{Pkg|medit}}}}<br />
* {{App|[[Wikipedia:Xfce#Mousepad|Mousepad]]|Fast text editor for the Xfce Desktop Environment.|https://www.xfce.org|{{Pkg|mousepad}}}}<br />
* {{App|[[Wikipedia:NEdit|Nedit]]|Text editor for the Motif environment.|http://www.nedit.org|{{Pkg|nedit}}}}<br />
* {{App|Notepadqq|A Qt-based, Notepad++-like text editor with support for syntax highlighting for more than 100 languages.|http://notepadqq.altervista.org/s/|{{Pkg|notepadqq}}}}<br />
* {{App|[[MATE|Pluma]]|A powerful text editor for MATE.|http://mate-desktop.org|{{Pkg|pluma}}}}<br />
* {{App|[[Wikipedia:PyRoom|PyRoom]]|Great distractionless PyGTK text editor, a clone of the infamous WriteRoom.|http://pyroom.org|{{AUR|pyroom}}}}<br />
* {{App|QSciTE|Qt clone of the SciTE text and code editor.|https://code.google.com/archive/p/qscite/|{{AUR|qscite}}}}<br />
* {{App|QXmlEdit|Simple Qt XML editor and XSD viewer.|http://qxmledit.org|{{AUR|qxmledit}}}}<br />
* {{App|[[Wikipedia:Sam (text editor)|Sam]]|Minimalist text editor with a graphical user interface, a very powerful command language and remote editing capabilities, developed by Rob Pike.|http://sam.cat-v.org|{{Pkg|plan9port}} or {{Pkg|9base}}}}<br />
* {{App|[[Wikipedia:SciTE|SciTE]]|Generally useful editor with facilities for building and running programs.|http://scintilla.org/SciTE.html|{{AUR|scite}}}}<br />
* {{App|Scribes|An ultra minimalist text editor that combines simplicity with power.|http://scribes.sourceforge.net|{{Pkg|scribes}}}}<br />
* {{App|[[Wikipedia:Sublime Text|Sublime Text 2]]|Closed-source C++ and Python-based editor with many advanced features and plugins while staying lightweight and pretty.|https://www.sublimetext.com|{{AUR|sublime-text2}}}}<br />
* {{App|[[Wikipedia:Sublime Text|Sublime Text 3]]|Closed-source C++ and Python-based editor with many advanced features and plugins while staying lightweight and pretty.|https://www.sublimetext.com|{{AUR|sublime-text-dev}}}}<br />
* {{App|Tea|Qt-based feature rich text editor.|http://semiletov.org/tea|{{AUR|tea}}}}<br />
* {{App|[[Textadept]]|Lua-extensible feature rich text editor based on Scintilla and written in C.|http://foicica.com/textadept|{{AUR|textadept}}}}<br />
* {{App|[[Visual Studio Code]]|Editor for building and debugging modern web and cloud applications.|https://code.visualstudio.com|{{AUR|visual-studio-code-bin}}}}{{AUR|code}}<br />
* {{App|XEdit|Simple text editor for the X Window System.|https://www.x.org/wiki|{{Pkg|xorg-xedit}}}}<br />
<br />
=====Collaborative text editors=====<br />
* {{App|Gobby|Collaborative editor supporting multiple documents in one session and a multi-user chat.|https://gobby.github.io|{{Pkg|gobby}}}}<br />
<br />
=== Readers and Viewers ===<br />
<br />
==== E-book applications ====<br />
<br />
{{Note|Some [[#PDF and DjVu|PDF and DjVu viewers]] also support other e-book formats.}}<br />
<br />
* {{App|Bookworm|eBook reader with epub, pdf, mobi, cbr support for Elementary OS.|https://babluboy.github.io/bookworm/|{{Pkg|bookworm}}}}<br />
* {{App|[[Wikipedia:Calibre (software)|Calibre]]|E-book library management application that can also convert between different formats and sync with a variety of e-book readers. Supported formats include CBZ, CBR, CBC, CHM, DJVU, EPUB, FictionBook, HTML, HTMLZ, LIT, LRF, Mobipocket, ODT, PDF, PRC, PDB, PML, RB, RTF, SNB, TCR, TXT and TXTZ.|https://calibre-ebook.com/|{{Pkg|calibre}}}}<br />
* {{App|Cool Reader|E-book viewer with many supported formats such as EPUB (non-DRM), FictionBook, TXT, RTF, HTML, CHM and TCR.|https://sourceforge.net/projects/crengine/|{{AUR|coolreader3-git}}}}<br />
* {{App|epub|A console EPUB reader using Python and Curses.|https://pypi.org/project/epub/|{{AUR|python-epub}}}}<br />
* {{App|[[Wikipedia:FBReader|FBReader]]|E-book viewer with many supported formats such as EPUB, FictionBook, HTML, plucker, PalmDoc, zTxt, TCR, CHM, RTF, OEB, Mobipocket (non-DRM) and TXT.|https://fbreader.org/|{{Pkg|fbreader}}}}<br />
* {{App|[[Wikipedia:Sigil (application)|Sigil]]|WYSIWYG ebook editor.|https://sigil-ebook.com/|{{pkg|sigil}}}}<br />
<br />
==== PDF and DjVu ====<br />
<br />
{{Note|1=[[Wikipedia:Portable_Document_Format#Interactive_elements|PDF forms]] support:<br />
* {{AUR|acroread}} is able to save both AcroForms and XFA forms into PDF files.<br />
* Poppler-based readers such as {{Pkg|evince}} and {{Pkg|okular}} support AcroForms, but not full XFA forms. [https://bugs.freedesktop.org/show_bug.cgi?id=18935] [https://bugs.launchpad.net/ubuntu/+source/poppler/+bug/321720]<br />
* For CJK(Chinese, Japanese, Korean) support in poppler-based readers such as {{Pkg|evince}} and {{Pkg|okular}}, install {{Pkg|poppler-data}}. poppler-data is an optional dependency of poppler which is an indirect dependency of evince and okular.<br />
}}<br />
<br />
See also [[Wikipedia:List of PDF software]] and [[Wikipedia:DjVu]].<br />
<br />
===== Console =====<br />
<br />
* {{App|fbgs|Poor man's PostScript/pdf viewer for the linux framebuffer console.|https://www.kraxel.org/blog/linux/fbida/|{{Pkg|fbida}}}}<br />
* {{App|fbpdf|Small framebuffer PDF and DjVu viewer based off of MuPDF, with [[Vim]] keybindings and written in C|http://repo.or.cz/w/fbpdf.git|{{AUR|fbpdf-git}}}}<br />
* {{App|ghostscript| convert into PDF, reduce size of PDF documents with eg {{ic|<nowiki>gs -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dPDFSETTINGS=/screen -dNOPAUSE -dQUIET -dBATCH -sOutputFile=output.pdf input.pdf</nowiki>}}|https://www.ghostscript.com/|{{Pkg|ghostscript}}}}<br />
* {{App|jfbview|Framebuffer PDF and image viewer. Features include Vim-like controls, zoom-to-fit, a TOC (outline) view, fast multi-threaded rendering and asynchronous pre-caching. Originally a fork of ''fbpdf'' called ''jfbpdf'', now completely rewritten.|https://seasonofcode.com/pages/jfbview.html|{{AUR|jfbview}}}}<br />
<br />
===== Graphical =====<br />
<br />
{{Note|Some [[List_of_applications/Internet#Web_browsers|web browsers]] have support for displaying PDF files, either built-in or via plugin.}}<br />
<br />
* {{App|acroread|A PDF file viewer offered by Adobe (closed source).|http://www.adobe.com/products/reader.html|{{AUR|acroread}}}}<br />
* {{App|apvlv|Lightweight PDF/DjVu/UMD/TXT viewer with [[Vim]] keybindings.|http://naihe2010.github.io/apvlv/|{{AUR|apvlv}}}}<br />
* {{App|Atril|Simple multi-page document viewer for MATE.|https://github.com/mate-desktop/atril|{{Pkg|atril}}}}<br />
* {{App|DjView4|Viewer for DjVu documents.|http://djvu.sourceforge.net/djview4.html|{{Pkg|djview}}}}<br />
* {{App|ePDFView|Free lightweight PDF document viewer using the Poppler and GTK+ libraries. Development stopped.|http://freecode.com/projects/epdfview|{{Pkg|epdfview}}}}<br />
* {{App|[[Wikipedia:Evince|Evince]]|Document viewer for multiple document formats. Supports PDF, PostScript, DjVu, TIFF and DVI.|https://wiki.gnome.org/Apps/Evince|{{Pkg|evince}}}}<br />
* {{App|[[Wikipedia:Foxit Reader|Foxit Reader]]|Small, fast (compared to Acrobat) PDF viewer. (closed source)|https://www.foxitsoftware.com/pdf-reader/|{{AUR|foxitreader}}}}<br />
* {{App|gv|Graphical user interface for the Ghostscript interpreter that allows to view and navigate through PostScript and PDF documents.|https://www.gnu.org/software/gv/|{{Pkg|gv}}}}<br />
* {{App|[[llpp]]|Very fast PDF reader based off of MuPDF, that supports continuous page scrolling, bookmarking, and text search through the whole document.|http://repo.or.cz/w/llpp.git|{{Pkg|llpp}}}}<br />
* {{App|Master PDF Editor|A functional proprietary PDF editor. Free non-commercial use. (closed source)|https://code-industry.net/free-pdf-editor/|{{AUR|masterpdfeditor}}}}<br />
* {{App|[[MuPDF]]|Very fast PDF, XPS, and EPUB viewer and toolkit written in portable C. Features CJK font support.|https://mupdf.com/|{{Pkg|mupdf}}}}<br />
* {{App|[[Wikipedia:Okular|Okular]]|Universal PDF viewer for KDE.|https://okular.kde.org/|{{Pkg|okular}}}}<br />
* {{App|PDF Chain|A graphical interface allowing to manipulate PDF documents (concatenate, burst, watermark, attach files...)|http://pdfchain.sourceforge.net/|{{AUR|pdfchain}}}}<br />
* {{App|PdfMod| You can reorder, rotate, and remove pages, export images from a document, edit the title, subject, author, and keywords, and combine documents via drag and drop. |https://wiki.gnome.org/Apps/PdfMod|{{Pkg|pdfmod}}}}<br />
* {{App|PDF Shuffler|Combine, split, rotate and reorder PDF documents. Uses Python and GTK2.|https://sourceforge.net/projects/pdfshuffler/|{{Pkg|pdfshuffler}}}}<br />
* {{App|PDF Studio|All-in-one PDF editor similar to Adobe Acrobat (proprietary).|https://www.qoppa.com/pdfstudio/|{{AUR|pdfstudio}}}}<br />
* {{App|qpdfview|Tabbed document viewer. It uses Poppler for PDF support, libspectre for PS support, DjVuLibre for DjVu support, CUPS for printing support and the Qt toolkit for its interface.|https://launchpad.net/qpdfview|{{Pkg|qpdfview}}}}<br />
* {{App|[[Wikipedia:Xournal|Xournal]]|Pdf viewer/note taking application.|http://xournal.sourceforge.net/|{{Pkg|xournal}}}}<br />
* {{App|[[Wikipedia:Xpdf|Xpdf]]|Viewer that can decode LZW and read encrypted PDFs. Note that due to removal of all Type1 fonts from the gsfonts package, you will need to install them from an archive package - see https://bugs.archlinux.org/task/50297|http://www.xpdfreader.com/|{{Pkg|xpdf}}}} and {{AUR|gsfonts-type1}}<br />
* {{App|Xreader|Document viewer for files like PDF and Postscript. X-Apps Project.|https://github.com/linuxmint/xreader/|{{Pkg|xreader}}}}<br />
* {{App|[[Wikipedia:Zathura (document viewer)|zathura]]|Highly customizable and functional PDF/DjVu/PostScript/ComicBook viewer (plugin based).|https://pwmt.org/projects/zathura/|{{Pkg|zathura}} {{pkg|zathura-pdf-mupdf}} {{pkg|zathura-djvu}}}}<br />
<br />
==== Terminal pagers ====<br />
<br />
See also [[Wikipedia:Terminal pager]].<br />
<br />
* {{App|[[Wikipedia:More_(command)|more]]|A simple and feature-light pager. It is a part of util-linux.|https://git.kernel.org/pub/scm/utils/util-linux/util-linux.git/about/|{{Pkg|util-linux}}}}<br />
* {{App|[[Core_utilities#less|less]]|A program similar to more, but with support for both forward and backward scrolling, as well as partial loading of files.|https://www.gnu.org/software/less/|{{Pkg|less}}}}<br />
* {{App|[[Wikipedia:Most_(Unix)|most]]|A pager with support for multiple windows, left and right scrolling, and built-in colour support|http://www.jedsoft.org/most/|{{Pkg|most}}}}<br />
* {{App|mcview|A pager with mouse and colour support. It is bundled with midnight commander.|http://midnight-commander.org/|{{Pkg|mc}}}}<br />
* {{App|vimpager|A script that turns vim into a pager. As a result, you get various vim features such as colour schemes, mouse support, split screens, etc.|https://github.com/rkitover/vimpager|{{Pkg|vimpager}}}}<br />
<br />
==== CHM ====<br />
<br />
See also [[Wikipedia:Microsoft Compiled HTML Help]].<br />
<br />
* {{App|Archmage|An extensible reader and decompiler for files in the CHM format.|https://github.com/dottedmag/archmage|{{AUR|archmage}}}}<br />
* {{App|ChmSee|CHM viewer based on xulrunner.|https://code.google.com/archive/p/chmsee/|{{AUR|chmsee}}}}<br />
* {{App|Kchmviewer|Qt-based CHM viewer that uses chmlib and borrows some ideas from xchm. It does not depend on [[KDE]], but it can be compiled to integrate with it.|http://www.ulduzsoft.com/linux/kchmviewer/|{{Pkg|kchmviewer}}}}<br />
* {{App|[[Wikipedia:xCHM|xCHM]]|Lightweight CHM viewer, based on chmlib.|http://xchm.sourceforge.net/|{{Pkg|xchm}}}}<br />
<br />
==== Comic book (comix/manga) ====<br />
<br />
* {{App|[[Wikipedia:MComix|MComix]]|GTK2 image viewer specifically designed to handle comic book archives (fork of Comix). Also includes library manager.|https://sourceforge.net/projects/mcomix/|{{Pkg|mcomix}}}}<br />
* {{App|YACReader|Comic book viewer written in C++ and Qt5. Comes with YACReaderLibrary for managing comics.|http://yacreader.com/|{{AUR|yacreader}}}}<br />
<br />
=== Scanning software ===<br />
<br />
See [[SANE#Install a frontend]].<br />
<br />
=== OCR software ===<br />
<br />
See also [[Wikipedia:Comparison of optical character recognition software]].<br />
<br />
==== Engines ====<br />
<br />
* {{App|CuneiForm|Command line OCR system originally developed and open sourced by Cognitive technologies. Supported languages: eng, ger, fra, rus, swe, spa, ita, ruseng, ukr, srp, hrv, pol, dan, por, dut, cze, rum, hun, bul, slo, lav, lit, est, tur.|https://launchpad.net/cuneiform-linux|{{Pkg|cuneiform}}}}<br />
* {{App|GOCR/JOCR|OCR engine which also supports barcode recognition.|http://jocr.sourceforge.net/|{{Pkg|gocr}}}}<br />
* {{App|Ocrad|OCR program based on a feature extraction method.|https://www.gnu.org/software/ocrad/|{{Pkg|ocrad}}}}<br />
* {{App|Tesseract|Accurate open source OCR engine. Package splitted, you need install some datafiles for each language ({{Pkg|tesseract-data-eng}} for example).|https://github.com/tesseract-ocr|{{Pkg|tesseract}}}}<br />
<br />
==== Layout analyzers and user interfaces ====<br />
<br />
* {{App|gImageReader|Graphical GTK frontend to Tesseract.|http://gimagereader.sourceforge.net/|{{AUR|gimagereader}}}}<br />
* {{App|gscan2pdf|Scans, runs an OCR engine, minor post-processing, creates a document.|http://gscan2pdf.sourceforge.net/|{{Pkg|gscan2pdf}}}}<br />
* {{App|[[Wikipedia:OCRFeeder|OCRFeeder]]|Python GUI for Gnome which performs document analysis and rendition, and can use either CuneiForm, GOCR, Ocrad or Tesseract as OCR engines. It can import from PDF or image files, and export to HTML or OpenDocument.|https://wiki.gnome.org/Apps/OCRFeeder|{{Pkg|ocrfeeder}}}}<br />
* {{App|OCRopy|OCR ''platform'', modules exist for document layout analysis, OCR engines (it can use Tesseract or its own engine), natural language modeling, etc.|https://github.com/tmbdev/ocropy|{{AUR|ocropy}}}}<br />
* {{App|Scan Tailor|Interactive post-processing tool for scanned pages.|http://scantailor.org/|{{Pkg|scantailor}}}}<br />
* {{App|[[YAGF]]|Graphical interface for the CuneiForm text recognition program on the Linux platform.|http://symmetrica.net/cuneiform-linux/yagf-en.html|{{AUR|yagf}}}}<br />
<br />
=== Note taking organizers ===<br />
<br />
See also [[Wikipedia:Comparison of notetaking software]].<br />
<br />
==== Console ====<br />
<br />
* {{App|deft|Manage notes within emacs|http://jblevins.org/projects/deft/}}<br />
* {{App|hnb (hierarchical notebook)|Program to organize many kinds of data (addresses, to-do lists, ideas, book reviews, etc.) in one place using the XML format.|http://hnb.sourceforge.net/|{{AUR|hnb}}}}<br />
* {{App|pynote|Manage notes on the commandline|https://github.com/rumpelsepp/pynote|{{AUR|pynote}}}}<br />
<br />
==== Graphical ====<br />
<br />
* {{App|[[Wikipedia:BasKet Note Pads|BasKet]]|Application for organizing, sharing, and taking notes. It can manage various types of information such as to-do lists, links, pictures, and other types, similar to a scrapbook.|https://userbase.kde.org/BasKet|{{Pkg|basket}}}}<br />
* {{App|Cherrytree|Hierarchical note taking application, featuring rich text and syntax highlighting, storing data in a single xml or sqlite file.|http://giuspen.com/cherrytree/|{{Pkg|cherrytree}}}}<br />
* {{App|[[Wikipedia:Gnote|Gnote]]|Experimental port of Tomboy to C++.|https://wiki.gnome.org/Apps/Gnote|{{Pkg|gnote}}}}<br />
* {{App|KeepNote|Cross-platform GTK+ note-taking application with rich text formatting.|http://keepnote.org|{{Pkg|keepnote}}}}<br />
* {{App|KNotes|A program that lets you write the computer equivalent of sticky notes.|https://www.kde.org/applications/utilities/knotes/|{{Pkg|knotes}}}}<br />
* {{App|Laverna|A JavaScript note taking application with Markdown editor and encryption support. Consider it like open source alternative to Evernote. |https://laverna.cc/|{{AUR|laverna}}}}<br />
* {{App|[[Wikipedia:org-mode|org-mode]]|[[Emacs]] mode for notes, project planning and authoring.|http://orgmode.org|{{AUR|emacs-org-mode}}}}<br />
* {{App|nixnote|Evernote's third Opensource application, formerly called Nevernote.|http://www.sourceforge.net/projects/nevernote|{{aur|nixnote2}}}}<br />
* {{app|[[Wikipedia:QOwnNotes|QOwnNotes]]|An open source notepad and todo list manager with markdown support and optional ownCloud integration built on qt5.|http://www.qownnotes.org/|{{aur|qownnotes}}}}<br />
* {{App|RedNotebook|Modern journal, which lets you format, tag and search your entries.|http://rednotebook.sourceforge.net/|{{aur|rednotebook}}}}<br />
* {{App|[[Wikipedia:Tomboy (software)|Tomboy]]|Desktop note-taking application for Linux and Unix with a wiki-like linking system to connect notes together.|https://wiki.gnome.org/Apps/Tomboy|{{Pkg|tomboy}}}}<br />
* {{App|wiznote|Opensource cross-platform cloud based note-taking client.|http://www.wiznote.com/|{{Pkg|wiznote}}}}<br />
* {{App|[[zim]]|WYSIWYG text editor that aims at bringing the concept of a wiki to the desktop.|http://zim-wiki.org/|{{Pkg|zim}}}}<br />
* {{app|znotes|A lightweight crossplatform application for notes managment with simple interface, use qt4 libraries.|http://znotes.sourceforge.net/|{{aur|znotes}}}}<br />
<br />
=== Mind-mapping tools ===<br />
<br />
* {{App|FreeMind|Premier free mind-mapping software written in Java.|http://freemind.sourceforge.net|{{Pkg|freemind}}}}<br />
* {{App|Freeplane|Free and open source software application that supports thinking, sharing information and getting things done at work, in school and at home. The software can be used for mind mapping and analyzing the information contained in mind maps.|http://freeplane.sourceforge.net|{{AUR|freeplane}}}}<br />
* {{App|Labyrinth|Lightweight mind-mapping tool with support for image import and drawing.|https://github.com/labyrinth-team/labyrinth|{{Pkg|labyrinth}}}}<br />
* {{App|Semantik|A mind-mapping application for KDE.|https://waf.io/semantik.html|{{AUR|semantik}}}}<br />
* {{App|TreeSheets|The ultimate replacement for spreadsheets, mind mappers, outliners, PIMs, text editors and small databases.|http://strlen.com/treesheets/|{{AUR|treesheets-git}}}}<br />
* {{App|View Your Mind|Tool to generate and manipulate maps which show your thoughts. Such maps can help you to improve your creativity and effectivity. You can use them for time management, to organize tasks, to get an overview over complex contexts, to sort your ideas etc.|http://www.insilmaril.de/vym/|{{Pkg|vym}}}}<br />
* {{App|Visual Understanding Environment|Open Source project focused on creating flexible tools for managing and integrating digital resources in support of teaching, learning and research.|http://vue.tufts.edu |{{AUR|vue}}}}<br />
* {{App|XMind|Brainstorming and mind mapping application. It provides a rich set of different visualization styles, and allows sharing of created mind maps via their website.|http://www.xmind.net|{{AUR|xmind}}}}<br />
<br />
=== Character selectors ===<br />
<br />
* {{app|GNOME Characters|Character map application for GNOME|https://wiki.gnome.org/Design/Apps/CharacterMap|{{Pkg|gnome-characters}}}}<br />
* {{app|gucharmap|A GTK+ 3 Character Selector, distributed with GNOME desktop.|https://wiki.gnome.org/Apps/Gucharmap|{{pkg|gucharmap}}}}<br />
* {{app|kdeutils-kcharselect|A tool to select special characters from all installed fonts and copy them into the clipboard. Distributed with KDE.|https://utils.kde.org/projects/kcharselect/|{{Pkg|kcharselect}}}}<br />
<br />
=== Stylus note taking ===<br />
* {{app|Write|A word processor for hand writing.|http://www.styluslabs.com/|{{AUR|write_stylus}}}}<br />
* {{app|Gournal|Note-taking application written for usage on Tablet-PC, written in perl.|http://www.adebenham.com/old-stuff/gournal/|{{AUR|gournal}}}}<br />
* {{app|Xournal|An application for notetaking, sketching and keeping a journal using a stylus. Capable of annotating existing PDF-files as well. |http://xournal.sourceforge.net/|{{Pkg|xournal}}}}<br />
* {{app|Xournal++|A C++ rewrite of Xournal.|https://github.com/xournalpp/xournalpp|{{AUR|xournalpp-git}}}}<br />
<br />
=== Barcode generators and readers ===<br />
<br />
==== Console ====<br />
<br />
* {{App|barcode|A tool to convert text strings to printed bars.|https://www.gnu.org/software/barcode/|{{Pkg|barcode}}}}<br />
* {{App|iec16022|Produce 2D barcodes often also referenced as DataMatrix.|https://datenfreihafen.org/projects/iec16022.html|{{Pkg|iec16022}}}}<br />
* {{App|qrencode|C library and command line tool for encoding data in a QR Code symbol.|https://fukuchi.org/works/qrencode/|{{Pkg|qrencode}}}}<br />
* {{App|ZBar|Application and library for reading bar codes from various sources.|http://zbar.sourceforge.net/|{{Pkg|zbar}}}}<br />
* {{App|Zint|Barcode encoding library and command line tool supporting over 50 symbologies.|http://zint.org.uk/|{{Pkg|zint}}}}<br />
<br />
==== Graphical ====<br />
<br />
* {{App|gLabels|Program for creating labels and business cards. It also supports creating barcodes.|http://glabels.org/|{{Pkg|glabels}}}}<br />
* {{App|Qreator|Create your own QR codes.|http://davidplanella.org/project-showcase/qreator/|{{AUR|qreator}}}}<br />
* {{App|QtQR|QR Code generator and decoder.|https://launchpad.net/qr-tools|{{AUR|qtqr}}}}<br />
* {{App|Zint Barcode Studio|Barcode generator GUI.|http://zint.org.uk/|{{Pkg|zint-qt}}}}</div>Delapouitehttps://wiki.archlinux.org/index.php?title=Kakoune&diff=523104Kakoune2018-05-25T17:15:39Z<p>Delapouite: change install link to point to community</p>
<hr />
<div>[[Category:Text editors]]<br />
[[ja:Kakoune]]<br />
{{Related articles start}}<br />
{{Related|List of applications/Documents#Vi text editors}}<br />
{{Related|Vim}}<br />
{{Related articles end}}<br />
<br />
[http://kakoune.org/ Kakoune] is a modal text editor. It is inspired by Vim and similar alternatives, but tries to improve the text editing workflow as well as fit better to the Unix philosophy. Besides modal editing, two other main concepts are selection based editing, and multi-cursor editing. It has an interactive help system, and supports many languages.<br />
<br />
== Installation ==<br />
[[Install]] the {{Pkg|kakoune}} package.<br />
<br />
== Usage ==<br />
{{ic|:doc <topic>}} opens the documentation of <topic>.<br />
<br />
It has an interactive help system, which means e.g. pressing {{ic|g}} {{ic|(goto mode)}} shows a dialog with possible keys and destinations, or it displays a help dialog with the description of the highlighted completion candidate in {{ic|prompt}} mode.<br />
<br />
== Configuration ==<br />
Kakoune reads configuration from {{ic|$XDG_CONFIG_HOME/kak}}.<br />
<br />
The main configuration file is {{ic|kakrc}}, and custom colorschemes can be stored in the {{ic|colors}} directory.<br />
<br />
Every {{ic|*.kak}} file is loaded from {{ic|autoload}} at startup. If this directory exists in {{ic|$XDG_CONFIG_HOME}}, Kakoune don't loads the system wide {{ic|autoload}} dir (/usr/share/kak/autoload), so it have to be linked there. For example:<br />
<br />
ln -s /usr/share/kak/autoload $XDG_CONFIG_HOME/kak/autoload/default<br />
<br />
== See also ==<br />
<br />
* [https://github.com/mawww/kakoune Github repository]<br />
* [https://github.com/mawww/kakoune/wiki Github wiki]</div>Delapouitehttps://wiki.archlinux.org/index.php?title=List_of_applications/Documents&diff=510706List of applications/Documents2018-02-13T21:25:01Z<p>Delapouite: /* Vi text editors */ add link to kakoune wiki page</p>
<hr />
<div><noinclude><br />
[[Category:Applications]]<br />
[[es:List of applications/Documents]]<br />
[[it:List of applications/Documents]]<br />
[[ja:アプリケーション一覧/ドキュメント]]<br />
[[ru:List of applications/Documents]]<br />
[[zh-hans:List of applications/Documents]]<br />
[[zh-hant:List of applications/Documents]]<br />
{{List of applications navigation}}<br />
</noinclude><br />
== Documents and texts ==<br />
<br />
=== Office suites ===<br />
<br />
See also [[Wikipedia:Comparison of office suites]].<br />
<br />
* {{App|[[Wikipedia:Calligra Suite|Calligra]]|Actively developed fork of KOffice, the [[KDE]] office suite. It offers most of the features of OpenOffice while also having versions for smartphones (Calligra Mobile) and tablets (Calligra Active).|https://www.calligra.org/|{{Pkg|calligra}}}}<br />
* {{App|[[LibreOffice]]|More actively developed fork of OpenOffice.|https://www.libreoffice.org/|{{Pkg|libreoffice-still}} or {{Pkg|libreoffice-fresh}}}}<br />
* {{App|[[OpenOffice]]|Open-source office software suite for word processing, spreadsheets, presentations, graphics, databases and more, under the Apache Licence.|http://www.openoffice.org/|{{AUR|openoffice}}}}<br />
* {{App|[[Wikipedia:SoftMaker Office|SoftMaker Office]]|A complete, reliable, lightning-fast and Microsoft Office-compatible office suite with a word processor, spreadsheet, and presentation graphics software.|http://www.freeoffice.com/|{{AUR|freeoffice}}}}<br />
* {{App|Unoconv|Libreoffice-based document converter.|http://dag.wiee.rs/home-made/unoconv/|{{Pkg|unoconv}}}}<br />
* {{App|[[Wikipedia:Kingsoft Office|WPS Office]]|Proprietary office productivity suite, previously known as Kingsoft Office.|http://www.wps.com/|{{AUR|wps-office}}}}<br />
<br />
=== Word processors ===<br />
<br />
See also [[Wikipedia:Comparison of word processors]].<br />
<br />
* {{App|[[Abiword]]|Full-featured word processor.|http://www.abisource.com/|{{Pkg|abiword}}}}<br />
* {{App|[[Antiword]]|MS Word reader.|http://www.winfield.demon.nl/|{{Pkg|antiword}}}}<br />
* {{App|[[Wikipedia:BlueGriffon|BlueGriffon]]|WYSIWYG content editor for the World Wide Web.|http://www.bluegriffon.com/|{{Pkg|bluegriffon}}}}<br />
* {{App|[[Wikipedia:Calligra Words|Calligra Words]]|Powerful word processor included in the Calligra Suite.|https://www.calligra.org/words/|{{Pkg|calligra}}}}<br />
* {{App|gLabels|Program for creating labels and business cards.|http://glabels.org/|{{Pkg|glabels}}}}<br />
* {{App|[[Wikipedia:KompoZer|KompoZer]]|A Dreamweaver style WYSIWYG web editor; Nvu unofficial bug-fix release.|http://kompozer.net/|{{Pkg|kompozer}}}}<br />
* {{App|[[LibreOffice|LibreOffice Writer]]|Full-featured word processor included in the LibreOffice suite.|https://www.libreoffice.org/discover/writer|{{Pkg|libreoffice-still}} or {{Pkg|libreoffice-fresh}}}}<br />
* {{App|[[OpenOffice|OpenOffice Writer]]|Full-featured word processor included in the OpenOffice suite.|http://www.openoffice.org/|{{AUR|openoffice}}}}<br />
* {{App|[[Wikipedia:Scribus|Scribus]]|Desktop publishing program.|http://www.scribus.net/canvas/Scribus|{{Pkg|scribus}}}}<br />
* {{App|[[Wikipedia:SeaMonkey#Composer|SeaMonkey Composer]]|Powerful yet simple HTML editor included in the SeaMonkey suite.|http://www.seamonkey-project.org/|{{Pkg|seamonkey}}}}<br />
* {{App|[[Wikipedia:Ted (word processor)|Ted]]|Easy to use GTK+-based rich text processor (with footnote support).|http://www.nllgg.nl/Ted/|{{AUR|ted}}}}<br />
<br />
=== Document markup languages ===<br />
<br />
See also [[Wikipedia:Comparison of document markup languages]].<br />
<br />
* {{App|[[Wikipedia:AsciiDoc|asciidoc]]|Human-readable text document format. Used by Arch for generating ''pacman'' 's man pages[https://www.archlinux.org/pacman/pacman.8.html].|http://asciidoc.org/|{{Pkg|asciidoc}}}}<br />
* {{App|Asciidoctor|An asciidoc implementation written in Ruby, with many extra features.|http://asciidoctor.org/|{{Pkg|asciidoctor}}}}<br />
* {{App|[[Wikipedia:Markdown|Markdown]]|Text-to-HTML conversion tool that allows you to write using a simple plain text format.|http://daringfireball.net/projects/markdown|{{Pkg|discount}}}}<br />
* {{App|[[Wikipedia:Pandoc|Pandoc]]|Swiss-army knife for converting one markup format into another.|http://johnmacfarlane.net/pandoc|{{pkg|pandoc}}}}<br />
* {{App|[[Wikipedia:Sphinx_(documentation_generator)|Sphinx]]| A documentation generation system using [[Wikipedia:ReStructuredText|reStructuredText]] to generate output in multiple formats (primary documentation system for the Python project).|http://sphinx-doc.org|{{Pkg|python-sphinx}}}}<br />
* {{App|[[Wikipedia:Txt2tags|txt2tags]]|Dead-simple, KISS-compliant lightweight, human-readable markup language to produce rich format content out of plain text files.|http://txt2tags.sourceforge.net|{{Pkg|txt2tags}}}}<br />
<br />
=== Spreadsheets ===<br />
<br />
See also [[Wikipedia:Comparison of spreadsheet software]].<br />
<br />
* {{App|[[Wikipedia:Calligra Sheets|Calligra Sheets]]|Powerful spreadsheet application included in the Calligra Suite|https://www.calligra.org/sheets/|{{Pkg|calligra}}}}<br />
* {{App|[[Gnumeric]]|Spreadsheet program that is part of the GNOME desktop.|http://www.gnumeric.org/|{{Pkg|gnumeric}}}}<br />
* {{App|[[LibreOffice|LibreOffice Calc]]|Full-featured spreadsheet application included in the LibreOffice suite.|https://www.libreoffice.org/discover/calc/|{{Pkg|libreoffice-still}} or {{Pkg|libreoffice-fresh}}}}<br />
* {{App|[[OpenOffice|OpenOffice Calc]]|Full-featured spreadsheet application included in the OpenOffice suite.|http://openoffice.org/product/calc.html|{{AUR|openoffice}}}}<br />
* {{App|Pyspread|Pyspread is a non-traditional spreadsheet application that is based on and written in the programming language Python.|http://manns.github.io/pyspread/index.html|{{AUR|pyspread}}}}<br />
* {{App|[[sc]]|curses-based lightweight spreadsheet.|http://ibiblio.org/pub/linux/apps/financial/spreadsheet/!INDEX.html|{{Pkg|sc}}}}<br />
* {{App|sc-im|spreadsheet program based on sc.|https://github.com/andmarti1424/sc-im/|{{AUR|sc-im}}}}<br />
<br />
=== Scientific documents ===<br />
With [[TeX Live|TeX, LaTeX and friends]], creation of any scientific document, article, journal, etc. is made commonplace.<br />
<br />
See also [[Wikipedia:Comparison of TeX editors]] and [https://en.wikibooks.org/wiki/LaTeX/Installation#Editors the LaTeX Wikibook].<br />
<br />
* {{App|[[Wikipedia:AUCTEX|AUCTeX]]|Together with RefTex, AUCTeX provices an extensible environment for writing and formatting TeX files in Emacs.|https://www.gnu.org/software/auctex/|{{Pkg|auctex}}}}<br />
* {{App|EqualX|LaTeX equation editor with real time preview.|http://equalx.sourceforge.net/index.html|{{AUR|equalx}}}}<br />
* {{App|gedit-latex|Add code-completion to gedit and allows for compiling LaTeX documents and managing BibTeX bibliographies.|http://www.gnome.org/|{{AUR|gedit-latex}}}}<br />
* {{App|[[Wikipedia:Gummi (software)|Gummi]]|Lightweight TeX/LaTeX GTK+-based editor. It features a continuous preview mode, integrated BibTeX support, extendable snippet interface and multi-document support.|https://github.com/alexandervdm/gummi/|{{Pkg|gummi}}}}<br />
* {{App|[[Wikipedia:JabRef|JabRef]]|Java GUI frontend for managing BibTeX and other bibliographies.|http://jabref.sourceforge.net/index.php|{{AUR|jabref}} {{AUR|jabref-git}}}}<br />
* {{App|[[Wikipedia:Kile|Kile]]|User-friendly TeX/LaTeX editor for the KDE desktop with many features.|http://kile.sourceforge.net/|{{Pkg|kile}}}}<br />
* {{App|Ktikz|GUI making diagrams with [http://pgf.sourceforge.net/ PGF/TikZ] easier.|http://www.hackenberger.at/blog/ktikz-editor-for-the-tikz-language/|{{AUR|ktikz}}}}<br />
* {{App|[[Wikipedia:LaTeXila|LaTeXila]]|LaTeX editor for the GNOME Desktop including support for code completion, compiling and project management.|https://wiki.gnome.org/Apps/LaTeXila|{{Pkg|latexila}}}}<br />
* {{App|[[Lout]]|A lightware document formatting system. Reads a high-level description of a document similar in style to LaTeX and produces a PostScript.|http://savannah.nongnu.org/projects/lout|{{pkg|lout}}}}<br />
* {{App|[[Wikipedia:LyX|LyX]]|Document processor that encourages an approach to writing based on the structure of your documents (WYSIWYM) and not simply their appearance (WYSIWYG).|http://www.lyx.org/|{{Pkg|lyx}}}}<br />
* {{App|[[Wikipedia:GNU TeXmacs|TeXmacs]]|WYSIWYW (what you see is what you want) editing platform with special features for scientists.|http://www.texmacs.org/|{{Pkg|texmacs}}}}<br />
* {{App|[[Wikipedia:Texmaker|Texmaker]]|Cross-platform, light and easy-to-use LaTeX IDE. It integrates many tools needed to develop documents with LaTeX, in just one application|http://www.xm1math.net/texmaker/|{{Pkg|texmaker}}}}<br />
* {{App|[[Wikipedia:TeXstudio|TeXstudio]]|Fork of TeXMaker including support for code completion of bibtex items, grammar check and automatic detection of the need for multiple LaTeX runs.|http://texstudio.sourceforge.net/|{{pkg|texstudio}}}}<br />
* {{App|[[Vim|Vim-LaTeX-suite]]|Customizable LaTeX environment for Vim.|http://vim-latex.sourceforge.net/|{{Pkg|vim-latexsuite}}}}<br />
* {{App|[[Vim|Vimtex]]|This vim plugin is a fork of [https://github.com/LaTeX-Box-Team/LaTeX-Box LaTeX-Box]. It provides automatic syntax-based folding, omni-completion (for citations and labels), latexmk-based compilation and synctex functionality for {{Pkg|zathura}} and {{Pkg|mupdf}}.|https://github.com/lervag/vimtex/|}}<br />
* {{App|[[Wikipedia:Zotero|Zotero]]|This is a free, easy-to-use tool to help you collect, organize, cite, and share your research sources. There is a stand-alone version and a Firefox add-on available.|https://www.zotero.org/|{{AUR|zotero}}}}<br />
<br />
=== Translation and localization ===<br />
<br />
* {{App|[[Wikipedia:Apertium|Apertium]]|Free and open source rule-based machine translation platform with available language data. It supports the following formats: HTML, Microsoft Office 2007 XML, OpenDocument, TMX, MediaWiki and others.|http://apertium.org/|{{AUR|apertium}}}}<br />
* {{App|[[Wikipedia:Gtranslator|Gtranslator]]|Enhanced gettext po file editor for the GNOME. It handles all forms of gettext po files and includes very useful features.|https://wiki.gnome.org/Apps/Gtranslator|{{Pkg|gtranslator}}}}<br />
* {{App|Lokalize|Standard [[KDE]] tool for software translation. It includes basic editing of PO files, support for glossary, translation memory, project managing, etc. It belongs to {{Grp|kdesdk}}|https://userbase.kde.org/Lokalize|{{Pkg|lokalize}}}}<br />
* {{App|[[Wikipedia:Moses (machine translation)|Moses]]|Statistical machine translation tool (language data not included).|http://statmt.org/moses|{{AUR|mosesdecoder}} {{AUR|mosesdecoder-git}}}}<br />
* {{App|[[Wikipedia:OmegaT|OmegaT]]|General translator's tool which contains a lot of translation memory features and can give suggestions from Google Translate. It supports the following formats: HTML, Microsoft Office 2007 XML, OpenDocument, XLIFF/Okapi, MediaWiki, plain text, TMX and others.|http://omegat.org|{{AUR|omegat}}}}<br />
* {{App|[[Wikipedia:Poedit|Poedit]]|Simple gettext/po-based translation tool.|http://poedit.net|{{Pkg|poedit}}}}<br />
* {{App|Pology|Set of Python tools for dealing with gettext/po-files.|https://techbase.kde.org/Localization/Tools/Pology|{{AUR|pology}}}}<br />
* {{App|[[Wikipedia:Virtaal|Virtaal]]|Editor for translation of both software and other text, based on [[Wikipedia:Translate Toolkit|Translate Toolkit]]. It supports the following formats: [[Wikipedia:gettext|gettext]], [[Wikipedia:XLIFF|XLIFF]] , TMX, TBX, [[Wikipedia:Wordfast|Wordfast]], Qt Linguist , Qt Phrase Book, [[Wikipedia:OmegaT|OmegaT glossary]] and others. It can also show suggestions from [[Wikipedia:Apertium|Apertium]], [[Wikipedia:Google Translate|Google Translate]], [[Wikipedia:Bing Translator|Bing Translator]], [[Wikipedia:Moses (machine translation)|Moses]] and others.|http://virtaal.translatehouse.org/|{{AUR|virtaal}}}}<br />
<br />
=== Text editors ===<br />
<br />
See also [[Wikipedia:Comparison of text editors]].<br />
<br />
Some of the lighter-weight [[List_of_applications/Utilities#Integrated_development_environments|Integrated development environments]] can also serve as text editors.<br />
<br />
==== Console ====<br />
<br />
* {{App|e3|Tiny editor without dependencies, written in assembly.|http://sites.google.com/site/e3editor/|{{Pkg|e3}}}}<br />
* {{App|ee|A classic curse-based text editor. Born in HP-UX, used in FreeBSD.|http://www.users.qwest.net/~hmahon/|{{aur|ee-editor}}}}<br />
* {{App|dex|Small and easy to use text editor with support for ctags and parsing compiler errors.|https://github.com/tihirvon/dex|{{AUR|dex-editor-git}}}}<br />
* {{App|[[Emacs|Emacs-nox]]|The extensible, customizable, self-documenting real-time display editor, without X11 support.|https://www.gnu.org/software/emacs/emacs.html|{{Pkg|emacs-nox}}}}<br />
* {{App|[[Wikipedia:JED (text editor)|JED]]|Text editor that makes extensive use of the [[Wikipedia:S-Lang (programming library)|S-Lang library]]. Includes a console version (jed) and an X-window version (xjed).|http://jedsoft.org/jed/|{{AUR|jed}}}}<br />
* {{App|Joe (Joe's Own Editor)|Terminal-based text editor designed to be easy to use.|http://joe-editor.sourceforge.net/|{{Pkg|joe}}}}<br />
* {{App|[[Wikipedia:Midnight Commander|mcedit]]|Useful text editor that comes with Midnight Commander file manager.|http://www.ibiblio.org/mc/|{{Pkg|mc}}}}<br />
* {{App|micro|A modern and intuitive terminal-based text editor, written in go and extensible through plugins|https://micro-editor.github.io|{{AUR|micro}}}}<br />
* {{App|[[Wikipedia:MicroEMACS|MicroEmacs]]|Ncurses-based text editor. Includes a console version (me -n) and an X-window version (me).|http://www.jasspa.com/|{{AUR|jasspa-me}}}}<br />
* {{App|[[Wikipedia:mg (editor)|mg]]|Small, fast, and portable Emacs-like editor.|http://homepage.boetes.org/software/mg|{{Pkg|mg}}}}<br />
* {{App|mp|Minimum Profit is a text editor for programmers. It helps you definitively abandon vi, emacs and other six-legged freaks.|http://triptico.com/software/mp.html|{{AUR|mp}}}}<br />
* {{App|[[nano]]|Console text editor based on pico with on-screen key bindings help.|http://nano-editor.org/|{{Pkg|nano}}}}<br />
* {{App|Ne|Minimalist text editor with Windows-like key-bindings.|http://ne.di.unimi.it/|{{AUR|ne}}}}<br />
* {{App|Slap|Sublime-like terminal-based text editor.|https://github.com/slap-editor/slap|{{AUR|slap}}}}<br />
* {{App|Tilde|An intuitive text editor with Windows-like key bindings.|http://os.ghalkes.nl/tilde/|{{AUR|tilde}}}}<br />
* {{App|[[Wikipedia:Vile (editor)|vile]]|A lightweight Emacs clone with ''vi''-like key bindings.|http://invisible-island.net/vile/vile.html|{{AUR|vile}}}}<br />
* {{App|[[Wikipedia:Zile (editor)|Zile]]|A lightweight Emacs clone.|https://www.gnu.org/software/zile/|{{Pkg|zile}}}}<br />
<br />
===== Vi text editors =====<br />
<br />
* {{App|Amp|A text editor written in Rust, that aims to take the core interaction model of Vim, simplify it, and bundle in the essential features required for a modern text editor.|https://amp.rs|{{AUR|amp}}}}<br />
* {{App|[[Kakoune]]|Modal editor. Fewer keystrokes. Selection based, multi-cursor editing. Orthogonal design.|https://github.com/mawww/kakoune|{{aur|kakoune-git}}}}<br />
* {{App|[[Neovim]]|Vim's rebirth for the 21st century|http://neovim.io/|{{Pkg|neovim}}}}<br />
* {{App|[[Vi]]|The original ex/vi text editor.|http://ex-vi.sourceforge.net/|{{Pkg|vi}}}}<br />
* {{App|[[Vim]] (Vi IMproved)|Advanced text editor that seeks to provide the power of the de-facto Unix editor 'vi', with a more complete feature set.|http://www.vim.org/|{{Pkg|vim}}}}<br />
* {{App|Vis|modern, legacy free, simple yet efficient vim-like editor.|http://www.brain-dump.org/projects/vis/|{{Pkg|vis}}}}<br />
<br />
==== Graphical ====<br />
<br />
* {{App|[[Wikipedia:Acme (text editor)|Acme]]|Minimalist and flexible programming environment developed by Rob Pike for the Plan 9 operating system.|http://acme.cat-v.org|{{Pkg|plan9port}}}}<br />
* {{App|[[Atom]]|A promising text editor developed by GitHub. With support for plug-ins written in Node.js and embedded [[Git]] Control.|https://atom.io|{{Pkg|atom}}}}<br />
* {{App|Beaver|A GTK+ editor designed to be modular, lightweight and stylish.|http://beaver-editor.sourceforge.net|{{Pkg|beaver}}}}<br />
* {{App|[[w:Brackets (text editor)|Brackets]]|An open source code editor for the web, written in JavaScript, HTML and CSS.|http://brackets.io|{{AUR|brackets}}}}<br />
* {{App|FeatherPad|Minimal Qt5 plain text editor featuring a native dark theme and support for tabs, printing and syntax highlighting.|https://github.com/tsujan/FeatherPad|{{AUR|featherpad}}}}<br />
* {{App|[[Wikipedia:Geany|Geany]]|A text editor using the GTK2 toolkit with basic features of an integrated development environment. It has support for TeX-based documents.|https://www.geany.org|{{Pkg|geany}}}}<br />
* {{App|[[Wikipedia:Gedit|Gedit]]|GTK+ editor for the GNOME desktop with syntax highlighting, automatic indentation, matching brackets, etc., and a number of add-ons to increase functionality.|https://wiki.gnome.org/Apps/Gedit|{{Pkg|gedit}}}}<br />
* {{App|[[GNU Emacs]]|The extensible, customizable, self-documenting real-time display editor.|https://www.gnu.org/software/emacs/|{{Pkg|emacs}}}}<br />
* {{App|[[gVim]]|Graphical interface for Vim.|http://www.vim.org|{{Pkg|gvim}}}}<br />
* {{App|Jedit|Text editor for programmers, written in Java.|http://www.jedit.org|{{Pkg|jedit}}}}<br />
* {{App|[[Wikipedia:JuffEd|JuffEd]]|Simple tabbed text editor with syntax highlighting, written in Qt.|http://juffed.com/en/index.html|{{AUR|juffed}}}}<br />
* {{App|[[Wikipedia:Kate (text editor)|Kate]]|Full-featured programmer's editor for the KDE desktop with MDI and a filesystem browser.|https://kate-editor.org|{{Pkg|kate}}}}<br />
* {{App|[[Wikipedia:KWrite|KWrite]]|Lightweight text editor for the KDE desktop that uses the same editor widget as Kate.|https://www.kde.org/applications/utilities/kwrite|{{Pkg|kwrite}}}}<br />
* {{App|[[Wikipedia:Leafpad|Leafpad]]|Notepad clone for GTK+ that emphasizes simplicity.|http://tarot.freeshell.org/leafpad|{{Pkg|leafpad}}}}<br />
* {{App|L3afpad| Simple text editor forked from Leafpad, supports GTK+ 3.|https://github.com/stevenhoneyman/l3afpad|{{Pkg|l3afpad}}}}<br />
* {{App|[[w:Light Table (software)|LightTable]]|A modern open source text editor.|http://lighttable.com|{{AUR|lighttable-bin}}{{AUR|lighttable-git}}}}<br />
* {{App|Medit|Programming and around-programming text editor.|http://mooedit.sourceforge.net|{{Pkg|medit}}}}<br />
* {{App|[[Wikipedia:Xfce#Mousepad|Mousepad]]|Fast text editor for the Xfce Desktop Environment.|https://www.xfce.org|{{Pkg|mousepad}}}}<br />
* {{App|[[Wikipedia:NEdit|Nedit]]|Text editor for the Motif environment.|http://www.nedit.org|{{Pkg|nedit}}}}<br />
* {{App|Notepadqq|A Qt-based, Notepad++-like text editor with support for syntax highlighting for more than 100 languages.|http://notepadqq.altervista.org/s/|{{Pkg|notepadqq}}}}<br />
* {{App|[[MATE|Pluma]]|A powerful text editor for MATE.|http://mate-desktop.org|{{Pkg|pluma}}}}<br />
* {{App|[[Wikipedia:PyRoom|PyRoom]]|Great distractionless PyGTK text editor, a clone of the infamous WriteRoom.|http://pyroom.org|{{AUR|pyroom}}}}<br />
* {{App|QSciTE|Qt clone of the SciTE text and code editor.|https://code.google.com/archive/p/qscite/|{{AUR|qscite}}}}<br />
* {{App|QXmlEdit|Simple Qt XML editor and XSD viewer.|http://qxmledit.org|{{AUR|qxmledit}}}}<br />
* {{App|[[Wikipedia:Sam (text editor)|Sam]]|Minimalist text editor with a graphical user interface, a very powerful command language and remote editing capabilities, developed by Rob Pike.|http://sam.cat-v.org|{{Pkg|plan9port}} or {{Pkg|9base}}}}<br />
* {{App|[[Wikipedia:SciTE|SciTE]]|Generally useful editor with facilities for building and running programs.|http://scintilla.org/SciTE.html|{{AUR|scite}}}}<br />
* {{App|Scribes|An ultra minimalist text editor that combines simplicity with power.|http://scribes.sourceforge.net|{{Pkg|scribes}}}}<br />
* {{App|[[Wikipedia:Sublime Text|Sublime Text 2]]|Closed-source C++ and Python-based editor with many advanced features and plugins while staying lightweight and pretty.|https://www.sublimetext.com|{{AUR|sublime-text2}}}}<br />
* {{App|[[Wikipedia:Sublime Text|Sublime Text 3]]|Closed-source C++ and Python-based editor with many advanced features and plugins while staying lightweight and pretty.|https://www.sublimetext.com|{{AUR|sublime-text-dev}}}}<br />
* {{App|Tea|Qt-based feature rich text editor.|http://semiletov.org/tea|{{AUR|tea}}}}<br />
* {{App|[[Textadept]]|Lua-extensible feature rich text editor based on Scintilla and written in C.|http://foicica.com/textadept|{{AUR|textadept}}}}<br />
* {{App|[[Visual Studio Code]]|Editor for building and debugging modern web and cloud applications.|https://code.visualstudio.com|{{AUR|visual-studio-code-bin}}}}<br />
* {{App|XEdit|Simple text editor for the X Window System.|https://www.x.org/wiki|{{Pkg|xorg-xedit}}}}<br />
<br />
=====Collaborative text editors=====<br />
* {{App|Gobby|Collaborative editor supporting multiple documents in one session and a multi-user chat.|https://gobby.github.io|{{Pkg|gobby}}}}<br />
<br />
=== Readers and Viewers ===<br />
<br />
==== E-book applications ====<br />
<br />
{{Note|Some [[#PDF and DjVu|PDF and DjVu viewers]] also support other e-book formats.}}<br />
<br />
* {{App|Bookworm|eBook reader with epub, pdf, mobi, cbr support for Elementary OS.|https://babluboy.github.io/bookworm/|{{Pkg|bookworm}}}}<br />
* {{App|[[Wikipedia:Calibre (software)|Calibre]]|E-book library management application that can also convert between different formats and sync with a variety of e-book readers. Supported formats include CBZ, CBR, CBC, CHM, DJVU, EPUB, FictionBook, HTML, HTMLZ, LIT, LRF, Mobipocket, ODT, PDF, PRC, PDB, PML, RB, RTF, SNB, TCR, TXT and TXTZ.|https://calibre-ebook.com/|{{Pkg|calibre}}}}<br />
* {{App|Cool Reader|E-book viewer with many supported formats such as EPUB (non-DRM), FictionBook, TXT, RTF, HTML, CHM and TCR.|https://sourceforge.net/projects/crengine/|{{AUR|coolreader3-git}}}}<br />
* {{App|epub|A console EPUB reader using Python and Curses.|https://pypi.python.org/pypi/epub|{{AUR|python-epub}}}}<br />
* {{App|[[Wikipedia:FBReader|FBReader]]|E-book viewer with many supported formats such as EPUB, FictionBook, HTML, plucker, PalmDoc, zTxt, TCR, CHM, RTF, OEB, Mobipocket (non-DRM) and TXT.|https://fbreader.org/|{{Pkg|fbreader}}}}<br />
* {{App|[[Wikipedia:Sigil (application)|Sigil]]|WYSIWYG ebook editor.|https://sigil-ebook.com/|{{pkg|sigil}}}}<br />
<br />
==== PDF and DjVu ====<br />
<br />
{{Note|1=[[Wikipedia:Portable_Document_Format#Interactive_elements|PDF forms]] support:<br />
* {{AUR|acroread}} is able to save both AcroForms and XFA forms into PDF files.<br />
* Poppler-based readers such as {{Pkg|evince}} and {{Pkg|okular}} support AcroForms, but not full XFA forms. [https://bugs.freedesktop.org/show_bug.cgi?id=18935] [https://bugs.launchpad.net/ubuntu/+source/poppler/+bug/321720]<br />
* For CJK(Chinese, Japanese, Korean) support in poppler-based readers such as {{Pkg|evince}} and {{Pkg|okular}}, install {{Pkg|poppler-data}}. poppler-data is an optional dependency of poppler which is an indirect dependency of evince and okular.<br />
}}<br />
<br />
See also [[Wikipedia:List of PDF software]] and [[Wikipedia:DjVu]].<br />
<br />
===== Console =====<br />
<br />
* {{App|fbgs|Poor man's PostScript/pdf viewer for the linux framebuffer console.|https://www.kraxel.org/blog/linux/fbida/|{{Pkg|fbida}}}}<br />
* {{App|fbpdf|Small framebuffer PDF and DjVu viewer based off of MuPDF, with [[Vim]] keybindings and written in C|http://repo.or.cz/w/fbpdf.git|{{AUR|fbpdf-git}}}}<br />
* {{App|ghostscript| convert into PDF, reduce size of PDF documents with eg {{ic|<nowiki>gs -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dPDFSETTINGS=/screen -dNOPAUSE -dQUIET -dBATCH -sOutputFile=output.pdf input.pdf</nowiki>}}|https://www.ghostscript.com/|{{Pkg|ghostscript}}}}<br />
* {{App|jfbview|Framebuffer PDF and image viewer. Features include Vim-like controls, zoom-to-fit, a TOC (outline) view, fast multi-threaded rendering and asynchronous pre-caching. Originally a fork of ''fbpdf'' called ''jfbpdf'', now completely rewritten.|https://seasonofcode.com/pages/jfbview.html|{{AUR|jfbview}}}}<br />
<br />
===== Graphical =====<br />
<br />
{{Note|Some [[List_of_applications/Internet#Web_browsers|web browsers]] have support for displaying PDF files, either built-in or via plugin.}}<br />
<br />
* {{App|acroread|A PDF file viewer offered by Adobe (closed source).|http://www.adobe.com/products/reader.html|{{AUR|acroread}}}}<br />
* {{App|apvlv|Lightweight PDF/DjVu/UMD/TXT viewer with [[Vim]] keybindings.|http://naihe2010.github.io/apvlv/|{{AUR|apvlv}}}}<br />
* {{App|Atril|Simple multi-page document viewer for MATE.|https://github.com/mate-desktop/atril|{{Pkg|atril}}}}<br />
* {{App|ePDFView|Free lightweight PDF document viewer using the Poppler and GTK+ libraries. Development stopped.|http://freecode.com/projects/epdfview|{{Pkg|epdfview}}}}<br />
* {{App|[[Wikipedia:Evince|Evince]]|Document viewer for multiple document formats. Supports PDF, PostScript, DjVu, TIFF and DVI.|https://wiki.gnome.org/Apps/Evince|{{Pkg|evince}}}}<br />
* {{App|[[Wikipedia:Foxit Reader|Foxit Reader]]|Small, fast (compared to Acrobat) PDF viewer. (closed source)|https://www.foxitsoftware.com/pdf-reader/|{{AUR|foxitreader}}}}<br />
* {{App|gv|Graphical user interface for the Ghostscript interpreter that allows to view and navigate through PostScript and PDF documents.|https://www.gnu.org/software/gv/|{{Pkg|gv}}}}<br />
* {{App|[[llpp]]|Very fast PDF reader based off of MuPDF, that supports continuous page scrolling, bookmarking, and text search through the whole document.|http://repo.or.cz/w/llpp.git|{{AUR|llpp}}}}<br />
* {{App|Master PDF Editor|A functional proprietary PDF editor. Free non-commercial use. (closed source)|https://code-industry.net/free-pdf-editor/|{{AUR|masterpdfeditor}}}}<br />
* {{App|[[MuPDF]]|Very fast PDF, XPS, and EPUB viewer and toolkit written in portable C. Features CJK font support.|https://mupdf.com/|{{Pkg|mupdf}}}}<br />
* {{App|[[Wikipedia:Okular|Okular]]|Universal PDF viewer for KDE.|https://okular.kde.org/|{{Pkg|okular}}}}<br />
* {{App|PDF Chain|A graphical interface allowing to manipulate PDF documents (concatenate, burst, watermark, attach files...)|http://pdfchain.sourceforge.net/|{{AUR|pdfchain}}}}<br />
* {{App|PdfMod| You can reorder, rotate, and remove pages, export images from a document, edit the title, subject, author, and keywords, and combine documents via drag and drop. |https://wiki.gnome.org/Apps/PdfMod|{{Pkg|pdfmod}}}}<br />
* {{App|PDF Shuffler|Combine, split, rotate and reorder PDF documents. Uses Python and GTK2.|https://sourceforge.net/projects/pdfshuffler/|{{Pkg|pdfshuffler}}}}<br />
* {{App|PDF Studio|All-in-one PDF editor similar to Adobe Acrobat (proprietary).|https://www.qoppa.com/pdfstudio/|{{AUR|pdfstudio}}}}<br />
* {{App|qpdfview|Tabbed document viewer. It uses Poppler for PDF support, libspectre for PS support, DjVuLibre for DjVu support, CUPS for printing support and the Qt toolkit for its interface.|https://launchpad.net/qpdfview|{{Pkg|qpdfview}}}}<br />
* {{App|[[Wikipedia:Xournal|Xournal]]|Pdf viewer/note taking application.|http://xournal.sourceforge.net/|{{Pkg|xournal}}}}<br />
* {{App|[[Wikipedia:Xpdf|Xpdf]]|Viewer that can decode LZW and read encrypted PDFs. Note that due to removal of all Type1 fonts from the gsfonts package, you will need to install them from an archive package - see https://bugs.archlinux.org/task/50297|http://www.xpdfreader.com/|{{Pkg|xpdf}}}} and {{AUR|gsfonts-type1}}<br />
* {{App|[[Wikipedia:Zathura (document viewer)|zathura]]|Highly customizable and functional PDF/DjVu/PostScript/ComicBook viewer (plugin based).|https://pwmt.org/projects/zathura/|{{Pkg|zathura}} {{pkg|zathura-pdf-mupdf}} {{pkg|zathura-djvu}}}}<br />
<br />
==== Terminal pagers ====<br />
<br />
See also [[Wikipedia:Terminal pager]].<br />
<br />
* [[Wikipedia:More_(command)|more]] &mdash; A simple and feature-light pager. It is a part of the {{Pkg|util-linux}} package.<br />
* {{App|[[Core_utilities#less|less]]|A program similar to more, but with support for both forward and backward scrolling, as well as partial loading of files.|https://www.gnu.org/software/less/|{{Pkg|less}}}}<br />
* {{App|[[Wikipedia:Most_(Unix)|most]]|A pager with support for multiple windows, left and right scrolling, and built-in colour support|http://www.jedsoft.org/most/|{{Pkg|most}}}}<br />
* {{App|mcview|A pager with mouse and colour support. It is bundled with midnight commander.|http://midnight-commander.org/|{{Pkg|mc}}}}<br />
* {{App|vimpager|A script that turns vim into a pager. As a result, you get various vim features such as colour schemes, mouse support, split screens, etc.|https://github.com/rkitover/vimpager|{{Pkg|vimpager}}}}<br />
<br />
==== CHM ====<br />
<br />
See also [[Wikipedia:Microsoft Compiled HTML Help]].<br />
<br />
* {{App|Archmage|An extensible reader and decompiler for files in the CHM format.|https://github.com/dottedmag/archmage|{{AUR|archmage}}}}<br />
* {{App|ChmSee|CHM viewer based on xulrunner.|https://code.google.com/archive/p/chmsee/|{{AUR|chmsee}}}}<br />
* {{App|Kchmviewer|Qt-based CHM viewer that uses chmlib and borrows some ideas from xchm. It does not depend on [[KDE]], but it can be compiled to integrate with it.|http://www.ulduzsoft.com/linux/kchmviewer/|{{Pkg|kchmviewer}}}}<br />
* {{App|[[Wikipedia:xCHM|xCHM]]|Lightweight CHM viewer, based on chmlib.|http://xchm.sourceforge.net/|{{Pkg|xchm}}}}<br />
<br />
==== Comic book (comix/manga) ====<br />
<br />
* {{App|[[Wikipedia:MComix|MComix]]|GTK2 image viewer specifically designed to handle comic book archives (fork of Comix). Also includes library manager.|https://sourceforge.net/projects/mcomix/|{{Pkg|mcomix}}}}<br />
* {{App|YACReader|Comic book viewer written in C++ and Qt5. Comes with YACReaderLibrary for managing comics.|http://yacreader.com/|{{AUR|yacreader}}}}<br />
<br />
=== Scanning software ===<br />
<br />
See [[SANE#Install a frontend]].<br />
<br />
=== OCR software ===<br />
<br />
See also [[Wikipedia:Comparison of optical character recognition software]].<br />
<br />
==== Engines ====<br />
<br />
* {{App|CuneiForm|Command line OCR system originally developed and open sourced by Cognitive technologies. Supported languages: eng, ger, fra, rus, swe, spa, ita, ruseng, ukr, srp, hrv, pol, dan, por, dut, cze, rum, hun, bul, slo, lav, lit, est, tur.|https://launchpad.net/cuneiform-linux|{{Pkg|cuneiform}}}}<br />
* {{App|GOCR/JOCR|OCR engine which also supports barcode recognition.|http://jocr.sourceforge.net/|{{Pkg|gocr}}}}<br />
* {{App|Ocrad|OCR program based on a feature extraction method.|https://www.gnu.org/software/ocrad/|{{Pkg|ocrad}}}}<br />
* {{App|Tesseract|Accurate open source OCR engine. Package splitted, you need install some datafiles for each language ({{Pkg|tesseract-data-eng}} for example).|https://github.com/tesseract-ocr|{{Pkg|tesseract}}}}<br />
<br />
==== Layout analyzers and user interfaces ====<br />
<br />
* {{App|gImageReader|Graphical GTK frontend to Tesseract.|http://gimagereader.sourceforge.net/|{{AUR|gimagereader}}}}<br />
* {{App|gscan2pdf|Scans, runs an OCR engine, minor post-processing, creates a document.|http://gscan2pdf.sourceforge.net/|{{AUR|gscan2pdf}}}}<br />
* {{App|OCRFeeder|Python GUI for Gnome which performs document analysis and rendition, and can use either CuneiForm, GOCR, Ocrad or Tesseract as OCR engines. It can import from PDF or image files, and export to HTML or OpenDocument.|https://wiki.gnome.org/Apps/OCRFeeder|{{Pkg|ocrfeeder}}}}<br />
* {{App|OCRopy|OCR ''platform'', modules exist for document layout analysis, OCR engines (it can use Tesseract or its own engine), natural language modeling, etc.|https://github.com/tmbdev/ocropy|{{AUR|ocropy}}}}<br />
* {{App|[[YAGF]]|Graphical interface for the CuneiForm text recognition program on the Linux platform.|http://symmetrica.net/cuneiform-linux/yagf-en.html|{{AUR|yagf}}}}<br />
<br />
=== Note taking organizers ===<br />
<br />
See also [[Wikipedia:Comparison of notetaking software]].<br />
<br />
==== Console ====<br />
<br />
* {{App|deft|Manage notes within emacs|http://jblevins.org/projects/deft/}}<br />
* {{App|hnb (hierarchical notebook)|Program to organize many kinds of data (addresses, to-do lists, ideas, book reviews, etc.) in one place using the XML format.|http://hnb.sourceforge.net/|{{AUR|hnb}}}}<br />
* {{App|pynote|Manage notes on the commandline|https://github.com/rumpelsepp/pynote|{{AUR|pynote}}}}<br />
<br />
==== Graphical ====<br />
<br />
* {{App|[[Wikipedia:BasKet Note Pads|BasKet]]|Application for organizing, sharing, and taking notes. It can manage various types of information such as to-do lists, links, pictures, and other types, similar to a scrapbook.|https://userbase.kde.org/BasKet|{{Pkg|basket}}}}<br />
* {{App|Cherrytree|Hierarchical note taking application, featuring rich text and syntax highlighting, storing data in a single xml or sqlite file.|http://giuspen.com/cherrytree/|{{Pkg|cherrytree}}}}<br />
* {{App|[[Wikipedia:Gnote|Gnote]]|Experimental port of Tomboy to C++.|https://wiki.gnome.org/Apps/Gnote|{{Pkg|gnote}}}}<br />
* {{App|KeepNote|Cross-platform GTK+ note-taking application with rich text formatting.|http://keepnote.org|{{Pkg|keepnote}}}}<br />
* {{App|KNotes|A program that lets you write the computer equivalent of sticky notes.|https://www.kde.org/applications/utilities/knotes/|{{Pkg|knotes}}}}<br />
* {{App|Laverna|A JavaScript note taking application with Markdown editor and encryption support. Consider it like open source alternative to Evernote. |https://laverna.cc/|{{AUR|laverna}}}}<br />
* {{App|[[Wikipedia:org-mode|org-mode]]|[[Emacs]] mode for notes, project planning and authoring.|http://orgmode.org|{{AUR|emacs-org-mode}}}}<br />
* {{App|nixnote|Evernote's third Opensource application, formerly called Nevernote.|http://www.sourceforge.net/projects/nevernote|{{aur|nixnote2}}}}<br />
* {{app|[[Wikipedia:QOwnNotes|QOwnNotes]]|An open source notepad and todo list manager with markdown support and optional ownCloud integration built on qt5.|http://www.qownnotes.org/|{{aur|qownnotes}}}}<br />
* {{App|RedNotebook|Modern journal, which lets you format, tag and search your entries.|http://rednotebook.sourceforge.net/|{{aur|rednotebook}}}}<br />
* {{App|[[Wikipedia:Tomboy (software)|Tomboy]]|Desktop note-taking application for Linux and Unix with a wiki-like linking system to connect notes together.|https://wiki.gnome.org/Apps/Tomboy|{{Pkg|tomboy}}}}<br />
* {{App|wiznote|Opensource cross-platform cloud based note-taking client.|http://www.wiznote.com/|{{Pkg|wiznote}}}}<br />
* {{App|[[zim]]|WYSIWYG text editor that aims at bringing the concept of a wiki to the desktop.|http://zim-wiki.org/|{{Pkg|zim}}}}<br />
* {{app|znotes|A lightweight crossplatform application for notes managment with simple interface, use qt4 libraries.|http://znotes.sourceforge.net/|{{aur|znotes}}}}<br />
<br />
=== Mind-mapping tools ===<br />
<br />
* {{App|FreeMind|Premier free mind-mapping software written in Java.|http://freemind.sourceforge.net|{{Pkg|freemind}}}}<br />
* {{App|Freeplane|Free and open source software application that supports thinking, sharing information and getting things done at work, in school and at home. The software can be used for mind mapping and analyzing the information contained in mind maps.|http://freeplane.sourceforge.net|{{AUR|freeplane}}}}<br />
* {{App|Labyrinth|Lightweight mind-mapping tool with support for image import and drawing.|https://github.com/labyrinth-team/labyrinth|{{Pkg|labyrinth}}}}<br />
* {{App|Semantik|A mind-mapping application for KDE.|https://waf.io/semantik.html|{{AUR|semantik}}}}<br />
* {{App|TreeSheets|The ultimate replacement for spreadsheets, mind mappers, outliners, PIMs, text editors and small databases.|http://strlen.com/treesheets/|{{AUR|treesheets-git}}}}<br />
* {{App|View Your Mind|Tool to generate and manipulate maps which show your thoughts. Such maps can help you to improve your creativity and effectivity. You can use them for time management, to organize tasks, to get an overview over complex contexts, to sort your ideas etc.|http://www.insilmaril.de/vym/|{{Pkg|vym}}}}<br />
* {{App|Visual Understanding Environment|Open Source project focused on creating flexible tools for managing and integrating digital resources in support of teaching, learning and research.|http://vue.tufts.edu |{{AUR|vue}}}}<br />
* {{App|XMind|Brainstorming and mind mapping application. It provides a rich set of different visualization styles, and allows sharing of created mind maps via their website.|http://www.xmind.net|{{AUR|xmind}}}}<br />
<br />
=== Character Selector ===<br />
<br />
* {{app|GNOME Characters|Character map application for GNOME|https://wiki.gnome.org/Design/Apps/CharacterMap|{{Pkg|gnome-characters}}}}<br />
* {{app|gucharmap|A GTK+ 3 Character Selector, distributed with GNOME desktop.|https://wiki.gnome.org/Apps/Gucharmap|{{pkg|gucharmap}}}}<br />
* {{app|kdeutils-kcharselect|A tool to select special characters from all installed fonts and copy them into the clipboard. Distributed with KDE.|https://utils.kde.org/projects/kcharselect/|{{Pkg|kcharselect}}}}<br />
<br />
=== Stylus notes taking ===<br />
* {{app|Write|A word processor for hand writing.|http://www.styluslabs.com/|{{AUR|write_stylus}}}}<br />
* {{app|Gournal|Note-taking application written for usage on Tablet-PC, written in perl.|http://www.adebenham.com/old-stuff/gournal/|{{AUR|gournal}}}}<br />
* {{app|Xournal|An application for notetaking, sketching, keeping a journal using a stylus.|http://xournal.sourceforge.net/|{{Pkg|xournal}}}}<br />
* {{app|Xournal++|A C++ rewrite of Xournal.|https://github.com/xournalpp/xournalpp|{{AUR|xournalpp-git}}}}<br />
<br />
=== Bibliographic reference managers ===<br />
<br />
See also [[Wikipedia:Comparison of reference management software]].<br />
<br />
* {{App|Bibus|A bibliographic database that can directly insert references in OpenOffice.org/LibreOffice and generate the bibliographic index.|http://bibus-biblio.sourceforge.net|{{AUR|bibus}}}}<br />
* {{App|DocEar|Docear is an academic literature suite for searching, organizing and creating academic literature, built upon the mind mapping software Freeplane and the reference manager JabRef.|https://www.docear.org|{{AUR|docear}}}}<br />
* {{App|JabRef|GUI frontend for BibTeX, written in Java.|http://jabref.sourceforge.net|{{AUR|jabref}}}}<br />
* {{App|Zotero|Zotero Standalone. Is a free, easy-to-use tool to help you collect, organize, cite, and share your research sources.|http://www.zotero.org|{{AUR|zotero}}}}<br />
<br />
=== Barcode generators and readers ===<br />
<br />
==== Console ====<br />
<br />
* {{App|barcode|A tool to convert text strings to printed bars.|https://www.gnu.org/software/barcode/|{{Pkg|barcode}}}}<br />
* {{App|iec16022|Produce 2D barcodes often also referenced as DataMatrix.|https://datenfreihafen.org/projects/iec16022.html|{{Pkg|iec16022}}}}<br />
* {{App|qrencode|C library and command line tool for encoding data in a QR Code symbol.|https://fukuchi.org/works/qrencode/|{{Pkg|qrencode}}}}<br />
* {{App|ZBar|Application and library for reading bar codes from various sources.|http://zbar.sourceforge.net/|{{Pkg|zbar}}}}<br />
* {{App|Zint|Barcode encoding library and command line tool supporting over 50 symbologies.|http://zint.org.uk/|{{Pkg|zint}}}}<br />
<br />
==== Graphical ====<br />
<br />
* {{App|gLabels|Program for creating labels and business cards. It also supports creating barcodes.|http://glabels.org/|{{Pkg|glabels}}}}<br />
* {{App|Qreator|Create your own QR codes.|http://davidplanella.org/project-showcase/qreator/|{{AUR|qreator}}}}<br />
* {{App|QtQR|QR Code generator and decoder.|https://launchpad.net/qr-tools|{{AUR|qtqr}}}}<br />
* {{App|Zint Barcode Studio|Barcode generator GUI.|http://zint.org.uk/|{{Pkg|zint-qt}}}}</div>Delapouite