https://wiki.archlinux.org/api.php?action=feedcontributions&user=Pocm&feedformat=atomArchWiki - User contributions [en]2024-03-29T13:19:43ZUser contributionsMediaWiki 1.41.0https://wiki.archlinux.org/index.php?title=Capabilities&diff=210931Capabilities2012-06-22T18:33:27Z<p>Pocm: /* screen */ correction - only needs setuid for multiuser</p>
<hr />
<div>[[Category:Security]]<br />
The intention of this article is to remove the setuid attribute in the binaries that require certain root-privileges.<br />
In this way, it eliminates the need for "all or nothing", using a fine grained control with POSIX 1003.1e capabilities.<br />
<br />
'''Use with caution, some programs do not know about file capabilities. It apparently works correctly, but have some unexpected side effects (see for example [[#util-linux-ng]])'''<br />
<br />
==Prerequisites==<br />
You need libcap, for setting file capabalities that are extended attributes, with the utility setcap.<br />
# pacman -S libcap<br />
<br />
==Setuid-root files by package==<br />
<br />
===coreutils===<br />
<br />
{{Note|Warning: Do not use it, because su will return incorrect password.}}<br />
<br />
# chmod u-s /bin/su<br />
# setcap cap_setgid,cap_setuid+ep /bin/su<br />
<br />
===dcron===<br />
<br />
# chmod u-s /usr/bin/crontab<br />
# setcap cap_dac_override,cap_setgid+ep /usr/bin/crontab<br />
<br />
===inetutils===<br />
<br />
# chmod u-s /usr/bin/rsh<br />
# setcap cap_net_bind_service+ep /usr/bin/rsh<br />
<br />
# chmod u-s /usr/bin/rcp<br />
# setcap cap_net_bind_service+ep /usr/bin/rcp<br />
<br />
# chmod u-s /usr/bin/rlogin<br />
# setcap cap_net_bind_service+ep /usr/bin/rlogin<br />
<br />
===iputils===<br />
<br />
# chmod u-s /bin/ping<br />
# setcap cap_net_raw+ep /bin/ping<br />
<br />
# chmod u-s /bin/ping6<br />
# setcap cap_net_raw+ep /bin/ping6<br />
<br />
# chmod u-s /bin/traceroute<br />
# setcap cap_net_raw+ep /bin/traceroute<br />
<br />
# chmod u-s /bin/traceroute6<br />
# setcap cap_net_raw+ep /bin/traceroute6<br />
<br />
===pam===<br />
<br />
# chmod u-s /sbin/unix_chkpwd<br />
# setcap cap_dac_read_search+ep /sbin/unix_chkpwd<br />
<br />
===pmount===<br />
<br />
Does not work without setuid.<br />
<br />
===screen===<br />
<br />
Needs setuid for multiuser sessions, but if you don't need that feature, you can safely turn off setuid.<br />
<br />
===shadow===<br />
<br />
# chmod u-s /usr/bin/chage<br />
# setcap cap_dac_read_search+ep /usr/bin/chage<br />
<br />
# chmod u-s /usr/bin/chfn<br />
# setcap cap_chown,cap_setuid+ep /usr/bin/chfn<br />
<br />
# chmod u-s /usr/bin/chsh<br />
# setcap cap_chown,cap_setuid+ep /usr/bin/chsh<br />
<br />
# chmod u-s /usr/bin/expiry<br />
# setcap cap_dac_override,cap_setgid+ep /usr/bin/expiry<br />
<br />
# chmod u-s /usr/bin/gpasswd<br />
# setcap cap_chown,cap_dac_override,cap_setuid+ep /usr/bin/gpasswd<br />
<br />
# chmod u-s /usr/bin/newgrp<br />
# setcap cap_dac_override,cap_setgid+ep /usr/bin/newgrp<br />
<br />
# chmod u-s /usr/bin/passwd<br />
# setcap cap_chown,cap_dac_override,cap_fowner+ep /usr/bin/passwd<br />
<br />
===sudo===<br />
<br />
Sudo does not work without setuid.<br />
<br />
===util-linux-ng===<br />
<br />
{{Note|Warning: Do not use it, because mount and umount can not do some checks, then users can mount/umount filesystems that do not have permission.}}<br />
<br />
# chmod u-s /bin/mount<br />
# setcap cap_dac_override,cap_sys_admin+ep /bin/mount<br />
<br />
# chmod u-s /bin/umount<br />
# setcap cap_dac_override,cap_sys_admin+ep /bin/umount<br />
<br />
===xorg-xserver===<br />
<br />
# chmod u-s /usr/bin/Xorg<br />
# setcap cap_chown,cap_dac_override,cap_sys_rawio,cap_sys_admin+ep /usr/bin/Xorg<br />
<br />
==Other programs that benefit from capabilities==<br />
<br />
The following packages do not have files with the setuid attribute but require root privileges to work. By enabling some capabilities, regular users can use the program without privilege elevation.<br />
<br />
===chvt===<br />
<br />
# setcap cap_dac_read_search,cap_sys_tty_config+ep /usr/bin/chvt<br />
<br />
===iftop===<br />
<br />
# setcap cap_net_raw+ep /usr/sbin/iftop<br />
<br />
==Useful commands==<br />
Find setuid-root files<br />
$ find /bin /sbin /lib /usr/bin /usr/sbin /usr/lib -perm /4000 -user root<br />
<br />
Find setgid-root files<br />
$ find /bin /sbin /lib /usr/bin /usr/sbin /usr/lib -perm /2000 -group root<br />
<br />
==Additional Resources==<br />
* Man Page capabilities(7) setcap(8) getcap(8)</div>Pocmhttps://wiki.archlinux.org/index.php?title=Browser_plugins&diff=201902Browser plugins2012-05-17T07:04:27Z<p>Pocm: /* Blue tint on videos with Flash and Nvidia */ updated to recommend newer patch</p>
<hr />
<div>{{i18n|Browser Plugins}}<br />
[[Category:Web Browser]]<br />
[[de:Browser Plugins]]<br />
[[fr:Plugins navigateur]]<br />
[[tr:Web tarayıcı eklentileri]]<br />
These plugins work in [[Firefox]], [[Opera]] and WebKit derivatives. <!-- Chrome? --><br />
<br />
==Flash Player==<br />
<br />
===Adobe Flash Player===<br />
<br />
Flash Player is in the [[Official Repositories|official repositories]] for both i686 and x86_64 architectures: {{Pkg|flashplugin}}<br />
<br />
====Epiphany====<br />
Note that for {{Pkg|Epiphany}}, you have to wrap Adobe Flash Player in the same fashion as described for x86_64. See [[Epiphany#Flash]] for more details.<br />
<br />
====Misc====<br />
In addition, it may be needed to install {{AUR|ttf-ms-fonts}} from the [[AUR]] in order to properly render text.<br />
<br />
====Configuration====<br />
<!-- Change this heading to Flash configuration once more than one plugin needs a similar section --><br />
To change general plug-in preferences (privacy settings, resource usage, etc.), right click on embedded Flash content and choose preferences from the menu, or go to the [http://www.macromedia.com/support/documentation/en/flashplayer/help/settings_manager.html Macromedia website]. There, a Flash animation will give access to local settings.<br />
<br />
You can make your own settings file for Flash, just use the file {{ic|/etc/adobe/mms.cfg}}. Example config below:<br />
# Adobe player settings<br />
AVHardwareDisable = 0<br />
FullScreenDisable = 0<br />
LocalFileReadDisable = 1<br />
FileDownloadDisable = 1<br />
FileUploadDisable = 1<br />
LocalStorageLimit = 1<br />
ThirdPartyStorage = 1<br />
AssetCacheSize = 10<br />
AutoUpdateDisable = 1<br />
LegacyDomainMatching = 0<br />
LocalFileLegacyAction = 0<br />
AllowUserLocalTrust = 0<br />
# DisableSockets = 1 <br />
OverrideGPUValidation = 1<br />
<br />
You can also refer to the [http://sources.gentoo.org/cgi-bin/viewvc.cgi/gentoo-x86/www-plugins/adobe-flash/files/mms.cfg mms.cfg from Gentoo], which is extensively commented.<br />
<br />
====Disable "Press ESC to exit full screen mode" message====<br />
[http://ubuntuforums.org/showthread.php?t=1839293 This topic] at ubuntuforums.org describes a way to disable that message.<br />
<br />
Backup "libflashplayer.so" in case something messes up.<br />
# cp /usr/lib/mozilla/plugins/libflashplayer.so /usr/lib/mozilla/plugins/libflashplayer.so.backup <br />
<br />
Make a copy to your home directory<br />
# cp /usr/lib/mozilla/plugins/libflashplayer.so ~/<br />
<br />
Make sure wine is installed. If not, execute the following command<br />
# pacman -S wine<br />
<br />
Download "Flash Fullscreen Patcher.zip" from [http://forum.videohelp.com/threads/304807-How-to-remove-annoying-Press-Esc-to-message-in-Flash-Video this page], extract and execute with wine.<br />
<br />
$ wget http://forum.videohelp.com/attachments/9255-1319291919/Flash%20Fullscreen%20Patcher.zip<br />
$ unzip Flash\ Fullscreen\ Patcher.zip <br />
$ wine Flash\ Fullscreen\ Patcher.exe<br />
<br />
Patch "libflashplayer.so" in your home dir using the GUI.<br />
Copy the patched lib back to the plugins directory<br />
# cp ~/libflashplayer.so /usr/lib/mozilla/plugins/<br />
<br />
====Troubleshooting====<br />
If you have Abobe Flash installed on an older system and you start playing a video which simply turns black with nothing happeing, it is most likely that your CPU does not support ISSE2. You can simply check out this by looking at your CPU flags with this command:<br />
<br />
# cat /proc/cpuinfo | grep flags<br />
If sse2 is not mentioned there, then you need to install an older version of Flash (for example 10.3). Older versions possibly will have vulnerabilities. You should then consider sandboxing Firefox using sandfox (https://igurublog.wordpress.com/downloads/script-sandfox/).<br />
<br />
Older versions of Flash are available here:<br />
http://www.adobe.com/products/flashplayer/distribution3.html<br />
<br />
Get the tar version and unpack it. You need to copy libflashplayer.so to the folder /usr/lib/mozilla/plugins/<br />
<br />
Restart Firefox and you have working Flash again<br />
<br />
==PDF viewer==<br />
<br />
===Evince===<br />
If you want to view PDF files in [[Firefox]] without opening a new window, follow this guide: https://wiki.archlinux.org/index.php/Firefox_Tips_and_Tweaks#Viewing_PDF.2FPS_inside_Firefox<br />
<br />
===Adobe Reader===<br />
Due to licensing restrictions, Adobe Reader cannot be distributed from any of the official Arch Linux repositories. There are versions available in the [[AUR]]. Please note that no matter how many votes it receives, Adobe Reader will never be included in the [[Official Repositories|official repositories]]. See this [https://aur.archlinux.org/packages.php?ID=16980 comment] for an explanation.<br />
<br />
Also, there are [https://aur.archlinux.org/packages.php?O=0&K=acroread-&do_Search=Go localizations] available in many languages.<br />
<br />
====32-bit====<br />
32-bit AUR package: {{AUR|acroread}}<br />
<br />
It installs the Acrobat Reader application as well as the Firefox plugin. Note that hardware-assisted rendering is unavailable under Linux (at least using a Geforce 8600GTS with driver version 185.18.14).<br />
<br />
====64-bit====<br />
Adobe Reader is a closed-source application, meaning that users desiring a 64-bit binary have no other choice other than to wait for official support. Workarounds to be considered:<br />
<br />
* Follow [[Install bundled 32-bit system in Arch64|this guide]] originally posted in the forums. It involves creating a chrooted environment that could be reused for other 32-bit only applications.<br />
<br />
* Or, simply get the 32-bit binary along with the 32-bit dependencies. Install {{AUR|bin32-acroread}}. Also, consider installing the extra font packages suggested by the package. Be advised that the [[Firefox]] plugin cannot be used ''directly'' with this binary -- it will not load in the 64-bit browser. {{AUR|nspluginwrapper-flash}} is required to load the plugin. Finally, be sure to run:<br />
$ nspluginwrapper -v -a -i<br />
as a '''normal user'''. This checks the plugin directory and links the plugins as needed. Everything should work as expected now.<br />
<br />
{{Note|There seems to also be a {{Pkg|nspluginwrapper}} in the [[Official Repositories|official repositories]] which may be the new way to go.}}<br />
<br />
==Citrix==<br />
See: [[Citrix]]<br />
<br />
== Java (IcedTea) ==<br />
Provided by {{Pkg|icedtea-web-java7}} from the [[Official Repositories|official repositories]], it also needs [[Java]] installed.<br />
<br />
{{Note|If you experience any problems with the Java plug-in, you can try the [[Flash#Plugins_are_installed_but_not_working|solution]], suggested for the Firefox Flash plug-in. You can also try using non-free version, bundled with Oracle JRE.}}<br />
<br />
=== Weird symlink ===<br />
{{Note|The section below is likely outdated.}}<br />
But if you want to, since {{Pkg|firefox}} v3.6 does not seem to look in {{ic|/usr/lib/mozilla/plugins}}, which is the default location where {{AUR|jre}} v1.6.0_22 places the Java plugin, just<br />
# ln -s /opt/java/jre/lib/i386/libnpjp2.so ~/mozilla/plugins/libnpjp2.so<br />
and it is safe to<br />
# rm -R /usr/lib/mozilla<br />
unless you use it for something else! Be careful here.<br />
<br />
==Video Plugins==<br />
<br />
===Gecko Media Player===<br />
A good replacement of the now obsolete mplayer-plugin is [http://code.google.com/p/gecko-mediaplayer/ Gecko Media Player] packaged as {{Pkg|gecko-mediaplayer}}. More stable combined with MPlayer 1.0RC2. (No more crashes with Apple Trailers.)<br />
<br />
===Totem Plugin===<br />
The {{Pkg|totem-plugin}} might be the right choice for those seeking a [[GStreamer]]-based plugin.<br />
<br />
===Rosa Media Player Plugin===<br />
The {{AUR|rosa-media-player-plugin}} might be the right choice for those seeking a [[Mplayer]]-based plugin written in QT (install it through the [[AUR]]).<br />
<br />
===VLC Plugin===<br />
{{AUR|npapi-vlc-git}} is the modern VLC Mozilla plugin based on libVLC.<br />
<br />
==Other==<br />
<br />
===Mozplugger===<br />
{{Stub}}<br />
Install {{AUR|mozplugger}} through the [[AUR]].<br />
<br />
==Troubleshooting==<br />
<br />
=== Bad (choppy) sound on 64bit flashplugin ===<br />
There is a problem with flashplugin 11 64bit and a new memcpy routine in glibc, which makes the sound choppy on mp3 streams (more info here: [http://forums.fedoraforum.org/showthread.php?t=258346]. Current workarounds are either replacing the memcopy routine like suggested in the mentioned thread or using flashplugin-square [https://aur.archlinux.org/packages.php?ID=58116] from the AUR.<br />
<br />
===Flash blocks sound and/or delayed playback===<br />
If sound is delayed within flash video and/or if Flash stops sound from any other application, then make sure you do not have {{ic|snd_pcm_oss}} module loaded:<br />
$ lsmod | grep snd_pcm_oss<br />
You can unload it<br />
# rmmod snd_pcm_oss<br />
and restart the browser to see if it helps.<br />
<br />
===No sound in Flash===<br />
Flash Player outputs its sound only through the default ALSA device, which is number 0. If you have multiple sound devices (a very common example is having a sound card and HDMI output in video card), then your preferred device may have a different number.<br />
For example:<br />
$ aplay -l<br />
**** List of PLAYBACK Hardware Devices ****<br />
card 0: Generic [HD-Audio Generic], device 3: HDMI 0 [HDMI 0]<br />
Subdevices: 1/1<br />
Subdevice #0: subdevice #0<br />
card 1: DX [Xonar DX], device 0: Multichannel [Multichannel]<br />
Subdevices: 0/1<br />
Subdevice #0: subdevice #0<br />
card 1: DX [Xonar DX], device 1: Digital [Digital]<br />
Subdevices: 1/1<br />
Subdevice #0: subdevice #0<br />
In this case, HDMI output is "card 0" and sound card is "card 1". To make it default for ALSA, create a file named {{ic|~/.asoundrc}} with the following content:<br />
pcm.!default {<br />
type hw<br />
card 1<br />
}<br />
<br />
ctl.!default {<br />
type hw<br />
card 1<br />
}<br />
<br />
===Flash performance===<br />
Adobe's Flash plugin has some serious performance issues, especially when CPU frequency scaling is used. There seems to be a policy not to use the whole CPU workload, so the frequency scaling governor does not clock the CPU any higher. To work around this issue, see: [[cpufrequtils#Changing the ondemand governor's threshold]]<br />
<br />
===Plugins are installed but not working===<br />
A common problem is that the plugin path is unset. This typically occurs on a new install, when the user has not re-logged in before running Firefox after the installation. Test if the path is unset:<br />
echo $MOZ_PLUGIN_PATH<br />
If unset, then either re-login, or source {{ic|/etc/profile.d/mozilla-common.sh}} and start Firefox from the same shell:<br />
. /etc/profile.d/mozilla-common.sh && firefox<br />
<br />
===Gecko Media Player will not play Apple trailers===<br />
If Apple Trailers appear to start to play and then fail, try setting the user agent for your browser to:<br />
QuickTime/7.6.2 (qtver=7.6.2;os=Windows NT 5.1Service Pack 3)<br />
<br />
===Low webcam resolution in Flash===<br />
If your webcam has low resolution in Flash (the image looks very pixelated) you can try starting your browser with this:<br />
LD_PRELOAD=/usr/lib/libv4l/v4l1compat.so chromium<br />
<br />
===Black bars in fullscreen video playback on multiheaded desktops===<br />
<br />
The Flash plugin has a known bug, where the full screen mode does not really work when you have a multi-monitor setup. Apparently it incorrectly determines the fullscreen resolution, so the video fill the correct monitor but gets scaled as if the monitor had the resolution of the total display area.<br />
<br />
To fix this, you can use the "hack" described [http://al.robotfuzz.com/content/workaround-fullscreen-flash-linux-multiheaded-desktops here]. Simply download the file linked and follow instructions from the README.<br />
<br />
Note that while the author mentions using nvidia twinview, this actually applies regardless.<br />
<br />
===Blue tint on videos with Flash and Nvidia===<br />
<br />
An issue with {{Pkg|flashplugin}} versions 11.2.202.228-1 and 11.2.202.233-1 causes it to send the U/V panes in the incorrect order resulting in a blue tint on certain videos. There are a few potential fixes for this bug:<br />
<br />
* Install {{AUR|libvdpau-git-flashpatch}} from [[AUR]]<br />
* Patch vdpau_trace.so [http://www.nvnews.net/vbulletin/showpost.php?p=2518770&postcount=104] with [https://bbs.archlinux.org/viewtopic.php?pid=1078368#p1078368 this makepkg].<br />
* Right click on a video, select 'Settings...' and untick 'Enable hardware acceleration'. Reload the page for it to take affect. Note that this disables GPU acceleration.<br />
* Downgrade Flash to version 11.1.102.63-1 at most<br />
* Use Google Chrome with the new Pepper API.<br />
* Try one of the few Flash alternatives.<br />
<br />
The merits of each are discussed in [https://bbs.archlinux.org/viewtopic.php?id=137877 this thread]. To summarize: if you want all flash sites (youtube, vimeo, etc) to work properly in non-Chrome browsers, without feature regressions (such as losing hardware acceleration), without crashes/instability (enabling hardware decoding), without security concerns (multiple CVEs against older flash versions) and without breaking the vdpau tracing library from its intended purpose, the LEAST objectionable is to install {{AUR|libvdpau-git-flashpatch}}.<br />
<br />
===Leaking overlay with Flash and Nvidia===<br />
<br />
This bug is due to the incorrect colour key being used by the {{Pkg|flashplugin}} version 11.2.202.228-1 [http://www.nvnews.net/vbulletin/showpost.php?p=2514210&postcount=102] and causes the flash content to "leak" into other pages or solid black backgrounds. To avoid this issue simply export {{ic|1=VDPAU_NVIDIA_NO_OVERLAY=1}} within either your shell profile (E.g. {{ic|~/.bash_profile}} or {{ic|~/.zprofile}}) or {{ic|~/.xinitrc}}</div>Pocmhttps://wiki.archlinux.org/index.php?title=PKGBUILD&diff=166029PKGBUILD2011-10-15T18:26:59Z<p>Pocm: Clarifying the syntax of noextract vs source arrays</p>
<hr />
<div>[[Category:About Arch (English)]]<br />
[[Category:Package development (English)]]<br />
{{i18n|PKGBUILD}}<br />
[[fr:PKGBUILD]]<br />
<br />
{{Article summary start}}<br />
{{Article summary text|A PKGBUILD is a script that describes how software is to be compiled and packaged. This article provides an explanation of PKGBUILD variables used when [[Creating Packages]].}}<br />
{{Article summary heading|Overview}}<br />
{{Article summary text|{{Package management overview}}}}<br />
{{Article summary heading|Related}}<br />
{{Article summary wiki|Creating Packages}}<br />
{{Article summary wiki|Custom local repository}}<br />
{{Article summary wiki|pacman Tips}}<br />
{{Article summary heading|Resources}}<br />
{{Article summary link|PKGBUILD(5) Manual Page|http://www.archlinux.org/pacman/PKGBUILD.5.html}}<br />
{{Article summary end}}<br />
<br />
A {{Filename|PKGBUILD}} is an Arch Linux package build description file used when [[creating packages]].<br />
<br />
Packages in Arch Linux are built using the [[makepkg]] utility and information stored in {{Filename|PKGBUILD}} files. When {{Codeline|makepkg}} is run, it searches for a {{Filename|PKGBUILD}} in the current directory and follows the instructions therein to either compile or otherwise acquire the files to build a package file ({{Filename|pkgname.pkg.tar.xz}}). The resulting package contains binary files and installation instructions; readily installed with [[pacman]].<br />
<br />
==Variables==<br />
<br />
The following are variables that can be filled out in the {{Filename|PKGBUILD}} file.<br />
<br />
It is common practice to define the variables in the {{Filename|PKGBUILD}} in same order as given here. However, this is not mandatory, as long as correct [[Bash]] syntax is used.<br />
<br />
==={{Codeline|pkgname}}===<br />
<br />
The name of the package. It should consist of '''alphanumeric characters and dashes ('-')''' and all letters should be '''lowercase'''. For the sake of consistency, {{Codeline|pkgname}} should match the name of the source tarball of the software you are packaging. For instance, if the software is in {{Filename|foobar-2.5.tar.gz}}, the {{Codeline|pkgname}} value should be ''foobar''. The present working directory the {{Filename|PKGBUILD}} file is in should also match the {{Codeline|pkgname}}.<br />
<br />
==={{Codeline|pkgver}}===<br />
<br />
The version of the package. The value should be the same as the version released by the author of the package. It can contain letters, numbers and periods but '''CANNOT''' contain a hyphen. If the author of the package uses a hyphen in their version numbering scheme, replace it with an underscore. For instance, if the version is ''0.99-10'', it should be changed to ''0.99_10''. If the pkgver variable is used later in the PKGBUILD then the underscore can easily be substituted for a dash on usage e.g.:<br />
source=($pkgname-${pkgver//_/-}.tar.gz)<br />
<br />
==={{Codeline|pkgrel}}===<br />
The release number of the package specific to Arch Linux. This value allows users to differentiate between consecutive builds of the same version of a package. When a new package version is first released, the '''release number starts at 1'''. As fixes and optimizations are made to the {{Filename|PKGBUILD}} file, the package will be '''re-released''' and the '''release number''' will increment by 1. When a new version of the package comes out, the release number resets to 1.<br />
<br />
==={{Codeline|epoch}}===<br />
<br />
An integer value, specific to Arch Linux, representing what 'lifetime' to compare version numbers against. This value allows overrides of the normal version comparison rules for packages that have inconsistent version numbering, require a downgrade, change numbering schemes, etc. By default, packages are assumed to have an epoch value of ''0''. Do not use this unless you know what you are doing.<br />
<br />
==={{Codeline|pkgdesc}}===<br />
<br />
The description of the package. The description should be about 80 characters or less and should not include the package name in a self-referencing way. For instance, "Nedit is a text editor for X11" should be written as "A text editor for X11."<br />
<br />
==={{Codeline|arch}}===<br />
<br />
An array of architectures that the {{Filename|PKGBUILD}} file is known to build and work on. Currently, it should contain '''i686''' and/or '''x86_64''', {{Codeline|<nowiki>arch=('i686' 'x86_64')</nowiki>}}. The value '''any''' can also be used for architechture-independent packages.<br />
<br />
You can access the target architecture with the variable {{Codeline|$CARCH}} during a build, and even when defining variables. See also [https://bugs.archlinux.org/task/16352 FS#16352]. Example:<br />
<br />
<pre><br />
depends=(foobar)<br />
if test "$CARCH" == x86_64; then<br />
depends=("${depends[@]}" lib32-glibc)<br />
fi<br />
</pre><br />
<br />
==={{Codeline|url}}===<br />
<br />
The URL of the official site of the software being packaged.<br />
<br />
==={{Codeline|license}}===<br />
<br />
The license under which the software is distributed. A {{Package Official|licenses}} package has been created in {{Codeline|[core]}} that stores common licenses in {{Filename|/usr/share/licenses/common}}, e.g. {{Filename|/usr/share/licenses/common/GPL}}. If a package is licensed under one of these licenses, the value should be set to the directory name, e.g. {{Codeline|<nowiki>license=('GPL')</nowiki>}}. If the appropriate license is not included in the official {{Package Official|licenses}} package, several things must be done:<br />
<br />
# The license file(s) should be included in: {{Filename|/usr/share/licenses/'''pkgname'''/}}, e.g. {{Filename|/usr/share/licenses/foobar/LICENSE}}.<br />
# If the source tarball does '''NOT''' contain the license details and the license is only displayed elsewhere, e.g. a website, then you need to copy the license to a file and include it.<br />
# Add '''custom''' to the {{Codeline|license}} array. Optionally, you can replace '''custom''' with '''custom:name of license'''. Once a license is used in two or more packages in an official repository (including {{Codeline|[community]}}), it becomes a part of the {{Package Official|licenses}} package.<br />
* The [[Wikipedia:BSD License|BSD]], [[Wikipedia:MIT License|MIT]], [[Wikipedia:ZLIB license|zlib/png]] and [[Wikipedia:Python License|Python]] licenses are special cases and could not be included in the {{Package Official|licenses}} package. For the sake of the {{Codeline|license}} array, it is treated as a common license ({{Codeline|<nowiki>license=('BSD')</nowiki>}}, {{Codeline|<nowiki>license=('MIT')</nowiki>}}, {{Codeline|<nowiki>license=('ZLIB')</nowiki>}} and {{Codeline|<nowiki>license=('Python')</nowiki>}}) but technically each one is a custom license because each one has its own copyright line. Any packages licensed under these four should have its own unique license stored in {{Filename|/usr/share/licenses/'''pkgname'''}}. Some packages may not be covered by a single license. In these cases, multiple entries may be made in the license array, e.g. {{Codeline|<nowiki>license=('GPL' 'custom:name of license')</nowiki>}}.<br />
* Additionally, the (L)GPL has many versions and permutations of those versions. For (L)GPL software, the convention is:<br />
** (L)GPL - (L)GPLv2 or any later version<br />
** (L)GPL2 - (L)GPL2 only<br />
** (L)GPL3 - (L)GPL3 or any later version<br />
* If after researching the issue no license can be determined, {{Codeline|PKGBUILD.proto}} suggests using {{Codeline|unknown}}. However upstream should be contacted about the conditions under which the software is (and is not) available.<br />
<br />
==={{Codeline|groups}}===<br />
<br />
The group the package belongs in. For instance, when you install the {{Package Official|kdebase}} package, it installs all packages that belong in the ''kde'' group.<br />
<br />
==={{Codeline|depends}}===<br />
<br />
An array of package names that must be installed before this software can be run. If a software requires a minimum version of a dependency, the '''>=''' operator should be used to point this out, e.g. {{Codeline|<nowiki>depends=('foobar>=1.8.0')</nowiki>}}. You do not need to list packages that your software depends on if other packages your software depends on already have those packages listed in their dependency. For instance, ''gtk2'' depends on ''glib2'' and ''glibc''. However, ''glibc'' does not need to be listed as a dependency for ''gtk2'' because it is a dependency for ''glib2''.<br />
<br />
==={{Codeline|makedepends}}===<br />
<br />
An array of package names that must be installed to build the software but unnecessary for using the software after installation. You can specify the minimum version dependency of the packages in the same format as the {{Codeline|depends}} array.<br />
<br />
{{Warning| The group "base-devel" is assumed already installed when building with makepkg . Members of "base-devel" '''should not''' be included in makedepends arrays.}}<br />
<br />
==={{Codeline|optdepends}}===<br />
<br />
An array of package names that are not needed for the software to function but provides additional features. A short description of what each package provides should also be noted. An {{Codeline|optdepends}} may look like this:<br />
optdepends=('cups: printing support'<br />
'sane: scanners support'<br />
'libgphoto2: digital cameras support'<br />
'alsa-lib: sound support'<br />
'giflib: GIF images support'<br />
'libjpeg: JPEG images support'<br />
'libpng: PNG images support')<br />
<br />
==={{Codeline|provides}}===<br />
<br />
An array of package names that this package provides the features of (or a virtual package such as ''cron'' or ''sh''). If you use this variable, you should add the version ({{Codeline|pkgver}} and perhaps the {{Codeline|pkgrel}}) that this package will provide if dependencies may be affected by it. For instance, if you are providing a modified ''qt'' package named ''qt-foobar'' version 3.3.8 which provides ''qt'' then the {{Codeline|provides}} array should look like {{Codeline|<nowiki>provides=('qt=3.3.8')</nowiki>}}. Putting {{Codeline|<nowiki>provides=('qt')</nowiki>}} will cause to fail those dependencies that require a specific version of ''qt''. Do not add {{Codeline|pkgname}} to your provides array, this is done automatically.<br />
<br />
==={{Codeline|conflicts}}===<br />
<br />
An array of package names that may cause problems with this package if installed. You can also specify the version properties of the conflicting packages in the same format as the {{Codeline|depends}} array.<br />
<br />
==={{Codeline|replaces}}===<br />
<br />
An array of obsolete package names that are replaced by this package, e.g. {{Codeline|<nowiki>replaces=('ethereal')</nowiki>}} for the {{Package Official|wireshark}} package. After syncing with {{Codeline|pacman -Sy}}, it will immediately replace an installed package upon encountering another package with the matching {{Codeline|replaces}} in the repositories. If you are providing an alternate version of an already existing package, use the {{Codeline|conflicts}} variable which is only evaluated when actually installing the conflicting package.<br />
<br />
==={{Codeline|backup}}===<br />
<br />
An array of files to be backed up as {{Filename|file.pacsave}} when the package is removed. This is commonly used for packages placing configuration files in {{Filename|/etc}}. The file paths in this array should be relative paths (e.g. {{Filename|etc/pacman.conf}}) not absolute paths (e.g. {{Filename|/etc/pacman.conf}}).<br />
<br />
==={{Codeline|options}}===<br />
<br />
This array allows you to override some of the default behavior of {{Codeline|makepkg}}. To set an option, include the option name in the array. To reverse the default behavior, place an '''!''' at the front of the option. The following options may be placed in the array:<br />
<br />
* '''''strip''''' - Strips symbols from binaries and libraries.<br />
* '''''docs''''' - Save {{Filename|/doc}} directories.<br />
* '''''libtool''''' - Leave ''libtool'' ({{Filename|.la}}) files in packages.<br />
* '''''emptydirs''''' - Leave empty directories in packages.<br />
* '''''zipman''''' - Compress ''man'' and ''info'' pages with ''gzip''.<br />
* '''''ccache''''' - Allow the use of {{Codeline|ccache}} during build. More useful in its negative form {{Codeline|!ccache}} with select packages that have problems building with {{Codeline|ccache}}.<br />
* '''''distcc''''' - Allow the use of {{Codeline|distcc}} during build. More useful in its negative form {{Codeline|!distcc}} with select packages that have problems building with {{Codeline|distcc}}.<br />
* '''''buildflags''''' - Allow the use of user-specific {{Codeline|buildflags}} (CFLAGS, CXXFLAGS, LDFLAGS) during build. More useful in its negative form !buildflags with select packages that have problems building with custom {{Codeline|buildflags}}.<br />
* '''''makeflags''''' - Allow the use of user-specific {{Codeline|makeflags}} during build. More useful in its negative form {{Codeline|!makeflags}} with select packages that have problems building with custom {{Codeline|makeflags}}.<br />
<br />
==={{Codeline|install}}===<br />
<br />
The name of the {{Filename|.install}} script to be included in the package. ''pacman'' has the ability to store and execute a package-specific script when it installs, removes or upgrades a package. The script contains the following functions which run at different times:<br />
<br />
* '''''pre_install''''' - The script is run right before files are extracted. One argument is passed: new package version.<br />
* '''''post_install''''' - The script is run right after files are extracted. One argument is passed: new package version.<br />
* '''''pre_upgrade''''' - The script is run right before files are extracted. Two arguments are passed in the following order: new package version, old package version.<br />
* '''''post_upgrade''''' - The script is run after files are extracted. Two arguments are passed in the following order: new package version, old package version.<br />
* '''''pre_remove''''' - The script is run right before files are removed. One argument is passed: old package version.<br />
* '''''post_remove''''' - The script is run right after files are removed. One argument is passed: old package version.<br />
<br />
Each function is run chrooted inside the pacman install directory. See [https://bbs.archlinux.org/viewtopic.php?pid=913891 this thread].<br />
<br />
{{Tip|A prototype {{Filename|.install}} is provided at {{Filename|/usr/share/pacman/proto.install}}.}}<br />
<br />
==={{Codeline|source}}===<br />
<br />
An array of files which are needed to build the package. It must contain the location of the software source, which in most cases is a full HTTP or FTP URL. The previously set variables {{Codeline|pkgname}} and {{Codeline|pkgver}} can be used effectively here (e.g. {{Codeline|<nowiki>source=(http://example.com/$pkgname-$pkgver.tar.gz)</nowiki>}})<br />
<br />
{{Note|If you need to supply files which are not downloadable on the fly, e.g. self-made patches, you simply put those into the same directory where your {{Filename|PKGBUILD}} file is in and add the filename to this array. Any paths you add here are resolved relative to the directory where the {{Filename|PKGBUILD}} lies. Before the actual build process is started, all of the files referenced in this array will be downloaded or checked for existence, and {{Codeline|makepkg}} will not proceed if any are missing.}}<br />
<br />
{{Note|You can specify a different name for the downloaded file - if the downloaded file has a different name for some reason like the url had a GET parameter - using the following syntax: <filename>::<fileuri>, do not include the '<' and '>' characters}}<br />
<br />
==={{Codeline|noextract}}===<br />
<br />
An array of files listed under the {{Codeline|source}} array which should not be extracted from their archive format by {{Codeline|makepkg}}. This most commonly applies to certain zip files which cannot be handled by ''bsdtar'' because ''libarchive'' processes all files as streams rather than random access as ''unzip'' does. In these situations ''unzip'' should be added in the {{Codeline|makedepends}} array and the first line of the {{Codeline|build()}} function should contain:<br />
cd $srcdir/$pkgname-$pkgver<br />
unzip [source].zip<br />
Note that while the {{Codeline|source}} array accepts URLs, {{Codeline|noextract}} is '''just''' the filename portion. So, for example, you would do something like this (simplified from [https://projects.archlinux.org/svntogit/packages.git/tree/trunk/PKGBUILD?h=packages/grub2&id=f054e33a0b5cbdfe7d81e91a8c4c807a9bfaa124 grub2's PKGBUILD]):<br />
source=(<nowiki>"http://ftp.archlinux.org/other/grub2/grub2_extras_lua_r20.tar.xz"</nowiki>)<br />
noextract=("grub2_extras_lua_r20.tar.xz")<br />
To extract ''nothing'', you can do something fancy like this (taken from [https://projects.archlinux.org/svntogit/packages.git/tree/trunk/PKGBUILD?h=packages/firefox-i18n&id=cb10a40aeda9b444285d1ae6959c344110b4c936 firefox-i18n]):<br />
noextract=(${source[@]##*/})<br />
Note that a more conservative bash substitution would include quotes, or possibly even a loop that calls {{Codeline|basename}}. If you've read this far, you should get the idea. :)<br />
<br />
==={{Codeline|md5sums}}===<br />
<br />
An array of MD5 checksums of the files listed in the {{Codeline|source}} array. Once all files in the {{Codeline|source}} array are available, an MD5 hash of each file will be automatically generated and compared with the values of this array in the same order they appear in the {{Codeline|source}} array. While the order of the source files itself does not matter, it is important that it matches the order of this array since {{Codeline|makepkg}} cannot guess which checksum belongs to what source file. You can generate this array quickly and easily using the command {{Codeline|makepkg -g}} in the directory that contains the {{Filename|PKGBUILD}} file. Note that the MD5 algorithm is known to have weaknesses, so you should consider using a stronger alternative.<br />
<br />
==={{Codeline|sha1sums}}===<br />
<br />
An array of SHA-1 160-bit checksums. This is an alternative to md5sums described above, but is also known to have weaknesses, so you should consider using a stronger alternative. To enable use and generation of these checksums, be sure to set up the INTEGRITY_CHECK option in {{Filename|/etc/makepkg.conf}}. See man makepkg.conf.<br />
<br />
==={{Codeline|sha256sums, sha384sums, sha512sums}}===<br />
<br />
An array of SHA-2 checksums with digest sizes 256, 384 and 512 bits respectively. These are alternatives to md5sums described above and are generally believed to be stronger. To enable use and generation of these checksums, be sure to set up the INTEGRITY_CHECK option in {{Filename|/etc/makepkg.conf}}. See man makepkg.conf.<br />
<br />
==See also==<br />
*[http://pastebin.com/MeXiLDV9 Example PKGBUILD file]<br />
*[http://seberm.pastebin.com/gP0tBqvs Example .install file]<br />
*[[Creating Packages]] for more information on creating packages<br />
*[[Custom local repository]] for information on using packages after they have been created<br />
*[[Arch Packaging Standards]] for various guidelines</div>Pocmhttps://wiki.archlinux.org/index.php?title=PKGBUILD&diff=136028PKGBUILD2011-04-06T03:35:58Z<p>Pocm: /* Variables */ note that install functions are run chrooted</p>
<hr />
<div>[[Category:About Arch (English)]]<br />
[[Category:Package development (English)]]<br />
[[Category:Guidelines (English)]]<br />
{{i18n|PKGBUILD}}<br />
[[fr:PKGBUILD]]<br />
<br />
{{Article summary start}}<br />
{{Article summary text|A PKGBUILD is a script that describes how software is to be compiled and packaged. This article provides an explanation of PKGBUILD variables used when [[Creating Packages]].}}<br />
{{Article summary heading|Overview}}<br />
{{Article summary text|{{Package management overview}}}}<br />
{{Article summary heading|Related}}<br />
{{Article summary wiki|Creating Packages}}<br />
{{Article summary wiki|Custom local repository}}<br />
{{Article summary wiki|pacman Tips}}<br />
{{Article summary heading|Resources}}<br />
{{Article summary link|PKGBUILD(5) Manual Page|http://www.archlinux.org/pacman/PKGBUILD.5.html}}<br />
{{Article summary end}}<br />
<br />
A {{Filename|PKGBUILD}} is an Arch Linux package build description file used when [[Creating Packages|creating packages]]. This article describes possible {{Filename|PKGBUILD}} variables.<br />
<br />
==Building packages==<br />
<br />
Packages in Arch Linux are built using the [[makepkg]] utility and information stored in a {{Filename|PKGBUILD}} file. When {{Codeline|makepkg}} is run, it searches for a {{Filename|PKGBUILD}} in the current directory and follows the instructions therein to either compile or otherwise acquire the required files to be packaged within a package file ({{Filename|pkgname.pkg.tar.xz}}). The resulting package contains binary files and installation instructions; readily installed with [[pacman]].<br />
<br />
See:<br />
:* [[Creating Packages]] for more information on creating packages; and<br />
:* [[Custom local repository]] for information on using them after they have been created.<br />
<br />
==Variables==<br />
<br />
The following are variables that can be filled out in the {{Filename|PKGBUILD}} file:<br />
<br />
; {{Codeline|pkgname}} : The name of the package. It should consist of '''alphanumeric characters and dashes ('-')''' and all letters should be '''lowercase'''. For the sake of consistency, {{Codeline|pkgname}} should match the name of the source tarball of the software you are packaging. For instance, if the software is in {{Filename|foobar-2.5.tar.gz}}, the {{Codeline|pkgname}} value should be ''foobar''. The present working directory the {{Filename|PKGBUILD}} file is in should also match the {{Codeline|pkgname}}.<br />
<br />
; {{Codeline|pkgver}} : The version of the package. The value should be the same as the version released by the author of the package. It can contain letters, numbers and periods but '''CANNOT''' contain a hyphen. If the author of the package uses a hyphen in their version numbering scheme, replace it with an underscore. For instance, if the version is ''0.99-10'', it should be changed to ''0.99_10''. If the pkgver variable is used later in the PKGBUILD then the underscore can easily be substituted for a dash on usage e.g.:<br />
source=($pkgname-${pkgver//_/-}.tar.gz)<br />
<br />
; {{Codeline|pkgrel}} : The release number of the package specific to Arch Linux. This value allows users to differentiate between consecutive builds of the same version of a package. When a new package version is first released, the '''release number starts at 1'''. As fixes and optimizations are made to the {{Filename|PKGBUILD}} file, the package will be '''re-released''' and the '''release number''' will increment by 1. When a new version of the package comes out, the release number resets to 1.<br />
<br />
; {{Codeline|epoch}} : An integer value, specific to Arch Linux, representing what 'lifetime' to compare version numbers against. This value allows overrides of the normal version comparison rules for packages that have inconsistent version numbering, require a downgrade, change numbering schemes, etc. By default, packages are assumed to have an epoch value of ''0''. Do not use this unless you know what you are doing.<br />
<br />
; {{Codeline|pkgdesc}} : The description of the package. The description should be about 80 characters or less and should not include the package name in a self-referencing way. For instance, "Nedit is a text editor for X11" should be written as "A text editor for X11."<br />
<br />
; {{Codeline|arch}} : An array of architectures that the {{Filename|PKGBUILD}} file is known to build and work on. Currently, it should contain '''i686''' and/or '''x86_64''', {{Codeline|<nowiki>arch=('i686' 'x86_64')</nowiki>}}. The value '''any''' can also be used for architechture-independent packages. You can access this value with the variable {{Codeline|$CARCH}} during the build.<br />
<br />
; {{Codeline|url}} : The URL of the official site of the software being packaged.<br />
<br />
; {{Codeline|license}} : The license under which the software is distributed. A {{Package Official|licenses}} package has been created in {{Codeline|[core]}} that stores common licenses in {{Filename|/usr/share/licenses/common}}, i.e. {{Filename|/usr/share/licenses/common/GPL}}. If a package is licensed under one of these licenses, the value should be set to the directory name, e.g. {{Codeline|<nowiki>license=('GPL')</nowiki>}}. If the appropriate license is not included in the official {{Package Official|licenses}} package, several things must be done:<br />
:# The license file(s) should be included in: {{Filename|/usr/share/licenses/'''pkgname'''/}}, e.g. {{Filename|/usr/share/licenses/foobar/LICENSE}}.<br />
:# If the source tarball does '''NOT''' contain the license details and the license is only displayed elsewhere, e.g. a website, then you need to copy the license to a file and include it.<br />
:# Add '''custom''' to the {{Codeline|license}} array. Optionally, you can replace '''custom''' with '''custom:name of license'''. Once a license is used in two or more packages in an official repository (including {{Codeline|[community]}}), it becomes a part of the {{Package Official|licenses}} package.<br />
:* The [[Wikipedia:BSD License|BSD]], [[Wikipedia:MIT License|MIT]], [[Wikipedia:ZLIB license|zlib/png]] and [[Wikipedia:Python License|Python]] licenses are special cases and could not be included in the {{Package Official|licenses}} package. For the sake of the {{Codeline|license}} array, it is treated as a common license ({{Codeline|<nowiki>license=('BSD')</nowiki>}}, {{Codeline|<nowiki>license=('MIT')</nowiki>}}, {{Codeline|<nowiki>license=('ZLIB')</nowiki>}} and {{Codeline|<nowiki>license=('Python')</nowiki>}}) but technically each one is a custom license because each one has its own copyright line. Any packages licensed under these four should have its own unique license stored in {{Filename|/usr/share/licenses/'''pkgname'''}}. Some packages may not be covered by a single license. In these cases, multiple entries may be made in the license array, e.g. {{Codeline|<nowiki>license=('GPL' 'custom:name of license')</nowiki>}}.<br />
:* Additionally, the (L)GPL has many versions and permutations of those versions. For (L)GPL software, the convention is:<br />
:** (L)GPL - (L)GPLv2 or any later version<br />
:** (L)GPL2 - (L)GPL2 only<br />
:** (L)GPL3 - (L)GPL3 or any later version<br />
<br />
; {{Codeline|groups}} : The group the package belongs in. For instance, when you install the {{Package Official|kdebase}} package, it installs all packages that belong in the ''kde'' group.<br />
<br />
; {{Codeline|depends}} : An array of package names that must be installed before this software can be run. If a software requires a minimum version of a dependency, the '''>=''' operator should be used to point this out, e.g. {{Codeline|<nowiki>depends=('foobar>=1.8.0')</nowiki>}}. You do not need to list packages that your software depends on if other packages your software depends on already have those packages listed in their dependency. For instance, ''gtk2'' depends on ''glib2'' and ''glibc''. However, ''glibc'' does not need to be listed as a dependency for ''gtk2'' because it is a dependency for ''glib2''.<br />
<br />
; {{Codeline|makedepends}} : An array of package names that must be installed to build the software but unnecessary for using the software after installation. You can specify the minimum version dependency of the packages in the same format as the {{Codeline|depends}} array.<br />
<br />
: {{Warning| The group "base-devel" is assumed already installed when building with makepkg . Members of "base-devel" '''should not''' be included in makedepends arrays.}}<br />
<br />
; {{Codeline|optdepends}} : An array of package names that are not needed for the software to function but provides additional features. A short description of what each package provides should also be noted. An {{Codeline|optdepends}} may look like this:<br />
optdepends=('cups: printing support'<br />
'sane: scanners support'<br />
'libgphoto2: digital cameras support'<br />
'alsa-lib: sound support'<br />
'giflib: GIF images support'<br />
'libjpeg: JPEG images support'<br />
'libpng: PNG images support')<br />
<br />
; {{Codeline|provides}} : An array of package names that this package provides the features of (or a virtual package such as ''cron'' or ''sh''). If you use this variable, you should add the version ({{Codeline|pkgver}} and perhaps the {{Codeline|pkgrel}}) that this package will provide if dependencies may be affected by it. For instance, if you are providing a modified ''qt'' package named ''qt-foobar'' version 3.3.8 which provides ''qt'' then the {{Codeline|provides}} array should look like {{Codeline|<nowiki>provides=('qt=3.3.8')</nowiki>}}. Putting {{Codeline|<nowiki>provides=('qt')</nowiki>}} will cause to fail those dependencies that require a specific version of ''qt''. Do not add {{Codeline|pkgname}} to your provides array, this is done automatically.<br />
<br />
; {{Codeline|conflicts}} : An array of package names that may cause problems with this package if installed. You can also specify the version properties of the conflicting packages in the same format as the {{Codeline|depends}} array.<br />
<br />
; {{Codeline|replaces}} : An array of obsolete package names that are replaced by this package, e.g. {{Codeline|<nowiki>replaces=('ethereal')</nowiki>}} for the {{Package Official|wireshark}} package. After syncing with {{Codeline|pacman -Sy}}, it will immediately replace an installed package upon encountering another package with the matching {{Codeline|replaces}} in the repositories. If you are providing an alternate version of an already existing package, use the {{Codeline|conflicts}} variable which is only evaluated when actually installing the conflicting package.<br />
<br />
; {{Codeline|backup}} : An array of files to be backed up as {{Filename|file.pacsave}} when the package is removed. This is commonly used for packages placing configuration files in {{Filename|/etc}}. The file paths in this array should be relative paths (e.g. {{Filename|etc/pacman.conf}}) not absolute paths (e.g. {{Filename|/etc/pacman.conf}}).<br />
<br />
; {{Codeline|options}} : This array allows you to override some of the default behavior of {{Codeline|makepkg}}. To set an option, include the option name in the array. To reverse the default behavior, place an '''!''' at the front of the option. The following options may be placed in the array:<br />
:* '''''strip''''' - Strips symbols from binaries and libraries.<br />
:* '''''docs''''' - Save {{Filename|/doc}} directories.<br />
:* '''''libtool''''' - Leave ''libtool'' ({{Filename|.la}}) files in packages.<br />
:* '''''emptydirs''''' - Leave empty directories in packages.<br />
:* '''''zipman''''' - Compress ''man'' and ''info'' pages with ''gzip''.<br />
:* '''''ccache''''' - Allow the use of {{Codeline|ccache}} during build. More useful in its negative form {{Codeline|!ccache}} with select packages that have problems building with {{Codeline|ccache}}.<br />
:* '''''distcc''''' - Allow the use of {{Codeline|distcc}} during build. More useful in its negative form {{Codeline|!distcc}} with select packages that have problems building with {{Codeline|distcc}}.<br />
:* '''''makeflags''''' - Allow the use of user-specific {{Codeline|makeflags}} during build. More useful in its negative form {{Codeline|!makeflags}} with select packages that have problems building with custom {{Codeline|makeflags}}.<br />
<br />
; {{Codeline|install}} : The name of the {{Filename|.install}} script to be included in the package. ''pacman'' has the ability to store and execute a package-specific script when it installs, removes or upgrades a package. The script contains the following functions which run at different times:<br />
:* '''''pre_install''''' - The script is run right before files are extracted. One argument is passed: new package version.<br />
:* '''''post_install''''' - The script is run right after files are extracted. One argument is passed: new package version.<br />
:* '''''pre_upgrade''''' - The script is run right before files are extracted. Two arguments are passed in the following order: new package version, old package version.<br />
:* '''''post_upgrade''''' - The script is run after files are extracted. Two arguments are passed in the following order: new package version, old package version.<br />
:* '''''pre_remove''''' - The script is run right before files are removed. One argument is passed: old package version.<br />
:* '''''post_remove''''' - The script is run right after files are removed. One argument is passed: old package version.<br />
<br />
: Each function is run chrooted inside the pacman install directory. See [https://bbs.archlinux.org/viewtopic.php?pid=913891 this thread].<br />
<br />
: {{Tip|A prototype {{Filename|.install}} is provided at {{Filename|/usr/share/pacman/proto.install}}.}}<br />
<br />
; {{Codeline|source}} : An array of files which are needed to build the package. It must contain the location of the software source, which in most cases is a full HTTP or FTP URL. The previously set variables {{Codeline|pkgname}} and {{Codeline|pkgver}} can be used effectively here (e.g. {{Codeline|<nowiki>source=(http://example.com/$pkgname-$pkgver.tar.gz)</nowiki>}})<br />
<br />
: {{Note|If you need to supply files which are not downloadable on the fly, e.g. self-made patches, you simply put those into the same directory where your {{Filename|PKGBUILD}} file is in and add the filename to this array. Any paths you add here are resolved relative to the directory where the {{Filename|PKGBUILD}} lies. Before the actual build process is started, all of the files referenced in this array will be downloaded or checked for existence, and {{Codeline|makepkg}} will not proceed if any are missing.}}<br />
<br />
: {{Note|You can specify a different name for the downloaded file - if the downloaded file has a different name for some reason like the url had a GET parameter - using the following syntax: <filename>::<fileuri>, do not include the '<' and '>' characters}}<br />
<br />
; {{Codeline|noextract}} : An array of files listed under the {{Codeline|source}} array which should not be extracted from their archive format by {{Codeline|makepkg}}. This most commonly applies to certain zip files which cannot be handled by ''bsdtar'' because ''libarchive'' processes all files as streams rather than random access as ''unzip'' does. In these situations ''unzip'' should be added in the {{Codeline|makedepends}} array and the first line of the {{Codeline|build()}} function should contain:<br />
cd $srcdir/$pkgname-$pkgver<br />
unzip [source].zip<br />
<br />
; {{Codeline|md5sums}} : An array of MD5 checksums of the files listed in the {{Codeline|source}} array. Once all files in the {{Codeline|source}} array are available, an MD5 hash of each file will be automatically generated and compared with the values of this array in the same order they appear in the {{Codeline|source}} array. While the order of the source files itself does not matter, it is important that it matches the order of this array since {{Codeline|makepkg}} cannot guess which checksum belongs to what source file. You can generate this array quickly and easily using the command {{Codeline|makepkg -g}} in the directory that contains the {{Filename|PKGBUILD}} file. Note that the MD5 algorithm is known to have weaknesses, so you should consider using a stronger alternative.<br />
<br />
; {{Codeline|sha1sums}} : An array of SHA-1 160-bit checksums. This is an alternative to md5sums described above, but is also known to have weaknesses, so you should consider using a stronger alternative. To enable use and generation of these checksums, be sure to set up the INTEGRITY_CHECK option in makepkg.conf. See man makepkg.conf.<br />
<br />
; {{Codeline|sha256sums, sha384sums, sha512sums}} : An array of SHA-2 checksums with digest sizes 256, 384 and 512 bits respectively. These are alternatives to md5sums described above and are generally believed to be stronger. To enable use and generation of these checksums, be sure to set up the INTEGRITY_CHECK option in makepkg.conf. See man makepkg.conf.<br />
<br />
It is common practice to preserve the order of the {{Filename|PKGBUILD}} variables as shown above. However, this is not mandatory, as the only requirement in this context is correct [[Wikipedia:Bash|Bash]] syntax.<br />
<br />
==See also==<br />
*[http://pastebin.com/MeXiLDV9 Example PKGBUILD file]<br />
*[http://seberm.pastebin.com/gP0tBqvs Example .install file]</div>Pocmhttps://wiki.archlinux.org/index.php?title=Xfce&diff=135249Xfce2011-03-29T00:14:08Z<p>Pocm: section on cursors</p>
<hr />
<div>[[Category:Desktop environments (English)]]<br />
[[Category:HOWTOs (English)]]<br />
{{i18n|Xfce}}<br />
[[pl:XFCE]]<br />
[[de:Xfce]]<br />
<br />
{{Article summary start}}<br />
{{Article summary text|Xfce is a lightweight desktop environment for Unix-like operating systems. It aims to be fast and lightweight, while still being visually appealing and user friendly. This article covers its installation, configuration, and troubleshooting.}}<br />
{{Article summary text|Xfce uses the [[GTK+]] toolkit.}}<br />
{{Article summary heading|Overview}}<br />
{{Article summary text|{{Graphical user interface overview}}}}<br />
{{Article summary end}}<br />
<br />
From [http://www.xfce.org/about/ Xfce - About]:<br />
<br />
:''Xfce embodies the traditional UNIX philosophy of modularity and re-usability. It consists of a number of components that provide the full functionality one can expect of a modern desktop environment. They are packaged separately and you can pick among the available packages to create the optimal personal working environment.''<br />
<br />
== What is Xfce? ==<br />
Xfce is a Desktop Environment, like GNOME or KDE. It contains a suite of apps like a root window app, window manager, file manager, panel, etc. Xfce is written using the GTK2 toolkit, and contains its own development environment (libraries, daemons, etc), similar to other big DEs. Unlike GNOME or KDE, Xfce is lightweight and designed more around [http://www.opengroup.org/cde/ CDE] than Windows or Mac. It has a much slower development cycle, but is very stable and extremely fast. Xfce is great for older hardware.<br />
<br />
== Why use Xfce? ==<br />
Here is a (subjective) list of reasons to use Xfce:<br />
* It's fast; faster than the other major DEs.<br />
* It's stable. In the long time Xfce-4 has been out, only a relatively small handful of bugs has been discovered, despite it having a rather large following.<br />
* It's pretty. It uses GTK2 and is themable. You can make Xfce look very nice. The fonts are completely AA as well.<br />
* It works great with multiple monitors. Xfce's [[Wikipedia:Xinerama|Xinerama]] support is arguably the best out of any WM/DE.<br />
* It doesn't get in your way. You'll find Xfce helps your work flow, rather than always making itself "present."<br />
* It comes with a built-in compositor which allows for true transparency, among other cool things.<br />
<br />
== Why not use Xfce? ==<br />
Here is a (subjective) list of reasons not to use Xfce:<br />
* Doesn't contain all the features and integration of the major DEs.<br />
* Slower development cycle.<br />
* Because it's based on the CDE design, the layout may not be as familiar.<br />
<br />
== How to Install Xfce ==<br />
Xfce is somewhat modular. That means there is no need for you to run every part, you can pick and choose some of them. Because of this, Xfce has some separate Arch packages.<br />
<br />
=====Installing Xfce=====<br />
Make sure that the [[Xorg]] is installed and working correctly before proceeding.<br />
<br />
To install the base Xfce system, run:<br />
<br />
# pacman -S xfce4<br />
<br />
Pacman will ask you to select the packages to install, you probably want to get them all by simply pressing enter.<br />
<br />
{{Note |Or you can install only a few needed '''core packages''':<br />
<br />
# pacman -S xfwm4 xfce4-panel xfdesktop thunar xfce4-session xfce4-settings xfce4-appfinder xfce-utils xfconf<br />
<br />
}}<br />
<br />
If you want extras, like panel plugins, run this:<br />
<br />
# pacman -S xfce4-goodies<br />
<br />
Like before, pacman will ask you which packages you want to install.<br />
<br />
{{Note |'''xfce4-xfapplet-plugin''' (a plugin that allows the use of GNOME applets in the Xfce4 panel) is part of the '''xfce4-goodies''' group and depends on '''gnome-panel''', which in turn depends on '''gnome-desktop'''. You may wish to take this into consideration before installing, since it represents a significant number of extra dependencies.}}<br />
<br />
If you don't want xfce4-xfapplet-plugin, you can install xfce4-goodies this way:<br />
<br />
# pacman -S $(pacman -Sgq xfce4-goodies | grep -v xfce4-xfapplet-plugin)<br />
<br />
If you wish to admire 'Tips and Tricks' on login, install the fortune-mod package:<br />
<br />
# pacman -S fortune-mod<br />
<br />
In order to get the xfce4-mixer to work with alsa, you need to install gstreamer0.10-base-plugins. (See below for help with OSS.)<br />
<br />
# pacman -S gstreamer0.10-base-plugins<br />
<br />
=====Installing and configuring the Daemons=====<br />
Install dbus:<br />
# pacman -S dbus<br />
<br />
To start automatically on boot, you should add <tt>dbus</tt> to your DAEMONS array in {{filename|/etc/rc.conf}}:<br />
<br />
DAEMONS=(syslog-ng '''dbus''' network crond)<br />
<br />
If you need to start dbus without rebooting, run<br />
# /etc/rc.d/dbus start<br />
<br />
Install gamin (the successor of fam). It is configured to automatically run in the background by default, do not add it to rc.conf.<br />
<br />
# pacman -S gamin<br />
<br />
== Running Xfce ==<br />
<br />
=====Automatically at boot time=====<br />
See [[Display Manager]] to install and configure a Display Manager.<br />
<br />
=====Manually=====<br />
<br />
You can execute:<br />
$ startxfce4<br />
from the console, or configure xinitrc and use xinit or startx.<br />
<br />
If you have not created a ~/.xinitrc yet, do so with:<br />
<br />
$ cp /etc/skel/.xinitrc ~/.xinitrc<br />
<br />
and add the following line:<br />
<br />
exec ck-launch-session startxfce4<br />
<br />
Example:<br />
#!/bin/sh<br />
#<br />
# ~/.xinitrc<br />
#<br />
# Executed by startx (run your window manager from here)<br />
<br />
# exec gnome-session<br />
# exec startkde<br />
# exec startxfce4<br />
# ...or the Window Manager of your choice<br />
exec ck-launch-session startxfce4<br />
<br />
{{{Note |<code>ck-launch-session</code> starts a clean consolekit session needed by Xfce for power management, automounting, shutting down/rebooting etc. Consolekit/policykit capable display managers such as gdm do this for you automatically.}}}<br />
<br />
=====Shutting down and rebooting from withing Xfce=====<br />
* Make sure that '''dbus''' is enabled in the DAEMONS array in /etc/rc.conf.<br />
* Make sure you are a member of the ''power'' group.<br />
* Make sure that you are using <code>exec ck-launch-session startxfce4</code> in ~/.xinitrc or a consolekit/policykit capable display manager (e.g. gdm)<br />
<br />
== Tips ==<br />
=== Panel ===<br />
==== How to customize xfce panel background ====<br />
The same, edit ~/.gtkrc-2.0. ( foo.bar is path to your image )<br />
Note that you must place the image in the same directory as the configuration, which is ~/. You can not specify the path to the image, or it won't work.<br />
style "panel-background" {<br />
bg_pixmap[NORMAL] = "foo.bar"<br />
bg_pixmap[PRELIGHT] = "foo.bar"<br />
bg_pixmap[ACTIVE] = "foo.bar"<br />
bg_pixmap[SELECTED] = "foo.bar"<br />
bg_pixmap[INSENSITIVE] = "foo.bar"<br />
}<br />
widget_class "*Panel*" style "panel-background"<br />
<br />
==== Replacements for the default 'menu' panel applet ====<br />
The "Ubuntu System Panel" (Gnome) panel applet has similar features to those found in its KDE v4.2 equivalent. It can be added to an Xfce panel via the 'XfApplet' panel applet, which allows Gnome applets to be used in Xfce.<br />
<br />
It is available in [http://aur.archlinux.org/packages.php?ID=10259 the AUR]<br />
<br />
==== How to remove menu entries from the System menu ==== <br />
With the built-in menu editor, you cannot remove menu entries from the System menu. Here’s how to hide them:<br />
# Go to the /usr/share/applications folder. Type in the terminal (Xfce menu > System > Terminal): <pre>$ cd /usr/share/applications</pre><br />
# This folder should be full of .desktop files. To see how many there are, type: <pre>$ ls</pre>Say the one you want to edit is Firefox. Type in the terminal:<pre>$ sudo mousepad firefox.desktop</pre><br />
# In the bottom of the file, paste the following: <pre>NoDisplay=true</pre><br />
# Save and exit. Now Firefox won’t show up in the System menu. You can do this with any program.<br />
<br />
<br />
Another method is to copy the entire contents of the global applications directory over to your local applications directory, and then proceed to modify and/or disable unwanted .desktop entries. This will survive application updates that overwrite changes under /usr/share/applications/.<br />
# In a terminal, copy everything from /usr/share/applications to ~/.local/share/applications/: <pre>$ cp /usr/share/applications/* ~/.local/share/applications/</pre><br />
# For any entry you wish to hide from the menu, add the NoDisplay=true option: <pre>$ echo "NoDisplay=true" >> ~/.local/share/applications/foo.desktop</pre><br />
<br />
You can also edit the application's category by editing the .desktop file with a text editor and modifying the Categories= line.<br />
<br />
==== But what do you do with menu entries which do not show up in /usr/share/applications (e.g., apps installed via wine)? ==== <br />
I've found some shortcuts that show in the category “Other” in this directory:<br />
~/.local/share/applications/wine/.<br />
<br />
=== Desktop ===<br />
==== Why doesn't my desktop refresh? ====<br />
Xfce 4.6 uses [[FAM]] (File Alteration Monitor) or [[gamin]] (FAM's successor) to get notification when a file or directory changes.<br />
If you decide to use FAM, don't forget to add 'fam' to the list of DAEMONS in /etc/rc.conf.<br />
This step is not necessary for gamin.<br />
<br />
NOTE: After recent updates, FAM has caused issues opening some mounts, such as sshfs, that gamin does not have an issue with.<br />
<br />
==== Use a transparent background for desktop icon titles ====<br />
To change the default white background of desktop icon titles to something more suitable, edit the .gtkrc-2.0 file in your home directory (or create the file if needed) and add the following:<br />
style "xfdesktop-icon-view" {<br />
XfdesktopIconView::label-alpha = 10<br />
base[NORMAL] = "#000000"<br />
base[SELECTED] = "#71B9FF"<br />
base[ACTIVE] = "#71FFAD"<br />
fg[NORMAL] = "#ffffff"<br />
fg[SELECTED] = "#71B9FF"<br />
fg[ACTIVE] = "#71FFAD" }<br />
widget_class "*XfdesktopIconView*" style "xfdesktop-icon-view"<br />
<br />
==== Hide selected partitions on the desktop ====<br />
If you wish to prevent certain partitions or drives appearing on the desktop, you can create a udev rule, for example {{filename|/etc/udev/rules.d/10-local.rules}}:<br />
<br />
KERNEL=="sda1", ENV{UDISKS_PRESENTATION_HIDE}="1"<br />
KERNEL=="sda2", ENV{UDISKS_PRESENTATION_HIDE}="1"<br />
<br />
Would show all partitions with the exception of sda1 and sda2 on your desktop.<br />
<br />
==== Switch to old desktop right click menu without Thunar things ====<br />
xfconf-query -c xfce4-desktop -v --create -p /desktop-icons/style -t int -s 0<br />
<br />
=== App suggestions ===<br />
==== A drop down console like in quake ====<br />
<br />
# pacman -S tilda<br />
<br />
will install tilda, a drop down console, similar to yakuake. A more lightweight alternative would be '''stjerm''' which can be found in the AUR.<br />
<br />
To configure tilda, type<br />
<br />
# tilda -C<br />
<br />
which opens a configuration window in X.<br />
<br />
====Guake====<br />
Another functional alternative is guake, which is available in the community repo:<br />
<br />
# pacman -S guake<br />
<br />
=== XFWM4 ===<br />
==== How to enable the compositor in Xfce 4.6 ====<br />
Xfce 4.6 comes with a builtin compositor adding the option for fancy window effects, shadows and transparency and so on. It can be enabled in the Window Manager Tweaks and works on the fly. No additional settings are needed in your /etc/xorg.conf. To enable and adjust settings, go to:<br />
<br />
Menu --> Settings --> Window Manager Tweaks<br />
<br />
==== Persistent window placement per-app ====<br />
<br />
=== Commands for the settings manager ===<br />
<br />
There is no official documentation for the commands executed. One must look at .desktop files ''/usr/share/applications/'' folder. For the people who like to know exactly what is happening, here is a handy list to save the effort:<br />
<br />
xfce-setting-show backdrop<br />
xfce-setting-show display<br />
xfce-setting-show keyboard<br />
xfce4-menueditor<br />
xfce-setting-show sound<br />
xfce-setting-show mouse<br />
xfce-setting-show session<br />
xfce-setting-show<br />
xfce-setting-show splash<br />
xfce-setting-show ui<br />
xfce-setting-show xfwm4<br />
xfce-setting-show wmtweaks<br />
xfce-setting-show workspaces<br />
xfce-setting-show printing_system<br />
xfce4-appfinder<br />
xfce4-autostart-editor<br />
xfce4-panel -c<br />
<br />
To review all the available setting manager commands run the following in a terminal:<br />
<br />
$ grep xfce-setting-show /usr/share/applications/xfce*settings*<br />
<br />
=== Session ===<br />
==== Customizing Startup Applications ====<br />
<br />
This includes getting necessary environment variables into the GUI runtime.<br />
<br />
* Copy the file /etc/xdg/xfce4/xinitrc to ~/.config/xfce4/<br />
* Edit this file. For example, you can add something like this somehwere in the middle:<br />
source $HOME/.bashrc<br />
# start rxvt-unicode server<br />
urxvtd -q -o -f<br />
<br />
==== Switch between users ====<br />
<br />
It is possible to switch between X sessions thanks to [http://goodies.xfce.org/projects/panel-plugins/xfswitch-plugin xfswitch-plugin ]. It adds an icon to the Xfce panel, and requires gdm to work at the moment.<br />
<br />
xfswitch-plugin is available through [http://aur.archlinux.org/packages.php?ID=40677 AUR ]<br />
<br />
==== Modify XML settings files directly ====<br />
It may be useful, especially when upgrading, to manually edit .xml files in the ~/.config/xfce4/xfconf/ folder. For application keyboard shortcuts for example, the file is ~/.config/xfce4/xfconf/xfce-perchannel-xml/xfce4-keyboard-shortcuts.xml. It's faster to copy and paste the XML keys that you want rather than using the GUI.<br />
<br />
<br />
=== How to add themes to XFCE === <br />
<br />
1. Go to [http://xfce-look.org xfce-look.org] and click "Themes" in the left navbar. Look around for a theme you want and click "Download".<br />
<br />
2. Go to the directory where you downloaded the tarball/file and extract it using Squeeze/Xarchiver/CLI.<br />
<br />
3. Move the extracted folder to /usr/share/themes (for all users) or ~/.themes (for just you). Inside /usr/share/themes/abc, there is a folder that you create called xfwm4 that will contain whatever files that is included with that theme.<br />
<br />
4. GTK theme is available here:<br />
Menu --> Settings --> Appearance<br />
You select your xfwm theme in:<br />
Menu --> Settings --> Window Manager<br />
<br />
=== Cursors ===<br />
<br />
By default, X uses a plain black cursor. If you have alternative X cursor themes installed, Xfce can find them with:<br />
Menu --> Settings --> Mouse --> Theme<br />
<br />
To install new cursor themes, install {{Package Official|xcursor-themes}} or another {{Package Official|xcursor}} package, or see [[X11 Cursors]].<br />
<br />
=== Fonts ===<br />
<br />
If you find the standard fonts rather thick and or slightly out of focus open Settings>Appearence click on the Fonts tab and under Hinting: change to Full<br />
<br />
You could also try using a custom DPI setting.<br />
<br />
=== Sound ===<br />
<br />
==== How do I get xfce4-mixer and OSS4 to work together? ====<br />
<br />
Xfce 4.6 uses gstreamer as the backend to control volume, so first you have to make gstreamer cooperate with xfce4-mixer.<br />
<br />
pacman -S xfce4-mixer gstreamer0.10-base-plugins<br />
<br />
(Optional) Second, try to install gstreamer0.10-good-plugins, gstreamer0.10-bad-plugins<br />
<br />
pacman -S gstreamer0.10-good-plugins gstreamer0.10-bad-plugins<br />
<br />
login and logout, or just remove the mixer plugin and add it again. If it doesn't work at all, then you have to compile gstreamer0.10-good-plugins yourself. and can <br />
<br />
Download the PKGBUILD and other files needed from ABS or [http://repos.archlinux.org/viewvc.cgi/gstreamer0.10-good-plugins/repos/extra-i686/ here], edit the PKGBUILD, add --enable-oss. <br />
<br />
./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var '''--enable-oss'''\<br />
--disable-static --enable-experimental \<br />
--enable-ladspa \<br />
--with-package-name="GStreamer Good Plugins (Arch Linux)" \<br />
--with-package-origin="http://www.archlinux.org/" || return 1<br />
<br />
and then run makepkg -i. <br />
<br />
makepkg -i<br />
<br />
Still not working? Try tis package in AUR [http://aur.archlinux.org/packages.php?ID=17024 gstreamer0.10-good-plugins-ossv4], modify the pkgver to the newest in the PKGBUILD, and it should work.<br />
<br />
Other LINKS: [http://www.4front-tech.com/forum/ OSS forum]<br />
<br />
==== Change volume with keyboard volume buttons ====<br />
<br />
Go to <br />
Settings --> Keyboard<br />
Click the "Application Shortcuts" tab and add click the "Add" button. Add the following by entering the command, then pressing the corresponding button at the next window:<br />
<br />
===== ALSA =====<br />
For the raise volume button:<br />
amixer set Master 5%+<br />
For the lower volume button:<br />
amixer set Master 5%-<br />
For the mute button:<br />
amixer set Master toggle<br />
<br />
You can also run these commands to set the above commands to the standard XF86Audio keys:<br />
xfconf-query -c xfce4-keyboard-shortcuts -p /commands/custom/XF86AudioRaiseVolume -n -t string -s "amixer set Master 5%+"<br />
xfconf-query -c xfce4-keyboard-shortcuts -p /commands/custom/XF86AudioLowerVolume -n -t string -s "amixer set Master 5%-"<br />
xfconf-query -c xfce4-keyboard-shortcuts -p /commands/custom/XF86AudioMute -n -t string -s "amixer set Master toggle"<br />
<br />
If {{codeline|amixer set Master toggle}} does not work, try the PCM channel ({{codeline|amixer set PCM toggle}}) instead.<br />
<br />
The channel must have a "mute" option for the toggle command to work. To check whether or not your Master channel supports toggling mute, run {{codeline|alsamixer}} in a terminal and look for the double M's (MM) under the Master channel. If they are not present, then it does not support the mute option. If, for example, you had to change the toggle button to use the PCM channel, make sure to also set the PCM channel as the Mixer Track under Xfce Mixer properties.<br />
<br />
===== OSS =====<br />
Use one of these scripts:<br />
[http://www.opensound.com/wiki/index.php/Tips_And_Tricks#Using_multimedia_keys_with_OSS<br />
]<br />
<br />
If using ossvol (recommended), add:<br />
ossvol -i 1<br />
for the volume up button<br />
ossvol -d 1<br />
for the volume down button<br />
ossvol -t<br />
for the mute/unmute button<br />
<br />
<br />
=== Screenshots ===<br />
<br />
==== Using print-screen key ====<br />
<br />
A simple way is to use a command-line screenshot utility:<br />
<br />
# pacman -S scrot<br />
<br />
Then<br />
<br />
XFCE Menu --> Settings --> Keyboard >>> Application Shortcuts.<br />
<br />
Add the "scrot" command to use the "PrintScreen" key.<br />
<br />
All screenshots will be placed in your home folder with unique names like<br />
<br />
"2009-02-19-063052_1280x1024_scrot.png".<br />
<br />
====Screenshooter====<br />
<br />
There is also an a screenshot plugin for the Xfce panel, which can be used instead of scrot, that is available in extra:<br />
<br />
# pacman -S xfce4-screenshooter<br />
<br />
You can add a keyboard binding for it using the command<br />
<br />
xfce4-screenshooter -f<br />
<br />
instead of "scrot". You'll get a dialog window after pressing "Print" where you can copy the image to the clipboard or save it.<br />
<br />
=== Change mount options ===<br />
<br />
A common problem when automounting USB sticks formatted with fat filesystem is the inability to properly show characters as umlauts, ñ, ß, etc. This may be solved changing the default iocharset to utf8, which is easily done adding a line to '''/etc/xdg/xfce4/mount.rc''':<br />
<br />
[vfat]<br />
uid=<auto><br />
shortname=winnt<br />
'''utf8=true'''<br />
# FreeBSD specific option<br />
longnames=true<br />
<br />
Note that when using utf-8, the system will distinct between upper- and lowercases, potentially corrupting your files. Be careful.<br />
<br />
It is also recommendable to mount vfat devices with the '''flush''' option, so that when copying to usb sticks data flushes more often, thus making thunar's progress bar to stays up until things are on the disk.<br />
<br />
[vfat]<br />
flush=true<br />
<br />
====Removable Devices====<br />
<br />
If you want a icon appearing on your desktop and in thunar when you plug in external devices, make sure gvfs is installed<br />
<br />
# pacman -S gvfs<br />
<br />
It is also a good idea to install thunar-volman<br />
<br />
# pacman -S thunar-volman<br />
<br />
== Troubleshooting ==<br />
=== Keyboard shortcuts aren't working ===<br />
Under Xfce 4.6 there is a problem where the user's [http://bugzilla.xfce.org/show_bug.cgi?id=5639 keyboard shortcuts will intermittently not work]. This is usually the case when the settings helper is either not running or has been started improperly due to a conflict. This bug has been fixed in Xfce 4.8, which replaced 4.6 in the main repositories.<br />
<br />
A workaround is to disable ''xfce4-settings-helper-autostart'' from autostarting in a user's session. The settings helper daemon will start upon loading an Xfce session, anyways. The following two steps seem to have resolved this issue.<br />
<br />
Remove or rename the global autostart .desktop file:<br />
mv /etc/xdg/autostart/xfce4-settings-helper-autostart.desktop /etc/xdg/autostart/xfce4-settings-helper-autostart.desktop.disabled<br />
<br />
Remove or rename the local autostart .desktop file:<br />
mv ~/.config/autostart/xfce4-settings-helper-autostart.desktop ~/.config/autostart/xfce4-settings-helper-autostart.desktop.disabled<br />
<br />
After logging out and logging back in, your shortcut keys should be working fine now.<br />
<br />
=== Restore default settings ===<br />
If for any reason you need to revert back to the default settings, try renaming ~/.config/xfce4-session/ and ~/.config/xfce4/<br />
<br />
$ mv ~/.config/xfce4-session/ ~/.config/xfce4-session-bak<br />
$ mv ~/.config/xfce4/ ~/.config/xfce4-bak<br />
<br />
Logout and login for changes to take effect.<br />
<br />
== Xfce 4.8 ==<br />
<br />
=== Start Xfce ===<br />
Use this command in .xinitrc to launch Xfce<br />
exec ck-launch-session startxfce4<br />
<br />
=== Thunar - Removable devices ===<br />
Make sure dbus is running: /etc/rc.d/dbus start<br />
Create the file /etc/polkit-1/localauthority/50-local.d/org.freedesktop.udisks.pkla and add yourself into the ''storage'' group<br />
[Local Users]<br />
Identity=unix-group:storage<br />
Action=org.freedesktop.udisks.*<br />
ResultAny=yes<br />
ResultInactive=no<br />
ResultActive=yes<br />
The changes doesn't need any restart or reload.<br />
Please note that this is a temporary solution as Ionut and other core dev prefer to fix the pam + ck issues<br />
<br />
=== Reboot/Shutdown ===<br />
Create the file /etc/polkit-1/localauthority/50-local.d/org.freedesktop.consolekit.pkla and add yourself into the ''power'' group<br />
[Local restart]<br />
Identity=unix-group:power<br />
Action=org.freedesktop.consolekit.system.restart<br />
ResultAny=yes<br />
ResultInactive=no<br />
ResultActive=yes<br />
<br />
[Local shutdown]<br />
Identity=unix-group:power<br />
Action=org.freedesktop.consolekit.system.stop<br />
ResultAny=yes<br />
ResultInactive=no<br />
ResultActive=yes<br />
<br />
[Local restart - multiple]<br />
Identity=unix-group:power<br />
Action=org.freedesktop.consolekit.system.restart-multiple-users<br />
ResultAny=yes<br />
ResultInactive=no<br />
ResultActive=yes<br />
<br />
[Local shutdown - multiple]<br />
Identity=unix-group:power<br />
Action=org.freedesktop.consolekit.system.stop-multiple-users<br />
ResultAny=yes<br />
ResultInactive=no<br />
ResultActive=yes<br />
Now, some rules can be changed as if the ''Local * - multiple'' are redundant with the ''Local *''<br />
The changes doesn't need any restart or reload.<br />
Please note that this is a temporary solution as Ionut and other core dev prefer to fix the pam + ck issues<br />
<br />
=== Suspend/Hibernate ===<br />
Create the file /etc/polkit-1/localauthority/50-local.d/org.freedesktop.upower.pkla and add yourself into the ''power'' group<br />
[Local Users]<br />
Identity=unix-group:power<br />
Action=org.freedesktop.upower.*<br />
ResultAny=yes<br />
ResultInactive=no<br />
ResultActive=yes<br />
The changes doesn't need any restart or reload.<br />
Please note that this is a temporary solution as Ionut and other core dev prefer to fix the pam + ck issues<br />
<br />
=== Forum related thread ===<br />
https://bbs.archlinux.org/viewtopic.php?pid=851985#p851985<br />
<br />
== Related Articles ==<br />
* [[Thunar]]<br />
* [[Build order for XFCE]]<br />
* [[Improve GTK Application Looks]]<br />
* [[Autostart applications#Graphical]]<br />
<br />
== External Resources ==<br />
* [http://www.us.xfce.org/documentation/ Xfce.org] - The complete documentation.<br />
* [http://www.xfce-look.org/ Xfce-Look] - Themes, wallpapers, and more.<br />
* [http://xfce.wikia.com/wiki/Frequently_Asked_Questions Xfce Wikia] - How to edit the auto generated menu with the menu editor<br />
* [http://wiki.xfce.org Xfce Wiki]<br />
* [https://xubuntu.wordpress.com/2006/08/04/howto-remove-menu-entries-from-the-system-menu/ Howto: Remove menu entries from the System menu]<br />
* [http://www.linuxquestions.org/questions/linux-general-1/how-to-use-xfce-themes-658354/ XFCE themes at linuxquestions.org]</div>Pocmhttps://wiki.archlinux.org/index.php?title=Cursor_themes&diff=135247Cursor themes2011-03-29T00:08:11Z<p>Pocm: /* Getting Mouse Cursor Themes */ Clarify section on default xcursor-themes</p>
<hr />
<div>[[Category:X Server (English)]]<br />
[[Category:HOWTOs (English)]]<br />
{{i18n|X11 Cursors}}<br />
<br />
There are many cursor themes available for the X11 Windowing System besides the default black pointer.<br />
This guide will instruct you on where to get them, installing them, and configuring them.<br />
<br />
==Getting Mouse Cursor Themes==<br />
Here are links to where you may download cursor:<br />
*[http://kde-look.org/index.php?xcontentmode=36 KDE Look]<br />
<!--<br />
this link doesn't work<br />
*[http://www.themedepot.org/showarea.php4?area=19 Theme Depot]<br />
--><br />
*[http://themes.freshmeat.net/browse/982/ Freshmeat]<br />
*[http://www.customize.org/list/xcursors Customize.org]<br />
Also, some themes available through [http://aur.archlinux.org/packages.php?O=0&L=0&C=17&K=cursor&SeB=nd&SB=n&SO=a&PP=50&do_Search=Go AUR]<br />
{{Note| That the {{Package Official|xcursor-themes}} package (installed by default with the {{Package Official|xorg}} group) already comes with the 'redglass' and 'whiteglass' themes in {{Filename|/usr/share/icons}}.}}<br />
<br />
==Installing Mouse Cursor Themes==<br />
'''Extract the cursor theme package:'''<br />
$ tar -zxvf foobar-cursor-theme-package-foo.tar.gz<br />
or<br />
$ tar -jxvf foobar-cursor-theme-package-foo.tar.bz2<br />
'''Make a directory for the cursor theme:'''<br />
<br />
''Example:'' FooBar-AweSoMe-Cursors-v2.98beta<br />
<br />
User-specific installation:<br />
$ mkdir -p ~/.icons/foobar/cursors<br />
<br />
System-wide installation:<br />
# mkdir -p /usr/share/icons/foobar/cursors<br />
<br />
{{Note| To simplify the name of the theme, the name being used is 'foobar' instead of 'FooBar-AweSoMe-Cursors-v2.98beta' when creating the dir(s) above.}}<br />
<br />
'''Copy cursor files into the appropriate directory:'''<br />
<br />
User-specific installation:<br />
$ cp -a FooBar-AweSoMe-Cursors-v2.98beta/cursors/* ~/.icons/foobar/cursors/<br />
<br />
System-wide installation:<br />
# cp -a FooBar-AweSoMe-Cursors-v2.98beta/cursors/* /usr/share/icons/foobar/cursors/<br />
<br />
If the package includes index.theme file check if there is an "Inherits" line inside. If yes, check whether the inherited theme also exists under this name in your system (rename if needed).<br />
<br />
'''Copy index.theme file into the appropriate directory:'''<br />
<br />
User-specific installation:<br />
$ cp -a FooBar-AweSoMe-Cursors-v2.98beta/index.theme ~/.icons/foobar/index.theme<br />
<br />
System-wide installation:<br />
# cp -a FooBar-AweSoMe-Cursors-v2.98beta/index.theme /usr/share/icons/foobar/index.theme<br />
<br />
If the package doesn't have index.theme or if it doesn't include an "Inherits" line you don't have to copy this file.<br />
<br />
'''Create links to missing cursors:'''<br />
<br />
Applications may keep using the default X11 cursors when a theme lacks some cursors. If you experience this, it can be corrected by adding links to the missing cursors. For example:<br />
<br />
$ cd ~/.icons/foobar/cursors/<br />
$ ln -s right_ptr arrow<br />
$ ln -s cross crosshair<br />
$ ln -s right_ptr draft_large<br />
$ ln -s right_ptr draft_small<br />
$ ln -s cross plus<br />
$ ln -s left_ptr top_left_arrow<br />
$ ln -s cross tcross<br />
$ ln -s hand hand1<br />
$ ln -s hand hand2<br />
$ ln -s left_side left_tee<br />
$ ln -s left_ptr ul_angle<br />
$ ln -s left_ptr ur_angle<br />
$ ln -s left_ptr_watch 08e8e1c95fe2fc01f976f1e063a24ccd<br />
<br />
If the above links don't resolve the problem, look in {{Filename|/usr/share/icons/whiteglass/cursors}} for additional cursors your theme may be missing, and create links for them as well.<br />
<br />
== Configuring Cursor Themes ==<br />
<br />
To locally name a cursor theme, add to your {{Filename|~/.Xresources}}:<br />
<br />
Xcursor.theme: foobar<br />
<br />
To have the cursor theme properly loaded it will need to be called by your window manager. If it does not, you can force it to load prior your window manager by putting the following command in {{Filename|~/.xinitrc}} or [[.xprofile]] (depending on your setup):<br />
<br />
xrdb ~/.Xresources &<br />
<br />
Refer to your window manager documentation for details.<br />
<br />
Alternatively, you can create a symlink "default" in {{Filename|~/.icons}}, which points to your installed cursor theme:<br />
<br />
$ ln -s /usr/share/icons/foobar/ ~/.icons/default<br />
<br />
If you rather want to change the cursor globally (e.g. used by graphical login managers like kdm, gdm, ...), or if you experience problems with above method (for example in Firefox), create the {{Filename|/usr/share/icons/default/}} directory '''(only if needed)''':<br />
<br />
# mkdir -p /usr/share/icons/default '''(only if needed)'''<br />
<br />
Edit or create the {{Filename|/usr/share/icons/default/index.theme}} file and add the following:<br />
<br />
[icon theme] <br />
Inherits=foobar<br />
<br />
Or if you have/want your cursor themes in {{Filename|~/.icons}} only. Create the {{Filename|~/.icons/default/}} directory:<br />
<br />
$ mkdir -p ~/.icons/default<br />
<br />
And create the {{Filename|~/.icons/default/index.theme}} file with the same contents as above {{Filename|/usr/share/icons/default/index.theme}}.<br />
<br />
You can optionally add this line to {{Filename|~/Xresources}} if your cursor theme supports multiple sizes:<br />
Xcursor.size: 16 ! 32, 48 or 64 may also be good values<br />
<br />
If you don't know about supported cursor sizes just start X without this setting and let it choose the cursor size automatically.<br />
<br />
== More information ==<br />
For more information about cursors in X (supported directories, formats, compatibility, etc.) refer to the man page:<br />
$ man Xcursor<br />
<br />
{{Note| If the animations are flickering on your nvidia card, add the following line to your {{Filename|/etc/X11/xorg.conf}} file, into the nvidia device section, to fix it:}}<br />
Option "HWCursor" "off"</div>Pocm