https://wiki.archlinux.org/api.php?action=feedcontributions&user=7h3w1zz&feedformat=atomArchWiki - User contributions [en]2024-03-29T07:36:46ZUser contributionsMediaWiki 1.41.0https://wiki.archlinux.org/index.php?title=Archiving_and_compression&diff=797781Archiving and compression2024-01-21T16:51:10Z<p>7h3w1zz: Added patool as a convenience tool</p>
<hr />
<div>[[Category:Data compression and archiving]]<br />
[[Category:Command-line]]<br />
[[es:Archiving and compression]]<br />
[[ja:アーカイブと圧縮]]<br />
[[pt:Archiving and compression]]<br />
[[ru:Archiving and compression]]<br />
[[zh-hans:Archiving and compression]]<br />
The traditional Unix archiving and compression tools are separated according to the [[Wikipedia:Unix philosophy|Unix philosophy]]:<br />
<br />
* A [[Wikipedia:File archiver|file archiver]] combines several files into one archive file, e.g. ''tar''.<br />
* A [[Wikipedia:Data compression|compression]] tool compresses and decompresses data, e.g. ''gzip''.<br />
<br />
These tools are often used in sequence by firstly creating an archive file and then compressing it.<br />
<br />
Of course there are also [[#Archiving and compression|tools that do both]], which tend to additionally offer encryption, error detection and recovery.<br />
<br />
== Archiving only ==<br />
<br />
{| class=wikitable<br />
! Name !! Package !! Manuals !! Description<br />
|-<br />
| GNU [[Wikipedia:tar (computing)|tar]] || {{Pkg|tar}} || {{man|1|tar}}, [https://www.gnu.org/software/tar/manual/html_chapter/index.html info] || [[Core utility]] for manipulating the ubiquitous tar archives (tarballs), which are used by [[pacman]] and the [[AUR]].<br />
|-<br />
| [https://libarchive.org/ libarchive] || {{Pkg|libarchive}} || {{man|1|bsdtar}}<br>{{man|1|bsdcpio}} || Implementation of ''tar'' and ''cpio'' that also offers a library. Used by [[pacman]] and [[mkinitcpio]].<br />
|-<br />
| [[Wikipedia:ar (Unix)|ar]] || {{Pkg|binutils}} || {{man|1|ar}}|| Legacy Unix archiver before ''tar''. Today only used for creating [[Wikipedia:Static library|static library]] files.<br />
|-<br />
| [[Wikipedia:cpio|cpio]] || {{Pkg|cpio}} || {{man|1|cpio}} || File archiver via stdin/stdout, supports cpio and tar formats.<br />
|-<br />
| [http://dar.linux.free.fr/ DAR] || {{AUR|dar}} || {{man|1|dar|url=http://dar.linux.free.fr/doc/man/dar.html}} || Archiver to backup large live filesystems, takes care of hard links, [[extended attributes]], sparse files and inode types.<br />
|}<br />
<br />
{{Tip|Both GNU and BSD tar automatically do decompression delegation for bzip2, compress, gzip, lzip, lzma, lzop, zstd, and xz compressed archives. Only BSD tar supports lz4 natively (but GNU tar can do an equivalent with {{ic|1=--use-compress-program=lz4}}/{{ic|-Ilz4}}). When creating archives both support the {{ic|-a}} switch to automatically filter the created archive through the right compression program based on the file extension. While BSD tar recognizes compression formats based on the format, GNU tar only guesses based on the file extension.}}<br />
<br />
See also [[#Archiving only usage]].<br />
<br />
== Compression tools ==<br />
<br />
=== Compression only ===<br />
<br />
These compression programs implement their own file format.<br />
<br />
{| class=wikitable<br />
! Name !! Package !! Manual !! Ext !! Tar ext !! Description !! Parallel implementations<br />
|-<br />
| [[Wikipedia:bzip2|bzip2]] || {{Pkg|bzip2}} || {{man|1|bzip2}} || .bz2, .bz || .tbz2, .tbz|| Uses the [[Wikipedia:Burrows–Wheeler transform|Burrows–Wheeler algorithm]].|| {{Pkg|lbzip2}}, {{Pkg|pbzip2}}<br />
|-<br />
| bzip3 || {{Pkg|bzip3}} || {{man|1|bzip3}} || .bz3 || .tbz3 || Uses the [[Wikipedia:Burrows–Wheeler transform|Burrows–Wheeler algorithm]].|| <br />
|-<br />
| [[Wikipedia:gzip|gzip]] || {{Pkg|gzip}} || {{man|1|gzip}} || .gz, .z|| .tgz, .taz|| GNU zip, based on [[Wikipedia:DEFLATE|DEFLATE]] algorithm.|| {{Pkg|pigz}}, {{man|1|bgzip|url=https://manpages.debian.org/latest/tabix/bgzip.1.en.html}} (part of {{aur|htslib}}), {{aur|crabz}}, {{aur|python-rapidgzip}}<br />
|-<br />
| [[lrzip]] || {{Pkg|lrzip}} || {{man|1|lrzip}} || .lrz || || Improved version of [[Wikipedia:rzip|rzip]], uses multiple algorithms. || is multithreaded<br />
|-<br />
| [[Wikipedia:LZ4 (compression algorithm)|LZ4]] || {{Pkg|lz4}} || {{man|1|lz4}} || .lz4 || || Written in C, focused on compression and decompression speed. || Can be multithreaded, though the {{Pkg|lz4}} is not. See https://lz4.github.io/lz4/ for alternatives.<br />
|-<br />
| [[Wikipedia:lzip|lzip]] || {{Pkg|lzip}} || {{man|1|lzip}} || .lz || || Uses [[Wikipedia:LZMA|LZMA]]. || {{AUR|plzip}}<br />
|-<br />
| [[Wikipedia:lzop|lzop]] || {{Pkg|lzop}} || {{man|1|lzop}} || .lzo || .tzo || Uses the [[Wikipedia:Lempel–Ziv–Oberhumer|LZO]] library ({{Pkg|lzo}}).||<br />
|-<br />
| [[Wikipedia:XZ Utils|xz]] || {{Pkg|xz}} || {{man|1|xz}} || .xz, .lzma || .txz, .tlz|| Uses [[Wikipedia:LZMA|LZMA]], default for GNU {{Pkg|coreutils}} and kernel archive files.|| is multithreaded, {{Pkg|pixz}}, {{AUR|pxz-git}}<br />
|-<br />
| [[Wikipedia:zstd|zstd]] || {{Pkg|zstd}} || {{man|1|zstd}} || .zst || || Uses [[Wikipedia:Zstandard|Zstandard]] algorithm. || is multithreaded<br />
|-<br />
|}<br />
<br />
* Parallel implementations offer improved speeds by using multiple CPU cores.<br />
* Tar extensions refers to compressed archives where {{ic|tar}} and the compression tool is used, e.g. {{ic|.tzo}} is {{ic|.tar.lzo}}.<br />
* See also [[#Compression only usage]].<br />
<br />
=== Archiving and compression ===<br />
<br />
{| class=wikitable<br />
! Name !! Packages !! Manuals !! Ext !! Description<br />
|-<br />
| [[p7zip]] || {{Pkg|p7zip}} || {{man|1|7z}} ||rowspan=2| .7z || The third-party POSIX port of [[Wikipedia:7-Zip|7-zip's]] command-line.<br />
|-<br />
| [https://www.7-zip.org/ 7-Zip] || {{AUR|7-zip}}, {{AUR|7-zip-full}} || - || The upstream Linux version of a file archiver with a high compression ratio.<br />
|-<br />
| [[Wikipedia:RAR (file format)|RAR]] || {{AUR|rar}}, {{Pkg|unrar}} || {{man|1|rar|url=https://manned.org/rar.1}}{{Dead link|2023|08|09}} || .rar || Both the format and the [[rar]] utility are proprietary.<br />
|-<br />
|[https://github.com/martinellimarco/t2sz t2sz]||{{aur|t2sz}}|| || .tar.zst .tzst || Tar archiving utility in C with member-aligned zstd-compression<br />
|-<br />
|[https://lzip.nongnu.org/tarlz.html tarlz]|| {{aur|tarlz}} || {{man|1|tarlz|url=https://manpages.debian.org/latest/tarlz/tarlz.1.en.html}} || .tar.lz .tlz || Tar archiving utility in C++ with member-aligned lzip compression<br />
|-<br />
| [[Wikipedia:Zip (file format)|ZIP]] || {{Pkg|zip}}, {{Pkg|unzip}} || {{man|1|zip}}, {{man|1|unzip}} || .zip || Widely used outside of the Linux world.<br />
|-<br />
| [https://theunarchiver.com/ Unarchiver] || {{Pkg|unarchiver}} || {{man|1|unar}}, {{man|1|lsar}} || ''many'' || Command-line tool of a Mac application, supports over 40 archive formats.<br />
|-<br />
| [[Wikipedia:ZPAQ|ZPAQ]] || {{AUR|zpaq}} || {{man|1|zpaq|url=https://mattmahoney.net/dc/zpaqdoc.html}} || .zpaq || A high compression ratio archiver written in C++, uses several algorithms.<br />
|-<br />
| [[Wikipedia:LHA (file format)|LHa]] || {{Pkg|lhasa}}, {{AUR|lha}} || {{man|1|lha}} || .lzh (on Amiga: .lha) || LZH/LHA archiver, supports the lh7-method.<br />
|-<br />
| [[W:WinAce|WinAce]] || {{Pkg|unace}} || {{man|1|unace|url=https://manned.org/unace.1}}{{Dead link|2023|08|09}} || .ace || Both the [[W:ACE (compressed file format)|ACE]] file format and the archiving tool are proprietary.<br />
|}<br />
<br />
See also [[#Archiving and compression usage]].<br />
<br />
=== Feature charts ===<br />
<br />
Some of the tools above are capable of handling multiple formats, allowing for fewer installed packages.<br />
<br />
==== Decompress ====<br />
<br />
{| class="wikitable sortable"<br />
! Name !! gzip !! bzip2 !! ZIP !! LHa/LZH !! RAR !! compress !! CAB !! ARJ<br />
|-<br />
| {{Pkg|gzip}} || {{Yes}} || {{No}} || {{Y|Partial<sup>1</sup>}} || {{No}} || {{No}} ||{{Yes}} || {{No}} || {{No}}<br />
|-<br />
| {{Pkg|p7zip}} || {{Yes}} || {{Yes}} || {{Yes}} || {{Yes}} || {{Yes}} || {{No}} || {{Yes}} || {{Yes}}<br />
|-<br />
| {{Pkg|unarchiver}} || {{Yes}} || {{Yes}} || {{Yes}} || {{Yes}} || {{Yes}} ||{{Yes}} || {{Yes}} || {{Y|Partial}}<br />
|}<br />
<br />
# {{Pkg|gzip}}'s ''gunzip'' can only decompress single member ZIP files.<br />
<br />
== Usage comparison ==<br />
<br />
=== Archiving only usage ===<br />
<br />
{| class=wikitable<br />
! Name !! Create archive !! Extract archive !! List content<br />
|-<br />
| {{man|1|tar}} || {{ic|tar cfv archive.tar file1 file2}} || {{ic|tar xfv archive.tar}} || {{ic|tar -tvf archive.tar}}<br />
|-<br />
| {{man|1|cpio}} || {{ic|ls file1 file2 <nowiki>|</nowiki> cpio -o > archive.cpio}} || {{ic|cpio -i -vd < archive.cpio}} || {{ic|cpio -t < archive.cpio}}<br />
|}<br />
<br />
=== Compression only usage ===<br />
<br />
{| class=wikitable<br />
! Name !! Compress !! Decompress !! Decompress to stdout<br />
|-<br />
| {{man|1|bzip2}} || {{ic|bzip2 file}} || {{ic|bzip2 -d file.bz2}} || {{ic|bzcat file.bz2}}<br />
|-<br />
| {{man|1|gzip}} || {{ic|gzip file}} || {{ic|gzip -d file.gz}} || {{ic|zcat file.gz}}<br />
|-<br />
| {{man|1|lrzip}} || {{ic|lrzip file}}<br>{{ic|lrztar folder}} || {{ic|lrzip -d file.lrz}}<br>{{ic|lrztar -d folder.tar.lrz}} || {{ic|lrzcat file.lrz}}<br />
|-<br />
| {{man|1|xz}} || {{ic|xz file}} || {{ic|xz -d file.xz}} || {{ic|xzcat file.xz}}<br />
|}<br />
<br />
=== Archiving and compression usage ===<br />
<br />
{| class=wikitable<br />
! Name !! Compress !! Decompress !! Decompress to stdout !! List content<br />
|-<br />
| {{man|1|7z}} || {{ic|7z a archive.7z file1 file2}} || {{ic|7z x archive.7z}} || {{ic|7z e -so archive.7z file1}} || {{ic|7z l archive.7z}}<br />
|-<br />
| {{man|1|rar|url=https://manned.org/rar.1}}{{Dead link|2023|08|09}} || {{ic|rar a archive.rar file1 file2}} || {{ic|rar x archive.rar}} || {{ic|rar p -inul archive.rar file1}} || {{ic|rar l archive.rar}}<br />
|-<br />
| {{man|1|zip}}, {{man|1|unzip}} || {{ic|zip archive.zip file1 file2}} || {{ic|unzip archive.zip}} || {{ic|unzip -p archive.zip file1}} || {{ic|unzip -l archive.zip}}<br />
|-<br />
| {{man|1|lha}} || {{ic|lha ao7 archive.lzh file1 file2}} || {{ic|lha x archive.lzh}} || || minimal: {{ic|lha l archive.lzh}} verbose: {{ic|lha v archive.lzh}}<br />
|-<br />
|}<br />
<br />
== Convenience tools ==<br />
<br />
* {{App|atool|Script for managing file archives of various types.|https://www.nongnu.org/atool/|{{Pkg|atool}}}}<br />
* {{App|dtrx|An intelligent archive extraction tool.|https://github.com/brettcs/dtrx|{{AUR|dtrx}}}}<br />
* {{App|J7Z|GUI for Linux in java which attempts to simplify data compression and backup. It can create 7z, BZip2, Zip, GZip, Tar archives.|http://j7z.xavion.name/|{{AUR|j7z}}}}<br />
* {{App|unp|Command line tool that can unpack archives easily.|https://github.com/mitsuhiko/unp|{{AUR|python-unp}}}}<br />
* {{App|unpack|Wrapper script for handling multiple archive formats.|https://github.com/githaff/unpack|{{AUR|unpack-git}}}}<br />
* {{App|patool|Allows various archive types to be created, extracted, tested, listed, compared, searched and repacked.|https://wummel.github.io/patool/|{{AUR|patool}}}}<br />
* [[Bash/Functions#Extract]]<br />
<br />
== Determining archive format ==<br />
<br />
To extract an archive, its file format needs to be determined. If the file is properly named you can deduce its format from the file extension.<br />
<br />
Otherwise you can use the {{Pkg|file}} tool, see {{man|1|file}}.<br />
<br />
== Esoteric, rare or deprecated tools ==<br />
<br />
{| class=wikitable<br />
! Name !! Packages !! Ext !! Description<br />
|-<br />
| [[Wikipedia:ARC (file format)|ARC]] || {{AUR|arc}} || .arc, .ark|| Was very popular during the early days of the dial-up BBS. Superseded by ZIP.<br />
|-<br />
| [[Wikipedia:ARJ|ARJ]] || {{Pkg|arj}} || .arj|| An archiver used on DOS/Windows in mid-1990s. This is an open source clone.<br />
|-<br />
| [[Wikipedia:compress|compress]] || {{Pkg|ncompress}} || .Z || The de facto standard UNIX compression utility to success the Huffman-based {{man|1|pack|url=https://illumos.org/man/1/pack}} before gzip become a thing.<br />
|-<br />
| [[Wikipedia:Parchive|PAR2]] || {{Pkg|par2cmdline}} || .par2|| Parity archiver for increased data integrity. See also [[Parchive]].<br />
|-<br />
| [[Wikipedia:shar|shar]] || {{Pkg|sharutils}} || .shar || Creates self-extracting archives that are valid shell scripts.<br />
|-<br />
| [[Wikipedia:Zoo_(file_format)|Zoo]] || {{AUR|zoo}} || .zoo || Was mostly popular on the [[Wikipedia:OpenVMS|OpenVMS]] operating system before PKZIP became popular.<br />
|}<br />
<br />
== File system compression ==<br />
<br />
Some [[file systems]] support on-the-fly compression of file data:<br />
<br />
* [[Btrfs#Compression|Btrfs]] can be configured to compress individual files, directories, or entire volumes by default.<br />
* On [[ZFS#Tuning|ZFS]], compression can be enabled on pools or file systems.<br />
<br />
== Device mapper compression ==<br />
<br />
There is work being done to mainline (integrate into the Linux kernel project) the open-sourced VDO project, which provides a deduplication and compression device mapper layer in the interest of increasing storage efficiency. The following packages are available:<br />
<br />
* {{App|vdo|Userspace tools for managing VDO volumes|https://github.com/dm-vdo/vdo|{{AUR|vdo}}}}<br />
* {{App|kvdo|A pair of kernel modules which provide pools of deduplicated and/or compressed block storage|https://github.com/dm-vdo/kvdo|{{AUR|kvdo-dkms}}}}<br />
<br />
== Compression libraries ==<br />
<br />
* {{App|[[Wikipedia:Brotli|Brotli]]|Compression algorithm for data streams using the LZ77 algorithm, Huffman coding and 2nd order context modeling.|https://github.com/google/brotli|{{Pkg|brotli}}}}<br />
* {{App|[[Wikipedia:libzip|libzip]]|Provides creation and extraction of ZIP files. Used by KDE and Deepin in place of the zip/unzip tools.|https://libzip.org|{{Pkg|libzip}}}}<br />
* {{App|[[Wikipedia:zlib|zlib]]|Compression library implementing the deflate compression method found in gzip and PKZIP.|https://www.zlib.net/|{{Pkg|zlib}}}}<br />
* {{App|[[Wikipedia:Zopfli|Zopfli]]|High compress ratio file compressor from Google, using a deflate-compatible algorithm called zopfli.|https://github.com/google/zopfli|{{AUR|zopfli-git}}}}<br />
<br />
== Troubleshooting ==<br />
<br />
=== Garbled Japanese Filenames ===<br />
<br />
Japanese versions of Windows encode ZIP archives with Shift-JIS. By default, these archives will suffer from [[Wikipedia:mojibake|mojibake]] filenames when extracted.<br />
To extract properly, use ''unzip'' in the command-line using the shift-jis option.<br />
<br />
$ unzip -O shift-jis nihongo.zip<br />
<br />
== See also ==<br />
<br />
* [[List of applications/Utilities#Archive managers]]<br />
* [[List of applications/Multimedia#Image compression]]<br />
* [[Wikipedia:Comparison of file archivers]]<br />
* [[Wikipedia:List of archive formats]]<br />
* [[Wikipedia:Comparison of archive formats]]</div>7h3w1zzhttps://wiki.archlinux.org/index.php?title=Dzen&diff=597132Dzen2020-02-10T01:57:52Z<p>7h3w1zz: fixed typo</p>
<hr />
<div>[[Category:Notification]]<br />
[[Category:Graphical user interfaces]]<br />
[[ja:Dzen]]<br />
[[pt:Dzen]]<br />
[http://robm.github.com/dzen/ Dzen] is "a general purpose messaging, notification and menuing program for X11. It was designed to be scriptable in any language and integrate well with window managers like [[dwm]], [[wmii]] and [[xmonad]] though it will work with any window manager."<br />
<br />
== Installation ==<br />
<br />
[[Install]] the {{Pkg|dzen2}} package, which includes Xft, XPM, and Xinerama support.<br />
<br />
== Usage ==<br />
Dzen receives string from a pipe and output it graphicaly, this fact makes dzen scriptable in any language.<br />
Example:<br />
$ echo "Hello World" | dzen2 -p<br />
<br />
=== Options ===<br />
Dzen have a lot of options, follow below some of them:<br />
* {{ic|-fg}} Foreground color.<br />
* {{ic|-bg}} Background color.<br />
* {{ic|-fn}} Font.<br />
* {{ic|-ta}} Align the title window content, '''l'''(eft), '''c'''(enter), '''r'''(ight).<br />
* {{ic|-tw}} Width of the title window.<br />
* {{ic|-sa}} Align the slave window content. See {{ic|-ta}}.<br />
* {{ic|-l}} Number of lines in the slave window.<br />
* {{ic|-e}} Events and action.<br />
* {{ic|-m}} Menu mode.<br />
* {{ic|-u}} Update contents of title and slave window simultaneously.<br />
* {{ic|-p}} Persist EOF (optional timeout in seconds).<br />
* {{ic|-x}} X position .<br />
* {{ic|-y}} Y position .<br />
* {{ic|-h}} Height of the line (default: fontheight + 2 pixels).<br />
* {{ic|-w}} Width of the window.<br />
* {{ic|-v}} Version.<br />
<br />
{{Warning|The ''-u'' option is deprecated.}}<br />
<br />
== Making a pop-up with dzen ==<br />
The follow code will open a dzen window in the top right corner of the screen. It will be 100px width, 15px height with a black foreground and white background (right button click to close dzen).<br />
$ seq 1 3 | dzen2 -p -w '100' -h '15' -fg '#000000' -bg '#FFFFFF'<br />
Note that the window is with the number 3 in the middle, try to run the same code with {{ic|-l}} option.<br />
$ seq 1 3 | dzen2 -p -w '100' -h '15' -fg '#000000' -bg '#FFFFFF' -l '2'<br />
Now when you hover the mouse through the dzen it will uncollapse the slave window. If you click on the lines in the slave window nothing will happen, try to use the {{ic|-m}} option.<br />
$ seq 1 3 | dzen2 -p -w '100' -h '15' -fg '#000000' -bg '#FFFFFF' -l '2' -m<br />
Now if you click on the lines it will print the numbers in your terminal. This feature is useful to make menus.<br />
<br />
But if you want to center the numbers and align the title to the left, you will need the options: {{ic|-sa}} and {{ic|-ta}}.<br />
$ seq 1 3 | dzen2 -p -w '100' -h '15' -fg '#000000' -bg '#FFFFFF' -l '2' -m -ta 'l' -sa 'c'<br />
That's how dzen works.<br />
<br />
== Configuration ==<br />
<br />
Dzen is able to read font and color settings from [[X resources]]. As an example, you can add following lines to {{ic|~/.Xresources}}:<br />
dzen2.font: -*-fixed-*-*-*-*-*-*-*-*-*-*-*-*<br />
dzen2.foreground: #22EE11<br />
dzen2.background: black<br />
<br />
== Tips and tricks ==<br />
<br />
=== Using custom fonts with dzen ===<br />
<br />
Dzen follows the [[X Logical Font Description]] so it will only find fonts in the X font path. See [[Fonts#Older applications]] for details.<br />
<br />
=== Dzen and Conky ===<br />
<br />
[[Conky]] can be used to pipe information directly to dzen for output in a status bar. <br />
This can be done with Conky in the official repositories and also with {{AUR|conky-cli}}, a stripped-down version of the Conky status utility.<br />
<br />
The following example displays the average load values in red and the current time in the default dzen foreground colour:<br />
<br />
{{hc|~/.conkyrc|<nowiki><br />
conky.config = {<br />
background = false<br />
, out_to_console = true<br />
, out_to_x = false<br />
, update_interval = 1.0<br />
, total_run_times = 0<br />
, use_spacer = none<br />
}<br />
<br />
conky.text = [[^fg(\#ff0000)${loadavg 1 2 3} ^fg()${time %a %b %d %I:%M%P}]]<br />
</nowiki>}}<br />
<br />
{{hc|~/bin/dzconky|<nowiki><br />
#!/bin/sh<br />
<br />
FG='#aaaaaa'<br />
BG='#1a1a1a'<br />
FONT='-*-terminus-*-r-normal-*-*-120-*-*-*-*-iso8859-*'<br />
conky | dzen2 -e - -h '16' -w '600' -ta r -fg $FG -bg $BG -fn $FONT &<br />
</nowiki>}}<br />
Simply execute {{ic|dzconky}} in your startup scripts.<br />
<br />
=== Clickable areas and popups ===<br />
<br />
dzen2 allows you to define clickable areas using {{ic|^ca(''button'', ''command'')Text^ca()}}.<br />
You can use this property to create popups giving arbitrary information, as seen in various screenshot gifs like [http://i.imgur.com/bZegioR.gif this].<br />
<br />
A simple example can be:<br />
{{hc|sysinfo_popup.sh|<nowiki><br />
#/bin/bash<br />
<br />
#A simple popup showing system information<br />
<br />
HOST=$(uname -n)<br />
KERNEL=$(uname -r)<br />
UPTIME=$( uptime | sed 's/.* up //' | sed 's/[0-9]* us.*//' | sed 's/ day, /d /'\<br />
| sed 's/ days, /d /' | sed 's/:/h /' | sed 's/ min//'\<br />
| sed 's/,/m/' | sed 's/ / /')<br />
PACKAGES=$(pacman -Q | wc -l)<br />
UPDATED=$(awk '/upgraded/ {line=$0;} END { $0=line; gsub(/[\[\]]/,"",$0); \<br />
printf "%s %s",$1,$2;}' /var/log/pacman.log)<br />
<br />
(<br />
echo "System Information" # Fist line goes to title<br />
# The following lines go to slave window<br />
echo "Host: $HOST "<br />
echo "Kernel: $KERNEL"<br />
echo "Uptime: $UPTIME "<br />
echo "Pacman: $PACKAGES packages"<br />
echo "Last updated on: $UPDATED"<br />
) | dzen2 -p -x "500" -y "30" -w "220" -l "5" -sa 'l' -ta 'c'\<br />
-title-name 'popup_sysinfo' -e 'onstart=uncollapse;button1=exit;button3=exit'<br />
<br />
# "onstart=uncollapse" ensures that slave window is visible from start.<br />
</nowiki>}}<br />
Save this script and make it executable and then use the {{ic|^ca()}} attribute in your conkyrc (or the script that you pipe to dzen2) to trigger it.<br />
{{ic|^ca(1,''<path to your script>'')Sysinfo^ca()}}<br />
<br />
This will bind the script to mouse button 1 and execute it when it is clicked over the text.<br />
<br />
=== Gadgets ===<br />
<br />
There are some gadgets on dzen that may be used to make a good customize. Follow below some of they with a brief explanation and examples.<br />
<br />
==== dbar ====<br />
<br />
Dbar receive a pipe from another command with any number and outputs a semi-graphical progress bar with it, by default the max number of ''100%'' is {{ic|100}}. The maximum and minimum values can be changed with {{ic|-max}}/{{ic|-min}} respectively.<br />
<br />
Output example:<br />
50% [============= ]<br />
<br />
Code example:<br />
{{hc|~/test|<nowiki><br />
#!/bin/sh<br />
<br />
(<br />
amixer get Master | \<br />
awk '/Left:/{gsub(/[[:punct:]]/,"",$5);left=$5}<br />
/Right:/{gsub(/[[:punct:]]/,"",$5);right=$5}<br />
END {print left ORS right}'<br />
) | dbar -max 100 -min 0 -s '|' -l 'Vol'<br />
</nowiki>}}<br />
<br />
See [https://github.com/robm/dzen/blob/master/gadgets/README.dbar README.dbar] for details.<br />
<br />
==== gdbar ====<br />
<br />
Gdbar as well as [[#dbar|dbar]] outputs a progress bar based on a value of ''100%'', but here it is full-graphical. Gdbar have the same options of dbar with some additional options. Some of the options are:<br />
* {{ic|-fg}} set the foreground.<br />
* {{ic|-bg}} set the background.<br />
* {{ic|-w}}/{{ic|-h}} set the width and height respectively.<br />
<br />
Code example:<br />
{{hc|~/test|<nowiki><br />
#!/bin/sh<br />
<br />
(<br />
amixer get Master | \<br />
awk '/Left:/{gsub(/[[:punct:]]/,"",$5);left=$5}<br />
/Right:/{gsub(/[[:punct:]]/,"",$5);right=$5}<br />
END{print left ORS right}'<br />
) | gdbar -max 100 -min 0 -l 'Vol ' -bg '#777777' -fg '#00ff00' -ss '2' | dzen2 -p -l '1' -w '150' -y '100' -x '100' -ta c -sa c -e 'onstartup=uncollapse;button3=exit'<br />
</nowiki>}}<br />
<br />
See [https://github.com/robm/dzen/blob/master/gadgets/README.gdbar README.gdbar] for details.<br />
<br />
{{Note|1=Gdbar will only be useful in combination with dzen >= 0.7.0.|2==}}<br />
<br />
==== Others ====<br />
<br />
Information about others gadgets can be found [https://github.com/robm/dzen/tree/master/gadgets here].<br />
<br />
== See also ==<br />
<br />
* [http://robm.github.com/dzen/ Official website], [https://github.com/robm/dzen/wiki/_pages wiki], and [https://github.com/robm/dzen source]<br />
<br />
'''Forum threads'''<br />
* 2007-12-04 - Arch Linux - [https://bbs.archlinux.org/viewtopic.php?id=40637 dzen & xmobar Hacking Thread]</div>7h3w1zzhttps://wiki.archlinux.org/index.php?title=Vifm&diff=590724Vifm2019-12-01T19:43:30Z<p>7h3w1zz: Format and fix typo of directory</p>
<hr />
<div>[[Category:File managers]]<br />
[[Category:Console applications]]<br />
[[ar:Vifm]]<br />
[[ja:Vifm]]<br />
{{Related articles start}}<br />
{{Related|nnn}}<br />
{{Related|ranger}}<br />
{{Related articles end}}<br />
From the [http://vifm.info/ Vifm] home page:<br />
:Vifm is an ncurses based file manager with vi like keybindings/modes/options/commands/configuration, which also borrows some useful ideas from [[mutt]].<br />
If you use [[vi]], Vifm gives you complete keyboard control over your files without having to learn a new set of commands.<br />
<br />
== Installation ==<br />
<br />
[[Install]] the {{Pkg|vifm}} package.<br />
<br />
== Help file ==<br />
<br />
Basic information about vifm is given in the help file. You can view it by opening vifm and typing<br />
<br />
:h<br />
<br />
Another good source of information is the man page.<br />
<br />
== Customizing Vifm ==<br />
<br />
Vifm creates and populates a .vifm folder in your home directory containing the following:<br />
* vifmrc - a well commented configuration file that can be edited to suit your working style.<br />
* vifm-help.txt - the help text<br />
* vifminfo - bookmarks and trash contents - it is not recommended to edit this file by hand<br />
* Trash/ directory - self explanatory<br />
* colors/ directory - color schemes<br />
** Default - well commented default color scheme - can be copied to create user-created color schemes<br />
<br />
To get started, read the information avaliable in:<br />
* {{ic|/usr/share/vifm/vifm.txt}}<br />
* {{ic|/usr/share/vifm/vifm-help.txt}}<br />
<br />
=== Color schemes ===<br />
<br />
The {{ic|~/.vifm/colors}} directory contains the color schemes. The format is outlined in the file and follows vi/vim syntax highlight format. It is basically:<br />
highlight ''group'' cterm=''attribute'' ctermfg=''color'' ctermbg=''color''<br />
<br />
An example colorscheme looks like:<br />
highlight Win cterm=none ctermfg=white ctermbg=black<br />
highlight Directory cterm=bold ctermfg=cyan ctermbg=none<br />
highlight Link cterm=bold ctermfg=yellow ctermbg=none<br />
highlight BrokenLink cterm=bold ctermfg=red ctermbg=none<br />
highlight Socket cterm=bold ctermfg=magenta ctermbg=none<br />
highlight Device cterm=bold ctermfg=red ctermbg=none<br />
highlight Fifo cterm=bold ctermfg=cyan ctermbg=none<br />
highlight Executable cterm=bold ctermfg=green ctermbg=none<br />
highlight Selected cterm=bold ctermfg=magenta ctermbg=none<br />
highlight CurrLine cterm=bold ctermfg=none ctermbg=blue<br />
highlight TopLine cterm=none ctermfg=black ctermbg=white<br />
highlight TopLineSel cterm=bold ctermfg=black ctermbg=none<br />
highlight StatusLine cterm=bold ctermfg=black ctermbg=white<br />
highlight WildMenu cterm=underline,reverse ctermfg=white ctermbg=black<br />
highlight CmdLine cterm=none ctermfg=white ctermbg=black<br />
highlight ErrorMsg cterm=none ctermfg=red ctermbg=black<br />
highlight Border cterm=none ctermfg=black ctermbg=white<br />
<br />
You can also highlight different filetypes using regular expressions:<br />
highlight /^.*\.(mp3|ogg|oga|flac|m4a)$/ ctermfg=magenta<br />
highlight /^.*\.(jpg|jpeg|png|gif|tiff|webp|bmp|svg|svgz)$/ ctermfg=yellow<br />
highlight /^.*\.(zip|gz|bz2|xz|tar|tgz|tbz2|7z|rar|iso|rpm|deb)$/ ctermfg=red<br />
<br />
=== Key mapping ===<br />
<br />
As of 0.6.2 you can customize key bindings in Vifm. These can be set from the command mode using the map command, like so:<br />
:map ] :s<br />
<br />
However, these mappings will not be saved between sessions. To map a key permanently, place them in {{ic|~/.vifm/vifmrc}}. More sample mappings can be seen at the end of that file.<br />
<br />
=== Opening filetypes in vifm ===<br />
<br />
You can assign applications to filetypes in vifmrc, eg.<br />
filetype *.jpg,*.jpeg,*.png,*.gif feh %f 2>/dev/null &<br />
filetype *.md5 md5sum -c %f<br />
Several defaults can be found in vifmrc. These can be edited or added to following the same format.<br />
<br />
==== Browse images in current directory with Feh ====<br />
<br />
filextype *.jpg,*.jpeg,*.png,*.gif<br />
\ {View in feh}<br />
\ feh -FZ %d --start-at %d/%c 2>/dev/null<br />
It will display your selected image in feh, but it will enable you to browse all other images in the directory as well, in their default order.<br />
<br />
=== User commands ===<br />
<br />
You can also create custom commands in vifmrc, eg.<br />
command df df -h %m 2> /dev/null<br />
command diff vim -d %f %F<br />
<br />
==== Creating symbolic links ====<br />
<br />
command link ln -s %d/%f %D<br />
When you call <br />
:link<br />
a link of the selected file is made in the other directory (if you are in split view). It even works with multiple files selected with visual (v) or tag (t).<br />
<br />
==== Torrent creation ====<br />
<br />
make a .torrent of the current file in the other tab's dir<br />
command mkt mktorrent -p -a [your announce url here] -o %D/%f.torrent %d/%f<br />
<br />
=== Marks ===<br />
<br />
Marks can be set same as in vi.<br />
To set a mark for current file:<br />
m[a-z][A-Z][0-9]<br />
Go to a file set for mark:<br />
'[a-z][A-Z][0-9]<br />
Vifm will remember the marks between the sessions.<br />
<br />
=== Previews ===<br />
Provided {{Pkg|poppler}} is installed,<br />
putting<br />
fileviewer *.pdf<br />
\ pdftotext %c -<br />
into vifmrc enables pdf-previewing using pdftotext.<br />
The {{ic|%c}} is a vifm macro for the current file under the cursor.<br />
The preview is activated with<br />
:view<br />
Neat image previewing can be achieved using img2txt from {{Pkg|libcaca}}<br />
fileviewer *.png,*.jpeg,*.jpg<br />
\ img2txt %c <br />
Previewing the contents of tar-archives:<br />
fileviewer *.tar,*.tar.gz<br />
\ tar -tvf %c<br />
For previewing html documents suitable programs are<br />
text based browsers including {{Pkg|lynx}}, {{Pkg|links}} or {{Pkg|w3m}}<br />
fileviewer *.html<br />
\ w3m %c<br />
For printing text instead of previewing the file (for binary files for example):<br />
fileviewer *.exe<br />
\ echo Binary file: no preview available. %i<br />
{{ic|%i}} is there because {{ic|%c}} is implicitly used if no other macro is used. In this case, {{ic|%i}} is ignored.<br />
<br />
For handling filetypes not handled by anything else, put {{ic|fileviewer * <your command>}} as the last fileviewer option in your config file.<br />
<br />
Further useful programs for previews include<br />
* {{Pkg|tree}} for directory previews<br />
* {{Pkg|mp3info}} for viewing information about mp3 files<br />
* {{Pkg|libmediainfo}} for the mediainfo program (audio and video information)<br />
<br />
== Tips and tricks ==<br />
<br />
=== Useful key mappings ===<br />
<br />
Single stroke to access command line<br />
nmap ; :<br />
<br />
=== Non-vim Users ===<br />
{{ic|vifm}} assumes that you are using {{ic|vim}} and will throw errors if it doesn't find it. If you are using {{ic|vi}} or {{ic|nvim}} ([[Neovim]]), you need to edit your {{ic|~/.vifm/vifmrc}} file. Comment out the line {{ic|<nowiki>set vicmd=vim</nowiki>}} and replace it with {{ic|<nowiki>set vicmd=vi</nowiki>}} or {{ic|<nowiki>set vicmd=nvim</nowiki>}}. Note that, just like {{ic|.exrc}}, comment lines are introduced by double quotes.<br />
<br />
=== Total size of selected files ===<br />
<br />
To get the total size of selected files change %s to %E in {{ic|~/.vifm/vifmrc}}, like so:<br />
set statusline=" %t%= %A %10u:%-7g %15E %20d "<br />
<br />
=== Use output of external program in status line ===<br />
<br />
Here's a status line that calls [[File_permissions_and_attributes#chattr_and_lsattr|lsattr]], passing it the name of the file currently under the cursor:<br />
set statusline="%{system('lsattr -l ' . expand('%c'))}"<br />
<br />
For more, see [https://vifm.info/manual.shtml#Expression%20syntax expression syntax] and available [https://vifm.info/manual.shtml#Functions functions].</div>7h3w1zzhttps://wiki.archlinux.org/index.php?title=Music_Player_Daemon&diff=579768Music Player Daemon2019-08-13T20:23:16Z<p>7h3w1zz: Changing unwieldy (and incorrect) sentence</p>
<hr />
<div>[[Category:Music]]<br />
[[Category:Daemons]]<br />
[[de:Music Player Daemon]]<br />
[[es:Music Player Daemon]]<br />
[[fr:MPD]]<br />
[[it:Music Player Daemon]]<br />
[[ja:Music Player Daemon]]<br />
[[nl:Music Player Daemon]]<br />
[[pl:Music Player Daemon]]<br />
[[ru:Music Player Daemon]]<br />
[[sr:Music Player Daemon]]<br />
[[zh-hans:Music Player Daemon]]<br />
{{Related articles start}}<br />
{{Related|MPD/Tips and Tricks}}<br />
{{Related|MPD/Troubleshooting}}<br />
{{Related articles end}}<br />
<br />
'''[http://www.musicpd.org/ MPD]''' (music player daemon) is an audio player that has a server-client architecture. It plays audio files, organizes playlists and maintains a music database, all while using very few resources. In order to interface with it, a separate [[#Clients|client]] is needed.<br />
<br />
== Installation ==<br />
<br />
[[Install]] the {{Pkg|mpd}} package, or {{AUR|mpd-git}} for the development version.<br />
<br />
== Configuration ==<br />
<br />
{{Expansion|Is there any reason for [[#System-wide configuration]]?}}<br />
<br />
MPD is able to run in [[#Per-user configuration]] or [[#System-wide configuration]] mode (settings apply to all users). Also it is possible to run multiple instances of MPD in a [[#Multi-MPD setup]].<br />
The way of setting up MPD depends on the way it is intended to be used: a local per-user configuration is easier to setup and may prove more adapted on a desktop system.<br />
<br />
In order for MPD to be able to playback audio, [[ALSA]], optionally with [[PulseAudio]], must be setup and working. The [[#Audio configuration]] section thereafter describes the parameters needed for ''ALSA'' or ''PulseAudio''.<br />
<br />
MPD is configured in the file {{man|5|mpd.conf}} which can be located in various paths depending on the setup chosen (system-wide or per-user). In short, the two common locations used are:<br />
# {{ic|~/.config/mpd/mpd.conf}} in per-user configuration mode, this is the first location searched,<br />
# {{ic|/etc/mpd.conf}} in system-wide configuration.<br />
<br />
For reference, these are some of the most commonly used configuration options:<br />
* {{ic|pid_file}} - The file where MPD stores its process ID<br />
* {{ic|db_file}} - The music database<br />
* {{ic|state_file}} - MPD's current state is noted here<br />
* {{ic|playlist_directory}} - The folder where playlists are saved into<br />
* {{ic|music_directory}} - The folder that MPD scans for music<br />
* {{ic|sticker_file}} - The sticker database<br />
<br />
=== Per-user configuration ===<br />
<br />
MPD can be configured per-user. Running it as a normal user has the benefits of:<br />
<br />
* Regrouping into one single directory {{ic|~/.config/mpd/}} (or any other directory under {{ic|$HOME}}) all the MPD configuration files.<br />
* Avoiding unforeseen directory and file permission errors.<br />
<br />
==== Configure the location of files and directories ====<br />
<br />
{{Accuracy|{{ic|~/.config}} is not recommended, it's just the default.}}<br />
<br />
In user mode, the configuration is read from {{ic|$XDG_CONFIG_HOME/mpd/mpd.conf}}.<br />
We will assume here {{ic|$XDG_CONFIG_HOME}} equals {{ic|~/.config}} which is the recommended [http://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html XDG base directory specification].<br />
<br />
To build the user configuration, the [https://raw.githubusercontent.com/MusicPlayerDaemon/MPD/master/doc/mpdconf.example MPD configuration example] included in the package is a good starting point, copy it using the following lines:<br />
<br />
$ mkdir ~/.config/mpd<br />
$ cp /usr/share/doc/mpd/mpdconf.example ~/.config/mpd/mpd.conf<br />
<br />
A good practice is to use this newly created {{ic|~/.config/mpd/}} directory to store, together with the configuration file, other MPD related files like the database or the playlists. The user must have read write access to this directory.<br />
<br />
Then edit the configuration file in order to specify the required and optional files and directories:<br />
<br />
{{hc|~/.config/mpd/mpd.conf|<br />
# Recommended location for database<br />
db_file "~/.config/mpd/database"<br />
<br />
# Logs to systemd journal<br />
log_file "syslog"<br />
<br />
# The music directory is by default the XDG directory, uncomment to amend and choose a different directory<br />
#music_directory "~/music"<br />
<br />
# Uncomment to refresh the database whenever files in the music_directory are changed<br />
#auto_update "yes"<br />
<br />
# Uncomment to enable the functionalities<br />
#playlist_directory "~/.config/mpd/playlists"<br />
#pid_file "~/.config/mpd/pid"<br />
#state_file "~/.config/mpd/state"<br />
#sticker_file "~/.config/mpd/sticker.sql"<br />
}}<br />
<br />
If playlists are enabled in the configuration, the specified playlist directory must be created:<br />
<br />
$ mkdir ~/.config/mpd/playlists<br />
<br />
MPD can now be started (an optional custom location for the configuration file can be specified):<br />
<br />
$ mpd ''[config_file]''<br />
<br />
In order to build the database file, ''MPD'' must scan into the {{ic|music_directory}} defined above. A MPD client is required to request this task, for example with {{pkg|mpc}} the command is:<br />
<br />
$ mpc update<br />
<br />
or alternatively one can set the option {{ic|auto_update}} to {{ic|"yes"}} in the configuration to refresh the database whenever files are changed in {{ic|music_directory}}.<br />
<br />
==== Audio configuration ====<br />
<br />
If [[ALSA]] is used, '''autodetection''' of the default device should work out of the box without any particular setting. If not, the syntax for ALSA audio output definition is provided thereafter; the required {{ic|name}} parameter specifies a unique name for the audio output.<br />
The exact device as displayed using {{ic|aplay --list-pcm}} from the package {{pkg|alsa-utils}} can optionally be indicated with the {{ic|device}} option.<br />
{{hc|~/.config/mpd/mpd.conf|2=<br />
audio_output {<br />
type "alsa"<br />
name "''ALSA sound card''"<br />
# Optional<br />
#device "''iec958:CARD=Intel,DEV=0''"<br />
#mixer_control "PCM"<br />
}<br />
}}<br />
<br />
Users of [[PulseAudio]] will need to make the following modification:<br />
{{hc|~/.config/mpd/mpd.conf|2=<br />
audio_output {<br />
type "pulse"<br />
name "''pulse audio''"<br />
}<br />
}}<br />
<br />
User will also have to edit {{ic|/etc/pulse/client.conf}} and change the {{ic|autospawn}} option to {{ic|yes}} in order to allow the MPD user to use PulseAudio. It will be necessary to restart PulseAudio after making this modification.<br />
<br />
==== Autostart with systemd ====<br />
<br />
The {{Pkg|mpd}} package provides a [[systemd/User|user service]] file. The service starts the process as user, there is no need to change permission nor use the {{ic|user}} and {{ic|group}} variables in the MPD configuration file.<br />
<br />
[[start/enable]] the user unit {{ic|mpd.service}} (i.e. with the {{ic|--user}} flag).<br />
<br />
{{Note|The configuration file is read from {{ic|~/.config/mpd/mpd.conf}}, see [[systemd#Editing provided units]] if you would like to indicate a custom configuration file path.}}<br />
<br />
==== Autostart on tty login ====<br />
<br />
To start MPD on login add the following to {{ic|~/.profile}} or another [[Autostarting|autostart file]]:<br />
<br />
# MPD daemon start (if no other user instance exists)<br />
[ ! -s ~/.config/mpd/pid ] && mpd<br />
<br />
==== Scripted configuration ====<br />
<br />
The following tool provides assistance for MPD configuration:<br />
<br />
* {{App|[http://lacocina.nl/audiophile-mpd mpd-configure]|Create a MPD configuration optimized for [https://www.musicpd.org/doc/user/advanced_usage.html#bit_perfect bit perfect] audio playback, without any resampling or conversion, using the ALSA interface hardware address (hw:x,y)|https://gitlab.com/ronalde/mpd-configure}}<br />
<br />
=== System-wide configuration ===<br />
<br />
{{Note|Users of PulseAudio with a system-wide MPD configuration have to implement a [[Music Player Daemon/Tips and tricks#Local (with separate mpd user)|workaround]] in order to run MPD as its own user!}}<br />
<br />
The default {{ic|/etc/mpd.conf}} keeps the setup in {{ic|/var/lib/mpd}} which is assigned to user as well as primary group MPD.<br />
<br />
==== Music directory ====<br />
<br />
The music directory is defined by the option {{ic|music_directory}} in the configuration file {{ic|/etc/mpd.conf}}.<br />
<br />
MPD needs to have execute permission on ''all'' parent directories of the music collection and also read access to all directories containing music files. This may conflict with the default configuration of the user directory, like {{ic|~/Music}}, where the music is stored.<br />
<br />
While there are several solutions to this issue, one of these should be most practical:<br />
* Switch to the [[#Per-user configuration]] mode instead<br />
* Add the {{ic|mpd}} user to the user's group and grant group execute permission to the user directory. This way the {{ic|mpd}} user has permission to open the user directory:<br />
# gpasswd -a mpd ''user_group''<br />
$ chmod 710 /home/''user_directory''<br />
* Store the music collection in a different path, either:<br />
** by moving it entirely,<br />
** with a bind mount,<br />
** or with [[Btrfs#Subvolumes]] (you should make this change persistent with an entry to {{ic|/etc/fstab}} ).<br />
<br />
The MPD configuration file must define only one music directory. If the music collection is contained under multiple directories, create symbolic links under the main music directory in {{ic|/var/lib/mpd}}. Remember to set permissions accordingly on the directories being linked.<br />
<br />
==== Start with systemd ====<br />
<br />
MPD can be controlled with {{ic|mpd.service}} [[systemd#Using units|using systemd]]. The first startup can take some time as MPD will scan your music directory.<br />
<br />
Test everything by starting a client application ({{Pkg|ncmpc}} is a light and easy to use client), and play some music!<br />
<br />
===== Socket activation =====<br />
<br />
{{Pkg|mpd}} provides a {{ic|mpd.socket}} unit. If {{ic|mpd.socket}} is enabled (and {{ic|mpd.service}} is disabled), systemd will not start MPD immediately, it will just listen to the appropriate sockets. Then, whenever an MPD client attempts to connect to one of these sockets, systemd will start {{ic|mpd.service}} and transparently hand over control of these ports to the MPD process.<br />
<br />
If you prefer to listen to different UNIX sockets or network ports (even multiple sockets of each type), or if you prefer not to listen to network ports at all, [[edit]] the {{ic|mpd.socket}} unit appropriately '''and''' modify {{ic|/etc/mpd.conf}} to match the configuration (see {{man|5|mpd.conf}} for details).<br />
<br />
==== User id startup workflow ====<br />
MPD should never run as ''root'', you may use the {{ic|user}} option in the configuration to make MPD change its user id after initialization. Do not use this option if you start MPD as an unprivileged user.<br />
To describe how MPD drops its superuser privileges and switch to those of the user set in the configuration, the steps of a normal MPD startup are listed thereafter:<br />
<br />
# Since MPD is started as ''root'' by systemd, it first reads the {{ic|/etc/mpd.conf}} file.<br />
# MPD reads the {{ic|user}} variable in the configuration, and changes from ''root'' to this user.<br />
# MPD then reads the rest of the configuration file and configures itself accordingly. Uses of {{ic|~}} in the configuration file points to the home user's directory, and not root's directory.<br />
<br />
=== Multi-MPD setup ===<br />
<br />
==== Running an Icecast server ====<br />
<br />
For a second MPD (e.g. with [[Icecast]] output to share music over the network) using the same music and playlist as the one above, simply copy the above configuration file and make a new file (e.g., {{ic|/home/username/.mpd/config-icecast}}), and only change the {{ic|log_file}}, {{ic|error_file}}, {{ic|pid_file}}, and {{ic|state_file}} parameters (e.g. {{ic|mpd-icecast.log}}, {{ic|mpd-icecast.error}}, and so on). Using the same directory paths for the music and playlist directories would ensure that this second MPD uses the same music collection as the first one, e.g. creating and editing a playlist under the first daemon would affect the second daemon as well. Users do not have to create the same playlists all over again for the second daemon. Call this second daemon the same way from {{ic|~/.xinitrc}} above - but be sure to have a different port number, avoiding a conflict with the first MPD daemon.<br />
<br />
==== Satellite setup ====<br />
<br />
The method described in [[#Running an Icecast server]] works, but at least in theory could lead to issues with the database, when both MPD instances try to write to the same database file concurrently. MPD has a [http://www.musicpd.org/doc/user/advanced_config.html#satellite satellite mode] where one instance can receive the database from an already running MPD instance.<br />
<br />
In your {{ic|config-icecast}} add this, where host and port reflect your primary MPD server:<br />
<br />
{{bc|<br />
database {<br />
plugin "proxy"<br />
host "localhost"<br />
port "6600"<br />
}<br />
}}<br />
<br />
== Clients ==<br />
<br />
A separate client is needed to control MPD. See a long list of clients at the [https://www.musicpd.org/clients/ mpd website]. Popular options are:<br />
<br />
=== Console ===<br />
<br />
* {{App|clerk|MPD client using [[Rofi]].|https://github.com/carnager/clerk|{{AUR|clerk-git}}}}<br />
* {{App|FMUI|Console user interface created with [[fzf]] and mpc.|https://github.com/seebye/fmui|{{AUR|fmui-git}}}}<br />
* {{App|mpc|Command line user interface for MPD server.|http://www.musicpd.org/clients/mpc/|{{Pkg|mpc}}}}<br />
* {{App|ncmpc|Ncurses client for MPD.|http://www.musicpd.org/clients/ncmpc/|{{Pkg|ncmpc}}}}<br />
* {{App|[[ncmpcpp]]|Almost exact clone of ncmpc with some new features written in C++ (tag editor, search engine).|http://ncmpcpp.rybczak.net/|{{Pkg|ncmpcpp}}}}<br />
* {{App|ncmpy|Curses-based MPD client written in Python.|https://repo.cykerway.com/ncmpy|{{AUR|ncmpy}}}}<br />
* {{App|nncmpp|Yet another MPD client. It is in effect a simplified TUI version of Sonata.|https://git.janouch.name/p/nncmpp/|{{AUR|nncmpp-git}}}}<br />
* {{App|pms|Highly configurable and accessible ncurses client written in Go.|https://ambientsound.github.io/pms/|{{AUR|pmus-git}}}}<br />
* {{App|vimpc|Ncurses based MPD client with vi-like key bindings.|https://github.com/boysetsfrog/vimpc|{{AUR|vimpc-git}}}}<br />
<br />
=== Graphical ===<br />
<br />
* {{App|Ario|Very feature-rich GTK3 GUI client for MPD, inspired by [[Rhythmbox]].|http://ario-player.sourceforge.net/|{{Pkg|ario}}}}<br />
* {{App|Cantata|High-feature, Qt4, Qt5 or KDE client for MPD with very configurable interface.|https://github.com/CDrummond/cantata|{{Pkg|cantata}}}}<br />
* {{App|CoverGrid|GTK3 GUI client focusing on albums instead of single tracks.|https://www.suruatoel.xyz/codes/mcg|{{AUR|mcg}}}}<br />
* {{App|GMPC|Gnome Music Player Client. GTK+ frontend for MPD. It is designed to be lightweight and easy to use, while providing full access to all of MPD's features. Users are presented with several different methods to browse through their music. It can be extended by plugins, of which many are available.|http://gmpclient.org/|{{AUR|gmpc}}}}<br />
* {{App|pymp'd|A GTK+ front end client for the music playing daemon MPD.|http://pympd.sourceforge.net|{{AUR|pympd}}}}<br />
* {{App|QMPDClient|Qt4 GUI client.|http://bitcheese.net/wiki/QMPDClient|{{AUR|qmpdclient}}}}<br />
* {{App|Quimup|Simple Qt5 frontend for MPD written in C++.|https://sourceforge.net/projects/quimup/|{{AUR|quimup}}}}<br />
* {{App|RompЯ|Web client for MPD.|https://fatg3erman.github.io/RompR/|{{AUR|rompr}}}}<br />
* {{App|SkyMPC|Simple MPD client, powered by Qt5.|https://github.com/soramimi/SkyMPC|{{AUR|skympc-git}}}}<br />
* {{App|Sonata|Elegant Python GTK+ client.|http://www.nongnu.org/sonata/|{{Pkg|sonata}}}}<br />
* {{App|Xfce MPD Panel Plugin|MPD plugin for [[Xfce]]4 panel.|http://goodies.xfce.org/projects/panel-plugins/xfce4-mpc-plugin|{{Pkg|xfce4-mpc-plugin}}}}<br />
* {{App|Xfmpc|Graphical GTK+ MPD client focusing on low footprint.|http://goodies.xfce.org/projects/applications/xfmpc|{{Pkg|xfmpc}}}}<br />
* {{App|ympd|Standalone MPD Web GUI written in C, utilizing Websockets and Bootstrap/JS.|https://ympd.org/|{{AUR|ympd}}}}<br />
<br />
== See also ==<br />
<br />
* [http://forum.musicpd.org/ MPD Forum]<br />
* [http://www.musicpd.org/doc/user/ MPD User Manual]<br />
* [[Wikipedia:Music Player Daemon|Wikipedia article]]<br />
* [https://github.com/MusicPlayerDaemon/MPD GitHub repository]<br />
* {{Pkg|mopidy}} is an alternative to MPD written in Python. Note it is not a complete MPD replacement, its advantage is that it has plug-ins for playing music from cloud services like Spotify, SoundCloud, and Google Play Music. However, the project is not that active and some of its plugins are not maintained.</div>7h3w1zz