https://wiki.archlinux.org/api.php?action=feedcontributions&user=Zendeavor&feedformat=atomArchWiki - User contributions [en]2024-03-29T01:08:24ZUser contributionsMediaWiki 1.41.0https://wiki.archlinux.org/index.php?title=User:Misfit138/The_Arch_Way_v2.0&diff=268005User:Misfit138/The Arch Way v2.02013-07-25T23:49:49Z<p>Zendeavor: Replaced content with "you can't just make up a new philosophy."</p>
<hr />
<div>you can't just make up a new philosophy.</div>Zendeavorhttps://wiki.archlinux.org/index.php?title=Unity&diff=266039Unity2013-07-13T06:58:09Z<p>Zendeavor: /* From repository */ quotes are extremely recommended around command substitutions in all situations.</p>
<hr />
<div>[[it:Notify OSD]]<br />
[[ja:Unity]]<br />
[[zh-CN:Unity]]<br />
[[Category:Desktop environments]]<br />
{{Article summary start|Summary}}<br />
{{Article summary text|This article discusses how to install and use Unity. Unity is a shell interface for the GNOME desktop environment. This article covers how to get Unity on your system and how to configure it to fit your needs.}}<br />
{{Article summary heading|Related}}<br />
{{Article summary wiki|GNOME}}<br />
{{Article summary end}}<br />
[http://unity.ubuntu.com/ Unity] is a powerful desktop and netbook environment that brings consistency and elegance to the Ubuntu experience.<br />
<br />
== Installation ==<br />
There are two ways to install Unity on Archlinux: from the source and from a repository.<br />
<br />
=== From source ===<br />
All of the PKGBUILDs can be browsed on the [https://github.com/chenxiaolong/Unity-for-Arch Github repository], where [https://github.com/chenxiaolong/Unity-for-Arch Unity-For-Arch] provides a minimal working Unity shell, and [https://github.com/chenxiaolong/Unity-for-Arch-Extra Unity-For-Arch-Extra] provides some additional applications, including '''lightdm-ubuntu''' (lightdm with ubuntu patches), '''light-themes''', '''unity-tweak-tool''' (a popular ubuntu tool) and some more.<br />
<br />
To install a minimal Unity shell:<br />
<br />
1. 'cd' into a directory, where you want to keep the sources, and run:<br />
{{bc|$ git clone https://github.com/chenxiaolong/Unity-for-Arch.git}}<br />
For this to work, {{Pkg|git}} is required.<br />
<br />
2 Open the README file and build packages according to the ordered list. Basically run:<br />
{{bc|$ cd packagename<br />
$ rm -rvf # Clears out any files from a previous build<br />
$ makepkg -sci # '-s' means install needed dependencies, '-c' means clear left files after build and '-i' means install the package after it is built.<br />
}}<br />
3. Log out and log into the Unity session.<br />
<br />
To use '''lightdm''' to start Unity, follow the same steps mentionned above to install '''lightdm-ubuntu''' and '''lightdm-unity-greeter''' from the [https://github.com/chenxiaolong/Unity-for-Arch-Extra Unity-For-Arch-Extra] repository. '''lightdm''' needs to be added to autostart daemons. For Systemd users, check the [https://wiki.archlinux.org/index.php/Systemd Systemd wiki page].<br />
<br />
{{Tip|To complete this procedure automatically, [https://gist.github.com/3906721 this script] can be used.}}<br />
<br />
=== From repository ===<br />
Compiled packages are also available at [http://unity.humbug.in/ unity.humbug.in] and [http://unity.xe-xe.org/ unity.xe-xe.org].<br />
Take '''unity.xe-xe.org''' as an example, to install the packages,<br />
add<br />
{{bc|<br />
[unity]<br />
Server &#61; http://unity.xe-xe.org/$arch<br />
<br />
[unity-extra]<br />
Server &#61; http://unity.xe-xe.org/extra/$arch<br />
}}<br />
to {{ic|/etc/pacman.conf}}<br />
<br />
Run:<br />
{{bc|<br />
$ pacman -Suy<br />
$ pacman -S "$(pacman -Slq unity)"}}<br />
<br />
{{Tip| There are many ubuntu-patched packages that replace original Arch packages.<br />
It is also recommended to use freetype2-ubuntu from '''AUR'''.}}<br />
<br />
{{Warning|Remember that you are installing '''unofficial''' packages which are not supported by the Arch Linux developers.}}<br />
{{Warning|Almost all packages related to Unity in '''AUR''' are outdated. Do not mix those packages with the ones provided from the repository.}}<br />
<br />
=== From testing repository ===<br />
There is also a testing repository which provides bleeding edge features and is almost always synchronized to the changes made in Github repository. You may want to use it if you prefer newest features or if you've encountered some package conflicts while using the repositories mentioned above.<br />
<br />
{{bc|<br />
[Unity-for-Arch]<br />
SigLevel &#61; Optional TrustAll<br />
Server &#61; http://dl.dropbox.com/u/486665/Repos/Unity-for-Arch/$arch<br />
<br />
[Unity-for-Arch-Extra] <br />
SigLevel &#61; Optional TrustAll <br />
Server &#61; http://dl.dropbox.com/u/486665/Repos/Unity-for-Arch-Extra/$arch<br />
}}<br />
<br />
==Update==<br />
For Unity repository, the update is the same as packages from official repositories.<br />
<br />
Otherwise:<br />
<br />
1. 'cd' into the 'Unity-for-Arch' directory where it was originally cloned<br />
<br />
2. pull all of changes from github repository:<br />
{{bc|$ git pull}}<br />
3. Check if packages need to be updated:<br />
{{bc|$ ./What_can_I_update\?.py}}<br />
4. If any packages need to be updated, just build them like mentioned above in '''from source''' section.<br />
<br />
{{Note| Sometimes if certain crucial package is updated, those package which depend on it will also need to be recompiled though they won't be reported. For example, '''Unity''' is often required to be recompiled if '''nux''' gets updated}}<br />
<br />
==Trouble Shooting==<br />
<br />
=== Unity notifications doesn't work ===<br />
Ensure following is installed: {{Pkg|notify-osd}}<br />
<br />
=== Screensaver locking doesn't work ===<br />
Ensure following is installed: {{Pkg|gnome-screensaver}} . For now you need to also create this file<br />
{{hc|/usr/share/dbus-1/services/org.gnome.ScreenSaver.service|[D-BUS Service]<br />
Name&#61;org.gnome.ScreenSaver<br />
Exec&#61;/usr/bin/gnome-screensaver --no-daemon}}<br />
<br />
=== online accounts doesn't work ===<br />
Ensure following is installed: {{Pkg|signon-keyring-extension}} and {{Pkg|gnome-keyring}}. You may also require {{Pkg|telepathy}} to get certain accounts to work.<br />
<br />
=== ssh keys aren't remembered by keyring ===<br />
Ensure following is installed: {{Pkg|gnome-keyring}}<br />
<br />
=== KDE apps aren't integrated into the HUD and menubar ===<br />
Ensure following is installed: {{Pkg|appmenu-qt}}<br />
<br />
=== Files and Folder lens doesn't seem to work or display anything ===<br />
Ensure following is installed: {{Pkg|zeitgeist}} and {{Pkg|zeitgeist-datahub}}<br />
<br />
=== Can't right click on desktop ===<br />
Few things this addresses/fixes:<br />
* Can't right click on the desktop<br />
* Title bar at top doesn't display 'Arch Linux Desktop'<br />
* Shortcut keys like Super and Alt doesn't work when there are no active windows<br />
<br />
Simply install {{Pkg|gnome-tweak-tool}} then open '''Tweak Tool''' and check '''Have file manager handle the desktop'''. You might to uncheck '''Home icon visible on desktop''' and '''Trash icon visible on desktop'''.<br />
<br />
===Unity stops working after update===<br />
Try to run:<br />
{{bc|$ compiz.reset}}<br />
and Log out and log into the Unity session.<br />
<br />
If it still doesn't work, report an issue on [https://github.com/chenxiaolong/Unity-for-Arch/issues?state=open github] or discuss it on [https://bbs.archlinux.org/viewtopic.php?id=125423&p=1 Arch forum].<br />
<br />
===Window decoration doesn't work properly===<br />
Try to install {{Pkg|gnome-tweak-tool}} to adjust the theme.<br />
<br />
===Window decoration can't use certain theme===<br />
Install metacity-ubuntu instead of metacity.<br />
<br />
===Some gtk themes look ugly after update to Gnome 3.6===<br />
It also happens for unity default theme light-themes. Put<br />
{{bc|<br />
GtkLabel {<br />
background-color: @transparent;<br />
}<br />
}}<br />
in {{ic|.config/gtk3.0/gtk.css}}<br />
<br />
===Workspace switcher widget dissappeared===<br />
Check this setting: Go to settings, Appearance, Behaviour, Enable workspaces<br />
<br />
===Newly opened window is always placed at (0,0) on the screen===<br />
'''Metacity-ubuntu''' needs to be used instead of {{Pkg|metacity}}. '''Metacity-ubuntu''' is now included in [https://github.com/chenxiaolong/Unity-for-Arch Unity-for-Arch] again.<br />
<br />
===Window's titlebar still exists when maximized===<br />
'''Metacity-ubuntu''' needs to be used instead of {{Pkg|metacity}}.<br />
<br />
===''Indicator-messages'' doesn't work properly===<br />
Pidgin and a bunch of other applications can not be integrated into indicator-messages due to its API changes. Wait for the upstream software updates or you can help file a bug report.<br />
<br />
==Known Issues==</div>Zendeavorhttps://wiki.archlinux.org/index.php?title=Dotfiles&diff=202577Dotfiles2012-05-22T19:08:29Z<p>Zendeavor: /* Repositories */</p>
<hr />
<div>{{Lowercase title}}<br />
[[Category:Dotfiles]]<br />
{{i18n|dotfiles}}<br />
{{stub|Needs more repos and, potentially, more table categories.}}<br />
<br />
This article collects links to many user repositories containing custom configuration files.<br />
<br />
== Repositories ==<br />
<br />
{| class="wikitable sortable" border="1" cellpadding="1" cellspacing="0"<br />
! scope="col" | Author<br />
! scope="col" | Shell<br />
! scope="col" | WM / DE<br />
! scope="col" | Editor<br />
! scope="col" | Terminal<br />
! scope="col" | Multiplexer<br />
! scope="col" | Audio<br />
! scope="col" | Monitor<br />
! scope="col" | Mail<br />
! scope="col" | IRC<br />
|-<br />
! [https://github.com/pbrisbin/dotfiles brisbin33]<br />
| [https://github.com/pbrisbin/oh-my-zsh zsh] || [https://github.com/pbrisbin/xmonad-config xmonad] || [https://github.com/pbrisbin/vim-config vim] || rxvt-unicode || || ncmpcpp || conky || [https://github.com/pbrisbin/mutt-config mutt] || irssi<br />
|-<br />
! [https://github.com/falconindy/dotfiles falconindy]<br />
| bash || i3 || vim || rxvt-unicode || || ncmpcpp || conky || mutt ||<br />
|-<br />
! [https://github.com/graysky2/configs/tree/master/dotfiles graysky]<br />
| bash || xfce4 || vim || terminal || || ncmpcpp || custom || thunderbird ||<br />
|-<br />
! [http://code.gtmanfred.com/cgit/dotfiles.git/tree/?h=tower gtmanfred]<br />
| zsh || dwm || vim || rxvt-unicode || || || conky || mutt || weechat<br />
|-<br />
! [https://bitbucket.org/jasonwryan/eeepc/src jasonwryan]<br />
| bash || dwm || vim || rxvt-unicode || || ncmpcpp || || mutt || weechat<br />
|-<br />
! [http://github.com/meskarune/.dotfiles meskarune]<br />
| bash || || || || || || conky || || weechat<br />
|-<br />
! [https://github.com/ok100/configs OK100]<br />
| bash || dwm || vim || rxvt-unicode || || cmus || conky, dzen || mutt || weechat<br />
|-<br />
! [http://hg.subtle.de/dotfiles/file unexist]<br />
| zsh || subtle || vim || rxvt-unicode || || ncmpcpp || || mutt || irssi<br />
|-<br />
! [http://github.com/simongmzlj/dotfiles vodik]<br />
| zsh || xmonad || vim || rxvt-unicode || || ncmpcpp || custom || || weechat<br />
|-<br />
! [http://github.com/Wintervenom/Configuration Wintervenom]<br />
| bash || herbstluftwm ||vim || rxvt-unicode || screen ||mpd ([https://github.com/Wintervenom/Scripts/tree/master/audio/mpd mpc-utils]) || [https://github.com/Wintervenom/Scripts/blob/master/wm/herbstluftwm/hlwm-dzen2https://github.com/wolfcore/dotfiles hlwm-dzen2] || mutt || weechat<br />
|-<br />
! [http://github.com/wolfcore/dotfiles wolfcore] <br />
| bash || dwm || vim || rxvt-unicode || tmux || cmus || custom || || weechat<br />
|-<br />
! [https://github.com/xfausto/dotfiles xfausto]<br />
| zsh || dwm || vim || st || || ncmpcpp || conky || ||<br />
|-<br />
! [https://github.com/zendeavor zendeavor]<br />
| [https://github.com/zendeavor/config-stuff/tree/sandbag/zsh zsh] || [https://github.com/zendeavor/config-stuff/blob/sandbag/i3/config i3] || [https://github.com/zendeavor/dotvim/tree/sandbag vim] || [https://github.com/zendeavor/config-stuff/blob/sandbag/X11/Xresources#L14 rxvt-unicode] || [https://github.com/zendeavor/config-stuff/tree/sandbag/tmux tmux] || [https://github.com/zendeavor/config-stuff/blob/sandbag/ncmpcpp/config ncmpcpp] || [https://github.com/zendeavor/config-stuff/blob/sandbag/i3/i3status.conf i3status] || || [https://github.com/zendeavor/config-stuff/tree/kiwi/weechat weechat]<br />
|-<br />
|}<br />
<br />
== See also ==<br />
* [http://mywiki.wooledge.org/DotFiles Dotfiles - Greg's Wiki]<br />
* [http://www.haskell.org/haskellwiki/Xmonad/Config_archive XMonad Config Archive]<br />
* [http://dotshare.it dotshare.it]<br />
* [http://dotfiles.org dotfiles.org]</div>Zendeavorhttps://wiki.archlinux.org/index.php?title=Dotfiles&diff=202576Dotfiles2012-05-22T19:06:46Z<p>Zendeavor: /* Repositories */</p>
<hr />
<div>{{Lowercase title}}<br />
[[Category:Dotfiles]]<br />
{{i18n|dotfiles}}<br />
{{stub|Needs more repos and, potentially, more table categories.}}<br />
<br />
This article collects links to many user repositories containing custom configuration files.<br />
<br />
== Repositories ==<br />
<br />
{| class="wikitable sortable" border="1" cellpadding="1" cellspacing="0"<br />
! scope="col" | Author<br />
! scope="col" | Shell<br />
! scope="col" | WM / DE<br />
! scope="col" | Editor<br />
! scope="col" | Terminal<br />
! scope="col" | Multiplexer<br />
! scope="col" | Audio<br />
! scope="col" | Monitor<br />
! scope="col" | Mail<br />
! scope="col" | IRC<br />
|-<br />
! [https://github.com/pbrisbin/dotfiles brisbin33]<br />
| [https://github.com/pbrisbin/oh-my-zsh zsh] || [https://github.com/pbrisbin/xmonad-config xmonad] || [https://github.com/pbrisbin/vim-config vim] || rxvt-unicode || || ncmpcpp || conky || [https://github.com/pbrisbin/mutt-config mutt] || irssi<br />
|-<br />
! [https://github.com/falconindy/dotfiles falconindy]<br />
| bash || i3 || vim || rxvt-unicode || || ncmpcpp || conky || mutt ||<br />
|-<br />
! [https://github.com/graysky2/configs/tree/master/dotfiles graysky]<br />
| bash || xfce4 || vim || terminal || || ncmpcpp || custom || thunderbird ||<br />
|-<br />
! [http://code.gtmanfred.com/cgit/dotfiles.git/tree/?h=tower gtmanfred]<br />
| zsh || dwm || vim || rxvt-unicode || || || conky || mutt || weechat<br />
|-<br />
! [https://bitbucket.org/jasonwryan/eeepc/src jasonwryan]<br />
| bash || dwm || vim || rxvt-unicode || || ncmpcpp || || mutt || weechat<br />
|-<br />
! [http://github.com/meskarune/.dotfiles meskarune]<br />
| bash || || || || || || conky || || weechat<br />
|-<br />
! [https://github.com/ok100/configs OK100]<br />
| bash || dwm || vim || rxvt-unicode || || cmus || conky, dzen || mutt || weechat<br />
|-<br />
! [http://hg.subtle.de/dotfiles/file unexist]<br />
| zsh || subtle || vim || rxvt-unicode || || ncmpcpp || || mutt || irssi<br />
|-<br />
! [http://github.com/simongmzlj/dotfiles vodik]<br />
| zsh || xmonad || vim || rxvt-unicode || || ncmpcpp || custom || || weechat<br />
|-<br />
! [http://github.com/Wintervenom/Configuration Wintervenom]<br />
| bash || herbstluftwm ||vim || rxvt-unicode || screen ||mpd ([https://github.com/Wintervenom/Scripts/tree/master/audio/mpd mpc-utils]) || [https://github.com/Wintervenom/Scripts/blob/master/wm/herbstluftwm/hlwm-dzen2https://github.com/wolfcore/dotfiles hlwm-dzen2] || mutt || weechat<br />
|-<br />
! [http://github.com/wolfcore/dotfiles wolfcore] <br />
| bash || dwm || vim || rxvt-unicode || tmux || cmus || custom || || weechat<br />
|-<br />
! [https://github.com/xfausto/dotfiles xfausto]<br />
| zsh || dwm || vim || st || || ncmpcpp || conky || ||<br />
|-<br />
! [https://github.com/zendeavor/config-stuff/tree/sandbag zendeavor]<br />
| zsh || i3 || vim || rxvt-unicode || tmux || ncmpcpp || i3status || || weechat<br />
|-<br />
! [https://github.com/zendeavor/config-stuff/tree/sandbag zendeavor]<br />
| [https://github.com/zendeavor git] || [https://github.com/zendeavor/config-stuff/tree/sandbag/zsh zsh] || [https://github.com/zendeavor/config-stuff/blob/sandbag/i3/config i3] || [https://github.com/zendeavor/dotvim/tree/sandbag vim] || [https://github.com/zendeavor/config-stuff/blob/sandbag/X11/Xresources#L14 rxvt-unicode] || [https://github.com/zendeavor/config-stuff/tree/sandbag/tmux tmux] || [https://github.com/zendeavor/config-stuff/blob/sandbag/ncmpcpp/config ncmpcpp] || [https://github.com/zendeavor/config-stuff/blob/sandbag/i3/i3status.conf i3status] || || [https://github.com/zendeavor/config-stuff/tree/kiwi/weechat weechat]<br />
|-<br />
|}<br />
<br />
== See also ==<br />
* [http://mywiki.wooledge.org/DotFiles Dotfiles - Greg's Wiki]<br />
* [http://www.haskell.org/haskellwiki/Xmonad/Config_archive XMonad Config Archive]<br />
* [http://dotshare.it dotshare.it]<br />
* [http://dotfiles.org dotfiles.org]</div>Zendeavorhttps://wiki.archlinux.org/index.php?title=Dotfiles&diff=202545Dotfiles2012-05-22T18:22:07Z<p>Zendeavor: /* Repositories */</p>
<hr />
<div>{{Lowercase title}}<br />
[[Category:Dotfiles]]<br />
{{i18n|dotfiles}}<br />
{{stub|Needs more repos and, potentially, more table categories.}}<br />
<br />
This article collects links to many user repositories containing custom configuration files.<br />
<br />
== Repositories ==<br />
<br />
{| class="wikitable sortable" border="1" cellpadding="1" cellspacing="0"<br />
! scope="col" | Author<br />
! scope="col" | VCS<br />
! scope="col" | Shell<br />
! scope="col" | WM / DE<br />
! scope="col" | Editor<br />
! scope="col" | Terminal<br />
! scope="col" | Multiplexer<br />
! scope="col" | Music<br />
! scope="col" | Monitor<br />
! scope="col" | Mail<br />
! scope="col" | IRC<br />
|-<br />
! [https://github.com/pbrisbin/dotfiles brisbin33]<br />
| git || [https://github.com/pbrisbin/oh-my-zsh zsh] || [https://github.com/pbrisbin/xmonad-config xmonad] || [https://github.com/pbrisbin/vim-config vim] || rxvt-unicode || || ncmpcpp || conky || [https://github.com/pbrisbin/mutt-config mutt] || irssi<br />
|-<br />
! [https://github.com/falconindy/dotfiles falconindy]<br />
| git || bash || i3 || vim || rxvt-unicode || || ncmpcpp || conky || mutt ||<br />
|-<br />
! [https://github.com/graysky2/configs/tree/master/dotfiles graysky]<br />
| git || bash || xfce4 || vim || terminal || || ncmpcpp || custom || thunderbird ||<br />
|-<br />
! [http://code.gtmanfred.com/cgit/dotfiles.git/tree/?h=tower gtmanfred]<br />
| git || zsh || dwm || vim || rxvt-unicode || || || conky || mutt || weechat<br />
|-<br />
! [https://bitbucket.org/jasonwryan/eeepc/src jasonwryan]<br />
| hg || bash || dwm || vim || rxvt-unicode || || ncmpcpp || || mutt || weechat<br />
|-<br />
! [http://github.com/meskarune/.dotfiles meskarune]<br />
| git || bash || || || || || || conky || || weechat<br />
|-<br />
! [https://github.com/ok100/configs OK100]<br />
| git || bash || dwm || vim || rxvt-unicode || || cmus || conky, dzen || mutt || weechat<br />
|-<br />
! [http://hg.subtle.de/dotfiles/file unexist]<br />
| hg || zsh || subtle || vim || rxvt-unicode || || ncmpcpp || || mutt || irssi<br />
|-<br />
! [http://github.com/simongmzlj/dotfiles vodik]<br />
| git || zsh || xmonad || vim || rxvt-unicode || || ncmpcpp || custom || || weechat<br />
|-<br />
! [http://github.com/wolfcore/dotfiles wolfcore] <br />
| git || bash || dwm || vim || rxvt-unicode || || cmus || custom || || weechat<br />
|-<br />
! [https://github.com/xfausto/dotfiles xfausto]<br />
| git || zsh || dwm || vim || st || || ncmpcpp || conky || ||<br />
|-<br />
| [https://github.com/zendeavor/config-stuff/tree/sandbag zendeavor]<br />
| [https://github.com/zendeavor git] || [https://github.com/zendeavor/config-stuff/tree/sandbag/zsh zsh] || [https://github.com/zendeavor/config-stuff/blob/sandbag/i3/config i3] || [https://github.com/zendeavor/dotvim/tree/sandbag vim] || [https://github.com/zendeavor/config-stuff/blob/sandbag/X11/Xresources#L14 rxvt-unicode] || [https://github.com/zendeavor/config-stuff/tree/sandbag/tmux tmux] || [https://github.com/zendeavor/config-stuff/blob/sandbag/ncmpcpp/config ncmpcpp] || [https://github.com/zendeavor/config-stuff/blob/sandbag/i3/i3status.conf i3status] || || [https://github.com/zendeavor/config-stuff/tree/kiwi/weechat weechat]<br />
|}<br />
<br />
== See also ==<br />
* [http://mywiki.wooledge.org/DotFiles Dotfiles - Greg's Wiki]<br />
* [http://www.haskell.org/haskellwiki/Xmonad/Config_archive XMonad Config Archive]<br />
* [http://dotshare.it dotshare.it]<br />
* [http://dotfiles.org dotfiles.org]</div>Zendeavorhttps://wiki.archlinux.org/index.php?title=Dotfiles&diff=202544Dotfiles2012-05-22T18:20:40Z<p>Zendeavor: throw in my links, add multiplexer column</p>
<hr />
<div>{{Lowercase title}}<br />
[[Category:Dotfiles]]<br />
{{i18n|dotfiles}}<br />
{{stub|Needs more repos and, potentially, more table categories.}}<br />
<br />
This article collects links to many user repositories containing custom configuration files.<br />
<br />
== Repositories ==<br />
<br />
{| class="wikitable sortable" border="1" cellpadding="1" cellspacing="0"<br />
! scope="col" | Author<br />
! scope="col" | VCS<br />
! scope="col" | Shell<br />
! scope="col" | WM / DE<br />
! scope="col" | Editor<br />
! scope="col" | Terminal<br />
! scope="col" | Multiplexer<br />
! scope="col" | Music<br />
! scope="col" | Monitor<br />
! scope="col" | Mail<br />
! scope="col" | IRC<br />
|-<br />
! [https://github.com/pbrisbin/dotfiles brisbin33]<br />
| git || [https://github.com/pbrisbin/oh-my-zsh zsh] || [https://github.com/pbrisbin/xmonad-config xmonad] || [https://github.com/pbrisbin/vim-config vim] || rxvt-unicode || || ncmpcpp || conky || [https://github.com/pbrisbin/mutt-config mutt] || irssi<br />
|-<br />
! [https://github.com/falconindy/dotfiles falconindy]<br />
| git || bash || i3 || vim || rxvt-unicode || || ncmpcpp || conky || mutt ||<br />
|-<br />
! [https://github.com/graysky2/configs/tree/master/dotfiles graysky]<br />
| git || bash || xfce4 || vim || terminal || || ncmpcpp || custom || thunderbird ||<br />
|-<br />
! [http://code.gtmanfred.com/cgit/dotfiles.git/tree/?h=tower gtmanfred]<br />
| git || zsh || dwm || vim || rxvt-unicode || || || conky || mutt || weechat<br />
|-<br />
! [https://bitbucket.org/jasonwryan/eeepc/src jasonwryan]<br />
| hg || bash || dwm || vim || rxvt-unicode || || ncmpcpp || || mutt || weechat<br />
|-<br />
! [http://github.com/meskarune/.dotfiles meskarune]<br />
| git || bash || || || || || || conky || || weechat<br />
|-<br />
! [https://github.com/ok100/configs OK100]<br />
| git || bash || dwm || vim || rxvt-unicode || || cmus || conky, dzen || mutt || weechat<br />
|-<br />
! [http://hg.subtle.de/dotfiles/file unexist]<br />
| hg || zsh || subtle || vim || rxvt-unicode || || ncmpcpp || || mutt || irssi<br />
|-<br />
! [http://github.com/simongmzlj/dotfiles vodik]<br />
| git || zsh || xmonad || vim || rxvt-unicode || || ncmpcpp || custom || || weechat<br />
|-<br />
! [http://github.com/wolfcore/dotfiles wolfcore] <br />
| git || bash || dwm || vim || rxvt-unicode || || cmus || custom || || weechat<br />
|-<br />
! [https://github.com/xfausto/dotfiles xfausto]<br />
| git || zsh || dwm || vim || st || || ncmpcpp || conky || ||<br />
|-<br />
| [https://github.com/zendeavor/config-stuff/tree/sandbag zendeavor]<br />
| [https://github.com/zendeavor git] || [https://github.com/zendeavor/config-stuff/tree/sandbag/zsh zsh] || [https://github.com/zendeavor/config-stuff/tree/sandbag/i3 i3] || [https://github.com/zendeavor/dotvim/tree/sandbag vim] || [https://github.com/zendeavor/config-stuff/blob/sandbag/X11/Xresources#L14 rxvt-unicode] || [https://github.com/zendeavor/config-stuff/tree/sandbag/tmux tmux] || [https://github.com/zendeavor/config-stuff/blob/sandbag/ncmpcpp/config ncmpcpp] || [https://github.com/zendeavor/config-stuff/blob/sandbag/i3/i3status.conf i3status] || || [https://github.com/zendeavor/config-stuff/tree/kiwi/weechat weechat]<br />
|}<br />
<br />
== See also ==<br />
* [http://mywiki.wooledge.org/DotFiles Dotfiles - Greg's Wiki]<br />
* [http://www.haskell.org/haskellwiki/Xmonad/Config_archive XMonad Config Archive]<br />
* [http://dotshare.it dotshare.it]<br />
* [http://dotfiles.org dotfiles.org]</div>Zendeavorhttps://wiki.archlinux.org/index.php?title=Pacman/Tips_and_tricks&diff=200449Pacman/Tips and tricks2012-05-06T12:43:42Z<p>Zendeavor: /* Reinstalling all installed packages */</p>
<hr />
<div>[[Category:Package management]] {{DISPLAYTITLE:pacman Tips}}<br />
[[tr:Pacman_ipuçları]]<br />
{{i18n|Pacman Tips}}<br />
<br />
{{Article summary start|Summary}}<br />
{{Article summary text|This is a collection of common tips for new pacman users.}}<br />
{{Article summary heading|Related}}<br />
{{Article summary wiki|pacman}}<br />
{{Article summary wiki|Mirrors}}<br />
{{Article summary wiki|Creating Packages}}<br />
{{Article summary wiki|Custom local repository}}<br />
{{Article summary end}}<br />
<br />
==Cosmetic and Convienence==<br />
===Color output===<br />
The most effective method of colorizing pacman is installing {{AUR|pacman-color}} from the [[AUR]].<br />
<br />
{{Note|The package installs a separate pacman binary patched for colored output ({{ic|pacman-color}}), so you may want to use an [[alias]].}}<br />
<br />
===Shortcuts===<br />
The following instructions allow users to run some of the more common pacman commands without the need to type them fully via a script alias.<br />
<br />
====Configure the shell====<br />
Add the following examples, which work in both [[Bash]] and [[Zsh]]:<br />
{{bc|<nowiki> # Pacman alias examples<br />
alias pacupg='sudo pacman -Syu' # Synchronize with repositories before upgrading packages that are out of date on the local system.<br />
alias pacin='sudo pacman -S' # Install specific package(s) from the repositories<br />
alias pacins='sudo pacman -U' # Install specific package not from the repositories but from a file <br />
alias pacre='sudo pacman -R' # Remove the specified package(s), retaining its configuration(s) and required dependencies<br />
alias pacrem='sudo pacman -Rns' # Remove the specified package(s), its configuration(s) and unneeded dependencies<br />
alias pacrep='pacman -Si' # Display information about a given package in the repositories<br />
alias pacreps='pacman -Ss' # Search for package(s) in the repositories<br />
alias pacloc='pacman -Qi' # Display information about a given package in the local database<br />
alias paclocs='pacman -Qs' # Search for package(s) in the local database<br />
<br />
# Additional pacman alias examples<br />
alias pacupd='sudo pacman -Sy && sudo abs' # Update and refresh the local package and ABS databases against repositories<br />
alias pacinsd='sudo pacman -S --asdeps' # Install given package(s) as dependencies of another package<br />
alias pacmir='sudo pacman -Syy' # Force refresh of all package lists after updating /etc/pacman.d/mirrorlist<br />
</nowiki>}}<br />
<br />
====Usage====<br />
Perform the respective commands by simply typing the alias name. For example, to synchronize with repositories before upgrading packages that are out of date on the local system:<br />
$ pacupg<br />
Install packages from repositories:<br />
$ pacin <package1> <package2> <package3><br />
Install a custom built package:<br />
$ pacins /path/to/<package><br />
Completely remove a locally installed package:<br />
$ pacrem <package><br />
Search for available packages in the repositories:<br />
$ pacreps <keywords><br />
Display information about a package (e.g. size, dependencies) in the repositories:<br />
$ pacrep <keywords><br />
<br />
====Notes====<br />
The aliases used above are merely examples. By following the syntax samples above, rename the aliases as convenient. For example:<br />
alias pacrem='sudo pacman -Rns'<br />
alias pacout='sudo pacman -Rns'<br />
<br />
In the case above, the commands {{Ic|pacrem}} and {{Ic|pacout}} both call Bash to execute the same command.<br />
<br />
===Operations and Bash syntax===<br />
In addition to pacman's standard set of features, there are ways to extend its usability through rudimentary [[Bash]] commands/syntax.<br />
<br />
* To install a number of packages sharing similar patterns in their names -- not the entire group nor all matching packages; eg. {{Pkg|kde}}:<br />
pacman -S kde-{applets,theme,tools}<br />
* Of course, that is not limited and can be expanded to however many levels needed:<br />
pacman -S kde-{ui-{kde,kdemod},kdeartwork}<br />
* Sometimes, {{Ic|-s}}'s builtin ERE can cause a lot of unwanted results, so it has to be limited to match the package name only; not the description nor any other field:<br />
pacman -Ss '^vim-'<br />
* pacman has the {{Ic|-q}} operand to hide the version column, so it is possible to query and reinstall packages with "compiz" as part of their name:<br />
pacman -S $(pacman -Qq | grep compiz)<br />
<br />
==Maintenance==<br />
''House keeping, in the interest of keeping a clean system and following [[The Arch Way]]''<br />
<br />
===CacheClean to selectivly purge cache===<br />
[[CacheClean]] is a Python script to clean the {{ic|/var/cache/pacman/pkg}} directory while allowing to specify how many package versions should be retained. <sup>[http://bbs.archlinux.org/viewtopic.php?id=9104]</sup><br />
<br />
A corresponding {{AUR|Cacheclean}} package is also available from the [[AUR]].<br />
<br />
===Listing all installed packages with size===<br />
* You may want to get the list of installed packages sorted by size, which may be useful when freeing space on your hard drive.<br />
pacman -Qi | awk '/^Name/ {pkg=$3} /Size/ {print $4$5,pkg}' | sort -n<br />
* Use {{ic|pacsysclean}} from {{ic|pacman-contrib}} package.<br />
* Install {{Pkg|expac}} and run {{ic| expac -s "%-30n %m" | sort -rhk 2}}<br />
* Invoke pacgraph with the -c option to produce a list of all installed packages with their respective sizes on the system. Pacgraph is available from [community].<br />
<br />
===Listing all installed packages with name, version, size and unique ===<br />
pacman -Qi | awk '/^Name/ {pkg=$3} /Version/ {ver=$3} /Size/ {size=$4$5} {print pkg,ver,size}' | uniq<br />
<br />
===Identify files not owned by any package===<br />
Periodic checks for files outside of pacman database are recommended. These files are often some 3rd party applications installed using the usual procedure (e.g. {{ic|./configure && make && make install}}). Search the file-system for these files (or symlinks) using this simple script:<br />
{{hc|pacman-disowned|2=<br />
<nowiki><br />
#!/bin/sh<br />
<br />
tmp=${TMPDIR-/tmp}/pacman-disowned-$UID-$$<br />
db=$tmp/db<br />
fs=$tmp/fs<br />
<br />
mkdir "$tmp"<br />
trap 'rm -rf "$tmp"' EXIT<br />
<br />
pacman -Qlq | sort -u > "$db"<br />
<br />
find /bin /etc /lib /sbin /usr \<br />
! -name lost+found \<br />
\( -type d -printf '%p/\n' -o -print \) | sort > "$fs"<br />
<br />
comm -23 "$fs" "$db"<br />
</nowiki><br />
}}<br />
<br />
To generate the list:<br />
$ pacman-disowned > non-db.txt<br />
<br />
Note that one should '''not''' delete all files listed in {{ic|non-db.txt}} without confirming each entry. There could be various configuration files, logs, etc., so use this list responsibly and only proceed after extensively searching for cross-references using {{Ic|grep}}.<br />
<br />
===Removing orphaned packages===<br />
For ''recursively'' removing orphans:<br />
# pacman -Rs $(pacman -Qtdq)<br />
<br />
The following function is easily inserted into {{ic|$HOME/.bashrc}} and removes orphans if found:<br />
<br />
<pre>orphans() {<br />
if [[ ! -n $(pacman -Qdt) ]]; then<br />
echo no orphans to remove<br />
else<br />
sudo pacman -Rs $(pacman -Qdtq)<br />
fi<br />
}</pre><br />
<br />
===Removing everything but base group===<br />
If it is ever necessary to remove all packages except the base group, try this one liner:<br />
{{bc|<nowiki># pacman -Rs $(comm -23 <(pacman -Qeq|sort) <((for i in $(pacman -Qqg base); do pactree -ul $i; done)|sort -u|cut -d ' ' -f 1))</nowiki>}}<br />
<br />
Source: [https://bbs.archlinux.org/viewtopic.php?id=130176 Look discussion here]<br />
<br />
Notes:<br />
# {{ic|comm}} requires sorted input otherwise you get e.g. {{ic|comm: file 1 is not in sorted order}}.<br />
# {{ic|pactree}} prints the package name followed by what it provides e.g.<br />
{{hc|$ pactree -lu logrotate|<nowiki><br />
logrotate<br />
popt<br />
glibc<br />
linux-api-headers<br />
tzdata<br />
dcron cron<br />
bash<br />
readline<br />
ncurses<br />
gzip</nowiki>}}<br />
The 'dcron cron' line seems to cause problems, that is why {{ic|cut -d ' ' -f 1}} is needed - to keep just the package name.<br />
<br />
==Installation and recovery==<br />
''Alternative ways of getting and restoring packages''<br />
<br />
===Installing packages from a CD/DVD/ISO===<br />
<!-- could easily be adapted to work with usb sticks --><br />
*First mount the CD (replace ''cdrom'' with ''dvd'' if needed):<br />
# mount /mnt/cdrom<br />
<br />
:If working with an .iso file instead, first create a directory under /mnt:<br />
# mkdir /mnt/iso<br />
:Then mount the image:<br />
# mount -t iso9660 -o ro,loop /path/to/iso /mnt/iso<br />
<br />
*Configure pacman:<br />
# nano -w /etc/pacman.conf<br />
<br />
*Add the following ''before'' other repositories (e.g. extra, core, etc.). This ensures the files from the CD/DVD/iso take precedence over those in the standard repositories:<br />
# Settings for using a cd-rom as a repository.<br />
[custom]<br />
Server = file:///mnt/cdrom/arch/pkg<br />
:Again, replace {{ic|cdrom}} as appropriate.<br />
<br />
Once {{ic|pacman.conf}} has been edited, sync pacman in order to be able to use the new repository.<br />
<br />
====Using packages from an Arch core image====<br />
<br />
In order to use packages from an Arch core image (e.g. to set up wireless support while offline), mount the core repository:<br />
# mount -o loop /path/to/arch_core_image/i686/repo-core-i686.sfs /mnt/iso<br />
Then edit {{ic|pacman.conf}}'s {{ic|[core]}} section, (temporarily) replacing the default entry with a reference to the mounted image:<br />
[core]<br />
#Include = /etc/pacman.d/mirrorlist<br />
Server = file:///mnt/iso<br />
Finally, sync Pacman:<br />
# pacman -Syu<br />
<br />
===Custom local repository===<br />
pacman 3 introduced a new script named {{Ic|repo-add}} which makes generating a database for a personal repository much easier. Use {{Ic|repo-add --help}} for more details on its usage.<br />
<br />
Simply store all of the built packages to be included in the repository in one directory, and execute the following command (where ''repo'' is the name of the custom repository):<br />
$ repo-add /path/to/repo.db.tar.gz /path/to/*.pkg.tar.xz<br />
<br />
Note that when using {{Ic|repo-add}}, the database and the packages do not need to be in the same directory. But when using pacman with that database, they should be together.<br />
<br />
To add a new package (and remove the old if it exists), run:<br />
$ repo-add /path/to/repo.db.tar.gz /path/to/packagetoadd-1.0-1-i686.pkg.tar.xz<br />
<br />
{{Note|If there is a package that needs to be removed from the repository, read up on {{Ic|repo-remove}}.}}<br />
<br />
Once the local repository has been made, add the repository to {{ic|pacman.conf}}. The name of the {{ic|db.tar.gz}} file is the repository name. Reference it directly using a ''file://'' url, or access it via FTP using ftp://localhost/path/to/directory.<br />
<br />
If willing, add the custom repository to the [[Unofficial user repositories|list of unofficial user repositories]], so that the community can benefit from it.<br />
<br />
===Network shared pacman cache===<br />
{{Tip|See [http://xyne.archlinux.ca/projects/pacserve/ pacserve] for an alternate solution.}}<br />
<br />
In order to share packages between multiple computers, simply share {{ic|/var/cache/pacman/}} using any network-based mount protocol. This section shows how to use shfs or sshfs to share a package cache plus the related library-directories between multiple computers on the same local network. Keep in mind that a network shared cache can be slow depending on the file-system choice, among other factors.<br />
<br />
First, install any network-supporting filesystem; for example [[sshfs]], [[shfs]], [[ftpfs]], [[smbfs]] or [[nfs]]<br />
{{Tip|To use sshfs or shfs, consider reading [[Using SSH Keys]].}}<br />
<br />
Then, to share the actual packages, mount {{ic|/var/cache/pacman/pkg}} from the server to {{ic|/var/cache/pacman/pkg}} on every client machine.<br />
<br />
To have shared package databases, mount {{ic|<nowiki>/var/lib/pacman/sync/{core,extra,testing,community}</nowiki>}} in the same way. Proceed to place the appropriate lines in {{ic|/etc/fstab}}.<br />
<br />
====Preventing unwanted cache purges====<br />
By default, {{Ic|pacman -Sc}} removes package tarballs from the cache that correspond to packages that are not installed on the machine the command was issued on. Because pacman cannot predict what packages are installed on all machines that share the cache, it will end up deleting files that should not be.<br />
<br />
To clean up the cache so that only ''outdated'' tarballs are deleted, add this entry in the {{Ic|[options]}} section of {{ic|/etc/pacman.conf}}:<br />
CleanMethod = KeepCurrent<br />
<br />
===Backing up and retrieving a list of installed packages===<br />
It is good practice to keep periodic backups of all pacman-installed packages. In the event of a system crash which is unrecoverable by other means, pacman can then easily reinstall the very same packages onto a new installation.<br />
<br />
*First, backup the current list of non-local packages:<br />
$ comm -23 <(pacman -Qeq|sort) <(pacman -Qmq|sort) > pkglist<br />
<br />
*Store the pkglist on a USB key or other convenient medium or gist.github.com or evernote or dropbox.<br />
<br />
*Copy the pkglist file to the new installation, and navigate to the directory containing it.<br />
<br />
*Issue the following command to install from the backup list:<br />
# pacman -S $(< pkglist)<br />
<br />
In the case you have a list which was not generated like mentioned above, there may be foreign packages in it (i.e. packages not belonging to any repos you have configured, or packages from the AUR).<br />
<br />
In such a case, you may still want to install all available packages from that list:<br />
# pacman -S --needed $(diff <(cat badpkglist|sort) <(diff <(cat badpkglist|sort) <(pacman -Slq|sort)|grep \<|cut -f2 -d' ')|grep \<|cut -f2 -d' ')<br />
Explanation:<br />
* {{ic|pacman -Slq}} lists all available softwares, but the list is sorted by repository first, hence the ''sort'' command<br />
* Sorted files are required in order to make the {{ic|diff}} command work.<br />
* The first diff returns all unavailable packages; the second all available packages.<br />
* The {{ic|--needed}} switch is used to skip already installed packages.<br />
<br />
You may also try to install all unavailable packages (those not in the repos) from the AUR using [[yaourt]] (not recommended unless you know exactly what you are doing):<br />
$ yaourt -S --noconfirm $(diff <(cat badpkglist|sort) <(pacman -Slq|sort) |grep \<|cut -f2 -d' ')<br />
<br />
Finally, you may want to remove all the packages on your system that are not mentioned in the list.<br />
Warning: use this command wisely, and always check the result prompted by pacman.<br />
# pacman -Rsu $(diff <(cat badpkglist|sort) <(pacman -Qq|sort) | grep \>|cut -f2 -d' ')<br />
<br />
===List downloaded packages that are not in base or base-devel===<br />
<br />
The following command will list any installed packages that are not in base/base-devel, and as such were likely installed manually by the user:<br />
<br />
comm -23 <(pacman -Qeq|sort) <(pacman -Qgq base base-devel|sort)<br />
<br />
===Reinstalling all installed packages===<br />
If you mess up your system ({{ic|rm -rf}}) you can repair by having pacman reinstall all of your packages. <br />
<br />
If your system does not contain any foreign (AUR) packages you can run:<br />
# pacman -Qeq | pacman -S -<br />
# pacman -Qdq | pacman -S --asdeps -<br />
<br />
If you have foreign packages this will error as packages will not be found in the repositories. The following will make a list of all packages and remove the foreign packages seen with {{ic|pacman -Qmq}}. Combining a command to list all packages, and another to hide the list of foreign packages is required.<br />
<br />
The following will reinstall every package found in the repositories, preserving asdeps/explicitly installed info:<br />
# comm -23 <(pacman -Qeq | sort) <(pacman -Qmq | sort) | pacman -S -<br />
# comm -23 <(pacman -Qdq | sort) <(pacman -Qmq | sort) | pacman -S --asdeps -<br />
<br />
===Restore pacman's local database===<br />
Signs that pacman needs a local database restoration:<br />
*{{Ic|pacman -Q}} gives absolutely no output, and {{Ic|pacman -Syu}} erroneously reports that the system is up to date.<br />
*When trying to install a package using {{Ic|pacman -S package}} it outputs a list of already satisfied dependencies.<br />
<br />
Most likely, pacman's database of installed software, {{ic|/var/lib/pacman/local}}, has been corrupted or deleted. While this is a serious problem, it can be restored by following the instructions below.<br />
<br />
Firstly, make sure pacman's log file is present:<br />
$ ls /var/log/pacman.log<br />
<br />
If it does not exist, it is ''not'' possible to continue with this method. You may be able to use [http://bbs.archlinux.org/viewtopic.php?pid=670876 Xyne's package detection script] to recreate the database. If not, then the likely solution is to re-install the entire system.<br />
<br />
====Log filter script====<br />
Create a script with the following content <sup>based on [http://bbs.archlinux.org/viewtopic.php?id=38531]</sup>:<br />
{{hc|log2pkglist.awk|2=<br />
<nowiki><br />
#!/bin/awk -f<br />
<br />
$3 ~ /^(installed|upgraded)$/ {<br />
pkg[$4] = 1<br />
next<br />
} <br />
<br />
$3 == "removed" {<br />
pkg[$4] = 0<br />
} <br />
<br />
END {<br />
for (i in pkg) if (pkg[i]) print i<br />
}<br />
</nowiki><br />
}}<br />
<br />
Make the script executable:<br />
$ chmod +x log2pkglist.awk<br />
<br />
====Generating the package recovery list====<br />
Run the script and pipe the output to a temporary list:<br />
$ ./log2pkglist.awk /var/log/pacman.log > pkglist.orig<br />
<br />
Optionally edit {{ic|pkglist.orig}} and remove anything that should not be re-installed. This might be the situation with custom packages made with [[ABS]], for example.<br />
<br />
Here is a way to automatically restrict the list to packages available in a repository:<br />
$ { cat pkglist.orig; pacman -Slq; } | sort | uniq -d > pkglist<br />
<br />
Check if some important ''base'' package are missing, and add them to the list:<br />
$ comm -23 <(pacman -Sgq base) pkglist.orig >> pkglist<br />
<br />
Proceed once the contents of {{ic|pkglist}} are satisfactory, since they will be used it restore pacman's installed package database; {{ic|/var/lib/pacman/local/}}.<br />
<br />
====Performing the recovery====<br />
As a normal user, make temporary directories for the cache, database, and root:<br />
{{bc|1=<br />
tmp=~/tmp<br />
mkdir -p "${tmp}"<br />
<br />
pushd "${tmp}"<br />
dbpath=$(readlink -f ./dbpath)<br />
root=$(readlink -f ./root)<br />
cache=$(readlink -f ./cache)<br />
log=/dev/null<br />
mkdir -p "${dbpath}" "${cache}" "${root}"<br />
popd<br />
<br />
recovery-pacman() {<br />
fakeroot pacman "$@" \<br />
--dbpath "${dbpath}" \<br />
--root "${root}" \<br />
--cache "${cache}" \<br />
--log "${log}" \<br />
--noscriptlet \<br />
#<br />
}<br />
}}<br />
<br />
Populate the temporary sync database:<br />
$ recovery-pacman -Sy<br />
or copy the system's sync database:<br />
$ cp -r /var/lib/pacman/sync "${dbpath}"<br />
<br />
To avoid downloading and/or processing packages that are present in the system's local database (or whatever remains of it), optionally copy it into the temporary location:<br />
$ cp -r /var/lib/pacman/local "${dbpath}"<br />
<br />
Generate the temporary local recovery database from the previously generated {{ic|pkglist}}:<br />
$ recovery-pacman -S --nodeps --needed $(< pkglist)<br />
<br />
{{note|Because {{Ic|--noscriptlet}} is needed, the files owned by packages in the fake root will not be representative of a real install.}}<br />
<br />
After revising the database, conclude by copying it to the real destination:<br />
# cp -r "${dbpath}"/local /var/lib/pacman<br />
<br />
Finally update the local database so that packages that are not required by any other package are marked as explicitly installed and the other as dependences. You will need be extra careful in the future when removing packages, but with the original database lost is the best we can do.<br />
# pacman -D --asdeps $(pacman -Qq)<br />
# pacman -D --asexplicit $(pacman -Qtq)<br />
<br />
===Recovering a USB key from existing install===<br />
If you have Arch installed on a USB key and manage to mess it up (e.g. removing it while it is still being written to), then it is possible to re-install all the packages and hopefully get it back up and working again (assuming USB key is mounted in /newarch)<br />
# pacman -S $(pacman -Qq --dbpath /newarch/var/lib/pacman) --root /newarch --dbpath /newarch/var/lib/pacman<br />
<br />
===Extracting contents of a .pkg file===<br />
The {{ic|.pkg}} files ending in {{ic|.xz}} are simply tar'ed archives that can be decompressed with:<br />
$ tar -Jxvf package.tar.xz<br />
If you want to extract a couple of files out of a {{ic|.pkg}} file, this would be a way to do it.</div>Zendeavorhttps://wiki.archlinux.org/index.php?title=Polipo&diff=175730Polipo2011-12-23T22:14:07Z<p>Zendeavor: /* Tunneling */</p>
<hr />
<div>[[Category:Proxy servers (English)]]<br />
[[Category:Daemons and system services (English)]]<br />
{{i18n|Polipo}}<br />
{{expansion}}<br />
From [http://www.pps.jussieu.fr/~jch/software/polipo/ Polipo's site]:<br />
:"''Polipo is a small and fast caching web proxy (a web cache, an HTTP proxy, a proxy server). While Polipo was designed to be used by one person or a small group of people, there is nothing that prevents it from being used by a larger group.''"<br />
<br />
Unlike [[Squid]], Polipo is very light on resources and simple to configure. This makes it ideal for single user systems and other uncomplicated setups. Do keep in mind; however, that this versatility comes at a cost; Polipo will increase its space usage without restriction as it is not aware of how big its disk cache grows. This perceived fault is by design, since omitting these sanity checks drastically reduces Polipo's memory usage and overall toll on the system. A practical way of restricting disk usage is by making Polipo run as its own user and employing [[disk quota]].<br />
<br />
The following covers installing and setting up Polipo.<br />
<br />
==Installation==<br />
<br />
Install {{Package Official|polipo}} using [[pacman]]:<br />
# pacman -S polipo<br />
<br />
Alternatively, install the newer development branch [http://aur.archlinux.org/packages.php?ID=32630 polipo-git] from the [[AUR]] instead.<br />
<br />
==Improving Polipo==<br />
<br />
===Run Polipo as designated user===<br />
Polipo should run as an unpriviledged user. Such a user can either be created or reused:<br />
# mkdir /var/cache/polipo<br />
# groupadd -r polipo<br />
# useradd -d /var/cache/polipo -g polipo -r -s /bin/false polipo<br />
<br />
To make sure all files and folders are created before you start polipo as an a designated user. Start and stop the Polipo.<br />
<br />
# /etc/rc.d/polipo start<br />
# /etc/rc.d/polipo stop<br />
<br />
While other daemons start as root and drop priviledges as soon as possible, polipo runs as the user that invoked it. If polipo is invoked from {{filename|/etc/rc.d/polipo}}, change the invokation line from <br />
/usr/bin/$DAEMON $ARGS >/dev/null 2>&1<br />
to<br />
su -c "/usr/bin/$DAEMON $ARGS" -s /bin/sh polipo >/dev/null 2>&1<br />
<br />
It is then also necessary to change ownership and/or permissions of several files and directories written by polipo:<br />
<br />
# chown polipo:polipo /var/log/polipo<br />
# chown -R polipo:polipo /var/run/polipo<br />
# chown -R polipo:polipo /var/cache/polipo<br />
<br />
Although a better choice is to create a directory {{filename|/var/log/polipo}} owned by the designated user and set polipo's log file to {{filename|/var/log/polipo/polipo.log}} via the logFile variable in the config file.<br />
<br />
==Starting the daemon==<br />
To start the Polipo daemon:<br />
# /etc/rc.d/polipo start<br />
<br />
Add it to {{filename|/etc/rc.conf}} to start it automatically at boot:<br />
DAEMONS=(syslog-ng network netfs '''polipo''' crond)<br />
<br />
===Multiple instances===<br />
Polipo can also run without super user privileges. To do so, first copy {{filename|/etc/polipo/config.sample}} to a suitable directory:<br />
$ cp /etc/polipo/config.sample ~/.poliporc<br />
<br />
Edit it so that it points at a writable location, instead of {{filename|/var/cache/polipo}}:<br />
# Uncomment this if you want to put the on-disk cache in a<br />
# non-standard location:<br />
diskCacheRoot = "~/.polipo-cache/"<br />
<br />
Create the cache directory:<br />
$ mkdir ~/.polipo-cache<br />
<br />
Finally, launch Polipo with the new configuration:<br />
$ polipo -c ~/.poliporc<br />
<br />
==Configuration==<br />
Management is mostly performed in {{filename|/etc/polipo/config}}. Most users can opt for using the sample configuration file, which is sufficient for most situations and well documented.<br />
# cd /etc/polipo; cp config.sample config<br />
<br />
One element of configuration that warrants mentioning is polipo's default behavior of blocking outbound connections by port. There are two variables in polipo's config file that control allowed outbound ports. {{Ic|allowedPorts}} specifies ports for outbound HTTP connections. It defaults to 80-100 and 1024-65535. {{Ic|tunnelAllowedPorts}} specifies ports polipo will allow tunnel traffic to as well as HTTPS traffic. By default it is much more restricted: "''It defaults to allowing ssh, HTTP, https, rsync, IMAP, imaps, POP, pops, Jabber, CVS and Git traffic.''" <br />
<br />
If you see a "403 Forbidden Port" error message from polipo when attempting to browse to a host:port, you need to configure polipo to accept traffic to more ports for either HTTP or HTTPS. To set them wide open, add the following to {{filename|/etc/polipo/config}}:<br />
allowedPorts = 1-65535<br />
tunnelAllowedPorts = 1-65535<br />
<br />
Unlike other proxies, Polipo needs to be restarted after alterations.<br />
<br />
===Browser===<br />
Set the browser so that it uses {{Ic|localhost:8123}} for proxying. Be sure to disable the browser's disk cache to avoid redundant IO operations and bad performance.<br />
<br />
===Tunneling===<br />
{{note|According to the [http://www.pps.jussieu.fr/~jch/software/polipo/faq.html Polipo FAQ] on "intercepting proxy" this is not possible/supported!}}<br />
<br />
{{note|this requires to run Polipo as its own user.}}<br />
<br />
Instead of manually configuring each browser or other utilities that might benefit from Polipo's caching, one can also use [[iptables]] to route traffic through polipo.<br />
<br />
After installing iptables, add the appropiate rules to {{filename|/etc/iptables/iptables.rules}}:<br />
*nat<br />
:PREROUTING ACCEPT [0:0]<br />
:POSTROUTING ACCEPT [0:0]<br />
:OUTPUT ACCEPT [0:0]<br />
''-A OUTPUT -p tcp --dport 80 -m owner ! --uid-owner polipo -j ACCEPT''<br />
''-A OUTPUT -p tcp --dport 80 -j REDIRECT --to-ports 8123''<br />
COMMIT<br />
This routes HTTP traffic through Polipo. Remove all proxy settings from browsers, if any, and restart iptables.<br />
<br />
===Privoxy===<br />
[[Privoxy]] is a proxy useful for intercepting advertisement and other undesirables.<br />
<br />
According to Polipo's developer, in order to get the privacy enhancements of Privoxy and much (but not all) of the performance of Polipo, one should place Polipo upstream of Privoxy.<br />
<br />
In other words:<br />
*point the browser at Privoxy: {{Ic|localhost:8118}}<br />
*and direct Privoxy traffic to Polipo: {{Ic|forward / localhost:8123}} in the Privoxy configuration file.<br />
<br />
===Tor===<br />
[[Tor]] is an anonymizing proxy network.<br />
<br />
To use Polipo with Tor, uncomment or include the following in {{Ic|/etc/polipo/config}}:<br />
socksParentProxy = localhost:9050<br />
socksProxyType = socks5<br />
<br />
===DansGuardian===<br />
[[DansGuardian]] is a web content filter. The only difference to using [[DansGuardian]] with Polipo (rather than squid or tinyproxy) is that in {{filename|dansguardian.conf}} the proxyport needs to be set to polipo's 8123:<br />
# the port DansGuardian connects to proxy on<br />
proxyport = 8123<br />
<br />
==More resources==<br />
*[http://www.pps.jussieu.fr/~jch/software/polipo/faq.html Polipo FAQ]<br />
*[http://www.pps.jussieu.fr/~jch/software/polipo/manual/index.html The Polipo Manual]</div>Zendeavorhttps://wiki.archlinux.org/index.php?title=Polipo&diff=175729Polipo2011-12-23T22:13:31Z<p>Zendeavor: /* Tunneling */</p>
<hr />
<div>[[Category:Proxy servers (English)]]<br />
[[Category:Daemons and system services (English)]]<br />
{{i18n|Polipo}}<br />
{{expansion}}<br />
From [http://www.pps.jussieu.fr/~jch/software/polipo/ Polipo's site]:<br />
:"''Polipo is a small and fast caching web proxy (a web cache, an HTTP proxy, a proxy server). While Polipo was designed to be used by one person or a small group of people, there is nothing that prevents it from being used by a larger group.''"<br />
<br />
Unlike [[Squid]], Polipo is very light on resources and simple to configure. This makes it ideal for single user systems and other uncomplicated setups. Do keep in mind; however, that this versatility comes at a cost; Polipo will increase its space usage without restriction as it is not aware of how big its disk cache grows. This perceived fault is by design, since omitting these sanity checks drastically reduces Polipo's memory usage and overall toll on the system. A practical way of restricting disk usage is by making Polipo run as its own user and employing [[disk quota]].<br />
<br />
The following covers installing and setting up Polipo.<br />
<br />
==Installation==<br />
<br />
Install {{Package Official|polipo}} using [[pacman]]:<br />
# pacman -S polipo<br />
<br />
Alternatively, install the newer development branch [http://aur.archlinux.org/packages.php?ID=32630 polipo-git] from the [[AUR]] instead.<br />
<br />
==Improving Polipo==<br />
<br />
===Run Polipo as designated user===<br />
Polipo should run as an unpriviledged user. Such a user can either be created or reused:<br />
# mkdir /var/cache/polipo<br />
# groupadd -r polipo<br />
# useradd -d /var/cache/polipo -g polipo -r -s /bin/false polipo<br />
<br />
To make sure all files and folders are created before you start polipo as an a designated user. Start and stop the Polipo.<br />
<br />
# /etc/rc.d/polipo start<br />
# /etc/rc.d/polipo stop<br />
<br />
While other daemons start as root and drop priviledges as soon as possible, polipo runs as the user that invoked it. If polipo is invoked from {{filename|/etc/rc.d/polipo}}, change the invokation line from <br />
/usr/bin/$DAEMON $ARGS >/dev/null 2>&1<br />
to<br />
su -c "/usr/bin/$DAEMON $ARGS" -s /bin/sh polipo >/dev/null 2>&1<br />
<br />
It is then also necessary to change ownership and/or permissions of several files and directories written by polipo:<br />
<br />
# chown polipo:polipo /var/log/polipo<br />
# chown -R polipo:polipo /var/run/polipo<br />
# chown -R polipo:polipo /var/cache/polipo<br />
<br />
Although a better choice is to create a directory {{filename|/var/log/polipo}} owned by the designated user and set polipo's log file to {{filename|/var/log/polipo/polipo.log}} via the logFile variable in the config file.<br />
<br />
==Starting the daemon==<br />
To start the Polipo daemon:<br />
# /etc/rc.d/polipo start<br />
<br />
Add it to {{filename|/etc/rc.conf}} to start it automatically at boot:<br />
DAEMONS=(syslog-ng network netfs '''polipo''' crond)<br />
<br />
===Multiple instances===<br />
Polipo can also run without super user privileges. To do so, first copy {{filename|/etc/polipo/config.sample}} to a suitable directory:<br />
$ cp /etc/polipo/config.sample ~/.poliporc<br />
<br />
Edit it so that it points at a writable location, instead of {{filename|/var/cache/polipo}}:<br />
# Uncomment this if you want to put the on-disk cache in a<br />
# non-standard location:<br />
diskCacheRoot = "~/.polipo-cache/"<br />
<br />
Create the cache directory:<br />
$ mkdir ~/.polipo-cache<br />
<br />
Finally, launch Polipo with the new configuration:<br />
$ polipo -c ~/.poliporc<br />
<br />
==Configuration==<br />
Management is mostly performed in {{filename|/etc/polipo/config}}. Most users can opt for using the sample configuration file, which is sufficient for most situations and well documented.<br />
# cd /etc/polipo; cp config.sample config<br />
<br />
One element of configuration that warrants mentioning is polipo's default behavior of blocking outbound connections by port. There are two variables in polipo's config file that control allowed outbound ports. {{Ic|allowedPorts}} specifies ports for outbound HTTP connections. It defaults to 80-100 and 1024-65535. {{Ic|tunnelAllowedPorts}} specifies ports polipo will allow tunnel traffic to as well as HTTPS traffic. By default it is much more restricted: "''It defaults to allowing ssh, HTTP, https, rsync, IMAP, imaps, POP, pops, Jabber, CVS and Git traffic.''" <br />
<br />
If you see a "403 Forbidden Port" error message from polipo when attempting to browse to a host:port, you need to configure polipo to accept traffic to more ports for either HTTP or HTTPS. To set them wide open, add the following to {{filename|/etc/polipo/config}}:<br />
allowedPorts = 1-65535<br />
tunnelAllowedPorts = 1-65535<br />
<br />
Unlike other proxies, Polipo needs to be restarted after alterations.<br />
<br />
===Browser===<br />
Set the browser so that it uses {{Ic|localhost:8123}} for proxying. Be sure to disable the browser's disk cache to avoid redundant IO operations and bad performance.<br />
<br />
===Tunneling===<br />
{{note|According to the [http://www.pps.jussieu.fr/~jch/software/polipo/faq.html Polipo FAQ] on "intercepting proxy" this is not possible/supported!}}<br />
<br />
{{note|this requires to run Polipo as its own user.}}<br />
<br />
Instead of manually configuring each browser or other utilities that might benefit from Polipo's caching, one can also use [[iptables]] to route traffic through polipo.<br />
<br />
After installing iptables, add the appropiate rules to {{filename|/etc/iptables/iptables.rules}}:<br />
*nat<br />
:PREROUTING ACCEPT [0:0]<br />
:POSTROUTING ACCEPT [0:0]<br />
:OUTPUT ACCEPT [0:0]<br />
''-A OUTPUT -p tcp --dport 80 -m ! owner --uid-owner polipo -j ACCEPT''<br />
''-A OUTPUT -p tcp --dport 80 -j REDIRECT --to-ports 8123''<br />
COMMIT<br />
This routes HTTP traffic through Polipo. Remove all proxy settings from browsers, if any, and restart iptables.<br />
<br />
===Privoxy===<br />
[[Privoxy]] is a proxy useful for intercepting advertisement and other undesirables.<br />
<br />
According to Polipo's developer, in order to get the privacy enhancements of Privoxy and much (but not all) of the performance of Polipo, one should place Polipo upstream of Privoxy.<br />
<br />
In other words:<br />
*point the browser at Privoxy: {{Ic|localhost:8118}}<br />
*and direct Privoxy traffic to Polipo: {{Ic|forward / localhost:8123}} in the Privoxy configuration file.<br />
<br />
===Tor===<br />
[[Tor]] is an anonymizing proxy network.<br />
<br />
To use Polipo with Tor, uncomment or include the following in {{Ic|/etc/polipo/config}}:<br />
socksParentProxy = localhost:9050<br />
socksProxyType = socks5<br />
<br />
===DansGuardian===<br />
[[DansGuardian]] is a web content filter. The only difference to using [[DansGuardian]] with Polipo (rather than squid or tinyproxy) is that in {{filename|dansguardian.conf}} the proxyport needs to be set to polipo's 8123:<br />
# the port DansGuardian connects to proxy on<br />
proxyport = 8123<br />
<br />
==More resources==<br />
*[http://www.pps.jussieu.fr/~jch/software/polipo/faq.html Polipo FAQ]<br />
*[http://www.pps.jussieu.fr/~jch/software/polipo/manual/index.html The Polipo Manual]</div>Zendeavorhttps://wiki.archlinux.org/index.php?title=GRUB&diff=168887GRUB2011-11-06T06:40:13Z<p>Zendeavor: /* Boot Microsoft Windows installed in BIOS-MBR mode */</p>
<hr />
<div>[[Category:Boot loaders (English)]]<br />
{{i18n|GRUB2}}<br />
[[fr:GRUB2]]<br />
{{Article summary start}}<br />
{{Article summary text|Covers various aspects of the next generation of the GRand Unified Bootloader (GRUB2).}}<br />
{{Article summary heading|Overview}}<br />
{{Article summary text|{{Boot process overview}}}}<br />
{{Article summary heading|Related}}<br />
{{Article summary wiki|Burg}} - Burg is a brand-new boot loader based on GRUB2. It uses a new object format which allows it to be built in a wider range of OS, including Linux/Windows/OSX/Solaris/FreeBSD, etc. It also has a highly configurable menu system which works in both text and graphic mode. <br />
{{Article summary heading|Resources}}<br />
{{Article summary link|GNU GRUB -- GNU Project|http://www.gnu.org/software/grub/}}<br />
{{Article summary link|GNU GRUB Wiki|http://grub.enbug.org/}}{{Linkrot|2011|09|05}}<br />
{{Article summary end}}<br />
<br />
[http://www.gnu.org/software/grub/ GRUB2] is the next generation of the GRand Unified Bootloader (GRUB). GRUB2 is derived from [http://www.nongnu.org/pupa/ PUPA] which was a research project to investigate the next generation of GRUB. GRUB 2 has been rewritten from scratch to clean up everything and provide modularity and portability [http://www.gnu.org/software/grub/grub-faq.en.html#q1].<br />
<br />
Briefly, the ''bootloader'' is the first software program that runs when a computer starts. It is responsible for loading and transferring control to the Linux kernel. The kernel, in turn, initializes the rest of the operating system.<br />
<br />
== Preface ==<br />
<br />
Although, [[GRUB]] (i.e. version 0.9x) is the de facto standard bootloader of Linux, it is considered 'legacy' by upstream. It is being replaced by GRUB2 in many distributions. Upstream recommends GRUB2 >=1.99~rc2 over grub-legacy, even for current grub-legacy users.<br />
<br />
{{Note|grub2 from 1.99~rc2 and later supports btrfs as root (without a separate /boot filesystem).}}<br />
<br />
=== Notes for current GRUB Legacy users ===<br />
<br />
* There are differences in the commands of GRUB and GRUB2. Familiarize yourself with [http://www.gnu.org/software/grub/manual/grub.html#Commands GRUB2 commands] before proceeding (e.g. "find" has been replaced with "search").<br />
<br />
* GRUB2 is now ''modular'' and no longer requires "stage 1.5". As a result, the bootloader itself is limited -- modules are loaded from the hard drive as needed to expand functionality (e.g. for [[LVM]] or RAID support).<br />
<br />
* Device naming has changed between GRUB and GRUB2. Partitions are numbered from 1 instead of 0 while drives are still numbered from 0, and prefixed with partition-table type. For example, {{Filename|/dev/sda1}} would be referred to as {{Codeline|(hd0,msdos1)}} (for MBR) or {{Codeline|(hd0,gpt1)}} (for GPT) using GRUB2.<br />
<br />
=== Preliminary Requirements for GRUB2 ===<br />
<br />
==== BIOS systems ====<br />
<br />
===== [[GPT]] specific instructions =====<br />
<br />
GRUB2 in BIOS-GPT configuration requires a BIOS Boot Partition to embed its core.img in the absence of post-MBR gap in GPT partitioned systems (which is taken over by the GPT Primary Header and Primary Partition table). This partition is used by GRUB2 only in BIOS-GPT setups. No such partition type exists in case of MBR partitioning (at least not for GRUB2). This partition is also not required if the system is UEFI based, as no embedding of bootsectors takes place in that case. Syslinux does not require this partition.<br />
<br />
For a BIOS-GPT configuration, create a 2 MiB partition using cgdisk or GNU Parted with no filesystem. The location of the partition in the partition table does not matter but it should be within the first 2 TiB region of the disk. It is advisable to put it somewhere in the beginning of the disk before the /boot partition. Set the partition type to "EF02" in cgdisk or {{Codeline|set <BOOT_PART_NUM> bios_grub on}} in GNU Parted.<br />
<br />
{{Note|This partition should be created before grub_bios-install or grub-setup is run or before the '''Install Bootloader''' step of the Archlinux installer (if GRUB2 BIOS is selected as bootloader).}}<br />
<br />
===== [[MBR]] aka msdos partitioning specific instructions =====<br />
<br />
Usually the post-MBR gap (after the 512 byte MBR region and before the start of the 1st partition) in many MBR (or msdos disklabel) partitioned systems is 32 KiB when DOS compatibility cylinder alignment issues are satisfied in the partition table. However a post-MBR gap of about 1 to 2 MiB is recommended to provide sufficient room for embedding grub2's core.img ( https://bugs.archlinux.org/task/24103 ). It is advisable to use a partitioner which supports 1 MiB partition alignment to obtain this space as well as satisfy other non-512 byte sector issues (which are unrelated to embedding of core.img).<br />
<br />
If you do not dual-boot with MS Windows (any version) in BIOS systems, it is advisable to switch to GPT partitioning - [[GUID_Partition_Table#Convert_from_MBR_to_GPT_without_data_loss]]<br />
<br />
{{Note|Create the 2MiB partition mentioned above BEFORE you convert to GPT. If you do not, gparted will not resize your boot partition to allow its creation, and when you reboot grub2 will not know where to look.}}<br />
<br />
==== UEFI systems ====<br />
<br />
===== Create and Mount the UEFI SYSTEM PARTITION =====<br />
<br />
Follow [[Unified_Extensible_Firmware_Interface#Creating_a_UEFI_SYSTEM_PARTITION_in_Linux]] for instructions on creating a UEFI SYSTEM PARTITION. Then mount the UEFI SYSTEM PARTITION at {{Filename|/boot/efi}}. It should be FAT32 formatted and should be >=200 MiB in size. If you have mounted the UEFISYS partition in some other mountpoint, replace {{Filename|/boot/efi}} in the below instructions with that mountpoint:<br />
<br />
# mkdir -p /boot/efi<br />
# mount -t vfat <UEFISYS_PART_DEVICE> /boot/efi<br />
<br />
Create a <UEFI_SYSTEM_PARTITION>/efi directory if it does not exist:<br />
<br />
# mkdir -p /boot/efi/efi<br />
<br />
== Installation ==<br />
<br />
=== During Arch Linux installation ===<br />
<br />
* Skip the '''Install Bootloader''' step and exit the installer.<br />
* Configure the network:<br />
# aif -p partial-configure-network<br />
This will bring up a prompt; put in the network interface to use, (e.g., eth0) and use DHCP for easy configuration.<br />
* If you did not configure the installed system's {{Filename|/etc/resolv.conf}} file during installation (for instance, if you plan to let DHCP generate it later), you will need to copy the one generated by AIF when it configured the network:<br />
# cp /etc/resolv.conf /mnt/etc/resolv.conf<br />
* Load the dm-mod module (you might need grub2-bios; install the package if needed):<br />
# modprobe dm-mod<br />
{{Note|This is necessary at this point, and cannot be postponed after the chroot. If you try to use modprobe in a chroot environment that has a later kernel version from that of the installing device (at the time of writing, 2.6.33), modprobe will fail. This happens routinely using the Arch "net" installations.}}<br />
* From the installer's live shell, chroot to the installed system:<br />
# mount -o bind /dev /mnt/dev<br />
# chroot /mnt bash<br />
* Update pacman's database:<br />
# pacman-db-upgrade<br />
* Refresh the package list (with an extra -y flag to force a refresh of all package lists even if they appear to be up to date):<br />
# pacman -Syy<br />
* Install the GRUB2 package as mentioned in the section [[#From a running Arch Linux]]. Note that the dm-mod module has already been loaded, no need to do that again.<br />
<br />
=== From a running Arch Linux ===<br />
<br />
==== BIOS systems ====<br />
<br />
===== Make a backup of your precious data =====<br />
<br />
In general, a grub installation should run smoothly . Sometimes it could mess up your system. You're strongly advised to make a backup before installing grub2-bios.<br />
<br />
* copy grub modules and configuration<br />
<br />
# cp -a /boot/grub /path/to/backup/<br />
<br />
* backup the MBR and GRUB-Legacy stage 1.5<br />
<br />
# dd if=/dev/sdX of=/path/to/backup/first-sectors bs=512 count=63<br />
<br />
Replace /dev/sdaX with you disk path (mostly /dev/sda).<br />
<br />
{{Note|This command backs up the partition table too. Be careful while restoring if you've changed your partition setup in the meantime}}<br />
<br />
To backup only the MBR boot code use:<br />
<br />
# dd if=/dev/sdX of=/path/to/backup/mbr-boot-code bs=440 count=1<br />
<br />
You could now lightly remove {{Filename|/boot/grub}} with:<br />
<br />
# rm -rf /boot/grub<br />
<br />
and follow the instructions below. You know that if things get nasty, you could reboot your system thanks to an installation media and :<br />
<br />
* move old grub-legacy or grub2 files out of the way<br />
<br />
# mv /boot/grub /boot/grub.nonfunctional<br />
<br />
* copy grub back to /boot<br />
<br />
# cp -a /path/to/backup/grub /boot/<br />
<br />
* replace MBR and next 62 sectors of sda with backed up copy (DANGEROUS!)<br />
<br />
# dd if=/path/to/backup/first-sectors of=/dev/sdX bs=512 count=63<br />
<br />
{{Note|This command also restores the partition table. Be careful.}}<br />
<br />
To restore only the MBR boot code use:<br />
<br />
# dd if=/path/to/backup/mbr-boot-code of=/dev/sdX bs=440 count=1<br />
<br />
===== Before grub_bios-install =====<br />
<br />
The GRUB2 package can be installed with pacman (and will replace {{Package Official|grub}}, if it is installed):<br />
<br />
# pacman -S grub2-bios<br />
<br />
{{Note|Installing grub2-common (a dependency of grub2-bios) 1.99~rc1 or later, may take forever in some systems since the post_install script runs grub-mkconfig and this script does not provide the option <code>--no-floppy</code>. For more details search this option in the article.}}<br />
<br />
{{Note|Simply installing the package won't update the /boot/grub/core.img file and the grub2 modules in /boot/grub . You need to update the core.img file and the grub2 modules manually using grub_bios-install as explained below.}}<br />
<br />
Also load the device-mapper kernel module without which grub-probe does not reliably detect disks and partitions:<br />
<br />
# modprobe dm-mod<br />
<br />
===== Run grub_bios-install =====<br />
<br />
There are 3 ways to install grub2 in BIOS booting - [[#Install_to_440-byte_MBR_boot_code_region]] (recommended) , [[#Install_to_Partition_or_Partitionless_Disk]] (not recommended) or [[#Generate_core.img_alone]] (safest method, but requires another BIOS bootloader like [[grub-legacy]] or [[syslinux]] to be installed to chainload {{Filename|/boot/grub/core.img}} ). For all the ways [[#Before_grub_bios-install]] step is needed.<br />
<br />
====== Install to 440-byte MBR boot code region ======<br />
<br />
To setup grub2-bios in the 440-byte Master Boot Record boot code region, populate the {{Filename|/boot/grub}} directory, generate the {{Filename|/boot/grub/core.img}} file, and embed it in the 32 KiB (minimum size - varies depending on partition alignment) post-MBR gap (MBR disks) or in BIOS Boot Partition (GPT disks), run:<br />
<br />
# grub_bios-install --boot-directory=/boot --no-floppy --recheck /dev/sda<br />
<br />
where {{Filename|/dev/sda}} is the destination of the installation (in this case the MBR of the first SATA disk). If you use [[LVM]] for your {{Filename|/boot}}, you can install GRUB2 on multiple physical disks. <br />
<br />
The {{Codeline|--no-floppy}} tells grub2-bios utilities not to search for any floppy devices which reduces the overall execution time of grub_bios-install on many systems (it will also prevent the issue below from occuring). Otherwise you get an error like this:<br />
<br />
grub-probe: error: Cannot get the real path of '/dev/fd0'<br />
Auto-detection of a filesystem module failed.<br />
Please specify the module with the option '--modules' explicitly.<br />
<br />
Follow [[#Generate_GRUB2_BIOS_Config_file]] or if that fails, convert your {{Filename|/boot/grub/menu.lst}} file to {{Filename|/boot/grub/grub.cfg}} using:<br />
<br />
# grub-menulst2cfg /boot/grub/menu.lst /boot/grub/grub.cfg<br />
<br />
For example:<br />
<br />
{{File|name=/boot/grub/menu.lst|content=<br />
default=0<br />
timeout=5<br />
<br />
title Arch Linux Stock Kernel<br />
root (hd0,0)<br />
kernel /vmlinuz-linux root=/dev/sda2 ro<br />
initrd /initramfs-linux.img<br />
<br />
title Arch Linux Stock Kernel Fallback<br />
root (hd0,0)<br />
kernel /vmlinuz-linux root=/dev/sda2 ro<br />
initrd /initramfs-linux-fallback.img<br />
}}<br />
<br />
{{File|name=/boot/grub/grub.cfg|content=<br />
set default='0'; if [ x"$default" = xsaved ]; then load_env; set default="$saved_entry"; fi<br />
set timeout=5<br />
<br />
menuentry 'Arch Linux Stock Kernel' {<br />
set root='(hd0,1)'; set legacy_hdbias='0'<br />
legacy_kernel '/vmlinuz-linux' '/vmlinuz-linux' 'root=/dev/sda2' 'ro'<br />
legacy_initrd '/initramfs-linux.img' '/initramfs-linux.img'<br />
<br />
}<br />
<br />
menuentry 'Arch Linux Stock Kernel Fallback' {<br />
set root='(hd0,1)'; set legacy_hdbias='0'<br />
legacy_kernel '/vmlinuz-linux' '/vmlinuz-linux' 'root=/dev/sda2' 'ro'<br />
legacy_initrd '/initramfs-linux-fallback.img' '/initramfs-linux-fallback.img'<br />
}<br />
}}<br />
<br />
<br />
If you forgot to create a GRUB2 {{Filename|/boot/grub/grub.cfg}} configfile and simply rebooted into GRUB2 Command Shell, type:<br />
<br />
sh:grub> insmod legacycfg<br />
sh:grub> legacy_configfile ${prefix}/menu.lst<br />
<br />
Boot into Arch and re-create the proper GRUB2 {{Filename|/boot/grub/grub.cfg}} configfile.<br />
<br />
{{Note|This option works only in BIOS systems, not in UEFI systems.}}<br />
<br />
====== Install to Partition or Partitionless Disk ======<br />
<br />
{{Note|grub2-bios (any version - including upstream bzr repo) does not encourage installation to a partition boot sector or a partitionless disk like grub-legacy or syslinux does. Neither do the Arch devs.}}<br />
<br />
To setup grub2-bios to a partition boot sector, to a partitionless disk (also called superfloppy) or to a floppy disk, run (using for example /dev/sda1 as the /boot partition)<br />
<br />
# chattr -i /boot/grub/core.img<br />
# grub_bios-install --boot-directory=/boot --no-floppy --recheck --force /dev/sda1<br />
# chattr +i /boot/grub/core.img<br />
<br />
You need to use the {{Codeline|--force}} option to allow usage of blocklists and should not use <code>--grub-setup=/bin/true</code> (which is similar to simply generating core.img).<br />
<br />
grub_bios-install will give out warnings like which should give you the idea of what might go wrong with this approach.<br />
<br />
/sbin/grub-setup: warn: Attempting to install GRUB to a partitionless disk or to a partition. This is a BAD idea.<br />
/sbin/grub-setup: warn: Embedding is not possible. GRUB can only be installed in this setup by using blocklists. <br />
However, blocklists are UNRELIABLE and their use is discouraged.<br />
<br />
Without {{Codeline|--force}} you may get the below error and grub-setup will not setup its boot code in the partition boot sector.<br />
<br />
/sbin/grub-setup: error: will not proceed with blocklists<br />
<br />
With {{Codeline|--force}} you should get<br />
<br />
Installation finished. No error reported.<br />
<br />
The reason why grub-setup does not by default allow this is because in case of partition or a partitionless disk is that grub2-bios relies on embedded blocklists in the partition bootsector to locate the {{Filename|/boot/grub/core.img}} file and the prefix dir {{Filename|/boot/grub}} . The sector locations of {{Filename|core.img}} may change whenever the filesystem in the partition is being altered (files copied, deleted etc.). For more info see https://bugzilla.redhat.com/show_bug.cgi?id=728742 and https://bugzilla.redhat.com/show_bug.cgi?id=730915 .<br />
<br />
The workaround for this is to set the immutable flag on {{Filename|/boot/grub/core.img}} (using chattr command as mentioned above) so that the sector locations of the {{Filename|core.img}} file in the disk is not altered. The immutable flag on {{Filename|/boot/grub/core.img}} needs to be set only if grub2-bios is installed to a partition boot sector or a partitionless disk, not in case of installtion to MBR or simple generation of {{Filename|core.img}} without embedding any bootsector (mentioned above). <br />
<br />
====== Generate core.img alone ======<br />
<br />
To populate the {{Filename|/boot/grub}} directory and generate a {{Filename|/boot/grub/core.img}} file WITHOUT embedding any grub2-bios bootsector code in the MBR, post-MBR region, or the partition bootsector, add <code>--grub-setup=/bin/true</code> to grub_bios-install:<br />
<br />
# grub_bios-install --grub-setup=/bin/true --boot-directory=/boot --no-floppy --recheck /dev/sda<br />
<br />
You can then chainload grub2's core.img from grub-legacy or syslinux as a Linux kernel or a multiboot kernel.<br />
<br />
===== After grub_bios-install =====<br />
<br />
====== Generate GRUB2 BIOS Config file ======<br />
<br />
Finally, generate a configuration for grub2 (this is explained in greater detail in the Configuration section):<br />
<br />
# grub-mkconfig -o /boot/grub/grub.cfg<br />
<br />
If grub2 complains about "no suitable mode found" while booting, go to [[#Correct_GRUB2_No_Suitable_Mode_Found_Error]] .<br />
<br />
===== Multiboot in BIOS =====<br />
<br />
====== Boot Microsoft Windows installed in BIOS-MBR mode ======<br />
<br />
{{Note|GRUB2 supports booting {{Filename|bootmgr}} directly and chainload of partition boot sector is no longer required to boot Windows in a BIOS-MBR setup.}}<br />
<br />
Find the UUID of the NTFS filesystem of the Windows's SYSTEM PARTITION where the bootmgr and its files reside. For example, if Windows {{Filename|bootmgr}} exists at {{Filename|/media/Windows/bootmgr}}:<br />
<br />
# grub-probe --target=fs_uuid /media/Windows/bootmgr<br />
69B235F6749E84CE<br />
<br />
Then, add the below code to {{Filename|/etc/grub.d/40_custom}} and regenerate grub.cfg with grub-mkconfig as explained above to chainload Windows (Vista, 7 or 8) installed in BIOS-MBR mode :<br />
<br />
menuentry "Microsoft Windows 7 BIOS-MBR" {<br />
insmod part_msdos<br />
insmod ntfs<br />
insmod search_fs_uuid<br />
insmod ntldr <br />
search --fs-uuid --no-floppy --set=root 69B235F6749E84CE<br />
ntldr (${root})/bootmgr<br />
}<br />
<br />
For Windows XP<br />
<br />
menuentry "Microsoft Windows XP" {<br />
insmod part_msdos<br />
insmod ntfs<br />
insmod search_fs_uuid<br />
insmod ntldr <br />
search --fs-uuid --no-floppy --set=root 69B235F6749E84CE<br />
ntldr (${root})/ntldr<br />
}<br />
<br />
==== [[UEFI]] systems ====<br />
<br />
===== Before grub_efi_${UEFI_ARCH}-install =====<br />
<br />
{{Note|Unless specified as EFI 1.x , EFI and UEFI terms are used interchangeably to denote UEFI 2.x firmware. Also unless stated explicitely, the instructions are general and not Mac specific. Some of them may not work or may be different in Macs. Apple's EFI implementation is neither a EFI 1.x version nor UEFI 2.x version but mixes up both. This kind of firmware does not fall under any one UEFI Specification version and is therefore not a standard UEFI firmware.}}<br />
<br />
GRUB2 UEFI bootloader is available in Arch Linux only from version 1.99~rc1 . To install, first [https://wiki.archlinux.org/index.php/Unified_Extensible_Firmware_Interface#Detecting_UEFI_Firmware_Arch Detect which UEFI firmware arch] you have (either x86_64 or i386).<br />
<br />
Depending on that, install the appropriate package<br />
<br />
For 64-bit aka x86_64 UEFI firmware:<br />
# pacman -S grub2-efi-x86_64<br />
<br />
For 32-bit aka i386 UEFI firmware:<br />
# pacman -S grub2-efi-i386<br />
<br />
{{Note|Installing grub2-common (a dependency of grub2-bios) 1.99~rc1 or later, may take forever in some systems since the post_install script runs grub-mkconfig and this script does not provide the option <code>--no-floppy</code>. For more details search this option in the article.}}<br />
<br />
{{Note|Simply installing the package won't update the grub.efi file and the grub2 modules in the UEFI System Partition . You need to update the grub.efi file and the grub2 modules in the UEFI System Partition manually using grub_efi_${UEFI_ARCH}-install as explained below.}}<br />
<br />
Also load the device-mapper kernel module without which grub-probe does not reliably detect disks and partitions<br />
<br />
# modprobe dm-mod<br />
<br />
===== Run grub_efi_${UEFI_ARCH}-install =====<br />
<br />
====== Install to UEFI SYSTEM PARTITION ======<br />
<br />
{{Note|The below commands assume you are using {{Codeline|grub2-efi-x86_64}} (for {{Codeline|grub2-efi-i386}} replace {{Codeline|x86_64}} with {{Codeline|i386}} in the below commands).}}<br />
<br />
# grub_efi_x86_64-install --root-directory=/boot/efi --boot-directory=/boot/efi/efi --bootloader-id=grub --no-floppy --recheck<br />
<br />
The {{Codeline|grub_efi_x86_64-install}} automatically generates a {{Filename|grub.efi}} while setting up the {{Filename|/boot/efi/efi/grub/}} directory.<br />
<br />
If you notice carefully, there is no <device_path> option (Eg: {{Filename|/dev/sda}}) at the end of the {{Codeline|grub_efi_x86_64-install}} command unlike the case of setting up grub2 for BIOS systems. Any <device_path> provided will be ignored by the install script as UEFI bootloaders do not use MBR or Partition boot sectors at all.<br />
<br />
You may now be able to UEFI boot your system by creating a grub.cfg file using grub-mkconfig and copying /boot/efi/efi/grub/grub.efi to /boot/efi/efi/boot/bootx64.efi.<br />
<br />
===== After grub_efi_${UEFI_ARCH}-install =====<br />
<br />
====== Launch GRUB2 as default in non-Mac UEFI systems ======<br />
<br />
{{Note|The below steps will not work if the system has been booted in BIOS mode and will not work if the UEFI processor architecture does not match the kernel one, i.e. x86_64 UEFI + ix86 32-bit Kernel and vice-versa config will not work.}}<br />
<br />
grub_efi_${UEFI_ARCH}-install will ensure {{Filename|/boot/efi/efi/grub/grub.efi}} is launched by default if it detects {{Codeline|efibootmgr}} and if it is able to access UEFI Runtime Services. {{Codeline|efibootmgr}} command will work only if you have booted the system in UEFI mode itself, since it '''requires access to UEFI Runtime Variables''' which are '''available only in UEFI boot mode''' (with "noefi" kernel parameter NOT being used). Initially the user is required to manually launch {{Filename|/boot/efi/efi/grub/grub.efi}} from the firmware itself (using maybe the UEFI Shell) if grub2-efi was installed in BIOS mode. Then {{Codeline|efibootmgr}} should be run to make grub2 as the default entry in the UEFI Boot Manager<br />
<br />
First boot into UEFI mode manually either using the firmware boot menu, UEFI shell, or using any UEFI capable bootable iso (Archboot or Ubuntu non-Mac iso). Use grub probe to determine the device path of your EFI System Partition:<br />
# grub-probe --target=device /boot/efi/efi/grub/grub.efi<br />
<br />
It should give something like {{Filename|/dev/sda1}} (used as example in the remaining steps). Load 'efivars' kernel module:<br />
# modprobe efivars<br />
<br />
If you get '''no such device found''' error for this command, that means you have not booted in UEFI mode or due to some reason the kernel is unable to access UEFI Runtime Variables.<br />
<br />
Verify whether there are files in ''/sys/firmware/efi/vars/'' directory. This directory and its contents are created by "efivars" kernel module and it will exist only if you have booted in UEFI mode without the "noefi" kernel parameter.<br />
<br />
# ls -1 /sys/firmware/efi/vars/<br />
<br />
Sample output (x86_64-UEFI 2.3.1 in x86_64 Kernel:<br />
<br />
# ls -1 /sys/firmware/efi/vars/<br />
Boot0000-8be4df61-93ca-11d2-aa0d-00e098032b8c/<br />
BootCurrent-8be4df61-93ca-11d2-aa0d-00e098032b8c/<br />
BootOptionSupport-8be4df61-93ca-11d2-aa0d-00e098032b8c/<br />
BootOrder-8be4df61-93ca-11d2-aa0d-00e098032b8c/<br />
ConIn-8be4df61-93ca-11d2-aa0d-00e098032b8c/<br />
ConInDev-8be4df61-93ca-11d2-aa0d-00e098032b8c/<br />
ConOut-8be4df61-93ca-11d2-aa0d-00e098032b8c/<br />
ConOutDev-8be4df61-93ca-11d2-aa0d-00e098032b8c/<br />
ErrOutDev-8be4df61-93ca-11d2-aa0d-00e098032b8c/<br />
Lang-8be4df61-93ca-11d2-aa0d-00e098032b8c/<br />
LangCodes-8be4df61-93ca-11d2-aa0d-00e098032b8c/<br />
MTC-eb704011-1402-11d3-8e77-00a0c969723b/<br />
MemoryTypeInformation-4c19049f-4137-4dd3-9c10-8b97a83ffdfa/<br />
PlatformLang-8be4df61-93ca-11d2-aa0d-00e098032b8c/<br />
PlatformLangCodes-8be4df61-93ca-11d2-aa0d-00e098032b8c/<br />
RTC-378d7b65-8da9-4773-b6e4-a47826a833e1/<br />
del_var<br />
new_var<br />
<br />
If ''/sys/firmware/efi/vars/'' directory is empty or does not exist, then {{Codeline|efibootmgr}} command will not work. If you are unable to make the ISO/CD/DVD/USB boot in UEFI mode try https://gitorious.org/tianocore_uefi_duet_builds/pages/Linux_Windows_BIOS_UEFI_boot_USB .<br />
<br />
If ''/sys/firmware/efi/vars/'' directory (along with the exists then run {{Codeline|efibootmgr}} and reboot:<br />
<br />
# efibootmgr --create --gpt --disk /dev/sda --part 1 --write-signature --label "GRUB2" --loader "\\EFI\\grub\\grub.efi"<br />
<br />
In the above command, {{Filename|/boot/efi/efi/grub/grub.efi}} can be split up as {{Filename|/boot/efi}} and {{Filename|/efi/grub/grub.efi}}, which translates to {{Filename|(/dev/sda)}} -> partition 1 -> {{Filename|\\EFI\\grub\\grub.efi}}. <br />
<br />
FAT32 filesystem is case-insensitive since it does not use UTF-8 encoding by default. In that case the firmware uses capital 'EFI' instead of small 'efi', therefore using {{Filename|\\EFI\\grub\\grub.efi}} or {{Filename|\\efi\\grub\\grub.efi}} does not matter (this will change if the filesystem encoding is UTF-8). UEFI uses backward slash as path separatoir (similar to Windows paths). In the above command "double" backward slashes are used instead of single ones, since a backward slash is used as a escape character by sh shells, the first backward slash escapes the second one so that the path {{Filename|\EFI\grub\grub.efi}} is passed to {{Codeline|efibootmgr}}.<br />
<br />
The 'label' is the name of the menu entry shown in the UEFI boot menu. This name is user's choice and does not affect the booting of the system. More info can be obtained from [http://linux.dell.com/cgi-bin/gitweb/gitweb.cgi?p=efibootmgr.git;a=blob_plain;f=README;hb=HEAD efibootmgr GIT README]<br />
<br />
If you have problems running GRUB2 in UEFI mode you can try the following (worked on an ASUS Z68 mainboard):<br />
<br />
# cp /boot/efi/efi/grub/grub.efi /boot/efi/shellx64.efi<br />
<br />
or<br />
<br />
# cp /boot/efi/efi/grub/grub.efi /boot/efi/efi/shellx64.efi<br />
or<br />
<br />
# cp /boot/efi/efi/grub/grub.efi /boot/efi/efi/shell/shellx64.efi<br />
<br />
After this launch the UEFI Shell from the UEFI setup/menu (in ASUS UEFI BIOS, switch to advanced mode, press Exit in the top right corner and choose "Launch EFI shell from filesystem device"). The grub2 menu will show up and you can boot into your system. Afterwards you can use efibootmgr to setup a menu entry (see above).<br />
<br />
====== Launch GRUB2 as default in Apple Mac EFI systems ======<br />
<br />
{{Note|Using {{Filename|efibootmgr}} in Apple Macs will brick the firmware and may need reflash of the motherboard ROM. There have been bug reports regarding this in Ubuntu/Launchpad bug tracker. Use bless command alone in case of Macs}}<br />
<br />
Use bless command from within Mac OS X to setup {{Filename|grub.efi}} as the default boot option. More info at https://help.ubuntu.com/community/UEFIBooting#Apple_Mac_EFI_systems_.28both_EFI_architecture.29 .<br />
<br />
====== Generate GRUB2 UEFI Config file ======<br />
<br />
Finally, generate a configuration for grub2 (this is explained in greater detail in the Configuration section):<br />
<br />
# grub-mkconfig -o /boot/efi/efi/grub/grub.cfg<br />
<br />
If grub2-uefi complains about "no suitable mode found" while booting, go to [[#Correct_GRUB2_No_Suitable_Mode_Found_Error]] .<br />
<br />
===== Generate a custom GRUB2 UEFI Application =====<br />
<br />
If you want, you can create a custom {{Filename|grub_custom.efi}} app using:<br />
# grub-mkimage -d /usr/lib/grub/x86_64-efi -O x86_64-efi -p "" -o /boot/efi/efi/grub/grub_custom.efi <GRUB2_Modules_to_be_included><br />
<br />
{{Note|The '''-p''' option is important for creating a portable {{Filename|grub_custom.efi}} app.}}<br />
<br />
There is no file-size restriction on {{Filename|grub_custom.efi}} either due to GRUB2 or due to the UEFI firmware. Therefore you can include any number of modules you want.<br />
<br />
A "{{Filename|grub.cfg}}" created for BIOS based GRUB2 will be sufficient for the UEFI GRUB2 as long as all the paths in the config are absolute paths. The {{Filename|grub.cfg}} file should exist in the same directory as {{Filename|grub.efi}} or {{Filename|grub_custom.efi}}.<br />
<br />
The {{Filename|grub.efi}} UEFI application can be launched using the firmware's "Boot Manager", "Boot from file" option or using the [https://wiki.archlinux.org/index.php/UEFI#UEFI_Shell UEFI Shell].<br />
<br />
Alternatively, you can also setup {{Filename|/boot/efi/efi/grub}} directory by copying all the files in {{Filename|/usr/lib/grub/x86_64-efi}} to {{Filename|/boot/efi/efi/grub}} and using the above grub-mkimage command to create a {{Filename|grub_custom.efi}} application. Just make sure you have the required modules embedded in {{Filename|grub_custom.efi}} to enable it to access the EFI SYSTEM PARTITION.<br />
<br />
A basic {{Filename|grub_custom.efi}} can be generated using the following command:<br />
# sudo grub-mkimage -d /usr/lib/grub/x86_64-efi -O x86_64-efi -p "" -o /boot/efi/efi/grub/grub_custom.efi part_gpt fat iso9660 udf normal chain linux \<br />
ls search search_fs_file search_fs_uuid search_label help boot configfile echo efi_gop<br />
<br />
===== Multiboot in UEFI =====<br />
<br />
====== Chainload Microsoft Windows x86_64 UEFI-GPT ======<br />
<br />
Find the UUID of the FAT32 filesystem in the UEFI SYSTEM PARTITION where the Windows UEFI Bootloader files reside. For example, if Windows {{Filename|bootmgfw.efi}} exists at {{Filename|/boot/efi/efi/Microsoft/Boot/bootmgfw.efi}} (ignore the upper-lower case differences since that is immaterial in FAT filesystem):<br />
<br />
# grub-probe --target=fs_uuid /boot/efi/efi/Microsoft/Boot/bootmgfw.efi<br />
1ce5-7f28<br />
<br />
Then, add this code to {{Filename|/boot/efi/efi/grub/grub.cfg}} to chainload Windows x86_64 (Vista SP1+, 7 or 8) installed in UEFI-GPT mode :<br />
<br />
menuentry "Microsoft Windows x86_64 UEFI-GPT" {<br />
insmod part_gpt<br />
insmod fat<br />
insmod search_fs_uuid<br />
insmod chain<br />
search --fs-uuid --no-floppy --set=root 1ce5-7f28<br />
chainloader (${root})/efi/Microsoft/Boot/bootmgfw.efi<br />
}<br />
<br />
== Manual Compilation ==<br />
<br />
=== For BIOS Systems ===<br />
<br />
GRUB2 for BIOS systems should be compiled as follows:<br />
<pre><br />
./autogen.sh<br />
<br />
./configure --with-platform=pc --prefix=/usr<br />
<br />
make<br />
<br />
make install<br />
</pre><br />
<br />
The <code>--with-platform=pc</code> generates grub2 for bios alone irrespective of the firmware of the build system.<br />
<br />
=== For UEFI Systems ===<br />
<br />
First [https://wiki.archlinux.org/index.php/Unified_Extensible_Firmware_Interface#Detecting_UEFI_Firmware_Arch Detect which UEFI Firmware arch] you have and then follow the compile instructions below:<br />
<pre><br />
./autogen.sh<br />
<br />
./configure --with-platform=efi --target=TARGET_UEFI_ARCH --prefix=/usr<br />
<br />
make<br />
<br />
make install<br />
</pre><br />
<br />
The "--target" option denotes the UEFI firmware arch. for which grub2 should be compiled, not the architecture of the linux kernel grub2 may boot. <br />
<br />
It is possible to use UEFI 64-bit firmware + GRUB2 as x86_64-EFI app loading a i686 linux kernel, as long as the kernel does not try to access UEFI Runtime Services. Vice-versa situation is also possible. But a x86_64 UEFI firmware cannot launch GRUB2 i386-efi app (unlike x86_64 Operating Systems), and a i386 UEFI firmware will not launch GRUB2 {{Codeline|x86_64-efi}} app. It is important to compile GRUB2 to match the architecture of the UEFI firmware.<br />
<br />
== Configuration ==<br />
<br />
The configuration files are {{Filename|/etc/default/grub}} and {{Filename|/etc/grub.d/*}}. These files are used to generate the {{Filename|/boot/grub/grub.cfg}} file. You can also choose to manually edit {{Filename|grub.cfg}}.<br />
<br />
=== grub-mkconfig ===<br />
<br />
The grub-mkconfig script can be used to generate a {{Filename|grub.cfg}} file. By default the script outputs to stdout. Note that gettext ― an optional dependency of the GRUB2 package ― is required by the grub-mkconfig script. To generate a {{Filename|grub.cfg}} file run the command:<br />
# grub-mkconfig -o /boot/grub/grub.cfg<br />
Note that grub-mkconfig probably has your grub directory hardcoded to /boot/grub, which is probably wrong if you're using UEFI. Either mount your efi grub directory at /boot/grub or edit the script.<br />
<br />
=== grub.cfg ===<br />
<br />
A basic grub file uses the following options<br />
* {{Codeline|(hdX,Y)}} is the partition {{Codeline|Y}} on disk {{Codeline|X}}, partition numbers starting at 1, disk numbers starting at 0<br />
* {{Codeline|1=set default=N}} is the default boot entry that is chosen after timeout for user action<br />
* {{Codeline|1=set timeout=M}} is the time {{Codeline|M}} to wait in seconds for a user selection before default is booted<br />
* {{Codeline|<nowiki>menuentry "title" {entry options}</nowiki>}} is a boot entry titled {{Codeline|title}}<br />
* {{Codeline|1=set root=(hdX,Y)}} sets the boot partition, where the kernel and GRUB modules are stored (boot need not be a separate partition, and may simply be a directory under the "root" partition ({{Filename|/}})<br />
<br />
An example configuration:<br />
<br />
{{File<br />
|name=/boot/grub/grub.cfg<br />
|content=<nowiki><br />
# Config file for GRUB2 - The GNU GRand Unified Bootloader<br />
# /boot/grub/grub.cfg<br />
<br />
# DEVICE NAME CONVERSIONS<br />
#<br />
# Linux Grub<br />
# -------------------------<br />
# /dev/fd0 (fd0)<br />
# /dev/sda (hd0)<br />
# /dev/sdb2 (hd1,2)<br />
# /dev/sda3 (hd0,3)<br />
#<br />
<br />
# Timeout for menu<br />
set timeout=5<br />
<br />
# Set default boot entry as Entry 0<br />
set default=0<br />
<br />
# (0) Arch Linux<br />
menuentry "Arch Linux" {<br />
set root=(hd0,1)<br />
linux /vmlinuz-linux root=/dev/sda3 ro<br />
initrd /initramfs-linux.img<br />
}<br />
<br />
## (1) Windows<br />
#menuentry "Windows" {<br />
#set root=(hd0,3)<br />
#chainloader +1<br />
#}<br />
</nowiki>}}<br />
<br />
=== Dual-booting ===<br />
<br />
''NOTE: If you want GRUB2 to automatically search for other systems, for example as in Ubuntu. Then you may need to download {{Package AUR|os-prober}} from the [[AUR]].''<br />
<br />
==== Using grub-mkconfig ====<br />
The best way to add other entries is editing the {{Filename|/etc/grub.d/40_custom}}. The entries in this file will be automatically added when running '''grub-mkconfig'''.<br />
After adding the new lines, run:<br />
# grub-mkconfig -o /boot/grub/grub.cfg <br />
to generate an updated {{Filename|grub.cfg}}.<br />
<br />
===== With GNU/Linux =====<br />
<br />
Assuming that the other distro is on partition {{Filename|sda2}}:<br />
<br />
menuentry "Other Linux" {<br />
set root=(hd0,2)<br />
linux /boot/vmlinuz (add other options here as required)<br />
initrd /boot/initrd.img (if the other kernel uses/needs one)<br />
}<br />
<br />
===== With Windows =====<br />
<br />
This assumes that your Windows partition is {{Filename|sda3}}.<br />
<br />
# (2) Windows XP<br />
menuentry "Windows XP" {<br />
set root=(hd0,3)<br />
chainloader (hd0,3)+1<br />
}<br />
<br />
If the windows bootloader is on an entirely different harddrive than grub, it may be necessary to trick Windows into believing that it is in fact the first harddrive. This was possible in the old grub with {{Codeline|map}} and is now done with {{Codeline|drivemap}}. Assume grub is on {{Filename|hd0}} and windows on {{Filename|hd2}}, you need to add the following after {{Codeline|set root}}:<br />
<br />
drivemap -s hd0 hd2<br />
<br />
==== With Windows via EasyBCD and NeoGRUB ====<br />
<br />
Since EasyBCD's NeoGRUB currently does not understand the GRUB2 menu format, chainload to it by replacing the contents of your {{Filename|C:\NST\menu.lst}} file with lines similar to the following:<br />
<br />
default 0<br />
timeout 1<br />
<br />
title Chainload into GRUB v2<br />
root (hd0,7)<br />
kernel /boot/grub/core.img<br />
<br />
===Visual Configuration===<br />
<br />
In GRUB2 it is possible, by default, to change the look of the menu.<br />
<br />
====Background image and bitmap fonts====<br />
<br />
GRUB2 comes with support for background images and bitmap fonts in pf2 format. The unifont font is included in the grub2 package under the filename {{Filename|unicode.pf2}}, or, as only ascii characters under the name {{Filename|ascii.pf2}}. Image formats supported include tga, png and jpeg, providing the correct modules are loaded. The maximum supported resolution depends on your hardware. There are two ways of setting a {{Filename|tga}} file as background. Two sample configurations are shown below.<br />
<br />
Edit {{Filename|/etc/default/grub}} like this:<br />
GRUB_GFXMODE=1024x768x32<br />
GRUB_GFXPAYLOAD_LINUX=keep<br />
GRUB_BACKGROUND="/boot/grub/archlinux.tga"<br />
#GRUB_THEME="/path/to/gfxtheme"<br />
<br />
(archlinux.tga is a placeholder; put your file name there)<br />
<br />
To generate the changes, run: <br />
grub-mkconfig -o /boot/grub/grub.cfg<br />
<br />
{{Note|If this example does not work for you try to replace {{Codeline|1=gfxmode="1024x768x32"}} by {{Codeline|1=vbemode="0x105"}}.}}<br />
{{Note|To show all the modes you can use {{Codeline|1=# hwinfo --framebuffer}} (hwinfo is available in [community]), while at grub2 prompt you can use the {{Codeline|1=vbeinfo}} command.}}<br />
{{Note|If you have installed Grub on a separate partition, {{Filename|/boot/grub/archlinux.tga}} becomes {{Filename|/grub/archlinux.tga}}.}}<br />
<br />
====Menu colors====<br />
<br />
As in Grub (0.9x), you can change the menu colors in Grub2. The available colors for GRUB2 are at http://www.gnu.org/software/grub/manual/html_node/Theme-file-format.html#Theme-file-format . <br />
Here is an example:<br />
<br />
Edit {{Filename|/etc/default/grub}}:<br />
GRUB_COLOR_NORMAL="light-blue/black"<br />
GRUB_COLOR_HIGHLIGHT="light-cyan/blue"<br />
<br />
Generate the changes:<br />
grub-mkconfig -o /boot/grub/grub.cfg<br />
<br />
====Hidden menu====<br />
<br />
One of the unique features of Grub2 is hiding/skipping the menu and showing it by holding "Shift" when needed. You can also adjust whether you want to see the timeout counter.<br />
<br />
Edit {{Filename|/etc/default/grub}} as you wish. Here is an example where the comments from the beginning of the two lines have been removed to enable the feature, the timeout has been set to five seconds and to be shown to the user:<br />
GRUB_HIDDEN_TIMEOUT=5<br />
GRUB_HIDDEN_TIMEOUT_QUIET=false<br />
<br />
and run:<br />
grub-mkconfig -o /boot/grub/grub.cfg<br />
<br />
====Setting the framebuffer resolution ====<br />
<br />
Grub2 can set the framebuffer for both grub2 itself and the kernel. The old ''vga='' way is deprecated. The preferred method is editing {{Filename|/etc/default/grub}} as the following sample:<br />
<br />
GRUB_GFXMODE=1024x768x32<br />
GRUB_GFXPAYLOAD_LINUX=keep<br />
<br />
To generate the changes, run: <br />
grub-mkconfig -o /boot/grub/grub.cfg<br />
<br />
The {{Codeline|gfxpayload}} property will make sure the kernel keeps the resolution.<br />
<br />
If this method does not work for you, the deprecated <code>vga=</code> method will still work. Just<br />
add it next to the <code>"GRUB_CMDLINE_LINUX_DEFAULT="</code> line in {{Filename|/etc/default/grub}}<br />
for eg: <code>"GRUB_CMDLINE_LINUX_DEFAULT="quiet splash vga=792"</code> will give you a {{Codeline|1024x768}} resolution.<br />
<br />
You can choose one of these resolutions: {{Codeline|640×480}}, {{Codeline|800×600}}, {{Codeline|1024×768}}, {{Codeline|1280×1024}}, {{Codeline|1600×1200}}<br />
<br />
=== Other Options ===<br />
<br />
==== LVM ====<br />
<br />
If you use [[LVM]] for your {{Filename|/boot}}, add the following before menuentry lines:<br />
<br />
insmod lvm<br />
<br />
and specify your root in the menuentry as:<br />
<br />
set root=(''lvm_group_name''-''lvm_logical_boot_partition_name'')<br />
<br />
Example:<br />
<br />
# (0) Arch Linux<br />
menuentry "Arch Linux" {<br />
insmod lvm<br />
set root=(VolumeGroup-lv_boot)<br />
# you can only set following two lines<br />
linux /vmlinuz-linux root=/dev/mapper/VolumeGroup-root ro<br />
initrd /initramfs-linux.img<br />
}<br />
<br />
==== Raid ====<br />
<br />
Grub2 provides convenient handling of raid-volumes. You need to add:<br />
insmod raid<br />
<br />
which allows you to address the volume natively. E.g. {{Filename|/dev/md0}} becomes:<br />
set root=(md0)<br />
<br />
whereas a partitioned raid-volume (e.g. {{Filename|/dev/md0p1}}) becomes:<br />
set root=(md0,1)<br />
<br />
==== Persistent block device naming ====<br />
You can use UUIDs to detect partitions instead of the "old" {{Filename|/dev/sd*}} and {{Filename|/dev/hd*}} scheming. It has the advantage of detecting partitions by their unique UUIDs, which is needed by some people booting with complicated partition setups.<br />
<br />
UUIDs are used by default in the recent versions of grub2 - there is no downside in it anyway except that you need to re-generate the {{Filename|grub.cfg}} file every time you resize or reformat your partitions. Remember this when modifying partitions with Live-CD.<br />
<br />
The recent versions of grub2 use UUIDs by default. You can re-enable the use of UUIDS by simply commenting the UUID line (this is also what it looks like by default):<br />
#GRUB_DISABLE_LINUX_UUID=true<br />
you can also just set the value as {{Codeline|false}} as shown here:<br />
GRUB_DISABLE_LINUX_UUID=false<br />
<br />
Either way, do not forget to generate the changes:<br />
grub-mkconfig -o /boot/grub/grub.cfg<br />
<br />
==== Using Labels ====<br />
<br />
It is possible to use labels, human-readable strings attached to filesystems, by using the {{Codeline|--label}} option to {{Codeline|search}}. First of all, label your existing partition:<br />
# tune2fs -L a <LABEL> <PARTITION><br />
<br />
Then, add an entry using labels. An example of this:<br />
<br />
menuentry "Arch Linux, session texte" {<br />
search --label --no-floppy --set=root archroot<br />
linux /boot/vmlinuz-linux root=/dev/disk/by-label/archroot ro<br />
initrd /boot/initramfs-linux.img<br />
}<br />
<br />
==== Recall previous entry ====<br />
<br />
Grub2 can remember the last entry you booted from and use this as the default entry to boot from next time. This is useful if you have multiple kernels (i.e., the current Arch one and the LTS kernel as a fallback option) or operating systems. To do this, edit {{Filename|/etc/default/grub}} and change the setting of {{Codeline|GRUB_DEFAULT}}:<br />
<br />
GRUB_DEFAULT=saved<br />
<br />
This ensures that grub will default to the saved entry. To enable saving the selected entry, add the following line to {{Filename|/etc/default/grub}}:<br />
<br />
GRUB_SAVEDEFAULT=true<br />
<br />
Remember to regenerate your configuration file.<br />
<br />
==== Security ====<br />
<br />
If you want to secure GRUB2 so it is not possible for anyone to change boot parameters or use the command line, you can add a user/password combination to GRUB2's configuration files. To do this, run the command {{Codeline|grub-mkpasswd_pbkdf2}}. Enter a password and confirm it. The output will look like this:<br />
<br />
<pre style='overflow:auto'><br />
Your PBKDF2 is grub.pbkdf2.sha512.10000.C8ABD3E93C4DFC83138B0C7A3D719BC650E6234310DA069E6FDB0DD4156313DA3D0D9BFFC2846C21D5A2DDA515114CF6378F8A064C94198D0618E70D23717E82.509BFA8A4217EAD0B33C87432524C0B6B64B34FBAD22D3E6E6874D9B101996C5F98AB1746FE7C7199147ECF4ABD8661C222EEEDB7D14A843261FFF2C07B1269A</pre>Then, add the following to {{Filename|/etc/grub.d/00_header}}:<br />
<pre>cat << EOF<br />
<br />
set superusers="username"<br />
password_pbkdf2 username <password><br />
<br />
EOF</pre><br />
where <password> is the string generated by {{Codeline|grub-mkpasswd_pbkdf2}}.<br />
<br />
Regenerate your configuration file. Your GRUB2 command line and boot parameters are now protected.<br />
<br />
=== Booting an Ubuntu ISO Image from the GRUB2 Screen ===<br />
<br />
Edit {{Filename|/etc/grub.d/40_custom}} to add an entry pointing to an Ubuntu iso:<br />
<br />
menuentry "ubuntu-11.04-desktop-amd64.iso" {<br />
set isofile="/path/to/ubuntu-11.04-desktop-amd64.iso"<br />
loopback loop (hdX,Y)$isofile<br />
linux (loop)/casper/vmlinuz boot=casper iso-scan/filename=$isofile quiet noeject noprompt splash --<br />
initrd (loop)/casper/initrd.lz<br />
}<br />
<br />
Be sure to adjust the "hdX,Y" in the third line to point to the correct disk/partition number of the isofile. When finished, update grub2's configuration file via:<br />
<br />
grub-mkconfig -o /boot/grub/grub.cfg<br />
<br />
== Using the command shell ==<br />
<br />
Since the MBR is too small to store all GRUB2 modules, only the menu and a few basic commands reside there. The majority of GRUB2 functionality remains in modules in {{Filename|/boot/grub}}, which are inserted as needed. In error conditions (e.g. if the partition layout changes) GRUB2 may fail to boot. When this happens, a command shell may appear.<br />
<br />
GRUB2 offers multiple shells/prompts. If there is a problem reading the menu but the bootloader is able to find the disk, you will likely be dropped to the "normal" shell:<br />
sh:grub><br />
<br />
If there is a more serious problem (e.g. GRUB cannot find required files), you may instead be dropped to the "rescue" shell:<br />
grub rescue><br />
<br />
The rescue shell is a restricted subset of the normal shell, offering much less functionality. If dumped to the rescue shell, first try inserting the "normal" module, then starting the "normal" shell:<br />
grub rescue> set prefix=(hdX,Y)/boot/grub<br />
grub rescue> insmod (hdX,Y)/boot/grub/normal.mod<br />
rescue:grub> normal<br />
<br />
=== Pager support ===<br />
<br />
GRUB2 supports pager for reading commands that provide long output (like the help command). This works only in normal shell mode and not in rescue mode. To enable pager, in GRUB2 command shell type:<br />
sh:grub> set pager=1<br />
<br />
== GUI configuration tools ==<br />
<br />
Following package may be installed from [[AUR]]<br />
* [http://kde-apps.org/content/show.php?content=139643 grub2-editor] (requires kdelibs)<br />
*:A KDE4 control module for configuring the GRUB2 bootloader<br />
* [http://kde-apps.org/content/show.php?content=137886 kcm-grub2] (requires kdelibs python2-qt kdebindings-python)<br />
*:This Kcm module manages the most common settings of Grub2.<br />
* [http://sourceforge.net/projects/startup-manager/ startupmanager] (requires gnome-python imagemagick yelp python2 xorg-xrandr)<br />
*:GUI app for changing the settings of GRUB, GRUB2, Usplash and Splashy<br />
<br />
== parttool or legacy hide/unhide ==<br />
<br />
If you have a win9x paradigm with hidden C disks GRUB legacy had the hide/unhide feature. In GRUB2 this has been replaced by parttool. For example, to boot the third C disk of three win9x installations on the CLI enter the CLI and:<br />
parttool hd0,1 hidden+ boot-<br />
parttool hd0,2 hidden+ boot-<br />
parttool hd0,3 hidden- boot+<br />
set root=hd0,3<br />
chainloader +1<br />
boot<br />
<br />
== Using the rescue console ==<br />
<br />
See [[#Using the command shell]] first. If unable to activate the standard shell, one possible solution is to boot using a live CD or some other rescue disk to correct configuration errors and reinstall GRUB. However, such a boot disk is not always available (nor necessary); the rescue console is surprisingly robust.<br />
<br />
The available commands in GRUB rescue include "insmod", "ls", "set", and "unset". This example uses "set" and "insmod". "set" modifies variables and "insmod" inserts new modules to add functionality.<br />
<br />
Before starting, the user must know the location of their {{Filename|/boot}} partition (be it a separate partition, or a subdirectory under their root):<br />
grub rescue> set prefix=(hdX,Y)/boot/grub<br />
<br />
where X is the physical drive number and Y is the partition number.<br />
<br />
To expand console capabilities, insert the "linux" module:<br />
grub rescue> insmod (hdX,Y)/boot/grub/linux.mod<br />
<br />
{{Note|With a separate boot partition, omit {{Filename|/boot}} from the path, (i.e. type {{Codeline|1=set prefix=(hdX,Y)/grub}} and {{Codeline|insmod (hdX,Y)/grub/linux.mod}}).}}<br />
<br />
This introduces the "linux" and "initrd" commands, which should be familiar (see [[#Configuration]]).<br />
<br />
An example, booting Arch Linux:<br />
set root=(hd0,5)<br />
linux /boot/vmlinuz-linux root=/dev/sda5<br />
initrd /boot/initramfs-linux.img<br />
boot<br />
<br />
With a separate boot partition, again change the lines accordingly:<br />
set root=(hd0,5)<br />
linux /vmlinuz-linux root=/dev/sda6<br />
initrd /initramfs-linux.img<br />
boot<br />
<br />
After successfully booting the Arch Linux installation, users can correct {{Filename|grub.cfg}} as needed and then run:<br />
# grub-install /dev/sda --no-floppy<br />
<br />
to reinstall GRUB2 and fix the problem completely, changing {{Filename|/dev/sda}} if needed. See [[#Bootloader installation]] for details.<br />
<br />
== Combining the use of UUID's and basic scripting ==<br />
<br />
If you like the idea of using UUID's to avoid unreliable BIOS mappings or are struggling with Grub's syntax, here is an example boot menu item that uses UUID's and a small script to direct Grub to the proper disk partitions for your system. All you need to do is replace the UUID's in the sample with the correct UUID's for your system. (The example applies to a system with a boot and root partition. You will obviously need to modify the Grub configuration if you have additional partitions.)<br />
<br />
menuentry "Arch Linux 64" {<br />
#Enter the UUID of your boot partition (this is where Grub and your kernel reside)<br />
set uuid_grub_boot=ece0448f-bb08-486d-9864-ac3271bd8d07<br />
<br />
#Enter the UUID of the partition containing the root partition of your Arch Linux installation. <br />
set uuid_os_root=c55da16f-e2af-4603-9e0b-03f5f565ec4a<br />
<br />
#(Note: this may be the same as your boot partition)<br />
<br />
#Here we set the Grub "root" variable by locating the UUID of the root partition identified above <br />
search --fs-uuid --no-floppy --set=root $uuid_os_root<br />
<br />
#Here we set a custom variable grub_boot by locating the UUID of the boot partition identified above <br />
search --fs-uuid --no-floppy --set=grub_boot $uuid_grub_boot<br />
<br />
#Here is the magic. We test to see if the boot and root partitions have the same UUID.<br />
#If they do, we append /boot to the $grub_boot variable. For ex. (hd0,1) becomes (hd0,1)/boot.<br />
if [ $uuid_grub_boot == $uuid_os_root ] ; then<br />
set grub_boot=$grub_boot/boot<br />
fi<br />
<br />
# $grub_boot now points to the correct location, so the following will properly find the kernel and initrd<br />
linux ($grub_boot)/vmlinuz-linux root=/dev/disk/by-uuid/$uuid_os_root ro<br />
initrd ($grub_boot)/initramfs-linux.img<br />
}<br />
<br />
== Troubleshooting ==<br />
<br />
Any troubleshooting should be added here.<br />
<br />
=== Enable GRUB2 debug messages ===<br />
<br />
Add<br />
<br />
set pager=1<br />
set debug=all<br />
<br />
to {{Filename|grub.cfg}}.<br />
<br />
=== Correct GRUB2 No Suitable Mode Found Error ===<br />
<br />
If you get this error when booting any menuentry<br />
<br />
error: no suitable mode found<br />
Booting however<br />
<br />
Then you need to initialize grub2 graphical terminal (gfxterm) with proper video mode (gfxmode) in grub2. This video mode is passed by grub2 to the linux kernel via 'gfxpayload'. In case of UEFI systems, if the grub2 video mode is not initialized, no kernel boot messages will be shown in the terminal (atleast until KMS kicks in)<br />
<br />
Copy {{Filename|/usr/share/grub/unicode.pf2}} to ${GRUB2_PREFIX_DIR} ({{Filename|/boot/grub/}} in case of BIOS systems and {{Filename|/boot/efi/efi/grub/}} in case of UEFI systems). <br />
<br />
# cp /usr/share/grub/unicode.pf2 ${GRUB2_PREFIX_DIR}<br />
<br />
If {{Filename|/usr/share/grub/unicode.pf2}} does not exist, install {{Package Official|bdf-unifont}}, create the unifont.pf2 file and then copy it to ${GRUB2_PREFIX_DIR} .<br />
<br />
# grub-mkfont -o unicode.pf2 /usr/share/fonts/misc/unifont.bdf<br />
<br />
Then, in the {{Filename|grub.cfg}} file, add the following lines to enable grub2 to pass the video mode correctly to the kernel, without of which you will only get a black screen (no output) but booting (actually) proceeds successfully without any system hang:<br />
<br />
BIOS systems<br />
<br />
insmod vbe<br />
<br />
UEFI systems<br />
<br />
insmod efi_gop<br />
insmod efi_uga<br />
<br />
After that add the following code (common to both BIOS and UEFI)<br />
<br />
insmod font<br />
<br />
if loadfont ${prefix}/unicode.pf2<br />
then<br />
insmod gfxterm<br />
set gfxmode=auto<br />
set gfxpayload=keep<br />
terminal_output gfxterm<br />
fi<br />
<br />
As you can see for gfxterm (graphical terminal) to function properly, {{Filename|unicode.pf2}} font file should exist in ${GRUB2_PREFIX_DIR}.<br />
<br />
=== msdos-style error message ===<br />
<br />
grub-setup: warn: This msdos-style partition label has no post-MBR gap; embedding won't be possible!<br />
grub-setup: warn: Embedding is not possible. GRUB can only be installed in this setup by using blocklists.<br />
However, blocklists are UNRELIABLE and its use is discouraged.<br />
grub-setup: error: If you really want blocklists, use --force.<br />
<br />
This error may occur when you try installing GRUB2 in a VMware container. Read more about it [http://bbs.archlinux.org/viewtopic.php?pid=581760#p581760 here]. It happens when the first partition starts just after the MBR (block 63), without the usual space of 1 MiB (2048 blocks) before the first partition. Read [[#MBR_aka_msdos_partitioning_specific_instructions]]<br />
<br />
=== UEFI GRUB2 not loaded ===<br />
In some cases the EFI may fail to load grub correctly. Provided everything is set up correctly, the output of<br />
efibootmgr -v<br />
might look something like this:<br />
BootCurrent: 0000<br />
Timeout: 3 seconds<br />
BootOrder: 0000,0001,0002<br />
Boot0000* Grub HD(1,800,32000,23532fbb-1bfa-4e46-851a-b494bfe9478c)File(\efi\grub\grub.efi)<br />
Boot0001* Shell HD(1,800,32000,23532fbb-1bfa-4e46-851a-b494bfe9478c)File(\EfiShell.efi)<br />
Boot0002* Festplatte BIOS(2,0,00)P0: SAMSUNG HD204UI .<br />
If everything works correctly, the EFI would now automatically load grub.<br><br />
If the screen only goes black for a second and the next boot option is tried afterwards, according to [https://bbs.archlinux.org/viewtopic.php?pid=981560#p981560 this post], moving grub to the partition root can help. The boot option has to be deleted and recreated afterwards. The entry for grub should look like this then:<br />
Boot0000* Grub HD(1,800,32000,23532fbb-1bfa-4e46-851a-b494bfe9478c)File(\grub.efi)<br />
<br />
=== Invalid signature ===<br />
If trying to boot windows results in an "invalid signature" error, e.g. after reconfiguring partitions or adding additional hard drives, (re)move grub's device configuration and let it reconfigure.<br />
# mv /boot/grub/device.map /boot/grub/device.map-old<br />
# grub-mkconfig -o /boot/grub/grub.cfg<br />
Grub-mkconfig should now mention all found boot options including windows. If it works, remove /boot/grub/device.map-old.<br />
<br />
== References ==<br />
<br />
# Official GRUB2 Manual - http://www.gnu.org/software/grub/manual/grub.html<br />
# GRUB2 wiki page describing steps to compile for UEFI systems - https://help.ubuntu.com/community/UEFIBooting - previously http://grub.enbug.org/TestingOnUEFI{{Linkrot|2011|09|05}}<br />
# Wikipedia's page on [http://en.wikipedia.org/wiki/BIOS_Boot_partition BIOS Boot Partition]<br />
<br />
== External Links ==<br />
<br />
# [https://github.com/the-ridikulus-rat/My_Shell_Scripts/blob/master/grub2/grub2_bios.sh A Linux Bash Shell script to compile and install GRUB2 for BIOS from BZR Source]<br />
# [https://github.com/the-ridikulus-rat/My_Shell_Scripts/blob/master/grub2/grub2_uefi.sh A Linux Bash Shell script to compile and install GRUB2 for UEFI from BZR Source]</div>Zendeavorhttps://wiki.archlinux.org/index.php?title=NVIDIA&diff=168696NVIDIA2011-11-04T22:06:17Z<p>Zendeavor: /* Installing */</p>
<hr />
<div>[[Category: Graphics (English)]]<br />
[[Category: X Server (English)]]<br />
{{i18n|NVIDIA}}<br />
[[de:Nvidia]]<br />
[[fr:Nvidia]]<br />
{{Article summary start}}<br />
{{Article summary text|Information on installing, configuring and troubleshooting the proprietary NVIDIA Drivers.}}<br />
{{Article summary heading|Related}}<br />
{{Article summary wiki|ATI}}<br />
{{Article summary wiki|Intel}}<br />
{{Article summary wiki|Nouveau}}<br />
{{Article summary wiki|Xorg}}<br />
{{Article summary end}}<br />
<br />
This article covers installing and configuring [http://www.nvidia.com NVIDIA]'s ''proprietary'' graphic card driver. For information about the open-source drivers, see [[Nouveau]].<br />
<br />
==Installing==<br />
These instructions are for those using the stock {{Package Official|linux}} package. For custom kernel setup, skip to the [[#Alternate install: custom kernel|next]] subsection.<br />
<br />
{{Tip|It is usually beneficial to install the NVIDIA driver through [[pacman]] rather than through the package provided by the NVIDIA site, this allows the driver to be updated when upgrading the system.}}<br />
<br />
1. Visit NVIDIA's [http://www.nvidia.com/Download/index.aspx?lang=en-us driver download site] to find out the appropriate driver for a given card.<br />
:{{Note|Currently nvidia-173xx, nvidia-96xx and nvidia-71xx drivers don't support Xorg release 1.11, and therefore not available in the [[Official Repositories]]. You could use the open source drivers ([[nouveau]] or nv) instead.}}<br />
<br />
2. Install the driver for newer cards (newest GPUs, GeForce 6 and newer [NV40 and newer]):<br />
:<pre># pacman -Rdd libgl</pre><br />
:<pre># pacman -S nvidia nvidia-utils</pre><br />
<br />
<!-- These drivers are not compatible with the latest Xorg release in the official repo.<br />
<br />
:Whereas users with older cards should install (GeForce 5 FX series cards [NV30-NV38]):<br />
:<pre># pacman -S nvidia-173xx nvidia-173xx-utils</pre><br />
<br />
:or (GeForce2 MX, GeForce3 and GeForce4 series cards [NV11 and NV17-NV28]):<br />
:<pre># pacman -S nvidia-96xx nvidia-96xx-utils</pre><br />
<br />
:or (Riva TNT, TNT2, GeForce and GeForce2 series cards [NV03-NV10 and NV15-NV16]):<br />
:<pre># pacman -S nvidia-71xx nvidia-71xx-utils</pre><br />
<br />
--><br />
:The nvidia<!--{,-173xx,-96xx,-71xx}-->-utils package conflict with the libgl package. This is normal. If pacman asks to remove libgl and fails due to unsatisfied dependencies or some such, be sure you removed libgl as explained above.<br />
<br />
:{{Note|For the latest card models, it may be required to install {{Package AUR|nvidia-beta}} and {{Package AUR|nvidia-utils-beta}} from the [[AUR]] since the stable drivers may not support the newly introduced features.}}<br />
:On 64 bit systems, for 32 bit programs to take advantage of nvidia-utils you must also install the equivalent lib32 package (for example lib32-nvidia-utils).<br />
<br />
3. '''Reboot'''. The nvidia<!--{,-173xx,-96xx,-71xx}--> package contains a file which blacklists the nouveau module. A reboot is necessary for this blacklist to take effect.<br />
<br />
Once the driver has been installed, continue to: [[#Configuring]].<br />
<br />
===Alternate install: custom kernel===<br />
First of all, it is of advantage to know how the ABS system works by reading some of the other articles about it:<br />
* Main article for [[ABS]]<br />
* Article on [[makepkg]]<br />
* Article on [[Creating Packages]]<br />
<br />
{{Note|There is the {{Package AUR|nvidia-all}} package on [[AUR]] which turns out to make it easier to install the NVIDIA driver for custom kernels and multiple kernels}}<br />
<br />
The following is a short tutorial for making a custom NVIDIA driver package using [[ABS]]:<br />
<br />
Install ABS and generate the tree:<br />
# pacman -S abs<br />
# abs<br />
As a standard user, make a temporary directory for creating the new package:<br />
$ mkdir -p ~/devel/abs<br />
Make a copy of the {{Filename|nvidia}} package directory:<br />
$ cp -r /var/abs/extra/nvidia/ ~/devel/abs/<br />
Go into the temporary {{Filename|nvidia}} build directory:<br />
$ cd ~/devel/abs/nvidia<br />
It is required to edit the files {{Filename|nvidia.install}} and {{Filename|PKGBUILD}} file so that they contain the right kernel version variables.<br />
<br />
While running the custom kernel, get the appropriate kernel and local version names:<br />
$ uname -r<br />
# In nvidia.install, replace the {{Codeline|KERNEL_VERSION<nowiki>=</nowiki>"2.6.xx-ARCH"}} variable with the custom kernel version, such as {{Codeline|KERNEL_VERSION<nowiki>=</nowiki>"2.6.22.6"}} or {{Codeline|KERNEL_VERSION<nowiki>=</nowiki>"2.6.22.6-custom"}} depending on what the kernel's version is and the local version's text/numbers. Do this for all instances of the version number within this file.<br />
# In PKGBUILD, change the {{Codeline|_kernver<nowiki>=</nowiki>'2.6.xx-ARCH'}} variable to match the appropriate version, as above.<br />
# If there are more than one kernels in the system installed in parallel, (such as a custom kernel alongside the default -ARCH kernel) change the {{Codeline|"pkgname<nowiki>=</nowiki>nvidia"}} variable in the PKGBUILD to a unique identifier, such as nvidia-2622 or nvidia-custom. This will allow both kernels to use the nvidia module, since the custom nvidia module has a different package name and will not overwrite the original. You will also need to comment the line in {{Codeline|package()}} that creates {{Filename|/etc/modprobe.d/nouveau_blacklist.conf}} (else pacman will complain that it already exists).<br />
<br />
Then do:<br />
$ makepkg -ci<br />
The {{Codeline|-c}} operand tells makepkg to clean left over files after building the package, whereas {{Codeline|-i}} specifies that makepkg should automatically run pacman to install the resulting package.<br />
<br />
==Configuring==<br />
It is possible that after installing the driver it may not be needed to create an Xorg server configuration file. You can run [[Xorg#Running Xorg| a test]] to see if the Xorg server will function correctly without a configuration file. However, it may be required to create a {{Filename|/etc/X11/xorg.conf}} configuration file in order to adjust various settings. This configuration can be generated by the NVIDIA Xorg configuration tool, or it can be created manually. If created manually, it can be a minimal configuration (in the sense that it will only pass the basic options to the [[Xorg]] server), or it can include a [[Xorg#Manual configuration|number of settings]] that can bypass Xorg's auto-discovered or pre-configured options.<br />
<br />
===Automatic configuration===<br />
The NVIDIA package includes an automatic configuration tool to create an Xorg server configuration file ({{Filename|xorg.conf}}) and can be run by:<br />
# nvidia-xconfig<br />
<br />
This command will auto-detect and create (or edit, if already present) the {{Filename|/etc/X11/xorg.conf}} configuration according to present hardware.<br />
<br />
If there are instances of DRI, ensure they are commented out:<br />
# Load "dri"<br />
Double check your {{filename | /etc/X11/xorg.conf}} to make sure your default depth, horizontal sync, vertical refresh, and resolutions are acceptable.<br />
<br />
{{Warning| That may still not work properly with Xorg-server 1.8 }}<br />
<br />
===Automatic configuration with multiple monitors===<br />
The NVIDIA package provides Twinview. This tool will help by automatically configuring all the monitors connected to your video card. This only works for multiple monitors on a single card.<br />
To configure Xorg Server with Twinview run:<br />
# nvidia-xconfig --twinview<br />
<br />
===Minimal configuration===<br />
To create a basic {{Filename|/etc/X11/xorg.conf}}, as root:<br />
# vi /etc/X11/xorg.conf<br />
<br />
And add the driver:<br />
<pre><br />
Section "Device"<br />
Identifier "Device0"<br />
Driver "nvidia"<br />
VendorName "NVIDIA Corporation"<br />
EndSection<br />
</pre><br />
<br />
{{Tip|Make sure, in order to have full multimedia functionality, to have '''xorg-input-drivers''' installed.}}<br />
{{Tip|If upgrading from the nouveau drivers make sure to remove "nouveau" from /etc/mkinitcpio.conf. You can use [[NVIDIA#Switching_between_nvidia_and_nouveau_drivers|those scripts]] if you are switching between open and closed drivers often.}}<br />
<br />
==Tweaking==<br />
<br />
===GUI: nvidia-settings===<br />
The NVIDIA package includes the {{Codeline|nvidia-settings}} program that allows adjustment of several additional settings.<br />
<br />
For the settings to be loaded on login, run this command from the terminal:<br />
$ nvidia-settings --load-config-only<br />
<br />
Or add it to the the desktop environment's auto-startup method.<br />
<br />
{{Tip | On rare occasions the {{Filename|~/.nvidia-settings-rc}} may become corrupt. If this happens, the Xorg server may crash and the file will have to be deleted to fix the issue.}}<br />
<br />
===Advanced: xorg.conf===<br />
Edit {{Filename|/etc/X11/xorg.conf}}, and add the option to the correct section. NVIDIA tests and ships the drivers with the recommended setting so note that some edits may cause instability, tearing, among other problems. Since not all options may work for a given system, consider backing up {{Filename|xorg.conf}} before making any edits. The Xorg server will need to be restarted before any changes are applied.<br />
<br />
* See [http://us.download.nvidia.com/XFree86/Linux-x86_64/256.53/README/index.html NVIDIA Accelerated Linux Graphics Driver README and Installation Guide] for additional details and options.]<br />
====Enabling desktop composition====<br />
As of NVIDIA driver version 180.44, support for GLX with the Damage and Composite X extensions is enabled by default. Refer to [[Composite]] for detailed instructions.<br />
<br />
====Disabling the logo on startup====<br />
Add the {{Codeline|"NoLogo"}} option under section {{Codeline|Device}}:<br />
Option "NoLogo" "1"<br />
<br />
====Enabling hardware acceleration====<br />
{{Note|RenderAccel is enabled by default since drivers version 97.46.xx}}<br />
Add the {{Codeline|"RenderAccel"}} option under section {{Codeline|Device}}:<br />
Option "RenderAccel" "1"<br />
<br />
====Overriding monitor detection====<br />
The {{Codeline|"ConnectedMonitor"}} option under section {{Codeline|Device}} allows to override monitor detection when X server starts, which may save a significant amount of time at start up. The available options are: {{Codeline|"CRT"}} for analog connections, {{Codeline|"DFP"}} for digital monitors and {{Codeline|"TV"}} for televisions.<br />
<br />
The following statement forces the NVIDIA driver to bypass startup checks and recognize the monitor as DFP:<br />
Option "ConnectedMonitor" "DFP"<br />
{{Note| Use "CRT" for all analog 15 pin VGA connections, even if the display is a flat panel. "DFP" is intended for DVI digital connections only.}}<br />
<br />
====Enabling triple buffering====<br />
Enable the use of triple buffering by adding the {{Codeline|"TripleBuffer"}} Option under section {{Codeline|Device}}:<br />
Option "TripleBuffer" "1"<br />
<br />
Use this option if the graphics card has plenty of ram (equal or greater than 128MB). The setting only takes effect when syncing to vblank is enabled, one of the options featured in nvidia-settings.<br />
<br />
{{Note|This option may introduce full-screen tearing and reduce performance.}}<br />
<br />
====Using OS-level events====<br />
Taken from the NVIDIA driver's [http://http.download.nvidia.com/XFree86/Linux-x86/1.0-7182/README/readme.txt README] file: ''"[...] Use OS-level events to efficiently notify X when a client has performed direct rendering to a window that needs to be composited."'' It may help improving performance, but it is currently incompatible with SLI and Multi-GPU modes.<br />
<br />
Add under section {{Codeline|Device}}:<br />
Option "DamageEvents" "1"<br />
{{Note|This option is enabled by default in newer driver versions.}}<br />
<br />
====Enabling power saving====<br />
Add under section {{Codeline|Monitor}}:<br />
Option "DPMS" "1"<br />
<br />
====Enabling SLI====<br />
{{Warning|As of May 7, 2011, you may experience sluggish video performance in GNOME 3 after enabling SLI.}}<br />
<br />
Taken from the NVIDIA driver's [http://http.download.nvidia.com/XFree86/Linux-x86/1.0-8774/README/appendix-d.html README] appendix: ''This option controls the configuration of SLI rendering in supported configurations.'' A ''supported configuration'' is a computer equipped with an SLI-Certified Motherboard and 2 or 3 SLI-Certified GeForce GPUs. See NVIDIA's [http://www.slizone.com/page/home.html SLI Zone] for more information.<br />
<br />
Find the first GPU's PCI Bus ID using {{Codeline|lspci}}:<br />
$ lspci | grep VGA<br />
<br />
This will return something similar to:<br />
03:00.0 VGA compatible controller: nVidia Corporation G92 [GeForce 8800 GTS 512] (rev a2)<br />
05:00.0 VGA compatible controller: nVidia Corporation G92 [GeForce 8800 GTS 512] (rev a2)<br />
<br />
Add the BusID (3 in the previous example) under section {{Codeline|Device}}:<br />
BusID "PCI:3:0:0"<br />
<br />
{{Note|The format is important. The BusID value must be specified as {{Codeline|"PCI:<BusID>:0:0"}}}}<br />
<br />
Add the desired SLI rendering mode value under section {{Codeline|Screen}}:<br />
Option "SLI" "SLIAA"<br />
<br />
The following table presents the available rendering modes.<br />
<br />
{| border="1"<br />
! Value !! Behavior<br />
|-<br />
| 0, no, off, false, Single || Use only a single GPU when rendering.<br />
|-<br />
| 1, yes, on, true, Auto || Enable SLI and allow the driver to automatically select the appropriate rendering mode.<br />
|-<br />
| AFR || Enable SLI and use the alternate frame rendering mode.<br />
|-<br />
| SFR || Enable SLI and use the split frame rendering mode.<br />
|-<br />
| SLIAA || Enable SLI and use SLI antialiasing. Use this in conjunction with full scene antialiasing to improve visual quality.<br />
|}<br />
<br />
<br />
Alternatively, you can use the {{Codeline|nvidia-xconfig}} utility to insert these changes into {{Codeline|xorg.conf}} with a single command:<br />
# nvidia-xconfig --busid=PCI:3:0:0 --sli=SLIAA<br />
<br />
To verify that SLI mode is enabled from a shell:<br />
$ nvidia-settings -q all | grep SLIMode<br />
Attribute 'SLIMode' (arch:0.0): AA <br />
'SLIMode' is a string attribute.<br />
'SLIMode' is a read-only attribute.<br />
'SLIMode' can use the following target types: X Screen.<br />
<br />
====Forcing Powermizer performance level (for laptops)====<br />
Add under section {{Codeline|Device}}:<br />
# Force Powermizer to a certain level at all times<br />
# level 0x1=highest<br />
# level 0x2=med<br />
# level 0x3=lowest<br />
<br />
# AC settings:<br />
Option "RegistryDwords" "PowerMizerLevelAC=0x3"<br />
# Battery settings:<br />
Option "RegistryDwords" "PowerMizerLevel=0x3"<br />
Settings are better explained in [http://tutanhamon.com.ua/technovodstvo/NVIDIA-UNIX-driver/ NVIDIA Driver for X.org:Performance and Power Saving Hints].<br />
<br />
=====Letting the GPU set its own performance level based on temperature=====<br />
Add under section {{Codeline|Device}}:<br />
Option "RegistryDwords" "PerfLevelSrc=0x3333"<br />
<br />
====Disable vblank interrupts (for laptops)====<br />
When running the interrupt detection utility [[powertop]], it can be observed that the Nvidia driver will generate an interrupt for every vblank. To disable, place in the {{Codeline|Device}} section:<br />
Option "OnDemandVBlankInterrupts" "1"<br />
This will reduce interrupts to about one or two per second.<br />
<br />
====Enabling overclocking====<br />
{{Warning|Please note that overclocking may damage hardware and that no responsibility may be placed on the authors of this page due to any damage to any information technology equipment from operating products out of specifications set by the manufacturer.}}<br />
To enable GPU and memory overclocking, place the following line in the {{Codeline|Device}} section:<br />
Option "Coolbits" "1"<br />
<br />
This will enable on-the-fly overclocking within an X session by running:<br />
$ nvidia-settings<br />
{{Note|GTX 4xx/5xx series Fermi cores cannot currently be overclocked using <br />
the Coolbits method. The alternative is to edit and reflash the GPU BIOS either under DOS (preferred), or within a Win32 environment by way of [http://www.mvktech.net/component/option,com_remository/Itemid,26/func,select/id,127/orderby,2/page,1/ nvflash] and [http://www.mvktech.net/component/option,com_remository/Itemid,26/func,select/id,135/orderby,2/page,1/ NiBiTor 6.0]. The advantage of BIOS flashing is that not only can voltage limits be raised, but stability is generally improved over software overclocking methods such as Coolbits.}}<br />
<br />
===== Setting static 2D/3D clocks =====<br />
Set the following string in the {{Codeline|Device}} section to enable PowerMizer at its maximum performance level:<br />
Option "RegistryDwords" "PerfLevelSrc=0x2222"<br />
Set one of the following two strings in the {{Codeline|Device}} section to enable manual GPU fan control within {{codeline|nvidia-settings}}:<br />
Option "Coolbits" "4"<br />
<br />
Option "Coolbits" "5"<br />
<br />
====Enable screen rotation through XRandR====<br />
Place the following line in the {{Codeline|Device}} section:<br />
Option "RandRRotation" "True"<br />
After restarting Xorg:<br />
$ xrandr -o left<br />
The Screen should be rotated. To restore:<br />
$ xrandr -o normal<br />
{{Note| Editing xorg.conf may be unnecessary since screen rotation should be enabled by default, ideally by using the respective DE tools, such as SystemSettings in KDE.}}<br />
<br />
==Tips and tricks==<br />
===Enabling Pure Video HD (VDPAU/VAAPI)===<br />
'''Hardware Required:''' <br />
<br />
At least a video card with second generation PureVideo HD [http://en.wikipedia.org/wiki/PureVideo_HD#Table_of_PureVideo_.28HD.29_GPUs]<br />
<br />
'''Software Required:'''<br />
<br />
Nvidia video cards with the proprietary driver installed will provide video decoding capabilities with the VDPAU interface at different levels according to PureVideo generation.<br />
<br />
You can also add support for the VA-API interface with:<br />
# pacman -S vdpau-video<br />
<br />
Check VA-API support with:<br />
$ vainfo<br />
<br />
To take full advantage of the hardware decoding capability of your video card you will need a media player that supports VDPAU or VA-API.<br />
<br />
To enable hardware acceleration in [[MPlayer]] edit {{filename|~/.mplayer/config}}<br />
<br />
vo=vdpau<br />
vc=ffmpeg12vdpau,ffwmv3vdpau,ffvc1vdpau,ffh264vdpau,ffodivxvdpau,<br />
<br />
To enable hardware acceleration in [[VLC]] go:<br />
<br />
Tools -> Preferences -> Input & Codecs -> check "Use GPU acceleration (experimental)"<br />
<br />
To enable hardware acceleration in '''smplayer''' go:<br />
<br />
Options -> Preferences -> General -> Video Tab -> select vdpau as output driver<br />
<br />
To enable hardware acceleration in '''gnome-mplayer''' go:<br />
<br />
Edit -> Preferences -> set video output to vdpau<br />
<br />
'''Playing HD movies on cards with low memory:'''<br />
<br />
If your graphic card does not have a lot of memory (>521MB?), you can experience glitches when watching 1080p or even 720p movies.<br />
To avoid that start simple window manager like TWM or MWM.<br />
<br />
Additionally increasing the MPlayer's cache size in {{filename|~/.mplayer/config}} can help, when your hard drive is spinning down when watching HD movies.<br />
<br />
===Using TV-out===<br />
A good article on the subject can be found [http://en.wikibooks.org/wiki/NVidia/TV-OUT here]<br />
<br />
===X with a TV (DFP) as the only display===<br />
The X server falls back to CRT-0 if no monitor is automatically detected. This can be a problem when using a DVI connected TV as the main display, and X is started while the TV is turned off or otherwise disconnected.<br />
<br />
To force nvidia to use DFP, store a copy of the EDID somewhere in the filesystem so that X can parse the file instead of reading EDID from the TV/DFP.<br />
<br />
To acquire the EDID, start nvidia-settings. It will show some information in tree format, ignore the rest of the settings for now and select the GPU (the corresponding entry should be titled "GPU-0" or similar), click the "DFP" section (again, "DFP-0" or similar), click on the "Acquire Edid" Button and store it somewhere, for example, {{Filename|/etc/X11/dfp0.edid}}.<br />
<br />
Edit xorg.conf by adding to the "Device" section:<br />
Option "ConnectedMonitor" "DFP"<br />
Option "CustomEDID" "DFP-0:/etc/X11/dfp0.edid"<br />
The "ConnectedMonitor" option forces the driver to recognize the DFP as if it were connected. The "CustomEDID" provides EDID data for the device, meaning that it will start up just as if the TV/DFP was connected during X the process.<br />
<br />
This way, one can automatically start a display manager at boot time and still have a working and properly configured X screen by the time the TV gets powered on.<br />
<br />
===Check the power state===<br />
NVIDIA X.org driver can detect power source. To see the current state check 'GPUPowerSource' read-only parameter (0 - AC, 1 - battery):<br />
<br />
$ nvidia-settings -q GPUPowerSource -t<br />
1<br />
<br />
For it to be able to detect this you need to have [[acpid]] installed. Make sure to include acpid on DAEMONS array in rc.conf or this warning will appear on system log:<br />
ACPI: failed to connect to the ACPI event daemon; the daemon<br />
may not be running or the "AcpidSocketPath" X<br />
configuration option may not be set correctly. When the<br />
ACPI event daemon is available, the NVIDIA X driver will<br />
try to use it to receive ACPI event notifications. For<br />
details, please see the "ConnectToAcpid" and<br />
"AcpidSocketPath" X configuration options in Appendix B: X<br />
Config Options in the README.<br />
<br />
===Displaying GPU temperature in the shell===<br />
====Method 1 - nvidia-settings====<br />
{{Note|This method requires that you are using X. Use Method 2 or Method 3 if you are not. Also note that Method 3 currently does not not work with newer nvidia cards such as the G210/220 as well as embedded GPUs such as the Zotac IONITX's 8800GS.}}<br />
<br />
To display the GPU temp in the shell, use nvidia-settings as follows:<br />
$ nvidia-settings -q gpucoretemp<br />
<br />
This will output something similar to the following:<br />
Attribute 'GPUCoreTemp' (hostname:0.0): 41.<br />
'GPUCoreTemp' is an integer attribute.<br />
'GPUCoreTemp' is a read-only attribute.<br />
'GPUCoreTemp' can use the following target types: X Screen, GPU.<br />
<br />
The GPU temps of this board is 41 C.<br />
<br />
In order to get just the temperature for use in utils such as rrdtool or conky, among others:<br />
$ nvidia-settings -q gpucoretemp -t<br />
41<br />
<br />
====Method 2 - nvidia-smi====<br />
<br />
Use nvidia-smi which can read temps directly from the GPU without the need to use X at all. This is important for a small group of users who do not have X running on their boxes, perhaps because the box is headless running server apps. <br />
To display the GPU temp in the shell, use nvidia-smi as follows:<br />
<br />
$ nvidia-smi -a<br />
<br />
This should output something similar to the following:<br />
<pre><br />
$ nvidia-smi -a<br />
<br />
==============NVSMI LOG==============<br />
<br />
<br />
Timestamp : Mon Dec 13 20:11:28 2010<br />
<br />
Driver Version : 260.19.29<br />
<br />
<br />
GPU 0:<br />
Product Name : GeForce 8400 GS<br />
PCI Device/Vendor ID : 6e410de<br />
PCI Location ID : 0:1:0<br />
Board Serial : 2648101198649<br />
Display : Connected<br />
Temperature : 40 C<br />
Utilization<br />
GPU : 1%<br />
Memory : 8%<br />
<br />
</pre><br />
<br />
In order to get just the temperature for use in utils such as rrdtool or conky, among others:<br />
<br />
$ nvidia-smi -a | grep Temp | cut -c17-18<br />
40<br />
<br />
Reference: http://www.question-defense.com/2010/03/22/gpu-linux-shell-temp-get-nvidia-gpu-temperatures-via-linux-cli<br />
<br />
====Method 3 - nvclock====<br />
Use nvclock which is available from the [extra] repo. Note that nvclock cannot access thermal sensors on newer NVIDIA cards such as the G210/220.<br />
<br />
There can be significant differences between the temperatures reported by nvclock and nvidia-settings/nv-control. According to [http://sourceforge.net/projects/nvclock/forums/forum/67426/topic/1906899 this post] by the author (thunderbird) of nvclock, the nvclock values should be more accurate.<br />
<br />
===Set Fan Speed at Login===<br />
You can adjust the fan speed on your graphics card with {{Codeline|nvidia-settings}}'s console interface. First ensure that your Xorg configuration sets the Coolbits option to 4 or 5 in your {{Codeline|Device}} section to enable fan control.<br />
<br />
Option "Coolbits" "4"<br />
<br />
{{Note|GTX 4xx/5xx series cards cannot currently set fan speeds at login using this method. This method only allows for the setting of fan speeds within the current X session by way of nvidia-settings.}}<br />
<br />
Place the following line in your [[xinitrc|{{filename|~/.xinitrc}}]] file to adjust the fan when you launch Xorg. Replace <n> with the fan speed percentage you want to set.<br />
<br />
nvidia-settings -a "[gpu:0]/GPUFanControlState=1" -a "[fan:0]/GPUCurrentFanSpeed=<n>"<br />
<br />
You can also configure a second GPU by incrementing the GPU and fan number.<br />
<br />
nvidia-settings -a "[gpu:0]/GPUFanControlState=1" \ <br />
-a "[gpu:1]/GPUFanControlState=1" \<br />
-a "[fan:0]/GPUCurrentFanSpeed=<n>" \<br />
-a [fan:1]/GPUCurrentFanSpeed=<n>" &<br />
<br />
If you use a login manager such as GDM or KDM, you can create a desktop entry file to process this setting. Create {{filename|~/.config/autostart/nvidia-fan-speed.desktop}} and place this text inside it. Again, change <n> to the speed percentage you want.<br />
<br />
[Desktop Entry]<br />
Type=Application<br />
Exec=nvidia-settings -a "[gpu:0]/GPUFanControlState=1" -a "[fan:0]/GPUCurrentFanSpeed=<n>"<br />
X-GNOME-Autostart-enabled=true<br />
Name=nvidia-fan-speed<br />
<br />
===Order of install/deinstall for changing drivers===<br />
Where the old driver is nvidiaO and the new driver is nvidiaN.<br />
remove nvidiaO<br />
install nvidia-utilsN<br />
install nvidiaN<br />
install lib32-nvidia-utils-N (if required)<br />
<br />
===Switching between nvidia and nouveau drivers===<br />
If you are switching between the nvidia and nouveau driver often, you can use those two scripts to make it easier:<br />
<br />
#!/bin/bash<br />
# nvidia -> nouveau<br />
<br />
/usr/bin/sudo /bin/sed -i 's/#*options nouveau modeset=1/options nouveau modeset=1/' /etc/modprobe.d/modprobe.conf<br />
/usr/bin/sudo /bin/sed -i 's/#*MODULES="nouveau"/MODULES="nouveau"/' /etc/mkinitcpio.conf<br />
<br />
/usr/bin/sudo /usr/bin/pacman -Rdds --noconfirm nvidia-173xx{,-utils}<br />
/usr/bin/sudo /usr/bin/pacman -S --noconfirm nouveau-dri xf86-video-nouveau<br />
<br />
#/usr/bin/sudo /bin/cp {10-monitor,30-nouveau}.conf /etc/X11/xorg.conf.d/<br />
<br />
/usr/bin/sudo /sbin/mkinitcpio -p linux<br />
<br />
#!/bin/bash<br />
# nouveau -> nvidia<br />
<br />
/usr/bin/sudo /bin/sed -i 's/options nouveau modeset=1/#options nouveau modeset=1/' /etc/modprobe.d/modprobe.conf<br />
/usr/bin/sudo /bin/sed -i 's/MODULES="nouveau"/#MODULES="nouveau"/' /etc/mkinitcpio.conf<br />
<br />
/usr/bin/sudo /usr/bin/pacman -Rdds --noconfirm nouveau-dri xf86-video-nouveau libgl<br />
/usr/bin/sudo /usr/bin/pacman -S --noconfirm nvidia-173xx{,-utils}<br />
<br />
#/usr/bin/sudo /bin/rm /etc/X11/xorg.conf.d/{10-monitor,30-nouveau}.conf<br />
<br />
/usr/bin/sudo /sbin/mkinitcpio -p linux<br />
<br />
A reboot is needed to complete the switch.<br />
<br />
Adjust the scripts accordingly if you are using other version of NVIDIA drivers (I use nvidia-173xx).<br />
<br />
If you are using xorg-server older than 1.10.2-1, uncomment the lines that copy and remove {10-monitor,30-nouveau}.conf. Since version 1.10.2-1, xorg-server is patched to load nouveau driver automatically. I keep 10-monitor.conf and [[Nouveau#Loading|30-nouveau.conf]] in the same directory as this script, adjust the path if needed.<br />
<br />
==Troubleshooting==<br />
<br />
===Gaming using Twinview===<br />
In case you want to play fullscreen games when using Twinview, you will notice that games recognize the two screens as being one big screen. While this is technically correct (the virtual X screen really is the size of your screens combined), you probably do not want to play on both screens at the same time. <br />
<br />
To correct this behavior for SDL, try:<br />
export SDL_VIDEO_FULLSCREEN_HEAD=1<br />
<br />
For OpenGL, add the appropiate Metamodes to your xorg.conf in section {{Codeline|Device}} and restart X:<br />
Option "Metamodes" "1680x1050,1680x1050; 1280x1024,1280x1024; 1680x1050,NULL; 1280x1024,NULL;"<br />
<br />
Another method that may either work alone or in conjunction with those mentioned above is [[Gaming#Starting_games_in_a_separate_X_server|starting games in a separate X server]].<br />
<br />
===Old Xorg Settings===<br />
If upgrading from an old installation, please remove old {{Filename|/usr/X11R6}} paths as it can cause trouble during installation.<br />
<br />
===Corrupted screen: "Six screens" issue===<br />
For some users using Geforce GT 100M's, the screen turns out corrupted after X starts; divided into 6 sections with a resolution limited to 640x480.<br />
<br />
To solve this problem, enable the Validation Mode {{Codeline|NoTotalSizeCheck}} in section {{Codeline|Device}}:<br />
Section "Device"<br />
...<br />
Option "ModeValidation" "NoTotalSizeCheck"<br />
...<br />
EndSection<br />
==='/dev/nvidia0' Input/Output error===<br />
This error can occur for several different reasons, and the most common solution given for this error is to check for group/file permissions, which in almost every case is ''not'' the issue. The NVIDIA documentation does not talk in detail on what you should<br />
do to correct this problem but there are a few things that have worked for some people. The problem can be a IRQ conflict with another device or bad routing by either the kernel or your BIOS.<br />
<br />
First thing to try is to remove other video devices such as video capture cards and see if the problem goes away. If there are too many video processors on the same system it can lead into the kernel being unable to start them because of memory allocation problems with the video controller. In particular on systems with low video memory this can occur even if there is only one video processor. In such case you should find out the amount of your system's video memory (e.g. with ''lspci -v'') and pass allocation parameters to the kernel, e.g.:<br />
vmalloc=64M<br />
or<br />
vmalloc=256M<br />
<br />
Another thing to try is to change your BIOS IRQ routing from ''Operating system controlled'' to ''BIOS controlled'' or the other way around. The first one can be passed as a kernel parameter:<br />
PCI=biosirq<br />
<br />
The ''noacpi'' kernel parameter has also been suggested as a solution but since it disables ACPI completely it should be used with caution. Some hardware are easily damaged by overheating.<br />
<br />
{{Note|The kernel parameters can be passed either through the kernel command line or the bootloader configuration file. See your bootloader Wiki page for more information.}}<br />
<br />
==='/dev/nvidiactl' errors===<br />
Trying to start an opengl application might result in errors such as:<br />
Error: Could not open /dev/nvidiactl because the permissions are too<br />
restrictive. Please see the {{Codeline|FREQUENTLY ASKED QUESTIONS}} <br />
section of {{Codeline|/usr/share/doc/NVIDIA_GLX-1.0/README}} <br />
for steps to correct.<br />
<br />
Solve by adding the appropiate user to the "video" group and relogin:<br />
# gpasswd -a username video<br />
<br />
===32 bit applications do not start===<br />
Under 64 bit systems, installing {{Codeline|lib32-nvidia-utils}} that corresponds to the same version installed for the 64 bit driver fixes the issue.<br />
<br />
===Errors after updating the kernel===<br />
If a custom build of NVIDIA's module is used instead of the package from [extra], a recompile is required every time the kernel is updated. Rebooting is generally recommended after updating kernel and graphic drivers.<br />
<br />
===Crashing in general===<br />
* Try disabling {{Codeline|RenderAccel}} in xorg.conf.<br />
* If Xorg outputs an error about "conflicting memory type" or "failed to allocate primary buffer: out of memory", add {{Codeline|nopat}} at the end of the {{Codeline|kernel}} line in {{Codeline|/boot/grub/menu.lst}}.<br />
* If the NVIDIA compiler complains about different versions of GCC between the current one and the one used for compiling the kernel, add in {{Codeline|/etc/profile}}:<br />
export IGNORE_CC_MISMATCH=1<br />
* If Xorg is crashing with a "Signal 11" while using nvidia-96xx drivers, try disabling PAT. Pass the argument {{Codeline|nopat}} to the {{Codeline|kernel}} line in {{Codeline|menu.lst}}.<br />
More information about troubleshooting the driver can be found in the [http://www.nvnews.net/vbulletin/forumdisplay.php?s=&forumid=14 NVIDIA forums.]<br />
<br />
===Bad performance after installing a new driver version===<br />
If FPS have dropped in comparison with older drivers, first check if direct rendering is turned on:<br />
$ glxinfo | grep direct<br />
If the command prints:<br />
direct rendering: No<br />
then that could be an indication for the sudden FPS drop.<br />
<br />
A possible solution could be to regress to the previously installed driver version and rebooting afterwards.<br />
<br />
===CPU spikes with 400 series cards===<br />
If you are experiencing intermittent CPU spikes with a 400 series card, it may be caused by PowerMizer constantly changing the GPU's clock frequency. Switching PowerMizer's setting from Adaptive to Performance, add the following to the Device section of your Xorg configuration:<br />
<br />
Option "RegistryDwords" "PowerMizerEnable=0x1; PerfLevelSrc=0x3322; PowerMizerDefaultAC=0x1"<br />
<br />
===Laptops: X hangs on login/out, worked around with Ctrl+Alt+Backspace===<br />
If while using the legacy NVIDIA drivers Xorg hangs on login and logout (particularly with an odd screen split into two black and white/gray pieces), but logging in is still possible via Ctrl-Alt-Backspace (or whatever the new "kill X" keybind is), try adding this in {{Filename|/etc/modprobe.d/modprobe.conf}}:<br />
options nvidia NVreg_Mobile=1<br />
<br />
One user had luck with this instead, but it makes performance drop significantly for others:<br />
options nvidia NVreg_DeviceFileUID=0 NVreg_DeviceFileGID=33 NVreg_DeviceFileMode=0660 NVreg_SoftEDIDs=0 NVreg_Mobile=1<br />
<br />
Note that {{Codeline|NVreg_Mobile}} needs to be changed according to the laptop:<br />
* 1 for Dell laptops.<br />
* 2 for non-Compal Toshiba laptops.<br />
* 3 for other laptops.<br />
* 4 for Compal Toshiba laptops.<br />
* 5 for Gateway laptops.<br />
<br />
See [http://http.download.nvidia.com/XFree86/Linux-x86/1.0-7182/README/readme.txt NVIDIA Driver's Readme:Appendix K] for more information.<br />
<br />
===Refresh rate not detected properly by XRandR dependant utilities===<br />
The XRandR X extension is not presently aware of multiple display devices on a single X screen; it only sees the {{Codeline|MetaMode}} bounding box, which may contain one or more actual modes. This means that if multiple MetaModes have the same bounding box, XRandR will not be able to distinguish between them.<br />
<br />
In order to support {{Codeline|DynamicTwinView}}, the NVIDIA driver must make each MetaMode appear to be unique to XRandR. Presently, the NVIDIA driver accomplishes this by using the refresh rate as a unique identifier.<br />
<br />
Use {{Codeline|nvidia-settings -q RefreshRate}} to query the actual refresh rate on each display device.<br />
<br />
The XRandR extension is currently being redesigned by the X.Org community, so the refresh rate workaround may be removed at some point in the future.<br />
<br />
This workaround can also be disabled by setting the "DynamicTwinView" X configuration option to "false", which will disable NV-CONTROL support for manipulating MetaModes, but will cause the XRandR and XF86VidMode visible refresh rate to be accurate.<br />
<br />
===No screens found on a laptop / NVIDIA Optimus===<br />
On a laptop, if the NVIDIA driver cannot find any screens, you may have an NVIDIA Optimus setup : an Intel chipset connected to the screen and the video outputs, and a NVIDIA card that does all the hard work and writes to the chipset's video memory.<br />
<br />
Check if<br />
lspci | grep VGA<br />
outputs something similar to<br />
00:02.0 VGA compatible controller: Intel Corporation Core Processor Integrated Graphics Controller (rev 02)<br />
01:00.0 VGA compatible controller: nVidia Corporation Device 0df4 (rev a1)<br />
<br />
Unfortunately NVIDIA has no plans to support this in their Linux drivers.<br />
<br />
You need to install the [[Intel]] driver to handle the screens, then if you want 3D software you should run them through [[Bumblebee]] to tell them to use the NVIDIA card.<br />
<br />
===No brightness control on laptops===<br />
Try to add the following line on 20-nvidia.conf<br />
Option "RegistryDwords" "EnableBrightnessControl=1"<br />
If it still not working, you can try install [https://aur.archlinux.org/packages.php?ID=25467 nvidia-bl] or [https://aur.archlinux.org/packages.php?ID=50749 nvidiabl].<br />
<br />
===Black Bars while watching full screen flash videos with twinview===<br />
Follow the instructions presented here:<br />
[http://al.robotfuzz.com/content/workaround-fullscreen-flash-linux-multiheaded-desktops link]<br />
<br />
==External links==<br />
* [http://www.nvnews.net/vbulletin/forumdisplay.php?s=&forumid=14 NVIDIA forums]<br />
* [http://http.download.nvidia.com/XFree86/Linux-x86/1.0-7182/README/readme.txt Official readme for NVIDIA drivers]</div>Zendeavorhttps://wiki.archlinux.org/index.php?title=VirtualBox&diff=153127VirtualBox2011-08-24T07:50:07Z<p>Zendeavor: /* DAEMON Tools */</p>
<hr />
<div>[[Category:Emulators (English)]]<br />
[[fr:VirtualBox]]<br />
{{i18n|VirtualBox}}<br />
<br />
This article is about VirtualBox running in Arch, you may also be interested in [[Arch Linux VirtualBox Guest|Arch Linux as a VirtualBox Guest]].<br />
<br />
[http://www.virtualbox.org VirtualBox] is a virtual pc emulator like [[vmware]]. It has many of the features vmware has, as well as some of its own. It is in constant development and new features are implemented all the time. e.g. version 2.2 introduced OpenGL 3D acceleration support for Linux and Solaris guests. It has a nice GUI interface (Qt and/or SDL) or command line tools for managing virtual machines. Headless operation is also supported.<br />
<br />
==Installing==<br />
;{{package Official|virtualbox}}<br />
This is the basic GPL licensed VirtualBox suite, which can be found in the community repository.<br />
<br />
Install the basic package:<br />
# pacman -S virtualbox<br />
If you need additional features like RPD server, USB2.0 support, PXE boot for Intel cards etc, install {{package AUR|virtualbox-ext-oracle}}. This PUEL licensed extension pack is free for personal use. You can download it from the [[AUR]].<br />
<br />
Optionally install {{package Official|qt}} in order to use the GUI:<br />
# pacman -S qt<br />
<br />
==Running VirtualBox==<br />
Now, add the desired username to the ''vboxusers'' group:<br />
# gpasswd -a USERNAME vboxusers<br />
<br />
Build the required modules:<br />
# rc.d setup vboxdrv<br />
<br />
Lastly, edit {{Filename|/etc/[[rc.conf]]}} and add ''vboxdrv'' to the MODULES array in order to load the VirtualBox drivers at startup:<br />
MODULES=(... ''vboxdrv'')<br />
<br />
To load the module manually:<br />
# modprobe vboxdrv<br />
<br />
To start Virtualbox:<br />
$ virtualbox<br />
<br />
===Solving the impossible rc.d setup vboxdrv===<br />
<br />
In some case when VirtualBox is freshly installed you cannot compile the module and some error message appears, like:<br />
<br />
<pre><br />
# rc.d setup vboxdrv<br />
:: Unloading VirtualBox kernel modules [DONE]<br />
:: Recompiling VirtualBox kernel modules [BUSY]<br />
Look at /var/log/vbox-install.log to find out what went wrong<br />
Look at /var/log/vbox-install.log to find out what went wrong<br />
Look at /var/log/vbox-install.log to find out what went wrong<br />
[DONE]<br />
:: Reloading VirtualBox kernel modules}</pre><br />
<br />
with the evocated log file saying:<br />
<pre>Makefile:169: *** Error: unable to find the sources of your current Linux kernel. Specify KERN_DIR=<directory> and run Make again. Stop.<br />
cp: cannot stat `/tmp/vboxdrv-Module.symvers': No such file or directory<br />
Makefile:94: *** Error: unable to find the sources of your current Linux kernel. Specify KERN_DIR=<directory> and run Make again. Stop.<br />
cp: cannot stat `/tmp/vboxdrv-Module.symvers': No such file or directory<br />
Makefile:90: *** Error: unable to find the sources of your current Linux kernel. Specify KERN_DIR=<directory> and run Make again. Stop.</pre><br />
<br />
A solution is to install headers of your kernel:<br />
<br />
pacman -S linux-headers<br />
or, if you have got a lts version:<br />
pacman -S kernel26-lts-headers<br />
<br />
Then it could be useful to reboot your computer (but maybe not necessary, try) and following previous steps, your virtual machine should run.<br />
<br />
==Configuring==<br />
===Networking===<br />
VirtualBox guests may be networked through various methods; among them, there is [[#NAT]] and [[#Bridged]] networking. Using the [[#NAT]] method is the simplest and the default for new virtual machines.<br />
<br />
In order to use host-only and internal network settings you have to load the ''vboxnetadp'' kernel module. The [http://www.virtualbox.org/manual/UserManual.html VirtualBox manual] covers the available options for these two network types. They have been omitted here due to them being, for the most part, OS agnostic.<br />
<br />
====NAT====<br />
From VirtualBox:<br />
* access the VM's ''Settings'' menu;<br />
* click on ''Network'' from the list to the left; finally,<br />
* in the ''Attached to'' drop-down list, select ''NAT''.<br />
<br />
VirtualBox's bundled DHCP server enables the guest system to be configured with DHCP. The NAT IP address on the first card is 10.0.2.0, 10.0.3.0 on the second and so on.<br />
<br />
====Bridged====<br />
Bridged networking may be setup through various methods; among them, there is the native way, which requires minimal setup at the expense of having less control. For other methods, see [[Advanced VirtualBox Networking]]. Since newer versions, VirtualBox can bridge between a guest and a wireless host interface without the help of third party utilities.<br />
<br />
Before continuing, load the required module:<br />
# modprobe vboxnetflt<br />
<br />
From VirtualBox:<br />
* access the VM's ''Settings'' menu;<br />
* click on ''Network'' from the list to the left;<br />
* in the ''Attached to'' drop-down list, select ''Bridged Adapter''; finally,<br />
* in the ''Name'' drop-down list, select the name of the host interface that is connected to the network that the guest OS should be part of.<br />
<br />
Start the virtual machine and configure its network as usual; e.g., DHCP or static.<br />
<br />
===Guest additions===<br />
The Guest Additions make the shared folders feature available, improve video card acceleration support, and enable bi-directional clipboard between the guest and host. Mouse integration is another feature, taking away the need of releasing the mouse after using it in the guest.<br />
<br />
====Arch Linux guests====<br />
<br />
Refer to [[Arch Linux VirtualBox Guest]]<br />
<br />
====Windows guests====<br />
After installing Windows (XP etc.) on your virtual machine, simply select ''Devices &rarr; Install Guest Additions...''<br />
<br />
This will mount the iso image and windows should then automatically launch the guest additions installer. Follow the instructions to the end.<br />
If you have Guest Additions installed for one virtual machine, and you want to install it for another one, there is no need to re-download the .iso. Select ''Devices &rarr; CD/DVD Devices &rarr; Choose virtual CD/DVD drive'' and navigate to ~/.VirtualBox where the image is located. This is the case if you have multiple VMs.<br />
<br />
===Keyboard and mouse between the host and the guest===<br />
*To capture the keyboard and mouse, click the mouse inside the virtual machine display.<br />
*To uncapture, press right {{keypress|Ctrl}}.<br />
<br />
To get seamless mouse integration between host and guest, install the [[#Guest Additions]] inside the guest.<br />
<br />
When generating the guests' {{Filename|xorg.conf}} with {{Codeline|X -configure}}, the InputDevice section may feature the {{Codeline|mouse}} driver. After installing the Guest Additions, replace {{Codeline|mouse}} with {{Codeline|vboxmouse}} and then restart X or reboot the guest.<br />
<br />
Alternatively, add the following to the guest's {{Filename|xorg.conf}}:<br />
<pre><br />
Section "InputDevice"<br />
Identifier "Mouse0"<br />
Driver "vboxmouse"<br />
Option "Protocol" "auto"<br />
Option "Device" "/dev/input/mice"<br />
Option "ZAxisMapping" "4 5 6 7"<br />
EndSection<br />
<br />
Section "ServerLayout"<br />
Identifier "X.org Configured"<br />
Screen 0 "Screen0" 0 0<br />
InputDevice "Mouse0" "CorePointer"<br />
InputDevice "Keyboard0" "CoreKeyboard"<br />
EndSection<br />
</pre><br />
<br />
===Using full resolution of the host system in the guest===<br />
Set the resolution of your guest in the grub boot script {{Filename|/boot/grub/menu.lst}}, i.e. add the correct vga code to the kernel command line. For a resolution of 1280x1024, this would e.g. look like<br />
# kernel /vmlinuz-linux root=/dev/disk/by-uuid/7bdc5dee-8fb0-4260-bc43-60ac6e4e4a54 ro vga=795<br />
<br />
Add the resolution to {{Filename|/etc/X11/xorg.conf}}, e.g.<br />
<pre><br />
Section "Screen"<br />
...<br />
SubSection "Display"<br />
Viewport 0 0<br />
Depth 24<br />
Modes "1280x1024" "1024x768"<br />
EndSubSection<br />
...<br />
EndSection<br />
</pre><br />
If you experience problems with your resolution dropping back to second lower resolution in the 'Modes' setting, simply omit the second resolution. Example <br />
Modes "1280x1024"<br />
<br />
===Sharing folders between the host and the guest===<br />
In the settings of the virtual machine go to shared folders tab and add the folders you want to share.<br />
<br />
*NOTE: You need to install Guest Additions in order to use this feature.<br />
In a Linux host, ''Devices &rarr; Install Guest Additions''<br />
Yes (when asked to download the CD image)<br />
Mount (when asked to register and mount)<br />
<br />
In a Linux host, create one or more folders for sharing files, then set the shared folders via the virtualbox menu (guest window).<br />
<br />
In a Windows guest, starting with VirtualBox 1.5.0, shared folders are browseable and are therefore visible in Windows Explorer. Open Windows Explorer and look for it under ''My Networking Places &rarr; Entire Network &rarr; VirtualBox Shared Folders''.<br />
<br />
Launch the windows explorer (run explorer command) to browse the network places -> expand with the (+) sign : entire network &rarr; VirtualBox shared folders &rarr; '''\\Vboxsvr''' &rarr; then you can now expand all your configured shared folders here, and set up shortcuts for Linux folders in the guest filesystem. You can alternatively use the "Add network place wizard", and browse to "VBoxsvr".<br />
<br />
Alternatively, on the Windows command line, you can also use the following:<br />
net use x: \\VBOXSVR\sharename<br />
<br />
While {{Codeline|VBOXSVR}} is a fixed name, replace {{Codeline|x:}} with the drive letter that you want to use for the share, and sharename with the share name specified with VBoxManage.<br />
<br />
In a Windows guest, to improve loading and saving files (e.g. MS Office) by VirtualBox Shared Folders edit ''c:\windows\system32\drivers\etc\hosts'' as below:<br />
127.0.0.1 localhost vboxsvr<br />
<br />
In a Linux guest, use the following command:<br />
# mount -t vboxsf [-o OPTIONS] sharename mountpoint<br />
(Notes: sharename is optional or same as selected in the VirtualBox-Dialog , mountpoint of the shared directory in the hosts filesystem)<br />
:Automatically mounting a shared folder is possible through the linux-guest /etc/fstab file. You may also specify the uid=#,gid=# (where # is replaced by the actual numerical uid and gid) to mount the share with normal user permissions instead of root permissions. (this can be helpful to mount parts of your host ~/home for use in your Linux-guest. To do this add an entry in the following format to the linux-guest /etc/fstab:<br />
<br />
sharename mountpoint vboxsf uid=#,gid=# 0 0<br />
<br />
Replace {{Codeline|sharename}} with the share name specified with VBoxManage, and mountpoint with the path where you want the share to be mounted (e.g. /mnt/share). The usual mount rules apply, that is, create this directory first if it does not exist yet. Note that if you have told VirtualBox to "automatically mount" the shared folder, this step may not be necessary and your folder will be found somewhere under /media.<br />
<br />
Beyond the standard options supplied by the mount command, the following are available:<br />
iocharset=CHARSET<br />
to set the character set used for I/O operations (utf8 by default) and<br />
convertcp=CHARSET<br />
to specify the character set used for the shared folder name (utf8 by default).<br />
<br />
===Getting audio to work in the guest machine===<br />
In the machine settings, go to the audio tab and select the correct driver according to your sound system (ALSA, OSS or PulseAudio).<br />
<br />
===Setting up the RAM and video memory for the guest===<br />
You can change the default values by going to ''Settings &rarr; General''.<br />
<br />
===Setting up CD-ROM for the guest===<br />
You can change the default values by going to ''Settings &rarr; CD/DVD-ROM''.<br />
<br />
Check mount CD/DVD drive and select one of the following options.<br />
<br />
===Enabling D3D acceleration in Windows guests===<br />
Recent versions of Virtualbox have support for accelerating OpenGL inside guests. This can be enabled with a simple checkbox in the machine's settings, right below where video ram is set, and installing the Virtualbox guest additions. However, most Windows games use Direct3D (part of DirectX), not OpenGL, and are thus not helped by this method. However, it is possible to gain accelerated Direct3D in your Windows guests by borrowing the d3d libraries from Wine, which translate d3d calls into OpenGL, which is then accelerated. <br />
<br />
After enabling OpenGL acceleration as described above, go to http://www.nongnu.org/wined3d/ in your Windows guest and grab the "Latest version (Installer):". Reboot the guest into safe mode (press F8 before the Windows screen appears but after the Virtualbox screen disappears), and install wined3d, accepting the defaults during the install. (You may check the box for DirectX 10 support if you like, dont touch anything else.) Reboot back to normal mode and you should have accelerated Direct3D. <br />
<br />
{{Note | This hack may or may not work for some games depending on what hardware checks they make and what parts of D3D they use.}}<br />
{{Note | This has only been tried on Windows XP and Windows 7 RC guests AFAIK, and does not work on the Windows 7 guest. If you have experience with this on a different windows version, please add that data here.}}<br />
<br />
==Virtualized OS setup==<br />
Virtualbox needs to be setup to virtualize another operating system.<br />
<br />
===Test a liveCD/DVD===<br />
Click the 'New' button to create a new virtual environment. Name it appropriately and select Operating System type and version. Select base memory size (note: most operating systems will need at least 512MB to function properly). Create a new hard disk image (a hard disk image is a file that will contain the operating system's filesystem and files).<br />
<br />
When the new image has been created, click 'Settings', then CD/DVD-ROM, check 'Mount CD/DVD Drive' then select an ISO image.<br />
<br />
==Maintenance==<br />
<br />
===Rebuild the vboxdrv module===<br />
Note that any time your kernel version changes (due to an upgrade, recompile, etc.) you must also rebuild the VirtualBox kernel modules.<br />
<br />
Ensure that ''linux-headers'' is still installed, and run the following command:<br />
# rc.d setup vboxdrv<br />
<br />
This will build the VirtualBox kernel modules for the ''currently running kernel''; if you have just upgraded your kernel package, reboot before trying to rebuild your kernel modules.<br />
<br />
After rebuilding the module, do not forget to load it with<br />
# modprobe vboxdrv<br />
<br />
''vboxdrv'' and ''vboxnetflt'' should be in the MODULES=() section of your /etc/rc.conf<br />
<br />
If you are using an old virtualbox_bin package built from AUR, run:<br />
# vbox_build_module<br />
<br />
If you need to rebuild the Virtual Box Additions in a guest installation of Arch Linux, use this command:<br />
# rc.d setup rc.vboxadd<br />
<br />
===Compact a disk image===<br />
==== Linux Guests ====<br />
Boot the Linux guest VM and remove all bloat (unwanted packages, temp files, etc.). When satisfied, wipe the freespace using dd or preferably dcfldd:<br />
<br />
$ dcfldd if=/dev/zero of=fillfile bs=4M<br />
<br />
When the fillfile hits the limit of the virtual hdd, the vast majority of user-space (non-reserved blocks) will be filled. Alternatively, run the command as root to get all of them. Example message: "8192 blocks (8192Mb) written.dcfldd:: No space left on device."<br />
<br />
Once this occurs, simply remove the fill file and powerdown the VM:<br />
<br />
$ rm -f fillfile && sudo shutdown -hF now<br />
<br />
{{Note| The -F switch will force a disk check upon a reboot which is advised following the compact operation.}}<br />
<br />
Now compact the disk:<br />
<br />
$ VBoxManage modifyhd /path/to/your.vdi --compact<br />
<br />
==== Windows Guests ====<br />
<br />
See [http://www.mdl4.com/2010/04/virtualbox-compact-a-vdi-in-ubuntu this article].<br />
<br />
===Increase the size of a virtual hard drive for a Windows guest===<br />
{{Warning|This has only been tested with Windows XP and Windows 7 guests.}}<br />
<br />
If you find that you are running out of space due to the small hard drive size you selected when created your VM, you can take the following steps:<br />
<br />
Create a new vdi in ~/.VirtualBox/HardDisks by running:<br />
# cd ~/.VirtualBox/HardDisks<br />
# VBoxManage createhd -filename new.vdi --size 10000<br />
<br />
where size is in mb, in this example 10000MB ~= 10GB, and new.vdi is name of new hard drive to be created.<br />
<br />
Next the old vdi needs to be cloned to the new vdi, this may take some time so wait while it occurs:<br />
# VBoxManage clonehd old.vdi new.vdi --existing<br />
<br />
Detach old harddrive and attach new hard drive, replace VMName with whatever you called your VM:<br />
# VBoxManage modifyvm VMName --hda none<br />
# VBoxManage modifyvm VMName --hda new.vdi<br />
<br />
Boot the VM, run Partition Wizard 5 to resize the partition on the fly, and reboot.<br />
<br />
Remove old vdi from VirtualBox and delete<br />
# VBoxManage closemedium disk old.vdi<br />
# rm old.vdi<br />
<br />
===Windows Xp and Nokia phones===<br />
To get working Windows XP and Nokia phones with Pc Suite mode, Virtualbox needs two simple steps:<br />
<br />
'''1.''' Add a rule to udev with {{Filename|/etc/udev/rules.d/40-permissions.rules}}:<br />
LABEL="usb_serial_start"<br />
ATTRS{idVendor}=="0403", ATTRS{idProduct}=="6001", \<br />
GROUP="usbfs", MODE="0660", GROUP="dialout"<br />
LABEL="usb_serial_end"<br />
<br />
'''2.''' Create the group usbfs and add its user to it<br />
$ sudo groupadd usbfs<br />
$ sudo usermod -a -G usbfs $USER<br />
<br />
After a logout, connect a Nokia phone with PC Suite mode and start Windows XP to test new rule.<br />
<br />
==Migrating from another VM==<br />
The <code>qemu-img</code> program can be used to convert images from one format to another, or add compression or encryption to an image. <br />
# pacman -S qemu<br />
<br />
===Converting from QEMU images===<br />
To convert a QEMU image for use with VirtualBox, first convert it to ''raw'' format, then use VirtualBox's conversion utility to convert and compact it in its native format.<br />
$ qemu-img convert -O raw test.qcow2 test.raw<br />
$ VBoxManage modifyvdi /full/path/to/test.vdi compact<br />
or <br />
$ qemu-img convert -O raw test.qcow2 test.raw<br />
(of course you must have installed qemu package for that)<br />
$ VBoxManage convertfromraw /full/path/to/test.raw /full/path/to/test.vdi<br />
$ VBoxManage modifyvdi /full/path/to/test.vdi compact<br />
<br />
===Converting from VMware images ===<br />
Do <br />
$ VBoxManage clonehd source.vmdk target.vdi --format VDI<br />
<br />
This may not be needed anymore with recent virtualbox versions (to be confirmed)<br />
<br />
==Tips and tricks==<br />
<br />
===Starting Virtual Machines directly without starting the virtualbox console===<br />
I find it useful to start the virtual machines directly rather than start the console. To do this I simply assign a keybinding in .xbindkeysrc to <br />
"VBoxManage startvm '''''vm-name'''''"<br />
'''''keycode'''''<br />
'''''keyname'''''<br />
If you have a space in the vm name, then enclose the vm-name in single apostrophes. For eg.<br />
"VBoxManage startvm 'Windows 7'"<br />
m:0x0 + c:163<br />
XF86Mail<br />
<br />
===Getting Web-cams and other USB devices to detect===<br />
Make sure you filter any devices that are not a keyboard or a mouse so they do not start up at boot and this insures that Windows will detect the device at start-up.<br />
<br />
===Sending a CTRL+ALT+F1 to the Guest===<br />
If your guest O/S is a Linux distro, and you want to open a new tty text shell or exit X via typing {{Keypress|Ctrl}}+{{Keypress|Alt}}+{{Keypress|F1}}, you can easily send this command to the guest O/S simply by hitting your 'Host Key' (usually the {{Keypress|Ctrl}} in the Right side of your keyboard) + {{Keypress|F1}} or {{Keypress|F2}}, etc.<br />
<br />
===Starting VMs at system boot on headless servers===<br />
Add this line to /etc/rc.local<br />
exec /bin/su -c 'VBoxManage startvm --type headless <''UUID|NAME''>' ''PREFERED_USER'' >/dev/null 2>&1<br />
Where <UUID|NAME> is the guest identifier, and PREFERRED_USER is the user profile that contains the VM definitions and .vdi files.<br />
<br />
Since exec replaces the currently running process, you will not be able to start a second VM, or execute any other commands, after the exec. Try the following if this is a problem:<br />
su -c 'VBoxHeadless -s <''UUID|NAME''> &' -s /bin/sh ''PREFERED_USER'' >/dev/null 2>&1<br />
Using fully qualified path to su and VBoxHeadless is recommend. Add additional lines like above to start additional VMs. Commands following these in rc.local will be executed. Based on some rooting around in the VBox documentation, I get the impression this will be a little more robust than 'VBoxManage ... --type headless' in future VBox releases.<br />
<br />
To determine the available VMs for a user:<br />
su -c 'VBoxManage list vms' PREFERED_USER<br />
<br />
To save the state of a running VM:<br />
su -c 'VBoxManage controlvm <UUID|NAME> savestate' PREFERED_USER<br />
rc.local.shutdown would be a good spot for this.<br />
<br />
=== Guest management daemon ===<br />
Below is a [[daemon]] for automating guest administration. Guests will be initialized on start, and state-saved on stop, or you will just get a "./vbox_service: line 31: out[${m[1]}]: bad array subscript" message when you run it.<br />
<br />
The configuration file:<br />
{{File|name=/etc/conf.d/vbox_service|content=<nowiki><br />
# Guests to manage:<br />
#VB_GUESTS=('OpenBSD' 'Slackware' 'Windows XP')<br />
#<br />
# Disable a guest by prepending a bang:<br />
#VB_GUESTS=('OpenBSD' 'Slackware' !'Windows XP')<br />
#<br />
# Default value matches none:<br />
VB_GUESTS=()<br />
<br />
# User to run Virtual Box as:<br />
VB_USER='vbox'<br />
</nowiki>}}<br />
<br />
The script:<br />
{{File|name=/etc/rc.d/vbox_service|content=<nowiki><br />
#!/bin/bash<br />
<br />
. /etc/rc.conf<br />
. /etc/rc.d/functions<br />
<br />
unset VB_GUESTS<br />
unset VB_USER<br />
[[ -r /etc/conf.d/vbox_service ]] && . /etc/conf.d/vbox_service<br />
[[ ${VB_GUESTS[@]} ]] || VB_GUESTS=()<br />
[[ ${VB_USER[@]} ]] || VB_USER='vbox'<br />
<br />
<br />
match() {<br />
[[ $REPLY =~ $1 ]] && m=("${BASH_REMATCH[@]}")<br />
}<br />
<br />
<br />
vm_raw() {<br />
local argv=''<br />
printf -v argv ' %q ' "$@"<br />
su -c "/usr/bin/VBoxManage $argv" -s /bin/sh "$VB_USER"<br />
}<br />
<br />
vm_ls() {<br />
local -A out=''<br />
local -i ret=1<br />
<br />
local m=()<br />
while read -r; do<br />
match '^"(.+)" \{(.+)\}$'<br />
out[${m[1]}]=${m[2]}<br />
done < <(vm_raw list vms)<br />
<br />
local i=''<br />
for i in "${VB_GUESTS[@]##!*}"; do<br />
if [[ ${out[$i]} ]]; then<br />
printf ' %q ' "${out[$i]}"<br />
ret=0<br />
fi<br />
done<br />
<br />
return $ret<br />
}<br />
<br />
vm_envinit() {<br />
local m=()<br />
while read -r; do<br />
match '^(.+)="?([^"]+)'<br />
env[$1:${m[1]}]=${m[2]}<br />
done < <(vm_raw showvminfo --machinereadable "$1")<br />
}<br />
<br />
<br />
start() {<br />
if [[ ${env[$1:VMState]} != 'running' ]]; then<br />
vm_raw startvm --type headless "$1"<br />
fi<br />
}<br />
<br />
stop() {<br />
if [[ ${env[$1:VMState]} == 'running' ]]; then<br />
vm_raw controlvm "$1" savestate<br />
fi<br />
}<br />
<br />
restart() {<br />
stop "$1"<br />
sleep 3<br />
start "$1"<br />
}<br />
<br />
usage() {<br />
printf '%s\n' "usage: $0 <start|stop|restart> [name|uuid]..." >&2<br />
}<br />
<br />
<br />
if [[ ! $1 =~ ^(start|stop|restart)$ ]]; then<br />
usage<br />
exit 2<br />
fi<br />
cmd=$1<br />
shift<br />
(($#)) || eval set -- "$(vm_ls)"<br />
<br />
stat_busy "${cmd^}ing VMs:"<br />
trap 'stat_die' ERR<br />
set -Ee<br />
<br />
declare -A env=''<br />
<br />
for i; do<br />
[[ $i ]]<br />
vm_envinit "$i"<br />
stat_append "${env[$i:name]}, "<br />
$cmd "${env[$i:UUID]}" &>/dev/null<br />
done<br />
<br />
stat_done<br />
</nowiki>}}<br />
<br />
===Accessing server on VM from host===<br />
To access apache on a VM from the Host machine ONLY, simply execute the following lines on the Host:<br />
$ VBoxManage setextradata GuestName "VBoxInternal/Devices/pcnet/0/LUN#0/Config/Apache/HostPort" 8888<br />
$ VBoxManage setextradata GuestName "VBoxInternal/Devices/pcnet/0/LUN#0/Config/Apache/GuestPort" 80<br />
$ VBoxManage setextradata GuestName "VBoxInternal/Devices/pcnet/0/LUN#0/Config/Apache/Protocol" TCP<br />
Where 8888 is the port the host should listen on and 80 is the port the VM will send Apache's signal on. <br />
To use a port lower than 1024 on the host machine changes need to be made to the firewall on the host machine. This can also be set up to work with SSH, etc.. by changing "Apache" to whatever service and using different ports. <br />
<br />
Note: "pcnet" refers to the network card of the VM. If you use an Intel card in your VM settings change "pcnet" to "e1000"<br />
<br />
*from [http://mydebian.blogdns.org/?p=111 ]<br />
<br />
===DAEMON Tools===<br />
While VirtualBox can mount ISO images without a problem, there are some image formats which cannot reliably be converted to ISO. For instance, ccd2iso ignores .ccd and .sub files, which can give disk images with broken files. cdemu, fuseiso, and MagicISO will do the same. In this case there is no choice but to use Daemon Tools inside VirtualBox.<br />
<br />
===Using VirtualBox on a USB key===<br />
When using VirtualBox on a USB key, for example to start an installed machine with an ISO image, you will manually have to create VDMKs from the existing drives. However, once the new VMDKs are saved and you move on to another machine, you may experience problems launching an appropriate machine again. To get rid of this issue, you can use the following script to launch VirtualBox. This script will clean up and unregister old VMDK files and it will create new, proper VMDKs for you:<br />
<pre><br />
#!/bin/bash<br />
<br />
# Erase old VMDK entries<br />
rm ~/.VirtualBox/*.vmdk<br />
<br />
# Clean up VBox-Registry<br />
sed -i '/sd/d' ~/.VirtualBox/VirtualBox.xml<br />
<br />
# Remove old harddisks from existing machines<br />
find ~/.VirtualBox/Machines -name \*.xml | while read file; do<br />
line=`grep -e "type\=\"HardDisk\"" -n $file | cut -d ':' -f 1`<br />
if [ -n "$line" ]; then<br />
sed -i ${line}d $file<br />
sed -i ${line}d $file<br />
sed -i ${line}d $file<br />
fi<br />
sed -i "/rg/d" $file<br />
done<br />
<br />
# Delete prev-files created by VirtualBox<br />
find ~/.VirtualBox/Machines -name \*-prev -exec rm '{}' \;<br />
<br />
# Recreate VMDKs<br />
ls -l /dev/disk/by-uuid | cut -d ' ' -f 9,11 | while read ln; do<br />
if [ -n "$ln" ]; then<br />
uuid=`echo "$ln" | cut -d ' ' -f 1`<br />
device=`echo "$ln" | cut -d ' ' -f 2 | cut -d '/' -f 3 | cut -b 1-3`<br />
<br />
# determine whether drive is mounted already<br />
checkstr1=`mount | grep $uuid`<br />
checkstr2=`mount | grep $device`<br />
checkstr3=`ls ~/.VirtualBox/*.vmdk | grep $device`<br />
if [[ -z "$checkstr1" && -z "$checkstr2" && -z "$checkstr3" ]]; then<br />
VBoxManage internalcommands createrawvmdk -filename ~/.VirtualBox/$device.vmdk -rawdisk /dev/$device -register<br />
fi<br />
fi<br />
done<br />
<br />
# Start VirtualBox<br />
VirtualBox<br />
</pre><br />
Note that your user has to be added to the "disk" group to create VMDKs out of existing drives.<br />
<br />
===phpVirtualBox===<br />
An open source, AJAX implementation of the VirtualBox user interface written in PHP. As a modern web interface, it allows you to access and control remote VirtualBox instances. Much of its verbage and some of its code is based on the (inactive) vboxweb project. It allows the administrator to remotely, graphically, administer their virtual machines without having to log in to their headless VirtualBox servers.<br />
<br />
This requires the PUEL edition for VirtualBox.<br />
<br />
An installation guide is available here:<br />
http://code.google.com/p/phpvirtualbox/wiki/Installation<br />
<br />
Arch Linux users should uncomment these 2 extensions in ''/etc/php/php.ini''<br />
extension=json.so<br />
extension=soap.so<br />
<br />
==Troubleshooting==<br />
===OpenBSD===<br />
Some people with older computers can have trouble running an OpenBSD VM, manifesting as bunch of segmentation faults and total unusability. Starting VirtualBox with the -norawr0 argument may solve the problem. You can do it like this:<br />
$ VBoxSDL -norawr0 -vm NameOfYourOpenBSDVM<br />
<br />
See also [[PhpVirtualBox]]<br />
<br />
==External links==<br />
* [http://www.virtualbox.org/manual/UserManual.html VirtualBox User Manual]</div>Zendeavorhttps://wiki.archlinux.org/index.php?title=Beginners%27_Guide/Post-Installation&diff=149772Beginners' Guide/Post-Installation2011-07-23T02:09:33Z<p>Zendeavor: /* Bash script to update your mirrorlist with the most up-to-date mirrors */</p>
<hr />
<div><noinclude><br />
[[Category:Getting and installing Arch (English)]] [[Category:About Arch (English)]]<br />
[[Category:Website Resources]]<br />
{{i18n|Beginners' Guide/Post-Installation}}<br />
{{Tip|This is part of a multi-page article for The Beginners' Guide. '''[[Beginners' Guide|Click here]]''' if you would rather read the guide in its entirety.}}<br />
</noinclude><br />
==Post-Installation==<br />
'''Congratulations, and welcome to your new Arch Linux base system!'''<br />
<br />
This section will cover various must-do procedures after installation such as updating your new system and adding a regular, non-root user.<br />
<br />
===Update===<br />
Your new Arch Linux base system is now a functional GNU/Linux environment ready for customization. From here, you may build this elegant set of tools into whatever you wish or require for your purposes.<br />
<br />
Login with the root account. We will configure pacman and update the system as root.<br />
<br />
{{Note|Virtual consoles 1-6 are available. You may switch between them with <ALT>+F1...F6}}<br />
<br />
====Configure the network (if necessary)====<br />
If you properly configured your system, you should have a working network. Try to <code>ping example.com</code> to verify:<br />
{{Command|ping -c 3 example.com |<nowiki>PING example.com (192.0.43.10) 56(84) bytes of data.<br />
64 bytes from 43-10.any.icann.org (192.0.43.10): icmp_req=1 ttl=248 time=25.6 ms<br />
64 bytes from 43-10.any.icann.org (192.0.43.10): icmp_req=2 ttl=248 time=22.9 ms<br />
64 bytes from 43-10.any.icann.org (192.0.43.10): icmp_req=3 ttl=248 time=23.6 ms<br />
<br />
--- example.com ping statistics ---<br />
3 packets transmitted, 3 received, 0% packet loss, time 2003ms<br />
rtt min/avg/max/mdev = 22.912/24.062/25.632/1.156 ms</nowiki>}}<br />
<br />
If you have successfully established a network connection, continue with '''[[#Update, Sync, and Upgrade the system with pacman|Update, Sync, and Upgrade the system with pacman]]'''.<br />
<br />
If, after trying to ping www.google.com, an "unknown host" error is received, you may conclude that your network is not properly configured. You may choose to double-check the following files for integrity and proper settings:<br />
<br />
{{Filename|/etc/rc.conf}} - Specifically, check your HOSTNAME and NETWORKING section for typos and errors.<br />
<br />
{{Filename|/etc/hosts}} - Double-check for format, typos, and errors.<br />
<br />
{{Filename|/etc/resolv.conf}} - If you are using a static IP. If you are using DHCP, this file will be dynamically created and destroyed by default.<br />
<br />
{{Tip|Advanced instructions for configuring the network can be found in the [[Network]] article.}}<br />
<br />
=====Wired LAN=====<br />
Check your Ethernet with<br />
{{Cli|$ ip addr}}<br />
All interfaces will be listed. You should see an entry for eth0, or perhaps eth1. These examples will use eth0.<br />
<br />
'''Static IP'''<br />
<br />
If required, you can set a new static IP with:<br />
{{Cli|# ifconfig eth0 <ip address> netmask <netmask> up}}<br />
and the default gateway with<br />
{{Cli|# route add default gw <ip address of the gateway>}}<br />
Verify that {{Filename|/etc/resolv.conf}} contains your DNS server and add it if it is missing.<br />
Check your network again with <code>ping -c 3 www.google.com</code>. If everything is working now, adjust {{Filename|/etc/rc.conf}} as described above for static IP.<br />
<br />
'''DHCP'''<br />
<br />
If you have a DHCP server/router in your network try:<br />
{{Cli|# dhcpcd eth0}}<br />
If this is working, adjust {{Filename|/etc/rc.conf}} as described above, for dynamic IP.<br />
<br />
=====Wireless LAN=====<br />
Please see [[<noinclude>Beginners' Guide/Installation</noinclude>#Wireless Quickstart For the Live Environment|Wireless Quickstart For the Live Environment]] for details on connecting to a wireless network. Although you are no longer running off the installation media, the commands are the same as long as you installed all related wireless packages during package selection. Remember, your wireless device may need firmware in order to operate. For troubleshooting, check the detailed [[Wireless Setup]] page.<br />
<br />
=====Proxy Server=====<br />
If you are behind a proxy server, edit {{Filename|/etc/wgetrc}} and set http_proxy and ftp_proxy in it.<br />
<br />
=====Analog Modem, ISDN, and DSL (PPPoE)=====<br />
See [[Internet Access]] for detailed instructions.<br />
<br />
====Update, Sync, and Upgrade the system with [[pacman]]====<br />
Now we will update the system using [[pacman]]. [[Pacman]] is the '''pac'''kage '''man'''ager of Arch Linux. It manages your entire package system and handles installation, removal, package downgrade (through cache), custom compiled package handling, automatic dependency resolution, remote and local searches and much more. Pacman will now be used to download software packages from remote repositories and install them onto your system.<br />
<br />
{{Note|If you installed via a Netinstall, many, if not all, of your packages will already be up to date. However, it is still advisable to run through this update process.}}<br />
<br />
=====/etc/pacman.conf=====<br />
pacman will attempt to read {{Filename|/etc/pacman.conf}} each time it is invoked. This configuration file is divided into sections, or repositories. Each section defines a package [[Official Repositories|repository]] that pacman can use when searching for packages. The exception to this is the <tt>options</tt> section, which defines global options.<br />
<br />
{{Note| The defaults should work, so modifying at this point may be unnecessary, but verification is always recommended. Further info available in the [[Mirrors]] article.}}<br />
<br />
# nano /etc/pacman.conf<br />
<br />
Repositories are described below; enable all desired repositories by removing the # in front of the 'Include =' and '[repository]' lines.<br />
<br />
{{Note|<nowiki>When choosing repos, be sure to uncomment both the repository header lines in [brackets] as well as the 'Include =' lines. Failure to do so will result in the selected repository being omitted! This is a very common error.</nowiki>}}<br />
<br />
=====Package Repositories=====<br />
A [[Wikipedia:software repository|software repository]] is a storage location from which software packages may be retrieved and installed on a computer. Arch Linux [[Package Maintainer|package maintainers]] (developers and [[Trusted Users]]) maintain a number of official repositories containing software packages for essential and popular software, readily accessible via [[pacman]]. This article outlines those officially-supported repositories. See [[Official Repositories]] for more information including details about the purpose of each repository.<br />
<br />
Most people will want to use [core], [extra] and [community]. If you want to run 32-bit applications on Arch x86_64, enable the [multilib] repository by adding the lines below to /etc/pacman.conf:<br />
<br />
[multilib]<br />
Include = /etc/pacman.d/mirrorlist<br />
<br />
=====AUR=====<br />
The '''[[AUR]]''' also contains the '''unsupported''' branch, which cannot be accessed directly by pacman*. '''AUR''' [unsupported] does not contain binary packages. Rather, it provides more than twenty-eight thousand PKGBUILD scripts for building packages from source, that may be unavailable through the other repos. When an AUR unsupported package acquires enough popular votes, it may be moved to the AUR [community] binary repo, if a TU is willing to adopt and maintain it there.<br />
* TU maintained<br />
* All PKGBUILD bash build scripts<br />
* '''Not''' pacman accessible by default<br />
<br />
<nowiki>*</nowiki> pacman wrappers ('''''[[AUR Helpers]]''''') can help you seamlessly access AUR.<br />
<br />
====/etc/pacman.d/mirrorlist====<br />
Defines pacman repository mirrors and priorities.<br />
<br />
{{Note|If your installation medium is old, your mirrorlist might be outdated, which might lead to problems when updating archlinux with pacman (see here for the [https://bugs.archlinux.org/task/22510 bug report]). Therefore it is a good idea to get the latest version of the mirrorlist from [http://www.archlinux.org/mirrorlist/ the pacman mirror list generator page]. Copy the freshly generated list to {{Filename|/etc/pacman.d/mirrorlist}} before you continue.}}<br />
<br />
Open {{Filename|/etc/pacman.d/mirrorlist}} in an editor and uncomment (remove the '#' in front) a server close to you. Then issue a complete package refresh:<br />
# pacman -Syy<br />
Passing two --refresh or -y flags forces pacman to refresh all package lists even if they are considered to be up to date. Issuing pacman -Syy ''whenever a mirror is changed'', is good practice and will avoid possible headaches.<br />
<br />
=====Mirrorcheck for up-to-date packages=====<br />
Since <code>rankmirrors</code> does not take into account how up-to-date a mirror's package list is, it is important to note that one or more of the mirrors it selects as fastest may still be out-of-date. [http://www.archlinux.org/mirrors/status/ ArchLinux MirrorStatus] reports various aspects about the mirrors such as network problems with mirrors, data collection problems, the last time mirrors have been synced, etc. One may wish to manually inspect {{Filename|/etc/pacman.d/mirrorlist}}, ensuring that the file contains only up-to-date mirrors if having the latest package versions is a priority.<br />
<br />
Alternatively, the [http://www.archlinux.org/mirrorlist/ Mirrorlist Generator] can automatically rank mirrors close to your location by how up-to-date they are.<br />
<br />
=====Bash script to update your mirrorlist with the most up-to-date mirrors=====<br />
If you are in the United States, you can use the following shell script to update your mirrors based on the above rankings:<br />
<br />
NOTE: On my system, this script backs up the original mirrorlist, then replaces it with an XML file - not a mirrorlist.<br />
<pre><br />
#!/bin/bash<br />
<br />
# Define tmpfile<br />
tmpfile=/tmp/mirrorlisttmp<br />
<br />
# Determine architecture type<br />
archtype=$(uname -m)<br />
<br />
# Get latest mirror list and save to tmpfile <br />
wget -O $tmpfile "http://www.archlinux.org/mirrorlist/?country=United+States&protocol=ftp&protocol= \<br />
http&ip_version=4&use_mirror_status=on" >/dev/null 2>&1<br />
<br />
# Wrangle txt in saved file<br />
sed -i -e "s/^#Server/Server/g" -e "s/\$arch/"$archtype"/g" $tmpfile <br />
<br />
# Backup and replace current mirrorlist file <br />
if [[ ! -f /etc/pacman.d/mirrorlist.orig ]]; then<br />
mv /etc/pacman.d/mirrorlist /etc/pacman.d/mirrorlist.orig && echo "Successfully backed up original mirrorlist!"<br />
cp $tmpfile /etc/pacman.d/mirrorlist && echo "Successfully applied new mirrorlist!"<br />
else<br />
mv /etc/pacman.d/mirrorlist /etc/pacman.d/mirrorlist.bak && echo "Successfully backed up current mirrorlist!"<br />
cp $tmpfile /etc/pacman.d/mirrorlist && echo "Successfully applied new mirrorlist!"<br />
fi<br />
<br />
exit<br />
</pre><br />
<br />
NOTE: You will need to copy the text above, place it into a file (call it updatemirrors.sh), run chmod +x on the file and then run it with sudo/root privileges.<br />
<br />
====Get familiar with pacman====<br />
pacman is the Arch user's best friend. It is highly recommended to study and learn how to use the pacman(8) tool. Try:<br />
$ man pacman<br />
<br />
For more information, have a look at the [[pacman]] wiki entry at your own leisure, or check out the [[pacman rosetta]] entry for a comparison to other popular package managers.<br />
<br />
====Update the System====<br />
You are now ready to upgrade your entire system. Before you do, read through the [http://www.archlinux.org/news/ news] (and optionally the [http://archlinux.org/pipermail/arch-announce/ announce mailing list]). Often the developers will provide important information about required configurations and modifications for known issues. Consulting these pages before any upgrade is good practice.<br />
<br />
Sync, refresh, and upgrade your entire new system with:<br />
# pacman -Syu<br />
or:<br />
# pacman --sync --refresh --sysupgrade<br />
<br />
pacman will now download a fresh copy of the master package list from the server(s) defined in {{Filename|/etc/pacman.conf}} and perform all available upgrades. You may be prompted to upgrade pacman itself at this point. If so, say yes, and then reissue the <code>pacman -Syu</code> command when finished.<br />
<br />
Reboot if a kernel upgrade has occurred.<br />
<br />
{{Note|Occasionally, configuration changes may take place requiring user action during an update; read pacman's output for any pertinent information. See [[Pacnew and Pacsave Files]] for more details.}}<br />
<br />
Pacman output is saved in {{Filename|/var/log/pacman.log}}.<br />
<br />
See [[FAQ#Package Management|Package Management FAQ]] for answers to frequently asked questions regarding updating and managing your packages.<br />
<br />
=====Ignoring Packages=====<br />
After executing the command <code>pacman -Syu</code>, the entire system will be updated. It is possible to prevent a package from being upgraded. A typical scenario would be a package for which an upgrade may prove problematic for the system. In this case, there are two options; indicate the package(s) to skip in the pacman command line using the --ignore switch (<code>pacman -S --help</code> for details) or permanently indicate the package(s) to skip in the /etc/pacman.conf file in the IgnorePkg array. For more information, please see the [[pacman]] wiki entry.<br />
<br />
Please note that the power user is expected to keep the system up to date with pacman -Syu, rather than selectively upgrading packages. You may diverge from this typical usage as you wish; just be warned that there is a greater chance that things will not work as intended and that it could break your system. The majority of complaints happen when selective upgrading, unusual compilation or improper software installation is performed. Use of '''IgnorePkg''' in /etc/pacman.conf is therefore discouraged, and should only be used sparingly, if you know what you are doing.<br />
<br />
=====The Arch rolling release model=====<br />
Keep in mind that Arch is a '''rolling release''' distribution. This means there is never a reason to reinstall or perform elaborate system rebuilds to upgrade to the newest version. Simply issuing <code>pacman -Syu</code> periodically keeps your entire system up-to-date and on the bleeding edge. At the end of this upgrade, your system is completely current. Remember to '''reboot''' if a kernel upgrade has occurred.<br />
<br />
===Adding a User===<br />
{{Note|Before adding your users, consider hardening your system by switching from md5 password hashes to sha512 password hashes (see: [[SHA password hashes]]).}}<br />
<br />
Linux is a multi-user environment. You should not do your everyday work using the root account: it is more than poor practice, it is dangerous. Use root for administrative tasks only and instead add a normal user account using the <code>adduser</code> program:<br />
<br />
# adduser<br />
<br />
You will be asked to enter some information in an interactive way. In the following example we are creating the user ''archie'':<br />
Login name for new user []: '''archie'''<br />
<br />
User ID ('UID') [ defaults to next available ]:<br />
<br />
Initial group [ users ]:<br />
<br />
Additional groups (comma separated) []: '''audio,lp,optical,storage,video,wheel,games,power,scanner'''<br />
<br />
Home directory [ /home/archie ]:<br />
<br />
Shell [ /bin/bash ]:<br />
<br />
Expiry date (YYYY-MM-DD) []:<br />
<br />
As showed in the example, you are advised to enter values only for the ''Login name'' and the ''Additional groups'', and leave empty all the other fields.<br />
<br />
The list of ''Additional groups'' in the example is a typical choice for a desktop system, hence it is recommended especially for beginners:<br />
*'''audio''' - for tasks involving sound card and related software<br />
*'''lp''' - for managing printing tasks<br />
*'''optical''' - for managing tasks pertaining to the optical drive(s)<br />
*'''storage''' - for managing storage devices<br />
*'''video''' - for video tasks and hardware acceleration<br />
*'''wheel''' - for using sudo<br />
*'''games''' - needed for write permission for games in the games group<br />
*'''power''' - used with power options (e.g. shutdown with power button)<br />
*'''scanner''' - for using a scanner<br />
<br />
Now you will be presented with a preview of your new account, and the ability to cancel or continue operations:<br />
New account will be created as follows:<br />
<br />
---------------------------------------<br />
Login name.......: archie<br />
UID..............: [ Next available ]<br />
Initial group....: users<br />
Additional groups: audio,lp,optical,storage,video,wheel,games,power,scanner<br />
Home directory...: /home/archie<br />
Shell............: /bin/bash<br />
Expiry date......: [ Never ]<br />
<br />
This is it... if you want to bail out, hit Control-C. Otherwise press<br />
ENTER to go ahead and make the account.<br />
<br />
After pressing {{Keypress|ENTER}} the account will be created, and you will be prompted to enter additional, optional informations for the new user:<br />
<br />
Creating new account...<br />
<br />
<br />
Changing the user information for archie<br />
Enter the new value, or press ENTER for the default<br />
Full Name []:<br />
Room Number []:<br />
Work Phone []:<br />
Home Phone []:<br />
Other []:<br />
<br />
Finally, you will be asked to enter the password for your account:<br />
Enter new UNIX password:<br />
Retype new UNIX password:<br />
passwd: password updated successfully<br />
<br />
<br />
Account setup complete.<br />
<br />
Your new non-root user has now been created, complete with a home directory and a login password.<br />
<br />
See [[Users and Groups]] for further information. If you want to change the name of your user or any existing user, consult the [[Change username]] page. You may also check the man pages for <code>usermod(8)</code> and <code>gpasswd(8)</code>.<br />
<br />
====Deleting the user account====<br />
<br />
In the event of error, or if you wish to delete this user account in favor of a different name or for any other reason, use <code>/usr/sbin/userdel</code>:<br />
# userdel -r [username]<br />
The <tt>-r</tt> option will remove the user's home directory and its content, along with the the user's mail spool.<br />
<br />
==Extras==<br />
You should now have a completely functional Arch system which will act as a suitable base for you to build upon based on your needs. However, most people are interested in a desktop system, complete with sound and graphics. This part of the guide will provide a brief overview of the procedure to acquire these extras.<br />
<br />
===Sudo===<br />
Install Sudo:<br />
# pacman -S sudo<br />
To add a user as a sudo user (a &quot;sudoer&quot;), the visudo command must be run as root.<br />
<br />
By default, the visudo command uses the editor [[vi]]. If you do not know how to use vi, you may set the EDITOR environment variable to the editor of your choice, such as in this example with the editor "nano":<br />
# EDITOR=nano visudo<br />
{{Note|Please note that you are setting the variable and starting visudo on the same line at the same time. This will not work properly as two separated commands.}}<br />
<br />
If you are comfortable using vi, issue the visudo command without the EDITOR=nano variable:<br />
# visudo<br />
This will open the file /etc/sudoers in a special session of vi. visudo copies the file to be edited to a temporary file, edits it with an editor, (vi by default), and subsequently runs a sanity check. If it passes, the temporary file overwrites the original with the correct permissions.<br />
<br />
{{Warning|Do not edit /etc/sudoers directly with an editor; Errors in syntax can cause annoyances (like rendering the root account unusable). You must use the ''visudo'' command to edit /etc/sudoers.}}<br />
<br />
In the previous section we added your user to the "wheel" group. To give users in the wheel group full root privileges when they precede a command with &quot;sudo&quot;, uncomment the following line:<br />
%wheel ALL=(ALL) ALL<br />
Now you can give any user access to the sudo command by simply adding them to the wheel group.<br />
<br />
For more information, such as sudoer <TAB> completion, see [[Sudo]].<br />
<br />
===Sound===<br />
If you want sound, proceed to [[Advanced Linux Sound Architecture]] for instructions. Alternatively, proceed to the [[#Graphical User Interface|next section]] first, and set up sound later.<br />
<br />
{{Note|ALSA usually works out-of-the-box, it just needs to be unmuted.}}<br />
<br />
The [[Wikipedia:Advanced Linux Sound Architecture|Advanced Linux Sound Architecture]] (ALSA) is included with the kernel and it is recommended to try it first. However, if it does not work or you are not satisfied with the quality, the [[Wikipedia:Open Sound System|Open Sound System]] is a viable alternative. OSSv4 has been released under a free license and is generally considered a significant improvement over the older OSSv3 which was replaced by ALSA. Instructions can be found in the [[OSS|OSS article]].<br />
<br />
If you have advanced audio requirements, take a look at [[Sound]] for an overview of various articles.<br />
<br />
==='''G'''raphical '''U'''ser '''I'''nterface===<br />
====Install X====<br />
The [[Wikipedia:X Window System|X Window System]] (commonly '''X11''', or '''X''') is a networking and display protocol which provides windowing on bitmap displays. It provides the standard toolkit and protocol to build graphical user interfaces (GUIs).<br />
<br />
{{Note|If you're installing Arch in a Virtualbox guest, you need a different way to complete X installation. See [[Arch_Linux_VirtualBox_Guest|Running Arch Linux as a guest]], then jump to the configuration part below.}}<br />
<br />
Now we will install the base '''[[Xorg]]''' packages using pacman. This is the first step in building a GUI.<br />
<br />
Install the base packages:<br />
{{Cli|# pacman -S xorg-server xorg-xinit xorg-utils xorg-server-utils}}<br />
<br />
Install [[Wikipedia:Mesa 3D (OpenGL)|mesa]] for 3D support:<br />
{{Cli|# pacman -S mesa}}<br />
<br />
The 3D utilities glxgears and [http://dri.freedesktop.org/wiki/glxinfo glxinfo] are included in the '''mesa-demos''' package, install if needed:<br />
{{Cli|# pacman -S mesa-demos}}<br />
<br />
====Install video driver====<br />
Next, you should install a driver for your graphics card.<br />
<br />
You will need knowledge of which video chipset your machine has. If you do not know, use the <code>/usr/sbin/lspci</code> program:<br />
{{Cli|$ lspci}}<br />
<br />
{{Note| The '''vesa''' driver is the most generic, and should work with almost any modern video chipset. If you cannot find a suitable driver for your video chipset, vesa ''should'' work with any video card, but it offers only unaccelerated 2D performance.}}<br />
<br />
For a complete list of all '''open-source''' video drivers, search the package database:<br />
{{Cli|$ pacman -Ss xf86-video | less}}<br />
<br />
{{Note|Proprietary drivers for NVIDIA and ATI are covered in the next sections. If you plan on doing heavy 3D processing such as gaming, consider using these.}}<br />
<br />
Use pacman to install the appropriate video driver for your video card/onboard video. Example for the Savage driver:<br />
{{Cli|# pacman -S xf86-video-savage}}<br />
<br />
{{Tip|For some Intel graphics cards, configuration may be necessary to get proper 2D or 3D performance, see [[Intel]] for more information.}}<br />
<br />
=====NVIDIA Graphics Cards=====<br />
NVIDIA users have three options for drivers (in addition to the vesa driver):<br />
* The open-source nouveau driver, which offers fast 2d acceleration and experimental 3d support which is good enough for basic compositing (note: does not fully support powersaving yet). [http://nouveau.freedesktop.org/wiki/FeatureMatrix Feature Matrix.]<br />
* The open-source (but obfuscated) nv driver, which is very slow and only has 2d support.<br />
* The proprietary nvidia drivers, which offer good 3d performance and powersaving. Even if you plan on using the proprietary drivers, it is recommended to start with nouveau and then switch to the binary driver after you have X set up and working. Nouveau often works out-of-the-box, while nvidia will require configuration and likely some troubleshooting. See [[NVIDIA]] for more information.<br />
<br />
The open-source nouveau driver should be good enough for most users and is recommended:<br />
{{Cli|# pacman -S xf86-video-nouveau}}<br />
<br />
For experimental 3D support:<br />
{{Cli|# pacman -S nouveau-dri}}<br />
<br />
{{Tip|For advanced instructions, see [[Nouveau]].}}<br />
<br />
=====ATI Graphics Cards=====<br />
ATI owners have two options for drivers (in addition to the vesa driver):<br />
* The open source '''radeon''' driver provided by the '''xf86-video-ati''' package. See the [http://wiki.x.org/wiki/RadeonFeature radeon feature matrix] for details.<br />
* The proprietary '''fglrx''' driver provided by the [http://aur.archlinux.org/packages.php?O=0&K=catalyst&do_Search=Go catalyst] package located in the [[AUR]]. It supports only newer devices (HD2xxx and newer). It was once a package offered by Arch in the <code>extra</code> repository, but as of March 2009, official support has been dropped because of dissatisfaction with the quality and speed of development of the proprietary driver. See [[ATI Catalyst]] for more information.<br />
<br />
The open-source driver is the recommended choice. Install the '''radeon''' ATI Driver:<br />
{{Cli|# pacman -S xf86-video-ati}}<br />
<br />
{{Tip|For advanced instructions, see [[ATI]].}}<br />
<br />
====Install input drivers====<br />
Udev should be capable of detecting your hardware without problems and evdev (xf86-input-evdev) is the modern, hotplugging input driver for almost all devices so in most cases, installing input drivers is not needed. At this point, evdev has already been installed as a dependency of Xorg.<br />
<br />
If evdev does not support your device, install the needed driver from the xorg-input-drivers group.<br />
<br />
For a complete list of available input drivers, invoke a pacman search:<br />
{{Cli|# pacman -Ss xf86-input | less}}<br />
{{Note|You only need xf86-input-keyboard or xf86-input-mouse if you plan on disabling hotplugging, otherwise, evdev will act as the input driver.}}<br />
<br />
Laptop users (or users with a touchscreen) will also need the synaptics package to allow X to configure the touchpad/touchscreen:<br />
{{Cli|# pacman -S xf86-input-synaptics}}<br />
<br />
{{Tip|For instructions on fine tuning or troubleshooting touchpad settings, see the [[Touchpad Synaptics]] article.}}<br />
<br />
====Configure X (Optional)====<br />
{{Warning|Proprietary drivers usually require a reboot after installation along with configuration. See [[NVIDIA]] or [[ATI Catalyst]] for details.}}<br />
<br />
X Server features auto-configuration and therefore can function without an xorg.conf. If you still wish to manually configure X Server, please see the [[Xorg]] wiki page.<br />
<br />
=====Non-US keyboard=====<br />
If you do not use a standard US keyboard, you need to set the keyboard layout in {{Filename|/etc/X11/xorg.conf.d/10-evdev.conf}}:<br />
<br />
Section "InputClass"<br />
Identifier "evdev keyboard catchall"<br />
MatchIsKeyboard "on"<br />
MatchDevicePath "/dev/input/event*"<br />
Driver "evdev"<br />
'''Option "XkbLayout" "be"'''<br />
EndSection<br />
<br />
If, for example, you wish to use a variant of the US keyboard, add the following into the same section from the previous example:<br />
Option "XkbLayout" "us"<br />
Option "XkbVariant" "dvorak"<br />
<br />
{{Note|The '''XkbLayout''' key may differ from the keymap code you used with the km or loadkeys command. . A list of many keyboard layouts and variants can be found in {{Filename|/usr/share/X11/xkb/rules/base.lst}} (see text after line beginning with <tt><nowiki>! layout</nowiki></tt>). For instance the layout: '''gb''' corresponds to "English (UK)".<br />
<br />
}}<br />
<br />
====Testing X====<br />
This section will explain how to start a very basic graphical environment in order to test '''X'''. This uses the simple default '''X''' window manager, twm.<br />
<br />
Install the default test environment:<br />
<br />
{{Cli|# pacman -S xorg-twm xorg-xclock xterm}}<br />
<br />
The default X environment is rather bare. [[#Choose and install a graphical interface|This section below]] will deal with installing a desktop environment or window manager of your choice to supplement X.<br />
<br />
If you installed Xorg before creating your regular user, there will be an empty .xinitrc file in your $HOME that you need to either delete or edit in order to start a graphical environment. Simply deleting it will cause '''X''' to run with the default environment (twm, xclock, xterm).<br />
<br />
{{Cli|$ rm ~/.xinitrc}}<br />
<br />
=====Message bus=====<br />
{{Note|[[dbus]] is likely required for many of your applications to work properly, if you know you do not need it, skip this section.}}<br />
<br />
Install [[dbus]]:<br />
{{Cli|# pacman -S dbus}}<br />
<br />
{{Daemon|dbus}}<br />
<br />
=====Start X=====<br />
{{Note|The Ctrl-Alt-Backspace shortcut traditionally used to kill X has been deprecated and will not work to exit out of this test. You can enable Ctrl-Alt-Backspace by editing xorg.conf, as described [[Xorg#Ctrl-Alt-Backspace doesn't work|here]].}}<br />
<br />
Finally, start Xorg:<br />
{{Cli|$ startx}}<br />
or<br />
{{Cli|$ xinit -- /usr/bin/X -nolisten tcp}}<br />
<br />
A few movable windows should show up, and your mouse should work. Once you are satisfied that '''X''' installation was a success, you may exit out of '''X''' by issuing the <tt>exit</tt> command into the prompts until you return to the console.<br />
<br />
If the screen goes black, you may still attempt to switch to a different virtual console (CTRL-Alt-F2, for example), and login blindly as root, followed by <Enter>, followed by root's password followed by <Enter>.<br />
<br />
You can attempt to kill the '''X''' server with <code>/usr/bin/pkill</code> (note the capital letter '''X'''):<br />
{{Cli|# pkill X}}<br />
<br />
If pkill does not work, reboot blindly with:<br />
{{Cli|# reboot}}<br />
<br />
=====In case of errors=====<br />
If a problem occurs, look for errors in {{Filename|/var/log/Xorg.0.log}}. Be on the lookout for any lines beginning with {{Codeline|(EE)}} which represent errors, and also {{Codeline|(WW)}} which are warnings that could indicate other issues.<br />
$ grep EE /var/log/Xorg.0.log<br />
<br />
Errors may also be searched for in the console output of the virtual console from which '''X''' was started.<br />
<br />
See the [[Xorg]] article for detailed instructions and troubleshooting.<br />
<br />
=====Need Help?=====<br />
If you are still having trouble after consulting the [[Xorg]] article and need assistance via the Arch forums, be sure to install and use wgetpaste:<br />
<br />
{{Cli|# pacman -S wgetpaste}}<br />
Use wgetpaste and provide links for the following files when asking for help in your forum post:<br />
* ~/.xinitrc<br />
* /etc/X11/xorg.conf<br />
* /var/log/Xorg.0.log<br />
* /var/log/Xorg.0.log.old<br />
Use wgetpaste like so:<br />
{{Cli|$ wgetpaste </path/to/file>}}<br />
Post the corresponding links given within your forum post. Be sure to provide appropriate hardware and driver information as well.<br />
{{Note|It is very important to provide detail when troubleshooting X. Please provide all pertinent information as detailed above when asking for assistance on the Arch forums.}}<br />
<br />
====Install Fonts====<br />
At this point, you may wish to save time by installing visually pleasing, true type fonts, before installing a desktop environment/window manager. DejaVu is a set of high quality, general-purpose fonts.<br />
<br />
Install with:<br />
{{Cli|# pacman -S ttf-dejavu}}<br />
<br />
Refer to [[Font Configuration]] for how to configure font rendering and [[Fonts]] for font suggestions and installation instructions.<br />
<br />
====Choose and install a graphical interface====<br />
The X Window System provides the basic framework for building a graphical user interface (GUI).<br />
<br />
{{Note|Choosing your DE or WM is a very subjective and personal decision. Choose the best environment for ''your'' needs.}}<br />
<br />
;Window Manager (WM) : Controls the placement and appearance of application windows in conjunction with the X Window System. '''See [[Window Manager#Window managers|Window managers]] for more information.'''<br />
<br />
;Desktop Environment (DE): Works atop and in conjunction with X, to provide a completely functional and dynamic GUI. A DE typically provides a window manager, icons, applets, windows, toolbars, folders, wallpapers, a suite of applications and abilities like drag and drop.''' See [[Desktop Environment#Desktop environments|Desktop environments]] for more information.'''<br />
<br />
{{Note|You can build your own DE by using a WM and the applications of your choice.}}<br />
<br />
After installing a graphical interface, you may wish to continue with [[General Recommendations]] for post-installation instructions.<br />
<br />
====Methods for starting your Graphical Environment====<br />
=====Manually=====<br />
You might prefer to start X manually from your terminal rather than booting straight into the desktop. For DE-specific commands, please see the wiki page corrosponding to your DE for more information. For more generic '''X''' commands, please see the [[Xorg#Methods for starting your Graphical Environment|section on the Xorg page]].<br />
<br />
=====Automatically=====<br />
You might prefer to have the desktop start automatically during boot instead of starting X manually. See [[Display Manager]] for instructions on using a login manager or [[Start X at Boot]] for two lightweight methods that do not rely on a display manager.<br />
<br />
===General Troubleshooting===<br />
If you install applications without documentation, and wonder for example, which startup files the app reads, e.g. .Xresources, .myapprc, etc., then a quick {{Cli|$ strace -eopen myapp}} can give you lots more insight into where to look.<noinclude><br />
<br />
{{Beginners' Guide navigation}}<br />
</noinclude></div>Zendeavorhttps://wiki.archlinux.org/index.php?title=Dzen&diff=149506Dzen2011-07-20T07:15:41Z<p>Zendeavor: /* Dzen & Conky */</p>
<hr />
<div>[[Category:Utilities (English)]]<br />
[[Category:Eye candy (English)]]<br />
{{Stub}}<br />
{{i18n_links_start}}<br />
{{i18n_entry|English|Dzen}}<br />
{{i18n_links_end}}<br />
<br />
=Introduction=<br />
From the [http://gotmor.googlepages.com/dzen dzen] website:<br />
<br />
''"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 />
See also the Arch Linux [https://bbs.archlinux.org/viewtopic.php?id=40637 forum thread].<br />
<br />
=Installation=<br />
dzen is available from the community repository:<br />
# pacman -S dzen2<br />
<br />
And also in the [[AUR|AUR]], you can find [http://aur.archlinux.org/packages.php?ID=31899 dzen2-xft-xpm-xinerama-svn 267-2]. <br><br />
This version has all the bells & whistles enabled in the PKGBUILD. <br />
With Xft and XPM support you can use nice fonts and xpm images in your bar.<br />
<br />
=Tips & Tricks=<br />
<br />
== Using custom fonts with Dzen ==<br />
<br />
If you wish to use custom fonts with dzen2 (like the popular Terminus font), you need to add the path to your local fonts folder in xorg.conf.<br />
<br />
Section "Files"<br />
...<br />
FontPath "/usr/share/fonts/local"<br />
...<br />
EndSection<br />
<br />
If you do not have permission or do not want to change xorg.conf, you may add this to ~/.xinitrc:<br />
<br />
xset +fp /usr/share/fonts/local<br />
xset fp rehash<br />
<br />
== Dzen & Conky ==<br />
[[Conky]] can be used to pipe information directly to dzen for output in a statusbar. <br />
This can be done with Conky in the Extra repository and also with [http://aur.archlinux.org/packages.php?do_Details=1&ID=11884&O=0&L=0&C=0&K=conky-cli&SB=n&SO=a&PP=25&do_MyPackages=0&do_Orphans=0&SeB=nd conky-cli], a stripped-down version of the Conky status utility from [[AUR | AUR]] . <br><br />
The following example displays the the loadavg values in red and the current time in the default dzen foreground colour:<br />
<br />
'''~/.conkyrc:'''<br />
background no<br />
out_to_console yes<br />
out_to_x no<br />
update_interval 1.0<br />
total_run_times 0<br />
use_spacer none<br />
<br />
TEXT<br />
^fg(\#ff0000)${loadavg 1 2 3} ^fg()${time %a %b %d %I:%M%P}<br />
<br />
<br />
'''~/bin/dzconky:'''<br />
<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 />
<br />
Simply execute ''dzconky'' in your startup scripts.<br />
<br />
== Enabling Xft support for dzen ==<br />
<br />
{{Note|You need to install '''libxft''' package.}}<br />
As of revision 241 (development), dzen2 has optional support for Xft. To enable Xft, you should build dzen2 with these options: ('''edit''' {{filename|config.mk}})<br />
<br />
## Option: With Xinerama and XPM and XFT<br />
LIBS = -L/usr/lib -lc -L${X11LIB} -lX11 -lXinerama -lXpm `pkg-config --libs xft`<br />
CFLAGS = -Wall -Os ${INCS} -DVERSION=\"${VERSION}\" -DDZEN_XINERAMA -DDZEN_XPM -DDZEN_XFT `pkg-config --cflags xft`<br />
<br />
To check libxft support, you can use this command:<br />
<br />
echo "hello world" | dzen2 -fn 'Times New Roman' -p</div>Zendeavorhttps://wiki.archlinux.org/index.php?title=Tint2&diff=149154Tint22011-07-16T20:00:46Z<p>Zendeavor: /* Applications Menu in OpenBox3 */</p>
<hr />
<div>[[Category:Eye candy (English)]] <br />
[http://code.google.com/p/tint2/ tint2] is a system panel for linux. It is described by its developers as "simple panel/taskbar unobtrusive and light". It can be configured to include (or not include) among other things a system tray, a task list a battery monitor and a clock. Its look can also be configured a great deal, and it does not have many dependencies. This makes it ideal for window manager users who want a panel but don't have one by default, like [[Openbox]] users.<br />
<br />
==Installation==<br />
tint2 is in the community repository. Use [[pacman]] to install it:<br />
# pacman -S tint2<br />
<br />
==Configuration==<br />
tint2 has a configuration file in {{filename|~/.config/tint2/tint2rc}}. A skeleton configuration file with the default settings is created on the first time tint2 is ran. You can then change this file to your liking. Full documentation on how to configure tint2 is found [http://code.google.com/p/tint2/wiki/Configure here]. You can configure the fonts, colors, looks, location and more in this file. The tint2 package now contains a GUI configuration tool that can be accessed by typing the command: <br />
<pre><br />
$ tint2conf<br />
</pre><br />
<br />
Alternatively, you can edit your tint2rc configuration file graphically with [http://aur.archlinux.org/packages.php?ID=29696 tintwizard] from the [[AUR]]. The alternate and now outdated development branch [http://aur.archlinux.org/packages.php?ID=29766 tintwizard-svn] can also be used, but is the same as the tint2conf command.<br />
<br />
===Applications Menu in OpenBox3===<br />
If running the -svn branch of tint2 from AUR, you have the ability to create launchers. Unfortunately, tint2 doesn't support nested menus yet, so there is no native function to enable an applications menu. With a little ingenuity, one can trick tint2 and get an applications menu anyway! This example will create such a launcher for OpenBox3.<br />
<br />
First, you require OpenBox3, tint2-svn, and xdotool. We will assume you already have acquired these packages and installed them. If not, then {{Codeline|pacman -S openbox xdotool}} and [http://aur.archlinux.org/packages.php?ID=20733 tint2-svn]. Next you want to create a keybinding for opening the OpenBox menu.<br />
<pre><br />
<keyboard><br />
<!-- Keybinding for opening OpenBox menu --!><br />
<keybind key="C-A-space"><br />
<action name="ShowMenu"><menu>root-menu</menu><br />
</keybind><br />
...<br />
</keyboard><br />
</pre><br />
<br />
This will set Control-Alt-Spacebar to open the root-menu(this is the menu that opens when you right-click the desktop). You can change root-menu to any menu-id that you have defined in menu.xml. Next we need to make that keybinding into a .desktop file with xdotool. First test that your keybind works with <br />
{{Codeline|xdotool key ctrl+alt+space}}. If the menu you chose pops up under your mouse cursor, you've done it right! Now create a tint2.desktop file inside /usr/share/applications/ directory. Be sure to add the line {{Codeline|Exec&#61;xdotool key ctrl+alt+space}} where [ctrl+alt+space] are your chosen key combinations. Open your new tint2.desktop file from your file manager and, once again, you should see the menu appear under your cursor. Now just add this to tint2 as a launcher, and you have your OpenBox Applications Menu as a launcher for tint2!<br />
<br />
See [http://openbox.org/wiki/Help:Menus Openbox Menus] for further help on creating your own menu to use here, and menumaker to generate a nice full menu.xml for most (possibly all) of your installed programs.<br />
<br />
==Running tint2==<br />
You can run tint2 by simply typing the command:<br />
$ tint2<br />
<br />
If you want to run it when starting [[X]], simply add this to ~/.xinitrc. For example if you run tint2 with [[openbox]]:<br />
#!/bin/sh<br />
#<br />
# ~/.xinitrc<br />
#<br />
# Executed by startx (run your window manager from here)<br />
'''tint2 &'''<br />
exec ck-launch-session openbox-session<br />
<br />
If you want to run tint2 when starting [[Openbox]], you will need to update ~/.config/openbox/autostart.sh by adding the following:<br />
tint2 &<br />
<br />
Note: if you do not have an autostart.sh file in ~/.config/openbox, you can copy the default one from /etc/xdg/autostart.sh.<br />
<br />
Refer to [http://openbox.org/wiki/Help:Autostart Openbox help] for more information on autostart.sh options for Openbox.<br />
<br />
==Enabling transparency==<br />
<br />
To make tint2 look its best, some form of compositing is required. If your tint2 has a large black rectangular box behind it you are either using a window manager without native compositing (like Openbox) or it isn't enabled.<br />
<br />
To enable compositing under Openbox you can install [[Xcompmgr]]:<br />
<br />
# pacman -S xcompmgr<br />
<br />
Xcompmgr can be started like this:<br />
<br />
$ xcompmgr<br />
<br />
You will have to kill and restart tint2 to enable transparency.<br />
<br />
If Xcompmgr is used solely to provide tint2 with transparency effects it can be run at boot by changing the autostart section in ~/.config/openbox/autostart.sh to this:<br />
<br />
# Launch Xcomppmgr and tint2 with openbox<br />
if which tint2 >/dev/null 2>&1; then<br />
(sleep 2 && xcompmgr) &<br />
(sleep 2 && tint2) &<br />
fi<br />
<br />
Various other (better) ways to make Xcompmgr run at startup are discussed in the [[Openbox]] article.</div>Zendeavorhttps://wiki.archlinux.org/index.php?title=Tint2&diff=149123Tint22011-07-16T13:15:59Z<p>Zendeavor: </p>
<hr />
<div>[[Category:Eye candy (English)]] <br />
[http://code.google.com/p/tint2/ tint2] is a system panel for linux. It is described by its developers as "simple panel/taskbar unobtrusive and light". It can be configured to include (or not include) among other things a system tray, a task list a battery monitor and a clock. Its look can also be configured a great deal, and it does not have many dependencies. This makes it ideal for window manager users who want a panel but don't have one by default, like [[Openbox]] users.<br />
<br />
==Installation==<br />
tint2 is in the community repository. Use [[pacman]] to install it:<br />
# pacman -S tint2<br />
<br />
==Configuration==<br />
tint2 has a configuration file in {{filename|~/.config/tint2/tint2rc}}. A skeleton configuration file with the default settings is created on the first time tint2 is ran. You can then change this file to your liking. Full documentation on how to configure tint2 is found [http://code.google.com/p/tint2/wiki/Configure here]. You can configure the fonts, colors, looks, location and more in this file. The tint2 package now contains a GUI configuration tool that can be accessed by typing the command: <br />
<pre><br />
$ tint2conf<br />
</pre><br />
<br />
Alternatively, you can edit your tint2rc configuration file graphically with [http://aur.archlinux.org/packages.php?ID=29696 tintwizard] from the [[AUR]]. The alternate and now outdated development branch [http://aur.archlinux.org/packages.php?ID=29766 tintwizard-svn] can also be used, but is the same as the tint2conf command.<br />
<br />
===Applications Menu in OpenBox3===<br />
If running the -svn branch of tint2 from AUR, you have the ability to create launchers. Unfortunately, tint2 doesn't support nested menus yet, so there is no native function to enable an applications menu. With a little ingenuity, one can trick tint2 and get an applications menu anyway! This example will create such a launcher for OpenBox3.<br />
<br />
First, you require OpenBox3, tint2-svn, and xdotool. We will assume you already have acquired these packages and installed them. If not, then {{Codeline|pacman -S openbox xdotool}} and [http://aur.archlinux.org/packages.php?ID=20733 tint2]. Next you want to create a keybinding for opening the OpenBox menu.<br />
<pre><br />
<keyboard><br />
<!-- Keybinding for opening OpenBox menu --!><br />
<keybind key="C-A-space"><br />
<action name="ShowMenu"><menu>root-menu</menu><br />
</keybind><br />
...<br />
</keyboard><br />
</pre><br />
<br />
This will set Control-Alt-Spacebar to open the root-menu(this is the menu that opens when you right-click the desktop). You can change root-menu to any menu-id that you have defined in menu.xml. Next we need to make that keybinding into a .desktop file with xdotool. First test that your keybind works with <br />
{{Codeline|xdotool key ctrl+alt+space}}. If the menu you chose pops up under your mouse cursor, you've done it right! Now create a tint2.desktop file inside /usr/share/applications/ directory. Be sure to add the line {{Codeline|Exec&#61;xdotool key ctrl+alt+space}} where [ctrl+alt+space] are your chosen key combinations. Open your new tint2.desktop file from your file manager and, once again, you should see the menu appear under your cursor. Now just add this to tint2 as a launcher, and you have your OpenBox Applications Menu as a launcher for tint2!<br />
<br />
See [http://openbox.org/wiki/Help:Menus Openbox Menus] for further help on creating your own menu to use here, and menumaker to generate a nice full menu.xml for most (possibly all) of your installed programs.<br />
<br />
==Running tint2==<br />
You can run tint2 by simply typing the command:<br />
$ tint2<br />
<br />
If you want to run it when starting [[X]], simply add this to ~/.xinitrc. For example if you run tint2 with [[openbox]]:<br />
#!/bin/sh<br />
#<br />
# ~/.xinitrc<br />
#<br />
# Executed by startx (run your window manager from here)<br />
'''tint2 &'''<br />
exec ck-launch-session openbox-session<br />
<br />
If you want to run tint2 when starting [[Openbox]], you will need to update ~/.config/openbox/autostart.sh by adding the following:<br />
tint2 &<br />
<br />
Note: if you do not have an autostart.sh file in ~/.config/openbox, you can copy the default one from /etc/xdg/autostart.sh.<br />
<br />
Refer to [http://openbox.org/wiki/Help:Autostart Openbox help] for more information on autostart.sh options for Openbox.<br />
<br />
==Enabling transparency==<br />
<br />
To make tint2 look its best, some form of compositing is required. If your tint2 has a large black rectangular box behind it you are either using a window manager without native compositing (like Openbox) or it isn't enabled.<br />
<br />
To enable compositing under Openbox you can install [[Xcompmgr]]:<br />
<br />
# pacman -S xcompmgr<br />
<br />
Xcompmgr can be started like this:<br />
<br />
$ xcompmgr<br />
<br />
You will have to kill and restart tint2 to enable transparency.<br />
<br />
If Xcompmgr is used solely to provide tint2 with transparency effects it can be run at boot by changing the autostart section in ~/.config/openbox/autostart.sh to this:<br />
<br />
# Launch Xcomppmgr and tint2 with openbox<br />
if which tint2 >/dev/null 2>&1; then<br />
(sleep 2 && xcompmgr) &<br />
(sleep 2 && tint2) &<br />
fi<br />
<br />
Various other (better) ways to make Xcompmgr run at startup are discussed in the [[Openbox]] article.</div>Zendeavorhttps://wiki.archlinux.org/index.php?title=Tint2&diff=149122Tint22011-07-16T13:02:16Z<p>Zendeavor: /* Applications Menu */</p>
<hr />
<div>[[Category:Eye candy (English)]] <br />
[http://code.google.com/p/tint2/ tint2] is a system panel for linux. It is described by its developers as "simple panel/taskbar unobtrusive and light". It can be configured to include (or not include) among other things a system tray, a task list a battery monitor and a clock. Its look can also be configured a great deal, and it does not have many dependencies. This makes it ideal for window manager users who want a panel but don't have one by default, like [[Openbox]] users.<br />
<br />
==Installation==<br />
tint2 is in the community repository. Use [[pacman]] to install it:<br />
# pacman -S tint2<br />
<br />
==Configuration==<br />
tint2 has a configuration file in {{filename|~/.config/tint2/tint2rc}}. A skeleton configuration file with the default settings is created on the first time tint2 is ran. You can then change this file to your liking. Full documentation on how to configure tint2 is found [http://code.google.com/p/tint2/wiki/Configure here]. You can configure the fonts, colors, looks, location and more in this file. The tint2 package now contains a GUI configuration tool that can be accessed by typing the command: <br />
<pre><br />
$ tint2conf<br />
</pre><br />
<br />
Alternatively, you can edit your tint2rc configuration file graphically with [http://aur.archlinux.org/packages.php?ID=29696 tintwizard] from the [[AUR]]. The alternate and now outdated development branch [http://aur.archlinux.org/packages.php?ID=29766 tintwizard-svn] can also be used, but is the same as the tint2conf command.<br />
<br />
===Applications Menu in OpenBox3===<br />
If running the -svn branch of tint2 from AUR, you have the ability to create launchers. Unfortunately, tint2 doesn't support nested menus yet, so there is no native function to enable an applications menu. With a little ingenuity, one can trick tint2 and get an applications menu anyway! This example will create such a launcher for OpenBox3.<br />
<br />
First, you require OpenBox3, tint2-svn, and xdotool. We will assume you already have acquired these packages and installed them. If not, then {{Codeline|pacman -S openbox xdotool}} and [http://aur.archlinux.org/packages.php?ID=20733 tint2]. Next you want to create a keybinding for opening the OpenBox menu.<br />
<pre><br />
<keyboard><br />
<!-- Keybinding for opening OpenBox menu --!><br />
<keybind key="C-A-space"><br />
<action name="ShowMenu"><menu>root-menu</menu><br />
</keybind><br />
...<br />
</keyboard><br />
</pre><br />
<br />
This will set Control-Alt-Spacebar to open the root-menu(this is the menu that opens when you right-click the desktop). You can change root-menu to any menu-id that you have defined in menu.xml. Next we need to make that keybinding into a .desktop file with xdotool. First test that your keybind works with {{Codeline|xdotool key ctrl+alt+space}}. If the menu you chose pops up under your mouse cursor, you've done it right! Now create a tint2.desktop file inside /usr/share/applications/ directory. Be sure to add the line {{Codeline|Exec=xdotool key ctrl+alt+space]] where [ctrl+alt+space] are your chosen key combinations. Open your new tint2.desktop file from your file manager and, once again, you should see the menu appear under your cursor. Now just add this to tint2 as a launcher, and you have your OpenBox Applications Menu as a launcher for tint2!<br />
<br />
See http://openbox.org/wiki/Help:Menus for further help on creating your own menu to use here, and menumaker to generate a nice full menu.xml for most (possibly all) of your installed programs.<br />
<br />
==Running tint2==<br />
You can run tint2 by simply typing the command:<br />
$ tint2<br />
<br />
If you want to run it when starting [[X]], simply add this to ~/.xinitrc. For example if you run tint2 with [[openbox]]:<br />
#!/bin/sh<br />
#<br />
# ~/.xinitrc<br />
#<br />
# Executed by startx (run your window manager from here)<br />
'''tint2 &'''<br />
exec ck-launch-session openbox-session<br />
<br />
If you want to run tint2 when starting [[Openbox]], you will need to update ~/.config/openbox/autostart.sh by adding the following:<br />
tint2 &<br />
<br />
Note: if you do not have an autostart.sh file in ~/.config/openbox, you can copy the default one from /etc/xdg/autostart.sh.<br />
<br />
Refer to [http://openbox.org/wiki/Help:Autostart Openbox help] for more information on autostart.sh options for Openbox.<br />
<br />
==Enabling transparency==<br />
<br />
To make tint2 look its best, some form of compositing is required. If your tint2 has a large black rectangular box behind it you are either using a window manager without native compositing (like Openbox) or it isn't enabled.<br />
<br />
To enable compositing under Openbox you can install [[Xcompmgr]]:<br />
<br />
# pacman -S xcompmgr<br />
<br />
Xcompmgr can be started like this:<br />
<br />
$ xcompmgr<br />
<br />
You will have to kill and restart tint2 to enable transparency.<br />
<br />
If Xcompmgr is used solely to provide tint2 with transparency effects it can be run at boot by changing the autostart section in ~/.config/openbox/autostart.sh to this:<br />
<br />
# Launch Xcomppmgr and tint2 with openbox<br />
if which tint2 >/dev/null 2>&1; then<br />
(sleep 2 && xcompmgr) &<br />
(sleep 2 && tint2) &<br />
fi<br />
<br />
Various other (better) ways to make Xcompmgr run at startup are discussed in the [[Openbox]] article.</div>Zendeavorhttps://wiki.archlinux.org/index.php?title=Tint2&diff=149117Tint22011-07-16T12:23:36Z<p>Zendeavor: </p>
<hr />
<div>[[Category:Eye candy (English)]] <br />
[http://code.google.com/p/tint2/ tint2] is a system panel for linux. It is described by its developers as "simple panel/taskbar unobtrusive and light". It can be configured to include (or not include) among other things a system tray, a task list a battery monitor and a clock. Its look can also be configured a great deal, and it does not have many dependencies. This makes it ideal for window manager users who want a panel but don't have one by default, like [[Openbox]] users.<br />
<br />
==Installation==<br />
tint2 is in the community repository. Use [[pacman]] to install it:<br />
# pacman -S tint2<br />
<br />
==Configuration==<br />
tint2 has a configuration file in {{filename|~/.config/tint2/tint2rc}}. A skeleton configuration file with the default settings is created on the first time tint2 is ran. You can then change this file to your liking. Full documentation on how to configure tint2 is found [http://code.google.com/p/tint2/wiki/Configure here]. You can configure the fonts, colors, looks, location and more in this file. The tint2 package now contains a GUI configuration tool that can be accessed by typing the command: <br />
<pre><br />
$ tint2conf<br />
</pre><br />
<br />
Alternatively, you can edit your tint2rc configuration file graphically with [http://aur.archlinux.org/packages.php?ID=29696 tintwizard] from the [[AUR]]. The alternate and now outdated development branch [http://aur.archlinux.org/packages.php?ID=29766 tintwizard-svn] can also be used, but is the same as the tint2conf command.<br />
<br />
===Applications Menu===<br />
If running the -svn branch of tint2 from AUR, you have the ability to create launchers. Unfortunately, tint2 doesn't support nested menus yet, so there is no native function to enable an applications menu. With a little ingenuity, one can trick tint2 and get an applications menu anyway! This example will create such a launcher for OpenBox3.<br />
<br />
First, you require OpenBox3, tint2-svn, and xdotool. We will assume you already have acquired these packages and installed them. If not, then {{Codeline|pacman -S openbox xdotool}} and [http://aur.archlinux.org/packages.php?ID=20733 tint2]. Next you want to create a keybinding for opening the OpenBox menu.<br />
<pre><br />
<keyboard><br />
<!-- Keybinding for opening OpenBox menu --!><br />
<keybind key="C-A-space"><br />
<action name="ShowMenu"><menu>root-menu</menu><br />
</keybind><br />
...<br />
</keyboard><br />
</pre><br />
<br />
This will set Control-Alt-Spacebar to open the root-menu(this is the menu that opens when you right-click the desktop). You can change root-menu to any menu-id that you have defined in menu.xml. Next we need to make that keybinding into a .desktop file with xdotool. First test that your keybind works with {{Codeline|xdotool key ctrl+alt+space}}. If the menu you chose pops up under your mouse cursor, you've done it right! Now create a tint2.desktop file inside /usr/share/applications/ directory. Be sure to add the line {{Codeline|Exec=xdotool key ctrl+alt+space]] where [ctrl+alt+space] are your chosen key combinations. Open your new tint2.desktop file from your file manager and, once again, you should see the menu appear under your cursor. Now just add this to tint2 as a launcher, and you have your OpenBox Applications Menu as a launcher for tint2!<br />
==Running tint2==<br />
You can run tint2 by simply typing the command:<br />
$ tint2<br />
<br />
If you want to run it when starting [[X]], simply add this to ~/.xinitrc. For example if you run tint2 with [[openbox]]:<br />
#!/bin/sh<br />
#<br />
# ~/.xinitrc<br />
#<br />
# Executed by startx (run your window manager from here)<br />
'''tint2 &'''<br />
exec ck-launch-session openbox-session<br />
<br />
If you want to run tint2 when starting [[Openbox]], you will need to update ~/.config/openbox/autostart.sh by adding the following:<br />
tint2 &<br />
<br />
Note: if you do not have an autostart.sh file in ~/.config/openbox, you can copy the default one from /etc/xdg/autostart.sh.<br />
<br />
Refer to [http://openbox.org/wiki/Help:Autostart Openbox help] for more information on autostart.sh options for Openbox.<br />
<br />
==Enabling transparency==<br />
<br />
To make tint2 look its best, some form of compositing is required. If your tint2 has a large black rectangular box behind it you are either using a window manager without native compositing (like Openbox) or it isn't enabled.<br />
<br />
To enable compositing under Openbox you can install [[Xcompmgr]]:<br />
<br />
# pacman -S xcompmgr<br />
<br />
Xcompmgr can be started like this:<br />
<br />
$ xcompmgr<br />
<br />
You will have to kill and restart tint2 to enable transparency.<br />
<br />
If Xcompmgr is used solely to provide tint2 with transparency effects it can be run at boot by changing the autostart section in ~/.config/openbox/autostart.sh to this:<br />
<br />
# Launch Xcomppmgr and tint2 with openbox<br />
if which tint2 >/dev/null 2>&1; then<br />
(sleep 2 && xcompmgr) &<br />
(sleep 2 && tint2) &<br />
fi<br />
<br />
Various other (better) ways to make Xcompmgr run at startup are discussed in the [[Openbox]] article.</div>Zendeavorhttps://wiki.archlinux.org/index.php?title=Conky&diff=148921Conky2011-07-13T07:31:28Z<p>Zendeavor: /* Universal method to enable true transparency */</p>
<hr />
<div>[[Category:Utilities (English)]]<br />
[[Category:Eye candy (English)]]<br />
{{i18n|Conky}}<br />
<br />
Conky is a system monitor software for the X Window System. It is available for GNU/Linux and FreeBSD. It is free software released under the terms of the GPL license. Conky is able to monitor many system variables including CPU, memory, swap, disk space, temperature, top, upload, download, system messages, and much more. It is extremely configurable, however, the configuration can be a little hard to understand. Conky is a fork of torsmo.<br />
<br />
==Installation and configuration==<br />
*Conky is available in the Extra repository<br />
# pacman -S conky<br />
*Edit config file using an example configuration file from [http://conky.sourceforge.net/screenshots.html homeproject-screenshot]<br />
$ nano ~/.conkyrc<br />
*Alternatively, you can use the default config at {{Filename|/etc/conky/conky.conf}}:<br />
$ cp /etc/conky/conky.conf ~/.conkyrc<br />
<br />
==AUR packages==<br />
<br />
In addition to the basic conky package in the repos, there are various [[AUR]] packages available with extra compile options enabled.<br />
<br />
*Install [http://aur.archlinux.org/packages.php?ID=11884 conky-cli] for conky sans X11 dependencies<br />
*Install [http://aur.archlinux.org/packages.php?ID=19156 conky-nvidia] for nvidia support.<br />
*Install [http://aur.archlinux.org/packages.php?ID=31589 conky-lua] for lua support.<br />
*Install [http://aur.archlinux.org/packages.php?ID=36405 conky-lua-nv] for both lua and nvidia support.<br />
<br />
==Tips and tricks==<br />
===Enable real transparency (KDE4)===<br />
Since version 1.8.0 conky suppports real transparency. To enable it (and make it work nicely with KDE4), add these lines to {{Filename|~/.conkyrc}}:<br />
own_window yes<br />
own_window_transparent yes<br />
own_window_argb_visual yes<br />
own_window_type normal<br />
own_window_class conky-semi<br />
own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager<br />
This replaces the feh method described below.<br />
<br />
===Prevent flickering===<br />
Conky needs Double Buffer Extension (DBE) support from X server to prevent flickering, because it can't update window fast enough without it. It can be enabled in {{Filename|/etc/X11/xorg.conf}} with {{Codeline|Load "dbe"}} line in {{Codeline|Section "Module"}}. The xorg.conf file has been replaced (1.8.x patch upwards) by {{Filename|/etc/X11/xorg.conf.d}} which contains the particular configuration files. ''DBE'' is loaded automatically. <br />
<br />
To verify: <br />
# grep dbe /var/log/Xorg.0.log<br />
<br />
Output (should be similar):<br />
# [ 86.101] (II) LoadModule: "dbe"<br />
# [ 86.101] (II) Loading /usr/lib/xorg/modules/extensions/libdbe.so<br />
# [ 86.111] (II) Module dbe: vendor="X.Org Foundation"<br />
<br />
To enable double-buffer check to have in {{Filename|~/.conkyrc}}:<br />
# Place below the other options, not below TEXT or XY<br />
double_buffer yes<br />
<br />
===Don't minimize on Show Desktop (Compiz)===<br />
If the 'Show Desktop' button or keybinding minimizes conky along with all other windows, fire up compiz config settings manager, go to General Options and uncheck the "Hide Skip Taskbar Windows" option.<br />
<br />
===Integrate with KDesktop===<br />
Conky with screenshot configuration generate problems with icons visualization. So there are some steps to follow.<br />
*Add these lines to {{Filename|~/.conkyrc}}:<br />
own_window yes<br />
own_window_type normal<br />
own_window_transparent yes<br />
own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager<br />
*if this setting is on, comment it out or delete the line<br />
minimum_size<br />
*To autostart conky create this link<br />
$ ln -s /usr/bin/conky ~/.kde/share/autostart/conkylink<br />
For KDE4 users<br />
$ ln -s /usr/bin/conky ~/.kde4/Autostart/conkylink<br />
*Install feh<br />
# pacman -S feh<br />
*Make a script to allow transparency with the desktop<br />
For KDE3 users<br />
$ nano -w ~/.kde/share/autostart/fehconky <br />
<br />
#!/bin/bash<br />
feh --bg-scale `dcop kdesktop KBackgroundIface currentWallpaper 1`<br />
For KDE4 users<br />
$ nano -w ~/.kde4/Autostart/fehconky<br />
<br />
#!/bin/bash<br />
feh --bg-scale "`grep 'wallpaper=' ~/.kde4/share/config/plasma-desktop-appletsrc | tail --lines=1 | sed 's/wallpaper=//'`"<br />
use {{Codeline|--bg-center}} if you use a centered wallpaper.<br />
*Make it executable<br />
$ chmod +x ~/.kde/share/autostart/fehconky<br />
KDE4<br />
$ chmod +x ~/.kde4/Autostart/fehconky<br />
*Optionally instead using a script you can add the corresponding line to the bottom of {{Filename|.conkyrc}}<br />
$ nano ~/.conkyrc<br />
For KDE3<br />
${exec feh --bg-scale `dcop kdesktop KBackgroundIface currentWallpaper 1`}<br />
For KDE4<br />
${exec feh --bg-scale "`grep 'wallpaper=' ~/.kde4/share/config/plasma-desktop-appletsrc | tail --lines=1 | sed 's/wallpaper=//'`"}<br />
<br />
===Display package update information===<br />
*[https://bbs.archlinux.org/viewtopic.php?id=68104 Paconky] - Displays package update information in a user-defined format. The output of this program can be included in Conky with the ${execpi} command.<br />
*[https://bbs.archlinux.org/viewtopic.php?id=53761 Scrolling Notifications] - Prints scrolling update notifications. From the author of Paconky.<br />
*[https://bbs.archlinux.org/viewtopic.php?id=57291 Perl Script] - Simpler and earlier script from the author of Paconky. Prints only the number of packages needing an update.<br />
*[https://bbs.archlinux.org/viewtopic.php?id=37284 Python Script] - Fairly configurable update notification program in Python.<br />
*[https://bbs.archlinux.org/viewtopic.php?pid=483742#p483742 Bash Script] - Bash script for users that have enabled ShowSize.<br />
<br />
===Display weather forecast===<br />
See [http://bbs.archlinux.org/viewtopic.php?id=37381 this thread].<br />
<br />
===Display RSS feeds===<br />
Conky has the ability to display RSS feeds natively without the need for an outside script to run and output into conky. For example, to display the titles of the ten most recent Planet Arch updates and refresh the feed every minute you would put this into your {{Filename|.conkyrc}}:<br />
<br />
${rss http://planet.archlinux.org/rss20.xml 1 item_titles 10 }<br />
<br />
===Display Distrowatch Arch Linux ranking===<br />
See [http://bbs.archlinux.org/viewtopic.php?id=88779 this thread].<br />
<br />
===Display rTorrent stats===<br />
See [http://bbs.archlinux.org/viewtopic.php?id=67304 this thread].<br />
<br />
===Display number of new emails (GMail)===<br />
Create a file named <code>gmail.py</code> in a convenient location (this example uses <code>~/.scripts/</code>) with the following [[Python]] code:<br />
import os<br />
<br />
#Enter your username and password below within double quotes<br />
# eg. username="username" and password="password"<br />
username="****"<br />
password="****"<br />
com="wget -q -O - https://"+username+":"+password+"@mail.google.com/mail/feed/atom --no-check-certificate"<br />
<br />
temp=os.popen(com)<br />
msg=temp.read()<br />
index=msg.find("<fullcount>")<br />
index2=msg.find("</fullcount>")<br />
fc=int(msg[index+11:index2])<br />
<br />
if fc==0:<br />
print "0 new"<br />
else:<br />
print str(fc)+" new"<br />
<br />
The above script did not work for me and my Google Apps account. I modified the script below to work with a Google App mail account [[Python]] code:<br />
import os<br />
<br />
#Enter your domain, username and password below within double quotes<br />
# eg. domain="yourdomain.com", username="username" and password="password"<br />
domain="yourdomain.com"<br />
username="username"<br />
password="password"<br />
com="wget -q -O - https://mail.google.com/a/"+domain+"/feed/atom --http-user="+username+"@"+domain+" --http-password="+password+" --no-check-certificate"<br />
<br />
temp=os.popen(com)<br />
msg=temp.read()<br />
index=msg.find("<fullcount>")<br />
index2=msg.find("</fullcount>")<br />
fc=int(msg[index+11:index2])<br />
<br />
if fc==0:<br />
print "0 new"<br />
else:<br />
print str(fc)+" new"<br />
<br />
Under Python3, the the above scripts will return an error at the print lines. In order to resolve this, change them to:<br />
if fc==0:<br />
print ("0 new")<br />
else:<br />
print (str(fc)+" new")<br />
<br />
Add the following string to your <code>.conkyrc</code> in order the check your gmail account for new email every five minutes (300 seconds) and display: ''# new''<br />
${execpi 300 python ~/.scripts/gmail.py}<br />
<br />
Alternatively, you can use [http://www.stunnel.org/ stunnel].<br />
pacman -S stunnel<br />
<br />
The following configuration is taken from [http://conky.sourceforge.net/faq.html conky's FAQ]<br />
<br />
Modify /etc/stunnel/stunnel.conf:<br />
# Service-level configuration for TLS server<br />
[imap]<br />
client = yes<br />
accept = 143<br />
connect = imap.gmail.com:143<br />
protocol = imap<br />
sslVersion = TLSv1<br />
# Service-level configuration for SSL server<br />
[imaps]<br />
client = yes<br />
accept = 993<br />
connect = imap.gmail.com:993<br />
<br />
...and start stunnel:<br />
rc.d start stunnel<br />
<br />
The only thing left is our conkyrc:<br />
imap localhost username * -i 120 -p 993<br />
TEXT<br />
Inbox: ${imap_unseen}/${imap_messages}<br />
<br />
Here I used * as the password for conky to ask for it at start, but you don't ''have'' to do it.<br />
<br />
===Display new emails (IMAP + SSL)===<br />
Conky has built in support for IMAP accounts, but doesn't support SSL. This can be provided using this script from [http://www.unix.com/shell-programming-scripting/115322-perl-conky-gmail-imap-unread-message-count.html this forum post]. This requires the Perl/CPAN Modules Mail::IMAPClient and IO::Socket::SSL which are in the perl-mail-imapclient and perl-io-socket-ssl packages<br />
<br />
Create a file named imap.pl in a location to be read by conky. In this file add (with the appropriate changes):<br />
#!/usr/bin/perl<br />
<br />
# gimap.pl by gxmsgx<br />
# description: get the count of unread messages on imap<br />
<br />
use strict;<br />
use Mail::IMAPClient;<br />
use IO::Socket::SSL;<br />
<br />
my $username = 'example.username'; <br />
my $password = 'password123'; <br />
<br />
my $socket = IO::Socket::SSL->new(<br />
PeerAddr => 'imap.server',<br />
PeerPort => 993<br />
)<br />
or die "socket(): $@";<br />
<br />
my $client = Mail::IMAPClient->new(<br />
Socket => $socket,<br />
User => $username,<br />
Password => $password,<br />
)<br />
or die "new(): $@";<br />
<br />
if ($client->IsAuthenticated()) {<br />
my $msgct;<br />
<br />
$client->select("INBOX");<br />
$msgct = $client->unseen_count||'0';<br />
print "$msgct\n";<br />
}<br />
<br />
$client->logout();<br />
<br />
Add to .conkyrc:<br />
${execpi 300 ~/.conky/imap.pl} <br />
or wherever you saved the file.<br />
<br />
Alternatively, you can use stunnel as shown above: [[Conky#How to display the number of new emails (Gmail) in Conky]]<br />
<br />
== User-contributed configuration examples ==<br />
=== Graysky ===<br />
[[http://img9.imageshack.us/img9/3153/imageffj.jpg Screen shot]]<br />
<br />
[[https://github.com/graysky2/configs/raw/master/dotfiles/.conkyrc Here]] it is - modify to fit your system. Optimized for a quad core chip w/ several hdds (although one of them isn't connected for this screenshot) and an nvidia graphics card. You can easily modify this to a dual or single core system with one or whatever number of hdds.<br />
<br />
==A sample rings script with nvidia support:==<br />
<br />
<pre><br />
1 # -- Conky settings -- #<br />
2 background no<br />
3 update_interval 1<br />
4 <br />
5 cpu_avg_samples 2<br />
6 net_avg_samples 2<br />
7 <br />
8 override_utf8_locale yes<br />
9 <br />
10 double_buffer yes<br />
11 no_buffers yes<br />
12 <br />
13 text_buffer_size 2048<br />
14 imlib_cache_size 0<br />
15 <br />
16 # -- Window specifications -- #<br />
17 <br />
18 own_window yes<br />
19 own_window_type normal<br />
20 own_window_transparent yes<br />
21 own_window_hints undecorate,sticky,skip_taskbar,skip_pager,below<br />
22 <br />
23 border_inner_margin 0<br />
24 border_outer_margin 0<br />
25 <br />
26 minimum_size 320 800<br />
27 maximum_width 320<br />
28 <br />
29 alignment bottom_right<br />
30 gap_x 0<br />
31 gap_y 0<br />
32 <br />
33 # -- Graphics settings -- #<br />
34 draw_shades no<br />
35 draw_outline no<br />
36 draw_borders no<br />
37 draw_graph_borders yes<br />
38 <br />
39 # -- Text settings -- #<br />
40 use_xft yes<br />
41 xftfont MaiandraGD:size=24<br />
42 xftalpha 0.4<br />
43 <br />
44 uppercase no<br />
45 <br />
46 default_color 888888<br />
47 <br />
48 # -- Lua Load -- #<br />
49 lua_load ~/conky/lua/lua.lua<br />
50 lua_draw_hook_pre ring_stats<br />
51 <br />
52 TEXT<br />
53 ${alignr}${voffset 53}${goto 90}${font MaiandraGD:size=11}${time %A, %d %B %Y}<br />
54 <br />
55 <br />
56 ${voffset 5}${goto 164}${font MaiandraGD:size=16}${time %H:%M}<br />
57 <br />
58 <br />
59 <br />
60 ${voffset -40}${goto 100}${font MaiandraGD:size=9}Kernel:${offset 70}Uptime:<br />
61 ${goto 90}${font MaiandraGD:size=9}$kernel${offset 40}$uptime<br />
62 ${voffset 57}${goto 117}${font snap:size=8}${cpu cpu0}%<br />
63 ${goto 117}${cpu cpu1}%<br />
64 ${goto 117}CPU<br />
65 ${voffset 19}${goto 145}${memperc}%<br />
66 ${goto 145}$swapperc%<br />
67 ${goto 145}MEM<br />
68 ${voffset 25}${goto 170}${nvidia gpufreq}<br />
69 ${goto 170}${nvidia memfreq}<br />
70 ${goto 170}GPU<br />
71 ${voffset 27}${goto 198}${totaldown ppp0}<br />
72 ${goto 198}${totalup ppp0}<br />
73 ${goto 205}NET<br />
74 ${voffset 21}<br />
75 ${goto 222}${fs_used /home}<br />
76 ${goto 230}DISK<br />
<br />
</pre><br />
*And the required lua.lua script:<br />
<br />
<pre><br />
1 --[[<br />
2 Ring Meters by londonali1010 (2009)<br />
3 <br />
4 This script draws percentage meters as rings. It is fully customisable; all options are described in the script.<br />
5 <br />
6 IMPORTANT: if you are using the 'cpu' function, it will cause a segmentation fault if it tries to draw a ring straight away. The if s tatement on line 145 uses a delay to make sure that this doesn't happen. It calculates the length of the delay by the number of updat es since Conky started. Generally, a value of 5s is long enough, so if you update Conky every 1s, use update_num > 5 in that if state ment (the default). If you only update Conky every 2s, you should change it to update_num > 3; conversely if you update Conky every 0 .5s, you should use update_num > 10. ALSO, if you change your Conky, is it best to use "killall conky; conky" to update it, otherwise the update_num will not be reset and you will get an error.<br />
7 <br />
8 To call this script in Conky, use the following (assuming that you save this script to ~/scripts/rings.lua):<br />
9 lua_load ~/scripts/rings-v1.2.1.lua<br />
10 lua_draw_hook_pre ring_stats<br />
11 <br />
12 Changelog:<br />
13 + v1.2.1 -- Fixed minor bug that caused script to crash if conky_parse() returns a nil value (20.10.2009)<br />
14 + v1.2 -- Added option for the ending angle of the rings (07.10.2009)<br />
15 + v1.1 -- Added options for the starting angle of the rings, and added the "max" variable, to allow for variables that output a numer ical value rather than a percentage (29.09.2009)<br />
16 + v1.0 -- Original release (28.09.2009)<br />
17 ]]<br />
18 <br />
19 settings_table = {<br />
20 {<br />
21 -- Edit this table to customise your rings.<br />
22 -- You can create more rings simply by adding more elements to settings_table.<br />
23 -- "name" is the type of stat to display; you can choose from 'cpu', 'memperc', 'fs_used_perc', 'battery_used_perc'.<br />
24 name='time',<br />
25 -- "arg" is the argument to the stat type, e.g. if in Conky you would write ${cpu cpu0}, 'cpu0' would be the argument . If you would not use an argument in the Conky variable, use ''.<br />
26 arg='%I.%M',<br />
27 -- "max" is the maximum value of the ring. If the Conky variable outputs a percentage, use 100.<br />
28 max=12,<br />
29 -- "bg_colour" is the colour of the base ring.<br />
30 bg_colour=0x888888,<br />
31 -- "bg_alpha" is the alpha value of the base ring.<br />
32 bg_alpha=0.3,<br />
33 -- "fg_colour" is the colour of the indicator part of the ring.<br />
34 fg_colour=0x888888,<br />
35 -- "fg_alpha" is the alpha value of the indicator part of the ring.<br />
36 fg_alpha=0.5,<br />
37 -- "x" and "y" are the x and y coordinates of the centre of the ring, relative to the top left corner of the Conky wi ndow.<br />
38 x=191, y=145,<br />
39 -- "radius" is the radius of the ring.<br />
40 radius=32,<br />
41 -- "thickness" is the thickness of the ring, centred around the radius.<br />
42 thickness=4,<br />
43 -- "start_angle" is the starting angle of the ring, in degrees, clockwise from top. Value can be either positive or n egative.<br />
44 start_angle=0,<br />
45 -- "end_angle" is the ending angle of the ring, in degrees, clockwise from top. Value can be either positive or negat ive, but must be larger (e.g. more clockwise) than start_angle.<br />
46 end_angle=360<br />
47 },<br />
48 {<br />
49 name='time',<br />
50 arg='%M.%S',<br />
51 max=60,<br />
52 bg_colour=0x888888,<br />
53 bg_alpha=0.3,<br />
54 fg_colour=0x888888,<br />
55 fg_alpha=0.5,<br />
56 x=191, y=145,<br />
57 radius=37,<br />
58 thickness=4,<br />
59 start_angle=0,<br />
60 end_angle=360<br />
61 },<br />
62 {<br />
63 name='time',<br />
64 arg='%S',<br />
65 max=60,<br />
66 bg_colour=0x888888,<br />
67 bg_alpha=0.3,<br />
68 fg_colour=0x888888,<br />
69 fg_alpha=0.5,<br />
70 x=191, y=145,<br />
71 radius=42,<br />
72 thickness=4,<br />
73 start_angle=0,<br />
74 end_angle=360<br />
75 },<br />
76 {<br />
77 name='cpu',<br />
78 arg='cpu0',<br />
79 max=100,<br />
80 bg_colour=0x888888,<br />
81 bg_alpha=0.3,<br />
82 fg_colour=0x888888,<br />
83 fg_alpha=0.5,<br />
84 x=140, y=300,<br />
85 radius=26,<br />
86 thickness=5,<br />
87 start_angle=-90,<br />
88 end_angle=180<br />
89 },<br />
90 {<br />
91 name='cpu',<br />
92 arg='cpu1',<br />
93 max=100,<br />
94 bg_colour=0x888888,<br />
95 bg_alpha=0.3,<br />
96 fg_colour=0x888888,<br />
97 fg_alpha=0.5,<br />
98 x=140, y=300,<br />
99 radius=20,<br />
100 thickness=5,<br />
101 start_angle=-90,<br />
102 end_angle=180<br />
103 },<br />
104 {<br />
105 name='memperc',<br />
106 arg='',<br />
107 max=100,<br />
108 bg_colour=0x888888,<br />
109 bg_alpha=0.3,<br />
110 fg_colour=0x888888,<br />
111 fg_alpha=0.5,<br />
112 x=170, y=350,<br />
113 radius=26,<br />
114 thickness=5,<br />
115 start_angle=-90,<br />
116 end_angle=180<br />
117 },<br />
118 {<br />
119 name='swapperc',<br />
120 arg='',<br />
121 max=100,<br />
122 bg_colour=0x888888,<br />
123 bg_alpha=0.3,<br />
124 fg_colour=0x888888,<br />
125 fg_alpha=0.5,<br />
126 x=170, y=350,<br />
127 radius=20,<br />
128 thickness=5,<br />
129 start_angle=-90,<br />
130 end_angle=180<br />
131 },<br />
132 {<br />
133 name='time',<br />
134 arg='%d',<br />
135 max=31,<br />
136 bg_colour=0x888888,<br />
137 bg_alpha=0.3,<br />
138 fg_colour=0x888888,<br />
139 fg_alpha=0.5,<br />
140 x=191, y=145,<br />
141 radius=50,<br />
142 thickness=5,<br />
143 start_angle=-140,<br />
144 end_angle=-30<br />
145 },<br />
146 {<br />
147 name='time',<br />
148 arg='%m',<br />
149 max=12,<br />
150 bg_colour=0x888888,<br />
151 bg_alpha=0.3,<br />
152 fg_colour=0x888888,<br />
153 fg_alpha=0.5,<br />
154 x=191, y=145,<br />
155 radius=50,<br />
156 thickness=5,<br />
157 start_angle=30,<br />
158 end_angle=140<br />
159 },<br />
160 -- {<br />
161 -- name='fs_used_perc',<br />
162 -- arg='/',<br />
163 -- max=100,<br />
164 -- bg_colour=0x888888,<br />
165 -- bg_alpha=0.3,<br />
166 -- fg_colour=0x888888,<br />
167 -- fg_alpha=0.5,<br />
168 -- x=260, y=503,<br />
169 -- radius=26,<br />
170 -- thickness=5,<br />
171 -- start_angle=-90,<br />
172 -- end_angle=180<br />
173 -- },<br />
174 {<br />
175 name='fs_used_perc',<br />
176 arg='/home',<br />
177 max=100,<br />
178 bg_colour=0x888888,<br />
179 bg_alpha=0.3,<br />
180 fg_colour=0x888888,<br />
181 fg_alpha=0.5,<br />
182 x=260, y=503,<br />
183 radius=20,<br />
184 thickness=5,<br />
185 start_angle=-90,<br />
186 end_angle=180<br />
187 },<br />
188 {<br />
189 name='totalup',<br />
190 arg='ppp0',<br />
191 max=2,<br />
192 bg_colour=0x888888,<br />
193 bg_alpha=0.3,<br />
194 fg_colour=0x888888,<br />
195 fg_alpha=0.5,<br />
196 x=230, y=452,<br />
197 radius=20,<br />
198 thickness=5,<br />
199 start_angle=-90,<br />
200 end_angle=180<br />
201 },<br />
202 {<br />
203 name='totaldown',<br />
204 arg='ppp0',<br />
205 max=2,<br />
206 bg_colour=0x888888,<br />
207 bg_alpha=0.3,<br />
208 fg_colour=0x888888,<br />
209 fg_alpha=0.5,<br />
210 x=230, y=452,<br />
211 radius=26,<br />
212 thickness=5,<br />
213 start_angle=-90,<br />
214 end_angle=180<br />
215 },<br />
216 {<br />
217 name='nvidia',<br />
218 arg='gpufreq',<br />
219 max=475,<br />
220 bg_colour=0x888888,<br />
221 bg_alpha=0.3,<br />
222 fg_colour=0x888888,<br />
223 fg_alpha=0.5,<br />
224 x=200, y=401,<br />
225 radius=26,<br />
226 thickness=5,<br />
227 start_angle=-90,<br />
228 end_angle=180<br />
229 },<br />
230 {<br />
231 name='nvidia',<br />
232 arg='memfreq',<br />
233 max=700,<br />
234 bg_colour=0x888888,<br />
235 bg_alpha=0.3,<br />
236 fg_colour=0x888888,<br />
237 fg_alpha=0.5,<br />
238 x=200, y=401,<br />
239 radius=20,<br />
240 thickness=5,<br />
241 start_angle=-90,<br />
242 end_angle=180<br />
243 },<br />
244 }<br />
245 <br />
246 require 'cairo'<br />
247 <br />
248 function rgb_to_r_g_b(colour,alpha)<br />
249 return ((colour / 0x10000) % 0x100) / 255., ((colour / 0x100) % 0x100) / 255., (colour % 0x100) / 255., alpha<br />
250 end<br />
251 <br />
252 function draw_ring(cr,t,pt)<br />
253 local w,h=conky_window.width,conky_window.height<br />
254 <br />
255 local xc,yc,ring_r,ring_w,sa,ea=pt['x'],pt['y'],pt['radius'],pt['thickness'],pt['start_angle'],pt['end_angle']<br />
256 local bgc, bga, fgc, fga=pt['bg_colour'], pt['bg_alpha'], pt['fg_colour'], pt['fg_alpha']<br />
257 <br />
258 local angle_0=sa*(2*math.pi/360)-math.pi/2<br />
259 local angle_f=ea*(2*math.pi/360)-math.pi/2<br />
260 local t_arc=t*(angle_f-angle_0)<br />
261 <br />
262 -- Draw background ring<br />
263 <br />
264 cairo_arc(cr,xc,yc,ring_r,angle_0,angle_f)<br />
265 cairo_set_source_rgba(cr,rgb_to_r_g_b(bgc,bga))<br />
266 cairo_set_line_width(cr,ring_w)<br />
267 cairo_stroke(cr)<br />
268 <br />
269 -- Draw indicator ring<br />
270 <br />
271 cairo_arc(cr,xc,yc,ring_r,angle_0,angle_0+t_arc)<br />
272 cairo_set_source_rgba(cr,rgb_to_r_g_b(fgc,fga))<br />
273 cairo_stroke(cr)<br />
274 end<br />
275 <br />
276 function conky_ring_stats()<br />
277 local function setup_rings(cr,pt)<br />
278 local str=''<br />
279 local value=0<br />
280 <br />
281 str=string.format('${%s %s}',pt['name'],pt['arg'])<br />
282 str=conky_parse(str)<br />
283 <br />
284 value=tonumber(str)<br />
285 if value == nil then value = 0 end<br />
286 pct=value/pt['max']<br />
287 <br />
288 draw_ring(cr,pct,p<nowiki><nowiki>Insert non-formatted text here</nowiki>'''Bold text'''</nowiki>t)<br />
289 end<br />
290 <br />
291 if conky_window==nil then return end<br />
292 local cs=cairo_xlib_surface_create(conky_window.display,conky_window.drawable,conky_window.visual, conky_window.width,conky_w indow.height)<br />
293 <br />
294 local cr=cairo_create(cs)<br />
295 <br />
296 local updates=conky_parse('${updates}')<br />
297 update_num=tonumber(updates)<br />
298 <br />
299 if update_num>5 then<br />
300 for i in pairs(settings_table) do<br />
301 setup_rings(cr,settings_table[i])<br />
302 end<br />
303 end<br />
304 end<br />
~ <br />
</pre><br />
== A note about symbolic fonts ==<br />
<br />
Many of the more decorated .conkyrc's use the fonts PizzaDude Bullets and Pie Charts for Maps. They are available from the AUR as 'ttf-pizzadude-bullets' and 'ttf-piechartsformaps' respectively, or they can be found and downloaded with a quick search and manually installed using the instructions in [[Fonts]].<br />
<br />
== Universal method to enable true transparency ==<br />
<br />
Transparency is a strange beast in Conky, but there is a way to universally apply true transparency with any environment or window manager by using xcompmgr and transset-df. Install xcompmgr from [extra] and transset-df from [community] with {{Codeline|pacman -Sy xcompmgr transset-df}}. These packages both have the same 3 dependencies, so this is the lightest method for composition available, for those of you using standalone window managers in order to achieve the leanest setup you can manage (or whatever reason you have :D)<br />
<br />
NOTE: This may conflict with any other compositing manager you are already using.<br />
<br />
Check xcompmgr documentation to help you decide which compositing options you would like to enable. The following is a common standard command.<br />
<br />
<pre><br />
xcompmgr -c -t-5 -l-5 -r4.2 -o.55 &<br />
</pre><br />
<br />
Make sure conky is running with {{Codeline|conky &}}. Use transset-df to enable transparency on the Conky window. Set '.5' to any value in the range 0 - 1.<br />
<br />
<pre><br />
transset-df .5 -n Conky<br />
</pre><br />
<br />
This should give your conky window true transparency. If you get an error like, <br />
{{Command|name=transset-df .5 -n Conky|output=No Window matching Conky exists!}}<br />
Verify that conky is running, and use xprop and click on the conky window to find the name you should pass to {{Codeline|transset-df}}. <br />
{{Command|name=xprop &#124; grep WM_NAME|output=WM_NAME(STRING) = "Conky (ArchitectLinux)"}}<br />
<br />
In this case, "Conky" is right, but for you it may be different, so be sure to use your output instead. If ~/.conkyrc has {{Codeline|own_window_type panel}} then this xprop invocation may show now output. Try using any of the following options instead. {{Codeline|own_window_type {dock,normal,override,desktop}}}<br />
<br />
Use this in ~/.xinitrc to have transparent conky run when you {{Codeline|startx}}.<br />
<br />
<pre><br />
xcompmgr -c -t-5 -l-5 -r4.2 -o.55 &<br />
conky -d; sleep 1 && transset-df .5 -n Conky<br />
</pre><br />
<br />
== External links ==<br />
*[http://bbs.archlinux.org/viewtopic.php?id=39906 Conky Configs on arch forums]<br />
*[http://conky.sourceforge.net/ Official website]<br />
*[http://freshmeat.net/projects/conky/ Conky] on [[wikipedia:Freshmeat|Freshmeat]]<br />
*[http://sourceforge.net/projects/conky/ Conky] on [[wikipedia:sourceforge.net|SourceForge]]<br />
*[irc://chat.freenode.org/conky #conky] IRC chat channel on [[wikipedia:Freenode|freenode]]<br />
*[http://novel.evilcoder.org/wiki/index.php?title=ConkyFAQ&oldid=12463 FAQ]</div>Zendeavorhttps://wiki.archlinux.org/index.php?title=Conky&diff=148920Conky2011-07-13T06:09:49Z<p>Zendeavor: Added information on how to enable true transparency in conky that should work universally.</p>
<hr />
<div>[[Category:Utilities (English)]]<br />
[[Category:Eye candy (English)]]<br />
{{i18n|Conky}}<br />
<br />
Conky is a system monitor software for the X Window System. It is available for GNU/Linux and FreeBSD. It is free software released under the terms of the GPL license. Conky is able to monitor many system variables including CPU, memory, swap, disk space, temperature, top, upload, download, system messages, and much more. It is extremely configurable, however, the configuration can be a little hard to understand. Conky is a fork of torsmo.<br />
<br />
==Installation and configuration==<br />
*Conky is available in the Extra repository<br />
# pacman -S conky<br />
*Edit config file using an example configuration file from [http://conky.sourceforge.net/screenshots.html homeproject-screenshot]<br />
$ nano ~/.conkyrc<br />
*Alternatively, you can use the default config at {{Filename|/etc/conky/conky.conf}}:<br />
$ cp /etc/conky/conky.conf ~/.conkyrc<br />
<br />
==AUR packages==<br />
<br />
In addition to the basic conky package in the repos, there are various [[AUR]] packages available with extra compile options enabled.<br />
<br />
*Install [http://aur.archlinux.org/packages.php?ID=11884 conky-cli] for conky sans X11 dependencies<br />
*Install [http://aur.archlinux.org/packages.php?ID=19156 conky-nvidia] for nvidia support.<br />
*Install [http://aur.archlinux.org/packages.php?ID=31589 conky-lua] for lua support.<br />
*Install [http://aur.archlinux.org/packages.php?ID=36405 conky-lua-nv] for both lua and nvidia support.<br />
<br />
==Tips and tricks==<br />
===Enable real transparency (KDE4)===<br />
Since version 1.8.0 conky suppports real transparency. To enable it (and make it work nicely with KDE4), add these lines to {{Filename|~/.conkyrc}}:<br />
own_window yes<br />
own_window_transparent yes<br />
own_window_argb_visual yes<br />
own_window_type normal<br />
own_window_class conky-semi<br />
own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager<br />
This replaces the feh method described below.<br />
<br />
===Prevent flickering===<br />
Conky needs Double Buffer Extension (DBE) support from X server to prevent flickering, because it can't update window fast enough without it. It can be enabled in {{Filename|/etc/X11/xorg.conf}} with {{Codeline|Load "dbe"}} line in {{Codeline|Section "Module"}}. The xorg.conf file has been replaced (1.8.x patch upwards) by {{Filename|/etc/X11/xorg.conf.d}} which contains the particular configuration files. ''DBE'' is loaded automatically. <br />
<br />
To verify: <br />
# grep dbe /var/log/Xorg.0.log<br />
<br />
Output (should be similar):<br />
# [ 86.101] (II) LoadModule: "dbe"<br />
# [ 86.101] (II) Loading /usr/lib/xorg/modules/extensions/libdbe.so<br />
# [ 86.111] (II) Module dbe: vendor="X.Org Foundation"<br />
<br />
To enable double-buffer check to have in {{Filename|~/.conkyrc}}:<br />
# Place below the other options, not below TEXT or XY<br />
double_buffer yes<br />
<br />
===Don't minimize on Show Desktop (Compiz)===<br />
If the 'Show Desktop' button or keybinding minimizes conky along with all other windows, fire up compiz config settings manager, go to General Options and uncheck the "Hide Skip Taskbar Windows" option.<br />
<br />
===Integrate with KDesktop===<br />
Conky with screenshot configuration generate problems with icons visualization. So there are some steps to follow.<br />
*Add these lines to {{Filename|~/.conkyrc}}:<br />
own_window yes<br />
own_window_type normal<br />
own_window_transparent yes<br />
own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager<br />
*if this setting is on, comment it out or delete the line<br />
minimum_size<br />
*To autostart conky create this link<br />
$ ln -s /usr/bin/conky ~/.kde/share/autostart/conkylink<br />
For KDE4 users<br />
$ ln -s /usr/bin/conky ~/.kde4/Autostart/conkylink<br />
*Install feh<br />
# pacman -S feh<br />
*Make a script to allow transparency with the desktop<br />
For KDE3 users<br />
$ nano -w ~/.kde/share/autostart/fehconky <br />
<br />
#!/bin/bash<br />
feh --bg-scale `dcop kdesktop KBackgroundIface currentWallpaper 1`<br />
For KDE4 users<br />
$ nano -w ~/.kde4/Autostart/fehconky<br />
<br />
#!/bin/bash<br />
feh --bg-scale "`grep 'wallpaper=' ~/.kde4/share/config/plasma-desktop-appletsrc | tail --lines=1 | sed 's/wallpaper=//'`"<br />
use {{Codeline|--bg-center}} if you use a centered wallpaper.<br />
*Make it executable<br />
$ chmod +x ~/.kde/share/autostart/fehconky<br />
KDE4<br />
$ chmod +x ~/.kde4/Autostart/fehconky<br />
*Optionally instead using a script you can add the corresponding line to the bottom of {{Filename|.conkyrc}}<br />
$ nano ~/.conkyrc<br />
For KDE3<br />
${exec feh --bg-scale `dcop kdesktop KBackgroundIface currentWallpaper 1`}<br />
For KDE4<br />
${exec feh --bg-scale "`grep 'wallpaper=' ~/.kde4/share/config/plasma-desktop-appletsrc | tail --lines=1 | sed 's/wallpaper=//'`"}<br />
<br />
===Display package update information===<br />
*[https://bbs.archlinux.org/viewtopic.php?id=68104 Paconky] - Displays package update information in a user-defined format. The output of this program can be included in Conky with the ${execpi} command.<br />
*[https://bbs.archlinux.org/viewtopic.php?id=53761 Scrolling Notifications] - Prints scrolling update notifications. From the author of Paconky.<br />
*[https://bbs.archlinux.org/viewtopic.php?id=57291 Perl Script] - Simpler and earlier script from the author of Paconky. Prints only the number of packages needing an update.<br />
*[https://bbs.archlinux.org/viewtopic.php?id=37284 Python Script] - Fairly configurable update notification program in Python.<br />
*[https://bbs.archlinux.org/viewtopic.php?pid=483742#p483742 Bash Script] - Bash script for users that have enabled ShowSize.<br />
<br />
===Display weather forecast===<br />
See [http://bbs.archlinux.org/viewtopic.php?id=37381 this thread].<br />
<br />
===Display RSS feeds===<br />
Conky has the ability to display RSS feeds natively without the need for an outside script to run and output into conky. For example, to display the titles of the ten most recent Planet Arch updates and refresh the feed every minute you would put this into your {{Filename|.conkyrc}}:<br />
<br />
${rss http://planet.archlinux.org/rss20.xml 1 item_titles 10 }<br />
<br />
===Display Distrowatch Arch Linux ranking===<br />
See [http://bbs.archlinux.org/viewtopic.php?id=88779 this thread].<br />
<br />
===Display rTorrent stats===<br />
See [http://bbs.archlinux.org/viewtopic.php?id=67304 this thread].<br />
<br />
===Display number of new emails (GMail)===<br />
Create a file named <code>gmail.py</code> in a convenient location (this example uses <code>~/.scripts/</code>) with the following [[Python]] code:<br />
import os<br />
<br />
#Enter your username and password below within double quotes<br />
# eg. username="username" and password="password"<br />
username="****"<br />
password="****"<br />
com="wget -q -O - https://"+username+":"+password+"@mail.google.com/mail/feed/atom --no-check-certificate"<br />
<br />
temp=os.popen(com)<br />
msg=temp.read()<br />
index=msg.find("<fullcount>")<br />
index2=msg.find("</fullcount>")<br />
fc=int(msg[index+11:index2])<br />
<br />
if fc==0:<br />
print "0 new"<br />
else:<br />
print str(fc)+" new"<br />
<br />
The above script did not work for me and my Google Apps account. I modified the script below to work with a Google App mail account [[Python]] code:<br />
import os<br />
<br />
#Enter your domain, username and password below within double quotes<br />
# eg. domain="yourdomain.com", username="username" and password="password"<br />
domain="yourdomain.com"<br />
username="username"<br />
password="password"<br />
com="wget -q -O - https://mail.google.com/a/"+domain+"/feed/atom --http-user="+username+"@"+domain+" --http-password="+password+" --no-check-certificate"<br />
<br />
temp=os.popen(com)<br />
msg=temp.read()<br />
index=msg.find("<fullcount>")<br />
index2=msg.find("</fullcount>")<br />
fc=int(msg[index+11:index2])<br />
<br />
if fc==0:<br />
print "0 new"<br />
else:<br />
print str(fc)+" new"<br />
<br />
Under Python3, the the above scripts will return an error at the print lines. In order to resolve this, change them to:<br />
if fc==0:<br />
print ("0 new")<br />
else:<br />
print (str(fc)+" new")<br />
<br />
Add the following string to your <code>.conkyrc</code> in order the check your gmail account for new email every five minutes (300 seconds) and display: ''# new''<br />
${execpi 300 python ~/.scripts/gmail.py}<br />
<br />
Alternatively, you can use [http://www.stunnel.org/ stunnel].<br />
pacman -S stunnel<br />
<br />
The following configuration is taken from [http://conky.sourceforge.net/faq.html conky's FAQ]<br />
<br />
Modify /etc/stunnel/stunnel.conf:<br />
# Service-level configuration for TLS server<br />
[imap]<br />
client = yes<br />
accept = 143<br />
connect = imap.gmail.com:143<br />
protocol = imap<br />
sslVersion = TLSv1<br />
# Service-level configuration for SSL server<br />
[imaps]<br />
client = yes<br />
accept = 993<br />
connect = imap.gmail.com:993<br />
<br />
...and start stunnel:<br />
rc.d start stunnel<br />
<br />
The only thing left is our conkyrc:<br />
imap localhost username * -i 120 -p 993<br />
TEXT<br />
Inbox: ${imap_unseen}/${imap_messages}<br />
<br />
Here I used * as the password for conky to ask for it at start, but you don't ''have'' to do it.<br />
<br />
===Display new emails (IMAP + SSL)===<br />
Conky has built in support for IMAP accounts, but doesn't support SSL. This can be provided using this script from [http://www.unix.com/shell-programming-scripting/115322-perl-conky-gmail-imap-unread-message-count.html this forum post]. This requires the Perl/CPAN Modules Mail::IMAPClient and IO::Socket::SSL which are in the perl-mail-imapclient and perl-io-socket-ssl packages<br />
<br />
Create a file named imap.pl in a location to be read by conky. In this file add (with the appropriate changes):<br />
#!/usr/bin/perl<br />
<br />
# gimap.pl by gxmsgx<br />
# description: get the count of unread messages on imap<br />
<br />
use strict;<br />
use Mail::IMAPClient;<br />
use IO::Socket::SSL;<br />
<br />
my $username = 'example.username'; <br />
my $password = 'password123'; <br />
<br />
my $socket = IO::Socket::SSL->new(<br />
PeerAddr => 'imap.server',<br />
PeerPort => 993<br />
)<br />
or die "socket(): $@";<br />
<br />
my $client = Mail::IMAPClient->new(<br />
Socket => $socket,<br />
User => $username,<br />
Password => $password,<br />
)<br />
or die "new(): $@";<br />
<br />
if ($client->IsAuthenticated()) {<br />
my $msgct;<br />
<br />
$client->select("INBOX");<br />
$msgct = $client->unseen_count||'0';<br />
print "$msgct\n";<br />
}<br />
<br />
$client->logout();<br />
<br />
Add to .conkyrc:<br />
${execpi 300 ~/.conky/imap.pl} <br />
or wherever you saved the file.<br />
<br />
Alternatively, you can use stunnel as shown above: [[Conky#How to display the number of new emails (Gmail) in Conky]]<br />
<br />
== User-contributed configuration examples ==<br />
=== Graysky ===<br />
[[http://img9.imageshack.us/img9/3153/imageffj.jpg Screen shot]]<br />
<br />
[[https://github.com/graysky2/configs/raw/master/dotfiles/.conkyrc Here]] it is - modify to fit your system. Optimized for a quad core chip w/ several hdds (although one of them isn't connected for this screenshot) and an nvidia graphics card. You can easily modify this to a dual or single core system with one or whatever number of hdds.<br />
<br />
==A sample rings script with nvidia support:==<br />
<br />
<pre><br />
1 # -- Conky settings -- #<br />
2 background no<br />
3 update_interval 1<br />
4 <br />
5 cpu_avg_samples 2<br />
6 net_avg_samples 2<br />
7 <br />
8 override_utf8_locale yes<br />
9 <br />
10 double_buffer yes<br />
11 no_buffers yes<br />
12 <br />
13 text_buffer_size 2048<br />
14 imlib_cache_size 0<br />
15 <br />
16 # -- Window specifications -- #<br />
17 <br />
18 own_window yes<br />
19 own_window_type normal<br />
20 own_window_transparent yes<br />
21 own_window_hints undecorate,sticky,skip_taskbar,skip_pager,below<br />
22 <br />
23 border_inner_margin 0<br />
24 border_outer_margin 0<br />
25 <br />
26 minimum_size 320 800<br />
27 maximum_width 320<br />
28 <br />
29 alignment bottom_right<br />
30 gap_x 0<br />
31 gap_y 0<br />
32 <br />
33 # -- Graphics settings -- #<br />
34 draw_shades no<br />
35 draw_outline no<br />
36 draw_borders no<br />
37 draw_graph_borders yes<br />
38 <br />
39 # -- Text settings -- #<br />
40 use_xft yes<br />
41 xftfont MaiandraGD:size=24<br />
42 xftalpha 0.4<br />
43 <br />
44 uppercase no<br />
45 <br />
46 default_color 888888<br />
47 <br />
48 # -- Lua Load -- #<br />
49 lua_load ~/conky/lua/lua.lua<br />
50 lua_draw_hook_pre ring_stats<br />
51 <br />
52 TEXT<br />
53 ${alignr}${voffset 53}${goto 90}${font MaiandraGD:size=11}${time %A, %d %B %Y}<br />
54 <br />
55 <br />
56 ${voffset 5}${goto 164}${font MaiandraGD:size=16}${time %H:%M}<br />
57 <br />
58 <br />
59 <br />
60 ${voffset -40}${goto 100}${font MaiandraGD:size=9}Kernel:${offset 70}Uptime:<br />
61 ${goto 90}${font MaiandraGD:size=9}$kernel${offset 40}$uptime<br />
62 ${voffset 57}${goto 117}${font snap:size=8}${cpu cpu0}%<br />
63 ${goto 117}${cpu cpu1}%<br />
64 ${goto 117}CPU<br />
65 ${voffset 19}${goto 145}${memperc}%<br />
66 ${goto 145}$swapperc%<br />
67 ${goto 145}MEM<br />
68 ${voffset 25}${goto 170}${nvidia gpufreq}<br />
69 ${goto 170}${nvidia memfreq}<br />
70 ${goto 170}GPU<br />
71 ${voffset 27}${goto 198}${totaldown ppp0}<br />
72 ${goto 198}${totalup ppp0}<br />
73 ${goto 205}NET<br />
74 ${voffset 21}<br />
75 ${goto 222}${fs_used /home}<br />
76 ${goto 230}DISK<br />
<br />
</pre><br />
*And the required lua.lua script:<br />
<br />
<pre><br />
1 --[[<br />
2 Ring Meters by londonali1010 (2009)<br />
3 <br />
4 This script draws percentage meters as rings. It is fully customisable; all options are described in the script.<br />
5 <br />
6 IMPORTANT: if you are using the 'cpu' function, it will cause a segmentation fault if it tries to draw a ring straight away. The if s tatement on line 145 uses a delay to make sure that this doesn't happen. It calculates the length of the delay by the number of updat es since Conky started. Generally, a value of 5s is long enough, so if you update Conky every 1s, use update_num > 5 in that if state ment (the default). If you only update Conky every 2s, you should change it to update_num > 3; conversely if you update Conky every 0 .5s, you should use update_num > 10. ALSO, if you change your Conky, is it best to use "killall conky; conky" to update it, otherwise the update_num will not be reset and you will get an error.<br />
7 <br />
8 To call this script in Conky, use the following (assuming that you save this script to ~/scripts/rings.lua):<br />
9 lua_load ~/scripts/rings-v1.2.1.lua<br />
10 lua_draw_hook_pre ring_stats<br />
11 <br />
12 Changelog:<br />
13 + v1.2.1 -- Fixed minor bug that caused script to crash if conky_parse() returns a nil value (20.10.2009)<br />
14 + v1.2 -- Added option for the ending angle of the rings (07.10.2009)<br />
15 + v1.1 -- Added options for the starting angle of the rings, and added the "max" variable, to allow for variables that output a numer ical value rather than a percentage (29.09.2009)<br />
16 + v1.0 -- Original release (28.09.2009)<br />
17 ]]<br />
18 <br />
19 settings_table = {<br />
20 {<br />
21 -- Edit this table to customise your rings.<br />
22 -- You can create more rings simply by adding more elements to settings_table.<br />
23 -- "name" is the type of stat to display; you can choose from 'cpu', 'memperc', 'fs_used_perc', 'battery_used_perc'.<br />
24 name='time',<br />
25 -- "arg" is the argument to the stat type, e.g. if in Conky you would write ${cpu cpu0}, 'cpu0' would be the argument . If you would not use an argument in the Conky variable, use ''.<br />
26 arg='%I.%M',<br />
27 -- "max" is the maximum value of the ring. If the Conky variable outputs a percentage, use 100.<br />
28 max=12,<br />
29 -- "bg_colour" is the colour of the base ring.<br />
30 bg_colour=0x888888,<br />
31 -- "bg_alpha" is the alpha value of the base ring.<br />
32 bg_alpha=0.3,<br />
33 -- "fg_colour" is the colour of the indicator part of the ring.<br />
34 fg_colour=0x888888,<br />
35 -- "fg_alpha" is the alpha value of the indicator part of the ring.<br />
36 fg_alpha=0.5,<br />
37 -- "x" and "y" are the x and y coordinates of the centre of the ring, relative to the top left corner of the Conky wi ndow.<br />
38 x=191, y=145,<br />
39 -- "radius" is the radius of the ring.<br />
40 radius=32,<br />
41 -- "thickness" is the thickness of the ring, centred around the radius.<br />
42 thickness=4,<br />
43 -- "start_angle" is the starting angle of the ring, in degrees, clockwise from top. Value can be either positive or n egative.<br />
44 start_angle=0,<br />
45 -- "end_angle" is the ending angle of the ring, in degrees, clockwise from top. Value can be either positive or negat ive, but must be larger (e.g. more clockwise) than start_angle.<br />
46 end_angle=360<br />
47 },<br />
48 {<br />
49 name='time',<br />
50 arg='%M.%S',<br />
51 max=60,<br />
52 bg_colour=0x888888,<br />
53 bg_alpha=0.3,<br />
54 fg_colour=0x888888,<br />
55 fg_alpha=0.5,<br />
56 x=191, y=145,<br />
57 radius=37,<br />
58 thickness=4,<br />
59 start_angle=0,<br />
60 end_angle=360<br />
61 },<br />
62 {<br />
63 name='time',<br />
64 arg='%S',<br />
65 max=60,<br />
66 bg_colour=0x888888,<br />
67 bg_alpha=0.3,<br />
68 fg_colour=0x888888,<br />
69 fg_alpha=0.5,<br />
70 x=191, y=145,<br />
71 radius=42,<br />
72 thickness=4,<br />
73 start_angle=0,<br />
74 end_angle=360<br />
75 },<br />
76 {<br />
77 name='cpu',<br />
78 arg='cpu0',<br />
79 max=100,<br />
80 bg_colour=0x888888,<br />
81 bg_alpha=0.3,<br />
82 fg_colour=0x888888,<br />
83 fg_alpha=0.5,<br />
84 x=140, y=300,<br />
85 radius=26,<br />
86 thickness=5,<br />
87 start_angle=-90,<br />
88 end_angle=180<br />
89 },<br />
90 {<br />
91 name='cpu',<br />
92 arg='cpu1',<br />
93 max=100,<br />
94 bg_colour=0x888888,<br />
95 bg_alpha=0.3,<br />
96 fg_colour=0x888888,<br />
97 fg_alpha=0.5,<br />
98 x=140, y=300,<br />
99 radius=20,<br />
100 thickness=5,<br />
101 start_angle=-90,<br />
102 end_angle=180<br />
103 },<br />
104 {<br />
105 name='memperc',<br />
106 arg='',<br />
107 max=100,<br />
108 bg_colour=0x888888,<br />
109 bg_alpha=0.3,<br />
110 fg_colour=0x888888,<br />
111 fg_alpha=0.5,<br />
112 x=170, y=350,<br />
113 radius=26,<br />
114 thickness=5,<br />
115 start_angle=-90,<br />
116 end_angle=180<br />
117 },<br />
118 {<br />
119 name='swapperc',<br />
120 arg='',<br />
121 max=100,<br />
122 bg_colour=0x888888,<br />
123 bg_alpha=0.3,<br />
124 fg_colour=0x888888,<br />
125 fg_alpha=0.5,<br />
126 x=170, y=350,<br />
127 radius=20,<br />
128 thickness=5,<br />
129 start_angle=-90,<br />
130 end_angle=180<br />
131 },<br />
132 {<br />
133 name='time',<br />
134 arg='%d',<br />
135 max=31,<br />
136 bg_colour=0x888888,<br />
137 bg_alpha=0.3,<br />
138 fg_colour=0x888888,<br />
139 fg_alpha=0.5,<br />
140 x=191, y=145,<br />
141 radius=50,<br />
142 thickness=5,<br />
143 start_angle=-140,<br />
144 end_angle=-30<br />
145 },<br />
146 {<br />
147 name='time',<br />
148 arg='%m',<br />
149 max=12,<br />
150 bg_colour=0x888888,<br />
151 bg_alpha=0.3,<br />
152 fg_colour=0x888888,<br />
153 fg_alpha=0.5,<br />
154 x=191, y=145,<br />
155 radius=50,<br />
156 thickness=5,<br />
157 start_angle=30,<br />
158 end_angle=140<br />
159 },<br />
160 -- {<br />
161 -- name='fs_used_perc',<br />
162 -- arg='/',<br />
163 -- max=100,<br />
164 -- bg_colour=0x888888,<br />
165 -- bg_alpha=0.3,<br />
166 -- fg_colour=0x888888,<br />
167 -- fg_alpha=0.5,<br />
168 -- x=260, y=503,<br />
169 -- radius=26,<br />
170 -- thickness=5,<br />
171 -- start_angle=-90,<br />
172 -- end_angle=180<br />
173 -- },<br />
174 {<br />
175 name='fs_used_perc',<br />
176 arg='/home',<br />
177 max=100,<br />
178 bg_colour=0x888888,<br />
179 bg_alpha=0.3,<br />
180 fg_colour=0x888888,<br />
181 fg_alpha=0.5,<br />
182 x=260, y=503,<br />
183 radius=20,<br />
184 thickness=5,<br />
185 start_angle=-90,<br />
186 end_angle=180<br />
187 },<br />
188 {<br />
189 name='totalup',<br />
190 arg='ppp0',<br />
191 max=2,<br />
192 bg_colour=0x888888,<br />
193 bg_alpha=0.3,<br />
194 fg_colour=0x888888,<br />
195 fg_alpha=0.5,<br />
196 x=230, y=452,<br />
197 radius=20,<br />
198 thickness=5,<br />
199 start_angle=-90,<br />
200 end_angle=180<br />
201 },<br />
202 {<br />
203 name='totaldown',<br />
204 arg='ppp0',<br />
205 max=2,<br />
206 bg_colour=0x888888,<br />
207 bg_alpha=0.3,<br />
208 fg_colour=0x888888,<br />
209 fg_alpha=0.5,<br />
210 x=230, y=452,<br />
211 radius=26,<br />
212 thickness=5,<br />
213 start_angle=-90,<br />
214 end_angle=180<br />
215 },<br />
216 {<br />
217 name='nvidia',<br />
218 arg='gpufreq',<br />
219 max=475,<br />
220 bg_colour=0x888888,<br />
221 bg_alpha=0.3,<br />
222 fg_colour=0x888888,<br />
223 fg_alpha=0.5,<br />
224 x=200, y=401,<br />
225 radius=26,<br />
226 thickness=5,<br />
227 start_angle=-90,<br />
228 end_angle=180<br />
229 },<br />
230 {<br />
231 name='nvidia',<br />
232 arg='memfreq',<br />
233 max=700,<br />
234 bg_colour=0x888888,<br />
235 bg_alpha=0.3,<br />
236 fg_colour=0x888888,<br />
237 fg_alpha=0.5,<br />
238 x=200, y=401,<br />
239 radius=20,<br />
240 thickness=5,<br />
241 start_angle=-90,<br />
242 end_angle=180<br />
243 },<br />
244 }<br />
245 <br />
246 require 'cairo'<br />
247 <br />
248 function rgb_to_r_g_b(colour,alpha)<br />
249 return ((colour / 0x10000) % 0x100) / 255., ((colour / 0x100) % 0x100) / 255., (colour % 0x100) / 255., alpha<br />
250 end<br />
251 <br />
252 function draw_ring(cr,t,pt)<br />
253 local w,h=conky_window.width,conky_window.height<br />
254 <br />
255 local xc,yc,ring_r,ring_w,sa,ea=pt['x'],pt['y'],pt['radius'],pt['thickness'],pt['start_angle'],pt['end_angle']<br />
256 local bgc, bga, fgc, fga=pt['bg_colour'], pt['bg_alpha'], pt['fg_colour'], pt['fg_alpha']<br />
257 <br />
258 local angle_0=sa*(2*math.pi/360)-math.pi/2<br />
259 local angle_f=ea*(2*math.pi/360)-math.pi/2<br />
260 local t_arc=t*(angle_f-angle_0)<br />
261 <br />
262 -- Draw background ring<br />
263 <br />
264 cairo_arc(cr,xc,yc,ring_r,angle_0,angle_f)<br />
265 cairo_set_source_rgba(cr,rgb_to_r_g_b(bgc,bga))<br />
266 cairo_set_line_width(cr,ring_w)<br />
267 cairo_stroke(cr)<br />
268 <br />
269 -- Draw indicator ring<br />
270 <br />
271 cairo_arc(cr,xc,yc,ring_r,angle_0,angle_0+t_arc)<br />
272 cairo_set_source_rgba(cr,rgb_to_r_g_b(fgc,fga))<br />
273 cairo_stroke(cr)<br />
274 end<br />
275 <br />
276 function conky_ring_stats()<br />
277 local function setup_rings(cr,pt)<br />
278 local str=''<br />
279 local value=0<br />
280 <br />
281 str=string.format('${%s %s}',pt['name'],pt['arg'])<br />
282 str=conky_parse(str)<br />
283 <br />
284 value=tonumber(str)<br />
285 if value == nil then value = 0 end<br />
286 pct=value/pt['max']<br />
287 <br />
288 draw_ring(cr,pct,p<nowiki><nowiki>Insert non-formatted text here</nowiki>'''Bold text'''</nowiki>t)<br />
289 end<br />
290 <br />
291 if conky_window==nil then return end<br />
292 local cs=cairo_xlib_surface_create(conky_window.display,conky_window.drawable,conky_window.visual, conky_window.width,conky_w indow.height)<br />
293 <br />
294 local cr=cairo_create(cs)<br />
295 <br />
296 local updates=conky_parse('${updates}')<br />
297 update_num=tonumber(updates)<br />
298 <br />
299 if update_num>5 then<br />
300 for i in pairs(settings_table) do<br />
301 setup_rings(cr,settings_table[i])<br />
302 end<br />
303 end<br />
304 end<br />
~ <br />
</pre><br />
== A note about symbolic fonts ==<br />
<br />
Many of the more decorated .conkyrc's use the fonts PizzaDude Bullets and Pie Charts for Maps. They are available from the AUR as 'ttf-pizzadude-bullets' and 'ttf-piechartsformaps' respectively, or they can be found and downloaded with a quick search and manually installed using the instructions in [[Fonts]].<br />
<br />
== Universal method to enable true transparency ==<br />
<br />
Transparency is a strange beast in Conky, but there is a way to universally apply true transparency with any environment or window manager by using xcompmgr and transset-df. Install xcompmgr from [extra] and transset-df from [community] with {{Codeline|pacman -Sy xcompmgr transset-df}}. These packages both have the same 3 dependencies, so this is the lightest method for composition available, for those of you using standalone window managers in order to achieve the leanest setup you can manage (or whatever reason you have :D)<br />
<br />
Check xcompmgr documentation to help you decide which compositing options you would like to enable. The following is a common standard command.<br />
<br />
<pre><br />
xcompmgr -c -t-5 -l-5 -r4.2 -o.55 &<br />
</pre><br />
<br />
Make sure conky is running with {{Codeline|conky &}}. Use transset-df to enable transparency on the Conky window. Set '.5' to any value in the range 0 - 1.<br />
<br />
<pre><br />
transset-df .5 -n Conky<br />
</pre><br />
<br />
This should give your conky window true transparency. If you get an error like, <br />
{{Command|name=transset-df .5 -n Conky|output=No Window matching Conky exists!}}<br />
Verify that conky is running, and use xprop and click on the conky window to find the name you should pass to {{Codeline|transset-df}}. <br />
{{Command|name=xprop &#124; grep WM_NAME|output=WM_NAME(STRING) = "Conky (ArchitectLinux)"}}<br />
<br />
In this case, "Conky" is right, but for you it may be different, so be sure to use your output instead.<br />
<br />
Use this in ~/.xinitrc to have transparent conky run when you {{Codeline|startx}}.<br />
<br />
<pre><br />
xcompmgr -c -t-5 -l-5 -r4.2 -o.55 &<br />
conky -d; sleep 1 && transset-df .5 -n Conky<br />
</pre><br />
== External links ==<br />
*[http://bbs.archlinux.org/viewtopic.php?id=39906 Conky Configs on arch forums]<br />
*[http://conky.sourceforge.net/ Official website]<br />
*[http://freshmeat.net/projects/conky/ Conky] on [[wikipedia:Freshmeat|Freshmeat]]<br />
*[http://sourceforge.net/projects/conky/ Conky] on [[wikipedia:sourceforge.net|SourceForge]]<br />
*[irc://chat.freenode.org/conky #conky] IRC chat channel on [[wikipedia:Freenode|freenode]]<br />
*[http://novel.evilcoder.org/wiki/index.php?title=ConkyFAQ&oldid=12463 FAQ]</div>Zendeavor