https://wiki.archlinux.org/api.php?action=feedcontributions&user=Rent0n&feedformat=atomArchWiki - User contributions [en]2024-03-19T01:08:53ZUser contributionsMediaWiki 1.41.0https://wiki.archlinux.org/index.php?title=Dropbox&diff=112713Dropbox2010-07-27T17:48:10Z<p>Rent0n: </p>
<hr />
<div>[[Category:HOWTOs (English)]]<br />
[https://www.dropbox.com Dropbox] is a file sharing system that recently introduced a GNU/Linux client. Use it to transparently sync files across computers and architectures. Simply drop files into your "~/Dropbox" folder, and they will automatically sync to your centralized repository.<br />
<br />
==Installation Using an AUR Helper==<br />
<br />
The GNU/Linux Dropbox client is packaged both as a stand-alone binary and a Nautilus plugin. The package names in the [[AUR]] are either "[http://aur.archlinux.org/packages.php?ID=23363 dropbox]" or "[http://aur.archlinux.org/packages.php?ID=19615 nautilus-dropbox]".<br />
<br />
#You can use an [[AUR helper]] to easily install Dropbox.<br />
#*If you installed the stand-alone version ("dropbox"), you can now look for Dropbox in your application menu or run "dropboxd" from the command-line. The client icon will appear in the system tray.<br />
#*If you installed the Nautilus plugin ("nautilus-dropbox"), restart Nautilus. You will see the Dropbox icon in your panel.<br />
#Eventually a popup will ask you to login to your Dropbox account, or start a new one. Enter your credentials.<br />
#After some time you will see a "Welcome to Dropbox" popup, which will give you the opportunity to view a short tour of Dropbox.<br />
#Press the "Finish and go to My Dropbox".<br />
<br />
To use it, simply drag and drop files into your "Dropbox" folder.<br />
<br />
==Installation from Source==<br />
<br />
If you prefer compiling from source, Dropbox's Nautilus plug-in compiles perfectly on Arch. <br />
<br />
#Make sure you have or install nautilus, python, pygtk, glib2, docutils, pkg-config, and libnotify from pacman. These are necessary to compile Dropbox.<br />
#Download the .tar.gz from [http://www.getdropbox.com/downloading?os=lnx Dropbox's website]<br />
#Navigate to where you downloaded the file.<br />
#Extract the file<br />
$ bunzip2 nautilus-dropbox-0.6.1.tar.bz2<br />
$ tar xvf nautilus-dropbox-0.6.1.tar<br />
#Navigate to the "nautilus-dropbox" directory<br />
#Configure, and check the output for missing dependencies.<br />
$ ./configure<br />
#If the configure went well, make.<br />
$ make<br />
#Provided the compilation completed successfully, install Dropbox<br />
$ sudo make install<br />
#Now start the Dropbox, and tell it to install the proprietary daemon<br />
$ /usr/bin/dropbox start -i<br />
#It will download, unpack, and install the daemon, then launch the configuration wizard. Enter your details.<br />
<br />
Dropbox should now be running, and syncing with the Dropbox servers. Now you can use dropbox just as if you automatically installed it using an AUR helper, but now with a smug feeling of contentment.<br />
<br />
==Without Nautilus==<br />
<br />
If you happen to not use the Gnome desktop environment, you may not want to use Nautilus. <br />
<br />
As of Dropbox 0.7.110, no special steps are needed to use Dropbox without Nautilus. <br />
<br />
1. Extract Dropbox in your $HOME folder.<br />
<br />
2. Execute ".dropbox-dist/dropbox".<br />
<br />
3. A window will open that allows you to link your computer and select the Dropbox folder location.<br />
<br />
That's it!<br />
<br />
-----------------------------------------------------------------------------------------<br />
<br />
The following instructions are taken from the dropbox tips and tricks [http://wiki.getdropbox.com/TipsAndTricks/TextBasedLinuxInstall website] and enable you to share your ~/Dropbox folder without bringing in those gnome dependencies.<br />
<br />
<br />
<br />
First, download the Dropbox standalone client for [http://www.getdropbox.com/download?plat=lnx.x86 32bit] or [http://www.getdropbox.com/download?plat=lnx.x86_64 64bit]. Put it in your home directory.<br />
<br />
Note: i've been having problems of late, downloading the experimental build from [http://forums.getdropbox.com/topic.php?id=7220 here] solved it for me on two machine so far.<br />
<br />
While in your home directory, extract the downloaded tarball.<br />
$ cd<br />
$ tar zxof dropbox*.tar.gz<br />
<br />
Next, use wget to download a few scripts needed to get around those nautilus requirements:<br />
$ wget http://dl.getdropbox.com/u/6995/dbmakefakelib.py<br />
$ wget http://dl.getdropbox.com/u/6995/dbreadconfig.py<br />
<br />
Run the first script and check for the following output:<br />
$ python dbmakefakelib.py<br />
dropboxd ran for 15 seconds without quitting - success?<br />
<br />
Now run the second script to get some info required to register your client:<br />
$ python dbreadconfig.py<br />
host_id = 739bfe362f3bb3246da99dc8d20dbe2b<br />
last_revision = None<br />
schema_version = 6<br />
<br />
The important line here is the host_id. Go to https://www.getdropbox.com/cli_link?host_id=HOSTID (replacing HOSTID with the string from above) and follow the steps to register your client.<br />
<br />
There should now be three directories in your home directory called: ".dropbox-dist", ".dropbox", and "Dropbox". Create ~/Dropbox if it doesn't exist.<br />
<br />
You can start the dropbox client with the following command:<br />
$ ~/.dropbox-dist/dropboxd &<br />
<br />
Move files into "Dropbox" to sync them.<br />
".dropbox" holds configuration databases and caches for Dropbox. Don't touch this.<br />
<br />
At this point, you can continue using the dropbox daemon as is, placing the above command in some sort of startup script. If you would rather dropbox run as a daemon like sshd or vsftpd, simply do the following:<br />
<br />
As root, copy this into a file called /etc/rc.d/dropboxd; replace all occurrences of USER, obviously.<br />
<br />
<pre><br />
#!/bin/bash<br />
<br />
. /etc/rc.conf<br />
. /etc/rc.d/functions<br />
<br />
PID=`pidof -o %PPID /home/USER/.dropbox-dist/dropbox`<br />
<br />
case "$1" in<br />
start)<br />
stat_busy "Starting Dropbox Service"<br />
[ -z "$PID" ] && su -c "/home/USER/.dropbox-dist/dropboxd &" USER<br />
if [ $? -gt 0 ]; then<br />
stat_fail<br />
else<br />
add_daemon dropboxd<br />
stat_done<br />
fi<br />
;;<br />
stop)<br />
stat_busy "Stopping Dropbox Service"<br />
[ ! -z "$PID" ] && kill $PID > /dev/null<br />
if [ $? -gt 0 ]; then<br />
stat_fail<br />
else<br />
rm_daemon dropboxd<br />
stat_done<br />
fi<br />
;;<br />
restart)<br />
$0 stop<br />
sleep 3<br />
$0 start<br />
;;<br />
*)<br />
echo "usage: $0 {start|stop|restart}"<br />
;;<br />
esac<br />
exit 0<br />
</pre><br />
<br />
Make the file executable with<br />
sudo chmod +x /etc/rc.d/dropboxd<br />
<br />
This allows you to start or stop dropboxd just like any other service. place it in the daemons array in rc.conf for it to start at boot.<br />
<br />
sudo /etc/rc.d/dropboxd start<br />
sudo /etc/rc.d/dropboxd stop<br />
sudo /etc/rc.d/dropboxd restart<br />
<br />
And in rc.conf:<br />
DAEMONS=(syslog-ng network sensors hal @fcron @openntpd @alsa @dropboxd !icecast !mpd)<br />
<br />
==Without Nautilus (Another Way)==<br />
<br />
Another way to use Dropbox without Nautilus but with another file manager like Thunar is described below:<br />
<br />
1. Download and install the [http://aur.archlinux.org/packages.php?ID=23363 dropbox] package from the AUR.<br />
$ aurget dropbox<br />
<br />
2. Create a fake Nautilus script that will launch Thunar:<br />
$ sudo touch /usr/bin/nautilus && sudo chmod +x /usr/bin/nautilus && sudo nano /usr/bin/nautilus<br />
<br />
3. Insert this text into the file, then save and exit:<br />
#!/bin/bash<br />
exec thunar $@<br />
exit 0<br />
<br />
4. Launch Dropbox<br />
$ dropboxd<br />
<br />
5. Click on the dropbox tray icon to open your dropbox folder in Thunar.<br />
<br />
'''Note:''' in this way there is no need to create a dropbox daemon in /etc/rc.d and to start it at boot via /etc/rc.conf or to make it start via your session manager: just leave the "Start dropbox on system startup" option flagged in the Preferences window.<br />
<br />
'''Note:''' If you already have nautilus instaled but don't want to use it, neither modify the existing file under /usr/bin, just change the /usr/bin for /opt/dropbox in the step 2 above, like this: $ sudo touch /opt/dropbox/nautilus && sudo chmod +x /opt/dropbox/nautilus && sudo nano /opt/dropbox/nautilus. Dropbox will look this path first!<br />
<br />
== Alternative to install: use the web interface ==<br />
<br />
If all you need is basic access to the files in a dropbox, you can use the web interface at http://getdropbox.com to upload and download files to your dropbox. This can be a viable alternative to running a dropbox daemon and mirroring all the files on your own machine.<br />
<br />
==Securing your Dropbox==<br />
<br />
If you want to store sensitive data in your Dropbox, you should encrypt it before. Syncing to Dropbox is encrypted, but all files are (for the time being) stored on the server just as you put them in your Dropbox.<br />
<br />
* Dropbox works with [[Truecrypt]], and after you initially uploaded the Truecrypt volume to Dropbox, performance is quite ok, because of Dropbox has a working binary diff.<br />
<br />
* Another possibility is to use [[EncFS]], which has the advantage that all files are encrypted separately, i.e. you don't have to determine in advance the size of the content you want to encrypt and your encrypted directory grows and shrinks while you add/delete/modify files in it. You can also mount an encrypted volume at startup using the -S option of encfs to avoid having to input the passphrase, but note that your encrypted files are not secure from someone who has direct access to your computer.</div>Rent0nhttps://wiki.archlinux.org/index.php?title=Openbox&diff=112428Openbox2010-07-21T14:37:27Z<p>Rent0n: /* Resources */</p>
<hr />
<div>[[Category:Stacking WMs (English)]]<br />
[[Category:HOWTOs (English)]]<br />
{{i18n|Openbox}}<br />
<br />
Openbox is a lightweight and highly configurable window manager with extensive standards support. Its features are well-documented at the [http://openbox.org/ official website]. This article will pertain to running Openbox under Arch Linux.<br />
<br />
== Installation ==<br />
<br />
Openbox is available from the standard repositories:<br />
# pacman -S openbox<br />
<br />
Once installed, pacman will direct you to copy the default {{Filename|menu.xml}} and {{Filename|rc.xml}} configuration files to <tt>~/.config/openbox/</tt>, for example: <br />
<br />
{{Note | Do this as a regular user, not as root.}}<br />
<br />
$ mkdir -p ~/.config/openbox/<br />
$ cp /etc/xdg/openbox/rc.xml ~/.config/openbox/rc.xml<br />
$ cp /etc/xdg/openbox/menu.xml ~/.config/openbox/menu.xml<br />
<br />
{{Filename|rc.xml}} is the core configuration file for Openbox. It is used to manage keyboard shortcuts, themes, virtual desktops and other features.<br />
<br />
{{Filename|menu.xml}} controls the Openbox application menu that appears when you click on your desktop. The default items are pretty sparse, but it's very easy to modify the menu structure to suit your needs. See the menu section below for more details, or visit the [http://icculus.org/openbox/ Openbox website].<br />
<br />
== Stand-alone window manager ==<br />
<br />
To run Openbox on its own, simply add the following to the bottom of {{Filename|~/.xinitrc}}:<br />
exec openbox-session<br />
<br />
If you have used another window manager before, such as Xfce, and Openbox won't start after logging out of X, try moving the autostart folder:<br />
mv ~/.config/autostart ~/.config/autostart-bak<br />
<br />
Using D-Bus/HAL or similar, use this instead:<br />
exec ck-launch-session openbox-session<br />
<br />
If you use also '''polkit''' and '''D-Bus''' (e.g. for automount drivers in nautilus from Gnome 2.28 / 2.30) use:<br />
exec ck-launch-session dbus-launch openbox-session<br />
<br />
{{Note | [http://www.archlinux.org/packages/extra/i686/pyxdg/ pyxdg] is required for Openbox's xdg-autostart}}<br />
<br />
== Window manager for Desktop Environments ==<br />
<br />
=== GNOME ===<br />
==== GNOME 2.26 ====<br />
'''''Follow the next guide for GNOME 2.24. If it fails try this:'''''<br />
<br />
If after installing openbox and trying to log into the 'Gnome/openbox' session but it always fails then you can do the following as one way to achieve running openbox as your window manager every time you log into the 'Gnome' session from your login manager (xdm, gdm, kdm, entrance, slim, etc.)<br />
<br />
#Log into your Gnome only session (which would still be using metacity as its window manager) if you aren't already.<br />
#Install openbox if you have not done so already<br />
#Explore your menus to ''System &rarr; Preferences &rarr; Startup Applications'' (possibly named 'Session' for older versions of Gnome)<br />
#Open Startup Application, select '+ Add' and enter the text as seen in the box below whilst omitting the text behind the #.<br />
#Now hit the 'Add' button for that data entry window and make sure the checkbox beside your new entry is selected.<br />
#Thus log out of your gnome session and log back in and you should be running openbox as your window manager.<br />
#Enjoy!<br />
<br />
Name: Openbox Windox Manager # Can be changed<br />
Command: openbox --replace # Text should not be removed from this line, but possibly added to it<br />
Comment: Replaces metacity with openbox # Can be changed<br />
<br />
This creates an entry in a startup list which is executed by gnome everytime that particular user's gnome-session is started.<br />
<br />
==== GNOME 2.24 ====<br />
First, create {{Filename|/usr/share/applications/openbox.desktop}} containing the following:<br />
[Desktop Entry]<br />
Type=Application<br />
Encoding=UTF-8<br />
Name=OpenBox<br />
Exec=openbox<br />
NoDisplay=true<br />
# name of loadable control center module<br />
X-GNOME-WMSettingsModule=openbox<br />
# name we put on the WM spec check window<br />
X-GNOME-WMName=OpenBox<br />
Then, in gconf, set '''/desktop/gnome/session/required_components/windowmanager''' to '''openbox''':<br />
$ gconftool-2 -s -t string /desktop/gnome/session/required_components/windowmanager openbox<br />
Finally, choose the '''GNOME''' session in the GDM sessions menu.<br />
<br />
==== GNOME 2.22 and previous ====<br />
# If you use GDM, select the "GNOME/Openbox" login option<br />
# If you use startx, add {{Codeline|exec openbox-gnome-session}} to {{Filename|~/.xinitrc}}<br />
# From the shell:<br />
$ xinit /usr/bin/openbox-gnome-session<br />
<br />
=== KDE ===<br />
# If you use KDM, select the "KDE/Openbox" login option<br />
# If you use startx, add {{Codeline|exec openbox-kde-session}} to {{Filename|~/.xinitrc}}<br />
# From the shell:<br />
$ xinit /usr/bin/openbox-kde-session<br />
<br />
=== Xfce4 ===<br />
Log into a normal Xfce4 session. From your terminal of choice, do:<br />
$ killall xfwm4 ; openbox & exit<br />
<br />
This will kill xfwm4, run Openbox, and close the terminal. <br />
<br />
Log out, making sure to check the "Save session for future logins" checkbox. On next login, Xfce4 will use Openbox as its WM. To be able to exit the session using xfce4-session, open your file {{Filename|~/.config/openbox/menu.xml}} (if it isn't there, copy it from {{Filename|/etc/xdg/openbox/menu.xml}}). <br />
<br />
Look for the entry:<br />
<br />
<item label="Exit Openbox"><br />
<action name="Exit"><br />
<prompt>yes</prompt><br />
</action><br />
</item><br />
<br />
and change it to:<br />
<br />
<item label="Exit Openbox"><br />
<action name="Execute"><br />
<prompt>yes</prompt><br />
<command>xfce4-session-logout</command><br />
</action><br />
</item><br />
<br />
Otherwise, using the "Exit" entry of the root-menu will cause Openbox to terminate its execution, leaving you without a window manager.<br />
<br />
If you have an issue changing between virtual desktops with the mouse wheel skipping over virtual desktops, open your {{Filename|~/.config/openbox/rc.xml}} file and move the mouse binds with actions "DesktopPrevious" and "DesktopNext" from the context "Desktop" to the context "Root" (you may need to define the Root context).<br />
<br />
If you want to use the Openbox root-menu instead of Xfce's, you may terminate Xfdesktop by running the following command in a terminal:<br />
$ xfdesktop --quit<br />
<br />
However, Xfdesktop manages the wallpaper and desktop icons, requiring you to use other utilities, such as ROX, for these functions.<br />
<br />
(When terminating Xfdesktop, the above issue with the virtual desktops is no longer a problem.)<br />
<br />
== Preferences ==<br />
<br />
Currently, there are two options for configuring the core Openbox preferences; manually edit the {{Filename|rc.xml}}, or use the ObConf tool.<br />
<br />
=== Manual configuration ===<br />
<br />
To configure Openbox manually, simply edit {{Filename|~/.config/openbox/rc.xml}} with your favorite text editor. The config file provides plenty of comments throughout, and [http://openbox.org/wiki/Configuration full documentation] is available at the official website.<br />
<br />
=== ObConf ===<br />
<br />
[http://icculus.org/openbox/index.php/ObConf:About ObConf] is GUI-based Openbox configuration tool, which can be used to set most preferences including themes, virtual desktops, window properties and desktop margins.<br />
<br />
To install ObConf, run:<br />
# pacman -S obconf<br />
<br />
{{Note | ObConf cannot be used to configure keyboard shortcuts and some other advanced features. For these modifications, you must edit {{Filename|rc.xml}} manually (see above). Other option is [http://code.google.com/p/obkey/ ObKey] application (available in [[AUR]]).}}<br />
<br />
=== Application configuration ===<br />
<br />
Openbox features per-application settings, allowing you to define rules for your programs. For example, you can:<br />
* load your web browser on a certain desktop<br />
* load your terminal without a window border<br />
* load your torrent client at a certain position on your screen<br />
<br />
These are defined in {{Filename|~/.config/openbox/rc.xml}}. As you might expect, the instructions are well-documented within the file itself. Full details can also be found here: http://openbox.org/wiki/Help:Applications<br />
<br />
== Menus ==<br />
<br />
The default Openbox menu includes a variety of applications to get you started, but you'll probably want to customize this at some point. There are a number of ways to do so:<br />
<br />
=== Manual configuration ===<br />
<br />
Similar to the {{Filename|rc.xml}} file, you can edit {{Filename|~/.config/openbox/menu.xml}} with your favourite text editor. Although many of the settings are self-explanatory, [http://openbox.org/wiki/Help:Menus full documentation] is available.<br />
<br />
=== MenuMaker ===<br />
<br />
[http://menumaker.sourceforge.net/ MenuMaker] is a powerful tool that creates XML-based menus for a variety of Window Managers, including Openbox. MenuMaker will search your computer for executable programs and create an XML menu based on the results. It can be configured to exclude Legacy X, GNOME, KDE, or Xfce applications if the user desires.<br />
<br />
MenuMaker is available in the community repository:<br />
# pacman -S menumaker<br />
<br />
Once installed, you can generate a complete menu by running:<br />
$ mmaker -v OpenBox3<br />
<br />
By default, MenuMaker will not overwrite an existing menu.xml. To do so, run it with the -f (force) argument:<br />
<br />
$ mmaker -vf OpenBox3<br />
<br />
To see a full list of options, run {{Codeline|mmaker --help}}.<br />
<br />
This will give you a pretty thorough menu. Now you can modify the menu.xml by hand, or simply regenerate the list whenever you install new software.<br />
<br />
=== Obmenu ===<br />
<br />
Obmenu is a GUI-based menu editor for Openbox. For those who don't enjoy editing XML source code, this is probably the best option for you.<br />
<br />
It is available in the community repository:<br />
# pacman -S obmenu<br />
<br />
Once installed, simply run {{Codeline|obmenu}} and add or remove the desired applications.<br />
<br />
==== Obm-xdg ====<br />
<br />
<tt>obm-xdg</tt> is a command-line tool that comes with Obmenu. It can generate a categorized sub-menu of installed GTK/GNOME applications.<br />
<br />
To use obm-xdg, add the following line to {{Filename|~/.config/openbox/menu.xml}}:<br />
<menu execute="obm-xdg" id="xdg-menu" label="xdg"/><br />
<br />
Then run {{Codeline|openbox --reconfigure}} to refresh the Openbox menu. You should now see a sub-menu labeled '''xdg''' in your menu.<br />
<br />
{{Note | If you do not have GNOME installed, then you need to install '''gnome-menus''' package for obm-xdg to work.}}<br />
<br />
=== Python based xdg menu script ===<br />
<br />
This script can be found in Fedora's Openbox package. You will only have to put the script somewhere and add a menu entry.<br />
<br />
Here is my paste: http://pastebin.com/f2f827625<br />
And here is the head: http://cvs.fedoraproject.org/viewvc/devel/openbox/xdg-menu?view=markup<br />
<br />
Download the one you like (maybe you'll prefer the head version of course). You can put the file anywhere, I used ~/Documents/build/xdg-menu (just modify the menu entry later according to YOUR filename/path.)<br />
<br />
Then open your menu.xml with your favourite text editor and add the following entry where you want the new menu (of course, you can modify the label however you want):<br />
<menu id="apps-menu" label="xdgmenu" execute="python /home/shiki/Documents/build/xdg-menu"/><br />
<br />
Save the file, and run: {{Codeline|openbox --reconfigure}}.<br />
<br />
=== Pipe menus ===<br />
<br />
Openbox (and other WMs like WindowMaker and PekWM) allow you to write scripts that dynamically build menus on the fly. Some examples are system monitors, media player controls, and weather forecasts. Many examples can be found on the openbox [http://openbox.org/wiki/Openbox:Pipemenus site].<br />
<br />
Xyne has also created a file browser and brisbin33 has one for scanning for / connecting to wireless hot spots (requires netcfg). The relevant forum posts for these utilities are [http://bbs.archlinux.org/viewtopic.php?id=77197&p=1 here] and [http://bbs.archlinux.org/viewtopic.php?id=78290 here]<br />
<br />
== Startup programs ==<br />
<br />
Openbox features support for running programs at startup. This is provided by the "openbox-session" command.<br />
<br />
There are two ways to enable autostart:<br />
# If you use startx/xinit to log into your X session, edit {{Filename|~/.xinitrc}} and change the line that executes ''openbox'' to execute '''openbox-session''' instead.<br />
# If you log in with GDM/KDM, then select the ''Openbox'' session and it will automatically use autostart.<br />
<br />
Startup programs are managed in {{Filename|~/.config/openbox/autostart.sh}}. Full instructions and best practices for how to do this are available at the [http://openbox.org/wiki/Help:Autostart Openbox website].<br />
<br />
== Themes and appearance ==<br />
<br />
With the exception of the Openbox Themes topic, the following section is intended for users who have configured Openbox to run as a standalone desktop, without the assistance of GNOME, KDE or Xfce.<br />
<br />
=== Openbox themes ===<br />
<br />
Openbox themes control the appearance of window borders, including the titlebar and titlebar buttons. They also determine the appearance of the application menu and on-screen display (OSD). <br />
<br />
Additional themes are available from the standard repositories:<br />
<br />
# pacman -S openbox-themes<br />
<br />
This package is by no means definitive. You can download more themes at websites such as:<br />
*[http://www.box-look.org/index.php?xcontentmode=7402 box-look.org]<br />
*[http://customize.org/browse/tags/openbox customize.org]<br />
*http://www.minuslab.net/themes/<br />
*http://celo.wordpress.com/themes/<br />
*http://vault.openmonkey.com/pages/openbox<br />
*http://hewphoria.com/?p=submission&type=theme&cat=7<br />
<br />
Downloaded themes should be extracted to <tt>~/.themes</tt> and can be installed or selected with the [[Openbox#Preferences|ObConf]] tool.<br />
<br />
Creating new themes is fairly easy and again [http://icculus.org/openbox/index.php/Help:Themes well-documented].<br />
<br />
For a GUI theme editor, take a look at [http://xyne.archlinux.ca/info/obtheme ObTheme].<br />
<br />
=== X11 Appearance ===<br />
<br />
If you are running Openbox as a standalone, you will need to configure .Xdefaults file.<br />
Save a copy to ~/.Xdefaults and /home/root/.Xdefaults for windows opened as Root.<br />
<br />
Xdefaults is a user-level configuration dotfile, typically located at ~/.Xdefaults. When present, it is parsed by the xrdb (Xorg resource database) program automatically when Xorg is started, and can be used to set or override preferences for X and X applications. It can do many operations, including:<br />
<br />
- defining terminal colours<br />
- configuring terminal preferences<br />
- setting DPI, antialiasing, hinting and other X font settings<br />
- changing the Xcursor theme<br />
- theming xscreensaver<br />
- altering preferences on low-level X applications (xclock, xpdf, etc.) <br />
<br />
Xdefaults Arch WiKi<br />
http://wiki.archlinux.org/index.php/Xdefaults<br />
<br />
=== X11 Mouse cursors ===<br />
<br />
Extract the desired Xcursor theme to either <tt>/usr/share/icons</tt> (system-wide access) or <tt>~/.icons</tt> (local user access). There are also a limited amount of themes available in the community repository that can be installed using pacman.<br />
<br />
Add this to {{Filename|~/.Xdefaults}}:<br />
Xcursor.theme: [name-of-cursor-theme]<br />
where {{Codeline|[name-of-cursor-theme]}} is the name of the cursor theme directory. For example:<br />
Xcursor.theme: Vanilla-DMZ-AA<br />
To change the size:<br />
Xcursor.size: [size]<br />
Sometimes it is required to symlink the icon directory into each user directory to make the window manager use them:<br />
$ mkdir ~/.icons<br />
$ ln -s /usr/share/icons/[name-of-cursor-theme] ~/.icons/default<br />
<br />
For more information read the Arch WiKi<br />
http://wiki.archlinux.org/index.php/X11_Cursors<br />
<br />
=== GTK Themes ===<br />
<br />
==== GTK2/GTK+ ====<br />
<br />
First, extract the desired theme to <tt>/usr/share/themes</tt> (system-wide access) or <tt>~/.themes</tt> (local user access), then:<br />
<br />
GTK+ themes can be managed easily with the '''[[LXDE | lxappearance]]''', '''gtk-chtheme''', or '''switch2''' utilities. To install, run:<br />
# pacman -S lxappearance<br />
and/or<br />
# pacman -S gtk-chtheme<br />
and/or<br />
# pacman -S gtk-theme-switch2<br />
<br />
Now you can simply run {{Codeline|lxappearance}}, {{Codeline|gtk-chtheme}} or {{Codeline|switch2}} to set the desired theme.<br />
<br />
==== GTK1 ====<br />
For legacy GTK1 themes, install the '''gtk-theme-switch''' package:<br />
# pacman -S gtk-theme-switch<br />
Then run {{Codeline|switch}} to select a desired theme.<br />
<br />
==== GTK fonts ====<br />
<br />
To manually change the type and size of your fonts, add the following to {{Filename|~/.gtkrc.mine}}:<br />
style "user-font"<br />
{<br />
font_name = "[font-name] [size]"<br />
}<br />
widget_class "*" style "user-font"<br />
gtk-font-name = "[font-name] [size]"<br />
<br />
where {{Codeline|[font-name] [size]}} is the desired font and point size. For example:<br />
style "user-font"<br />
{<br />
font_name = "DejaVu Sans 8"<br />
}<br />
widget_class "*" style "user-font"<br />
gtk-font-name = "DejaVu Sans 8"<br />
<br />
Both {{Codeline|font_name}} and {{Codeline|gtk-font-name}} fields are required for backwards compatibility.<br />
<br />
You can also use '''gtk-chtheme''' or '''lxappearance''' to set GTK font settings. Please refer to the above section.<br />
<br />
==== GTK Icons ====<br />
<br />
First, extract the desired icon theme to <tt>/usr/share/icons</tt> (system-wide access) or <tt>~/.icons</tt> (local user access), then:<br />
<br />
Add the following to {{Filename|~/.gtkrc.mine}}: <br />
gtk-icon-theme-name = "[name-of-icon-theme]"<br />
<br />
where {{Codeline|[name-of-icon-theme]}} is the name of the icon theme directory. For example:<br />
gtk-icon-theme-name = "Tango"<br />
<br />
Ensure {{Filename|~/.gtkrc-2.0}} is configured to parse {{Filename|~/.gtkrc.mine}}:<br />
<br />
# ~/.gtkrc-2.0<br />
# -- THEME AUTO-WRITTEN DO NOT EDIT<br />
include "/usr/share/themes/Rezlooks-Gilouche/gtk-2.0/gtkrc"<br />
include "/home/username/.gtkrc.mine"<br />
# -- THEME AUTO-WRITTEN DO NOT EDIT<br />
<br />
You can use '''lxappearance''' to choose GTK icon themes. Please refer to the above section.<br />
<br />
=== Desktop icons ===<br />
Openbox does not provide a means to display icons on the desktop. Xfdesktop, PcmanFM, [http://rox.sourceforge.net ROX], [http://idesk.sourceforge.net iDesk], or even Nautilus (and the gnome-settings-daemon) can provide this function. <br />
<br />
ROX and PCmanFM have the additional advantage of being lightweight file managers.<br />
<br />
=== Desktop wallpaper ===<br />
<br />
Openbox itself does not include a way to change the wallpaper. This can be done easily with programs like [[Feh]] or [[Nitrogen]]. Other options include ImageMagick, hsetroot and xsetbg. Or Pcmanfm and Xfdesktop can do it too.<br />
<br />
== Recommended programs ==<br />
<br />
There is [[Lightweight Applications|list of Lightweight Software]] at Arch's wiki, most of them nicely fits with Openbox.<br />
<br />
=== Login managers ===<br />
<br />
[http://slim.berlios.de/ SLiM] provides a lightweight and elegant graphical login solution for standalone Openbox configurations. Refer to Arch's [[SLiM]] wiki for detailed instructions.<br />
<br />
[http://qingy.sourceforge.net/ Qingy] is ultralight and very configurable graphical login. It support login to both console and X Windows sessions. It uses [http://www.directfb.org DirectFB], therefore it does not start X Windows unless you choose X Windows session. See article about [[Qingy]] at Arch's wiki.<br />
<br />
=== Composite desktop ===<br />
<br />
[[Xcompmgr]] is a lightweight composite manager capable of rendering drop shadows, fading and simple window transparency within Openbox and other window managers.<br />
(It's worth noting that xcompmgr is no longer developed, and so any issues are unlikely to be fixed)<br />
(Developed an issue with tint2 0.9, the systray icons have a tendency to corrupt)<br />
<br />
[[Cairo Compmgr | Cairo Composite Manager]] -- A versatile and extensible composite manager which uses cairo for rendering, is an alternative.<br />
<br />
=== Panels, trays, and pagers ===<br />
<br />
There are quite a lot of utilities available that provide a panel (taskbar), system tray, and pager to Openbox. The most common are:<br />
<br />
==== Panels ====<br />
* [[PyPanel]]<br />
* [http://nsf.110mb.com/bmpanel/ BMPanel]<br />
* [[tint2]]<br />
* [http://www.gnomefiles.org/app.php/LXPanel LXPanel]<br />
* [http://fbpanel.sourceforge.net fbpanel]<br />
* [http://freshmeat.net/projects/perlpanel/ PerlPanel]<br />
* [http://www.chatjunkies.org/fspanel/ fspanel]<br />
* [http://www.xfce.org/projects/xfce4-panel/ Xfce4-panel]<br />
* [http://live.gnome.org/GnomePanel/ GnomePanel]<br />
* [https://launchpad.net/awn avant-window-navigator]<br />
* [http://developer.berlios.de/projects/cairo-dock/ cairo-dock]<br />
* [http://code.google.com/p/wbar/ wbar]<br />
* [http://www.screenlets.org/ screenlets]<br />
* [http://www.failedprojects.de/pancake/ pancake]<br />
<br />
==== Trays ====<br />
* [http://stalonetray.sourceforge.net/ Stalonetray]<br />
* [http://download.gna.org/fvwm-crystal/trayer/1.0/ Trayer]<br />
<br />
==== Pagers ====<br />
* [http://projects.l3ib.org/trac/visibility Visibility]<br />
* [http://bbtools.sourceforge.net/ bbpager]<br />
* [http://aur.archlinux.org/packages.php?ID=17563 netwmpager]<br />
* [http://useperl.ru/ipager/index.en.html IPager]<br />
* [http://code.google.com/p/neap/ neap]<br />
<br />
Make your choice and add it to your startup file. If you wish to set the desktop layout without using a pager, you can use [http://aur.archlinux.org/packages.php?ID=34376 obsetlayout], which is a packaged version of the setlayout tool from the Openbox wiki.<br />
<br />
=== File managers ===<br />
<br />
There are many possibilities, but the most popular lightweight file managers are:<br />
* [[Thunar]]. Thunar supports auto-mount features and other plugins. <br />
* [http://rox.sourceforge.net ROX] (ROX provides desktop icons)<br />
# pacman -S rox<br />
* [http://pcmanfm.sourceforge.net PCManFM] (pcmanfm also provides desktop icons)<br />
# pacman -S pcmanfm<br />
To access NTFS drives with PCManFM, install ntfs-3g:<br />
# pacman -S ntfs-3g<br />
and make sure you're added to group hal:<br />
# gpasswd -a username hal<br />
For even lighter options, consider [http://www.obsession.se/gentoo/ Gentoo] or [http://emelfm2.net/ emelFM2], both of which use the familiar 'Midnight Commander' two pane layout.<br />
<br />
Others:<br />
Xfe<br />
muCommander<br />
''(Will edit it later after I have tried them both.)''<br />
<br />
Of course, you can also use GNOME's Nautilus. Although slower than the above solutions, it has the additional advantage of VFS support (e.g. remote SSH, FTP and Samba connections)<br />
<br />
=== Application launchers ===<br />
<br />
==== dmenu ====<br />
<br />
Set-up dmenu as described in the [[dmenu]] wiki article. Then, add the following entry to the <keyboard> section {{Filename|~/.config/openbox/rc.xml}} to enable a shortcut to launch dmenu:<br />
<keybind key="W-space"><br />
<action name="Execute"><br />
<execute>dmenu_run</execute><br />
</action><br />
</keybind><br />
<br />
==== Gmrun ====<br />
<br />
[http://sourceforge.net/projects/gmrun gmrun] provides an excellent Run dialog box, similar to the Alt+F2 features found in Gnome and KDE:<br />
# pacman -S gmrun<br />
Add the following entry to the <keyboard> section {{Filename|~/.config/openbox/rc.xml}} to enable Alt+F2 functionality:<br />
<keybind key="A-F2"><br />
<action name="execute"><execute>gmrun</execute></action><br />
</keybind><br />
<br />
==== Bashrun ====<br />
<br />
[http://bashrun.sourceforge.net bashrun] provides a different, barebones approach to a run dialog, using a specialized bash session within a small xterm window. It is available in the community repository and can be launched through the Alt+F2 style approach mentioned previously. To make bashrun act more like a traditional run dialog, add the following entry to the <applications> section {{Filename|~/.config/openbox/rc.xml}}:<br />
<application name="bashrun"><br />
<desktop>all</desktop><br />
<decor>no</decor> # switch to yes if you prefer a bordered window<br />
<focus>yes</focus><br />
<skip_pager>yes</skip_pager><br />
<layer>above</layer><br />
</application><br />
<br />
==== Launchy ====<br />
<br />
[http://www.launchy.net/ Launchy] is a less minimalistic approach; it is skinnable and offers more functionality such as a calculator, checking the weather, etc. Originally for Windows, similar to Gnome Do.<br />
# pacman -S launchy<br />
It is launched by Ctrl+Space key combination.<br />
<br />
==== LXPanel ====<br />
<br />
The LXPanel run dialog can be executed with <br />
lxpanelctl run<br />
<br />
==== gnome-panel ====<br />
<br />
The gnome-panel run dialog can be executed with <br />
gnome-panel-control --run-dialog<br />
<br />
=== Clipboard managers ===<br />
<br />
You may wish to install a clipboard manager for feature rich copy/paste ability. '''xfce4-clipman-plugin, parcellite,''' or '''glipper-old''' may be installed via pacman. Add your choice to autostart.sh. From the terminal, Ctrl+Insert as copy and Shift+Insert as paste generally works as well. You may also copy from terminal with Ctrl+Shift+C, and paste with mouse middle click.<br />
<br />
=== Volume managers ===<br />
<br />
==== gvolwheel ====<br />
<br />
a lightweight audio mixer which lets you control the audio volume through a tray icon [http://aur.archlinux.org/packages.php?ID=25502] <br />
<br />
==== gvtray ====<br />
<br />
A master volume mixer in the system tray [http://aur.archlinux.org/packages.php?ID=6362]<br />
<br />
==== obmixer ====<br />
<br />
Obmixer is a mixer appplet written in C which is intended to be a lightweight alternative to gnome volume control [http://aur.archlinux.org/packages.php?ID=31131]<br />
<br />
==== volti ====<br />
<br />
GTK+ application for controlling audio volume from system tray/notification area [http://aur.archlinux.org/packages.php?ID=33525]<br />
<br />
==== volumeicon ====<br />
<br />
Volume control for your system tray [http://aur.archlinux.org/packages.php?ID=35793]<br />
<br />
==== volwheel ====<br />
<br />
Tray icon to change volume with the mouse [http://www.archlinux.org/packages/community/i686/volwheel/]<br />
<br />
=== Keyboard layout switchers ===<br />
<br />
==== fbxkb ====<br />
<br />
Keyboard indicator and switcher [http://aur.archlinux.org/packages.php?ID=3458]<br />
<br />
==== xxkb ====<br />
<br />
keyboard layout switcher/indicator [http://www.archlinux.org/packages/community/i686/xxkb/]<br />
<br />
==== axkb ====<br />
<br />
QT4 keyboard layout switcher [http://aur.archlinux.org/packages.php?ID=25555]<br />
<br />
==== xneur ====<br />
<br />
X Neural Switcher is a text analyser, it detects the language of input and corrects it if needed [http://aur.archlinux.org/packages.php?ID=9750]<br />
<br />
== Tips and tricks ==<br />
<br />
=== Copy and paste ===<br />
<br />
From the terminal, Ctrl+Insert as copy and Shift+Insert as paste generally works as well. You may also copy from terminal with Ctrl+Shift+C, and paste with mouse middle click.<br />
<br />
=== Transparency ===<br />
<br />
By using the program transset-df, it is virtually the same as [[transset]], (available by: pacman -S transset-df) you can enable transparancy of windows on the fly. For instance by editing the following in {{Filename|~/.config/openbox/rc.xml}} you can have your middle mouse scroll enable and disable transparency by scrolling down and up on the scroll button, respectively, while over the title bar (it is in the <mouse> section):<br />
<context name="Titlebar"><br />
<mousebind button="Left" action="Press"><br />
<action name="Focus"/><br />
<action name="Raise"/><br />
</mousebind><br />
<mousebind button="Left" action="Drag"><br />
<action name="Move"/><br />
</mousebind><br />
<mousebind button="Left" action="DoubleClick"><br />
<action name="ToggleMaximizeFull"/><br />
</mousebind><br />
<mousebind button="Middle" action="Press"><br />
<action name="Lower"/> <br />
<action name="FocusToBottom"/><br />
<action name="Unfocus"/><br />
</mousebind><br />
<mousebind button="Up" action="Click"><br />
<action name= "Execute" ><br />
<execute>transset-df -p .2 --inc </execute><br />
</action><br />
</mousebind><br />
<mousebind button="Down" action="Click"><br />
<action name= "Execute" ><br />
<execute>transset-df -p .2 --dec </execute><br />
</action><br />
</mousebind><br />
<mousebind button="Right" action="Press"><br />
<action name="Focus"/><br />
<action name="Raise"/><br />
<action name="ShowMenu"><br />
<menu>client-menu</menu><br />
</action><br />
</mousebind><br />
</context><br />
As of now, it only appears to work when no other actions are taken.<br />
<br />
=== Xprop values for applications ===<br />
If you use per-application settings frequently, you might find this bash alias handy:<br />
<br />
alias xp='xprop | grep "WM_WINDOW_ROLE\|WM_CLASS" && echo "WM_CLASS(STRING) = \"NAME\", \"CLASS\""'<br />
<br />
To use, run '''{{Codeline|xp}}''' and click on the running program that you'd like to define with per-app settings. The result will display only the info that Openbox requires, namely the WM_WINDOW_ROLE and WM_CLASS (name and class) values:<br />
<br />
[thayer@dublin:~] $ xp<br />
WM_WINDOW_ROLE(STRING) = "roster"<br />
WM_CLASS(STRING) = "gajim.py", "Gajim.py"<br />
WM_CLASS(STRING) = "NAME", "CLASS"<br />
<br />
==== Xprop for Firefox ====<br />
<br />
For whatever reason, Firefox and its open source equivalents will ignore application rules (e.g. <desktop>) unless {{Codeline|class&#61;"Firefox*"}} is used, regardless of what xprop reports as the actual WM_CLASS values.<br />
<br />
=== Linking the menu to a command ===<br />
<br />
Some people would want to link the Openbox main menu, or any other, to a command. This is useful for creating a menu button in a panel, for example. Although Openbox doesn't support this, a very simple script, xdotool, can simulate a keypress by running a command. Xdotool is [http://aur.archlinux.org/packages.php?do_Details=1&ID=14789&O=0&L=0&C=0&K=xdotool&SB=n&SO=a&PP=25&do_MyPackages=0&do_Orphans=0&SeB=nd available on AUR]. To use it, simply add the following code to the <keyboard> section of your {{Filename|rc.xml}}:<br />
<keybind key="A-C-q"><br />
<action name="ShowMenu"><br />
<menu>root-menu</menu><br />
</action><br />
</keybind><br />
Restart/reconfigure Openbox. You can now magically summon your menu at your cursor position by running the following command:<br />
# xdotool key ctrl+alt+q<br />
Of course, you can change the shortcut to your liking.<br />
<br />
=== Urxvt in the background ===<br />
<br />
With Openbox, running a terminal as desktop background is easy. You won't need '''devilspie''' here.<br />
<br />
First you must enable transparency, open your {{Filename|.Xdefaults}} file (if it doesn't exist yet, create it in your home folder).<br />
URxvt*transparent:true<br />
URxvt*scrollBar:false<br />
URxvt*geometry:124x24 #I don't use the whole screen, if you want a full screen term don't bother with this and see below.<br />
URxvt*borderLess:true<br />
URxvt*foreground:Black #Font color. My wallpaper is White, you may wish to change this to White.<br />
<br />
Then edit your {{Filename|.config/openbox/rc.xml}} file:<br />
<application name="URxvt"><br />
<decor>no</decor><br />
<focus>yes</focus><br />
<position><br />
<x>center</x><br />
<y>20</y><br />
</position><br />
<layer>below</layer><br />
<desktop>all</desktop><br />
<maximized>true</maximized> #Only if you want a full size terminal.<br />
</application><br />
<br />
The ''magic'' comes from the {{Codeline|<layer>below</layer>}} line, which place the application under all others. Here Urxvt is displayed on all desktops, change it to your convenience.<br />
<br />
Note: Instead of using <application name="URxvt">, you can use another name ("URxvt-bg" for example), and use the -name option when starting uxrvt. That way, only the urxvt terminals which you choose to name URxvt-bg would be captured and modified by the application rule in rc.xml. For example: urxvt -name URxvt-bg (case sensitive)<br />
<br />
=== Keyboard Volume Control ===<br />
If you use ALSA for sound, you can use the amixer program to adjust the volume of sound. You can use Openbox's keybindings to act like multimedia keys. (Alternatively, you can probably find out the names of your real multimedia keys and map them.) For example, in the <keyboard> section of rc.xml:<br />
<br />
<keybind key="W-Up"><br />
<action name="Execute"><br />
<command>amixer set Master 5%+</command><br />
</action><br />
</keybind><br />
<br />
This binds Windows key + Up arrow to increase your master ALSA volume by 5%. Corresponding binding for volume down:<br />
<br />
<keybind key="W-Down"><br />
<action name="Execute"><br />
<command>amixer set Master 5%-</command><br />
</action><br />
</keybind><br />
<br />
As another example you can also use the XF86Audio keybindings:<br />
<br />
<keybind key="XF86AudioRaiseVolume"><br />
<action name="Execute"><br />
<command>amixer set Master 5%+ unmute</command><br />
</action><br />
</keybind><br />
<keybind key="XF86AudioLowerVolume"><br />
<action name="Execute"><br />
<command>amixer set Master 5%- unmute</command><br />
</action><br />
</keybind><br />
<keybind key="XF86AudioMute"><br />
<action name="Execute"><br />
<command>amixer set Master toggle</command><br />
</action><br />
</keybind><br />
<br />
The above example should work for the majority of multimedia keyboards. It should enable to raise, lower and mute the Master control of your audio device by using the respective multimedia keyboard keys. Notice also that in this example:<br />
<br />
* The "Mute" key should unmute the Master control if it is already in mute mode.<br />
* The "Raise" and "Lower" keys should unmute the Master control if it is in mute mode.<br />
<br />
== Resources ==<br />
<br />
* [http://openbox.org/ Openbox Website] &ndash; The official website<br />
* [http://planetob.openmonkey.com/ Planet Openbox] &ndash; Openbox news portal<br />
* [http://www.box-look.org/ Box-Look.org] &ndash; A good resource for themes and related artwork<br />
* [https://bbs.archlinux.org/viewtopic.php?id=93126 Openbox Hacks and Configs Thread] @ Arch Linux Forums<br />
* [https://bbs.archlinux.org/viewtopic.php?id=45692 Openbox Screenshots Thread] @ Arch Linux Forums<br />
<!-- vim: set ft=Wikipedia: --></div>Rent0nhttps://wiki.archlinux.org/index.php?title=Openbox&diff=112427Openbox2010-07-21T14:32:44Z<p>Rent0n: /* Resources */</p>
<hr />
<div>[[Category:Stacking WMs (English)]]<br />
[[Category:HOWTOs (English)]]<br />
{{i18n|Openbox}}<br />
<br />
Openbox is a lightweight and highly configurable window manager with extensive standards support. Its features are well-documented at the [http://openbox.org/ official website]. This article will pertain to running Openbox under Arch Linux.<br />
<br />
== Installation ==<br />
<br />
Openbox is available from the standard repositories:<br />
# pacman -S openbox<br />
<br />
Once installed, pacman will direct you to copy the default {{Filename|menu.xml}} and {{Filename|rc.xml}} configuration files to <tt>~/.config/openbox/</tt>, for example: <br />
<br />
{{Note | Do this as a regular user, not as root.}}<br />
<br />
$ mkdir -p ~/.config/openbox/<br />
$ cp /etc/xdg/openbox/rc.xml ~/.config/openbox/rc.xml<br />
$ cp /etc/xdg/openbox/menu.xml ~/.config/openbox/menu.xml<br />
<br />
{{Filename|rc.xml}} is the core configuration file for Openbox. It is used to manage keyboard shortcuts, themes, virtual desktops and other features.<br />
<br />
{{Filename|menu.xml}} controls the Openbox application menu that appears when you click on your desktop. The default items are pretty sparse, but it's very easy to modify the menu structure to suit your needs. See the menu section below for more details, or visit the [http://icculus.org/openbox/ Openbox website].<br />
<br />
== Stand-alone window manager ==<br />
<br />
To run Openbox on its own, simply add the following to the bottom of {{Filename|~/.xinitrc}}:<br />
exec openbox-session<br />
<br />
If you have used another window manager before, such as Xfce, and Openbox won't start after logging out of X, try moving the autostart folder:<br />
mv ~/.config/autostart ~/.config/autostart-bak<br />
<br />
Using D-Bus/HAL or similar, use this instead:<br />
exec ck-launch-session openbox-session<br />
<br />
If you use also '''polkit''' and '''D-Bus''' (e.g. for automount drivers in nautilus from Gnome 2.28 / 2.30) use:<br />
exec ck-launch-session dbus-launch openbox-session<br />
<br />
{{Note | [http://www.archlinux.org/packages/extra/i686/pyxdg/ pyxdg] is required for Openbox's xdg-autostart}}<br />
<br />
== Window manager for Desktop Environments ==<br />
<br />
=== GNOME ===<br />
==== GNOME 2.26 ====<br />
'''''Follow the next guide for GNOME 2.24. If it fails try this:'''''<br />
<br />
If after installing openbox and trying to log into the 'Gnome/openbox' session but it always fails then you can do the following as one way to achieve running openbox as your window manager every time you log into the 'Gnome' session from your login manager (xdm, gdm, kdm, entrance, slim, etc.)<br />
<br />
#Log into your Gnome only session (which would still be using metacity as its window manager) if you aren't already.<br />
#Install openbox if you have not done so already<br />
#Explore your menus to ''System &rarr; Preferences &rarr; Startup Applications'' (possibly named 'Session' for older versions of Gnome)<br />
#Open Startup Application, select '+ Add' and enter the text as seen in the box below whilst omitting the text behind the #.<br />
#Now hit the 'Add' button for that data entry window and make sure the checkbox beside your new entry is selected.<br />
#Thus log out of your gnome session and log back in and you should be running openbox as your window manager.<br />
#Enjoy!<br />
<br />
Name: Openbox Windox Manager # Can be changed<br />
Command: openbox --replace # Text should not be removed from this line, but possibly added to it<br />
Comment: Replaces metacity with openbox # Can be changed<br />
<br />
This creates an entry in a startup list which is executed by gnome everytime that particular user's gnome-session is started.<br />
<br />
==== GNOME 2.24 ====<br />
First, create {{Filename|/usr/share/applications/openbox.desktop}} containing the following:<br />
[Desktop Entry]<br />
Type=Application<br />
Encoding=UTF-8<br />
Name=OpenBox<br />
Exec=openbox<br />
NoDisplay=true<br />
# name of loadable control center module<br />
X-GNOME-WMSettingsModule=openbox<br />
# name we put on the WM spec check window<br />
X-GNOME-WMName=OpenBox<br />
Then, in gconf, set '''/desktop/gnome/session/required_components/windowmanager''' to '''openbox''':<br />
$ gconftool-2 -s -t string /desktop/gnome/session/required_components/windowmanager openbox<br />
Finally, choose the '''GNOME''' session in the GDM sessions menu.<br />
<br />
==== GNOME 2.22 and previous ====<br />
# If you use GDM, select the "GNOME/Openbox" login option<br />
# If you use startx, add {{Codeline|exec openbox-gnome-session}} to {{Filename|~/.xinitrc}}<br />
# From the shell:<br />
$ xinit /usr/bin/openbox-gnome-session<br />
<br />
=== KDE ===<br />
# If you use KDM, select the "KDE/Openbox" login option<br />
# If you use startx, add {{Codeline|exec openbox-kde-session}} to {{Filename|~/.xinitrc}}<br />
# From the shell:<br />
$ xinit /usr/bin/openbox-kde-session<br />
<br />
=== Xfce4 ===<br />
Log into a normal Xfce4 session. From your terminal of choice, do:<br />
$ killall xfwm4 ; openbox & exit<br />
<br />
This will kill xfwm4, run Openbox, and close the terminal. <br />
<br />
Log out, making sure to check the "Save session for future logins" checkbox. On next login, Xfce4 will use Openbox as its WM. To be able to exit the session using xfce4-session, open your file {{Filename|~/.config/openbox/menu.xml}} (if it isn't there, copy it from {{Filename|/etc/xdg/openbox/menu.xml}}). <br />
<br />
Look for the entry:<br />
<br />
<item label="Exit Openbox"><br />
<action name="Exit"><br />
<prompt>yes</prompt><br />
</action><br />
</item><br />
<br />
and change it to:<br />
<br />
<item label="Exit Openbox"><br />
<action name="Execute"><br />
<prompt>yes</prompt><br />
<command>xfce4-session-logout</command><br />
</action><br />
</item><br />
<br />
Otherwise, using the "Exit" entry of the root-menu will cause Openbox to terminate its execution, leaving you without a window manager.<br />
<br />
If you have an issue changing between virtual desktops with the mouse wheel skipping over virtual desktops, open your {{Filename|~/.config/openbox/rc.xml}} file and move the mouse binds with actions "DesktopPrevious" and "DesktopNext" from the context "Desktop" to the context "Root" (you may need to define the Root context).<br />
<br />
If you want to use the Openbox root-menu instead of Xfce's, you may terminate Xfdesktop by running the following command in a terminal:<br />
$ xfdesktop --quit<br />
<br />
However, Xfdesktop manages the wallpaper and desktop icons, requiring you to use other utilities, such as ROX, for these functions.<br />
<br />
(When terminating Xfdesktop, the above issue with the virtual desktops is no longer a problem.)<br />
<br />
== Preferences ==<br />
<br />
Currently, there are two options for configuring the core Openbox preferences; manually edit the {{Filename|rc.xml}}, or use the ObConf tool.<br />
<br />
=== Manual configuration ===<br />
<br />
To configure Openbox manually, simply edit {{Filename|~/.config/openbox/rc.xml}} with your favorite text editor. The config file provides plenty of comments throughout, and [http://openbox.org/wiki/Configuration full documentation] is available at the official website.<br />
<br />
=== ObConf ===<br />
<br />
[http://icculus.org/openbox/index.php/ObConf:About ObConf] is GUI-based Openbox configuration tool, which can be used to set most preferences including themes, virtual desktops, window properties and desktop margins.<br />
<br />
To install ObConf, run:<br />
# pacman -S obconf<br />
<br />
{{Note | ObConf cannot be used to configure keyboard shortcuts and some other advanced features. For these modifications, you must edit {{Filename|rc.xml}} manually (see above). Other option is [http://code.google.com/p/obkey/ ObKey] application (available in [[AUR]]).}}<br />
<br />
=== Application configuration ===<br />
<br />
Openbox features per-application settings, allowing you to define rules for your programs. For example, you can:<br />
* load your web browser on a certain desktop<br />
* load your terminal without a window border<br />
* load your torrent client at a certain position on your screen<br />
<br />
These are defined in {{Filename|~/.config/openbox/rc.xml}}. As you might expect, the instructions are well-documented within the file itself. Full details can also be found here: http://openbox.org/wiki/Help:Applications<br />
<br />
== Menus ==<br />
<br />
The default Openbox menu includes a variety of applications to get you started, but you'll probably want to customize this at some point. There are a number of ways to do so:<br />
<br />
=== Manual configuration ===<br />
<br />
Similar to the {{Filename|rc.xml}} file, you can edit {{Filename|~/.config/openbox/menu.xml}} with your favourite text editor. Although many of the settings are self-explanatory, [http://openbox.org/wiki/Help:Menus full documentation] is available.<br />
<br />
=== MenuMaker ===<br />
<br />
[http://menumaker.sourceforge.net/ MenuMaker] is a powerful tool that creates XML-based menus for a variety of Window Managers, including Openbox. MenuMaker will search your computer for executable programs and create an XML menu based on the results. It can be configured to exclude Legacy X, GNOME, KDE, or Xfce applications if the user desires.<br />
<br />
MenuMaker is available in the community repository:<br />
# pacman -S menumaker<br />
<br />
Once installed, you can generate a complete menu by running:<br />
$ mmaker -v OpenBox3<br />
<br />
By default, MenuMaker will not overwrite an existing menu.xml. To do so, run it with the -f (force) argument:<br />
<br />
$ mmaker -vf OpenBox3<br />
<br />
To see a full list of options, run {{Codeline|mmaker --help}}.<br />
<br />
This will give you a pretty thorough menu. Now you can modify the menu.xml by hand, or simply regenerate the list whenever you install new software.<br />
<br />
=== Obmenu ===<br />
<br />
Obmenu is a GUI-based menu editor for Openbox. For those who don't enjoy editing XML source code, this is probably the best option for you.<br />
<br />
It is available in the community repository:<br />
# pacman -S obmenu<br />
<br />
Once installed, simply run {{Codeline|obmenu}} and add or remove the desired applications.<br />
<br />
==== Obm-xdg ====<br />
<br />
<tt>obm-xdg</tt> is a command-line tool that comes with Obmenu. It can generate a categorized sub-menu of installed GTK/GNOME applications.<br />
<br />
To use obm-xdg, add the following line to {{Filename|~/.config/openbox/menu.xml}}:<br />
<menu execute="obm-xdg" id="xdg-menu" label="xdg"/><br />
<br />
Then run {{Codeline|openbox --reconfigure}} to refresh the Openbox menu. You should now see a sub-menu labeled '''xdg''' in your menu.<br />
<br />
{{Note | If you do not have GNOME installed, then you need to install '''gnome-menus''' package for obm-xdg to work.}}<br />
<br />
=== Python based xdg menu script ===<br />
<br />
This script can be found in Fedora's Openbox package. You will only have to put the script somewhere and add a menu entry.<br />
<br />
Here is my paste: http://pastebin.com/f2f827625<br />
And here is the head: http://cvs.fedoraproject.org/viewvc/devel/openbox/xdg-menu?view=markup<br />
<br />
Download the one you like (maybe you'll prefer the head version of course). You can put the file anywhere, I used ~/Documents/build/xdg-menu (just modify the menu entry later according to YOUR filename/path.)<br />
<br />
Then open your menu.xml with your favourite text editor and add the following entry where you want the new menu (of course, you can modify the label however you want):<br />
<menu id="apps-menu" label="xdgmenu" execute="python /home/shiki/Documents/build/xdg-menu"/><br />
<br />
Save the file, and run: {{Codeline|openbox --reconfigure}}.<br />
<br />
=== Pipe menus ===<br />
<br />
Openbox (and other WMs like WindowMaker and PekWM) allow you to write scripts that dynamically build menus on the fly. Some examples are system monitors, media player controls, and weather forecasts. Many examples can be found on the openbox [http://openbox.org/wiki/Openbox:Pipemenus site].<br />
<br />
Xyne has also created a file browser and brisbin33 has one for scanning for / connecting to wireless hot spots (requires netcfg). The relevant forum posts for these utilities are [http://bbs.archlinux.org/viewtopic.php?id=77197&p=1 here] and [http://bbs.archlinux.org/viewtopic.php?id=78290 here]<br />
<br />
== Startup programs ==<br />
<br />
Openbox features support for running programs at startup. This is provided by the "openbox-session" command.<br />
<br />
There are two ways to enable autostart:<br />
# If you use startx/xinit to log into your X session, edit {{Filename|~/.xinitrc}} and change the line that executes ''openbox'' to execute '''openbox-session''' instead.<br />
# If you log in with GDM/KDM, then select the ''Openbox'' session and it will automatically use autostart.<br />
<br />
Startup programs are managed in {{Filename|~/.config/openbox/autostart.sh}}. Full instructions and best practices for how to do this are available at the [http://openbox.org/wiki/Help:Autostart Openbox website].<br />
<br />
== Themes and appearance ==<br />
<br />
With the exception of the Openbox Themes topic, the following section is intended for users who have configured Openbox to run as a standalone desktop, without the assistance of GNOME, KDE or Xfce.<br />
<br />
=== Openbox themes ===<br />
<br />
Openbox themes control the appearance of window borders, including the titlebar and titlebar buttons. They also determine the appearance of the application menu and on-screen display (OSD). <br />
<br />
Additional themes are available from the standard repositories:<br />
<br />
# pacman -S openbox-themes<br />
<br />
This package is by no means definitive. You can download more themes at websites such as:<br />
*[http://www.box-look.org/index.php?xcontentmode=7402 box-look.org]<br />
*[http://customize.org/browse/tags/openbox customize.org]<br />
*http://www.minuslab.net/themes/<br />
*http://celo.wordpress.com/themes/<br />
*http://vault.openmonkey.com/pages/openbox<br />
*http://hewphoria.com/?p=submission&type=theme&cat=7<br />
<br />
Downloaded themes should be extracted to <tt>~/.themes</tt> and can be installed or selected with the [[Openbox#Preferences|ObConf]] tool.<br />
<br />
Creating new themes is fairly easy and again [http://icculus.org/openbox/index.php/Help:Themes well-documented].<br />
<br />
For a GUI theme editor, take a look at [http://xyne.archlinux.ca/info/obtheme ObTheme].<br />
<br />
=== X11 Appearance ===<br />
<br />
If you are running Openbox as a standalone, you will need to configure .Xdefaults file.<br />
Save a copy to ~/.Xdefaults and /home/root/.Xdefaults for windows opened as Root.<br />
<br />
Xdefaults is a user-level configuration dotfile, typically located at ~/.Xdefaults. When present, it is parsed by the xrdb (Xorg resource database) program automatically when Xorg is started, and can be used to set or override preferences for X and X applications. It can do many operations, including:<br />
<br />
- defining terminal colours<br />
- configuring terminal preferences<br />
- setting DPI, antialiasing, hinting and other X font settings<br />
- changing the Xcursor theme<br />
- theming xscreensaver<br />
- altering preferences on low-level X applications (xclock, xpdf, etc.) <br />
<br />
Xdefaults Arch WiKi<br />
http://wiki.archlinux.org/index.php/Xdefaults<br />
<br />
=== X11 Mouse cursors ===<br />
<br />
Extract the desired Xcursor theme to either <tt>/usr/share/icons</tt> (system-wide access) or <tt>~/.icons</tt> (local user access). There are also a limited amount of themes available in the community repository that can be installed using pacman.<br />
<br />
Add this to {{Filename|~/.Xdefaults}}:<br />
Xcursor.theme: [name-of-cursor-theme]<br />
where {{Codeline|[name-of-cursor-theme]}} is the name of the cursor theme directory. For example:<br />
Xcursor.theme: Vanilla-DMZ-AA<br />
To change the size:<br />
Xcursor.size: [size]<br />
Sometimes it is required to symlink the icon directory into each user directory to make the window manager use them:<br />
$ mkdir ~/.icons<br />
$ ln -s /usr/share/icons/[name-of-cursor-theme] ~/.icons/default<br />
<br />
For more information read the Arch WiKi<br />
http://wiki.archlinux.org/index.php/X11_Cursors<br />
<br />
=== GTK Themes ===<br />
<br />
==== GTK2/GTK+ ====<br />
<br />
First, extract the desired theme to <tt>/usr/share/themes</tt> (system-wide access) or <tt>~/.themes</tt> (local user access), then:<br />
<br />
GTK+ themes can be managed easily with the '''[[LXDE | lxappearance]]''', '''gtk-chtheme''', or '''switch2''' utilities. To install, run:<br />
# pacman -S lxappearance<br />
and/or<br />
# pacman -S gtk-chtheme<br />
and/or<br />
# pacman -S gtk-theme-switch2<br />
<br />
Now you can simply run {{Codeline|lxappearance}}, {{Codeline|gtk-chtheme}} or {{Codeline|switch2}} to set the desired theme.<br />
<br />
==== GTK1 ====<br />
For legacy GTK1 themes, install the '''gtk-theme-switch''' package:<br />
# pacman -S gtk-theme-switch<br />
Then run {{Codeline|switch}} to select a desired theme.<br />
<br />
==== GTK fonts ====<br />
<br />
To manually change the type and size of your fonts, add the following to {{Filename|~/.gtkrc.mine}}:<br />
style "user-font"<br />
{<br />
font_name = "[font-name] [size]"<br />
}<br />
widget_class "*" style "user-font"<br />
gtk-font-name = "[font-name] [size]"<br />
<br />
where {{Codeline|[font-name] [size]}} is the desired font and point size. For example:<br />
style "user-font"<br />
{<br />
font_name = "DejaVu Sans 8"<br />
}<br />
widget_class "*" style "user-font"<br />
gtk-font-name = "DejaVu Sans 8"<br />
<br />
Both {{Codeline|font_name}} and {{Codeline|gtk-font-name}} fields are required for backwards compatibility.<br />
<br />
You can also use '''gtk-chtheme''' or '''lxappearance''' to set GTK font settings. Please refer to the above section.<br />
<br />
==== GTK Icons ====<br />
<br />
First, extract the desired icon theme to <tt>/usr/share/icons</tt> (system-wide access) or <tt>~/.icons</tt> (local user access), then:<br />
<br />
Add the following to {{Filename|~/.gtkrc.mine}}: <br />
gtk-icon-theme-name = "[name-of-icon-theme]"<br />
<br />
where {{Codeline|[name-of-icon-theme]}} is the name of the icon theme directory. For example:<br />
gtk-icon-theme-name = "Tango"<br />
<br />
Ensure {{Filename|~/.gtkrc-2.0}} is configured to parse {{Filename|~/.gtkrc.mine}}:<br />
<br />
# ~/.gtkrc-2.0<br />
# -- THEME AUTO-WRITTEN DO NOT EDIT<br />
include "/usr/share/themes/Rezlooks-Gilouche/gtk-2.0/gtkrc"<br />
include "/home/username/.gtkrc.mine"<br />
# -- THEME AUTO-WRITTEN DO NOT EDIT<br />
<br />
You can use '''lxappearance''' to choose GTK icon themes. Please refer to the above section.<br />
<br />
=== Desktop icons ===<br />
Openbox does not provide a means to display icons on the desktop. Xfdesktop, PcmanFM, [http://rox.sourceforge.net ROX], [http://idesk.sourceforge.net iDesk], or even Nautilus (and the gnome-settings-daemon) can provide this function. <br />
<br />
ROX and PCmanFM have the additional advantage of being lightweight file managers.<br />
<br />
=== Desktop wallpaper ===<br />
<br />
Openbox itself does not include a way to change the wallpaper. This can be done easily with programs like [[Feh]] or [[Nitrogen]]. Other options include ImageMagick, hsetroot and xsetbg. Or Pcmanfm and Xfdesktop can do it too.<br />
<br />
== Recommended programs ==<br />
<br />
There is [[Lightweight Applications|list of Lightweight Software]] at Arch's wiki, most of them nicely fits with Openbox.<br />
<br />
=== Login managers ===<br />
<br />
[http://slim.berlios.de/ SLiM] provides a lightweight and elegant graphical login solution for standalone Openbox configurations. Refer to Arch's [[SLiM]] wiki for detailed instructions.<br />
<br />
[http://qingy.sourceforge.net/ Qingy] is ultralight and very configurable graphical login. It support login to both console and X Windows sessions. It uses [http://www.directfb.org DirectFB], therefore it does not start X Windows unless you choose X Windows session. See article about [[Qingy]] at Arch's wiki.<br />
<br />
=== Composite desktop ===<br />
<br />
[[Xcompmgr]] is a lightweight composite manager capable of rendering drop shadows, fading and simple window transparency within Openbox and other window managers.<br />
(It's worth noting that xcompmgr is no longer developed, and so any issues are unlikely to be fixed)<br />
(Developed an issue with tint2 0.9, the systray icons have a tendency to corrupt)<br />
<br />
[[Cairo Compmgr | Cairo Composite Manager]] -- A versatile and extensible composite manager which uses cairo for rendering, is an alternative.<br />
<br />
=== Panels, trays, and pagers ===<br />
<br />
There are quite a lot of utilities available that provide a panel (taskbar), system tray, and pager to Openbox. The most common are:<br />
<br />
==== Panels ====<br />
* [[PyPanel]]<br />
* [http://nsf.110mb.com/bmpanel/ BMPanel]<br />
* [[tint2]]<br />
* [http://www.gnomefiles.org/app.php/LXPanel LXPanel]<br />
* [http://fbpanel.sourceforge.net fbpanel]<br />
* [http://freshmeat.net/projects/perlpanel/ PerlPanel]<br />
* [http://www.chatjunkies.org/fspanel/ fspanel]<br />
* [http://www.xfce.org/projects/xfce4-panel/ Xfce4-panel]<br />
* [http://live.gnome.org/GnomePanel/ GnomePanel]<br />
* [https://launchpad.net/awn avant-window-navigator]<br />
* [http://developer.berlios.de/projects/cairo-dock/ cairo-dock]<br />
* [http://code.google.com/p/wbar/ wbar]<br />
* [http://www.screenlets.org/ screenlets]<br />
* [http://www.failedprojects.de/pancake/ pancake]<br />
<br />
==== Trays ====<br />
* [http://stalonetray.sourceforge.net/ Stalonetray]<br />
* [http://download.gna.org/fvwm-crystal/trayer/1.0/ Trayer]<br />
<br />
==== Pagers ====<br />
* [http://projects.l3ib.org/trac/visibility Visibility]<br />
* [http://bbtools.sourceforge.net/ bbpager]<br />
* [http://aur.archlinux.org/packages.php?ID=17563 netwmpager]<br />
* [http://useperl.ru/ipager/index.en.html IPager]<br />
* [http://code.google.com/p/neap/ neap]<br />
<br />
Make your choice and add it to your startup file. If you wish to set the desktop layout without using a pager, you can use [http://aur.archlinux.org/packages.php?ID=34376 obsetlayout], which is a packaged version of the setlayout tool from the Openbox wiki.<br />
<br />
=== File managers ===<br />
<br />
There are many possibilities, but the most popular lightweight file managers are:<br />
* [[Thunar]]. Thunar supports auto-mount features and other plugins. <br />
* [http://rox.sourceforge.net ROX] (ROX provides desktop icons)<br />
# pacman -S rox<br />
* [http://pcmanfm.sourceforge.net PCManFM] (pcmanfm also provides desktop icons)<br />
# pacman -S pcmanfm<br />
To access NTFS drives with PCManFM, install ntfs-3g:<br />
# pacman -S ntfs-3g<br />
and make sure you're added to group hal:<br />
# gpasswd -a username hal<br />
For even lighter options, consider [http://www.obsession.se/gentoo/ Gentoo] or [http://emelfm2.net/ emelFM2], both of which use the familiar 'Midnight Commander' two pane layout.<br />
<br />
Others:<br />
Xfe<br />
muCommander<br />
''(Will edit it later after I have tried them both.)''<br />
<br />
Of course, you can also use GNOME's Nautilus. Although slower than the above solutions, it has the additional advantage of VFS support (e.g. remote SSH, FTP and Samba connections)<br />
<br />
=== Application launchers ===<br />
<br />
==== dmenu ====<br />
<br />
Set-up dmenu as described in the [[dmenu]] wiki article. Then, add the following entry to the <keyboard> section {{Filename|~/.config/openbox/rc.xml}} to enable a shortcut to launch dmenu:<br />
<keybind key="W-space"><br />
<action name="Execute"><br />
<execute>dmenu_run</execute><br />
</action><br />
</keybind><br />
<br />
==== Gmrun ====<br />
<br />
[http://sourceforge.net/projects/gmrun gmrun] provides an excellent Run dialog box, similar to the Alt+F2 features found in Gnome and KDE:<br />
# pacman -S gmrun<br />
Add the following entry to the <keyboard> section {{Filename|~/.config/openbox/rc.xml}} to enable Alt+F2 functionality:<br />
<keybind key="A-F2"><br />
<action name="execute"><execute>gmrun</execute></action><br />
</keybind><br />
<br />
==== Bashrun ====<br />
<br />
[http://bashrun.sourceforge.net bashrun] provides a different, barebones approach to a run dialog, using a specialized bash session within a small xterm window. It is available in the community repository and can be launched through the Alt+F2 style approach mentioned previously. To make bashrun act more like a traditional run dialog, add the following entry to the <applications> section {{Filename|~/.config/openbox/rc.xml}}:<br />
<application name="bashrun"><br />
<desktop>all</desktop><br />
<decor>no</decor> # switch to yes if you prefer a bordered window<br />
<focus>yes</focus><br />
<skip_pager>yes</skip_pager><br />
<layer>above</layer><br />
</application><br />
<br />
==== Launchy ====<br />
<br />
[http://www.launchy.net/ Launchy] is a less minimalistic approach; it is skinnable and offers more functionality such as a calculator, checking the weather, etc. Originally for Windows, similar to Gnome Do.<br />
# pacman -S launchy<br />
It is launched by Ctrl+Space key combination.<br />
<br />
==== LXPanel ====<br />
<br />
The LXPanel run dialog can be executed with <br />
lxpanelctl run<br />
<br />
==== gnome-panel ====<br />
<br />
The gnome-panel run dialog can be executed with <br />
gnome-panel-control --run-dialog<br />
<br />
=== Clipboard managers ===<br />
<br />
You may wish to install a clipboard manager for feature rich copy/paste ability. '''xfce4-clipman-plugin, parcellite,''' or '''glipper-old''' may be installed via pacman. Add your choice to autostart.sh. From the terminal, Ctrl+Insert as copy and Shift+Insert as paste generally works as well. You may also copy from terminal with Ctrl+Shift+C, and paste with mouse middle click.<br />
<br />
=== Volume managers ===<br />
<br />
==== gvolwheel ====<br />
<br />
a lightweight audio mixer which lets you control the audio volume through a tray icon [http://aur.archlinux.org/packages.php?ID=25502] <br />
<br />
==== gvtray ====<br />
<br />
A master volume mixer in the system tray [http://aur.archlinux.org/packages.php?ID=6362]<br />
<br />
==== obmixer ====<br />
<br />
Obmixer is a mixer appplet written in C which is intended to be a lightweight alternative to gnome volume control [http://aur.archlinux.org/packages.php?ID=31131]<br />
<br />
==== volti ====<br />
<br />
GTK+ application for controlling audio volume from system tray/notification area [http://aur.archlinux.org/packages.php?ID=33525]<br />
<br />
==== volumeicon ====<br />
<br />
Volume control for your system tray [http://aur.archlinux.org/packages.php?ID=35793]<br />
<br />
==== volwheel ====<br />
<br />
Tray icon to change volume with the mouse [http://www.archlinux.org/packages/community/i686/volwheel/]<br />
<br />
=== Keyboard layout switchers ===<br />
<br />
==== fbxkb ====<br />
<br />
Keyboard indicator and switcher [http://aur.archlinux.org/packages.php?ID=3458]<br />
<br />
==== xxkb ====<br />
<br />
keyboard layout switcher/indicator [http://www.archlinux.org/packages/community/i686/xxkb/]<br />
<br />
==== axkb ====<br />
<br />
QT4 keyboard layout switcher [http://aur.archlinux.org/packages.php?ID=25555]<br />
<br />
==== xneur ====<br />
<br />
X Neural Switcher is a text analyser, it detects the language of input and corrects it if needed [http://aur.archlinux.org/packages.php?ID=9750]<br />
<br />
== Tips and tricks ==<br />
<br />
=== Copy and paste ===<br />
<br />
From the terminal, Ctrl+Insert as copy and Shift+Insert as paste generally works as well. You may also copy from terminal with Ctrl+Shift+C, and paste with mouse middle click.<br />
<br />
=== Transparency ===<br />
<br />
By using the program transset-df, it is virtually the same as [[transset]], (available by: pacman -S transset-df) you can enable transparancy of windows on the fly. For instance by editing the following in {{Filename|~/.config/openbox/rc.xml}} you can have your middle mouse scroll enable and disable transparency by scrolling down and up on the scroll button, respectively, while over the title bar (it is in the <mouse> section):<br />
<context name="Titlebar"><br />
<mousebind button="Left" action="Press"><br />
<action name="Focus"/><br />
<action name="Raise"/><br />
</mousebind><br />
<mousebind button="Left" action="Drag"><br />
<action name="Move"/><br />
</mousebind><br />
<mousebind button="Left" action="DoubleClick"><br />
<action name="ToggleMaximizeFull"/><br />
</mousebind><br />
<mousebind button="Middle" action="Press"><br />
<action name="Lower"/> <br />
<action name="FocusToBottom"/><br />
<action name="Unfocus"/><br />
</mousebind><br />
<mousebind button="Up" action="Click"><br />
<action name= "Execute" ><br />
<execute>transset-df -p .2 --inc </execute><br />
</action><br />
</mousebind><br />
<mousebind button="Down" action="Click"><br />
<action name= "Execute" ><br />
<execute>transset-df -p .2 --dec </execute><br />
</action><br />
</mousebind><br />
<mousebind button="Right" action="Press"><br />
<action name="Focus"/><br />
<action name="Raise"/><br />
<action name="ShowMenu"><br />
<menu>client-menu</menu><br />
</action><br />
</mousebind><br />
</context><br />
As of now, it only appears to work when no other actions are taken.<br />
<br />
=== Xprop values for applications ===<br />
If you use per-application settings frequently, you might find this bash alias handy:<br />
<br />
alias xp='xprop | grep "WM_WINDOW_ROLE\|WM_CLASS" && echo "WM_CLASS(STRING) = \"NAME\", \"CLASS\""'<br />
<br />
To use, run '''{{Codeline|xp}}''' and click on the running program that you'd like to define with per-app settings. The result will display only the info that Openbox requires, namely the WM_WINDOW_ROLE and WM_CLASS (name and class) values:<br />
<br />
[thayer@dublin:~] $ xp<br />
WM_WINDOW_ROLE(STRING) = "roster"<br />
WM_CLASS(STRING) = "gajim.py", "Gajim.py"<br />
WM_CLASS(STRING) = "NAME", "CLASS"<br />
<br />
==== Xprop for Firefox ====<br />
<br />
For whatever reason, Firefox and its open source equivalents will ignore application rules (e.g. <desktop>) unless {{Codeline|class&#61;"Firefox*"}} is used, regardless of what xprop reports as the actual WM_CLASS values.<br />
<br />
=== Linking the menu to a command ===<br />
<br />
Some people would want to link the Openbox main menu, or any other, to a command. This is useful for creating a menu button in a panel, for example. Although Openbox doesn't support this, a very simple script, xdotool, can simulate a keypress by running a command. Xdotool is [http://aur.archlinux.org/packages.php?do_Details=1&ID=14789&O=0&L=0&C=0&K=xdotool&SB=n&SO=a&PP=25&do_MyPackages=0&do_Orphans=0&SeB=nd available on AUR]. To use it, simply add the following code to the <keyboard> section of your {{Filename|rc.xml}}:<br />
<keybind key="A-C-q"><br />
<action name="ShowMenu"><br />
<menu>root-menu</menu><br />
</action><br />
</keybind><br />
Restart/reconfigure Openbox. You can now magically summon your menu at your cursor position by running the following command:<br />
# xdotool key ctrl+alt+q<br />
Of course, you can change the shortcut to your liking.<br />
<br />
=== Urxvt in the background ===<br />
<br />
With Openbox, running a terminal as desktop background is easy. You won't need '''devilspie''' here.<br />
<br />
First you must enable transparency, open your {{Filename|.Xdefaults}} file (if it doesn't exist yet, create it in your home folder).<br />
URxvt*transparent:true<br />
URxvt*scrollBar:false<br />
URxvt*geometry:124x24 #I don't use the whole screen, if you want a full screen term don't bother with this and see below.<br />
URxvt*borderLess:true<br />
URxvt*foreground:Black #Font color. My wallpaper is White, you may wish to change this to White.<br />
<br />
Then edit your {{Filename|.config/openbox/rc.xml}} file:<br />
<application name="URxvt"><br />
<decor>no</decor><br />
<focus>yes</focus><br />
<position><br />
<x>center</x><br />
<y>20</y><br />
</position><br />
<layer>below</layer><br />
<desktop>all</desktop><br />
<maximized>true</maximized> #Only if you want a full size terminal.<br />
</application><br />
<br />
The ''magic'' comes from the {{Codeline|<layer>below</layer>}} line, which place the application under all others. Here Urxvt is displayed on all desktops, change it to your convenience.<br />
<br />
Note: Instead of using <application name="URxvt">, you can use another name ("URxvt-bg" for example), and use the -name option when starting uxrvt. That way, only the urxvt terminals which you choose to name URxvt-bg would be captured and modified by the application rule in rc.xml. For example: urxvt -name URxvt-bg (case sensitive)<br />
<br />
=== Keyboard Volume Control ===<br />
If you use ALSA for sound, you can use the amixer program to adjust the volume of sound. You can use Openbox's keybindings to act like multimedia keys. (Alternatively, you can probably find out the names of your real multimedia keys and map them.) For example, in the <keyboard> section of rc.xml:<br />
<br />
<keybind key="W-Up"><br />
<action name="Execute"><br />
<command>amixer set Master 5%+</command><br />
</action><br />
</keybind><br />
<br />
This binds Windows key + Up arrow to increase your master ALSA volume by 5%. Corresponding binding for volume down:<br />
<br />
<keybind key="W-Down"><br />
<action name="Execute"><br />
<command>amixer set Master 5%-</command><br />
</action><br />
</keybind><br />
<br />
As another example you can also use the XF86Audio keybindings:<br />
<br />
<keybind key="XF86AudioRaiseVolume"><br />
<action name="Execute"><br />
<command>amixer set Master 5%+ unmute</command><br />
</action><br />
</keybind><br />
<keybind key="XF86AudioLowerVolume"><br />
<action name="Execute"><br />
<command>amixer set Master 5%- unmute</command><br />
</action><br />
</keybind><br />
<keybind key="XF86AudioMute"><br />
<action name="Execute"><br />
<command>amixer set Master toggle</command><br />
</action><br />
</keybind><br />
<br />
The above example should work for the majority of multimedia keyboards. It should enable to raise, lower and mute the Master control of your audio device by using the respective multimedia keyboard keys. Notice also that in this example:<br />
<br />
* The "Mute" key should unmute the Master control if it is already in mute mode.<br />
* The "Raise" and "Lower" keys should unmute the Master control if it is in mute mode.<br />
<br />
== Resources ==<br />
<br />
* [http://openbox.org/ Openbox Website] &ndash; The official website<br />
* [http://planetob.openmonkey.com/ Planet Openbox] &ndash; Openbox news portal<br />
* [http://www.box-look.org/ Box-Look.org] &ndash; A good resource for themes and related artwork<br />
* [https://bbs.archlinux.org/viewtopic.php?id=93126 Openbox Hacks and Configs Thread] &ndash; @ Arch Linux Forums<br />
* [https://bbs.archlinux.org/viewtopic.php?id=45692 Openbox Screenshots Thread] &ndash; @ Arch Linux Forums<br />
<!-- vim: set ft=Wikipedia: --></div>Rent0nhttps://wiki.archlinux.org/index.php?title=Openbox&diff=112426Openbox2010-07-21T14:32:31Z<p>Rent0n: /* Resources */</p>
<hr />
<div>[[Category:Stacking WMs (English)]]<br />
[[Category:HOWTOs (English)]]<br />
{{i18n|Openbox}}<br />
<br />
Openbox is a lightweight and highly configurable window manager with extensive standards support. Its features are well-documented at the [http://openbox.org/ official website]. This article will pertain to running Openbox under Arch Linux.<br />
<br />
== Installation ==<br />
<br />
Openbox is available from the standard repositories:<br />
# pacman -S openbox<br />
<br />
Once installed, pacman will direct you to copy the default {{Filename|menu.xml}} and {{Filename|rc.xml}} configuration files to <tt>~/.config/openbox/</tt>, for example: <br />
<br />
{{Note | Do this as a regular user, not as root.}}<br />
<br />
$ mkdir -p ~/.config/openbox/<br />
$ cp /etc/xdg/openbox/rc.xml ~/.config/openbox/rc.xml<br />
$ cp /etc/xdg/openbox/menu.xml ~/.config/openbox/menu.xml<br />
<br />
{{Filename|rc.xml}} is the core configuration file for Openbox. It is used to manage keyboard shortcuts, themes, virtual desktops and other features.<br />
<br />
{{Filename|menu.xml}} controls the Openbox application menu that appears when you click on your desktop. The default items are pretty sparse, but it's very easy to modify the menu structure to suit your needs. See the menu section below for more details, or visit the [http://icculus.org/openbox/ Openbox website].<br />
<br />
== Stand-alone window manager ==<br />
<br />
To run Openbox on its own, simply add the following to the bottom of {{Filename|~/.xinitrc}}:<br />
exec openbox-session<br />
<br />
If you have used another window manager before, such as Xfce, and Openbox won't start after logging out of X, try moving the autostart folder:<br />
mv ~/.config/autostart ~/.config/autostart-bak<br />
<br />
Using D-Bus/HAL or similar, use this instead:<br />
exec ck-launch-session openbox-session<br />
<br />
If you use also '''polkit''' and '''D-Bus''' (e.g. for automount drivers in nautilus from Gnome 2.28 / 2.30) use:<br />
exec ck-launch-session dbus-launch openbox-session<br />
<br />
{{Note | [http://www.archlinux.org/packages/extra/i686/pyxdg/ pyxdg] is required for Openbox's xdg-autostart}}<br />
<br />
== Window manager for Desktop Environments ==<br />
<br />
=== GNOME ===<br />
==== GNOME 2.26 ====<br />
'''''Follow the next guide for GNOME 2.24. If it fails try this:'''''<br />
<br />
If after installing openbox and trying to log into the 'Gnome/openbox' session but it always fails then you can do the following as one way to achieve running openbox as your window manager every time you log into the 'Gnome' session from your login manager (xdm, gdm, kdm, entrance, slim, etc.)<br />
<br />
#Log into your Gnome only session (which would still be using metacity as its window manager) if you aren't already.<br />
#Install openbox if you have not done so already<br />
#Explore your menus to ''System &rarr; Preferences &rarr; Startup Applications'' (possibly named 'Session' for older versions of Gnome)<br />
#Open Startup Application, select '+ Add' and enter the text as seen in the box below whilst omitting the text behind the #.<br />
#Now hit the 'Add' button for that data entry window and make sure the checkbox beside your new entry is selected.<br />
#Thus log out of your gnome session and log back in and you should be running openbox as your window manager.<br />
#Enjoy!<br />
<br />
Name: Openbox Windox Manager # Can be changed<br />
Command: openbox --replace # Text should not be removed from this line, but possibly added to it<br />
Comment: Replaces metacity with openbox # Can be changed<br />
<br />
This creates an entry in a startup list which is executed by gnome everytime that particular user's gnome-session is started.<br />
<br />
==== GNOME 2.24 ====<br />
First, create {{Filename|/usr/share/applications/openbox.desktop}} containing the following:<br />
[Desktop Entry]<br />
Type=Application<br />
Encoding=UTF-8<br />
Name=OpenBox<br />
Exec=openbox<br />
NoDisplay=true<br />
# name of loadable control center module<br />
X-GNOME-WMSettingsModule=openbox<br />
# name we put on the WM spec check window<br />
X-GNOME-WMName=OpenBox<br />
Then, in gconf, set '''/desktop/gnome/session/required_components/windowmanager''' to '''openbox''':<br />
$ gconftool-2 -s -t string /desktop/gnome/session/required_components/windowmanager openbox<br />
Finally, choose the '''GNOME''' session in the GDM sessions menu.<br />
<br />
==== GNOME 2.22 and previous ====<br />
# If you use GDM, select the "GNOME/Openbox" login option<br />
# If you use startx, add {{Codeline|exec openbox-gnome-session}} to {{Filename|~/.xinitrc}}<br />
# From the shell:<br />
$ xinit /usr/bin/openbox-gnome-session<br />
<br />
=== KDE ===<br />
# If you use KDM, select the "KDE/Openbox" login option<br />
# If you use startx, add {{Codeline|exec openbox-kde-session}} to {{Filename|~/.xinitrc}}<br />
# From the shell:<br />
$ xinit /usr/bin/openbox-kde-session<br />
<br />
=== Xfce4 ===<br />
Log into a normal Xfce4 session. From your terminal of choice, do:<br />
$ killall xfwm4 ; openbox & exit<br />
<br />
This will kill xfwm4, run Openbox, and close the terminal. <br />
<br />
Log out, making sure to check the "Save session for future logins" checkbox. On next login, Xfce4 will use Openbox as its WM. To be able to exit the session using xfce4-session, open your file {{Filename|~/.config/openbox/menu.xml}} (if it isn't there, copy it from {{Filename|/etc/xdg/openbox/menu.xml}}). <br />
<br />
Look for the entry:<br />
<br />
<item label="Exit Openbox"><br />
<action name="Exit"><br />
<prompt>yes</prompt><br />
</action><br />
</item><br />
<br />
and change it to:<br />
<br />
<item label="Exit Openbox"><br />
<action name="Execute"><br />
<prompt>yes</prompt><br />
<command>xfce4-session-logout</command><br />
</action><br />
</item><br />
<br />
Otherwise, using the "Exit" entry of the root-menu will cause Openbox to terminate its execution, leaving you without a window manager.<br />
<br />
If you have an issue changing between virtual desktops with the mouse wheel skipping over virtual desktops, open your {{Filename|~/.config/openbox/rc.xml}} file and move the mouse binds with actions "DesktopPrevious" and "DesktopNext" from the context "Desktop" to the context "Root" (you may need to define the Root context).<br />
<br />
If you want to use the Openbox root-menu instead of Xfce's, you may terminate Xfdesktop by running the following command in a terminal:<br />
$ xfdesktop --quit<br />
<br />
However, Xfdesktop manages the wallpaper and desktop icons, requiring you to use other utilities, such as ROX, for these functions.<br />
<br />
(When terminating Xfdesktop, the above issue with the virtual desktops is no longer a problem.)<br />
<br />
== Preferences ==<br />
<br />
Currently, there are two options for configuring the core Openbox preferences; manually edit the {{Filename|rc.xml}}, or use the ObConf tool.<br />
<br />
=== Manual configuration ===<br />
<br />
To configure Openbox manually, simply edit {{Filename|~/.config/openbox/rc.xml}} with your favorite text editor. The config file provides plenty of comments throughout, and [http://openbox.org/wiki/Configuration full documentation] is available at the official website.<br />
<br />
=== ObConf ===<br />
<br />
[http://icculus.org/openbox/index.php/ObConf:About ObConf] is GUI-based Openbox configuration tool, which can be used to set most preferences including themes, virtual desktops, window properties and desktop margins.<br />
<br />
To install ObConf, run:<br />
# pacman -S obconf<br />
<br />
{{Note | ObConf cannot be used to configure keyboard shortcuts and some other advanced features. For these modifications, you must edit {{Filename|rc.xml}} manually (see above). Other option is [http://code.google.com/p/obkey/ ObKey] application (available in [[AUR]]).}}<br />
<br />
=== Application configuration ===<br />
<br />
Openbox features per-application settings, allowing you to define rules for your programs. For example, you can:<br />
* load your web browser on a certain desktop<br />
* load your terminal without a window border<br />
* load your torrent client at a certain position on your screen<br />
<br />
These are defined in {{Filename|~/.config/openbox/rc.xml}}. As you might expect, the instructions are well-documented within the file itself. Full details can also be found here: http://openbox.org/wiki/Help:Applications<br />
<br />
== Menus ==<br />
<br />
The default Openbox menu includes a variety of applications to get you started, but you'll probably want to customize this at some point. There are a number of ways to do so:<br />
<br />
=== Manual configuration ===<br />
<br />
Similar to the {{Filename|rc.xml}} file, you can edit {{Filename|~/.config/openbox/menu.xml}} with your favourite text editor. Although many of the settings are self-explanatory, [http://openbox.org/wiki/Help:Menus full documentation] is available.<br />
<br />
=== MenuMaker ===<br />
<br />
[http://menumaker.sourceforge.net/ MenuMaker] is a powerful tool that creates XML-based menus for a variety of Window Managers, including Openbox. MenuMaker will search your computer for executable programs and create an XML menu based on the results. It can be configured to exclude Legacy X, GNOME, KDE, or Xfce applications if the user desires.<br />
<br />
MenuMaker is available in the community repository:<br />
# pacman -S menumaker<br />
<br />
Once installed, you can generate a complete menu by running:<br />
$ mmaker -v OpenBox3<br />
<br />
By default, MenuMaker will not overwrite an existing menu.xml. To do so, run it with the -f (force) argument:<br />
<br />
$ mmaker -vf OpenBox3<br />
<br />
To see a full list of options, run {{Codeline|mmaker --help}}.<br />
<br />
This will give you a pretty thorough menu. Now you can modify the menu.xml by hand, or simply regenerate the list whenever you install new software.<br />
<br />
=== Obmenu ===<br />
<br />
Obmenu is a GUI-based menu editor for Openbox. For those who don't enjoy editing XML source code, this is probably the best option for you.<br />
<br />
It is available in the community repository:<br />
# pacman -S obmenu<br />
<br />
Once installed, simply run {{Codeline|obmenu}} and add or remove the desired applications.<br />
<br />
==== Obm-xdg ====<br />
<br />
<tt>obm-xdg</tt> is a command-line tool that comes with Obmenu. It can generate a categorized sub-menu of installed GTK/GNOME applications.<br />
<br />
To use obm-xdg, add the following line to {{Filename|~/.config/openbox/menu.xml}}:<br />
<menu execute="obm-xdg" id="xdg-menu" label="xdg"/><br />
<br />
Then run {{Codeline|openbox --reconfigure}} to refresh the Openbox menu. You should now see a sub-menu labeled '''xdg''' in your menu.<br />
<br />
{{Note | If you do not have GNOME installed, then you need to install '''gnome-menus''' package for obm-xdg to work.}}<br />
<br />
=== Python based xdg menu script ===<br />
<br />
This script can be found in Fedora's Openbox package. You will only have to put the script somewhere and add a menu entry.<br />
<br />
Here is my paste: http://pastebin.com/f2f827625<br />
And here is the head: http://cvs.fedoraproject.org/viewvc/devel/openbox/xdg-menu?view=markup<br />
<br />
Download the one you like (maybe you'll prefer the head version of course). You can put the file anywhere, I used ~/Documents/build/xdg-menu (just modify the menu entry later according to YOUR filename/path.)<br />
<br />
Then open your menu.xml with your favourite text editor and add the following entry where you want the new menu (of course, you can modify the label however you want):<br />
<menu id="apps-menu" label="xdgmenu" execute="python /home/shiki/Documents/build/xdg-menu"/><br />
<br />
Save the file, and run: {{Codeline|openbox --reconfigure}}.<br />
<br />
=== Pipe menus ===<br />
<br />
Openbox (and other WMs like WindowMaker and PekWM) allow you to write scripts that dynamically build menus on the fly. Some examples are system monitors, media player controls, and weather forecasts. Many examples can be found on the openbox [http://openbox.org/wiki/Openbox:Pipemenus site].<br />
<br />
Xyne has also created a file browser and brisbin33 has one for scanning for / connecting to wireless hot spots (requires netcfg). The relevant forum posts for these utilities are [http://bbs.archlinux.org/viewtopic.php?id=77197&p=1 here] and [http://bbs.archlinux.org/viewtopic.php?id=78290 here]<br />
<br />
== Startup programs ==<br />
<br />
Openbox features support for running programs at startup. This is provided by the "openbox-session" command.<br />
<br />
There are two ways to enable autostart:<br />
# If you use startx/xinit to log into your X session, edit {{Filename|~/.xinitrc}} and change the line that executes ''openbox'' to execute '''openbox-session''' instead.<br />
# If you log in with GDM/KDM, then select the ''Openbox'' session and it will automatically use autostart.<br />
<br />
Startup programs are managed in {{Filename|~/.config/openbox/autostart.sh}}. Full instructions and best practices for how to do this are available at the [http://openbox.org/wiki/Help:Autostart Openbox website].<br />
<br />
== Themes and appearance ==<br />
<br />
With the exception of the Openbox Themes topic, the following section is intended for users who have configured Openbox to run as a standalone desktop, without the assistance of GNOME, KDE or Xfce.<br />
<br />
=== Openbox themes ===<br />
<br />
Openbox themes control the appearance of window borders, including the titlebar and titlebar buttons. They also determine the appearance of the application menu and on-screen display (OSD). <br />
<br />
Additional themes are available from the standard repositories:<br />
<br />
# pacman -S openbox-themes<br />
<br />
This package is by no means definitive. You can download more themes at websites such as:<br />
*[http://www.box-look.org/index.php?xcontentmode=7402 box-look.org]<br />
*[http://customize.org/browse/tags/openbox customize.org]<br />
*http://www.minuslab.net/themes/<br />
*http://celo.wordpress.com/themes/<br />
*http://vault.openmonkey.com/pages/openbox<br />
*http://hewphoria.com/?p=submission&type=theme&cat=7<br />
<br />
Downloaded themes should be extracted to <tt>~/.themes</tt> and can be installed or selected with the [[Openbox#Preferences|ObConf]] tool.<br />
<br />
Creating new themes is fairly easy and again [http://icculus.org/openbox/index.php/Help:Themes well-documented].<br />
<br />
For a GUI theme editor, take a look at [http://xyne.archlinux.ca/info/obtheme ObTheme].<br />
<br />
=== X11 Appearance ===<br />
<br />
If you are running Openbox as a standalone, you will need to configure .Xdefaults file.<br />
Save a copy to ~/.Xdefaults and /home/root/.Xdefaults for windows opened as Root.<br />
<br />
Xdefaults is a user-level configuration dotfile, typically located at ~/.Xdefaults. When present, it is parsed by the xrdb (Xorg resource database) program automatically when Xorg is started, and can be used to set or override preferences for X and X applications. It can do many operations, including:<br />
<br />
- defining terminal colours<br />
- configuring terminal preferences<br />
- setting DPI, antialiasing, hinting and other X font settings<br />
- changing the Xcursor theme<br />
- theming xscreensaver<br />
- altering preferences on low-level X applications (xclock, xpdf, etc.) <br />
<br />
Xdefaults Arch WiKi<br />
http://wiki.archlinux.org/index.php/Xdefaults<br />
<br />
=== X11 Mouse cursors ===<br />
<br />
Extract the desired Xcursor theme to either <tt>/usr/share/icons</tt> (system-wide access) or <tt>~/.icons</tt> (local user access). There are also a limited amount of themes available in the community repository that can be installed using pacman.<br />
<br />
Add this to {{Filename|~/.Xdefaults}}:<br />
Xcursor.theme: [name-of-cursor-theme]<br />
where {{Codeline|[name-of-cursor-theme]}} is the name of the cursor theme directory. For example:<br />
Xcursor.theme: Vanilla-DMZ-AA<br />
To change the size:<br />
Xcursor.size: [size]<br />
Sometimes it is required to symlink the icon directory into each user directory to make the window manager use them:<br />
$ mkdir ~/.icons<br />
$ ln -s /usr/share/icons/[name-of-cursor-theme] ~/.icons/default<br />
<br />
For more information read the Arch WiKi<br />
http://wiki.archlinux.org/index.php/X11_Cursors<br />
<br />
=== GTK Themes ===<br />
<br />
==== GTK2/GTK+ ====<br />
<br />
First, extract the desired theme to <tt>/usr/share/themes</tt> (system-wide access) or <tt>~/.themes</tt> (local user access), then:<br />
<br />
GTK+ themes can be managed easily with the '''[[LXDE | lxappearance]]''', '''gtk-chtheme''', or '''switch2''' utilities. To install, run:<br />
# pacman -S lxappearance<br />
and/or<br />
# pacman -S gtk-chtheme<br />
and/or<br />
# pacman -S gtk-theme-switch2<br />
<br />
Now you can simply run {{Codeline|lxappearance}}, {{Codeline|gtk-chtheme}} or {{Codeline|switch2}} to set the desired theme.<br />
<br />
==== GTK1 ====<br />
For legacy GTK1 themes, install the '''gtk-theme-switch''' package:<br />
# pacman -S gtk-theme-switch<br />
Then run {{Codeline|switch}} to select a desired theme.<br />
<br />
==== GTK fonts ====<br />
<br />
To manually change the type and size of your fonts, add the following to {{Filename|~/.gtkrc.mine}}:<br />
style "user-font"<br />
{<br />
font_name = "[font-name] [size]"<br />
}<br />
widget_class "*" style "user-font"<br />
gtk-font-name = "[font-name] [size]"<br />
<br />
where {{Codeline|[font-name] [size]}} is the desired font and point size. For example:<br />
style "user-font"<br />
{<br />
font_name = "DejaVu Sans 8"<br />
}<br />
widget_class "*" style "user-font"<br />
gtk-font-name = "DejaVu Sans 8"<br />
<br />
Both {{Codeline|font_name}} and {{Codeline|gtk-font-name}} fields are required for backwards compatibility.<br />
<br />
You can also use '''gtk-chtheme''' or '''lxappearance''' to set GTK font settings. Please refer to the above section.<br />
<br />
==== GTK Icons ====<br />
<br />
First, extract the desired icon theme to <tt>/usr/share/icons</tt> (system-wide access) or <tt>~/.icons</tt> (local user access), then:<br />
<br />
Add the following to {{Filename|~/.gtkrc.mine}}: <br />
gtk-icon-theme-name = "[name-of-icon-theme]"<br />
<br />
where {{Codeline|[name-of-icon-theme]}} is the name of the icon theme directory. For example:<br />
gtk-icon-theme-name = "Tango"<br />
<br />
Ensure {{Filename|~/.gtkrc-2.0}} is configured to parse {{Filename|~/.gtkrc.mine}}:<br />
<br />
# ~/.gtkrc-2.0<br />
# -- THEME AUTO-WRITTEN DO NOT EDIT<br />
include "/usr/share/themes/Rezlooks-Gilouche/gtk-2.0/gtkrc"<br />
include "/home/username/.gtkrc.mine"<br />
# -- THEME AUTO-WRITTEN DO NOT EDIT<br />
<br />
You can use '''lxappearance''' to choose GTK icon themes. Please refer to the above section.<br />
<br />
=== Desktop icons ===<br />
Openbox does not provide a means to display icons on the desktop. Xfdesktop, PcmanFM, [http://rox.sourceforge.net ROX], [http://idesk.sourceforge.net iDesk], or even Nautilus (and the gnome-settings-daemon) can provide this function. <br />
<br />
ROX and PCmanFM have the additional advantage of being lightweight file managers.<br />
<br />
=== Desktop wallpaper ===<br />
<br />
Openbox itself does not include a way to change the wallpaper. This can be done easily with programs like [[Feh]] or [[Nitrogen]]. Other options include ImageMagick, hsetroot and xsetbg. Or Pcmanfm and Xfdesktop can do it too.<br />
<br />
== Recommended programs ==<br />
<br />
There is [[Lightweight Applications|list of Lightweight Software]] at Arch's wiki, most of them nicely fits with Openbox.<br />
<br />
=== Login managers ===<br />
<br />
[http://slim.berlios.de/ SLiM] provides a lightweight and elegant graphical login solution for standalone Openbox configurations. Refer to Arch's [[SLiM]] wiki for detailed instructions.<br />
<br />
[http://qingy.sourceforge.net/ Qingy] is ultralight and very configurable graphical login. It support login to both console and X Windows sessions. It uses [http://www.directfb.org DirectFB], therefore it does not start X Windows unless you choose X Windows session. See article about [[Qingy]] at Arch's wiki.<br />
<br />
=== Composite desktop ===<br />
<br />
[[Xcompmgr]] is a lightweight composite manager capable of rendering drop shadows, fading and simple window transparency within Openbox and other window managers.<br />
(It's worth noting that xcompmgr is no longer developed, and so any issues are unlikely to be fixed)<br />
(Developed an issue with tint2 0.9, the systray icons have a tendency to corrupt)<br />
<br />
[[Cairo Compmgr | Cairo Composite Manager]] -- A versatile and extensible composite manager which uses cairo for rendering, is an alternative.<br />
<br />
=== Panels, trays, and pagers ===<br />
<br />
There are quite a lot of utilities available that provide a panel (taskbar), system tray, and pager to Openbox. The most common are:<br />
<br />
==== Panels ====<br />
* [[PyPanel]]<br />
* [http://nsf.110mb.com/bmpanel/ BMPanel]<br />
* [[tint2]]<br />
* [http://www.gnomefiles.org/app.php/LXPanel LXPanel]<br />
* [http://fbpanel.sourceforge.net fbpanel]<br />
* [http://freshmeat.net/projects/perlpanel/ PerlPanel]<br />
* [http://www.chatjunkies.org/fspanel/ fspanel]<br />
* [http://www.xfce.org/projects/xfce4-panel/ Xfce4-panel]<br />
* [http://live.gnome.org/GnomePanel/ GnomePanel]<br />
* [https://launchpad.net/awn avant-window-navigator]<br />
* [http://developer.berlios.de/projects/cairo-dock/ cairo-dock]<br />
* [http://code.google.com/p/wbar/ wbar]<br />
* [http://www.screenlets.org/ screenlets]<br />
* [http://www.failedprojects.de/pancake/ pancake]<br />
<br />
==== Trays ====<br />
* [http://stalonetray.sourceforge.net/ Stalonetray]<br />
* [http://download.gna.org/fvwm-crystal/trayer/1.0/ Trayer]<br />
<br />
==== Pagers ====<br />
* [http://projects.l3ib.org/trac/visibility Visibility]<br />
* [http://bbtools.sourceforge.net/ bbpager]<br />
* [http://aur.archlinux.org/packages.php?ID=17563 netwmpager]<br />
* [http://useperl.ru/ipager/index.en.html IPager]<br />
* [http://code.google.com/p/neap/ neap]<br />
<br />
Make your choice and add it to your startup file. If you wish to set the desktop layout without using a pager, you can use [http://aur.archlinux.org/packages.php?ID=34376 obsetlayout], which is a packaged version of the setlayout tool from the Openbox wiki.<br />
<br />
=== File managers ===<br />
<br />
There are many possibilities, but the most popular lightweight file managers are:<br />
* [[Thunar]]. Thunar supports auto-mount features and other plugins. <br />
* [http://rox.sourceforge.net ROX] (ROX provides desktop icons)<br />
# pacman -S rox<br />
* [http://pcmanfm.sourceforge.net PCManFM] (pcmanfm also provides desktop icons)<br />
# pacman -S pcmanfm<br />
To access NTFS drives with PCManFM, install ntfs-3g:<br />
# pacman -S ntfs-3g<br />
and make sure you're added to group hal:<br />
# gpasswd -a username hal<br />
For even lighter options, consider [http://www.obsession.se/gentoo/ Gentoo] or [http://emelfm2.net/ emelFM2], both of which use the familiar 'Midnight Commander' two pane layout.<br />
<br />
Others:<br />
Xfe<br />
muCommander<br />
''(Will edit it later after I have tried them both.)''<br />
<br />
Of course, you can also use GNOME's Nautilus. Although slower than the above solutions, it has the additional advantage of VFS support (e.g. remote SSH, FTP and Samba connections)<br />
<br />
=== Application launchers ===<br />
<br />
==== dmenu ====<br />
<br />
Set-up dmenu as described in the [[dmenu]] wiki article. Then, add the following entry to the <keyboard> section {{Filename|~/.config/openbox/rc.xml}} to enable a shortcut to launch dmenu:<br />
<keybind key="W-space"><br />
<action name="Execute"><br />
<execute>dmenu_run</execute><br />
</action><br />
</keybind><br />
<br />
==== Gmrun ====<br />
<br />
[http://sourceforge.net/projects/gmrun gmrun] provides an excellent Run dialog box, similar to the Alt+F2 features found in Gnome and KDE:<br />
# pacman -S gmrun<br />
Add the following entry to the <keyboard> section {{Filename|~/.config/openbox/rc.xml}} to enable Alt+F2 functionality:<br />
<keybind key="A-F2"><br />
<action name="execute"><execute>gmrun</execute></action><br />
</keybind><br />
<br />
==== Bashrun ====<br />
<br />
[http://bashrun.sourceforge.net bashrun] provides a different, barebones approach to a run dialog, using a specialized bash session within a small xterm window. It is available in the community repository and can be launched through the Alt+F2 style approach mentioned previously. To make bashrun act more like a traditional run dialog, add the following entry to the <applications> section {{Filename|~/.config/openbox/rc.xml}}:<br />
<application name="bashrun"><br />
<desktop>all</desktop><br />
<decor>no</decor> # switch to yes if you prefer a bordered window<br />
<focus>yes</focus><br />
<skip_pager>yes</skip_pager><br />
<layer>above</layer><br />
</application><br />
<br />
==== Launchy ====<br />
<br />
[http://www.launchy.net/ Launchy] is a less minimalistic approach; it is skinnable and offers more functionality such as a calculator, checking the weather, etc. Originally for Windows, similar to Gnome Do.<br />
# pacman -S launchy<br />
It is launched by Ctrl+Space key combination.<br />
<br />
==== LXPanel ====<br />
<br />
The LXPanel run dialog can be executed with <br />
lxpanelctl run<br />
<br />
==== gnome-panel ====<br />
<br />
The gnome-panel run dialog can be executed with <br />
gnome-panel-control --run-dialog<br />
<br />
=== Clipboard managers ===<br />
<br />
You may wish to install a clipboard manager for feature rich copy/paste ability. '''xfce4-clipman-plugin, parcellite,''' or '''glipper-old''' may be installed via pacman. Add your choice to autostart.sh. From the terminal, Ctrl+Insert as copy and Shift+Insert as paste generally works as well. You may also copy from terminal with Ctrl+Shift+C, and paste with mouse middle click.<br />
<br />
=== Volume managers ===<br />
<br />
==== gvolwheel ====<br />
<br />
a lightweight audio mixer which lets you control the audio volume through a tray icon [http://aur.archlinux.org/packages.php?ID=25502] <br />
<br />
==== gvtray ====<br />
<br />
A master volume mixer in the system tray [http://aur.archlinux.org/packages.php?ID=6362]<br />
<br />
==== obmixer ====<br />
<br />
Obmixer is a mixer appplet written in C which is intended to be a lightweight alternative to gnome volume control [http://aur.archlinux.org/packages.php?ID=31131]<br />
<br />
==== volti ====<br />
<br />
GTK+ application for controlling audio volume from system tray/notification area [http://aur.archlinux.org/packages.php?ID=33525]<br />
<br />
==== volumeicon ====<br />
<br />
Volume control for your system tray [http://aur.archlinux.org/packages.php?ID=35793]<br />
<br />
==== volwheel ====<br />
<br />
Tray icon to change volume with the mouse [http://www.archlinux.org/packages/community/i686/volwheel/]<br />
<br />
=== Keyboard layout switchers ===<br />
<br />
==== fbxkb ====<br />
<br />
Keyboard indicator and switcher [http://aur.archlinux.org/packages.php?ID=3458]<br />
<br />
==== xxkb ====<br />
<br />
keyboard layout switcher/indicator [http://www.archlinux.org/packages/community/i686/xxkb/]<br />
<br />
==== axkb ====<br />
<br />
QT4 keyboard layout switcher [http://aur.archlinux.org/packages.php?ID=25555]<br />
<br />
==== xneur ====<br />
<br />
X Neural Switcher is a text analyser, it detects the language of input and corrects it if needed [http://aur.archlinux.org/packages.php?ID=9750]<br />
<br />
== Tips and tricks ==<br />
<br />
=== Copy and paste ===<br />
<br />
From the terminal, Ctrl+Insert as copy and Shift+Insert as paste generally works as well. You may also copy from terminal with Ctrl+Shift+C, and paste with mouse middle click.<br />
<br />
=== Transparency ===<br />
<br />
By using the program transset-df, it is virtually the same as [[transset]], (available by: pacman -S transset-df) you can enable transparancy of windows on the fly. For instance by editing the following in {{Filename|~/.config/openbox/rc.xml}} you can have your middle mouse scroll enable and disable transparency by scrolling down and up on the scroll button, respectively, while over the title bar (it is in the <mouse> section):<br />
<context name="Titlebar"><br />
<mousebind button="Left" action="Press"><br />
<action name="Focus"/><br />
<action name="Raise"/><br />
</mousebind><br />
<mousebind button="Left" action="Drag"><br />
<action name="Move"/><br />
</mousebind><br />
<mousebind button="Left" action="DoubleClick"><br />
<action name="ToggleMaximizeFull"/><br />
</mousebind><br />
<mousebind button="Middle" action="Press"><br />
<action name="Lower"/> <br />
<action name="FocusToBottom"/><br />
<action name="Unfocus"/><br />
</mousebind><br />
<mousebind button="Up" action="Click"><br />
<action name= "Execute" ><br />
<execute>transset-df -p .2 --inc </execute><br />
</action><br />
</mousebind><br />
<mousebind button="Down" action="Click"><br />
<action name= "Execute" ><br />
<execute>transset-df -p .2 --dec </execute><br />
</action><br />
</mousebind><br />
<mousebind button="Right" action="Press"><br />
<action name="Focus"/><br />
<action name="Raise"/><br />
<action name="ShowMenu"><br />
<menu>client-menu</menu><br />
</action><br />
</mousebind><br />
</context><br />
As of now, it only appears to work when no other actions are taken.<br />
<br />
=== Xprop values for applications ===<br />
If you use per-application settings frequently, you might find this bash alias handy:<br />
<br />
alias xp='xprop | grep "WM_WINDOW_ROLE\|WM_CLASS" && echo "WM_CLASS(STRING) = \"NAME\", \"CLASS\""'<br />
<br />
To use, run '''{{Codeline|xp}}''' and click on the running program that you'd like to define with per-app settings. The result will display only the info that Openbox requires, namely the WM_WINDOW_ROLE and WM_CLASS (name and class) values:<br />
<br />
[thayer@dublin:~] $ xp<br />
WM_WINDOW_ROLE(STRING) = "roster"<br />
WM_CLASS(STRING) = "gajim.py", "Gajim.py"<br />
WM_CLASS(STRING) = "NAME", "CLASS"<br />
<br />
==== Xprop for Firefox ====<br />
<br />
For whatever reason, Firefox and its open source equivalents will ignore application rules (e.g. <desktop>) unless {{Codeline|class&#61;"Firefox*"}} is used, regardless of what xprop reports as the actual WM_CLASS values.<br />
<br />
=== Linking the menu to a command ===<br />
<br />
Some people would want to link the Openbox main menu, or any other, to a command. This is useful for creating a menu button in a panel, for example. Although Openbox doesn't support this, a very simple script, xdotool, can simulate a keypress by running a command. Xdotool is [http://aur.archlinux.org/packages.php?do_Details=1&ID=14789&O=0&L=0&C=0&K=xdotool&SB=n&SO=a&PP=25&do_MyPackages=0&do_Orphans=0&SeB=nd available on AUR]. To use it, simply add the following code to the <keyboard> section of your {{Filename|rc.xml}}:<br />
<keybind key="A-C-q"><br />
<action name="ShowMenu"><br />
<menu>root-menu</menu><br />
</action><br />
</keybind><br />
Restart/reconfigure Openbox. You can now magically summon your menu at your cursor position by running the following command:<br />
# xdotool key ctrl+alt+q<br />
Of course, you can change the shortcut to your liking.<br />
<br />
=== Urxvt in the background ===<br />
<br />
With Openbox, running a terminal as desktop background is easy. You won't need '''devilspie''' here.<br />
<br />
First you must enable transparency, open your {{Filename|.Xdefaults}} file (if it doesn't exist yet, create it in your home folder).<br />
URxvt*transparent:true<br />
URxvt*scrollBar:false<br />
URxvt*geometry:124x24 #I don't use the whole screen, if you want a full screen term don't bother with this and see below.<br />
URxvt*borderLess:true<br />
URxvt*foreground:Black #Font color. My wallpaper is White, you may wish to change this to White.<br />
<br />
Then edit your {{Filename|.config/openbox/rc.xml}} file:<br />
<application name="URxvt"><br />
<decor>no</decor><br />
<focus>yes</focus><br />
<position><br />
<x>center</x><br />
<y>20</y><br />
</position><br />
<layer>below</layer><br />
<desktop>all</desktop><br />
<maximized>true</maximized> #Only if you want a full size terminal.<br />
</application><br />
<br />
The ''magic'' comes from the {{Codeline|<layer>below</layer>}} line, which place the application under all others. Here Urxvt is displayed on all desktops, change it to your convenience.<br />
<br />
Note: Instead of using <application name="URxvt">, you can use another name ("URxvt-bg" for example), and use the -name option when starting uxrvt. That way, only the urxvt terminals which you choose to name URxvt-bg would be captured and modified by the application rule in rc.xml. For example: urxvt -name URxvt-bg (case sensitive)<br />
<br />
=== Keyboard Volume Control ===<br />
If you use ALSA for sound, you can use the amixer program to adjust the volume of sound. You can use Openbox's keybindings to act like multimedia keys. (Alternatively, you can probably find out the names of your real multimedia keys and map them.) For example, in the <keyboard> section of rc.xml:<br />
<br />
<keybind key="W-Up"><br />
<action name="Execute"><br />
<command>amixer set Master 5%+</command><br />
</action><br />
</keybind><br />
<br />
This binds Windows key + Up arrow to increase your master ALSA volume by 5%. Corresponding binding for volume down:<br />
<br />
<keybind key="W-Down"><br />
<action name="Execute"><br />
<command>amixer set Master 5%-</command><br />
</action><br />
</keybind><br />
<br />
As another example you can also use the XF86Audio keybindings:<br />
<br />
<keybind key="XF86AudioRaiseVolume"><br />
<action name="Execute"><br />
<command>amixer set Master 5%+ unmute</command><br />
</action><br />
</keybind><br />
<keybind key="XF86AudioLowerVolume"><br />
<action name="Execute"><br />
<command>amixer set Master 5%- unmute</command><br />
</action><br />
</keybind><br />
<keybind key="XF86AudioMute"><br />
<action name="Execute"><br />
<command>amixer set Master toggle</command><br />
</action><br />
</keybind><br />
<br />
The above example should work for the majority of multimedia keyboards. It should enable to raise, lower and mute the Master control of your audio device by using the respective multimedia keyboard keys. Notice also that in this example:<br />
<br />
* The "Mute" key should unmute the Master control if it is already in mute mode.<br />
* The "Raise" and "Lower" keys should unmute the Master control if it is in mute mode.<br />
<br />
== Resources ==<br />
<br />
* [http://openbox.org/ Openbox Website] &ndash; The official website<br />
* [http://planetob.openmonkey.com/ Planet Openbox] &ndash; Openbox news portal<br />
* [http://www.box-look.org/ Box-Look.org] &ndash; A good resource for themes and related artwork<br />
* [https://bbs.archlinux.org/viewtopic.php?id=93126 Openbox Hacks and Configs Thread] &ndash; @ Arch Linux Forums<br />
* [https://bbs.archlinux.org/viewtopic.php?id=45692] Openbox Screenshots Thread] &ndash; @ Arch Linux Forums<br />
<!-- vim: set ft=Wikipedia: --></div>Rent0nhttps://wiki.archlinux.org/index.php?title=Openbox&diff=112425Openbox2010-07-21T14:30:45Z<p>Rent0n: /* Resources */</p>
<hr />
<div>[[Category:Stacking WMs (English)]]<br />
[[Category:HOWTOs (English)]]<br />
{{i18n|Openbox}}<br />
<br />
Openbox is a lightweight and highly configurable window manager with extensive standards support. Its features are well-documented at the [http://openbox.org/ official website]. This article will pertain to running Openbox under Arch Linux.<br />
<br />
== Installation ==<br />
<br />
Openbox is available from the standard repositories:<br />
# pacman -S openbox<br />
<br />
Once installed, pacman will direct you to copy the default {{Filename|menu.xml}} and {{Filename|rc.xml}} configuration files to <tt>~/.config/openbox/</tt>, for example: <br />
<br />
{{Note | Do this as a regular user, not as root.}}<br />
<br />
$ mkdir -p ~/.config/openbox/<br />
$ cp /etc/xdg/openbox/rc.xml ~/.config/openbox/rc.xml<br />
$ cp /etc/xdg/openbox/menu.xml ~/.config/openbox/menu.xml<br />
<br />
{{Filename|rc.xml}} is the core configuration file for Openbox. It is used to manage keyboard shortcuts, themes, virtual desktops and other features.<br />
<br />
{{Filename|menu.xml}} controls the Openbox application menu that appears when you click on your desktop. The default items are pretty sparse, but it's very easy to modify the menu structure to suit your needs. See the menu section below for more details, or visit the [http://icculus.org/openbox/ Openbox website].<br />
<br />
== Stand-alone window manager ==<br />
<br />
To run Openbox on its own, simply add the following to the bottom of {{Filename|~/.xinitrc}}:<br />
exec openbox-session<br />
<br />
If you have used another window manager before, such as Xfce, and Openbox won't start after logging out of X, try moving the autostart folder:<br />
mv ~/.config/autostart ~/.config/autostart-bak<br />
<br />
Using D-Bus/HAL or similar, use this instead:<br />
exec ck-launch-session openbox-session<br />
<br />
If you use also '''polkit''' and '''D-Bus''' (e.g. for automount drivers in nautilus from Gnome 2.28 / 2.30) use:<br />
exec ck-launch-session dbus-launch openbox-session<br />
<br />
{{Note | [http://www.archlinux.org/packages/extra/i686/pyxdg/ pyxdg] is required for Openbox's xdg-autostart}}<br />
<br />
== Window manager for Desktop Environments ==<br />
<br />
=== GNOME ===<br />
==== GNOME 2.26 ====<br />
'''''Follow the next guide for GNOME 2.24. If it fails try this:'''''<br />
<br />
If after installing openbox and trying to log into the 'Gnome/openbox' session but it always fails then you can do the following as one way to achieve running openbox as your window manager every time you log into the 'Gnome' session from your login manager (xdm, gdm, kdm, entrance, slim, etc.)<br />
<br />
#Log into your Gnome only session (which would still be using metacity as its window manager) if you aren't already.<br />
#Install openbox if you have not done so already<br />
#Explore your menus to ''System &rarr; Preferences &rarr; Startup Applications'' (possibly named 'Session' for older versions of Gnome)<br />
#Open Startup Application, select '+ Add' and enter the text as seen in the box below whilst omitting the text behind the #.<br />
#Now hit the 'Add' button for that data entry window and make sure the checkbox beside your new entry is selected.<br />
#Thus log out of your gnome session and log back in and you should be running openbox as your window manager.<br />
#Enjoy!<br />
<br />
Name: Openbox Windox Manager # Can be changed<br />
Command: openbox --replace # Text should not be removed from this line, but possibly added to it<br />
Comment: Replaces metacity with openbox # Can be changed<br />
<br />
This creates an entry in a startup list which is executed by gnome everytime that particular user's gnome-session is started.<br />
<br />
==== GNOME 2.24 ====<br />
First, create {{Filename|/usr/share/applications/openbox.desktop}} containing the following:<br />
[Desktop Entry]<br />
Type=Application<br />
Encoding=UTF-8<br />
Name=OpenBox<br />
Exec=openbox<br />
NoDisplay=true<br />
# name of loadable control center module<br />
X-GNOME-WMSettingsModule=openbox<br />
# name we put on the WM spec check window<br />
X-GNOME-WMName=OpenBox<br />
Then, in gconf, set '''/desktop/gnome/session/required_components/windowmanager''' to '''openbox''':<br />
$ gconftool-2 -s -t string /desktop/gnome/session/required_components/windowmanager openbox<br />
Finally, choose the '''GNOME''' session in the GDM sessions menu.<br />
<br />
==== GNOME 2.22 and previous ====<br />
# If you use GDM, select the "GNOME/Openbox" login option<br />
# If you use startx, add {{Codeline|exec openbox-gnome-session}} to {{Filename|~/.xinitrc}}<br />
# From the shell:<br />
$ xinit /usr/bin/openbox-gnome-session<br />
<br />
=== KDE ===<br />
# If you use KDM, select the "KDE/Openbox" login option<br />
# If you use startx, add {{Codeline|exec openbox-kde-session}} to {{Filename|~/.xinitrc}}<br />
# From the shell:<br />
$ xinit /usr/bin/openbox-kde-session<br />
<br />
=== Xfce4 ===<br />
Log into a normal Xfce4 session. From your terminal of choice, do:<br />
$ killall xfwm4 ; openbox & exit<br />
<br />
This will kill xfwm4, run Openbox, and close the terminal. <br />
<br />
Log out, making sure to check the "Save session for future logins" checkbox. On next login, Xfce4 will use Openbox as its WM. To be able to exit the session using xfce4-session, open your file {{Filename|~/.config/openbox/menu.xml}} (if it isn't there, copy it from {{Filename|/etc/xdg/openbox/menu.xml}}). <br />
<br />
Look for the entry:<br />
<br />
<item label="Exit Openbox"><br />
<action name="Exit"><br />
<prompt>yes</prompt><br />
</action><br />
</item><br />
<br />
and change it to:<br />
<br />
<item label="Exit Openbox"><br />
<action name="Execute"><br />
<prompt>yes</prompt><br />
<command>xfce4-session-logout</command><br />
</action><br />
</item><br />
<br />
Otherwise, using the "Exit" entry of the root-menu will cause Openbox to terminate its execution, leaving you without a window manager.<br />
<br />
If you have an issue changing between virtual desktops with the mouse wheel skipping over virtual desktops, open your {{Filename|~/.config/openbox/rc.xml}} file and move the mouse binds with actions "DesktopPrevious" and "DesktopNext" from the context "Desktop" to the context "Root" (you may need to define the Root context).<br />
<br />
If you want to use the Openbox root-menu instead of Xfce's, you may terminate Xfdesktop by running the following command in a terminal:<br />
$ xfdesktop --quit<br />
<br />
However, Xfdesktop manages the wallpaper and desktop icons, requiring you to use other utilities, such as ROX, for these functions.<br />
<br />
(When terminating Xfdesktop, the above issue with the virtual desktops is no longer a problem.)<br />
<br />
== Preferences ==<br />
<br />
Currently, there are two options for configuring the core Openbox preferences; manually edit the {{Filename|rc.xml}}, or use the ObConf tool.<br />
<br />
=== Manual configuration ===<br />
<br />
To configure Openbox manually, simply edit {{Filename|~/.config/openbox/rc.xml}} with your favorite text editor. The config file provides plenty of comments throughout, and [http://openbox.org/wiki/Configuration full documentation] is available at the official website.<br />
<br />
=== ObConf ===<br />
<br />
[http://icculus.org/openbox/index.php/ObConf:About ObConf] is GUI-based Openbox configuration tool, which can be used to set most preferences including themes, virtual desktops, window properties and desktop margins.<br />
<br />
To install ObConf, run:<br />
# pacman -S obconf<br />
<br />
{{Note | ObConf cannot be used to configure keyboard shortcuts and some other advanced features. For these modifications, you must edit {{Filename|rc.xml}} manually (see above). Other option is [http://code.google.com/p/obkey/ ObKey] application (available in [[AUR]]).}}<br />
<br />
=== Application configuration ===<br />
<br />
Openbox features per-application settings, allowing you to define rules for your programs. For example, you can:<br />
* load your web browser on a certain desktop<br />
* load your terminal without a window border<br />
* load your torrent client at a certain position on your screen<br />
<br />
These are defined in {{Filename|~/.config/openbox/rc.xml}}. As you might expect, the instructions are well-documented within the file itself. Full details can also be found here: http://openbox.org/wiki/Help:Applications<br />
<br />
== Menus ==<br />
<br />
The default Openbox menu includes a variety of applications to get you started, but you'll probably want to customize this at some point. There are a number of ways to do so:<br />
<br />
=== Manual configuration ===<br />
<br />
Similar to the {{Filename|rc.xml}} file, you can edit {{Filename|~/.config/openbox/menu.xml}} with your favourite text editor. Although many of the settings are self-explanatory, [http://openbox.org/wiki/Help:Menus full documentation] is available.<br />
<br />
=== MenuMaker ===<br />
<br />
[http://menumaker.sourceforge.net/ MenuMaker] is a powerful tool that creates XML-based menus for a variety of Window Managers, including Openbox. MenuMaker will search your computer for executable programs and create an XML menu based on the results. It can be configured to exclude Legacy X, GNOME, KDE, or Xfce applications if the user desires.<br />
<br />
MenuMaker is available in the community repository:<br />
# pacman -S menumaker<br />
<br />
Once installed, you can generate a complete menu by running:<br />
$ mmaker -v OpenBox3<br />
<br />
By default, MenuMaker will not overwrite an existing menu.xml. To do so, run it with the -f (force) argument:<br />
<br />
$ mmaker -vf OpenBox3<br />
<br />
To see a full list of options, run {{Codeline|mmaker --help}}.<br />
<br />
This will give you a pretty thorough menu. Now you can modify the menu.xml by hand, or simply regenerate the list whenever you install new software.<br />
<br />
=== Obmenu ===<br />
<br />
Obmenu is a GUI-based menu editor for Openbox. For those who don't enjoy editing XML source code, this is probably the best option for you.<br />
<br />
It is available in the community repository:<br />
# pacman -S obmenu<br />
<br />
Once installed, simply run {{Codeline|obmenu}} and add or remove the desired applications.<br />
<br />
==== Obm-xdg ====<br />
<br />
<tt>obm-xdg</tt> is a command-line tool that comes with Obmenu. It can generate a categorized sub-menu of installed GTK/GNOME applications.<br />
<br />
To use obm-xdg, add the following line to {{Filename|~/.config/openbox/menu.xml}}:<br />
<menu execute="obm-xdg" id="xdg-menu" label="xdg"/><br />
<br />
Then run {{Codeline|openbox --reconfigure}} to refresh the Openbox menu. You should now see a sub-menu labeled '''xdg''' in your menu.<br />
<br />
{{Note | If you do not have GNOME installed, then you need to install '''gnome-menus''' package for obm-xdg to work.}}<br />
<br />
=== Python based xdg menu script ===<br />
<br />
This script can be found in Fedora's Openbox package. You will only have to put the script somewhere and add a menu entry.<br />
<br />
Here is my paste: http://pastebin.com/f2f827625<br />
And here is the head: http://cvs.fedoraproject.org/viewvc/devel/openbox/xdg-menu?view=markup<br />
<br />
Download the one you like (maybe you'll prefer the head version of course). You can put the file anywhere, I used ~/Documents/build/xdg-menu (just modify the menu entry later according to YOUR filename/path.)<br />
<br />
Then open your menu.xml with your favourite text editor and add the following entry where you want the new menu (of course, you can modify the label however you want):<br />
<menu id="apps-menu" label="xdgmenu" execute="python /home/shiki/Documents/build/xdg-menu"/><br />
<br />
Save the file, and run: {{Codeline|openbox --reconfigure}}.<br />
<br />
=== Pipe menus ===<br />
<br />
Openbox (and other WMs like WindowMaker and PekWM) allow you to write scripts that dynamically build menus on the fly. Some examples are system monitors, media player controls, and weather forecasts. Many examples can be found on the openbox [http://openbox.org/wiki/Openbox:Pipemenus site].<br />
<br />
Xyne has also created a file browser and brisbin33 has one for scanning for / connecting to wireless hot spots (requires netcfg). The relevant forum posts for these utilities are [http://bbs.archlinux.org/viewtopic.php?id=77197&p=1 here] and [http://bbs.archlinux.org/viewtopic.php?id=78290 here]<br />
<br />
== Startup programs ==<br />
<br />
Openbox features support for running programs at startup. This is provided by the "openbox-session" command.<br />
<br />
There are two ways to enable autostart:<br />
# If you use startx/xinit to log into your X session, edit {{Filename|~/.xinitrc}} and change the line that executes ''openbox'' to execute '''openbox-session''' instead.<br />
# If you log in with GDM/KDM, then select the ''Openbox'' session and it will automatically use autostart.<br />
<br />
Startup programs are managed in {{Filename|~/.config/openbox/autostart.sh}}. Full instructions and best practices for how to do this are available at the [http://openbox.org/wiki/Help:Autostart Openbox website].<br />
<br />
== Themes and appearance ==<br />
<br />
With the exception of the Openbox Themes topic, the following section is intended for users who have configured Openbox to run as a standalone desktop, without the assistance of GNOME, KDE or Xfce.<br />
<br />
=== Openbox themes ===<br />
<br />
Openbox themes control the appearance of window borders, including the titlebar and titlebar buttons. They also determine the appearance of the application menu and on-screen display (OSD). <br />
<br />
Additional themes are available from the standard repositories:<br />
<br />
# pacman -S openbox-themes<br />
<br />
This package is by no means definitive. You can download more themes at websites such as:<br />
*[http://www.box-look.org/index.php?xcontentmode=7402 box-look.org]<br />
*[http://customize.org/browse/tags/openbox customize.org]<br />
*http://www.minuslab.net/themes/<br />
*http://celo.wordpress.com/themes/<br />
*http://vault.openmonkey.com/pages/openbox<br />
*http://hewphoria.com/?p=submission&type=theme&cat=7<br />
<br />
Downloaded themes should be extracted to <tt>~/.themes</tt> and can be installed or selected with the [[Openbox#Preferences|ObConf]] tool.<br />
<br />
Creating new themes is fairly easy and again [http://icculus.org/openbox/index.php/Help:Themes well-documented].<br />
<br />
For a GUI theme editor, take a look at [http://xyne.archlinux.ca/info/obtheme ObTheme].<br />
<br />
=== X11 Appearance ===<br />
<br />
If you are running Openbox as a standalone, you will need to configure .Xdefaults file.<br />
Save a copy to ~/.Xdefaults and /home/root/.Xdefaults for windows opened as Root.<br />
<br />
Xdefaults is a user-level configuration dotfile, typically located at ~/.Xdefaults. When present, it is parsed by the xrdb (Xorg resource database) program automatically when Xorg is started, and can be used to set or override preferences for X and X applications. It can do many operations, including:<br />
<br />
- defining terminal colours<br />
- configuring terminal preferences<br />
- setting DPI, antialiasing, hinting and other X font settings<br />
- changing the Xcursor theme<br />
- theming xscreensaver<br />
- altering preferences on low-level X applications (xclock, xpdf, etc.) <br />
<br />
Xdefaults Arch WiKi<br />
http://wiki.archlinux.org/index.php/Xdefaults<br />
<br />
=== X11 Mouse cursors ===<br />
<br />
Extract the desired Xcursor theme to either <tt>/usr/share/icons</tt> (system-wide access) or <tt>~/.icons</tt> (local user access). There are also a limited amount of themes available in the community repository that can be installed using pacman.<br />
<br />
Add this to {{Filename|~/.Xdefaults}}:<br />
Xcursor.theme: [name-of-cursor-theme]<br />
where {{Codeline|[name-of-cursor-theme]}} is the name of the cursor theme directory. For example:<br />
Xcursor.theme: Vanilla-DMZ-AA<br />
To change the size:<br />
Xcursor.size: [size]<br />
Sometimes it is required to symlink the icon directory into each user directory to make the window manager use them:<br />
$ mkdir ~/.icons<br />
$ ln -s /usr/share/icons/[name-of-cursor-theme] ~/.icons/default<br />
<br />
For more information read the Arch WiKi<br />
http://wiki.archlinux.org/index.php/X11_Cursors<br />
<br />
=== GTK Themes ===<br />
<br />
==== GTK2/GTK+ ====<br />
<br />
First, extract the desired theme to <tt>/usr/share/themes</tt> (system-wide access) or <tt>~/.themes</tt> (local user access), then:<br />
<br />
GTK+ themes can be managed easily with the '''[[LXDE | lxappearance]]''', '''gtk-chtheme''', or '''switch2''' utilities. To install, run:<br />
# pacman -S lxappearance<br />
and/or<br />
# pacman -S gtk-chtheme<br />
and/or<br />
# pacman -S gtk-theme-switch2<br />
<br />
Now you can simply run {{Codeline|lxappearance}}, {{Codeline|gtk-chtheme}} or {{Codeline|switch2}} to set the desired theme.<br />
<br />
==== GTK1 ====<br />
For legacy GTK1 themes, install the '''gtk-theme-switch''' package:<br />
# pacman -S gtk-theme-switch<br />
Then run {{Codeline|switch}} to select a desired theme.<br />
<br />
==== GTK fonts ====<br />
<br />
To manually change the type and size of your fonts, add the following to {{Filename|~/.gtkrc.mine}}:<br />
style "user-font"<br />
{<br />
font_name = "[font-name] [size]"<br />
}<br />
widget_class "*" style "user-font"<br />
gtk-font-name = "[font-name] [size]"<br />
<br />
where {{Codeline|[font-name] [size]}} is the desired font and point size. For example:<br />
style "user-font"<br />
{<br />
font_name = "DejaVu Sans 8"<br />
}<br />
widget_class "*" style "user-font"<br />
gtk-font-name = "DejaVu Sans 8"<br />
<br />
Both {{Codeline|font_name}} and {{Codeline|gtk-font-name}} fields are required for backwards compatibility.<br />
<br />
You can also use '''gtk-chtheme''' or '''lxappearance''' to set GTK font settings. Please refer to the above section.<br />
<br />
==== GTK Icons ====<br />
<br />
First, extract the desired icon theme to <tt>/usr/share/icons</tt> (system-wide access) or <tt>~/.icons</tt> (local user access), then:<br />
<br />
Add the following to {{Filename|~/.gtkrc.mine}}: <br />
gtk-icon-theme-name = "[name-of-icon-theme]"<br />
<br />
where {{Codeline|[name-of-icon-theme]}} is the name of the icon theme directory. For example:<br />
gtk-icon-theme-name = "Tango"<br />
<br />
Ensure {{Filename|~/.gtkrc-2.0}} is configured to parse {{Filename|~/.gtkrc.mine}}:<br />
<br />
# ~/.gtkrc-2.0<br />
# -- THEME AUTO-WRITTEN DO NOT EDIT<br />
include "/usr/share/themes/Rezlooks-Gilouche/gtk-2.0/gtkrc"<br />
include "/home/username/.gtkrc.mine"<br />
# -- THEME AUTO-WRITTEN DO NOT EDIT<br />
<br />
You can use '''lxappearance''' to choose GTK icon themes. Please refer to the above section.<br />
<br />
=== Desktop icons ===<br />
Openbox does not provide a means to display icons on the desktop. Xfdesktop, PcmanFM, [http://rox.sourceforge.net ROX], [http://idesk.sourceforge.net iDesk], or even Nautilus (and the gnome-settings-daemon) can provide this function. <br />
<br />
ROX and PCmanFM have the additional advantage of being lightweight file managers.<br />
<br />
=== Desktop wallpaper ===<br />
<br />
Openbox itself does not include a way to change the wallpaper. This can be done easily with programs like [[Feh]] or [[Nitrogen]]. Other options include ImageMagick, hsetroot and xsetbg. Or Pcmanfm and Xfdesktop can do it too.<br />
<br />
== Recommended programs ==<br />
<br />
There is [[Lightweight Applications|list of Lightweight Software]] at Arch's wiki, most of them nicely fits with Openbox.<br />
<br />
=== Login managers ===<br />
<br />
[http://slim.berlios.de/ SLiM] provides a lightweight and elegant graphical login solution for standalone Openbox configurations. Refer to Arch's [[SLiM]] wiki for detailed instructions.<br />
<br />
[http://qingy.sourceforge.net/ Qingy] is ultralight and very configurable graphical login. It support login to both console and X Windows sessions. It uses [http://www.directfb.org DirectFB], therefore it does not start X Windows unless you choose X Windows session. See article about [[Qingy]] at Arch's wiki.<br />
<br />
=== Composite desktop ===<br />
<br />
[[Xcompmgr]] is a lightweight composite manager capable of rendering drop shadows, fading and simple window transparency within Openbox and other window managers.<br />
(It's worth noting that xcompmgr is no longer developed, and so any issues are unlikely to be fixed)<br />
(Developed an issue with tint2 0.9, the systray icons have a tendency to corrupt)<br />
<br />
[[Cairo Compmgr | Cairo Composite Manager]] -- A versatile and extensible composite manager which uses cairo for rendering, is an alternative.<br />
<br />
=== Panels, trays, and pagers ===<br />
<br />
There are quite a lot of utilities available that provide a panel (taskbar), system tray, and pager to Openbox. The most common are:<br />
<br />
==== Panels ====<br />
* [[PyPanel]]<br />
* [http://nsf.110mb.com/bmpanel/ BMPanel]<br />
* [[tint2]]<br />
* [http://www.gnomefiles.org/app.php/LXPanel LXPanel]<br />
* [http://fbpanel.sourceforge.net fbpanel]<br />
* [http://freshmeat.net/projects/perlpanel/ PerlPanel]<br />
* [http://www.chatjunkies.org/fspanel/ fspanel]<br />
* [http://www.xfce.org/projects/xfce4-panel/ Xfce4-panel]<br />
* [http://live.gnome.org/GnomePanel/ GnomePanel]<br />
* [https://launchpad.net/awn avant-window-navigator]<br />
* [http://developer.berlios.de/projects/cairo-dock/ cairo-dock]<br />
* [http://code.google.com/p/wbar/ wbar]<br />
* [http://www.screenlets.org/ screenlets]<br />
* [http://www.failedprojects.de/pancake/ pancake]<br />
<br />
==== Trays ====<br />
* [http://stalonetray.sourceforge.net/ Stalonetray]<br />
* [http://download.gna.org/fvwm-crystal/trayer/1.0/ Trayer]<br />
<br />
==== Pagers ====<br />
* [http://projects.l3ib.org/trac/visibility Visibility]<br />
* [http://bbtools.sourceforge.net/ bbpager]<br />
* [http://aur.archlinux.org/packages.php?ID=17563 netwmpager]<br />
* [http://useperl.ru/ipager/index.en.html IPager]<br />
* [http://code.google.com/p/neap/ neap]<br />
<br />
Make your choice and add it to your startup file. If you wish to set the desktop layout without using a pager, you can use [http://aur.archlinux.org/packages.php?ID=34376 obsetlayout], which is a packaged version of the setlayout tool from the Openbox wiki.<br />
<br />
=== File managers ===<br />
<br />
There are many possibilities, but the most popular lightweight file managers are:<br />
* [[Thunar]]. Thunar supports auto-mount features and other plugins. <br />
* [http://rox.sourceforge.net ROX] (ROX provides desktop icons)<br />
# pacman -S rox<br />
* [http://pcmanfm.sourceforge.net PCManFM] (pcmanfm also provides desktop icons)<br />
# pacman -S pcmanfm<br />
To access NTFS drives with PCManFM, install ntfs-3g:<br />
# pacman -S ntfs-3g<br />
and make sure you're added to group hal:<br />
# gpasswd -a username hal<br />
For even lighter options, consider [http://www.obsession.se/gentoo/ Gentoo] or [http://emelfm2.net/ emelFM2], both of which use the familiar 'Midnight Commander' two pane layout.<br />
<br />
Others:<br />
Xfe<br />
muCommander<br />
''(Will edit it later after I have tried them both.)''<br />
<br />
Of course, you can also use GNOME's Nautilus. Although slower than the above solutions, it has the additional advantage of VFS support (e.g. remote SSH, FTP and Samba connections)<br />
<br />
=== Application launchers ===<br />
<br />
==== dmenu ====<br />
<br />
Set-up dmenu as described in the [[dmenu]] wiki article. Then, add the following entry to the <keyboard> section {{Filename|~/.config/openbox/rc.xml}} to enable a shortcut to launch dmenu:<br />
<keybind key="W-space"><br />
<action name="Execute"><br />
<execute>dmenu_run</execute><br />
</action><br />
</keybind><br />
<br />
==== Gmrun ====<br />
<br />
[http://sourceforge.net/projects/gmrun gmrun] provides an excellent Run dialog box, similar to the Alt+F2 features found in Gnome and KDE:<br />
# pacman -S gmrun<br />
Add the following entry to the <keyboard> section {{Filename|~/.config/openbox/rc.xml}} to enable Alt+F2 functionality:<br />
<keybind key="A-F2"><br />
<action name="execute"><execute>gmrun</execute></action><br />
</keybind><br />
<br />
==== Bashrun ====<br />
<br />
[http://bashrun.sourceforge.net bashrun] provides a different, barebones approach to a run dialog, using a specialized bash session within a small xterm window. It is available in the community repository and can be launched through the Alt+F2 style approach mentioned previously. To make bashrun act more like a traditional run dialog, add the following entry to the <applications> section {{Filename|~/.config/openbox/rc.xml}}:<br />
<application name="bashrun"><br />
<desktop>all</desktop><br />
<decor>no</decor> # switch to yes if you prefer a bordered window<br />
<focus>yes</focus><br />
<skip_pager>yes</skip_pager><br />
<layer>above</layer><br />
</application><br />
<br />
==== Launchy ====<br />
<br />
[http://www.launchy.net/ Launchy] is a less minimalistic approach; it is skinnable and offers more functionality such as a calculator, checking the weather, etc. Originally for Windows, similar to Gnome Do.<br />
# pacman -S launchy<br />
It is launched by Ctrl+Space key combination.<br />
<br />
==== LXPanel ====<br />
<br />
The LXPanel run dialog can be executed with <br />
lxpanelctl run<br />
<br />
==== gnome-panel ====<br />
<br />
The gnome-panel run dialog can be executed with <br />
gnome-panel-control --run-dialog<br />
<br />
=== Clipboard managers ===<br />
<br />
You may wish to install a clipboard manager for feature rich copy/paste ability. '''xfce4-clipman-plugin, parcellite,''' or '''glipper-old''' may be installed via pacman. Add your choice to autostart.sh. From the terminal, Ctrl+Insert as copy and Shift+Insert as paste generally works as well. You may also copy from terminal with Ctrl+Shift+C, and paste with mouse middle click.<br />
<br />
=== Volume managers ===<br />
<br />
==== gvolwheel ====<br />
<br />
a lightweight audio mixer which lets you control the audio volume through a tray icon [http://aur.archlinux.org/packages.php?ID=25502] <br />
<br />
==== gvtray ====<br />
<br />
A master volume mixer in the system tray [http://aur.archlinux.org/packages.php?ID=6362]<br />
<br />
==== obmixer ====<br />
<br />
Obmixer is a mixer appplet written in C which is intended to be a lightweight alternative to gnome volume control [http://aur.archlinux.org/packages.php?ID=31131]<br />
<br />
==== volti ====<br />
<br />
GTK+ application for controlling audio volume from system tray/notification area [http://aur.archlinux.org/packages.php?ID=33525]<br />
<br />
==== volumeicon ====<br />
<br />
Volume control for your system tray [http://aur.archlinux.org/packages.php?ID=35793]<br />
<br />
==== volwheel ====<br />
<br />
Tray icon to change volume with the mouse [http://www.archlinux.org/packages/community/i686/volwheel/]<br />
<br />
=== Keyboard layout switchers ===<br />
<br />
==== fbxkb ====<br />
<br />
Keyboard indicator and switcher [http://aur.archlinux.org/packages.php?ID=3458]<br />
<br />
==== xxkb ====<br />
<br />
keyboard layout switcher/indicator [http://www.archlinux.org/packages/community/i686/xxkb/]<br />
<br />
==== axkb ====<br />
<br />
QT4 keyboard layout switcher [http://aur.archlinux.org/packages.php?ID=25555]<br />
<br />
==== xneur ====<br />
<br />
X Neural Switcher is a text analyser, it detects the language of input and corrects it if needed [http://aur.archlinux.org/packages.php?ID=9750]<br />
<br />
== Tips and tricks ==<br />
<br />
=== Copy and paste ===<br />
<br />
From the terminal, Ctrl+Insert as copy and Shift+Insert as paste generally works as well. You may also copy from terminal with Ctrl+Shift+C, and paste with mouse middle click.<br />
<br />
=== Transparency ===<br />
<br />
By using the program transset-df, it is virtually the same as [[transset]], (available by: pacman -S transset-df) you can enable transparancy of windows on the fly. For instance by editing the following in {{Filename|~/.config/openbox/rc.xml}} you can have your middle mouse scroll enable and disable transparency by scrolling down and up on the scroll button, respectively, while over the title bar (it is in the <mouse> section):<br />
<context name="Titlebar"><br />
<mousebind button="Left" action="Press"><br />
<action name="Focus"/><br />
<action name="Raise"/><br />
</mousebind><br />
<mousebind button="Left" action="Drag"><br />
<action name="Move"/><br />
</mousebind><br />
<mousebind button="Left" action="DoubleClick"><br />
<action name="ToggleMaximizeFull"/><br />
</mousebind><br />
<mousebind button="Middle" action="Press"><br />
<action name="Lower"/> <br />
<action name="FocusToBottom"/><br />
<action name="Unfocus"/><br />
</mousebind><br />
<mousebind button="Up" action="Click"><br />
<action name= "Execute" ><br />
<execute>transset-df -p .2 --inc </execute><br />
</action><br />
</mousebind><br />
<mousebind button="Down" action="Click"><br />
<action name= "Execute" ><br />
<execute>transset-df -p .2 --dec </execute><br />
</action><br />
</mousebind><br />
<mousebind button="Right" action="Press"><br />
<action name="Focus"/><br />
<action name="Raise"/><br />
<action name="ShowMenu"><br />
<menu>client-menu</menu><br />
</action><br />
</mousebind><br />
</context><br />
As of now, it only appears to work when no other actions are taken.<br />
<br />
=== Xprop values for applications ===<br />
If you use per-application settings frequently, you might find this bash alias handy:<br />
<br />
alias xp='xprop | grep "WM_WINDOW_ROLE\|WM_CLASS" && echo "WM_CLASS(STRING) = \"NAME\", \"CLASS\""'<br />
<br />
To use, run '''{{Codeline|xp}}''' and click on the running program that you'd like to define with per-app settings. The result will display only the info that Openbox requires, namely the WM_WINDOW_ROLE and WM_CLASS (name and class) values:<br />
<br />
[thayer@dublin:~] $ xp<br />
WM_WINDOW_ROLE(STRING) = "roster"<br />
WM_CLASS(STRING) = "gajim.py", "Gajim.py"<br />
WM_CLASS(STRING) = "NAME", "CLASS"<br />
<br />
==== Xprop for Firefox ====<br />
<br />
For whatever reason, Firefox and its open source equivalents will ignore application rules (e.g. <desktop>) unless {{Codeline|class&#61;"Firefox*"}} is used, regardless of what xprop reports as the actual WM_CLASS values.<br />
<br />
=== Linking the menu to a command ===<br />
<br />
Some people would want to link the Openbox main menu, or any other, to a command. This is useful for creating a menu button in a panel, for example. Although Openbox doesn't support this, a very simple script, xdotool, can simulate a keypress by running a command. Xdotool is [http://aur.archlinux.org/packages.php?do_Details=1&ID=14789&O=0&L=0&C=0&K=xdotool&SB=n&SO=a&PP=25&do_MyPackages=0&do_Orphans=0&SeB=nd available on AUR]. To use it, simply add the following code to the <keyboard> section of your {{Filename|rc.xml}}:<br />
<keybind key="A-C-q"><br />
<action name="ShowMenu"><br />
<menu>root-menu</menu><br />
</action><br />
</keybind><br />
Restart/reconfigure Openbox. You can now magically summon your menu at your cursor position by running the following command:<br />
# xdotool key ctrl+alt+q<br />
Of course, you can change the shortcut to your liking.<br />
<br />
=== Urxvt in the background ===<br />
<br />
With Openbox, running a terminal as desktop background is easy. You won't need '''devilspie''' here.<br />
<br />
First you must enable transparency, open your {{Filename|.Xdefaults}} file (if it doesn't exist yet, create it in your home folder).<br />
URxvt*transparent:true<br />
URxvt*scrollBar:false<br />
URxvt*geometry:124x24 #I don't use the whole screen, if you want a full screen term don't bother with this and see below.<br />
URxvt*borderLess:true<br />
URxvt*foreground:Black #Font color. My wallpaper is White, you may wish to change this to White.<br />
<br />
Then edit your {{Filename|.config/openbox/rc.xml}} file:<br />
<application name="URxvt"><br />
<decor>no</decor><br />
<focus>yes</focus><br />
<position><br />
<x>center</x><br />
<y>20</y><br />
</position><br />
<layer>below</layer><br />
<desktop>all</desktop><br />
<maximized>true</maximized> #Only if you want a full size terminal.<br />
</application><br />
<br />
The ''magic'' comes from the {{Codeline|<layer>below</layer>}} line, which place the application under all others. Here Urxvt is displayed on all desktops, change it to your convenience.<br />
<br />
Note: Instead of using <application name="URxvt">, you can use another name ("URxvt-bg" for example), and use the -name option when starting uxrvt. That way, only the urxvt terminals which you choose to name URxvt-bg would be captured and modified by the application rule in rc.xml. For example: urxvt -name URxvt-bg (case sensitive)<br />
<br />
=== Keyboard Volume Control ===<br />
If you use ALSA for sound, you can use the amixer program to adjust the volume of sound. You can use Openbox's keybindings to act like multimedia keys. (Alternatively, you can probably find out the names of your real multimedia keys and map them.) For example, in the <keyboard> section of rc.xml:<br />
<br />
<keybind key="W-Up"><br />
<action name="Execute"><br />
<command>amixer set Master 5%+</command><br />
</action><br />
</keybind><br />
<br />
This binds Windows key + Up arrow to increase your master ALSA volume by 5%. Corresponding binding for volume down:<br />
<br />
<keybind key="W-Down"><br />
<action name="Execute"><br />
<command>amixer set Master 5%-</command><br />
</action><br />
</keybind><br />
<br />
As another example you can also use the XF86Audio keybindings:<br />
<br />
<keybind key="XF86AudioRaiseVolume"><br />
<action name="Execute"><br />
<command>amixer set Master 5%+ unmute</command><br />
</action><br />
</keybind><br />
<keybind key="XF86AudioLowerVolume"><br />
<action name="Execute"><br />
<command>amixer set Master 5%- unmute</command><br />
</action><br />
</keybind><br />
<keybind key="XF86AudioMute"><br />
<action name="Execute"><br />
<command>amixer set Master toggle</command><br />
</action><br />
</keybind><br />
<br />
The above example should work for the majority of multimedia keyboards. It should enable to raise, lower and mute the Master control of your audio device by using the respective multimedia keyboard keys. Notice also that in this example:<br />
<br />
* The "Mute" key should unmute the Master control if it is already in mute mode.<br />
* The "Raise" and "Lower" keys should unmute the Master control if it is in mute mode.<br />
<br />
== Resources ==<br />
<br />
* [http://openbox.org/ Openbox Website] &ndash; The official website<br />
* [http://planetob.openmonkey.com/ Planet Openbox] &ndash; Openbox news portal<br />
* [http://www.box-look.org/ Box-Look.org] &ndash; A good resource for themes and related artwork<br />
* [https://bbs.archlinux.org/viewtopic.php?id=93126 Openbox Hacks and Configs Thread] &ndash; @ Arch Linux Forums<br />
<!-- vim: set ft=Wikipedia: --></div>Rent0nhttps://wiki.archlinux.org/index.php?title=Rxvt-unicode&diff=110084Rxvt-unicode2010-06-30T12:58:00Z<p>Rent0n: /* Tips and tricks */</p>
<hr />
<div>'''rxvt-unicode''' is a highly customizable [[Terminal Emulator|terminal emulator]] forked from [[Wikipedia:Rxvt|rxvt]]. Commonly known as ''urxvt'', rxvt-unicode can be [[daemon]]ized to run clients within a single [[Wikipedia:Process (computing)|process]] in order to minimize the use of system resources. Developed by Marc Lehmann, some of the more outstanding features of rxvt-unicode include international language support through [[Wikipedia:Unicode|Unicode]], the ability to display multiple font types and support for [[Wikipedia:Perl|Perl]] extensions.<br />
<br />
==Installation==<br />
Install the latest version of rxvt-unicode:<br />
# pacman -S rxvt-unicode<br />
or<br />
# pacman -S rxvt-unicode-256color<br />
to install rxvt with 256 color support<br />
<br />
==Configuration==<br />
<br />
===Creating ~/.Xdefaults===<br />
The look, feel and function of rxvt-unicode is typically controlled by way of either command-line arguments, or resource settings within the file {{Filename|~/.[[Xdefaults]]}}. Create if not present:<br />
$ cd ~<br />
$ touch .Xdefaults<br />
<br />
All that is left at this point is to enter desired settings by editing the file.<br />
<br />
{{Note|Command-line arguments override and take precedence over the resource settings established in this file.}}<br />
<br />
===Example ~/.Xdefaults===<br />
[http://i275.photobucket.com/albums/jj281/adamchrista/Arch%20Linux/Wiki%20Examples/urxvt-man.png rxvt-unicode Example Screenshot]<br />
<pre><br />
URxvt.buffered: true<br />
URxvt.background: black<br />
URxvt.foreground: white<br />
URxvt.cursorColor: green<br />
URxvt.underlineColor: yellow<br />
URxvt.font: xft:Terminus:pixelsize=14:antialias=false<br />
URxvt.boldFont: xft:Terminus:bold:pixelsize=14:antialias=false<br />
URxvt.perl-ext-common: default,tabbed<br />
URxvt.title: ArchWiki Example<br />
</pre><br />
<br />
See the [http://pod.tst.eu/http://cvs.schmorp.de/rxvt-unicode/doc/rxvt.1.pod rxvt-unicode reference page] for the complete list of available setting and values.<br />
<br />
===Another Example ~/.Xdefaults===<br />
[http://nsa14.casimages.com/img/2010/05/08/100508043340911093.png Screenshot of this example]<br />
<br />
<pre><br />
URxvt.geometry: 400x30 <br />
URxvt.buffered: true<br />
URxvt.background: black<br />
URxvt.foreground: green<br />
URxvt.cursorColor: yellow<br />
URxvt.underlineColor: green<br />
URxvt.font:xft:Bitstream Vera Sans Mono:pixelsize=12:antialias=true<br />
<br />
!------------<br />
!True Transparency<br />
!------------<br />
!set to 32-bit for real transparency (compositing required (see xcompmgr)<br />
urxvt*depth: 32<br />
!transparent=0000 opaque=ffff<br />
urxvt*background: rgba:1111/1111/1111/dddd<br />
!urxvt*background: rgba:1111/1111/1111/0000<br />
<br />
<br />
!------------------<br />
!False tranparency<br />
!------------------<br />
!URxvt.transparent: true<br />
!URxvt.shading: 50 <br />
<br />
Urxvt.secondaryScroll: true # Enable Shift-PageUp/Down in screen<br />
</pre><br />
<br />
==Tips and tricks==<br />
<br />
===Clickable URLs===<br />
You can make URLs in the terminal clickable if you have Perl installed. For example, to open links in [[Firefox]] add the following to {{Filename|.Xdefaults}}:<br />
URxvt.perl-ext-common: default,matcher<br />
URxvt.urlLauncher: /usr/bin/firefox<br />
URxvt.matcher.button: 1 <br />
<br />
===Yankable URLs (mouselessly)===<br />
In addition, you can select and open URLs in your web browser without using the mouse.<br />
<br />
Install the [http://aur.archlinux.org/packages.php?ID=17263 rxvt-url-yank] AUR package and add the following to your {{Filename|.Xdefaults}}:<br />
URxvt.perl-ext: default,mark-yank-urls <br />
URxvt.keysym.M-u: perl:mark-yank-urls:activate_mark_mode<br />
URxvt.urlLauncher: firefox<br />
<br />
Alt+u: select last URL displayed on the terminal and cycle through URLs<br />
<br />
Ctrl+n: select next URL<br />
<br />
Ctrl+p: select previous URL<br />
<br />
y: yank url (copy to clipboard)<br />
<br />
Enter: open URL in Firefox<br />
<br />
Esc: exit yank-url mode<br />
<br />
===Cut and paste===<br />
For users unfamiliar with [[Xorg]]'s data transfer methods, the exchange of information to and from rxvt-unicode can become a burden. Suffice to say that rxvt-unicode uses cut buffers which are typically loaded into the current <tt>PRIMARY</tt> selection by default.<sup>[http://pod.tst.eu/http://cvs.schmorp.de/rxvt-unicode/doc/rxvt.1.pod#THE_SELECTION_SELECTING_AND_PASTING_]</sup> Users are urged to review [[Wikipedia:X Window selection]] for additional information.<br />
<br />
====Clipboard management====<br />
* [http://parcellite.sourceforge.net/ Parcellite] is a GTK+ clipboard manager which can also run in the background as a daemon.<br />
<br />
* [http://www.nongnu.org/autocutsel/ autocutsel] provides command line and daemon interfaces to synchronize PRIMARY, <tt>CLIPBOARD</tt> and cut buffer selections.<br />
<br />
* [http://glipper.sourceforge.net/ Glipper] is a [[GNOME]] panel applet with older versions available for use in environments other than GNOME.<br />
<br />
* [http://goodies.xfce.org/projects/panel-plugins/xfce4-clipman-plugin Clipman] (xfce-clipman-plugin) is a GUI clipboard manager plugin for the [[Xfce]] panel (xfpanel).<br />
<br />
====No clipboard management solution====<br />
Skottish[http://bbs.archlinux.org/viewtopic.php?pid=506845#p506845] created a perl script to automatically copy any selection in urxvt to the X clipboard. Save the following as {{Filename|/usr/lib/urxvt/perl/clipboard}}:<br />
<pre><br />
#! /usr/bin/perl<br />
<br />
sub on_sel_grab {<br />
my $query=quotemeta $_[0]->selection;<br />
$query=~ s/\n/\\n/g;<br />
$query=~ s/\r/\\r/g;<br />
system( "echo -en " . $query . " | xsel -i -b -p" );<br />
}<br />
</pre><br />
<br />
Xyne has also created his own variation of Skottish's script (which is also [http://aur.archlinux.org/packages.php?ID=35526 available in the AUR]):<br />
<pre><br />
#! /usr/bin/perl<br />
<br />
sub on_sel_grab {<br />
my $query = $_[0]->selection;<br />
open (my $pipe,'|-','xsel -ibp') or die;<br />
print $pipe $query;<br />
close $pipe;<br />
}<br />
</pre><br />
<br />
It also requires {{Codeline|xsel}} and needs to be enabled in the {{Codeline|*perl-ext-common}} or {{Codeline|*perl-ext}} field in {{Filename|.Xdefaults}}. For example:<br />
URxvt.perl-ext-common: default,clipboard<br />
<br />
===Scrollbar===<br />
The look of the scrollbar can be chosen through this entry in {{Filename|~/.Xdefaults}}:<br />
<br />
<pre><br />
# scrollbar style - rxvt (default), plain, next, or xterm<br />
URxvt*scrollstyle:rxvt<br />
</pre><br />
<br />
Of which "plain" is the most compact one.<br />
<br />
===Tabs===<br />
To add tabs to urxvt, add the following to your {{Filename|~/.Xdefaults}}:<br />
<pre><br />
URxvt.perl-ext-common: default,tabbed<br />
</pre><br />
<br />
To control tabs use:<br />
<br />
Shift+Down: new tab<br />
<br />
Shift+Left: go to left tab<br />
<br />
Shift+Right: go to right tab<br />
<br />
Ctrl+Left: move tab to the left<br />
<br />
Ctrl+Right: move tab to the right<br />
<br />
Ctrl+d: close tab <br />
<br />
You can change tabs' colors with the following:<br />
<pre><br />
URxvt.tabbed.tabbar-fg: <colour-index, default 3><br />
URxvt.tabbed.tabbar-bg: <colour-index, default 0><br />
URxvt.tabbed.tab-fg: <colour-index, default 0><br />
URxvt.tabbed.tab-bg: <colour-index, default 1><br />
</pre><br />
<br />
Colors must be specified using color indexes: 0 to 15 correspond to your {{Filename|~/.Xdefaults}} colors, -1 is the background color and -2 is the foreground color.<br />
<br />
===Font declaration methods===<br />
URxvt.font: 9x15<br />
is the same as<br />
-misc-fixed-medium-r-normal--15-140-75-75-c-90-iso8859-1<br />
and <br />
URxvt.font: 9x15bold<br />
is the same as<br />
URxvt.font: -misc-fixed-bold-r-normal--15-140-75-75-c-90-iso8859-1<br />
<br />
The complete list of short names for X core fonts can be found in /usr/share/fonts/misc/fonts.alias . (There are also fonts.alias files in some of the other subdirectories of /usr/share/fonts/ , but as they are packaged separately from the actual fonts, they may list fonts you don't actually have installed.) It is worth noting that these short aliases select for ISO-8859-1 versions of the fonts rather than ISO-10646-1 (Unicode) versions, and 75 DPI rather than 100 DPI versions, so you're probably better off avoiding them and choosing fonts by their full long names instead.<br />
<br />
===Improved Kuake-like behavior in Openbox===<br />
This was originally posted on the forum by Xyne<sup>[http://bbs.archlinux.org/viewtopic.php?pid=550380]</sup> and it relies on {{Codeline|xdotool}} which is available in the community repo.<br />
<br />
====The scriptlets====<br />
Save this scriptlet from the {{Codeline|urxvtc}} man page somewhere on your system as {{Filename|urxvtc}} (e.g., in {{Filename|~/.config/openbox}}):<br />
<pre><br />
#!/bin/sh<br />
urxvtc "$@"<br />
if [ $? -eq 2 ]; then<br />
urxvtd -q -o -f<br />
urxvtc "$@"<br />
fi<br />
</pre><br />
<br />
and save this one as {{Filename|urxvtq}}:<br />
<pre><br />
#!/bin/bash<br />
<br />
wid=$(xdotool search --classname urxvtq)<br />
if [ -z "$wid" ]; then<br />
/path/to/urxvtc -name urxvtq -geometry 80x28<br />
wid=$(xdotool search --classname urxvtq | head -1)<br />
xdotool windowfocus $wid<br />
xdotool key Control_L+l<br />
else<br />
if [ -z "$(xdotool search --onlyvisible --classname urxvtq 2>/dev/null)" ]; then<br />
xdotool windowmap $wid<br />
xdotool windowfocus $wid<br />
else<br />
xdotool windowunmap $wid<br />
fi<br />
fi<br />
</pre><br />
<br />
A previous version of xdotool introduced a bug which disabled recognition of visible windows and thus led some users to use the following scriptlet in place of the previous one. This is no longer necessary as xdotool>=1.20100416.2809, but it has been left here for future reference.<br />
<pre><br />
#!/bin/bash<br />
<br />
wid=$(xprop -name urxvtq | grep 'WM_COMMAND' | awk -F ',' '{print $3}' | awk -F '"' '{print $2}')<br />
if [ -z "$wid" ]; then<br />
/path/to/urxvtc -name urxvtq -geometry 200x28<br />
wid=$(xprop -name urxvtq | grep 'WM_COMMAND' | awk -F ',' '{print $3}' | awk -F '"' '{print $2}')<br />
xdotool windowfocus $wid<br />
xdotool key Control_L+l<br />
else<br />
if [ -z "$(xprop -id $wid | grep 'window state: Normal' 2>/dev/null)" ]; then<br />
xdotool windowmap $wid<br />
xdotool windowfocus $wid<br />
else<br />
xdotool windowunmap $wid<br />
fi<br />
fi<br />
</pre><br />
<br />
Make sure that you change {{Filename|/path/to/urxvtc}} to the actual path to the {{Filename|urxvtc}} scriptlet that you saved above. We'll be using {{Filename|urxvtc}} to launch both regular instances of {{Codeline|urxvt}} and the kuake-like instance.<br />
<br />
====urxvtq with tabbing====<br />
If you want to have tabs in your kuake-like {{Filename|urxvtc}} (here called {{Filename|urxvtq}}) just replace the third line in your {{Filename|urxvtq}}:<br />
wid=$(xdotool search --name urxvtq)<br />
with:<br />
wid=$(xdotool search --name urxvtq | grep -m 1 "" )<br />
<br />
To activate the tab support, you can either replace the fifth line of your {{Filename|urxvtq}}:<br />
/path/to/urxvtc -name urxvtq -geometry 80x28<br />
with:<br />
/path/to/urxvtc -name urxvtq -pe tabbed -geometry 80x28<br />
or replace this line of your {{Filename|.Xdefaults}}:<br />
URxvt.perl-ext-common: default,matcher<br />
with<br />
URxvt.perl-ext-common: default,matcher,tabbed<br />
<br />
=====Tab control=====<br />
<SHIFT>-Left: Switch to the tab left of current one<br />
<br />
<SHIFT>-Right: Switch to the tab right of current one<br />
<br />
<SHIFT>-Down: Create a new tab<br />
<br />
You can also use your mouse to switch the tabs by clicking the wished one and create a new tab by clicking on ''[NEW].\\''<br />
<br />
To close a tab just enter 'exit' like you'll close a terminal.<br />
<br />
====Openbox configuration====<br />
Now add the following lines to the {{Codeline|<applications>}} section of {{Filename|~/.config/openbox/rc.xml}}:<br />
<pre><br />
<application name="urxvtq"><br />
<decor>no</decor><br />
<position force="yes"><br />
<x>center</x><br />
<y>0</y><br />
</position><br />
<desktop>all</desktop><br />
<layer>above</layer><br />
<skip_pager>yes</skip_pager><br />
<skip_taskbar>yes</skip_taskbar><br />
<maximized>Horizontal</maximized><br />
</application><br />
</pre><br />
<br />
and add these lines to the {{Codeline|<keyboard>}} section:<br />
<pre><br />
<keybind key="W-t"><br />
<action name="Execute"><br />
<command>/path/to/urxvtc</command><br />
</action><br />
</keybind><br />
<keybind key="W-grave"><br />
<action name="Execute"><br />
<execute>/path/to/urxvtq</execute><br />
</action><br />
</keybind><br />
</pre><br />
<br />
Here too you need to change the {{Filename|/path/to/*}} lines to point to the scripts that you saved above. Save the file and then reconfigure Openbox. You should now be able to launch regular instances of urxvt with the Windows/Super key + "'''t'''", and toggle the kuake-like console with Windows/Super+grave ('''`''').<br />
<br />
====Further configuration====<br />
The advantage of this configuration over the urxvt kuake perl script is that Openbox provides more keybinding options such as modifier keys. The kuake script hijacks an entire physical key regardless of any modifier combination. Review the [http://icculus.org/openbox/index.php/Help:Bindings Openbox bindings documentation] for the full range or possibilities.<br />
<br />
The [http://icculus.org/openbox/index.php/Help:Applications Openbox per-app settings] can be used to further configure the behavior of the kuake-like console (e.g. screen position, layer, etc). You may need to change the "geometry" parameter in the {{Filename|urxvtq}} scriptlet to adjust the height of the console.<br />
<br />
====Related scripts====<br />
*hbekel has posted a generalized version of the {{Filename|urxvtq}} [http://bbs.archlinux.org/viewtopic.php?pid=550380#p550380 here] which can be used to toggle any application using {{Codeline|xdotool}}.<br />
<br />
*http://www.jukie.net/~bart/blog/20070503013555 - A script for opening url's with your keyboard instead of mouse with urxvt.<br />
<br />
===Rxvt-unicode as gmrun terminal===<br />
Unlike some other terminals, urxvt expects the arguments to -e to be given separately, rather than grouped together with quotes. This causes trouble with gmrun, which assumes the opposite behavior. This can be worked around by putting an "eval" in front of gmrun's "Terminal" variable in .gmrunrc:<br />
<pre><br />
Terminal = eval urxvt<br />
TermExec = ${Terminal} -e<br />
</pre><br />
(gmrun uses /bin/sh to execute commands, so the "eval is understood here.) The "eval" has the side-effect of "breaking up" the argument to -e in the same way $@ does in bash, making the command intelligible to urxvt.<br />
<br />
===Improving performance===<br />
*Avoid the use of Xft fonts. If Xft fonts must be used, append {{Codeline|<nowiki>:antialias=false</nowiki>}} to the setting value.<sup>[http://pod.tst.eu/http://cvs.schmorp.de/rxvt-unicode/doc/rxvt.7.pod#Can_I_speed_up_Xft_rendering_somehow]</sup><br />
<br />
*Build rxvt-unicode with disabled support for unnecessary features, {{Codeline|--disable-xft}} and {{Codeline|--disable-unicode3}} in particular.<sup>[http://pod.tst.eu/http://cvs.schmorp.de/rxvt-unicode/doc/rxvt.7.pod#Rxvt_unicode_uses_gobs_of_memory_how]</sup><br />
<br />
*Limit the number of {{Codeline|saveLines}} (option {{Codeline|-sl}}) in the scrollback buffer to reduce memory usage.<sup>[http://pod.tst.eu/http://cvs.schmorp.de/rxvt-unicode/doc/rxvt.7.pod#Isn_t_rxvt_unicode_supposed_to_be_sm]</sup><br />
<br />
*Consider running {{Codeline|urxvtd}} as a daemon accepting connections from {{Codeline|urxvtc}} clients.<br />
<br />
==External resources==<br />
*[http://software.schmorp.de/pkg/rxvt-unicode.html rxvt-unicode] - Official site<br />
*[http://pod.tst.eu/http://cvs.schmorp.de/rxvt-unicode/doc/rxvt.7.pod rxvt-unicode FAQ] - Official FAQ<br />
*[http://pod.tst.eu/http://cvs.schmorp.de/rxvt-unicode/doc/rxvt.1.pod rxvt-unicode Reference] - Official manual page<br />
*[http://pod.tst.eu/http://cvs.schmorp.de/rxvt-unicode/src/urxvt.pm urxvtperl] - Official Perl extension reference<br />
*{{Codeline|man urxvt}}<br />
<br />
[[Category:Utilities (English)]] [[Category:HOWTOs (English)]]</div>Rent0nhttps://wiki.archlinux.org/index.php?title=Cpufrequtils&diff=109725Cpufrequtils2010-06-27T09:17:03Z<p>Rent0n: /* Cpufrequtils and Laptop Mode Tools */</p>
<hr />
<div>[[Category:Power management (English)]]<br />
[[Category:CPU (English)]]<br />
[[Category:Daemons and system services (English)]]<br />
[[Category:HOWTOs (English)]]<br />
{{i18n|cpufrequtils}}<br />
[[de:Cpufrequtils]]<br />
{{Article summary start}} {{DISPLAYTITLE:cpufrequtils}}<br />
{{Article summary text|An overview of the popular userspace tools for the kernel [http://www.kernel.org/pub/linux/utils/kernel/cpufreq/cpufreq.html CPUfreq] subsystem.}}<br />
{{Article summary heading|Related}}<br />
{{Article summary wiki|Laptop Mode Tools|Laptop_Mode_Tools}}<br />
{{Article summary wiki|pm-utils}}<br />
{{Article summary wiki|powernowd}}<br />
{{Article summary end}}<br />
<br />
{{Package Official|cpufrequtils}} is a set of utilities designed to assist ''CPU frequency scaling'', a technology used primarily by notebooks that enables the operating system to scale the CPU speed up or down, depending on the current system load and/or power scheme. For instance, CPU frequency scaling can run a 2GHz processor at 1GHz when a notebook is on battery power, thereby conserving battery life and lowering core temperatures.<br />
<br />
When used in conjunction with [[pm-utils]], notebook owners are provided with a complete power management suite.<br />
<br />
Note that <tt>cpufrequtils</tt> is not the only way one can manage/throttle one's CPU. [[powernowd]] is a simple alternative for adjusting the speed of your CPU depending on system load.<br />
<br />
This article covers installation and basic configuration of the <tt>cpufrequtils</tt> package.<br />
<br />
'''Note:''' <tt>cpufrequtils</tt> is not the same as <tt>cpufreqd</tt>. Never run both <tt>cpufreq'''d'''</tt> and <tt>cpufreq</tt> daemons.<br />
<br />
== Installation ==<br />
<br />
The {{Package Official|cpufrequtils}} package is available in the [extra] repository:<br />
# pacman -S cpufrequtils<br />
<br />
== Configuration ==<br />
<br />
Configuring CPU scaling is a 3-part process:<br />
# Load appropriate CPU frequency driver<br />
# Load desired scaling governor(s)<br />
# Configure and load frequency scaling daemon (optional)<br />
<br />
=== CPU frequency driver ===<br />
In order for frequency scaling to work properly, the operating system must first know the limits of the CPU(s). To accomplish this, a kernel module is loaded that can read and manage the specifications of the CPU(s).<br />
<br />
Most modern notebooks and desktops can simply use the '''<tt>acpi-cpufreq</tt>''' driver. However, other options include the <tt>p4-clockmod</tt>, <tt>powernow-k6</tt>, <tt>powernow-k7</tt>, <tt>powernow-k8</tt>, and <tt>speedstep-centrino</tt> drivers. To see a full list of available drivers, run the following:<br />
<br />
$ ls /lib/modules/*/kernel/arch/*/kernel/cpu/cpufreq<br />
<br />
{{Tip|For an AMD "K10" CPU like Phenom X4, use the <tt>powernow-k8</tt> driver.}}<br />
<br />
To load the CPU frequency driver manually:<br />
<br />
==== Intel ====<br />
# modprobe acpi-cpufreq<br />
<br />
For older Intel CPUs, the command above may return with: <br />
FATAL: Error inserting acpi_cpufreq ([...]/acpi-cpufreq.ko): No such device<br />
<br />
In this case, replace the kernel module <tt>acpi-cpufreq</tt> with <tt>speedstep-centrino</tt>, <tt>p4-clockmod</tt> or <tt>speedstep-ich</tt>.<br />
<br />
Notice that the speedstep-centrino module is deprecated.<br />
<br />
There is a kernel with the speedstep-centrino module patched on the AUR, it is the '''<tt>kernel26-pentium-m</tt>''' package which is located here: http://aur.archlinux.org/packages.php?ID=33104<br />
<br />
==== AMD ====<br />
# modprobe powernow-k{6,7,8}<br />
<br />
Not all of the <tt>powernow-k*</tt> drivers may be available or necessary. If loading one of them fails, try loading them individually.<br />
<br />
=== Closing notes ===<br />
To load the driver automatically at startup, add the appropriate driver to the MODULES array within {{Filename|/etc/rc.conf}}. For example:<br />
MODULES=( '''acpi-cpufreq''' vboxdrv fuse fglrx iwl3945 ... )<br />
<br />
Once the appropriate cpufreq driver is loaded, detailed information about the CPU(s) can be displayed by running: <br />
$ cpufreq-info<br />
<br />
The output should appear similar to the following:<br />
<br />
{{Command<br />
|name=cpufreq-info<br />
|output=<nowiki><br />
analyzing CPU 0:<br />
driver: acpi-cpufreq<br />
CPUs which need to switch frequency at the same time: 0 1<br />
hardware limits: 1000 MHz - 2.00 GHz<br />
available frequency steps: 2.00 GHz, 1.67 GHz, 1.33 GHz, 1000 MHz<br />
available cpufreq governors: ondemand, performance<br />
current policy: frequency should be within 1000 MHz and 2.00 GHz.<br />
The governor "performance" may decide which speed to use<br />
within this range.<br />
current CPU frequency is 2.00 GHz.<br />
analyzing CPU 1:<br />
driver: acpi-cpufreq<br />
CPUs which need to switch frequency at the same time: 0 1<br />
hardware limits: 1000 MHz - 2.00 GHz<br />
available frequency steps: 2.00 GHz, 1.67 GHz, 1.33 GHz, 1000 MHz<br />
available cpufreq governors: ondemand, performance<br />
current policy: frequency should be within 1000 MHz and 2.00 GHz.<br />
The governor "performance" may decide which speed to use<br />
within this range.<br />
current CPU frequency is 2.00 GHz.<br />
</nowiki>}}<br />
<br />
Monitoring the CPU speed in real-time can be achieved by running:<br />
watch grep \"cpu MHz\" /proc/cpuinfo<br />
<br />
=== Cpufrequtils and Laptop Mode Tools ===<br />
<br />
If you are already using or plan to use [[Laptop Mode Tools]] for other power saving solutions, you may want to let it manage also CPU frequency scaling. <br />
In that case you just have to insert the <tt>acpi-cpufreq</tt> module to the MODULES array in {{Filename|/etc/rc.conf}}:<br />
MODULES=( '''acpi-cpufreq''' vboxdrv ... )<br />
<br />
And then go through the {{Filename|/etc/laptop-mode/conf.d/cpufreq.conf}} to define governors, frequencies and policies. <br />
<br />
If you use <tt>laptop-mode-tools</tt> to manage <tt>cpufrequtils</tt>, then you won't need to load other modules and daemons or to set up scaling governors and interaction with ACPI events. Please refer to [[Laptop Mode Tools]] to know how to install and configure <tt>laptop-mode-tools</tt>.<br />
<br />
=== Scaling governors ===<br />
<br />
Governors can be thought of as pre-configured power schemes for the CPU. These governors must be loaded as kernel modules in order to be seen by such programs as ''kpowersave'' and ''gnome-power-manager''. One may load as many governors as desired (only one will be active at any given time).<br />
<br />
Available governors:<br />
<br />
;{{Codeline|performance}} ''(default)'': The performance governor is built into the kernel and runs the CPU(s) at maximum clock speed<br />
;{{Codeline|cpufreq_ondemand}} ''(recommended)'': Dynamically increases/decreases the CPU(s) clock speed based on system load<br />
;{{Codeline|cpufreq_conservative}}: Similar to {{Codeline|ondemand}}, but more conservative (clock speed changes are more graceful)<br />
;{{Codeline|cpufreq_powersave}}: Runs the CPU at minimum speed<br />
;{{Codeline|cpufreq_userspace}}: Manually configured clock speeds by user<br />
<br />
Add the desired governor(s) to the MODULES array in {{Filename|/etc/rc.conf}}:<br />
MODULES=(acpi-cpufreq '''cpufreq_ondemand''' '''cpufreq_powersave''' vboxdrv fuse fglrx iwl3945 ... )<br />
<br />
Alternatively, manually set the governor by running the {{Codeline|cpufreq-set}} command (as root). However, this setting will not be saved after a reboot/shutdown. For example:<br />
# cpufreq-set -g ondemand<br />
<br />
Run {{Codeline|cpufreq-set --help}} or {{Codeline|man cpufreq-set}} for more information.<br />
<br />
==== Interaction with ACPI events ====<br />
<br />
Users may configure scaling governors to switch automatically based on different ACPI events such as connecting the AC adapter or closing a laptop lid. Events are defined in {{Filename|/etc/acpi/handler.sh}}. If the {{Package Official|acpid}} package is installed, the file should already exist and be executable. For example, to change the scaling governor from {{Codeline|performance}} to {{Codeline|conservative}} when the AC adapter is disconnected and change it back if reconnected:<br />
<br />
{{File<br />
|name=/etc/acpi/handler.sh<br />
|content=<nowiki><br />
[...]<br />
<br />
ac_adapter)<br />
case "$2" in<br />
AC*)<br />
case "$4" in<br />
00000000)<br />
echo "conservative" >/sys/devices/system/cpu/cpu0/cpufreq/scaling_governor <br />
echo -n $minspeed >$setspeed<br />
#/etc/laptop-mode/laptop-mode start<br />
;;<br />
00000001)<br />
echo "performance" >/sys/devices/system/cpu/cpu0/cpufreq/scaling_governor<br />
echo -n $maxspeed >$setspeed<br />
#/etc/laptop-mode/laptop-mode stop<br />
;;<br />
esac<br />
;;<br />
*) logger "ACPI action undefined: $2" ;;<br />
esac<br />
;;<br />
<br />
[...]<br />
</nowiki>}}<br />
<br />
==== Changing the {{Codeline|ondemand}} governor's threshold ====<br />
<!-- ln from [[Browser Plugins#Flash Performance]] --><br />
To change when the {{Codeline|ondemand}} governor switches to a higher multiplier, one can manipulate {{Filename|/sys/devices/system/cpu/cpu'''#'''/cpufreq/ondemand/up_threshold}}. Determine the current setting by issuing the following command as root:<br />
# cat /sys/devices/system/cpu/cpu0/cpufreq/ondemand/up_threshold<br />
<br />
The value returned should be <tt>95</tt>, the default setting as of kernel version 2.6.31. This means that the {{Codeline|ondemand}} governor currently increases the clock rate if a core reaches 95% utilization. The can be changed, for example:<br />
# echo 50 > /sys/devices/system/cpu/cpu0/cpufreq/ondemand/up_threshold<br />
<br />
The governor will now switch to a higher clock rate if a core reaches 50% utilization. <br />
<br />
To re-apply this setting during boot, add the command to {{Filename|/etc/rc.local}}.<br />
<br />
{{Tip|One user found it necessary to use {{Codeline|1=(sleep 2 && echo 50 > /sys/devices/system/cpu/cpu0/cpufreq/ondemand/up_threshold) &}} or the command would fail with a "path not found" message during boot.}}<br />
<br />
{{Note|Adjusting only {{Codeline|cpu0}} should work fine on multi-core systems, as other entries that belong to the same physical processor are adjusted automatically.}}<br />
<br />
{{Note|Starting with 2.6.33 adjusting only one core is deprecated and will produce a warning message: {{Codeline|CPUFREQ: Per core ondemand sysfs interface is deprecated - up_threshold<br />
}} The command should be used instead: {{Codeline|echo "50" > /sys/devices/system/cpu/cpufreq/ondemand/up_threshold}} }}<br />
<br />
=== Daemon ===<br />
<br />
<tt>cpufrequtils</tt> also includes a daemon which allows users to set the desired scaling governor and min/max clock speeds for all processor cores at boot-time, without the need for additional tools such as ''kpowersave''.<br />
<br />
Before starting the daemon, edit {{Filename|/etc/conf.d/cpufreq}} as root, selecting the desired governor and setting the min/max speed for your CPU(s), for example:<br />
<br />
{{File<br />
|name=/etc/conf.d/cpufreq<br />
|content=<nowiki><br />
#configuration for cpufreq control<br />
<br />
# valid governors:<br />
# ondemand, performance, powersave,<br />
# conservative, userspace<br />
governor="ondemand"<br />
<br />
# valid suffixes: Hz, kHz (default), MHz, GHz, THz<br />
min_freq="1GHz"<br />
max_freq="2GHz"<br />
</nowiki>}}<br />
<br />
{{Note|The exact min/max values of the CPU(s) can be determined by running {{Codeline|cpufreq-info}} after loading the CPU driver (e.g. {{Codeline|modprobe acpi-cpufreq}}). However, these values are ''optional''. Users may omit them entirely by deleting or commenting out the min/max_freq lines; scaling will work automatically.}}<br />
<br />
With the appropriate configuration, start the daemon with the following command:<br />
# /etc/rc.d/cpufreq start<br />
<br />
To start the daemon automatically at startup, add {{Codeline|cpufreq}} to the DAEMONS array in {{Filename|/etc/rc.conf}}, for example:<br />
DAEMONS=(syslog-ng hal '''cpufreq''' dhcdbd networkmanager !network !netfs @alsa @crond @cups @fam @ntpd @sshd)<br />
<br />
== Troubleshooting ==<br />
<br />
* Some applications, like [[ntop]], do not respond well to automatic frequency scaling. In the case of ntop it can result in segmentation faults and lots of lost information as even the {{Codeline|ondemand}} governor cannot change the frequency quickly enough when a lot of packages suddenly arrive at the monitored network interface that cannot be handled by the current processor speed.<br />
<br />
* Some CPUs may suffer from poor performance with the default settings of the {{Codeline|ondemand}} governor (e.g. flash videos not playing smoothly or stuttering window animations). Instead of completely disabling frequency scaling to resolve these issues, the aggressiveness of frequency scaling can be increased by lowering the ''up_threshold'' sysctl variable for each CPU. See [[#Changing the ondemand governor's threshold]].<br />
<br />
* Sometimes the deamon may not throttle to the maximum frequence but one step below. This can be solved by setting max_freq value slightly higher than the real maximum. For example, if frequence range of the CPU is from 2.00GHz to 3.00GHz, setting max_freq to 3.01GHz can be a good idea.</div>Rent0nhttps://wiki.archlinux.org/index.php?title=Talk:Cpufrequtils&diff=109714Talk:Cpufrequtils2010-06-27T08:18:36Z<p>Rent0n: </p>
<hr />
<div>Hi, I would like to have some feedback regarding my addition to this page: [[Cpufrequtils#Cpufrequtils and Laptop Mode Tools]].<br />
<br />
Thank you.<br />
<br />
rent0n</div>Rent0nhttps://wiki.archlinux.org/index.php?title=Talk:Cpufrequtils&diff=109713Talk:Cpufrequtils2010-06-27T08:18:05Z<p>Rent0n: Created page with 'Hi, I would like to have some feedback regarding my addition to this page: Cpufrequtils#Cpufrequtils and Laptop Mode Tools. Thank you.'</p>
<hr />
<div>Hi, I would like to have some feedback regarding my addition to this page: [[Cpufrequtils#Cpufrequtils and Laptop Mode Tools]].<br />
Thank you.</div>Rent0nhttps://wiki.archlinux.org/index.php?title=Cpufrequtils&diff=109712Cpufrequtils2010-06-27T08:03:21Z<p>Rent0n: /* Cpufrequtils and Laptop Mode Tools */</p>
<hr />
<div>[[Category:Power management (English)]]<br />
[[Category:CPU (English)]]<br />
[[Category:Daemons and system services (English)]]<br />
[[Category:HOWTOs (English)]]<br />
{{i18n|cpufrequtils}}<br />
[[de:Cpufrequtils]]<br />
{{Article summary start}} {{DISPLAYTITLE:cpufrequtils}}<br />
{{Article summary text|An overview of the popular userspace tools for the kernel [http://www.kernel.org/pub/linux/utils/kernel/cpufreq/cpufreq.html CPUfreq] subsystem.}}<br />
{{Article summary heading|Related}}<br />
{{Article summary wiki|Laptop Mode Tools|Laptop_Mode_Tools}}<br />
{{Article summary wiki|pm-utils}}<br />
{{Article summary wiki|powernowd}}<br />
{{Article summary end}}<br />
<br />
{{Package Official|cpufrequtils}} is a set of utilities designed to assist ''CPU frequency scaling'', a technology used primarily by notebooks that enables the operating system to scale the CPU speed up or down, depending on the current system load and/or power scheme. For instance, CPU frequency scaling can run a 2GHz processor at 1GHz when a notebook is on battery power, thereby conserving battery life and lowering core temperatures.<br />
<br />
When used in conjunction with [[pm-utils]], notebook owners are provided with a complete power management suite.<br />
<br />
Note that <tt>cpufrequtils</tt> is not the only way one can manage/throttle one's CPU. [[powernowd]] is a simple alternative for adjusting the speed of your CPU depending on system load.<br />
<br />
This article covers installation and basic configuration of the <tt>cpufrequtils</tt> package.<br />
<br />
'''Note:''' <tt>cpufrequtils</tt> is not the same as <tt>cpufreqd</tt>. Never run both <tt>cpufreq'''d'''</tt> and <tt>cpufreq</tt> daemons.<br />
<br />
== Installation ==<br />
<br />
The {{Package Official|cpufrequtils}} package is available in the [extra] repository:<br />
# pacman -S cpufrequtils<br />
<br />
== Configuration ==<br />
<br />
Configuring CPU scaling is a 3-part process:<br />
# Load appropriate CPU frequency driver<br />
# Load desired scaling governor(s)<br />
# Configure and load frequency scaling daemon (optional)<br />
<br />
=== CPU frequency driver ===<br />
In order for frequency scaling to work properly, the operating system must first know the limits of the CPU(s). To accomplish this, a kernel module is loaded that can read and manage the specifications of the CPU(s).<br />
<br />
Most modern notebooks and desktops can simply use the '''<tt>acpi-cpufreq</tt>''' driver. However, other options include the <tt>p4-clockmod</tt>, <tt>powernow-k6</tt>, <tt>powernow-k7</tt>, <tt>powernow-k8</tt>, and <tt>speedstep-centrino</tt> drivers. To see a full list of available drivers, run the following:<br />
<br />
$ ls /lib/modules/*/kernel/arch/*/kernel/cpu/cpufreq<br />
<br />
{{Tip|For an AMD "K10" CPU like Phenom X4, use the <tt>powernow-k8</tt> driver.}}<br />
<br />
To load the CPU frequency driver manually:<br />
<br />
==== Intel ====<br />
# modprobe acpi-cpufreq<br />
<br />
For older Intel CPUs, the command above may return with: <br />
FATAL: Error inserting acpi_cpufreq ([...]/acpi-cpufreq.ko): No such device<br />
<br />
In this case, replace the kernel module <tt>acpi-cpufreq</tt> with <tt>speedstep-centrino</tt>, <tt>p4-clockmod</tt> or <tt>speedstep-ich</tt>.<br />
<br />
Notice that the speedstep-centrino module is deprecated.<br />
<br />
There is a kernel with the speedstep-centrino module patched on the AUR, it is the '''<tt>kernel26-pentium-m</tt>''' package which is located here: http://aur.archlinux.org/packages.php?ID=33104<br />
<br />
==== AMD ====<br />
# modprobe powernow-k{6,7,8}<br />
<br />
Not all of the <tt>powernow-k*</tt> drivers may be available or necessary. If loading one of them fails, try loading them individually.<br />
<br />
=== Closing notes ===<br />
To load the driver automatically at startup, add the appropriate driver to the MODULES array within {{Filename|/etc/rc.conf}}. For example:<br />
MODULES=( '''acpi-cpufreq''' vboxdrv fuse fglrx iwl3945 ... )<br />
<br />
Once the appropriate cpufreq driver is loaded, detailed information about the CPU(s) can be displayed by running: <br />
$ cpufreq-info<br />
<br />
The output should appear similar to the following:<br />
<br />
{{Command<br />
|name=cpufreq-info<br />
|output=<nowiki><br />
analyzing CPU 0:<br />
driver: acpi-cpufreq<br />
CPUs which need to switch frequency at the same time: 0 1<br />
hardware limits: 1000 MHz - 2.00 GHz<br />
available frequency steps: 2.00 GHz, 1.67 GHz, 1.33 GHz, 1000 MHz<br />
available cpufreq governors: ondemand, performance<br />
current policy: frequency should be within 1000 MHz and 2.00 GHz.<br />
The governor "performance" may decide which speed to use<br />
within this range.<br />
current CPU frequency is 2.00 GHz.<br />
analyzing CPU 1:<br />
driver: acpi-cpufreq<br />
CPUs which need to switch frequency at the same time: 0 1<br />
hardware limits: 1000 MHz - 2.00 GHz<br />
available frequency steps: 2.00 GHz, 1.67 GHz, 1.33 GHz, 1000 MHz<br />
available cpufreq governors: ondemand, performance<br />
current policy: frequency should be within 1000 MHz and 2.00 GHz.<br />
The governor "performance" may decide which speed to use<br />
within this range.<br />
current CPU frequency is 2.00 GHz.<br />
</nowiki>}}<br />
<br />
Monitoring the CPU speed in real-time can be achieved by running:<br />
watch grep \"cpu MHz\" /proc/cpuinfo<br />
<br />
=== Cpufrequtils and Laptop Mode Tools ===<br />
<br />
If you are already using or plan to use [[Laptop Mode Tools]] for other power saving solutions, you may want to let it manage also CPU frequency scaling. <br />
In that case you just have to insert the <tt>acpi-cpufreq</tt> module to the MODULES array in {{Filename|/etc/rc.conf}}:<br />
MODULES=( '''acpi-cpufreq''' vboxdrv ... )<br />
<br />
And then go through the {{Filename|/etc/laptop-mode/conf.d/cpufreq.conf}} to define governors, frequencies and policies. <br />
<br />
If you use <tt>laptop-mode-tools</tt> to manage <tt>cpufrequtils</tt>, then you won't need to load other modules or to set up scaling governors and interaction with ACPI events. Please refer to [[Laptop Mode Tools]] to know how to install and configure <tt>laptop-mode-tools</tt>.<br />
<br />
=== Scaling governors ===<br />
<br />
Governors can be thought of as pre-configured power schemes for the CPU. These governors must be loaded as kernel modules in order to be seen by such programs as ''kpowersave'' and ''gnome-power-manager''. One may load as many governors as desired (only one will be active at any given time).<br />
<br />
Available governors:<br />
<br />
;{{Codeline|performance}} ''(default)'': The performance governor is built into the kernel and runs the CPU(s) at maximum clock speed<br />
;{{Codeline|cpufreq_ondemand}} ''(recommended)'': Dynamically increases/decreases the CPU(s) clock speed based on system load<br />
;{{Codeline|cpufreq_conservative}}: Similar to {{Codeline|ondemand}}, but more conservative (clock speed changes are more graceful)<br />
;{{Codeline|cpufreq_powersave}}: Runs the CPU at minimum speed<br />
;{{Codeline|cpufreq_userspace}}: Manually configured clock speeds by user<br />
<br />
Add the desired governor(s) to the MODULES array in {{Filename|/etc/rc.conf}}:<br />
MODULES=(acpi-cpufreq '''cpufreq_ondemand''' '''cpufreq_powersave''' vboxdrv fuse fglrx iwl3945 ... )<br />
<br />
Alternatively, manually set the governor by running the {{Codeline|cpufreq-set}} command (as root). However, this setting will not be saved after a reboot/shutdown. For example:<br />
# cpufreq-set -g ondemand<br />
<br />
Run {{Codeline|cpufreq-set --help}} or {{Codeline|man cpufreq-set}} for more information.<br />
<br />
==== Interaction with ACPI events ====<br />
<br />
Users may configure scaling governors to switch automatically based on different ACPI events such as connecting the AC adapter or closing a laptop lid. Events are defined in {{Filename|/etc/acpi/handler.sh}}. If the {{Package Official|acpid}} package is installed, the file should already exist and be executable. For example, to change the scaling governor from {{Codeline|performance}} to {{Codeline|conservative}} when the AC adapter is disconnected and change it back if reconnected:<br />
<br />
{{File<br />
|name=/etc/acpi/handler.sh<br />
|content=<nowiki><br />
[...]<br />
<br />
ac_adapter)<br />
case "$2" in<br />
AC*)<br />
case "$4" in<br />
00000000)<br />
echo "conservative" >/sys/devices/system/cpu/cpu0/cpufreq/scaling_governor <br />
echo -n $minspeed >$setspeed<br />
#/etc/laptop-mode/laptop-mode start<br />
;;<br />
00000001)<br />
echo "performance" >/sys/devices/system/cpu/cpu0/cpufreq/scaling_governor<br />
echo -n $maxspeed >$setspeed<br />
#/etc/laptop-mode/laptop-mode stop<br />
;;<br />
esac<br />
;;<br />
*) logger "ACPI action undefined: $2" ;;<br />
esac<br />
;;<br />
<br />
[...]<br />
</nowiki>}}<br />
<br />
==== Changing the {{Codeline|ondemand}} governor's threshold ====<br />
<!-- ln from [[Browser Plugins#Flash Performance]] --><br />
To change when the {{Codeline|ondemand}} governor switches to a higher multiplier, one can manipulate {{Filename|/sys/devices/system/cpu/cpu'''#'''/cpufreq/ondemand/up_threshold}}. Determine the current setting by issuing the following command as root:<br />
# cat /sys/devices/system/cpu/cpu0/cpufreq/ondemand/up_threshold<br />
<br />
The value returned should be <tt>95</tt>, the default setting as of kernel version 2.6.31. This means that the {{Codeline|ondemand}} governor currently increases the clock rate if a core reaches 95% utilization. The can be changed, for example:<br />
# echo 50 > /sys/devices/system/cpu/cpu0/cpufreq/ondemand/up_threshold<br />
<br />
The governor will now switch to a higher clock rate if a core reaches 50% utilization. <br />
<br />
To re-apply this setting during boot, add the command to {{Filename|/etc/rc.local}}.<br />
<br />
{{Tip|One user found it necessary to use {{Codeline|1=(sleep 2 && echo 50 > /sys/devices/system/cpu/cpu0/cpufreq/ondemand/up_threshold) &}} or the command would fail with a "path not found" message during boot.}}<br />
<br />
{{Note|Adjusting only {{Codeline|cpu0}} should work fine on multi-core systems, as other entries that belong to the same physical processor are adjusted automatically.}}<br />
<br />
{{Note|Starting with 2.6.33 adjusting only one core is deprecated and will produce a warning message: {{Codeline|CPUFREQ: Per core ondemand sysfs interface is deprecated - up_threshold<br />
}} The command should be used instead: {{Codeline|echo "50" > /sys/devices/system/cpu/cpufreq/ondemand/up_threshold}} }}<br />
<br />
=== Daemon ===<br />
<br />
<tt>cpufrequtils</tt> also includes a daemon which allows users to set the desired scaling governor and min/max clock speeds for all processor cores at boot-time, without the need for additional tools such as ''kpowersave''.<br />
<br />
Before starting the daemon, edit {{Filename|/etc/conf.d/cpufreq}} as root, selecting the desired governor and setting the min/max speed for your CPU(s), for example:<br />
<br />
{{File<br />
|name=/etc/conf.d/cpufreq<br />
|content=<nowiki><br />
#configuration for cpufreq control<br />
<br />
# valid governors:<br />
# ondemand, performance, powersave,<br />
# conservative, userspace<br />
governor="ondemand"<br />
<br />
# valid suffixes: Hz, kHz (default), MHz, GHz, THz<br />
min_freq="1GHz"<br />
max_freq="2GHz"<br />
</nowiki>}}<br />
<br />
{{Note|The exact min/max values of the CPU(s) can be determined by running {{Codeline|cpufreq-info}} after loading the CPU driver (e.g. {{Codeline|modprobe acpi-cpufreq}}). However, these values are ''optional''. Users may omit them entirely by deleting or commenting out the min/max_freq lines; scaling will work automatically.}}<br />
<br />
With the appropriate configuration, start the daemon with the following command:<br />
# /etc/rc.d/cpufreq start<br />
<br />
To start the daemon automatically at startup, add {{Codeline|cpufreq}} to the DAEMONS array in {{Filename|/etc/rc.conf}}, for example:<br />
DAEMONS=(syslog-ng hal '''cpufreq''' dhcdbd networkmanager !network !netfs @alsa @crond @cups @fam @ntpd @sshd)<br />
<br />
== Troubleshooting ==<br />
<br />
* Some applications, like [[ntop]], do not respond well to automatic frequency scaling. In the case of ntop it can result in segmentation faults and lots of lost information as even the {{Codeline|ondemand}} governor cannot change the frequency quickly enough when a lot of packages suddenly arrive at the monitored network interface that cannot be handled by the current processor speed.<br />
<br />
* Some CPUs may suffer from poor performance with the default settings of the {{Codeline|ondemand}} governor (e.g. flash videos not playing smoothly or stuttering window animations). Instead of completely disabling frequency scaling to resolve these issues, the aggressiveness of frequency scaling can be increased by lowering the ''up_threshold'' sysctl variable for each CPU. See [[#Changing the ondemand governor's threshold]].<br />
<br />
* Sometimes the deamon may not throttle to the maximum frequence but one step below. This can be solved by setting max_freq value slightly higher than the real maximum. For example, if frequence range of the CPU is from 2.00GHz to 3.00GHz, setting max_freq to 3.01GHz can be a good idea.</div>Rent0nhttps://wiki.archlinux.org/index.php?title=Cpufrequtils&diff=109711Cpufrequtils2010-06-27T08:02:37Z<p>Rent0n: </p>
<hr />
<div>[[Category:Power management (English)]]<br />
[[Category:CPU (English)]]<br />
[[Category:Daemons and system services (English)]]<br />
[[Category:HOWTOs (English)]]<br />
{{i18n|cpufrequtils}}<br />
[[de:Cpufrequtils]]<br />
{{Article summary start}} {{DISPLAYTITLE:cpufrequtils}}<br />
{{Article summary text|An overview of the popular userspace tools for the kernel [http://www.kernel.org/pub/linux/utils/kernel/cpufreq/cpufreq.html CPUfreq] subsystem.}}<br />
{{Article summary heading|Related}}<br />
{{Article summary wiki|Laptop Mode Tools|Laptop_Mode_Tools}}<br />
{{Article summary wiki|pm-utils}}<br />
{{Article summary wiki|powernowd}}<br />
{{Article summary end}}<br />
<br />
{{Package Official|cpufrequtils}} is a set of utilities designed to assist ''CPU frequency scaling'', a technology used primarily by notebooks that enables the operating system to scale the CPU speed up or down, depending on the current system load and/or power scheme. For instance, CPU frequency scaling can run a 2GHz processor at 1GHz when a notebook is on battery power, thereby conserving battery life and lowering core temperatures.<br />
<br />
When used in conjunction with [[pm-utils]], notebook owners are provided with a complete power management suite.<br />
<br />
Note that <tt>cpufrequtils</tt> is not the only way one can manage/throttle one's CPU. [[powernowd]] is a simple alternative for adjusting the speed of your CPU depending on system load.<br />
<br />
This article covers installation and basic configuration of the <tt>cpufrequtils</tt> package.<br />
<br />
'''Note:''' <tt>cpufrequtils</tt> is not the same as <tt>cpufreqd</tt>. Never run both <tt>cpufreq'''d'''</tt> and <tt>cpufreq</tt> daemons.<br />
<br />
== Installation ==<br />
<br />
The {{Package Official|cpufrequtils}} package is available in the [extra] repository:<br />
# pacman -S cpufrequtils<br />
<br />
== Configuration ==<br />
<br />
Configuring CPU scaling is a 3-part process:<br />
# Load appropriate CPU frequency driver<br />
# Load desired scaling governor(s)<br />
# Configure and load frequency scaling daemon (optional)<br />
<br />
=== CPU frequency driver ===<br />
In order for frequency scaling to work properly, the operating system must first know the limits of the CPU(s). To accomplish this, a kernel module is loaded that can read and manage the specifications of the CPU(s).<br />
<br />
Most modern notebooks and desktops can simply use the '''<tt>acpi-cpufreq</tt>''' driver. However, other options include the <tt>p4-clockmod</tt>, <tt>powernow-k6</tt>, <tt>powernow-k7</tt>, <tt>powernow-k8</tt>, and <tt>speedstep-centrino</tt> drivers. To see a full list of available drivers, run the following:<br />
<br />
$ ls /lib/modules/*/kernel/arch/*/kernel/cpu/cpufreq<br />
<br />
{{Tip|For an AMD "K10" CPU like Phenom X4, use the <tt>powernow-k8</tt> driver.}}<br />
<br />
To load the CPU frequency driver manually:<br />
<br />
==== Intel ====<br />
# modprobe acpi-cpufreq<br />
<br />
For older Intel CPUs, the command above may return with: <br />
FATAL: Error inserting acpi_cpufreq ([...]/acpi-cpufreq.ko): No such device<br />
<br />
In this case, replace the kernel module <tt>acpi-cpufreq</tt> with <tt>speedstep-centrino</tt>, <tt>p4-clockmod</tt> or <tt>speedstep-ich</tt>.<br />
<br />
Notice that the speedstep-centrino module is deprecated.<br />
<br />
There is a kernel with the speedstep-centrino module patched on the AUR, it is the '''<tt>kernel26-pentium-m</tt>''' package which is located here: http://aur.archlinux.org/packages.php?ID=33104<br />
<br />
==== AMD ====<br />
# modprobe powernow-k{6,7,8}<br />
<br />
Not all of the <tt>powernow-k*</tt> drivers may be available or necessary. If loading one of them fails, try loading them individually.<br />
<br />
=== Closing notes ===<br />
To load the driver automatically at startup, add the appropriate driver to the MODULES array within {{Filename|/etc/rc.conf}}. For example:<br />
MODULES=( '''acpi-cpufreq''' vboxdrv fuse fglrx iwl3945 ... )<br />
<br />
Once the appropriate cpufreq driver is loaded, detailed information about the CPU(s) can be displayed by running: <br />
$ cpufreq-info<br />
<br />
The output should appear similar to the following:<br />
<br />
{{Command<br />
|name=cpufreq-info<br />
|output=<nowiki><br />
analyzing CPU 0:<br />
driver: acpi-cpufreq<br />
CPUs which need to switch frequency at the same time: 0 1<br />
hardware limits: 1000 MHz - 2.00 GHz<br />
available frequency steps: 2.00 GHz, 1.67 GHz, 1.33 GHz, 1000 MHz<br />
available cpufreq governors: ondemand, performance<br />
current policy: frequency should be within 1000 MHz and 2.00 GHz.<br />
The governor "performance" may decide which speed to use<br />
within this range.<br />
current CPU frequency is 2.00 GHz.<br />
analyzing CPU 1:<br />
driver: acpi-cpufreq<br />
CPUs which need to switch frequency at the same time: 0 1<br />
hardware limits: 1000 MHz - 2.00 GHz<br />
available frequency steps: 2.00 GHz, 1.67 GHz, 1.33 GHz, 1000 MHz<br />
available cpufreq governors: ondemand, performance<br />
current policy: frequency should be within 1000 MHz and 2.00 GHz.<br />
The governor "performance" may decide which speed to use<br />
within this range.<br />
current CPU frequency is 2.00 GHz.<br />
</nowiki>}}<br />
<br />
Monitoring the CPU speed in real-time can be achieved by running:<br />
watch grep \"cpu MHz\" /proc/cpuinfo<br />
<br />
=== Cpufrequtils and Laptop Mode Tools ===<br />
<br />
If you are already using or plan to use [[Laptop Mode Tools]] for other power saving solutions, you may want to let it manage also CPU frequency scaling. <br />
In that case you just have to insert the <tt>acpi-cpufreq</tt> module to the MODULES array in {{Filename|/etc/rc.conf}}:<br />
MODULES=( '''acpi-cpufreq''' vboxdrv ... )<br />
<br />
And then go through the {{Filename|/etc/laptop-mode/conf.d/cpufreq.conf}} to define governors, frequencies and policies. <br />
<br />
If you use <tt>laptop-mode-tools</tt> to manage <tt>cpufrequtils</tt>, then you won't need to load other modules or to set up scaling governors and interaction with ACPI events. Please refer to [[Laptop Mode Tools]] to know how to install and configure Laptop Mode Tools.<br />
<br />
=== Scaling governors ===<br />
<br />
Governors can be thought of as pre-configured power schemes for the CPU. These governors must be loaded as kernel modules in order to be seen by such programs as ''kpowersave'' and ''gnome-power-manager''. One may load as many governors as desired (only one will be active at any given time).<br />
<br />
Available governors:<br />
<br />
;{{Codeline|performance}} ''(default)'': The performance governor is built into the kernel and runs the CPU(s) at maximum clock speed<br />
;{{Codeline|cpufreq_ondemand}} ''(recommended)'': Dynamically increases/decreases the CPU(s) clock speed based on system load<br />
;{{Codeline|cpufreq_conservative}}: Similar to {{Codeline|ondemand}}, but more conservative (clock speed changes are more graceful)<br />
;{{Codeline|cpufreq_powersave}}: Runs the CPU at minimum speed<br />
;{{Codeline|cpufreq_userspace}}: Manually configured clock speeds by user<br />
<br />
Add the desired governor(s) to the MODULES array in {{Filename|/etc/rc.conf}}:<br />
MODULES=(acpi-cpufreq '''cpufreq_ondemand''' '''cpufreq_powersave''' vboxdrv fuse fglrx iwl3945 ... )<br />
<br />
Alternatively, manually set the governor by running the {{Codeline|cpufreq-set}} command (as root). However, this setting will not be saved after a reboot/shutdown. For example:<br />
# cpufreq-set -g ondemand<br />
<br />
Run {{Codeline|cpufreq-set --help}} or {{Codeline|man cpufreq-set}} for more information.<br />
<br />
==== Interaction with ACPI events ====<br />
<br />
Users may configure scaling governors to switch automatically based on different ACPI events such as connecting the AC adapter or closing a laptop lid. Events are defined in {{Filename|/etc/acpi/handler.sh}}. If the {{Package Official|acpid}} package is installed, the file should already exist and be executable. For example, to change the scaling governor from {{Codeline|performance}} to {{Codeline|conservative}} when the AC adapter is disconnected and change it back if reconnected:<br />
<br />
{{File<br />
|name=/etc/acpi/handler.sh<br />
|content=<nowiki><br />
[...]<br />
<br />
ac_adapter)<br />
case "$2" in<br />
AC*)<br />
case "$4" in<br />
00000000)<br />
echo "conservative" >/sys/devices/system/cpu/cpu0/cpufreq/scaling_governor <br />
echo -n $minspeed >$setspeed<br />
#/etc/laptop-mode/laptop-mode start<br />
;;<br />
00000001)<br />
echo "performance" >/sys/devices/system/cpu/cpu0/cpufreq/scaling_governor<br />
echo -n $maxspeed >$setspeed<br />
#/etc/laptop-mode/laptop-mode stop<br />
;;<br />
esac<br />
;;<br />
*) logger "ACPI action undefined: $2" ;;<br />
esac<br />
;;<br />
<br />
[...]<br />
</nowiki>}}<br />
<br />
==== Changing the {{Codeline|ondemand}} governor's threshold ====<br />
<!-- ln from [[Browser Plugins#Flash Performance]] --><br />
To change when the {{Codeline|ondemand}} governor switches to a higher multiplier, one can manipulate {{Filename|/sys/devices/system/cpu/cpu'''#'''/cpufreq/ondemand/up_threshold}}. Determine the current setting by issuing the following command as root:<br />
# cat /sys/devices/system/cpu/cpu0/cpufreq/ondemand/up_threshold<br />
<br />
The value returned should be <tt>95</tt>, the default setting as of kernel version 2.6.31. This means that the {{Codeline|ondemand}} governor currently increases the clock rate if a core reaches 95% utilization. The can be changed, for example:<br />
# echo 50 > /sys/devices/system/cpu/cpu0/cpufreq/ondemand/up_threshold<br />
<br />
The governor will now switch to a higher clock rate if a core reaches 50% utilization. <br />
<br />
To re-apply this setting during boot, add the command to {{Filename|/etc/rc.local}}.<br />
<br />
{{Tip|One user found it necessary to use {{Codeline|1=(sleep 2 && echo 50 > /sys/devices/system/cpu/cpu0/cpufreq/ondemand/up_threshold) &}} or the command would fail with a "path not found" message during boot.}}<br />
<br />
{{Note|Adjusting only {{Codeline|cpu0}} should work fine on multi-core systems, as other entries that belong to the same physical processor are adjusted automatically.}}<br />
<br />
{{Note|Starting with 2.6.33 adjusting only one core is deprecated and will produce a warning message: {{Codeline|CPUFREQ: Per core ondemand sysfs interface is deprecated - up_threshold<br />
}} The command should be used instead: {{Codeline|echo "50" > /sys/devices/system/cpu/cpufreq/ondemand/up_threshold}} }}<br />
<br />
=== Daemon ===<br />
<br />
<tt>cpufrequtils</tt> also includes a daemon which allows users to set the desired scaling governor and min/max clock speeds for all processor cores at boot-time, without the need for additional tools such as ''kpowersave''.<br />
<br />
Before starting the daemon, edit {{Filename|/etc/conf.d/cpufreq}} as root, selecting the desired governor and setting the min/max speed for your CPU(s), for example:<br />
<br />
{{File<br />
|name=/etc/conf.d/cpufreq<br />
|content=<nowiki><br />
#configuration for cpufreq control<br />
<br />
# valid governors:<br />
# ondemand, performance, powersave,<br />
# conservative, userspace<br />
governor="ondemand"<br />
<br />
# valid suffixes: Hz, kHz (default), MHz, GHz, THz<br />
min_freq="1GHz"<br />
max_freq="2GHz"<br />
</nowiki>}}<br />
<br />
{{Note|The exact min/max values of the CPU(s) can be determined by running {{Codeline|cpufreq-info}} after loading the CPU driver (e.g. {{Codeline|modprobe acpi-cpufreq}}). However, these values are ''optional''. Users may omit them entirely by deleting or commenting out the min/max_freq lines; scaling will work automatically.}}<br />
<br />
With the appropriate configuration, start the daemon with the following command:<br />
# /etc/rc.d/cpufreq start<br />
<br />
To start the daemon automatically at startup, add {{Codeline|cpufreq}} to the DAEMONS array in {{Filename|/etc/rc.conf}}, for example:<br />
DAEMONS=(syslog-ng hal '''cpufreq''' dhcdbd networkmanager !network !netfs @alsa @crond @cups @fam @ntpd @sshd)<br />
<br />
== Troubleshooting ==<br />
<br />
* Some applications, like [[ntop]], do not respond well to automatic frequency scaling. In the case of ntop it can result in segmentation faults and lots of lost information as even the {{Codeline|ondemand}} governor cannot change the frequency quickly enough when a lot of packages suddenly arrive at the monitored network interface that cannot be handled by the current processor speed.<br />
<br />
* Some CPUs may suffer from poor performance with the default settings of the {{Codeline|ondemand}} governor (e.g. flash videos not playing smoothly or stuttering window animations). Instead of completely disabling frequency scaling to resolve these issues, the aggressiveness of frequency scaling can be increased by lowering the ''up_threshold'' sysctl variable for each CPU. See [[#Changing the ondemand governor's threshold]].<br />
<br />
* Sometimes the deamon may not throttle to the maximum frequence but one step below. This can be solved by setting max_freq value slightly higher than the real maximum. For example, if frequence range of the CPU is from 2.00GHz to 3.00GHz, setting max_freq to 3.01GHz can be a good idea.</div>Rent0nhttps://wiki.archlinux.org/index.php?title=Rxvt-unicode&diff=109326Rxvt-unicode2010-06-22T17:01:10Z<p>Rent0n: /* Tips and tricks */</p>
<hr />
<div>'''rxvt-unicode''' is a highly customizable [[Terminal Emulator|terminal emulator]] forked from [[Wikipedia:Rxvt|rxvt]]. Commonly known as ''urxvt'', rxvt-unicode can be [[daemon]]ized to run clients within a single [[Wikipedia:Process (computing)|process]] in order to minimize the use of system resources. Developed by Marc Lehmann, some of the more outstanding features of rxvt-unicode include international language support through [[Wikipedia:Unicode|Unicode]], the ability to display multiple font types and support for [[Wikipedia:Perl|Perl]] extensions.<br />
<br />
==Installation==<br />
Install the latest version of rxvt-unicode:<br />
# pacman -S rxvt-unicode<br />
or<br />
# pacman -S rxvt-unicode-256color<br />
to install rxvt with 256 color support<br />
<br />
==Configuration==<br />
<br />
===Creating ~/.Xdefaults===<br />
The look, feel and function of rxvt-unicode is typically controlled by way of either command-line arguments, or resource settings within the file {{Filename|~/.[[Xdefaults]]}}. Create if not present:<br />
$ cd ~<br />
$ touch .Xdefaults<br />
<br />
All that is left at this point is to enter desired settings by editing the file.<br />
<br />
{{Note|Command-line arguments override and take precedence over the resource settings established in this file.}}<br />
<br />
===Example ~/.Xdefaults===<br />
[http://i275.photobucket.com/albums/jj281/adamchrista/Arch%20Linux/Wiki%20Examples/urxvt-man.png rxvt-unicode Example Screenshot]<br />
<pre><br />
URxvt.buffered: true<br />
URxvt.background: black<br />
URxvt.foreground: white<br />
URxvt.cursorColor: green<br />
URxvt.underlineColor: yellow<br />
URxvt.font: xft:Terminus:pixelsize=14:antialias=false<br />
URxvt.boldFont: xft:Terminus:bold:pixelsize=14:antialias=false<br />
URxvt.perl-ext-common: default,tabbed<br />
URxvt.title: ArchWiki Example<br />
</pre><br />
<br />
See the [http://pod.tst.eu/http://cvs.schmorp.de/rxvt-unicode/doc/rxvt.1.pod rxvt-unicode reference page] for the complete list of available setting and values.<br />
<br />
===Another Example ~/.Xdefaults===<br />
[http://nsa14.casimages.com/img/2010/05/08/100508043340911093.png Screenshot of this example]<br />
<br />
<pre><br />
URxvt.geometry: 400x30 <br />
URxvt.buffered: true<br />
URxvt.background: black<br />
URxvt.foreground: green<br />
URxvt.cursorColor: yellow<br />
URxvt.underlineColor: green<br />
URxvt.font:xft:Bitstream Vera Sans Mono:pixelsize=12:antialias=true<br />
<br />
!------------<br />
!True Transparency<br />
!------------<br />
!set to 32-bit for real transparency (compositing required (see xcompmgr)<br />
urxvt*depth: 32<br />
!transparent=0000 opaque=ffff<br />
urxvt*background: rgba:1111/1111/1111/dddd<br />
!urxvt*background: rgba:1111/1111/1111/0000<br />
<br />
<br />
!------------------<br />
!False tranparency<br />
!------------------<br />
!URxvt.transparent: true<br />
!URxvt.shading: 50 <br />
<br />
Urxvt.secondaryScroll: true # Enable Shift-PageUp/Down in screen<br />
</pre><br />
<br />
==Tips and tricks==<br />
<br />
===Clickable URLs===<br />
You can make URLs in the terminal clickable if you have Perl installed. For example, to open links in [[Firefox]] add the following to {{Filename|.Xdefaults}}:<br />
URxvt.perl-ext-common: default,matcher<br />
URxvt.urlLauncher: /usr/bin/firefox<br />
URxvt.matcher.button: 1 <br />
<br />
===Cut and paste===<br />
For users unfamiliar with [[Xorg]]'s data transfer methods, the exchange of information to and from rxvt-unicode can become a burden. Suffice to say that rxvt-unicode uses cut buffers which are typically loaded into the current <tt>PRIMARY</tt> selection by default.<sup>[http://pod.tst.eu/http://cvs.schmorp.de/rxvt-unicode/doc/rxvt.1.pod#THE_SELECTION_SELECTING_AND_PASTING_]</sup> Users are urged to review [[Wikipedia:X Window selection]] for additional information.<br />
<br />
====Clipboard management====<br />
* [http://parcellite.sourceforge.net/ Parcellite] is a GTK+ clipboard manager which can also run in the background as a daemon.<br />
<br />
* [http://www.nongnu.org/autocutsel/ autocutsel] provides command line and daemon interfaces to synchronize PRIMARY, <tt>CLIPBOARD</tt> and cut buffer selections.<br />
<br />
* [http://glipper.sourceforge.net/ Glipper] is a [[GNOME]] panel applet with older versions available for use in environments other than GNOME.<br />
<br />
* [http://goodies.xfce.org/projects/panel-plugins/xfce4-clipman-plugin Clipman] (xfce-clipman-plugin) is a GUI clipboard manager plugin for the [[Xfce]] panel (xfpanel).<br />
<br />
====No clipboard management solution====<br />
Skottish[http://bbs.archlinux.org/viewtopic.php?pid=506845#p506845] created a perl script to automatically copy any selection in urxvt to the X clipboard. Save the following as {{Filename|/usr/lib/urxvt/perl/clipboard}}:<br />
<pre><br />
#! /usr/bin/perl<br />
<br />
sub on_sel_grab {<br />
my $query=quotemeta $_[0]->selection;<br />
$query=~ s/\n/\\n/g;<br />
$query=~ s/\r/\\r/g;<br />
system( "echo -en " . $query . " | xsel -i -b -p" );<br />
}<br />
</pre><br />
<br />
Xyne has also created his own variation of Skottish's script (which is also [http://aur.archlinux.org/packages.php?ID=35526 available in the AUR]):<br />
<pre><br />
#! /usr/bin/perl<br />
<br />
sub on_sel_grab {<br />
my $query = $_[0]->selection;<br />
open (my $pipe,'|-','xsel -ibp') or die;<br />
print $pipe $query;<br />
close $pipe;<br />
}<br />
</pre><br />
<br />
It also requires {{Codeline|xsel}} and needs to be enabled in the {{Codeline|*perl-ext-common}} or {{Codeline|*perl-ext}} field in {{Filename|.Xdefaults}}. For example:<br />
URxvt.perl-ext-common: default,clipboard<br />
<br />
===Tabs===<br />
To add tabs to urxvt, add the following to your {{Filename|~/.Xdefaults}}:<br />
<pre><br />
URxvt.perl-ext-common: default,tabbed<br />
</pre><br />
<br />
To control tabs use:<br />
<br />
Shift+Down: new tab<br />
<br />
Shift+Left: go to left tab<br />
<br />
Shift+Right: go to right tab<br />
<br />
Ctrl+Left: move tab to the left<br />
<br />
Ctrl+Right: move tab to the right<br />
<br />
Ctrl+d: close tab <br />
<br />
You can change tabs' colors with the following:<br />
<pre><br />
URxvt.tabbed.tabbar-fg: <colour-index, default 3><br />
URxvt.tabbed.tabbar-bg: <colour-index, default 0><br />
URxvt.tabbed.tab-fg: <colour-index, default 0><br />
URxvt.tabbed.tab-bg: <colour-index, default 1><br />
</pre><br />
<br />
Colors must be specified using color indexes: 0 to 15 correspond to your {{Filename|~/.Xdefaults}} colors, -1 is the background color and -2 is the foreground color.<br />
<br />
===Font declaration methods===<br />
URxvt.font: 9x15<br />
is the same as<br />
-misc-fixed-medium-r-normal--15-140-75-75-c-90-iso8859-1<br />
and <br />
URxvt.font: 9x15bold<br />
is the same as<br />
URxvt.font: -misc-fixed-bold-r-normal--15-140-75-75-c-90-iso8859-1<br />
<br />
The complete list of short names for X core fonts can be found in /usr/share/fonts/misc/fonts.alias . (There are also fonts.alias files in some of the other subdirectories of /usr/share/fonts/ , but as they are packaged separately from the actual fonts, they may list fonts you don't actually have installed.) It is worth noting that these short aliases select for ISO-8859-1 versions of the fonts rather than ISO-10646-1 (Unicode) versions, and 75 DPI rather than 100 DPI versions, so you're probably better off avoiding them and choosing fonts by their full long names instead.<br />
<br />
===Improved Kuake-like behavior in Openbox===<br />
This was originally posted on the forum by Xyne<sup>[http://bbs.archlinux.org/viewtopic.php?pid=550380]</sup> and it relies on {{Codeline|xdotool}} which is available in the community repo.<br />
<br />
====The scriptlets====<br />
Save this scriptlet from the {{Codeline|urxvtc}} man page somewhere on your system as {{Filename|urxvtc}} (e.g., in {{Filename|~/.config/openbox}}):<br />
<pre><br />
#!/bin/sh<br />
urxvtc "$@"<br />
if [ $? -eq 2 ]; then<br />
urxvtd -q -o -f<br />
urxvtc "$@"<br />
fi<br />
</pre><br />
<br />
and save this one as {{Filename|urxvtq}}:<br />
<pre><br />
#!/bin/bash<br />
<br />
wid=$(xdotool search --classname urxvtq)<br />
if [ -z "$wid" ]; then<br />
/path/to/urxvtc -name urxvtq -geometry 80x28<br />
wid=$(xdotool search --classname urxvtq | head -1)<br />
xdotool windowfocus $wid<br />
xdotool key Control_L+l<br />
else<br />
if [ -z "$(xdotool search --onlyvisible --classname urxvtq 2>/dev/null)" ]; then<br />
xdotool windowmap $wid<br />
xdotool windowfocus $wid<br />
else<br />
xdotool windowunmap $wid<br />
fi<br />
fi<br />
</pre><br />
<br />
A previous version of xdotool introduced a bug which disabled recognition of visible windows and thus led some users to use the following scriptlet in place of the previous one. This is no longer necessary as xdotool>=1.20100416.2809, but it has been left here for future reference.<br />
<pre><br />
#!/bin/bash<br />
<br />
wid=$(xprop -name urxvtq | grep 'WM_COMMAND' | awk -F ',' '{print $3}' | awk -F '"' '{print $2}')<br />
if [ -z "$wid" ]; then<br />
/path/to/urxvtc -name urxvtq -geometry 200x28<br />
wid=$(xprop -name urxvtq | grep 'WM_COMMAND' | awk -F ',' '{print $3}' | awk -F '"' '{print $2}')<br />
xdotool windowfocus $wid<br />
xdotool key Control_L+l<br />
else<br />
if [ -z "$(xprop -id $wid | grep 'window state: Normal' 2>/dev/null)" ]; then<br />
xdotool windowmap $wid<br />
xdotool windowfocus $wid<br />
else<br />
xdotool windowunmap $wid<br />
fi<br />
fi<br />
</pre><br />
<br />
Make sure that you change {{Filename|/path/to/urxvtc}} to the actual path to the {{Filename|urxvtc}} scriptlet that you saved above. We'll be using {{Filename|urxvtc}} to launch both regular instances of {{Codeline|urxvt}} and the kuake-like instance.<br />
<br />
====urxvtq with tabbing====<br />
If you want to have tabs in your kuake-like {{Filename|urxvtc}} (here called {{Filename|urxvtq}}) just replace the third line in your {{Filename|urxvtq}}:<br />
wid=$(xdotool search --name urxvtq)<br />
with:<br />
wid=$(xdotool search --name urxvtq | grep -m 1 "" )<br />
<br />
To activate the tab support, you can either replace the fifth line of your {{Filename|urxvtq}}:<br />
/path/to/urxvtc -name urxvtq -geometry 80x28<br />
with:<br />
/path/to/urxvtc -name urxvtq -pe tabbed -geometry 80x28<br />
or replace this line of your {{Filename|.Xdefaults}}:<br />
URxvt.perl-ext-common: default,matcher<br />
with<br />
URxvt.perl-ext-common: default,matcher,tabbed<br />
<br />
=====Tab control=====<br />
<SHIFT>-Left: Switch to the tab left of current one<br />
<br />
<SHIFT>-Right: Switch to the tab right of current one<br />
<br />
<SHIFT>-Down: Create a new tab<br />
<br />
You can also use your mouse to switch the tabs by clicking the wished one and create a new tab by clicking on ''[NEW].\\''<br />
<br />
To close a tab just enter 'exit' like you'll close a terminal.<br />
<br />
====Openbox configuration====<br />
Now add the following lines to the {{Codeline|<applications>}} section of {{Filename|~/.config/openbox/rc.xml}}:<br />
<pre><br />
<application name="urxvtq"><br />
<decor>no</decor><br />
<position force="yes"><br />
<x>center</x><br />
<y>0</y><br />
</position><br />
<desktop>all</desktop><br />
<layer>above</layer><br />
<skip_pager>yes</skip_pager><br />
<skip_taskbar>yes</skip_taskbar><br />
<maximized>Horizontal</maximized><br />
</application><br />
</pre><br />
<br />
and add these lines to the {{Codeline|<keyboard>}} section:<br />
<pre><br />
<keybind key="W-t"><br />
<action name="Execute"><br />
<command>/path/to/urxvtc</command><br />
</action><br />
</keybind><br />
<keybind key="W-grave"><br />
<action name="Execute"><br />
<execute>/path/to/urxvtq</execute><br />
</action><br />
</keybind><br />
</pre><br />
<br />
Here too you need to change the {{Filename|/path/to/*}} lines to point to the scripts that you saved above. Save the file and then reconfigure Openbox. You should now be able to launch regular instances of urxvt with the Windows/Super key + "'''t'''", and toggle the kuake-like console with Windows/Super+grave ('''`''').<br />
<br />
====Further configuration====<br />
The advantage of this configuration over the urxvt kuake perl script is that Openbox provides more keybinding options such as modifier keys. The kuake script hijacks an entire physical key regardless of any modifier combination. Review the [http://icculus.org/openbox/index.php/Help:Bindings Openbox bindings documentation] for the full range or possibilities.<br />
<br />
The [http://icculus.org/openbox/index.php/Help:Applications Openbox per-app settings] can be used to further configure the behavior of the kuake-like console (e.g. screen position, layer, etc). You may need to change the "geometry" parameter in the {{Filename|urxvtq}} scriptlet to adjust the height of the console.<br />
<br />
====Related scripts====<br />
*hbekel has posted a generalized version of the {{Filename|urxvtq}} [http://bbs.archlinux.org/viewtopic.php?pid=550380#p550380 here] which can be used to toggle any application using {{Codeline|xdotool}}.<br />
<br />
*http://www.jukie.net/~bart/blog/20070503013555 - A script for opening url's with your keyboard instead of mouse with urxvt.<br />
<br />
===Rxvt-unicode as gmrun terminal===<br />
Unlike some other terminals, urxvt expects the arguments to -e to be given separately, rather than grouped together with quotes. This causes trouble with gmrun, which assumes the opposite behavior. This can be worked around by putting an "eval" in front of gmrun's "Terminal" variable in .gmrunrc:<br />
<pre><br />
Terminal = eval urxvt<br />
TermExec = ${Terminal} -e<br />
</pre><br />
(gmrun uses /bin/sh to execute commands, so the "eval is understood here.) The "eval" has the side-effect of "breaking up" the argument to -e in the same way $@ does in bash, making the command intelligible to urxvt.<br />
<br />
===Improving performance===<br />
*Avoid the use of Xft fonts. If Xft fonts must be used, append {{Codeline|<nowiki>:antialias=false</nowiki>}} to the setting value.<sup>[http://pod.tst.eu/http://cvs.schmorp.de/rxvt-unicode/doc/rxvt.7.pod#Can_I_speed_up_Xft_rendering_somehow]</sup><br />
<br />
*Build rxvt-unicode with disabled support for unnecessary features, {{Codeline|--disable-xft}} and {{Codeline|--disable-unicode3}} in particular.<sup>[http://pod.tst.eu/http://cvs.schmorp.de/rxvt-unicode/doc/rxvt.7.pod#Rxvt_unicode_uses_gobs_of_memory_how]</sup><br />
<br />
*Limit the number of {{Codeline|saveLines}} (option {{Codeline|-sl}}) in the scrollback buffer to reduce memory usage.<sup>[http://pod.tst.eu/http://cvs.schmorp.de/rxvt-unicode/doc/rxvt.7.pod#Isn_t_rxvt_unicode_supposed_to_be_sm]</sup><br />
<br />
*Consider running {{Codeline|urxvtd}} as a daemon accepting connections from {{Codeline|urxvtc}} clients.<br />
<br />
==External resources==<br />
*[http://software.schmorp.de/pkg/rxvt-unicode.html rxvt-unicode] - Official site<br />
*[http://pod.tst.eu/http://cvs.schmorp.de/rxvt-unicode/doc/rxvt.7.pod rxvt-unicode FAQ] - Official FAQ<br />
*[http://pod.tst.eu/http://cvs.schmorp.de/rxvt-unicode/doc/rxvt.1.pod rxvt-unicode Reference] - Official manual page<br />
*[http://pod.tst.eu/http://cvs.schmorp.de/rxvt-unicode/src/urxvt.pm urxvtperl] - Official Perl extension reference<br />
*{{Codeline|man urxvt}}<br />
<br />
[[Category:Utilities (English)]] [[Category:HOWTOs (English)]]</div>Rent0nhttps://wiki.archlinux.org/index.php?title=Mutt&diff=105219Mutt2010-05-02T14:19:11Z<p>Rent0n: /* Additional resources */</p>
<hr />
<div>[[Category:Internet and Email (English)]]<br />
[[Category:HOWTOs (English)]]<br />
{{i18n|Mutt}}<br />
<br />
'''Mutt''' is a text-based mail client renowned for its powerful features. Mutt, though over a decade old, remains the mail client of choice for great number of power-users. Unfortunately, a default Mutt install is plagued by complex keybindings along a daunting amount of documentation. This guide will help the average user get Mutt up and running, and begin customizing as deemed fit.<br />
<br />
==Overview==<br />
Mutt focuses on being a Mail User Agent (MUA), and was originally written to only view mail. Because of this, later implemented mail retrieval, sending and filtering features are basic compared to other applications. Most Mutt setups rely on external programs to do those tasks. <br />
<br />
In any case, the Arch {{Package Official|mutt}} package has been compiled with IMAP, POP3 and SMTP support, and thus does not need external programs to deal with mail.<br />
<br />
This article will cover using both native IMAP mail sending/retrival, and a setup depending on [[OfflineIMAP]] or [[getmail]] (POP3) to retrieve mail, [[procmail]] to filter it in the case of POP3, and [[msmtp]] to send it.<br />
<br />
==Installing==<br />
Install Mutt:<br />
# pacman -S mutt<br />
<br />
Optionally install external helper applications for an IMAP setup:<br />
# pacman -S offlineimap msmtp<br />
<br />
Or if using POP3:<br />
# pacman -S getmail procmail<br />
<br />
===Notes===<br />
*If you just need the authentication methods LOGIN and PLAIN, these are satisfied with the dependency {{Package Official|libsasl}}.<br />
*If you want to (or have to) use CRAM-MD5, GSSAPI or DIGEST-MD5, install also the package {{Package Official|cyrus-sasl-plugins}}, and you're done. <br />
*if you are using Gmail as your smtp server, you may need to install the package {{Package Official|cyrus-sasl}}.<br />
<br />
==Configuring==<br />
This section covers IMAP, [[#POP3]], [[#MailDir]] and [[#SMTP]] configuration.<br />
<br />
Note that Mutt will recognize two locations for its configuration file; {{filename|~/.muttrc}} and {{filename|~/.mutt/muttrc}}. Either location will work.<br />
<br />
===IMAP===<br />
''Native and external setups''<br />
<br />
====Using native IMAP support====<br />
The pacman version of Mutt is compiled with IMAP support. At the very least you need to have 4 lines in your muttrc file to be able to access your mail.<br />
<br />
=====spoolfile=====<br />
Instead of a local mail spool, specify {{codeline|imap}} server. <br />
set spoolfile=imap[s]://imap.server.domain[:port]/folder<br />
<br />
Use {{codeline|imaps}} for SSL encryption or {{codeline|imap}} for no encryption. The port number is only needed when your server's port is non-standard. End with the folder name where new mail arrives, which is almost always INBOX. For example:<br />
set spoolfile=imaps://imap.gmail.com/INBOX<br />
<br />
=====imap_user=====<br />
set imap_user=USERNAME<br />
<br />
Continuing with the previous example, remember that gmail requires your full email address (this is not standard):<br />
set imap_user=your.username@gmail.com<br />
<br />
=====folder=====<br />
Instead of a local directory which contains all your mail (and directories), use your server (and the highest folder in the hierarchy, if needed).<br />
set folder=imap[s]://imap.server.domain[:port]/[folder/]<br />
<br />
You don't have to use a folder, but it might be convenient if you have all your other folders inside your INBOX, for example. Whatever you set here as your folder can be accessed later in Mutt with just an equal sign (=). Example:<br />
set folder=imaps://imap.gmail.com/<br />
<br />
=====mailboxes=====<br />
Any imap folders that should be checked regularly for new mail should be listed here (all on the same line).<br />
mailboxes <list of folders><br />
<br />
You can now use '=' or '+' as a substitution for the full {{codeline|folder}} path that was configured above. For example:<br />
mailboxes =INBOX =family<br />
mailboxes imaps://imap.gmail.com/INBOX imaps://imap.gmail.com/family<br />
<br />
These two versions are equivalent, but the first is much more convenient. Also, Mutt is configured by default to include a macro bound to the 'y' key which will allow you to change to any of the folders listed under mailboxes.<br />
<br />
=====Summary=====<br />
Using these options, you'll be able to start mutt, enter your IMAP password, and start reading your mail. Here is a muttrc snippet (for Gmail) with some other lines you might consider adding for better IMAP support.<br />
<pre><br />
set folder = imaps://imap.gmail.com/<br />
set spoolfile = imaps://imap.gmail.com/INBOX<br />
set imap_user = your.username@gmail.com<br />
set imap_pass = your-imap-password<br />
mailboxes = +INBOX<br />
<br />
# store message headers locally to speed things up<br />
set header_cache = ~/.mutt/hcache<br />
<br />
# specify where to save and/or look for postponed messages<br />
set postponed = +[Gmail]/Drafts<br />
<br />
# allow mutt to open new imap connection automatically<br />
set imap_passive = no<br />
<br />
# keep imap connection alive by polling intermittently (time in seconds)<br />
set imap_keepalive = 300<br />
<br />
# how often to check for new mail (time in seconds)<br />
set mail_check = 120<br />
</pre><br />
<br />
====External IMAP support====<br />
While IMAP-functionality is built into Mutt, it does not download mail for offline-use. The [[OfflineIMAP]] article describes how to download your emails to a local folder which can then be processed by Mutt.<br />
<br />
Consider using applications such as [[spamassassin]] or [[imapfilter]] to sort mail.<br />
<br />
===POP3===<br />
''Retrieving and sorting mail with external applications''<br />
<br />
====Retrieving mail====<br />
Create the directory <code>~/.getmail/</code>. Open the file <code>~/.getmail/getmailrc</code> in your favorite text editor.<br />
<br />
Here is an example <code>getmailrc</code> used with a gmail account.<br />
<pre><br />
[retriever]<br />
type = SimplePOP3SSLRetriever<br />
server = pop.gmail.com<br />
username = username@gmail.com<br />
port = 995<br />
password = password<br />
<br />
[destination]<br />
type = Maildir<br />
path = ~/mail/<br />
</pre><br />
<br />
You can tweak this to your POP3 service's specification.<br />
<br />
For this guide we will be storing our mail in the <code>maildir</code> format. The two main mailbox formats are <code>mbox</code> and <code>maildir</code>. The main difference between the two is that <code>mbox</code> is one file, with all of your mails and their headers stored in it, whereas a <code>maildir</code> is a directory tree. Each mail is its own file, which will often speed things up.<br />
<br />
A <code>maildir</code> is just a folder with the folders <code>cur</code>, <code>new</code> and <code>tmp</code> in it.<br />
mkdir -p ~/mail/{cur,new,tmp}<br />
<br />
Now, run getmail. If it works fine, you can create a cronjob for getmail to run every n hours/minutes. Type <code>crontab -e</code> to edit cronjobs, and enter the following:<br />
*/30 * * * * /usr/bin/getmail<br />
That will run <code>getmail</code> every 30 minutes.<br />
<br />
====Sorting mail====<br />
[http://www.procmail.org/ Procmail] is an extremely powerful sorting tool. For the purposes of this wiki, we will do some primitive sorting to get started.<br />
<br />
You must edit your getmailrc to pass retrieved mail to procmail:<br />
<pre><br />
[destination]<br />
type = MDA_external<br />
path = /usr/bin/procmail<br />
</pre><br />
<br />
Now, open up <code>.procmailrc</code> in your favorite editor. The following will sort all mail from the happy-kangaroos mailing list, and all mail from your lovey-dovey friend in their own maildirs.<br />
<pre><br />
MAILDIR=$HOME/mail<br />
DEFAULT=$MAILDIR/inbox/<br />
LOGFILE=$MAILDIR/log<br />
<br />
:0:<br />
* ^To: happy-kangaroos@nicehost.com<br />
happy-kangaroos/<br />
<br />
:0:<br />
* ^From: loveydovey@iheartyou.net<br />
lovey-dovey/<br />
</pre><br />
After you've saved your <code>.procmailrc</code>, run getmail and see if procmail succeeds in sorting your mail into the appropriate directories.<br />
<br />
'''Note:''' One easy to make mistake with .procmailrc is the permission. procmail require it to have permission 644 and won't give meaningless error message if you don't.<br />
<br />
===MailDir===<br />
MailDir is a generic and standardized format. Almost every MUA is able to handle MailDirs and Mutt's support is excellent. There are just a few simple things that you need to do to get Mutt to use them. Open your muttrc with and add the following lines:<br />
<pre><br />
set mbox_type=Maildir<br />
set folder=$HOME/Mail<br />
set spoolfile=+/INBOX<br />
set header_cache=~/.hcache<br />
</pre><br />
<br />
This is a minimal Configuration that enables you to access your Maildir and checks for new local Mails in INBOX. This configuration also caches the headers of the eMails to speed up directory-listings. It might not be enabled in your build (but it sure is in the Arch-Package) Note that this does not affect OfflineIMAP in any way. It always syncs the all directories on a Server. <code>spoolfile</code> tells Mutt which local directories to poll for new Mail. You might want to add more Spoolfiles (for example the Directories of Mailing-Lists) and maybe other things. But this is subject to the Mutt manual and beyond the scope of this document.<br />
<br />
===SMTP===<br />
Whether you use POP or IMAP to receive mail you will probably still send mail using SMTP.<br />
<br />
====Using native SMTP support====<br />
The pacman version of Mutt is also compiled with SMTP support. Just check the online manual [http://manual.cream.org/index.cgi/muttrc.5 muttrc], or <code>man muttrc</code> for more information.<br />
<br />
For example:<br />
<pre><br />
set my_pass='mysecretpass'<br />
set my_user=myname@gmail.com<br />
<br />
set smtp_url=smtps://$my_user:$my_pass@smtp.gmail.com<br />
set ssl_force_tls = yes<br />
</pre><br />
<br />
====External SMTP support====<br />
An external SMTP agenta such as [[msmtp]] or [[SSMTP]] can also be used. This section exclusively covers configuring Mutt for msmtp.<br />
<br />
Edit Mutt's configuration file or create it if unpresent:<br />
{{file|name=muttrc|content=<br />
set realname='Disgruntled Kangaroo'<br />
<br />
set sendmail="/usr/bin/msmtp"<br />
<br />
set edit_headers=yes<br />
set folder=~/mail<br />
set mbox=+mbox<br />
set spoolfile=+inbox<br />
set record=+sent<br />
set postponed=+drafts<br />
set mbox_type=Maildir<br />
<br />
mailboxes +inbox +lovey-dovey +happy-kangaroos<br />
}}<br />
<br />
Now, startup {{codeline|mutt}}:<br />
$ mutt<br />
<br />
You should see all the mail in {{filename|~/mail/inbox}}. Press {{keypress|m}} to compose mail; it will use the editor defined by your {{codeline|EDITOR}} environment variable. If this variable is not set, type:<br />
$ export EDITOR=editorbin<br />
<br />
For testing purposes, address the letter to yourself. After you have written the letter, save and exit the editor. You will return to Mutt, which will now show information about your e-mail. Press {{keypress|y}} to send it.<br />
<br />
==Customizing==<br />
Guides to get you started with using & customizing Mutt : <br />
* [http://mutt.blackfish.org.uk/ My first mutt] (maintained by Bruno Postle) <br />
* [http://www.therandymon.com/woodnotes/mutt/using-mutt.html The Woodnotes Guide to the Mutt Email Client] (maintained by Randall Wood)<br />
<br />
If you have any Mutt specific questions, feel free to ask in [[ArchChannel|the irc channel]].<br />
<br />
===Printing===<br />
You can install {{package AUR|muttprint}} from the [[AUR]] for a fancier printing quality.<br />
In your muttrc file, insert:<br />
set print_command="/usr/bin/muttprint %s -p {PrinterName}"<br />
<br />
===Signature block===<br />
Create a .signature in your home directory. Your signature will be appended at the end of your email.<br />
<br />
===Viewing URLs & opening Firefox===<br />
Your should start by creating a .mutt directory in $HOME if not done yet. There, create a file named macros. Insert the following:<br />
macro pager \cb <pipe-entry>'urlview'<enter> 'Follow links with urlview'<br />
<br />
Then install urlview with:<br />
pacman -S urlview<br />
<br />
Create a .urlview in $HOME and insert the following:<br />
REGEXP (((http|https|ftp|gopher)|mailto)[.:][^ >"\t]*|www\.[-a-z0-9.]+)[^ .,;\t>">\):]<br />
COMMAND firefox %s <br />
<br />
When you read an email on the pager, hitting ctrl+b will list all the urls from the email. Navigate up or down with arrow keys and hit enter on the desired url. Firefox will start and go to the selected site.<br />
<br />
*Note - urlview has been moved to unsupported and is available in AUR here[http://aur.archlinux.org/packages.php?ID=16703]<br />
<br />
*Note - If you have some problems with urlview due to Mutt's url encoding you can try [http://www.memoryhole.net/~kyle/extract_url/ extract_url.pl]<br />
<br />
===Mutt and Vim===<br />
*To limit the width of text to 72 characters, edit your .[[vim]]rc file and add:<br />
au BufRead /tmp/mutt-* set tw=72<br />
<br />
*Another choice is to use Vim's mail filetype plugin to enable other mail-centric options besides 72 character width. Edit {{filename|~/.vim/filetype.vim}}, creating it if unpresent, and add:<br />
<pre> <br />
augroup filetypedetect<br />
" Mail<br />
autocmd BufRead,BufNewFile *mutt-* setfiletype mail<br />
augroup END<br />
</pre><br />
<br />
*To set a different tmp directory, e.g. ~/.tmp, add a line to your muttrc as follows:<br />
set tmpdir="~/.tmp"<br />
<br />
*To reformat a modified text see the Vim context help<br />
:h 10.7<br />
<br />
===Viewing HTML within a Vim/Mutt setup===<br />
This setup will pass the html body to lynx and then dump it in Vim, keeping email viewing uniform and unobtrusive.<br />
<br />
Install lynx:<br />
pacman -S lynx<br />
<br />
If ''~/.mutt/mailcap'' does not exist you will need to create it and save the following to it.<br />
text/html; lynx -dump %s; nametemplate=%s.html; copiousoutput<br />
<br />
Edit muttrc and add the following,<br />
set mailcap_path = ~/.mutt/mailcap<br />
<br />
The beauty of this is, instead of seeing an html body as source or being opened by a seperate program, in this case lynx, it gets parsed to Vim as html, any url links within the email can be displayed with Ctrl+b.<br />
<br />
===Mutt and GNU nano===<br />
[[nano]] is another nice console editor to use with Mutt. <br />
<br />
To limit the width of text to 72 characters, edit your .nanorc file and add:<br />
set fill 72<br />
<br />
Also, in muttrc file, you can specify the line to start editing so that you will skip the mail header:<br />
set editor="nano +7"<br />
<br />
== Additional resources ==<br />
* [http://www.mutt.org/ The official Mutt website]<br />
* [http://wiki.mutt.org/ The Mutt wiki]<br />
* [http://pbrisbin.com:8080/pages/mutt2.html Brisbin's great guide on how to setup different IMAP accounts with mutt + offlineimap + msmtp]</div>Rent0nhttps://wiki.archlinux.org/index.php?title=Pm-utils&diff=101979Pm-utils2010-04-06T19:48:48Z<p>Rent0n: /* Hibernation (suspend2disk) */</p>
<hr />
<div>[[Category:Power management (English)]]<br />
[[Category:HOWTOs (English)]]<br />
{{i18n|pm-utils}} {{DISPLAYTITLE:pm-utils}}<br />
<br />
'''pm-utils''' is the new suspend and powerstate setting framework. It is designed to replace such scripts as those provided by the <tt>powersave</tt> package.<br />
<br />
It is usually used by HAL to execute the various hacks needed to work around bugs in drivers and subsystems that are not yet aware of suspend. It is easily extensible by putting custom hooks into a directory, which can either be done by the system administrator or those hooks can be part of a package, especially if this package needs special attention during a system suspend or power state transition.<br />
<br />
Used in conjunction with the [[cpufrequtils]] package, notebook (and desktop) owners are provided with a complete power management suite.<br />
<br />
== Installation ==<br />
<br />
The <tt>pm-utils</tt> package is now available from the [http://www.archlinux.org/packages/search/?q=pm-utils Extra] repository:<br />
# pacman -S pm-utils<br />
<br />
{{note|If you run into issues when resuming video, it might be necessary to also sync <tt>vbetool</tt> from [extra].}}<br />
<br />
== Basic Configuration ==<br />
=== Hibernation (suspend2disk) ===<br />
In order for suspend2disk (hibernate) to work, we need to edit ''/boot/grub/menu.lst'' as root and add '''resume=/path/to/swap/drive''' (e.g. /dev/sda2) to the kernel options, for example:<br />
# (0) Arch Linux<br />
title Arch Linux<br />
root (hd0,0)<br />
kernel /vmlinuz26 root=/dev/sda3 '''resume=/dev/sda2''' ro vga=0<br />
initrd /kernel26.img<br />
<br />
Raid swap example:<br />
# (0) Arch Linux<br />
title Arch Linux<br />
root (hd0,0)<br />
kernel /vmlinuz26 root=/dev/md2 resume=/dev/md0 ro md=0,/dev/sda2,/dev/sdb2 md=2,/dev/sda5,/dev/sdb5 vga=773<br />
initrd /kernel26.img<br />
<br />
It is also necessary to add the '''resume''' hook in the HOOKS section of the {{filename|/etc/mkinitcpio.conf}} file:<br />
<pre>HOOKS="base udev autodetect pata scsi sata filesystems keymap resume"</pre><br />
<br />
When the machine is placed into hibernation, it will now move all data from RAM to the swap partition... you ''did'' make your swap partition large enough to hold your RAM data, right?<br />
<br />
Even if your swap partition is smaller than RAM, you still have a big chance in hibernating successfully. According to [http://www.mjmwired.net/kernel/Documentation/power/interface.txt kernel documentation], ''/sys/power/image_size controls the size of the image created by the suspend-to-disk mechanism'', which has a default value of 512M. ''The suspend-to-disk mechanism will do its best to ensure the image size will not exceed that number.'' You may either decrease it due to a small swap partition or increase it in purpose of possible hibernation speed up.<br />
[[File:Example.jpg]]<br />
<br />
=== Suspend/Hibernate as regular user ===<br />
<br />
Two methods are available to suspend without the need for a root password: using HAL, and giving the user permissions.<br />
<br />
==== HAL Method ====<br />
<br />
HAL can be invoked as regular user to suspend by:<br />
<br />
<pre>dbus-send --system --print-reply --dest=org.freedesktop.Hal \<br />
/org/freedesktop/Hal/devices/computer \<br />
org.freedesktop.Hal.Device.SystemPowerManagement.Suspend int32:0</pre><br />
<br />
and Hibernate by:<br />
<br />
<pre>dbus-send --system --print-reply --dest=org.freedesktop.Hal \<br />
/org/freedesktop/Hal/devices/computer \<br />
org.freedesktop.Hal.Device.SystemPowerManagement.Hibernate</pre><br />
<br />
==== User Permission Method ====<br />
<br />
Because the <tt>pm-utils</tt> scripts must be run as root, you may want to make the scripts accessible to normal users by running sudo without the root password. To do so, edit the {{Filename|/etc/sudoers}} file with {{Codeline|visudo}}, for example:<br />
<br />
# visudo<br />
<br />
add the following lines, replacing ''username'' with your own:<br />
<br />
''username'' ALL = NOPASSWD: /usr/sbin/pm-hibernate<br />
''username'' ALL = NOPASSWD: /usr/sbin/pm-suspend<br />
<br />
save and exit visudo<br />
<br />
Or you can enable it for a group, using the following lines, of course replacing ''group'':<br />
<br />
''%group'' ALL = NOPASSWD: /usr/sbin/pm-hibernate<br />
''%group'' ALL = NOPASSWD: /usr/sbin/pm-suspend<br />
<br />
Note: These must come after any user privilege specifications, e.g., "username ALL=(ALL) ALL", or they won't work.<br />
<br />
You can now run the scripts without a password by simply typing:<br />
<br />
$ sudo pm-hibernate<br />
<br />
or <br />
<br />
$ sudo pm-suspend<br />
<br />
Also, add yourself to the ''power'' group so that way using things like applets to do suspend will work. If you do not do this, when you try to use suspend though things like the gnome shutdown applet to suspend/hibernate your computer will just play a very annoying loud triple beep and lock the screen.<br />
<br />
# gpasswd -a ''username'' power<br />
<br />
You should now be able to use gnome power management tools (and kpowersave?) to automatically suspend/hibernate when doing things like closing the laptop lid, running low on battery power etc...<br />
<br />
== Advanced Configuration ==<br />
The main configuration file is '''<tt>/usr/lib/pm-utils/defaults</tt>'''. You ''should not edit this file'', since after a package update it might be overwritten with the default settings. Put your config file into '''<tt>/etc/pm/config.d/</tt>''' instead.<br />
You can just put a simple text file with<br />
SUSPEND_MODULES="button uhci_hcd"<br />
named "modules" or "config" into <tt>/etc/pm/config.d</tt> and it will override the settings in the system wide configuration file.<br />
<br />
=== Available Variables for use in config files ===<br />
SUSPEND_MODULES="button" # the list of modules to be unloaded before suspend<br />
SLEEP_MODULE="tuxonice uswsusp kernel" # The default sleep/wake systems to try<br />
HIBERNATE_MODE="shutdown" # forces the system to shutdown rather than reboot<br />
<br />
=== Disabling a hook ===<br />
If a hook is run which you do not like or which you think is not useful or even harmful, we'd appreciate a bugreport for that.<br />
You can however easily disable hooks by just creating an empty file corresponding to the hook in <tt>/etc/pm/sleep.d/</tt>. Say you want to disable the hook <tt>/usr/lib/pm-utils/sleep.d/45pcmcia</tt>, you can do this easily by calling<br />
# touch /etc/pm/sleep.d/45pcmcia<br />
Do not set the executable bit on that dummy-hook.<br />
<br />
=== Creating your own hooks ===<br />
If you want to do something specific to your setup during suspend / hibernate, then you can easily put your own hook into <tt>/etc/pm/sleep.d</tt>. The hooks in this directory will be called in alphabetic order during suspend (that's the reason their names all start with 2 digits, to make the ordering explicit) and in the reverse order during resume.<br />
<br />
I'm showing a pretty useless demonstration hook here, that will just put some informative lines into your logfile:<br />
<br />
#!/bin/bash<br />
case $1 in<br />
hibernate)<br />
echo "Hey guy, we are going to suspend to disk!"<br />
;;<br />
suspend)<br />
echo "Oh, this time we're doing a suspend to RAM. Cool!"<br />
;;<br />
thaw)<br />
echo "oh, suspend to disk is over, we are resuming..."<br />
;;<br />
resume)<br />
echo "hey, the suspend to RAM seems to be over..."<br />
;;<br />
*) echo "somebody is calling me totally wrong."<br />
;;<br />
esac<br />
<br />
Put this into /etc/pm/sleep.d/66dummy, do a <tt>chmod +x /etc/pm/sleep.d/66dummy</tt> and it will spew some useless lines during suspend / resume.<br />
<br />
'''''Warning:''' All the hooks run as user root. This means that you need to be careful when creating temporary files, check that the PATH variable is set correctly etc. to avoid security problems.''<br />
<br />
== How it Works ==<br />
The concept is quite easy: the main script (<tt>pm-action</tt>, called via symlinks as either <tt>pm-suspend</tt>, <tt>pm-hibernate</tt> or <tt>pm-suspend-hybrid</tt>) executes so-called "hooks", executable scripts, in the alphabetical sorted order with the parameter <tt>suspend</tt> (suspend to RAM) or <tt>hibernate</tt> (suspend to disk).<br />
Once all hooks are done, it puts the machine to sleep. After the machine has woken up again, all those hooks are executed in reverse order with the parameter <tt>resume</tt> (resume from RAM) or <tt>thaw</tt> (resume from disk).<br />
The hooks do various stuff, for example preparing the bootloader, stopping the bluetooth subsystem or unloading of critical modules.<br />
<br />
Both pm-suspend and pm-hibernate are usually called from HAL, initiated by desktop applets as gnome-power-manager or kpowersave.<br />
<br />
{{Box Note|<tt>suspend-hybrid</tt> is a placeholder right now, it is not completely implemented.}}<br />
<br />
There is also the possibility to set the machine into high-power and low-power mode, the command <tt>pm-powersave</tt> is used with an additional parameter of <tt>true</tt> or <tt>false</tt>. It works basically the same as the suspend framework.<br />
<br />
The hooks for suspend are placed in<br />
* <tt>/usr/lib/pm-utils/sleep.d</tt> (distribution / package provided hooks)<br />
* <tt>/etc/pm/sleep.d</tt> (hooks added by the system administrator)<br />
<br />
The hooks for the power state are placed in <br />
* <tt>/usr/lib/pm-utils/power.d</tt> (distribution / package provided hooks)<br />
* <tt>/etc/pm/power.d</tt> (hooks added by the system administrator)<br />
<br />
Hooks in <tt>/etc/pm/</tt> take precedence over those in <tt>/usr/lib/pm-utils/</tt>, so the system administrator can override the defaults provided by the distribution.<br />
<br />
== Troubleshooting ==<br />
If suspend or hibernate did not work correctly, you will probably find some information in the logfile '''<tt>/var/log/pm-suspend.log</tt>''', for example which hooks were run and what the output of them was.<br />
<br />
=== Resume Hook ===<br />
<br />
It has been suggested that some systems require the <tt>resume</tt> hook be added to the initrd image, otherwise the kernel will '''not''' resume. To do so, edit <tt>/etc/mkinitcpio.conf</tt> as root and add <tt>resume</tt> to the HOOKS array:<br />
HOOKS="base udev autodetect ide scsi sata '''''resume''''' filesystems "<br />
<br />
Note that this is an example, and your HOOKS array may look different.<br />
<br />
<tt>resume</tt> must be placed ''after'' 'ide', 'scsi' and/or 'sata' but before 'filesystems'. Of course there has to be an appropriate 'resume' file in /lib/initcpio/hooks, it should already be there, as it is part of the package 'mkinitcpio'.<br />
<br />
Finally, you must rebuild the initrd image for these changes to take effect:<br />
<br />
# mkinitcpio -p kernel26<br />
<br />
{{Box Note|If you use a custom kernel then you might have to change the value of the '-p' option.}}<br />
<br />
== Tips and Tricks / FAQ ==<br />
=== Triggering suspend manually ===<br />
If you want to trigger suspend manually for debugging, without using HAL and other frameworks, call '''<tt>pm-suspend</tt>''' or '''<tt>pm-hibernate</tt>''' as root.<br />
=== Automatically deactivate kwin compositing before suspend===<br />
<br />
at the moment pm-suspend fails to resume with garbled screen when you resume from suspend with active AIGLX clients, such as kwin compositing (only ati-catalyst?).<br />
To automatically deactivate kwin compositing add a new hook under /etc/pm/sleep.d/00togglecompositing with this content:<br />
<br />
#!/bin/bash<br />
USER=`finger|grep '*:0'|grep -o '^\w*'`<br />
DBUS_SESSION_BUS_ADDRESS=`grep -o 'DBUS_SESSION_BUS_ADDRESS=.*' /home/$USER/.dbus/session-bus/*|sed s/DBUS_SESSION_BUS_ADDRESS=//`<br />
case $1 in<br />
hibernate)<br />
;;<br />
suspend)<br />
if `sudo -u $USER -i DBUS_SESSION_BUS_ADDRESS=$DBUS_SESSION_BUS_ADDRESS qdbus org.kde.kwin /KWin compositingActive`;<br />
then<br />
sudo -u $USER -i DBUS_SESSION_BUS_ADDRESS=$DBUS_SESSION_BUS_ADDRESS qdbus org.kde.kwin /KWin toggleCompositing;<br />
sleep 1<br />
fi<br />
;;<br />
thaw)<br />
;;<br />
resume)<br />
sudo -u $USER -i DBUS_SESSION_BUS_ADDRESS=$DBUS_SESSION_BUS_ADDRESS qdbus org.kde.kwin /KWin toggleCompositing;<br />
;;<br />
*) echo "somebody is calling me totally wrong."<br />
;;<br />
esac<br />
<br />
I don't know if it's very secure or if it can be done simpler. Feel free to add better versions.<br />
<br />
If you are having trouble getting the above script to work, you can try my version. This version removes the use of finger, and fixes the DBUS_SESSION_BUS_ADDRESS resolution which did not work for me (though my solution is admittedly quite dirty). Simply replace the first three lines with:<br />
<br />
#!/bin/bash<br />
USER=`who | grep ':0' | grep -o '^\w*' | head -n1`<br />
. /home/$USER/.dbus/session-bus/*<br />
<br />
=== Using another sleep backend (like uswsusp) ===<br />
Create a file with a SLEEP_MODULE variable, like this:<br />
$ cat /etc/pm/config.d/module <br />
SLEEP_MODULE=uswsusp<br />
I don't know but you may have to <code>chmod +x</code> it. To list available modules, use:<br />
$ pacman -Ql pm-utils | grep module.d<br />
<br />
=== Having the hd power management level automatically set again on resume ===<br />
Do it like this:<br />
$ cat /etc/pm/sleep.d/50-hdparm_pm <br />
#!/bin/dash<br />
<br />
if [ -n "$1" ] && ([ "$1" = "resume" ] || [ "$1" = "thaw" ]); then<br />
hdparm -B 254 /dev/sda > /dev/null<br />
fi<br />
<br />
=== Restarting the mouse ===<br />
On some laptops the mouse will hang after an otherwise successful suspend. One way to remedy this is to force a reinit of the PS/2 driver (here <tt>i8042</tt>) through a hook in <tt>/etc/pm/hooks</tt> (see [[#Creating_your_own_hooks|hooks]])<br />
<br />
#!/bin/sh <br />
echo -n "i8042" > /sys/bus/platform/drivers/i8042/unbind<br />
echo -n "i8042" > /sys/bus/platform/drivers/i8042/bind<br />
<br />
=== It seems to not do anything / where is the logfile ===<br />
If it seem to not do anything when called via the desktop applets, then try to call <tt>pm-suspend</tt> or <tt>pm-hibernate</tt> [[#Triggering_suspend_manually|manually from a root shell in a terminal]]. Maybe you'll already get some output that will point you to the problem.<br />
The suspend scripts also write a [[#Troubleshooting|logfile at '''<tt>/var/log/pm-suspend.log</tt>''']].<br />
<br />
=== Add sleep modes to Openbox menu ===<br />
Openbox users can add the new scripts as additional shutdown options within the Openbox menu by adding the items to a new or existing sub-menu in <tt>~/.config/openbox/menu.xml</tt>, for example:<br />
<menu id="64" label="Shutdown"><br />
<item label="Lock"> <action name="Execute"> <execute>xscreensaver-command -lock</execute> </action> </item><br />
<item label="Logout"> <action name="Exit"/> </item><br />
<item label="Reboot"> <action name="Execute"> <execute>sudo shutdown -r now</execute> </action> </item><br />
<item label="Poweroff"> <action name="Execute"> <execute>sudo shutdown -h now </execute> </action> </item><br />
'''''<item label="Hibernate"> <action name="Execute"> <execute>sudo pm-hibernate</execute> </action> </item>'''''<br />
'''''<item label="Suspend"> <action name="Execute"> <execute>sudo pm-suspend</execute> </action> </item>'''''<br />
</menu><br />
<br />
=== Blank screen issue ===<br />
Some users have reported having issues with their laptops not resuming after a suspend or hibernate. This is due to the autodetect HOOK. This can be disabled using the same method for adding the resume HOOK. Just remove autodetect from the list and follow the steps to build the new image. See [http://wiki.archlinux.org/index.php/Pm-utils#Resume_Hook Resume Hook] for more details on building the new image.<br />
<br />
=== Handling "sleep" and "power" buttons ===<br />
"Sleep" and "power" buttons are handled by acpid in /etc/acpi/handler.sh (see "button/power" and "power/sleep" entries). You may want to substitute the default actions with calls to pm-suspend and pm-hibernate.<br />
<br />
=== [[HAL]] will not recognize new devices on resume ===<br />
With the 2.6.30 kernel, HAL will on some systems bug on resume, not recognizing new USB devices. Adding the following bash script with a name like "02hal" to /etc/pm/sleep.d works around the problem by stopping HAL and starting it again after resuming.<br />
<br />
#!/bin/bash<br />
case $1 in<br />
hibernate)<br />
;;<br />
suspend)<br />
/etc/rc.d/hal stop<br />
;;<br />
thaw)<br />
;;<br />
resume)<br />
/etc/rc.d/hal start<br />
;;<br />
*)<br />
;;<br />
esac<br />
<br />
Remember to mark it executable with "chmod +x 02hal".<br />
<br />
== Other Resources ==<br />
* [https://wiki.ubuntu.com/UnderstandingSuspend Understanding Suspend] - Ubuntu article explaining how suspend-to-ram works<br />
*[[Cpufrequtils]] - CPU Frequency Scaling and CPU Power schemes<br/><br />
*[[SpeedStep]] - More information on CPU frequency scaling (some of which is obsolete)<br/><br />
*[[Acpid]] - daemon for delivering ACPI events.<br />
<br />
== Credits ==<br />
''This wiki entry was originally sourced from the [http://en.opensuse.org/Pm-utils OpenSUSE Wiki] (Licensed under GPL). A big thank you goes to the <tt>pm-utils</tt> developers and documenters for their time.''</div>Rent0nhttps://wiki.archlinux.org/index.php?title=Pm-utils&diff=101978Pm-utils2010-04-06T19:47:16Z<p>Rent0n: /* Hibernation (suspend2disk) */</p>
<hr />
<div>[[Category:Power management (English)]]<br />
[[Category:HOWTOs (English)]]<br />
{{i18n|pm-utils}} {{DISPLAYTITLE:pm-utils}}<br />
<br />
'''pm-utils''' is the new suspend and powerstate setting framework. It is designed to replace such scripts as those provided by the <tt>powersave</tt> package.<br />
<br />
It is usually used by HAL to execute the various hacks needed to work around bugs in drivers and subsystems that are not yet aware of suspend. It is easily extensible by putting custom hooks into a directory, which can either be done by the system administrator or those hooks can be part of a package, especially if this package needs special attention during a system suspend or power state transition.<br />
<br />
Used in conjunction with the [[cpufrequtils]] package, notebook (and desktop) owners are provided with a complete power management suite.<br />
<br />
== Installation ==<br />
<br />
The <tt>pm-utils</tt> package is now available from the [http://www.archlinux.org/packages/search/?q=pm-utils Extra] repository:<br />
# pacman -S pm-utils<br />
<br />
{{note|If you run into issues when resuming video, it might be necessary to also sync <tt>vbetool</tt> from [extra].}}<br />
<br />
== Basic Configuration ==<br />
=== Hibernation (suspend2disk) ===<br />
In order for suspend2disk (hibernate) to work, we need to edit ''/boot/grub/menu.lst'' as root and add '''resume=/path/to/swap/drive''' (e.g. /dev/sda2) to the kernel options, for example:<br />
# (0) Arch Linux<br />
title Arch Linux<br />
root (hd0,0)<br />
kernel /vmlinuz26 root=/dev/sda3 '''resume=/dev/sda2''' ro vga=0<br />
initrd /kernel26.img<br />
<br />
Raid swap example:<br />
# (0) Arch Linux<br />
title Arch Linux<br />
root (hd0,0)<br />
kernel /vmlinuz26 root=/dev/md2 resume=/dev/md0 ro md=0,/dev/sda2,/dev/sdb2 md=2,/dev/sda5,/dev/sdb5 vga=773<br />
initrd /kernel26.img<br />
<br />
It is also necessary to add the '''resume''' hook in the HOOKS section of the {{filename|/etc/mkinitcpio.conf}} file:<br />
<br />
HOOKS="base udev autodetect pata scsi sata filesystems keymap '''resume'''"<br />
<br />
<br />
When the machine is placed into hibernation, it will now move all data from RAM to the swap partition... you ''did'' make your swap partition large enough to hold your RAM data, right?<br />
<br />
Even if your swap partition is smaller than RAM, you still have a big chance in hibernating successfully. According to [http://www.mjmwired.net/kernel/Documentation/power/interface.txt kernel documentation], ''/sys/power/image_size controls the size of the image created by the suspend-to-disk mechanism'', which has a default value of 512M. ''The suspend-to-disk mechanism will do its best to ensure the image size will not exceed that number.'' You may either decrease it due to a small swap partition or increase it in purpose of possible hibernation speed up.<br />
[[File:Example.jpg]]<br />
<br />
=== Suspend/Hibernate as regular user ===<br />
<br />
Two methods are available to suspend without the need for a root password: using HAL, and giving the user permissions.<br />
<br />
==== HAL Method ====<br />
<br />
HAL can be invoked as regular user to suspend by:<br />
<br />
<pre>dbus-send --system --print-reply --dest=org.freedesktop.Hal \<br />
/org/freedesktop/Hal/devices/computer \<br />
org.freedesktop.Hal.Device.SystemPowerManagement.Suspend int32:0</pre><br />
<br />
and Hibernate by:<br />
<br />
<pre>dbus-send --system --print-reply --dest=org.freedesktop.Hal \<br />
/org/freedesktop/Hal/devices/computer \<br />
org.freedesktop.Hal.Device.SystemPowerManagement.Hibernate</pre><br />
<br />
==== User Permission Method ====<br />
<br />
Because the <tt>pm-utils</tt> scripts must be run as root, you may want to make the scripts accessible to normal users by running sudo without the root password. To do so, edit the {{Filename|/etc/sudoers}} file with {{Codeline|visudo}}, for example:<br />
<br />
# visudo<br />
<br />
add the following lines, replacing ''username'' with your own:<br />
<br />
''username'' ALL = NOPASSWD: /usr/sbin/pm-hibernate<br />
''username'' ALL = NOPASSWD: /usr/sbin/pm-suspend<br />
<br />
save and exit visudo<br />
<br />
Or you can enable it for a group, using the following lines, of course replacing ''group'':<br />
<br />
''%group'' ALL = NOPASSWD: /usr/sbin/pm-hibernate<br />
''%group'' ALL = NOPASSWD: /usr/sbin/pm-suspend<br />
<br />
Note: These must come after any user privilege specifications, e.g., "username ALL=(ALL) ALL", or they won't work.<br />
<br />
You can now run the scripts without a password by simply typing:<br />
<br />
$ sudo pm-hibernate<br />
<br />
or <br />
<br />
$ sudo pm-suspend<br />
<br />
Also, add yourself to the ''power'' group so that way using things like applets to do suspend will work. If you do not do this, when you try to use suspend though things like the gnome shutdown applet to suspend/hibernate your computer will just play a very annoying loud triple beep and lock the screen.<br />
<br />
# gpasswd -a ''username'' power<br />
<br />
You should now be able to use gnome power management tools (and kpowersave?) to automatically suspend/hibernate when doing things like closing the laptop lid, running low on battery power etc...<br />
<br />
== Advanced Configuration ==<br />
The main configuration file is '''<tt>/usr/lib/pm-utils/defaults</tt>'''. You ''should not edit this file'', since after a package update it might be overwritten with the default settings. Put your config file into '''<tt>/etc/pm/config.d/</tt>''' instead.<br />
You can just put a simple text file with<br />
SUSPEND_MODULES="button uhci_hcd"<br />
named "modules" or "config" into <tt>/etc/pm/config.d</tt> and it will override the settings in the system wide configuration file.<br />
<br />
=== Available Variables for use in config files ===<br />
SUSPEND_MODULES="button" # the list of modules to be unloaded before suspend<br />
SLEEP_MODULE="tuxonice uswsusp kernel" # The default sleep/wake systems to try<br />
HIBERNATE_MODE="shutdown" # forces the system to shutdown rather than reboot<br />
<br />
=== Disabling a hook ===<br />
If a hook is run which you do not like or which you think is not useful or even harmful, we'd appreciate a bugreport for that.<br />
You can however easily disable hooks by just creating an empty file corresponding to the hook in <tt>/etc/pm/sleep.d/</tt>. Say you want to disable the hook <tt>/usr/lib/pm-utils/sleep.d/45pcmcia</tt>, you can do this easily by calling<br />
# touch /etc/pm/sleep.d/45pcmcia<br />
Do not set the executable bit on that dummy-hook.<br />
<br />
=== Creating your own hooks ===<br />
If you want to do something specific to your setup during suspend / hibernate, then you can easily put your own hook into <tt>/etc/pm/sleep.d</tt>. The hooks in this directory will be called in alphabetic order during suspend (that's the reason their names all start with 2 digits, to make the ordering explicit) and in the reverse order during resume.<br />
<br />
I'm showing a pretty useless demonstration hook here, that will just put some informative lines into your logfile:<br />
<br />
#!/bin/bash<br />
case $1 in<br />
hibernate)<br />
echo "Hey guy, we are going to suspend to disk!"<br />
;;<br />
suspend)<br />
echo "Oh, this time we're doing a suspend to RAM. Cool!"<br />
;;<br />
thaw)<br />
echo "oh, suspend to disk is over, we are resuming..."<br />
;;<br />
resume)<br />
echo "hey, the suspend to RAM seems to be over..."<br />
;;<br />
*) echo "somebody is calling me totally wrong."<br />
;;<br />
esac<br />
<br />
Put this into /etc/pm/sleep.d/66dummy, do a <tt>chmod +x /etc/pm/sleep.d/66dummy</tt> and it will spew some useless lines during suspend / resume.<br />
<br />
'''''Warning:''' All the hooks run as user root. This means that you need to be careful when creating temporary files, check that the PATH variable is set correctly etc. to avoid security problems.''<br />
<br />
== How it Works ==<br />
The concept is quite easy: the main script (<tt>pm-action</tt>, called via symlinks as either <tt>pm-suspend</tt>, <tt>pm-hibernate</tt> or <tt>pm-suspend-hybrid</tt>) executes so-called "hooks", executable scripts, in the alphabetical sorted order with the parameter <tt>suspend</tt> (suspend to RAM) or <tt>hibernate</tt> (suspend to disk).<br />
Once all hooks are done, it puts the machine to sleep. After the machine has woken up again, all those hooks are executed in reverse order with the parameter <tt>resume</tt> (resume from RAM) or <tt>thaw</tt> (resume from disk).<br />
The hooks do various stuff, for example preparing the bootloader, stopping the bluetooth subsystem or unloading of critical modules.<br />
<br />
Both pm-suspend and pm-hibernate are usually called from HAL, initiated by desktop applets as gnome-power-manager or kpowersave.<br />
<br />
{{Box Note|<tt>suspend-hybrid</tt> is a placeholder right now, it is not completely implemented.}}<br />
<br />
There is also the possibility to set the machine into high-power and low-power mode, the command <tt>pm-powersave</tt> is used with an additional parameter of <tt>true</tt> or <tt>false</tt>. It works basically the same as the suspend framework.<br />
<br />
The hooks for suspend are placed in<br />
* <tt>/usr/lib/pm-utils/sleep.d</tt> (distribution / package provided hooks)<br />
* <tt>/etc/pm/sleep.d</tt> (hooks added by the system administrator)<br />
<br />
The hooks for the power state are placed in <br />
* <tt>/usr/lib/pm-utils/power.d</tt> (distribution / package provided hooks)<br />
* <tt>/etc/pm/power.d</tt> (hooks added by the system administrator)<br />
<br />
Hooks in <tt>/etc/pm/</tt> take precedence over those in <tt>/usr/lib/pm-utils/</tt>, so the system administrator can override the defaults provided by the distribution.<br />
<br />
== Troubleshooting ==<br />
If suspend or hibernate did not work correctly, you will probably find some information in the logfile '''<tt>/var/log/pm-suspend.log</tt>''', for example which hooks were run and what the output of them was.<br />
<br />
=== Resume Hook ===<br />
<br />
It has been suggested that some systems require the <tt>resume</tt> hook be added to the initrd image, otherwise the kernel will '''not''' resume. To do so, edit <tt>/etc/mkinitcpio.conf</tt> as root and add <tt>resume</tt> to the HOOKS array:<br />
HOOKS="base udev autodetect ide scsi sata '''''resume''''' filesystems "<br />
<br />
Note that this is an example, and your HOOKS array may look different.<br />
<br />
<tt>resume</tt> must be placed ''after'' 'ide', 'scsi' and/or 'sata' but before 'filesystems'. Of course there has to be an appropriate 'resume' file in /lib/initcpio/hooks, it should already be there, as it is part of the package 'mkinitcpio'.<br />
<br />
Finally, you must rebuild the initrd image for these changes to take effect:<br />
<br />
# mkinitcpio -p kernel26<br />
<br />
{{Box Note|If you use a custom kernel then you might have to change the value of the '-p' option.}}<br />
<br />
== Tips and Tricks / FAQ ==<br />
=== Triggering suspend manually ===<br />
If you want to trigger suspend manually for debugging, without using HAL and other frameworks, call '''<tt>pm-suspend</tt>''' or '''<tt>pm-hibernate</tt>''' as root.<br />
=== Automatically deactivate kwin compositing before suspend===<br />
<br />
at the moment pm-suspend fails to resume with garbled screen when you resume from suspend with active AIGLX clients, such as kwin compositing (only ati-catalyst?).<br />
To automatically deactivate kwin compositing add a new hook under /etc/pm/sleep.d/00togglecompositing with this content:<br />
<br />
#!/bin/bash<br />
USER=`finger|grep '*:0'|grep -o '^\w*'`<br />
DBUS_SESSION_BUS_ADDRESS=`grep -o 'DBUS_SESSION_BUS_ADDRESS=.*' /home/$USER/.dbus/session-bus/*|sed s/DBUS_SESSION_BUS_ADDRESS=//`<br />
case $1 in<br />
hibernate)<br />
;;<br />
suspend)<br />
if `sudo -u $USER -i DBUS_SESSION_BUS_ADDRESS=$DBUS_SESSION_BUS_ADDRESS qdbus org.kde.kwin /KWin compositingActive`;<br />
then<br />
sudo -u $USER -i DBUS_SESSION_BUS_ADDRESS=$DBUS_SESSION_BUS_ADDRESS qdbus org.kde.kwin /KWin toggleCompositing;<br />
sleep 1<br />
fi<br />
;;<br />
thaw)<br />
;;<br />
resume)<br />
sudo -u $USER -i DBUS_SESSION_BUS_ADDRESS=$DBUS_SESSION_BUS_ADDRESS qdbus org.kde.kwin /KWin toggleCompositing;<br />
;;<br />
*) echo "somebody is calling me totally wrong."<br />
;;<br />
esac<br />
<br />
I don't know if it's very secure or if it can be done simpler. Feel free to add better versions.<br />
<br />
If you are having trouble getting the above script to work, you can try my version. This version removes the use of finger, and fixes the DBUS_SESSION_BUS_ADDRESS resolution which did not work for me (though my solution is admittedly quite dirty). Simply replace the first three lines with:<br />
<br />
#!/bin/bash<br />
USER=`who | grep ':0' | grep -o '^\w*' | head -n1`<br />
. /home/$USER/.dbus/session-bus/*<br />
<br />
=== Using another sleep backend (like uswsusp) ===<br />
Create a file with a SLEEP_MODULE variable, like this:<br />
$ cat /etc/pm/config.d/module <br />
SLEEP_MODULE=uswsusp<br />
I don't know but you may have to <code>chmod +x</code> it. To list available modules, use:<br />
$ pacman -Ql pm-utils | grep module.d<br />
<br />
=== Having the hd power management level automatically set again on resume ===<br />
Do it like this:<br />
$ cat /etc/pm/sleep.d/50-hdparm_pm <br />
#!/bin/dash<br />
<br />
if [ -n "$1" ] && ([ "$1" = "resume" ] || [ "$1" = "thaw" ]); then<br />
hdparm -B 254 /dev/sda > /dev/null<br />
fi<br />
<br />
=== Restarting the mouse ===<br />
On some laptops the mouse will hang after an otherwise successful suspend. One way to remedy this is to force a reinit of the PS/2 driver (here <tt>i8042</tt>) through a hook in <tt>/etc/pm/hooks</tt> (see [[#Creating_your_own_hooks|hooks]])<br />
<br />
#!/bin/sh <br />
echo -n "i8042" > /sys/bus/platform/drivers/i8042/unbind<br />
echo -n "i8042" > /sys/bus/platform/drivers/i8042/bind<br />
<br />
=== It seems to not do anything / where is the logfile ===<br />
If it seem to not do anything when called via the desktop applets, then try to call <tt>pm-suspend</tt> or <tt>pm-hibernate</tt> [[#Triggering_suspend_manually|manually from a root shell in a terminal]]. Maybe you'll already get some output that will point you to the problem.<br />
The suspend scripts also write a [[#Troubleshooting|logfile at '''<tt>/var/log/pm-suspend.log</tt>''']].<br />
<br />
=== Add sleep modes to Openbox menu ===<br />
Openbox users can add the new scripts as additional shutdown options within the Openbox menu by adding the items to a new or existing sub-menu in <tt>~/.config/openbox/menu.xml</tt>, for example:<br />
<menu id="64" label="Shutdown"><br />
<item label="Lock"> <action name="Execute"> <execute>xscreensaver-command -lock</execute> </action> </item><br />
<item label="Logout"> <action name="Exit"/> </item><br />
<item label="Reboot"> <action name="Execute"> <execute>sudo shutdown -r now</execute> </action> </item><br />
<item label="Poweroff"> <action name="Execute"> <execute>sudo shutdown -h now </execute> </action> </item><br />
'''''<item label="Hibernate"> <action name="Execute"> <execute>sudo pm-hibernate</execute> </action> </item>'''''<br />
'''''<item label="Suspend"> <action name="Execute"> <execute>sudo pm-suspend</execute> </action> </item>'''''<br />
</menu><br />
<br />
=== Blank screen issue ===<br />
Some users have reported having issues with their laptops not resuming after a suspend or hibernate. This is due to the autodetect HOOK. This can be disabled using the same method for adding the resume HOOK. Just remove autodetect from the list and follow the steps to build the new image. See [http://wiki.archlinux.org/index.php/Pm-utils#Resume_Hook Resume Hook] for more details on building the new image.<br />
<br />
=== Handling "sleep" and "power" buttons ===<br />
"Sleep" and "power" buttons are handled by acpid in /etc/acpi/handler.sh (see "button/power" and "power/sleep" entries). You may want to substitute the default actions with calls to pm-suspend and pm-hibernate.<br />
<br />
=== [[HAL]] will not recognize new devices on resume ===<br />
With the 2.6.30 kernel, HAL will on some systems bug on resume, not recognizing new USB devices. Adding the following bash script with a name like "02hal" to /etc/pm/sleep.d works around the problem by stopping HAL and starting it again after resuming.<br />
<br />
#!/bin/bash<br />
case $1 in<br />
hibernate)<br />
;;<br />
suspend)<br />
/etc/rc.d/hal stop<br />
;;<br />
thaw)<br />
;;<br />
resume)<br />
/etc/rc.d/hal start<br />
;;<br />
*)<br />
;;<br />
esac<br />
<br />
Remember to mark it executable with "chmod +x 02hal".<br />
<br />
== Other Resources ==<br />
* [https://wiki.ubuntu.com/UnderstandingSuspend Understanding Suspend] - Ubuntu article explaining how suspend-to-ram works<br />
*[[Cpufrequtils]] - CPU Frequency Scaling and CPU Power schemes<br/><br />
*[[SpeedStep]] - More information on CPU frequency scaling (some of which is obsolete)<br/><br />
*[[Acpid]] - daemon for delivering ACPI events.<br />
<br />
== Credits ==<br />
''This wiki entry was originally sourced from the [http://en.opensuse.org/Pm-utils OpenSUSE Wiki] (Licensed under GPL). A big thank you goes to the <tt>pm-utils</tt> developers and documenters for their time.''</div>Rent0nhttps://wiki.archlinux.org/index.php?title=Samba&diff=99377Samba2010-03-08T16:28:06Z<p>Rent0n: </p>
<hr />
<div>[[Category:Networking (English)]]<br />
[[Category:HOWTOs (English)]]<br />
{{i18n|Samba}}<br />
{{Article summary start|Summary}}<br />
{{Article summary text|Installing, configuring and troubleshooting Samba}}<br />
{{Article summary heading|Related}}<br />
{{Article summary wiki|NFS}}<br />
{{Article summary wiki|Samba Domain Controller}}<br />
{{Article summary end}}<br />
<br />
'''Samba''' is a re-implementation of the SMB/CIFS networking protocol, it facilitates file and printer sharing among Linux and Windows systems as an alternative to [[NFS]]. Samba is easily configured and operation is very straight-forward.<br />
<br />
==Installation==<br />
Installing only the client program is sufficient for systems that are not meant to share files, only access them:<br />
# pacman -S smbclient<br />
<br />
In order to make shares available to clients, install the Samba ''server'' package:<br />
# pacman -S samba<br />
<br />
A daemon is installed with the server and it must be started for Samba to begin working. Samba typically uses [[FAM]] to monitor the file-system for changes, yet [[Gamin]] has almost completely replaced FAM as of recent, mainly because the former is poorly maintained and generally an inferior, unpopular choice.<br />
<br />
To install Gamin:<br />
# pacman -S gamin<br />
<br />
==Configuration==<br />
The {{filename|/etc/samba/smb.conf}} file must be created before starting the daemons. Once that is setup, users may opt for using an advanced configuration interface like SWAT.<br />
<br />
===smb.conf===<br />
As root, copy the default Samba configuration file to {{Filename|/etc/samba/smb.conf}}:<br />
# cp /etc/samba/smb.conf.default /etc/samba/smb.conf<br />
<br />
Open {{Filename|smb.conf}} and edit it to suit your needs. The default file creates a share for each user's home directory. It also creates a share for printers.<br />
<br />
===Starting and automating the daemons===<br />
If using FAM, start the {{codeline|fam}} [[daemon]] before {{codeline|samba}}. Gamin does not need a daemon since it automatically starts when needed.<br />
<br />
Without rebooting, FAM and Samba can be started with the commands:<br />
# /etc/rc.d/fam start<br />
# /etc/rc.d/samba start<br />
<br />
Add {{codeline|fam}} and {{codeline|samba}} to the DAEMONS line in {{Filename|[[rc.conf]]}} to automatically start the daemons at boot.<br />
<br />
===SWAT: Samba web administration tool===<br />
[http://samba.xsec.it/samba/docs/man/Samba-HOWTO-Collection/SWAT.html SWAT] is a facility that is part of the Samba suite. The main executable is called swat and is invoked by the eXtended InterNET Daemon, [[Wikipedia:xinetd|xinetd]]. <br />
<br />
There are many and varied opinions regarding the usefulness of SWAT. No matter how hard one tries to produce the perfect configuration tool, it remains an object of personal taste. SWAT is a tool that allows Web-based configuration of Samba. It has a wizard that may help to get Samba configured quickly, it has context-sensitive help on each {{Filename|smb.conf}} parameter, it provides for monitoring of current state of connection information, and it allows network-wide MS Windows network password management.[http://samba.xsec.it/samba/docs/man/Samba-HOWTO-Collection/SWAT.html]<br />
<br />
{{Warning|Before using SWAT, please be warned SWAT will completely replace your {{Filename|smb.conf}} with a fully optimized file that has been stripped of all comments you might have placed there, and only non-default settings will be written to the file.}}<br />
<br />
To use SWAT, first install xinetd:<br />
# pacman -S xinetd<br />
<br />
Edit {{Filename|/etc/xinetd.d/swat}} using your favorite text editor. To enable SWAT, change the {{Codeline|1=disable = yes}} line to {{Codeline|1=disable = no}}.<br />
<br />
service swat<br />
{<br />
port = 901<br />
socket_type = stream<br />
wait = no<br />
user = root<br />
server = /usr/sbin/swat<br />
log_on_success += HOST DURATION<br />
log_on_failure += HOST<br />
disable = no<br />
}<br />
<br />
If xinetd was compiled with tcpwrapper flag enabled, edit {{Filename|/etc/hosts.allow}} by adding following line:<br />
<br />
swat:127.0.0.1<br />
<br />
Then start xinetd daemon:<br />
<br />
# /etc/rc.d/xinetd start<br />
<br />
The web interface can be accessed on port 901 by default,<br />
http://localhost:901/<br />
<br />
{{Note|If you have problems with these directions, you can use the more all-encompasing [[Webmin]] tool instead, and easily load the SWAT module there.}}<br />
<br />
===Adding users===<br />
To log into a Samba share you'll need to add a user:<br />
# smbpasswd -a <user><br />
<br />
The user must already have a account on the server. If the user does not exist you will receive the error:<br />
Failed to modify password entry for user "<user>"<br />
<br />
You can add a new user to the Linux host with [[User Management#adduser|adduser]]. This article does not cover adding users to Windows systems.<br />
<br />
==Accessing Samba shares==<br />
KDE and Gnome have the ability to browse Samba shares. You therefore do not need any additional packages if using either of these DEs. If however you plan to use the share solely from a shell, you will need an additional package.<br />
<br />
===Accessing a Samba share from Gnome or KDE===<br />
From a Nautilus/Dolphin/Konqueror window, hit {{Keypress|Ctrl}}+{{Keypress|L}} or go to the "Go" menu and select "Location..." -- both actions will allow you to type in the "Go to:" blank. Enter:<br />
smb://servername/share<br />
<br />
{{Note|If you do not have your servername in your {{Filename|/etc/hosts}}, you must use the IP Address of the server in place of the servername.}}<br />
<br />
For a GUI in the KDE System Settings you have to install the kdenetwork-filesharing package from [extra].<br />
<br />
===Accessing a Samba share from the shell===<br />
Shares may be accessed by using an automatic mounter or by using a [[#Manual share mounting|manual method]].<br />
<br />
====Automatic share mounting====<br />
There are several alternatives for easy share browsing.<br />
<br />
=====smbnetfs=====<br />
1. Install {{Package Official|smbnetfs}}:<br />
# pacman -S smbnetfs<br />
<br />
2. Add the following line to {{Filename|/etc/fuse.conf}}:<br />
user_allow_other<br />
<br />
3. Load the {{Codeline|fuse}} kernel module:<br />
# modprobe fuse<br />
<br />
4. Start the {{Codeline|smbnetfs}} [[daemon]]:<br />
# /etc/rc.d/smbnetfs start<br />
<br />
All shares in the network are now automatically mounted under {{Filename|/mnt/smbnet}}.<br />
<br />
Add the following to {{Filename|/etc/rc.conf}} to access the shares at boot:<br />
MODULES=(... '''fuse''' ...)<br />
DAEMONS=(... '''smbnetfs''' ...)<br />
<br />
If a username and a password is required to access some of the shared folders, you have to edit {{filename|/etc/smbnetfs/.smb/smbnetfs.conf}} by uncommenting the line starting with "auth" and editing it to your needs:<br />
<br />
auth "WORKGROUP/username" "password"<br />
<br />
Then, it may be necessary to change the permissions of {{filename|/etc/smbnetfs/.smb/smbnetfs.conf}} for smbnetfs to work correctly:<br />
<br />
# chmod 600 /etc/smbnetfs/.smb/smbnetfs.conf<br />
<br />
=====fusesmb=====<br />
{{Note|1=Because {{Codeline|smbclient 3.2.X}} is malfunctioning with {{Codeline|fusesmb}}, revert to using older versions if necessary. See the [http://bbs.archlinux.org/viewtopic.php?id=58434 relevant forum topic] for details.}}<br />
<br />
1. Install the {{Package AUR|fusesmb}} package from the [[AUR]] using [[yaourt]] or other [[AUR Helpers]]:<br />
$ yaourt -S fusesmb<br />
<br />
2. Create a mount point:<br />
# mkdir /mnt/fusesmb<br />
<br />
3. Load {{Codeline|fuse}} module:<br />
# modprobe fuse<br />
<br />
4. Mount the shares:<br />
# fusesmb -o allow_other /mnt/fusesmb<br />
<br />
For mounting shares at boot, add the command above to {{Filename|/etc/rc.local}} and add {{Codeline|fuse}} module to {{Filename|/etc/rc.conf}}:<br />
MODULES=(... '''fuse''' ...)<br />
<br />
=====Autofs=====<br />
See [[Autofs]] for information on the kernel-based automounter for Linux.<br />
<br />
====Manual share mounting====<br />
1. Use [[smbclient]] to browse shares from the shell. To list any public shares on a server:<br />
$ smbclient -L <hostname> -U%<br />
<br />
2. Create the mount point for the share:<br />
# mkdir /mnt/MOUNTPOINT<br />
<br />
3. Mount the share using {{Codeline|mount.cifs}}. Keep in mind that not all options may be needed nor desirable, such as {{Codeline|password}}:<br />
# mount -t cifs //''SERVER''/''SHARENAME'' ''MOUNTPOINT'' -o user=''USERNAME'',password=''PASSWORD'',workgroup=''WORKGROUP'',ip=''SERVERIP''<br />
<br />
;{{Codeline|SERVER}}: The Windows system's name<br />
;{{Codeline|SHARENAME}}: The shared directory<br />
;{{Codeline|MOUNTPOINT}}: The local directory where the share will be mounted to<br />
;{{Codeline|-o [options]}}: Specifies options for {{Codeline|mount.cifs}}<br />
:;{{Codeline|user}}: Username used to mount the share<br />
:;{{Codeline|password}}: The shared directory's password<br />
:;{{Codeline|workgroup}}: Used to specify the workgroup<br />
:;{{Codeline|ip}}: The IP address of the server -- if the system is unable to find the Windows computer by name (DNS, WINS, hosts entry, etc.)<br />
<br />
{{Note|Abstain from using trailing directory ('''/''') characters. Using {{Filename|//SERVER/SHARENAME'''/'''}} will not work.}}<br />
<br />
4. To unmount the share, use:<br />
# umount /mnt/MOUNTPOINT<br />
<br />
=====Adding the share to {{Filename|fstab}}=====<br />
Add the following to {{Filename|/etc/[[fstab]]}} for easy mounting:<br />
//SERVER/SHARENAME /mnt/MOUNTPOINT cifs noauto,noatime,username=USER,password=PASSWORD,workgroup=WORKGROUP 0 0<br />
<br />
The {{Codeline|noauto}} option disables mounting it automatically at boot and {{Codeline|noatime}} increases performance by skipping inode access times.<br />
<br />
After adding the previous line, the syntax to mount files becomes simpler:<br />
# mount /mnt/MOUNTPOINT<br />
<br />
If adding a Samba share to {{Filename|fstab}}, the {{codeline|netfs}} daemon should also be added to {{Filename|[[rc.conf]]}}, somewhere after the [[network]] daemon. The {{codeline|netfs}} daemon will mount network partitions at boot and, more importantly, unmount network partitions at shutdown. Even if using the {{codeline|noauto}} option in {{Filename|fstab}}, the {{codeline|netfs}} daemon should be used. Without it any network share that is mounted when shutting down will cause the {{codeline|network}} daemon to wait for the connection to time out, considerably extending poweroff time.<br />
<br />
=====Allowing users to mount=====<br />
Before enabling access to the mount commands, {{Filename|fstab}} needs to be modified. Add the {{Codeline|users}} options to the entry in {{Filename|/etc/fstab}}:<br />
//SERVER/SHARENAME /path/to/SHAREMOUNT cifs '''users''',noauto,noatime,username=USER,password=PASSWORD,workgroup=WORKGROUP 0 0<br />
<br />
{{Note|The option is {{codeline|user'''s'''}} (plural). For other filesystem types handled by mount, this option is usually ''user''; sans the "'''s'''".}}<br />
<br />
This will allow users to mount it aslong as the mount point resides in a directory ''controllable'' by the user; i.e. the user's home. For users to be allowed to mount and unmount the Samba shares with mount points that they do not own, use [[#smbnetfs]], or grant privileges using [[sudo]].<br />
<br />
== Tips and tricks ==<br />
<br />
=== Share files for your LAN without user and password ===<br />
<br />
Edit {{Filename|/etc/samba/smb.conf}} and change the following line:<br />
<br />
security = user<br />
<br />
to<br />
<br />
security = share<br />
<br />
If you want to restrict the shares data to a specific interface replace:<br />
<br />
; interfaces = 192.168.12.2/24 192.168.13.2/24<br />
<br />
with:<br />
<br />
interfaces = lo eth0<br />
bind interfaces only = true<br />
<br />
(changing eth0 to the local network you want share with.)<br />
<br />
If you want to edit the account that access the shares, edit the following line:<br />
<br />
; guest account = nobody<br />
<br />
The last step is to create share directory (for write access make writable = yes):<br />
<br />
[Public Share]<br />
path = /path/to/public/share<br />
available = yes<br />
browsable = yes<br />
public = yes<br />
writable = no<br />
<br />
=== Sample configuration file ===<br />
<br />
The configuration that worked for one user:<br />
[global]<br />
workgroup = WORKGROUP<br />
server string = Samba Server<br />
netbios name = PC_NAME<br />
security = share<br />
; the line below is important! If you have permission issues make<br />
; sure the user here is the same as the user of the folder you<br />
; want to share<br />
guest account = mark<br />
username map = /etc/samba/smbusers<br />
name resolve order = hosts wins bcast<br />
wins support = no<br /><br />
[public]<br />
comment = Public Share<br />
path = /path/to/public/share<br />
available = yes<br />
browsable = yes<br />
public = yes<br />
writable = no<br />
<br />
=== Adding network shares using KDE4 GUI ===<br />
How to configure the folder sharing in KDE4. Simple file sharing limits user shared folders to their home directory and read-only access. Advanced file sharing gives full semantics of Samba with no limits to shared folders but requires su or sudo root permissions.<br />
* Read only, simple file sharing: [[Samba/Simple file sharing with KDE4]]<br />
* Full capability file sharing: [[Samba/Advanced file sharing with KDE4]]<br />
<br />
=== Discovering network shares ===<br />
<br />
If nothing is known about other systems on the local network, and automated tools such as [[#smbnetfs]] are not available, the following methods allow one to manually probe for Samba shares.<br />
<br />
1. First, install {{Package Official|nmap}} and {{Package Official|smbclient}} using [[pacman]]:<br />
# pacman -S nmap smbclient<br />
<br />
2. {{Codeline|nmap}} checks which ports are open:<br />
# nmap -sT 192.168.1.*<br />
<br />
In this case, a scan on the 192.168.1.* IP address range has been performed, resulting in:<br />
{{Command<br />
|name=nmap -sT 192.168.1.*<br />
|output=Starting nmap 3.78 ( http://www.insecure.org/nmap/ ) at 2005-02-15 11:45 PHT<br />
Interesting ports on 192.168.1.1:<br />
(The 1661 ports scanned but not shown below are in state: closed)<br />
PORT STATE SERVICE<br />
'''139/tcp open netbios-ssn'''<br />
5000/tcp open UPnP<br />
<br />
Interesting ports on 192.168.1.5:<br />
(The 1662 ports scanned but not shown below are in state: closed)<br />
PORT STATE SERVICE<br />
6000/tcp open X11<br />
<br />
Nmap run completed -- 256 IP addresses (2 hosts up) scanned in 7.255 seconds<br />
}}<br />
<br />
The first result is another system; the second happens to be the client from where this scan was performed.<br />
<br />
3. Now that systems with port 139 open are revealed, use {{Codeline|nmblookup}} to check for NetBIOS names: <br />
{{Command<br />
|name=nmblookup -A 192.168.1.1<br />
|output=Looking up status of 192.168.1.1<br />
PUTER <00> - B <ACTIVE><br />
HOMENET <00> - <GROUP> B <ACTIVE><br />
PUTER <03> - B <ACTIVE><br />
'''PUTER <20> - B <ACTIVE>'''<br />
HOMENET <1e> - <GROUP> B <ACTIVE><br />
USERNAME <03> - B <ACTIVE><br />
HOMENET <1d> - B <ACTIVE><br />
MSBROWSE <01> - <GROUP> B <ACTIVE><br />
}}<br />
<br />
Regardless of the output, look for '''<20>''', which shows the host with open services.<br />
<br />
4. Use {{Codeline|smbclient}} to list which services are shared on ''PUTER''. If prompted for a password, pressing enter should still display the list:<br />
{{Command<br />
|name=smbclient -L \\PUTER<br />
|output=<nowiki><br />
Sharename Type Comment<br />
--------- ---- -------<br />
MY_MUSIC Disk<br />
SHAREDDOCS Disk<br />
PRINTER$ Disk<br />
PRINTER Printer<br />
IPC$ IPC Remote Inter Process Communication<br />
<br />
Server Comment<br />
--------- -------<br />
PUTER<br />
<br />
Workgroup Master<br />
--------- -------<br />
HOMENET PUTER<br />
</nowiki>}}<br />
<br />
This shows which folders are shared and can be mounted locally. See: [[#Accessing Samba shares]]<br />
<br />
== Troubleshooting ==<br />
=== Trouble accessing a password-protected share from Windows ===<br />
<br />
If you are having trouble accessing a password protected share from Windows, try adding this to {{Filename|/etc/samba/smb.conf}}:[http://blogs.computerworld.com/networking_nightmare_ii_adding_linux]<br />
<br />
Note that you have to add this to your '''local''' smb.conf, not to the server's smb.conf<br />
<br />
[global]<br />
# lanman fix<br />
client lanman auth = yes<br />
client ntlmv2 auth = no<br />
<br />
=== Getting a dialog box up takes a long time ===<br />
<br />
I had a problem that it took ~30 seconds to get a password dialog box up when trying to connect from both Windows XP/Windows 7. Analyzing the error.log on the server I saw:<br />
<br />
[2009/11/11 06:20:12, 0] printing/print_cups.c:cups_connect(103)<br />
Unable to connect to CUPS server localhost:631 - Interrupted system call<br />
<br />
I don't have any printer connected to this server, so I added this to the global section:<br />
<br />
load printers = no<br />
printing = bsd<br />
disable spoolss = yes<br />
printcap name = /dev/null<br />
<br />
Not sure if all of them are necessary, but at least it works now.<br />
<br />
=== Changes in Samba version 3.4.0 ===<br />
<br />
[http://www.samba.org/samba/history/samba-3.4.0.html Major enhancements in Samba 3.4.0] include:<br />
<br />
The default passdb backend has been changed to 'tdbsam'! That breaks existing setups using the 'smbpasswd' backend without explicit declaration!<br />
<br />
If you would like to stick to the 'smbpasswd' backend try changing this in {{Filename|/etc/samba/smb.conf}}:<br />
<br />
passdb backend = smbpasswd<br />
<br />
or convert your smbpasswd entries using:<br />
<br />
sudo pdbedit -i smbpasswd -e tdbsam<br />
<br />
=== Error: Value too large for defined data type ===<br />
<br />
With some applications you could get this error whith every attempt to open a file mounted in smbfs/cifs:<br />
<br />
Value too large for defined data type<br />
<br />
The solution[https://bugs.launchpad.net/ubuntu/+bug/479266/comments/5] is to add this options to your smbfs/cifs mount options (in /etc/fstab for example):<br />
<br />
,nounix,noserverino<br />
<br />
''It works on Arch Linux up-to-date (2009-12-02)''<br />
<br />
== Resources ==<br />
*[http://www.samba.org/ Samba's official site]<br />
*[http://www.samba.org/samba/docs/SambaIntro.html Samba: An Introduction]</div>Rent0nhttps://wiki.archlinux.org/index.php?title=Samba&diff=99376Samba2010-03-08T16:26:56Z<p>Rent0n: </p>
<hr />
<div>[[Category:Networking (English)]]<br />
[[Category:HOWTOs (English)]]<br />
{{i18n|Samba}}<br />
{{Article summary start|Summary}}<br />
{{Article summary text|Installing, configuring and troubleshooting Samba}}<br />
{{Article summary heading|Related}}<br />
{{Article summary wiki|NFS}}<br />
{{Article summary wiki|Samba Domain Controller}}<br />
{{Article summary end}}<br />
<br />
'''Samba''' is a re-implementation of the SMB/CIFS networking protocol, it facilitates file and printer sharing among Linux and Windows systems as an alternative to [[NFS]]. Samba is easily configured and operation is very straight-forward.<br />
<br />
==Installation==<br />
Installing only the client program is sufficient for systems that are not meant to share files, only access them:<br />
# pacman -S smbclient<br />
<br />
In order to make shares available to clients, install the Samba ''server'' package:<br />
# pacman -S samba<br />
<br />
A daemon is installed with the server and it must be started for Samba to begin working. Samba typically uses [[FAM]] to monitor the file-system for changes, yet [[Gamin]] has almost completely replaced FAM as of recent, mainly because the former is poorly maintained and generally an inferior, unpopular choice.<br />
<br />
To install Gamin:<br />
# pacman -S gamin<br />
<br />
==Configuration==<br />
The {{filename|/etc/samba/smb.conf}} file must be created before starting the daemons. Once that is setup, users may opt for using an advanced configuration interface like SWAT.<br />
<br />
===smb.conf===<br />
As root, copy the default Samba configuration file to {{Filename|/etc/samba/smb.conf}}:<br />
# cp /etc/samba/smb.conf.default /etc/samba/smb.conf<br />
<br />
Open {{Filename|smb.conf}} and edit it to suit your needs. The default file creates a share for each user's home directory. It also creates a share for printers.<br />
<br />
===Starting and automating the daemons===<br />
If using FAM, start the {{codeline|fam}} [[daemon]] before {{codeline|samba}}. Gamin does not need a daemon since it automatically starts when needed.<br />
<br />
Without rebooting, FAM and Samba can be started with the commands:<br />
# /etc/rc.d/fam start<br />
# /etc/rc.d/samba start<br />
<br />
Add {{codeline|fam}} and {{codeline|samba}} to the DAEMONS line in {{Filename|[[rc.conf]]}} to automatically start the daemons at boot.<br />
<br />
===SWAT: Samba web administration tool===<br />
[http://samba.xsec.it/samba/docs/man/Samba-HOWTO-Collection/SWAT.html SWAT] is a facility that is part of the Samba suite. The main executable is called swat and is invoked by the eXtended InterNET Daemon, [[Wikipedia:xinetd|xinetd]]. <br />
<br />
There are many and varied opinions regarding the usefulness of SWAT. No matter how hard one tries to produce the perfect configuration tool, it remains an object of personal taste. SWAT is a tool that allows Web-based configuration of Samba. It has a wizard that may help to get Samba configured quickly, it has context-sensitive help on each {{Filename|smb.conf}} parameter, it provides for monitoring of current state of connection information, and it allows network-wide MS Windows network password management.[http://samba.xsec.it/samba/docs/man/Samba-HOWTO-Collection/SWAT.html]<br />
<br />
{{Warning|Before using SWAT, please be warned SWAT will completely replace your {{Filename|smb.conf}} with a fully optimized file that has been stripped of all comments you might have placed there, and only non-default settings will be written to the file.}}<br />
<br />
To use SWAT, first install xinetd:<br />
# pacman -S xinetd<br />
<br />
Edit {{Filename|/etc/xinetd.d/swat}} using your favorite text editor. To enable SWAT, change the {{Codeline|1=disable = yes}} line to {{Codeline|1=disable = no}}.<br />
<br />
service swat<br />
{<br />
port = 901<br />
socket_type = stream<br />
wait = no<br />
user = root<br />
server = /usr/sbin/swat<br />
log_on_success += HOST DURATION<br />
log_on_failure += HOST<br />
disable = no<br />
}<br />
<br />
If xinetd was compiled with tcpwrapper flag enabled, edit {{Filename|/etc/hosts.allow}} by adding following line:<br />
<br />
swat:127.0.0.1<br />
<br />
Then start xinetd daemon:<br />
<br />
# /etc/rc.d/xinetd start<br />
<br />
The web interface can be accessed on port 901 by default,<br />
http://localhost:901/<br />
<br />
{{Note|If you have problems with these directions, you can use the more all-encompasing [[Webmin]] tool instead, and easily load the SWAT module there.}}<br />
<br />
===Adding users===<br />
To log into a Samba share you'll need to add a user:<br />
# smbpasswd -a <user><br />
<br />
The user must already have a account on the server. If the user does not exist you will receive the error:<br />
Failed to modify password entry for user "<user>"<br />
<br />
You can add a new user to the Linux host with [[User Management#adduser|adduser]]. This article does not cover adding users to Windows systems.<br />
<br />
==Accessing Samba shares==<br />
KDE and Gnome have the ability to browse Samba shares. You therefore do not need any additional packages if using either of these DEs. If however you plan to use the share solely from a shell, you will need an additional package.<br />
<br />
===Accessing a Samba share from Gnome or KDE===<br />
From a Nautilus/Dolphin/Konqueror window, hit {{Keypress|Ctrl}}+{{Keypress|L}} or go to the "Go" menu and select "Location..." -- both actions will allow you to type in the "Go to:" blank. Enter:<br />
smb://servername/share<br />
<br />
{{Note|If you do not have your servername in your {{Filename|/etc/hosts}}, you must use the IP Address of the server in place of the servername.}}<br />
<br />
For a GUI in the KDE System Settings you have to install the kdenetwork-filesharing package from [extra].<br />
<br />
===Accessing a Samba share from the shell===<br />
Shares may be accessed by using an automatic mounter or by using a [[#Manual share mounting|manual method]].<br />
<br />
====Automatic share mounting====<br />
There are several alternatives for easy share browsing.<br />
<br />
=====smbnetfs=====<br />
1. Install {{Package Official|smbnetfs}}:<br />
# pacman -S smbnetfs<br />
<br />
2. Add the following line to {{Filename|/etc/fuse.conf}}:<br />
user_allow_other<br />
<br />
3. Load the {{Codeline|fuse}} kernel module:<br />
# modprobe fuse<br />
<br />
4. Start the {{Codeline|smbnetfs}} [[daemon]]:<br />
# /etc/rc.d/smbnetfs start<br />
<br />
All shares in the network are now automatically mounted under {{Filename|/mnt/smbnet}}.<br />
<br />
Add the following to {{Filename|/etc/rc.conf}} to access the shares at boot:<br />
MODULES=(... '''fuse''' ...)<br />
DAEMONS=(... '''smbnetfs''' ...)<br />
<br />
<br />
If a username and a password is required to access some of the shared folders, you have to edit {{filename|/etc/smbnetfs/.smb/smbnetfs.conf}} by uncommenting the line starting with "auth" and editing it to your needs:<br />
<br />
auth "WORKGROUP/username" "password"<br />
<br />
Then, it may be necessary to change the permissions of {{filename|/etc/smbnetfs/.smb/smbnetfs.conf}} for smbnetfs to work correctly:<br />
<br />
# chmod 600 /etc/smbnetfs/.smb/smbnetfs.conf<br />
<br />
<br />
=====fusesmb=====<br />
{{Note|1=Because {{Codeline|smbclient 3.2.X}} is malfunctioning with {{Codeline|fusesmb}}, revert to using older versions if necessary. See the [http://bbs.archlinux.org/viewtopic.php?id=58434 relevant forum topic] for details.}}<br />
<br />
1. Install the {{Package AUR|fusesmb}} package from the [[AUR]] using [[yaourt]] or other [[AUR Helpers]]:<br />
$ yaourt -S fusesmb<br />
<br />
2. Create a mount point:<br />
# mkdir /mnt/fusesmb<br />
<br />
3. Load {{Codeline|fuse}} module:<br />
# modprobe fuse<br />
<br />
4. Mount the shares:<br />
# fusesmb -o allow_other /mnt/fusesmb<br />
<br />
For mounting shares at boot, add the command above to {{Filename|/etc/rc.local}} and add {{Codeline|fuse}} module to {{Filename|/etc/rc.conf}}:<br />
MODULES=(... '''fuse''' ...)<br />
<br />
=====Autofs=====<br />
See [[Autofs]] for information on the kernel-based automounter for Linux.<br />
<br />
====Manual share mounting====<br />
1. Use [[smbclient]] to browse shares from the shell. To list any public shares on a server:<br />
$ smbclient -L <hostname> -U%<br />
<br />
2. Create the mount point for the share:<br />
# mkdir /mnt/MOUNTPOINT<br />
<br />
3. Mount the share using {{Codeline|mount.cifs}}. Keep in mind that not all options may be needed nor desirable, such as {{Codeline|password}}:<br />
# mount -t cifs //''SERVER''/''SHARENAME'' ''MOUNTPOINT'' -o user=''USERNAME'',password=''PASSWORD'',workgroup=''WORKGROUP'',ip=''SERVERIP''<br />
<br />
;{{Codeline|SERVER}}: The Windows system's name<br />
;{{Codeline|SHARENAME}}: The shared directory<br />
;{{Codeline|MOUNTPOINT}}: The local directory where the share will be mounted to<br />
;{{Codeline|-o [options]}}: Specifies options for {{Codeline|mount.cifs}}<br />
:;{{Codeline|user}}: Username used to mount the share<br />
:;{{Codeline|password}}: The shared directory's password<br />
:;{{Codeline|workgroup}}: Used to specify the workgroup<br />
:;{{Codeline|ip}}: The IP address of the server -- if the system is unable to find the Windows computer by name (DNS, WINS, hosts entry, etc.)<br />
<br />
{{Note|Abstain from using trailing directory ('''/''') characters. Using {{Filename|//SERVER/SHARENAME'''/'''}} will not work.}}<br />
<br />
4. To unmount the share, use:<br />
# umount /mnt/MOUNTPOINT<br />
<br />
=====Adding the share to {{Filename|fstab}}=====<br />
Add the following to {{Filename|/etc/[[fstab]]}} for easy mounting:<br />
//SERVER/SHARENAME /mnt/MOUNTPOINT cifs noauto,noatime,username=USER,password=PASSWORD,workgroup=WORKGROUP 0 0<br />
<br />
The {{Codeline|noauto}} option disables mounting it automatically at boot and {{Codeline|noatime}} increases performance by skipping inode access times.<br />
<br />
After adding the previous line, the syntax to mount files becomes simpler:<br />
# mount /mnt/MOUNTPOINT<br />
<br />
If adding a Samba share to {{Filename|fstab}}, the {{codeline|netfs}} daemon should also be added to {{Filename|[[rc.conf]]}}, somewhere after the [[network]] daemon. The {{codeline|netfs}} daemon will mount network partitions at boot and, more importantly, unmount network partitions at shutdown. Even if using the {{codeline|noauto}} option in {{Filename|fstab}}, the {{codeline|netfs}} daemon should be used. Without it any network share that is mounted when shutting down will cause the {{codeline|network}} daemon to wait for the connection to time out, considerably extending poweroff time.<br />
<br />
=====Allowing users to mount=====<br />
Before enabling access to the mount commands, {{Filename|fstab}} needs to be modified. Add the {{Codeline|users}} options to the entry in {{Filename|/etc/fstab}}:<br />
//SERVER/SHARENAME /path/to/SHAREMOUNT cifs '''users''',noauto,noatime,username=USER,password=PASSWORD,workgroup=WORKGROUP 0 0<br />
<br />
{{Note|The option is {{codeline|user'''s'''}} (plural). For other filesystem types handled by mount, this option is usually ''user''; sans the "'''s'''".}}<br />
<br />
This will allow users to mount it aslong as the mount point resides in a directory ''controllable'' by the user; i.e. the user's home. For users to be allowed to mount and unmount the Samba shares with mount points that they do not own, use [[#smbnetfs]], or grant privileges using [[sudo]].<br />
<br />
== Tips and tricks ==<br />
<br />
=== Share files for your LAN without user and password ===<br />
<br />
Edit {{Filename|/etc/samba/smb.conf}} and change the following line:<br />
<br />
security = user<br />
<br />
to<br />
<br />
security = share<br />
<br />
If you want to restrict the shares data to a specific interface replace:<br />
<br />
; interfaces = 192.168.12.2/24 192.168.13.2/24<br />
<br />
with:<br />
<br />
interfaces = lo eth0<br />
bind interfaces only = true<br />
<br />
(changing eth0 to the local network you want share with.)<br />
<br />
If you want to edit the account that access the shares, edit the following line:<br />
<br />
; guest account = nobody<br />
<br />
The last step is to create share directory (for write access make writable = yes):<br />
<br />
[Public Share]<br />
path = /path/to/public/share<br />
available = yes<br />
browsable = yes<br />
public = yes<br />
writable = no<br />
<br />
=== Sample configuration file ===<br />
<br />
The configuration that worked for one user:<br />
[global]<br />
workgroup = WORKGROUP<br />
server string = Samba Server<br />
netbios name = PC_NAME<br />
security = share<br />
; the line below is important! If you have permission issues make<br />
; sure the user here is the same as the user of the folder you<br />
; want to share<br />
guest account = mark<br />
username map = /etc/samba/smbusers<br />
name resolve order = hosts wins bcast<br />
wins support = no<br /><br />
[public]<br />
comment = Public Share<br />
path = /path/to/public/share<br />
available = yes<br />
browsable = yes<br />
public = yes<br />
writable = no<br />
<br />
=== Adding network shares using KDE4 GUI ===<br />
How to configure the folder sharing in KDE4. Simple file sharing limits user shared folders to their home directory and read-only access. Advanced file sharing gives full semantics of Samba with no limits to shared folders but requires su or sudo root permissions.<br />
* Read only, simple file sharing: [[Samba/Simple file sharing with KDE4]]<br />
* Full capability file sharing: [[Samba/Advanced file sharing with KDE4]]<br />
<br />
=== Discovering network shares ===<br />
<br />
If nothing is known about other systems on the local network, and automated tools such as [[#smbnetfs]] are not available, the following methods allow one to manually probe for Samba shares.<br />
<br />
1. First, install {{Package Official|nmap}} and {{Package Official|smbclient}} using [[pacman]]:<br />
# pacman -S nmap smbclient<br />
<br />
2. {{Codeline|nmap}} checks which ports are open:<br />
# nmap -sT 192.168.1.*<br />
<br />
In this case, a scan on the 192.168.1.* IP address range has been performed, resulting in:<br />
{{Command<br />
|name=nmap -sT 192.168.1.*<br />
|output=Starting nmap 3.78 ( http://www.insecure.org/nmap/ ) at 2005-02-15 11:45 PHT<br />
Interesting ports on 192.168.1.1:<br />
(The 1661 ports scanned but not shown below are in state: closed)<br />
PORT STATE SERVICE<br />
'''139/tcp open netbios-ssn'''<br />
5000/tcp open UPnP<br />
<br />
Interesting ports on 192.168.1.5:<br />
(The 1662 ports scanned but not shown below are in state: closed)<br />
PORT STATE SERVICE<br />
6000/tcp open X11<br />
<br />
Nmap run completed -- 256 IP addresses (2 hosts up) scanned in 7.255 seconds<br />
}}<br />
<br />
The first result is another system; the second happens to be the client from where this scan was performed.<br />
<br />
3. Now that systems with port 139 open are revealed, use {{Codeline|nmblookup}} to check for NetBIOS names: <br />
{{Command<br />
|name=nmblookup -A 192.168.1.1<br />
|output=Looking up status of 192.168.1.1<br />
PUTER <00> - B <ACTIVE><br />
HOMENET <00> - <GROUP> B <ACTIVE><br />
PUTER <03> - B <ACTIVE><br />
'''PUTER <20> - B <ACTIVE>'''<br />
HOMENET <1e> - <GROUP> B <ACTIVE><br />
USERNAME <03> - B <ACTIVE><br />
HOMENET <1d> - B <ACTIVE><br />
MSBROWSE <01> - <GROUP> B <ACTIVE><br />
}}<br />
<br />
Regardless of the output, look for '''<20>''', which shows the host with open services.<br />
<br />
4. Use {{Codeline|smbclient}} to list which services are shared on ''PUTER''. If prompted for a password, pressing enter should still display the list:<br />
{{Command<br />
|name=smbclient -L \\PUTER<br />
|output=<nowiki><br />
Sharename Type Comment<br />
--------- ---- -------<br />
MY_MUSIC Disk<br />
SHAREDDOCS Disk<br />
PRINTER$ Disk<br />
PRINTER Printer<br />
IPC$ IPC Remote Inter Process Communication<br />
<br />
Server Comment<br />
--------- -------<br />
PUTER<br />
<br />
Workgroup Master<br />
--------- -------<br />
HOMENET PUTER<br />
</nowiki>}}<br />
<br />
This shows which folders are shared and can be mounted locally. See: [[#Accessing Samba shares]]<br />
<br />
== Troubleshooting ==<br />
=== Trouble accessing a password-protected share from Windows ===<br />
<br />
If you are having trouble accessing a password protected share from Windows, try adding this to {{Filename|/etc/samba/smb.conf}}:[http://blogs.computerworld.com/networking_nightmare_ii_adding_linux]<br />
<br />
Note that you have to add this to your '''local''' smb.conf, not to the server's smb.conf<br />
<br />
[global]<br />
# lanman fix<br />
client lanman auth = yes<br />
client ntlmv2 auth = no<br />
<br />
=== Getting a dialog box up takes a long time ===<br />
<br />
I had a problem that it took ~30 seconds to get a password dialog box up when trying to connect from both Windows XP/Windows 7. Analyzing the error.log on the server I saw:<br />
<br />
[2009/11/11 06:20:12, 0] printing/print_cups.c:cups_connect(103)<br />
Unable to connect to CUPS server localhost:631 - Interrupted system call<br />
<br />
I don't have any printer connected to this server, so I added this to the global section:<br />
<br />
load printers = no<br />
printing = bsd<br />
disable spoolss = yes<br />
printcap name = /dev/null<br />
<br />
Not sure if all of them are necessary, but at least it works now.<br />
<br />
=== Changes in Samba version 3.4.0 ===<br />
<br />
[http://www.samba.org/samba/history/samba-3.4.0.html Major enhancements in Samba 3.4.0] include:<br />
<br />
The default passdb backend has been changed to 'tdbsam'! That breaks existing setups using the 'smbpasswd' backend without explicit declaration!<br />
<br />
If you would like to stick to the 'smbpasswd' backend try changing this in {{Filename|/etc/samba/smb.conf}}:<br />
<br />
passdb backend = smbpasswd<br />
<br />
or convert your smbpasswd entries using:<br />
<br />
sudo pdbedit -i smbpasswd -e tdbsam<br />
<br />
=== Error: Value too large for defined data type ===<br />
<br />
With some applications you could get this error whith every attempt to open a file mounted in smbfs/cifs:<br />
<br />
Value too large for defined data type<br />
<br />
The solution[https://bugs.launchpad.net/ubuntu/+bug/479266/comments/5] is to add this options to your smbfs/cifs mount options (in /etc/fstab for example):<br />
<br />
,nounix,noserverino<br />
<br />
''It works on Arch Linux up-to-date (2009-12-02)''<br />
<br />
== Resources ==<br />
*[http://www.samba.org/ Samba's official site]<br />
*[http://www.samba.org/samba/docs/SambaIntro.html Samba: An Introduction]</div>Rent0nhttps://wiki.archlinux.org/index.php?title=Talk:VirtualBox&diff=93115Talk:VirtualBox2010-01-22T14:57:35Z<p>Rent0n: </p>
<hr />
<div>I really think this article should be cleaned up and simplified. It is a little confusing- specifically the "Using host interface networking" section. I would atempt to do it myself, but I am not super knowlegable about this topic. Even Breaking this into sections with advice on which way would be best to use would be helpful. ~[[User:meskarune|meskarune]] (Fri, June 26, 2009)<br />
<br />
Anybody, any experience with how to use existing vmware virtual machine in virtualbox? I tried, but without success. I'll retry using: http://liquidat.wordpress.com/2007/11/23/howto-transform-a-qemu-image-to-a-virtualbox-image/ and post my findings.<br />
<br />
--<br />
<br />
Could someone please update the wiki with instructions on how to install Guest Additions on an Arch Linux virtual machine? I have been trying to figure this one out for a while now and I can't seem to get the proper daemons/modules to install. ~[[User:Thayer.w|Thayer]] (Thursday, 19 July 2007)<br />
:<strike>I'm bumping this again, because the current instructions don't seem to work.</strike> Nevermind, got it working =) ~[[User:Thayer.w|Thayer]] (Weds, Aug 6, 2008)<br />
<br />
--<br />
<br />
== Corrected USB-problem ==<br />
<br />
The fstab entry contains the group-id 85 which can vary on other PCs. I added a possible solution...<br />
=== More USB ===<br />
Can confirm that you can use mass storage USB passthrough with 3.0.4. But you must mount /proc/bus/usb as described in the article for any other types of USB devices such as mice & Blackberries<br />
<br />
For me an entry in the fstab was also necessary to use my USB flash drive in the WinXP guest. But instead of the line in the wiki article I had to use this one: <br />
none /sys/bus/usb/drivers usbfs devgid=108,devmode=664 0 0 (see this thread: http://bbs.archlinux.org/viewtopic.php?pid=640440)<br />
<br />
== Using host interface networking (the Arch way) & udev rules ==<br />
<br />
the wiki ask to set a file called 60-vboxdrv.rules under the directory /etc/udev/rules.d, but when I've tried, a file named 60-virtualbox.rules is already here, with the same setting. I don't know if the name matter, how from where the file come (virtualbox-ose via pacman ? guest addition ?)<br />
<br />
So I report this.<br />
--[[User:Gkrnours|Gkrnours]] 04:38, 13 May 2009 (EDT)<br />
<br />
== vboxdrv module ==<br />
Since Arch uses MODULES_AUTOLAD=yes by default in /etc/rc.conf, is it still mandatory to add vboxdrv in the MODULES array? I don't think so but I'm not totally sure.<br />
<br />
rent0n</div>Rent0nhttps://wiki.archlinux.org/index.php?title=User:Rent0n&diff=88252User:Rent0n2009-12-20T12:51:19Z<p>Rent0n: Created page with ''''Registered Linux User #337812''' '''[http://rent0n86.deviantart.com rent0n@deviantART]''''</p>
<hr />
<div>'''Registered Linux User #337812'''<br />
<br />
'''[http://rent0n86.deviantart.com rent0n@deviantART]'''</div>Rent0nhttps://wiki.archlinux.org/index.php?title=Talk:Pacman/Pacnew_and_Pacsave&diff=88250Talk:Pacman/Pacnew and Pacsave2009-12-20T11:34:53Z<p>Rent0n: </p>
<hr />
<div>I never wrote in a wiki, however...<br />
<br />
I just would like to say that the meld loop script completely screwed up my pacnew files, removing them without comparing them to originals.<br />
Maybe it's my fault somehow but during the procedure I had lots of meld errors and I think it's better to control and review that part.<br />
<br />
Best wishes, <br />
rent0n<br />
<br />
Thanks renton for putting this up. Not sure just what happened, but I'm guessing that kdesu isn't installed???? If that were the case, the command would be skipped and the .pacnew would be removed. I added '-i' to 'rm' command to prompt to confirm before removal. Hope this helps :|.<br />
<br />
--[[User:Gen2ly|Gen2ly]] 18:30, 18 December 2009 (EST)<br />
<br />
I don't know what happened, However I had changed kdesu for gksudo. Are you using that script without problems?<br />
rent0n<br />
<br />
Yes... however, I don't have my user set for global sudo permissions or for the 'rm and copy' command which would be necessary for files to be copied/deleted. When I used the script the 'rm' and 'cp' commands never ran properly. It's fixed now so that files don't get deleted without a prompt but what problems were you having with meld?<br />
<br />
--[[User:Gen2ly|Gen2ly]] 14:22, 19 December 2009 (EST)<br />
<br />
Yes, it should work now.<br />
Maybe it is better to look for pacnew files in the whole / instead than in /etc only?<br />
rent0n</div>Rent0nhttps://wiki.archlinux.org/index.php?title=Dropbox&diff=88197Dropbox2009-12-19T23:13:02Z<p>Rent0n: /* Without Nautilus (Another Way) */</p>
<hr />
<div>[[Category:HOWTOs (English)]]<br />
[http://getdropbox.com Dropbox] is a file sharing system that recently introduced a GNU/Linux client. Use it to transparently sync files across computers and architectures. Simply drop files into your "~/Dropbox" folder, and they will automatically sync to your centralized repository.<br />
<br />
==Installation from Yaourt==<br />
<br />
The GNU/Linux Dropbox client is packaged both as a stand-alone binary and a Nautilus plugin. It is in the [[AUR]] as "dropbox" and "nautilus-dropbox". <br />
<br />
#Simply run "yaourt nautilus-dropbox" or "yaourt dropbox" to build and install. (See [http://archux.com/page/installing-programs-aur here] for instructions on installing from the AUR).<br />
#If you installed the stand-alone version, you can now look for Dropbox in your application menu or run "dropboxd" from the command-line. The client icon will appear in the system tray.<br />
#If you installed the Nautilus plugin, restart Nautilus. You will see the Dropbox icon in your panel.<br />
#Eventually a popup will ask you to login to your Dropbox account, or start a new one. Enter your credentials.<br />
#After some time you will see a "Welcome to Dropbox" popup, which will give you the opportunity to view a short tour of Dropbox.<br />
#Press the "Finish and go to My Dropbox".<br />
<br />
To use it, simply drag and drop files into your "Dropbox" folder.<br />
<br />
==Installation from Source==<br />
<br />
If you prefer compiling from source, Dropbox's Nautilus plug-in compiles perfectly on Arch. <br />
<br />
#Make sure you have or install nautilus, python, pygtk, glib2, docutils, pkg-config, and libnotify from pacman. These are necessary to compile Dropbox.<br />
#Download the .tar.gz from [http://www.getdropbox.com/downloading?os=lnx Dropbox's website]<br />
#Navigate to where you downloaded the file.<br />
#Extract the file<br />
$ bunzip2 nautilus-dropbox-0.6.1.tar.bz2<br />
$ tar xvf nautilus-dropbox-0.6.1.tar<br />
#Navigate to the "nautilus-dropbox" directory<br />
#Configure, and check the output for missing dependencies.<br />
$ ./configure<br />
#If the configure went well, make.<br />
$ make<br />
#Provided the compilation completed successfully, install Dropbox<br />
$ sudo make install<br />
#Now start the Dropbox, and tell it to install the proprietary daemon<br />
$ /usr/bin/dropbox start -i<br />
#It will download, unpack, and install the daemon, then launch the configuration wizard. Enter your details.<br />
<br />
Dropbox should now be running, and syncing with the Dropbox servers. Now you can use dropbox just like you installed from yaourt, but now with a smug feeling of contentment.<br />
<br />
==Without Nautilus==<br />
<br />
If you happen to not use the Gnome desktop environment, you may not want to use Nautilus. The following instructions are taken from the dropbox tips and tricks [http://wiki.getdropbox.com/TipsAndTricks/TextBasedLinuxInstall website] and enable you to share your ~/Dropbox folder without bringing in those gnome dependencies.<br />
<br />
<br />
<br />
First, download the Dropbox standalone client for [http://www.getdropbox.com/download?plat=lnx.x86 32bit] or [http://www.getdropbox.com/download?plat=lnx.x86_64 64bit]. Put it in your home directory.<br />
<br />
Note: i've been having problems of late, downloading the experimental build from [http://forums.getdropbox.com/topic.php?id=7220 here] solved it for me on two machine so far.<br />
<br />
While in your home directory, extract the downloaded tarball.<br />
$ cd<br />
$ tar zxof dropbox*.tar.gz<br />
<br />
Next, use wget to download a few scripts needed to get around those nautilus requirements:<br />
$ wget http://dl.getdropbox.com/u/6995/dbmakefakelib.py<br />
$ wget http://dl.getdropbox.com/u/6995/dbreadconfig.py<br />
<br />
Run the first script and check for the follwing output:<br />
$ python dbmakefakelib.py<br />
dropboxd ran for 15 seconds without quitting - success?<br />
<br />
Now run the second script to get some info required to register your client:<br />
$ python dbreadconfig.py<br />
host_id = 739bfe362f3bb3246da99dc8d20dbe2b<br />
last_revision = None<br />
schema_version = 6<br />
<br />
The important line here is the host_id. Go to https://www.getdropbox.com/cli_link?host_id=HOSTID (replacing HOSTID with the string from above) and follow the steps to register your client.<br />
<br />
There should now be three directories in your home directory called: ".dropbox-dist", ".dropbox", and "Dropbox". Create ~/Dropbox if it doesn't exist.<br />
<br />
You can start the dropbox client with the following command:<br />
$ ~/.dropbox-dist/dropboxd &<br />
<br />
Move files into "Dropbox" to sync them.<br />
".dropbox" holds configuration databases and caches for Dropbox. Don't touch this.<br />
<br />
At this point, you can continue using the dropbox daemon as is, placing the above command in some sort of startup script. If you would rather dropbox run as a daemon like sshd or vsftpd, simply do the following:<br />
<br />
As root, copy this into a file called /etc/rc.d/dropboxd; replace all occurrences of USER, obviously.<br />
<br />
#!/bin/bash<br />
<br />
. /etc/rc.conf<br />
. /etc/rc.d/functions<br />
<br />
PID=`pidof -o %PPID /home/USER/.dropbox-dist/dropbox`<br />
<br />
case "$1" in<br />
start)<br />
stat_busy "Starting Dropbox Service"<br />
[ -z "$PID" ] && su -c "/home/USER/.dropbox-dist/dropboxd &" USER<br />
if [ $? -gt 0 ]; then<br />
stat_fail<br />
else<br />
add_daemon dropboxd<br />
stat_done<br />
fi<br />
;;<br />
stop)<br />
stat_busy "Stopping Dropbox Service"<br />
[ ! -z "$PID" ] && kill $PID > /dev/null<br />
if [ $? -gt 0 ]; then<br />
stat_fail<br />
else<br />
rm_daemon dropboxd<br />
stat_done<br />
fi<br />
;;<br />
restart)<br />
$0 stop<br />
sleep 3<br />
$0 start<br />
;;<br />
*)<br />
echo "usage: $0 {start|stop|restart}"<br />
;;<br />
esac<br />
exit 0<br />
<br />
<br />
<br />
Make the file executable with<br />
sudo chmod +x /etc/rc.d/dropboxd<br />
<br />
This allows you to start or stop dropboxd just like any other service. place it in the daemons array in rc.conf for it to start at boot.<br />
<br />
sudo /etc/rc.d/dropboxd start<br />
sudo /etc/rc.d/dropboxd stop<br />
sudo /etc/rc.d/dropboxd restart<br />
<br />
And in rc.conf:<br />
DAEMONS=(syslog-ng network sensors hal @fcron @openntpd @alsa @dropboxd !icecast !mpd)<br />
<br />
==Without Nautilus (Another Way)==<br />
<br />
Another way to use Dropbox without Nautilus but with another file manager like Thunar is described below:<br />
<br />
1. Download and install the [http://aur.archlinux.org/packages.php?ID=23363 dropbox] package from the AUR.<br />
$ aurget dropbox<br />
<br />
2. Create a fake Nautilus script that will launch Thunar:<br />
$ sudo touch /usr/bin/nautilus && sudo chmod +x /usr/bin/nautilus && sudo nano /usr/bin/nautilus<br />
<br />
3. Insert this text into the file, then save and exit:<br />
#!/bin/bash<br />
exec thunar $@<br />
exit 0<br />
<br />
4. Launch Dropbox<br />
$ dropboxd<br />
<br />
5. Click on the dropbox tray icon to open your dropbox folder in Thunar.<br />
<br />
'''Note:''' in this way there is no need to create a dropbox daemon in /etc/rc.d and to start it at boot via /etc/rc.conf or to make it start via your session manager: just leave the "Start dropbox on system startup" option flagged in the Preferences window.<br />
<br />
==Securing your Dropbox==<br />
<br />
If you want to store sensitive data in your Dropbox, you should encrypt it before. Syncing to Dropbox is encrypted, but all files are (for the time being) stored on the server just as you put them in your Dropbox.<br />
<br />
* Dropbox works with [[Truecrypt]], and after you initially uploaded the Truecrypt volume to Dropbox, performance is quite ok, because of Dropbox has a working binary diff.<br />
<br />
* Another possibility is to use [[EncFS]], which has the advantage that all files are encrypted separately, i.e. you don't have to determine in advance the size of the content you want to encrypt and your encrypted directory grows and shrinks while you add/delete/modify files in it. You can also mount an encrypted volume at startup using the -S option of encfs to avoid having to input the passphrase, but note that your encrypted files are not secure from someone who has direct access to your computer.</div>Rent0nhttps://wiki.archlinux.org/index.php?title=Dropbox&diff=88196Dropbox2009-12-19T23:12:04Z<p>Rent0n: Added an alternative way to use Dropbox without Nautilus, but with Thunar.</p>
<hr />
<div>[[Category:HOWTOs (English)]]<br />
[http://getdropbox.com Dropbox] is a file sharing system that recently introduced a GNU/Linux client. Use it to transparently sync files across computers and architectures. Simply drop files into your "~/Dropbox" folder, and they will automatically sync to your centralized repository.<br />
<br />
==Installation from Yaourt==<br />
<br />
The GNU/Linux Dropbox client is packaged both as a stand-alone binary and a Nautilus plugin. It is in the [[AUR]] as "dropbox" and "nautilus-dropbox". <br />
<br />
#Simply run "yaourt nautilus-dropbox" or "yaourt dropbox" to build and install. (See [http://archux.com/page/installing-programs-aur here] for instructions on installing from the AUR).<br />
#If you installed the stand-alone version, you can now look for Dropbox in your application menu or run "dropboxd" from the command-line. The client icon will appear in the system tray.<br />
#If you installed the Nautilus plugin, restart Nautilus. You will see the Dropbox icon in your panel.<br />
#Eventually a popup will ask you to login to your Dropbox account, or start a new one. Enter your credentials.<br />
#After some time you will see a "Welcome to Dropbox" popup, which will give you the opportunity to view a short tour of Dropbox.<br />
#Press the "Finish and go to My Dropbox".<br />
<br />
To use it, simply drag and drop files into your "Dropbox" folder.<br />
<br />
==Installation from Source==<br />
<br />
If you prefer compiling from source, Dropbox's Nautilus plug-in compiles perfectly on Arch. <br />
<br />
#Make sure you have or install nautilus, python, pygtk, glib2, docutils, pkg-config, and libnotify from pacman. These are necessary to compile Dropbox.<br />
#Download the .tar.gz from [http://www.getdropbox.com/downloading?os=lnx Dropbox's website]<br />
#Navigate to where you downloaded the file.<br />
#Extract the file<br />
$ bunzip2 nautilus-dropbox-0.6.1.tar.bz2<br />
$ tar xvf nautilus-dropbox-0.6.1.tar<br />
#Navigate to the "nautilus-dropbox" directory<br />
#Configure, and check the output for missing dependencies.<br />
$ ./configure<br />
#If the configure went well, make.<br />
$ make<br />
#Provided the compilation completed successfully, install Dropbox<br />
$ sudo make install<br />
#Now start the Dropbox, and tell it to install the proprietary daemon<br />
$ /usr/bin/dropbox start -i<br />
#It will download, unpack, and install the daemon, then launch the configuration wizard. Enter your details.<br />
<br />
Dropbox should now be running, and syncing with the Dropbox servers. Now you can use dropbox just like you installed from yaourt, but now with a smug feeling of contentment.<br />
<br />
==Without Nautilus==<br />
<br />
If you happen to not use the Gnome desktop environment, you may not want to use Nautilus. The following instructions are taken from the dropbox tips and tricks [http://wiki.getdropbox.com/TipsAndTricks/TextBasedLinuxInstall website] and enable you to share your ~/Dropbox folder without bringing in those gnome dependencies.<br />
<br />
<br />
<br />
First, download the Dropbox standalone client for [http://www.getdropbox.com/download?plat=lnx.x86 32bit] or [http://www.getdropbox.com/download?plat=lnx.x86_64 64bit]. Put it in your home directory.<br />
<br />
Note: i've been having problems of late, downloading the experimental build from [http://forums.getdropbox.com/topic.php?id=7220 here] solved it for me on two machine so far.<br />
<br />
While in your home directory, extract the downloaded tarball.<br />
$ cd<br />
$ tar zxof dropbox*.tar.gz<br />
<br />
Next, use wget to download a few scripts needed to get around those nautilus requirements:<br />
$ wget http://dl.getdropbox.com/u/6995/dbmakefakelib.py<br />
$ wget http://dl.getdropbox.com/u/6995/dbreadconfig.py<br />
<br />
Run the first script and check for the follwing output:<br />
$ python dbmakefakelib.py<br />
dropboxd ran for 15 seconds without quitting - success?<br />
<br />
Now run the second script to get some info required to register your client:<br />
$ python dbreadconfig.py<br />
host_id = 739bfe362f3bb3246da99dc8d20dbe2b<br />
last_revision = None<br />
schema_version = 6<br />
<br />
The important line here is the host_id. Go to https://www.getdropbox.com/cli_link?host_id=HOSTID (replacing HOSTID with the string from above) and follow the steps to register your client.<br />
<br />
There should now be three directories in your home directory called: ".dropbox-dist", ".dropbox", and "Dropbox". Create ~/Dropbox if it doesn't exist.<br />
<br />
You can start the dropbox client with the following command:<br />
$ ~/.dropbox-dist/dropboxd &<br />
<br />
Move files into "Dropbox" to sync them.<br />
".dropbox" holds configuration databases and caches for Dropbox. Don't touch this.<br />
<br />
At this point, you can continue using the dropbox daemon as is, placing the above command in some sort of startup script. If you would rather dropbox run as a daemon like sshd or vsftpd, simply do the following:<br />
<br />
As root, copy this into a file called /etc/rc.d/dropboxd; replace all occurrences of USER, obviously.<br />
<br />
#!/bin/bash<br />
<br />
. /etc/rc.conf<br />
. /etc/rc.d/functions<br />
<br />
PID=`pidof -o %PPID /home/USER/.dropbox-dist/dropbox`<br />
<br />
case "$1" in<br />
start)<br />
stat_busy "Starting Dropbox Service"<br />
[ -z "$PID" ] && su -c "/home/USER/.dropbox-dist/dropboxd &" USER<br />
if [ $? -gt 0 ]; then<br />
stat_fail<br />
else<br />
add_daemon dropboxd<br />
stat_done<br />
fi<br />
;;<br />
stop)<br />
stat_busy "Stopping Dropbox Service"<br />
[ ! -z "$PID" ] && kill $PID > /dev/null<br />
if [ $? -gt 0 ]; then<br />
stat_fail<br />
else<br />
rm_daemon dropboxd<br />
stat_done<br />
fi<br />
;;<br />
restart)<br />
$0 stop<br />
sleep 3<br />
$0 start<br />
;;<br />
*)<br />
echo "usage: $0 {start|stop|restart}"<br />
;;<br />
esac<br />
exit 0<br />
<br />
<br />
<br />
Make the file executable with<br />
sudo chmod +x /etc/rc.d/dropboxd<br />
<br />
This allows you to start or stop dropboxd just like any other service. place it in the daemons array in rc.conf for it to start at boot.<br />
<br />
sudo /etc/rc.d/dropboxd start<br />
sudo /etc/rc.d/dropboxd stop<br />
sudo /etc/rc.d/dropboxd restart<br />
<br />
And in rc.conf:<br />
DAEMONS=(syslog-ng network sensors hal @fcron @openntpd @alsa @dropboxd !icecast !mpd)<br />
<br />
==Without Nautilus (Another Way)==<br />
<br />
Another way to use Dropbox without Nautilus but with another file manager like Thunar is described below:<br />
<br />
1. Download and install the [http://aur.archlinux.org/packages.php?ID=23363 dropbox] package from the AUR.<br />
$ aurget dropbox<br />
<br />
2. Create a fake Nautilus script that will launch Thunar:<br />
$ sudo touch /usr/bin/nautilus && sudo chmod +x /usr/bin/nautilus && sudo nano /usr/bin/nautilus<br />
<br />
3. Insert this text into the file, then save and exit:<br />
#!/bin/bash<br />
exec thunar $@<br />
exit 0<br />
<br />
4. Launch Dropbox<br />
$ dropboxd<br />
<br />
5. Click on the dropbox tray icon to open your dropbox folder in Thunar.<br />
<br />
'''Note:''' in this way there is no need to create a dropbox daemon in /etc/rc.d and to start it at boot via /etc/rc.conf or to make it start via your session manager: just leave the "Start dropbox on system startup" option flagged in the Prefernces window.<br />
<br />
==Securing your Dropbox==<br />
<br />
If you want to store sensitive data in your Dropbox, you should encrypt it before. Syncing to Dropbox is encrypted, but all files are (for the time being) stored on the server just as you put them in your Dropbox.<br />
<br />
* Dropbox works with [[Truecrypt]], and after you initially uploaded the Truecrypt volume to Dropbox, performance is quite ok, because of Dropbox has a working binary diff.<br />
<br />
* Another possibility is to use [[EncFS]], which has the advantage that all files are encrypted separately, i.e. you don't have to determine in advance the size of the content you want to encrypt and your encrypted directory grows and shrinks while you add/delete/modify files in it. You can also mount an encrypted volume at startup using the -S option of encfs to avoid having to input the passphrase, but note that your encrypted files are not secure from someone who has direct access to your computer.</div>Rent0nhttps://wiki.archlinux.org/index.php?title=Talk:Pacman/Pacnew_and_Pacsave&diff=88171Talk:Pacman/Pacnew and Pacsave2009-12-19T12:32:07Z<p>Rent0n: </p>
<hr />
<div>I never wrote in a wiki, however...<br />
<br />
I just would like to say that the meld loop script completely screwed up my pacnew files, removing them without comparing them to originals.<br />
Maybe it's my fault somehow but during the procedure I had lots of meld errors and I think it's better to control and review that part.<br />
<br />
Best wishes, <br />
rent0n<br />
<br />
Thanks renton for putting this up. Not sure just what happened, but I'm guessing that kdesu isn't installed???? If that were the case, the command would be skipped and the .pacnew would be removed. I added '-i' to 'rm' command to prompt to confirm before removal. Hope this helps :|.<br />
<br />
--[[User:Gen2ly|Gen2ly]] 18:30, 18 December 2009 (EST)<br />
<br />
I don't know what happened, However I had changed kdesu for gksudo. Are you using that script without problems?<br />
rent0n</div>Rent0nhttps://wiki.archlinux.org/index.php?title=Talk:Dropbox&diff=88096Talk:Dropbox2009-12-18T21:23:32Z<p>Rent0n: </p>
<hr />
<div>What do you think of adding the procedure explained here?<br />
<br />
--> [http://bbs.archlinux.org/viewtopic.php?pid=674176#p674176]<br />
<br />
It describes a very simple way on how to use dropbox without nautilus, give me your feedback!<br />
<br />
rent0n</div>Rent0nhttps://wiki.archlinux.org/index.php?title=Talk:Dropbox&diff=88095Talk:Dropbox2009-12-18T21:23:11Z<p>Rent0n: Created page with 'What do you think of adding the procedure explained here? --> [http://bbs.archlinux.org/viewtopic.php?pid=674176#p674176] It describes a very simple way on how to use dropbox w…'</p>
<hr />
<div>What do you think of adding the procedure explained here?<br />
<br />
--> [http://bbs.archlinux.org/viewtopic.php?pid=674176#p674176]<br />
<br />
It describes a very simple way on how to use dropbox without nautilus, give me your feedback!</div>Rent0nhttps://wiki.archlinux.org/index.php?title=Talk:Pacman/Pacnew_and_Pacsave&diff=88094Talk:Pacman/Pacnew and Pacsave2009-12-18T21:17:07Z<p>Rent0n: Created page with 'I never wrote in a wiki, however... I just would like to say that the meld loop script completely screwed up my pacnew files, removing them without comparing them to originals. …'</p>
<hr />
<div>I never wrote in a wiki, however...<br />
<br />
I just would like to say that the meld loop script completely screwed up my pacnew files, removing them without comparing them to originals.<br />
Maybe it's my fault somehow but during the procedure I had lots of meld errors and I think it's better to control and review that part.<br />
<br />
Best wishes, <br />
rent0n</div>Rent0n