https://wiki.archlinux.org/api.php?action=feedcontributions&user=Tonyctl&feedformat=atomArchWiki - User contributions [en]2024-03-29T08:06:59ZUser contributionsMediaWiki 1.41.0https://wiki.archlinux.org/index.php?title=Xephyr&diff=369704Xephyr2015-04-14T21:31:54Z<p>Tonyctl: add startx example</p>
<hr />
<div>[[Category:X Server]]<br />
{{Expansion|Mention how this can be used against keylogging attacks [http://theinvisiblethings.blogspot.be/2011/04/linux-security-circus-on-gui-isolation.html], mention layers like {{Pkg|gdm}}}}<br />
'''Xephyr''' is a nested X server that runs as an X application.<br />
<br />
== Installation ==<br />
<br />
{{Pkg|xorg-server-xephyr}} is available from [[official repositories]]. Install it with [[pacman]].<br />
<br />
== Execution ==<br />
<br />
If you wish to run a nested X window, you'll need to specify a display.<br />
<br />
$ Xephyr -br -ac -noreset -screen 800x600 :1<br />
<br />
This will launch a new Xephyr window with a DISPLAY of ":1". In order to launch an application in that window, you would need to specify that display.<br />
<br />
$ DISPLAY=:1 xterm<br />
<br />
If you want to launch another WM, [[spectrwm]] for example, you would type:<br />
<br />
$ DISPLAY=:1 spectrwm<br />
<br />
You can also launch Xephyr with your [[xinitrc]] using startx:<br />
<br />
$ startx -- /usr/bin/Xephyr :1</div>Tonyctlhttps://wiki.archlinux.org/index.php?title=Openbox&diff=311541Openbox2014-04-23T03:43:04Z<p>Tonyctl: /* Keybinds */ add media player key binding configuration</p>
<hr />
<div>[[Category:Stacking WMs]]<br />
[[cs:Openbox]]<br />
[[de:Openbox]]<br />
[[es:Openbox]]<br />
[[fr:Openbox]]<br />
[[it:Openbox]]<br />
[[ja:Openbox]]<br />
[[ko:Openbox]]<br />
[[lt:Openbox]]<br />
[[nl:Openbox]]<br />
[[pl:Openbox]]<br />
[[ru:Openbox]]<br />
[[sk:Openbox]]<br />
[[sr:Openbox]]<br />
[[tr:Openbox]]<br />
[[zh-CN:Openbox]]<br />
[[zh-TW:Openbox]]<br />
{{Related articles start}}<br />
{{Related|Desktop environment}}<br />
{{Related|Display manager}}<br />
{{Related|File manager functionality}}<br />
{{Related|Window manager}}<br />
{{Related|Oblogout}}<br />
{{Related articles end}}<br />
<br />
Openbox is a lightweight, powerful, and highly configurable ''stacking'' [[Window manager|window manager]] with extensive standards support. It may be built upon and run independently as the basis of a unique [[desktop environment]], or within other integrated desktop environments such as [[KDE]] and [[Xfce]], as an alternative to the window managers they provide. The [[LXDE]] desktop environment is itself built around Openbox.<br />
<br />
A comprehensive list of features are documented at the [http://openbox.org/ official Openbox website]. This article pertains to specifically installing Openbox under Arch Linux.<br />
<br />
== Installation ==<br />
<br />
Install {{Pkg|openbox}}, available in the [[official repositories]].<br />
<br />
== Openbox Sessions ==<br />
<br />
Again, Openbox may be run independently as a standalone window manager, or within other integrated desktop environments such as [[KDE]] and [[XFCE]] as an alternative to the window managers they provide.<br />
<br />
=== Standalone ===<br />
<br />
Many popular [[Display manager|display managers]] such as [[LXDM]], [[SLiM]], and [[LightDM]] will automatically detect Openbox, allowing for it to be run as a standalone session.<br />
<br />
However, it may be necessary to manually specify the command to start an openbox session where intending to set it as a default session for [[SLiM]], or where not using a display manager at all (e.g. logging in at the command line, followed by the command {{ic|startx}}). In either instance, it will be necessary to modify the [[Xinitrc]] file in order to add the following command:<br />
<br />
exec openbox-session<br />
<br />
=== Within other desktop environments ===<br />
<br />
When replacing the native window manager of a desktop environment with Openbox, any desktop compositing effects - such a transparency - provided by that native window manager will be lost. This is because Openbox itself does not provide any compositing functionality. However, it is easily possible to use a separate compositing program to [[Openbox#Compositing effects|re-enable compositing]]. <br />
<br />
==== GNOME ====<br />
<br />
Openbox does not seem to work with [[GNOME|GNOME 3]]. The {{ic|Gnome-Shell}} touch-style interface requires both its native window manager and its native gtk-window-decorator packages to function. Furthermore, attempting to run Openbox within the {{ic|Classic-Gnome-Shell}} interface results in the loss of the {{ic|gnome-panel}}. Ceasing Openbox and attempting to restore the native window manager will result in crashing the desktop. Gnome 3 is tightly integrated, and is therefore deliberately designed not to be modular in nature (i.e. allowing components to be changed).<br />
<br />
==== KDE ====<br />
See the [[KDE#Using Openbox in KDE|using Openbox in KDE]] section of the main [[KDE]] article.<br />
<br />
==== Xfce ====<br />
<br />
See the [[Xfce#Replacing_the_native_window_manager|replacing the native window manager]] section of the main [[Xfce]] article.<br />
<br />
== System configuration==<br />
<br />
Those installing Openbox - particularly as a stand-alone Window Manager - will have noticed that several elements may fail to work properly, or even work at all. Examples of the common problems encountered are:<br />
<br />
* '''File Managers''': Other partitions are not displayed or accessible. The trash function - where provided - does not work <br />
* '''Authentication''': Passwords are not stored / remembered during sessions<br />
* '''Secure Shell (SSH)''': SSH agent will not start<br />
* '''Wireless Connection''': Instant failure when attempting to connect to wifi (related to authentication) <br />
* '''Themes''': Application windows are mismatched or haphazard-looking<br />
* '''Folders''': Expected folders such as {{ic|Documents}}, {{ic|Downloads}} and so forth are missing from the {{ic|Home}} folder<br />
* '''System Tray''': Installed packages fail to autostart or can be seen running twice<br />
<br />
Most of these problems are actually the result of [[Dbus]] and [[GTK]] issues, both of which can be fixed simultaneously by editing the [[xprofile|~/.xprofile]] file - or if using [[SLiM]] as a [[display manager]] instead - by editing the [[xinitrc|~/.xinitrc]] file. It will also be necessary to install some key packages to ensure full functionality.<br />
<br />
=== D-Bus ===<br />
<br />
File manager, authentication, SSH agent, and WiFi-connection problems will likely be due to that [[D-Bus]] is not functioning correctly. Most [[display manager]]s such as [[GDM]], [[KDM]], [[LightDM]] and [[LXDM]] will handle this for you.<br />
<br />
When using [[xinit]] or certain other DMs (such as [[XDM]] and [[SLiM]]), make sure {{ic|~/.xinitrc}} is based on {{ic|/etc/skel/.xinitrc}} (so that it sources {{ic|/etc/X11/xinit/xinitrc.d/}}, see [[xinitrc]] for more information).<br />
<br />
=== GTK+ 2 ===<br />
<br />
Problems with the theme and look will likely be due to the absence of the appropriate command to ensure that a uniform look must be applied to applications that use GTK 2. Again, edit {{ic|~/.xinitrc}} and/or {{ic|~/.xprofile}} with the following command:<br />
<br />
export GTK2_RC_FILES="$HOME/.gtkrc-2.0" <br />
<br />
The {{ic|~/.gtkrc-2.0}} file will be automatically generated where using [[LXDE|lxappearance]] to set themes.<br />
<br />
It will also be necessary to install {{Pkg|libgnomeui}} to ensure that [[Qt]] is also able to find GTK themes.<br />
<br />
See [[GTK+#GTK+ 2.x]] for an introduction to manually editing {{ic|~/.gtkrc-2.0}}.<br />
<br />
=== XDG ===<br />
<br />
In addition to sourcing the '''local''' {{ic|~/.config/openbox/autostart}} file to autostart applications, Openbox will also source {{ic|.desktop}} files automatically installed by some packages in the '''global''' {{ic|/etc/xdg/autostart}} directory. The package responsible for allowing Openbox to additionally source the {{ic|/etc/xdg/autostart}} directory is {{Pkg|python2-xdg}}. <br />
<br />
For example, where initially autostarting a package such as the [[NetworkManager|Network Manager]] applet ('''nm-applet''') locally, should {{Pkg|python2-xdg}} be installed at a later time - either explicitly or as a dependency for another package - its global XDG {{ic|.desktop}} file will then also be sourced as a consequence, resulting in seeing two icons running in the system tray. It is therefore recommended to install {{Pkg|python2-xdg}} explicitly, as this will ensure that applications that should automatically autostart when installed will do so.<br />
<br />
=== Home folders ===<br />
<br />
{{Tip|This fix will be especially helpful for those who wish to use a file manager to manage their desktop, as it will automatically create a special {{ic|~/Desktop}} directory, which will house all files and application shortcuts stored on the desktop itself.}}<br />
<br />
Where expected {{ic|Home}} folders such as {{ic|Downloads}}, {{ic|Documents}}, etc., are not present, then please review the [[Xdg user directories]] article.<br />
<br />
=== Authentication and passwords ===<br />
<br />
For authentication (e.g. WiFi passwords, etc.), it will be necessary to install the appropriate packages. They are:<br />
<br />
* {{Pkg|polkit}}: Application development toolkit for controlling system-wide privileges; see [[polkit]]<br />
* {{Pkg|lxpolkit}}: Simple policykit authentication agent for LXDE ({{Pkg|polkit-gnome}} currently does not work properly)<br />
* {{Pkg|gnome-keyring}}: store / remember passwords; see [[GNOME Keyring]]<br />
<br />
== Configuration ==<br />
<br />
{{Warning|Edit these files as the user you will be using Openbox with. Not as root!}}<br />
{{Tip|Local configuration files will always override global equivalents. These files may also be manually edited by any appropriate text editor, such as Leafpad or Geany; there is no need to use [[sudo]] or '''gksu''' commands to edit them.}}<br />
<br />
Four key files form the basis of the openbox configuration, each serving a unique role. They are: {{ic|rc.xml}}, {{ic|menu.xml}}, {{ic|autostart}}, and {{ic|environment}}. Although these files are discussed in more detail below, to start configuring Openbox, it will first be necessary to create a '''local''' Openbox profile (i.e for your specific user account) based on them. This can be done by copying them from the '''global''' {{ic|/etc/xdg/openbox}} profile (applicable to any and all users) as a template:<br />
<br />
$ mkdir -p ~/.config/openbox<br />
$ cp -R /etc/xdg/openbox/* ~/.config/openbox<br />
<br />
=== rc.xml ===<br />
<br />
{{Tip|Custom keyboard shortcuts (keybindings) must be added to the {{ic|<keyboard>}} section of this file, and underneath the {{ic|<nowiki><!-- Keybindings for running aplications --></nowiki>}} heading.}}<br />
<br />
{{ic|~/.config/openbox/rc.xml}} is the main configuration file, responsible for determining the behaviour and settings of the overall session, including:<br />
<br />
* Keyboard shortcuts (e.g. starting applications; controlling the volume)<br />
* Theming<br />
* Desktop and Virtual desktop settings, and<br />
* Application Window settings<br />
<br />
This file is also pre-configured, meaning that it will only be necessary to amend existing content in order to customise behaviour to suit personal preference.<br />
<br />
=== menu.xml ===<br />
<br />
{{ic|~/.config/openbox/menu.xml}} defines the type and behaviour of the desktop menu, accessable by right-clicking the background. Although the default provided is a '''static menu''' (meaning that it will not automatically update when new applications are installed), it is possible to employ the use of '''dynamic menus''' that will automatically update as well. <br />
<br />
The available options are discussed extensively below in the [[Openbox#Menus|Menus]] section.<br />
<br />
=== autostart ===<br />
<br />
{{Tip|Be aware that some applications will automatically start via {{ic|.desktop}} files installed in the {{ic|/etc/xdg/autostart/}} or {{ic|~/.config/autostart/}} directories.}}<br />
<br />
{{ic|~/.config/openbox/autostart}} determines which applications are to be launched upon beginning the Openbox session. These may include:<br />
<br />
* Panels and/or docks<br />
* Compositors<br />
* Background providers<br />
* Screensavers<br />
* Applications to autoload or autostart (e.g. [[Conky]])<br />
* [[Daemon]] processes (e.g. File Managers for automounting and other functions)<br />
* Other appropriate commands (e.g. disable [[DPMS]])<br />
<br />
==== Listing commands ====<br />
<br />
There are two very important points to note when adding commands to the {{ic|~/.config/openbox/autostart}} file:<br />
<br />
* Each and every command '''must''' be terminated with an ampersand ({{ic|&}}). Where a command does not end with an ampersand, then no further commands listed below it will be executed.<br />
* It is strongly recommended to add delays to the execution of some or all commands in the autostart file, even if only by a single second. The consequence of not doing so is that all commands will be executed simultaneously, potentially resulting in the mis- or non-starting of items. The syntax of the command to delay the execution of commands (in seconds) is:<br />
<br />
(sleep <number of seconds>s && <command>) &<br />
<br />
For example, to delay the execution of [[Conky]] by 3 seconds, the command would be (and note the termination of it with an ampersand):<br />
<br />
(sleep 3s && conky) &<br />
<br />
Here is a more complete example of a possible {{ic|~/.config/openbox/autostart}} file:<br />
<br />
## Autostart File ##<br />
<br />
##Disable DPMS<br />
xset -dpms; xset s off &<br />
<br />
##Compositor<br />
compton -CGb &<br />
<br />
##Background<br />
(sleep 1s && nitrogen --restore) &<br />
<br />
##tint2 panel<br />
(sleep 1s && tint2) &<br />
<br />
##Sound Icon<br />
(sleep 1s && volumeicon) &<br />
<br />
##Screensaver<br />
(sleep 1s && xscreensaver -no-splash) &<br />
<br />
##Conky<br />
(sleep 3s && conky) &<br />
<br />
##Disable touchpad<br />
/user/bin/synclient TouchpadOff=1 &<br />
<br />
=== environment ===<br />
<br />
{{Note|This is the least important file, and many users may not need to edit it at all.}}<br />
<br />
{{ic|~/.config/openbox/environment}} can be used to export and set relevant environmental variables such as to:<br />
<br />
* Define new pathways (e.g. execute commands that would otherwise require the entire pathway to be listed with them)<br />
* Change language settings, and<br />
* Define other variables to be used (e.g. the fix for GTK theming could be listed here)<br />
<br />
=== Optional GUI configuration packages ===<br />
<br />
Several GUIs are available to quickly and easily configure your Openbox desktop. From the official repositories these include:<br />
<br />
* {{Pkg|obconf}}: Basic Openbox configuration manager<br />
* {{Pkg|lxappearance-obconf}}: LXDE configuration manager (provides additional options)<br />
* {{Pkg|lxinput}}: LXDE keyboard and mouse configuration<br />
* {{Pkg|lxrandr}}: LXDE monitor configuration<br />
<br />
Others, such as {{AUR|obkey}} (configure keyboard shortcuts via the {{ic|rc.xml}} file) and {{AUR|ob-autostart}} (configure the Openbox {{ic|autostart}} file) are available from the [[AUR]]. Programs and applications relating to the configuration of Openbox's desktop menu are discussed in the [[Openbox#Menus|Menus]] section.<br />
<br />
== Openbox reconfiguration ==<br />
<br />
{{Tip|where not already present, it would be worthwhile adding this command to a menu and/or as a keybind for convenience.}}<br />
<br />
Openbox will not always automatically reflect any changes made to its configuration files within a session. As a consequence, it will be necessary to manually reload those files after they have been edited. To do so, enter the following command:<br />
<br />
$ openbox --reconfigure<br />
<br />
Where intending to add this command as a keybinnd to {{ic|~/.config/openbox/rc.xml}}, it will only be necessary to list the command as {{ic|reconfigure}}. An example has been provided below, using the {{ic|Super}}+{{ic|F11}} keybind:<br />
<br />
<keybind key="W-F11"><br />
<action name="Reconfigure"/><br />
</keybind><br />
<br />
== Keybinds ==<br />
<br />
All keybinds must be added to the {{ic|~/.config/openbox/rc.xml}} file, and below the {{ic|<nowiki><!-- Keybindings for running aplications --></nowiki>}} heading. Although a brief overview has been provided here, a more in-depth explanation of keybindings can be found at [http://openbox.org/wiki/Help:Bindings openbox.org]. There is a utility 'obkey' in AUR for adjust key-binding. Before use obkey, you should use obconf to create {{ic|~/.config/openbox/rc.xml}}.<br />
<br />
=== Special keys ===<br />
<br />
While the use of standard alpha-numeric keys for keybindings is self-explanatory, special names are assigned to other types of keys, such as {{ic|modifers}}, {{ic|multimedia}} keys and {{ic|navigation}} keys.<br />
<br />
==== Modifiers ====<br />
<br />
{{ic|Modifer}} keys play an important role in keybindings (e.g. holding down the {{ic|shift}} or {{ic|CTRL / control}} key in combination with another key to undertake an action). Using modifers helps to prevent conflicting keybinds, whereby two or more actions are linked to the same key or combination of keys. The syntax to use a modifer with another key is:<br />
<br />
"<modifier>-<key>"<br />
<br />
The modifer codes are as follows:<br />
<br />
* {{ic|S}}: Shift<br />
* {{ic|C}}: Control / CTRL<br />
* {{ic|A}}: Alt<br />
* {{ic|W}}: Super / Windows<br />
* {{ic|M}}: Meta<br />
* {{ic|H}}: Hyper (If it is bound to something) <br />
<br />
For example, the code below would use {{ic|super}} and {{ic|t}} to launch {{Pkg|lxterminal}}<br />
<br />
<keybind key="W-t"><br />
<action name="Execute"><br />
<command>lxterminal</command><br />
</action><br />
</keybind><br />
<br />
==== Multimedia keys ====<br />
<br />
Where available, it is possible to set the appropriate {{ic|multimedia}} keys to perform their intended functions, such as to control the volume and/or the screen brightness. These will usually be integrated into the {{ic|function}} keys, and are identified by their appropriate symbols. See the [[Multimedia Keys]] article for further information.<br />
<br />
The volume and brightness multimedia codes are as follows (note that commands will still have to be assigned to them to actually function):<br />
<br />
* {{ic|XF86AudioRaiseVolume}}: Increase volume<br />
* {{ic|XF86AudioLowerVolume}}: Decrease volume<br />
* {{ic|XF86AudioMute}}: Mute / unmute volume<br />
* {{ic|XF86MonBrightnessUp}}: Increase screen brightess<br />
* {{ic|XF86MonBrightnessDown}}: Decrease screen brightness<br />
<br />
Examples of how these may be used in {{ic|~/.config/openbox/rc.xml}} have been provided below.<br />
<br />
==== Navigation keys ====<br />
<br />
These are the directional / arrow keys, usually used to move the cursor up, down, left, or right. The (self-explanatory) navigation codes are as follows:<br />
<br />
* {{ic|Up}}: Up<br />
* {{ic|Down}}: Down<br />
* {{ic|Left}}: Left<br />
* {{ic|Right}}: Right<br />
<br />
=== Volume Control ===<br />
<br />
What commands should be used for controlling the volume will depend on whether [[ALSA]], [[PulseAudio]], or [[OSS]] is used for sound.<br />
<br />
==== ALSA ====<br />
<br />
If [[ALSA]] is used for sound, the {{ic|amixer}} program can be used to adjust the volume, which is part of the {{Pkg|alsa-utils}} package. The following example - using the {{ic|multimedia}} keys intended to control the volume - will adjust the volume by +/- 5% (which may be changed, as desired):<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 />
==== Pulseaudio ====<br />
<br />
Where using [[PulseAudio]] with [[ALSA]] as a backend, the {{ic|amixer}} program commands will have to be modifed, as illustrated below in comparison to the ALSA example:<br />
<br />
<keybind key="XF86AudioRaiseVolume"><br />
<action name="Execute"><br />
<command>amixer -D pulse set Master 5%+ unmute</command><br />
</action><br />
</keybind><br />
<keybind key="XF86AudioLowerVolume"><br />
<action name="Execute"><br />
<command>amixer -D pulse 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 />
==== OSS ====<br />
<br />
{{Note|This option may be suitable for more experienced users.}}<br />
<br />
Where using [[OSS]], it is possible to create keybindings to raise or lower specific mixers. This allows, for example, the volume of a specific application (such as an audio player) to be changed without changing the overall system volume settings in turn. In this instance, the application must first have been [[OSS#Configuring_Applications_for_OSS|configured]] to use its own mixer. <br />
<br />
In the following example, [[MPD]] has been configured to use its own mixer - also named {{ic|mpd}} - to increase and decrease the volume by a single decibel at a time. The {{ic|--}} that appears after the {{ic|ossmix}} command has been added to prevent a negative value from being treated as an argument: <br />
<br />
<keybind key="[chosen keybind]"><br />
<action name="Execute"><br />
<command>ossmix -- mpd +1</command><br />
</action><br />
</keybind><br />
<keybind key="[chosen keybind]"><br />
<action name="Execute"><br />
<command>ossmix -- mpd -1</command><br />
</action><br />
</keybind><br />
<br />
=== Media player control ===<br />
<br />
The {{AUR|playerctl}} command-line utility can be used to bind multimedia keys to player actions. It should work with most media players.<br />
<br />
<keybind key="XF86AudioPlay"><br />
<action name="Execute"><br />
<command>playerctl play</command><br />
</action><br />
</keybind><br />
<keybind key="XF86AudioPause"><br />
<action name="Execute"><br />
<command>playerctl pause</command><br />
</action><br />
</keybind><br />
<keybind key="XF86AudioNext"><br />
<action name="Execute"><br />
<command>playerctl next</command><br />
</action><br />
</keybind><br />
<keybind key="XF86AudioPrev"><br />
<action name="Execute"><br />
<command>playerctl previous</command><br />
</action><br />
</keybind><br />
<br />
=== Brightness control ===<br />
<br />
The {{ic|xbacklight}} program is used to control screen brightness, which is part of the [[Xorg]] X-Window system. In the example below, the {{ic|multimedia}} keys intended to control the screen brightness will adjust the settings by +/- 10%:<br />
<br />
<keybind key="XF86MonBrightnessUp"><br />
<action name="Execute"><br />
<command>xbacklight +10</command><br />
</action><br />
</keybind><br />
<keybind key="XF86MonBrightnessDown"><br />
<action name="Execute"><br />
<command>xbacklight -10</command><br />
</action><br />
</keybind><br />
<br />
=== Window snapping ===<br />
<br />
Many desktop environments and window managers support ''window snapping'' (e.g. Windows 7 Aero snap), whereby they will automatically snap into place when moved to the edge of the screen. This effect can also be simulated in Openbox through the use of keybinds on focused windows. <br />
<br />
As illustrated in the example below, percentages must be used to determine window sizes (see [http://openbox.org/wiki/Help:Actions openbox.org] for further information). In this instance, The {{ic|super}} key is used in conjunction with the {{ic|navigation}} keys:<br />
<br />
<keybind key="W-Left"><br />
<action name="UnmaximizeFull"/><br />
<action name="MaximizeVert"/><br />
<action name="MoveResizeTo"><br />
<width>50%</width><br />
</action><br />
<action name="MoveToEdge"><direction>west</direction></action><br />
</keybind><br />
<keybind key="W-Right"><br />
<action name="UnmaximizeFull"/><br />
<action name="MaximizeVert"/><br />
<action name="MoveResizeTo"><br />
<width>50%</width><br />
</action><br />
<action name="MoveToEdge"><direction>east</direction></action><br />
</keybind><br />
<br />
However, it should be noted that once a window has been 'snapped' to an edge, it will remain vertically maximised unless subsequently maximised and then restored. The solution is to implement additional keybinds - in this instance using the {{ic|down}} and {{ic|up}} keys - to do so. This will also make pulling 'snapped' windows from screen edges faster as well:<br />
<br />
<keybind key="W-Down"><br />
<action name="Unmaximize"/><br />
</keybind><br />
<keybind key="W-Up"><br />
<action name="Maximize"/><br />
</keybind><br />
<br />
This [http://ubuntuforums.org/showthread.php?t=1796793 Ubuntu forum thread] provides more information. Applications such as {{AUR|opensnap-git}} are also available from the AUR to automatically simulate window snapping behaviour without the use of keybinds.<br />
<br />
=== Desktop menu ===<br />
<br />
It is also possible to create a keybind to access the desktop menu. For example, the following code will bring up the menu by pressing {{ic|CTRL}} + {{ic|m}}:<br />
<br />
<keybind key="C-m"><br />
<action name="ShowMenu"><br />
<menu>root-menu</menu><br />
</action><br />
</keybind><br />
<br />
== Menus ==<br />
<br />
It is possible to employ three types of menu in Openbox: {{ic|static}}, {{ic|pipes}} (dynamic), and {{ic|generators}} (static or dynamic). They may also be used alone or in any combination.<br />
<br />
=== Static ===<br />
<br />
As the name would suggest, this default type of menu does not change in any way, and may be manually edited and/or (re)generated automatically through the use on an appropriate software package.<br />
<br />
Fast and efficient, while this type of menu can be used to select applications, it can also be useful to access specific functions and/or perform specific tasks (e.g. desktop configuration), leaving the access of applications to another process (e.g. the {{Pkg|synapse}} or {{Pkg|xfce4-appfinder}} applications).<br />
<br />
The {{ic|~/.config/openbox/menu.xml}} file will be the sole source of static desktop menu content.<br />
<br />
==== menumaker ====<br />
<br />
{{Warning|A root terminal '''must''' be installed in order to use MenuMaker, even though a standard user terminal may be used to run it. {{Pkg|xterm}} is a good choice.}}<br />
<br />
{{Pkg|menumaker}} automatically generates {{ic|xml}} menus for several window managers, including Openbox, [[Fluxbox]], [[IceWM]] and [[XFCE]]. It will search for all installed executable programs and consequently create a menu file for them. It is also possible to configure MenuMaker to exclude certain application types (e.g. relating to [[Gnome]] or [[KDE]]), if desired.<br />
<br />
Once installed and executed, it will automatically generate a new {{ic|~/.config/openbox/menu.xml}} file. To avoid overwriting an existing file, enter:<br />
<br />
$ mmaker -v OpenBox3<br />
<br />
Otherwise, to overwrite an existing file, add the {{ic|force}} argument ({{ic|f}}):<br />
<br />
$ mmaker -vf OpenBox3<br />
<br />
Once a new {{ic|~/.config/openbox/menu.xml}} file has been generated it may then be manually edited, or configured using a GUI menu editor, such as {{Pkg|obmenu}}.<br />
<br />
==== obmenu ====<br />
<br />
{{Warning|{{ic|obm-xdg}} - a pipe menu to generate a list of [[GTK+]] and [[Gnome]] applications - is also provided with obmenu. However, it has long-running bugs whereby it may produce an invalid output, or even not function at all. Consequently it has been omitted from discussion.}}<br />
<br />
{{Pkg|obmenu}} is a "user-friendly" GUI application to edit {{ic|~/.config/openbox/menu.xml}}, without the need to code in {{ic|xml}}.<br />
<br />
==== xdg-menu ====<br />
<br />
{{Pkg|archlinux-xdg-menu}} will automatically generate a menu based on {{ic|xdg}} files contained within the {{ic|/etc/xdg/}} directory for numerous Window Managers, including Openbox. Review the [[Xdg-menu#OpenBox]] article for further information.<br />
<br />
==== logout menu options ====<br />
<br />
{{Tip|The commands provided can also be attached to [[Openbox#Keybinds|keybinds]].}}<br />
<br />
The {{ic|~/.config/openbox/menu.xml}} file can be edited in order to provide a sub-menu with the same options as provided by [[Openbox#oblogout|oblogout]]. The sample script below will provide all of these options, with the exception of the ability to lock the screen:<br />
<br />
<menu id="exit-menu" label="Exit"><br />
<item label="Log Out"><br />
<action name="Execute"><br />
<command>openbox --exit</command><br />
</action><br />
</item><br />
<item label="Shutdown"><br />
<action name="Execute"><br />
<command>systemctl poweroff</command><br />
</action><br />
</item><br />
<item label="Restart"><br />
<action name="Execute"><br />
<command>systemctl reboot</command><br />
</action><br />
</item><br />
<item label="Suspend"><br />
<action name="Execute"><br />
<command>systemctl suspend</command><br />
</action><br />
</item><br />
<item label="Hibernate"><br />
<action name="Execute"><br />
<command>systemctl hibernate</command><br />
</action><br />
</item><br />
</menu><br />
<br />
Once the entries have been composed, add the following line to present the sub-menu where desired within the main desktop menu (usually as the last entry):<br />
<br />
<menu id="exit-menu"/><br />
<br />
=== Pipes ===<br />
<br />
{{Tip|It is entirely feasible for a static menu to contain one or more pipe sub-menus. The functionality of some pipe menus may also rely on the installation of relevant software packages.}}<br />
<br />
This type of menu is in essence a script that provides dynamic, refreshed lists on-the-fly as and when run. These lists may be used for multiple purposes, including to list applications, to provide information, and to provide control functions. Pre-configured pipe menus can be installed, although not from the [[official repositories]]. More experienced users can also modify and/or create their own custom scripts. Again, {{ic|~/.config/openbox/menu.xml}} may and commonly will contain several pipe menus.<br />
<br />
==== Examples ====<br />
<br />
* {{AUR|openbox-xdgmenu}}: fast xdg-menu converter to xml-pipe-menu<br />
* {{AUR|obfilebrowser}}: Application and file browser<br />
* {{AUR|obdevicemenu}}: Management of removable media with [[Udisks#Udisks|Udisks]]<br />
* [https://bbs.archlinux.org/viewtopic.php?pid=1345031 wifi pipe menu]: Wireless networking using [[Netctl]]<br />
<br />
[http://openbox.org/download-pipemenus.php Openbox.org] also provides a further list of pipe menus.<br />
<br />
=== Generators ===<br />
<br />
This type of menu is akin to those provided by the taskbars of desktop environments such as [[XFCE]] or [[LXDE]]. Automatically updating on-the-fly, this type of menu can be powerful and very convenient. It may also be possible to add custom categories and menu entries; read the documentation for your intended dynamic menu to determine if and how this can be done.<br />
<br />
A menu generator will have to be executed from the {{ic|~/.config/openbox/menu.xml}} file.<br />
<br />
==== obmenu-generator ====<br />
<br />
{{Tip|icons can still be disabled in {{AUR|obmenu-generator}}, even where enabled in {{ic|~/.config/openbox/rc.xml}}.}}<br />
<br />
{{AUR|obmenu-generator}} is currently only available from the [[AUR]], although it is still highly recommended. With the ability to be used as a static or dynamic menu, it is highly configurable, powerful, and versatile. Menu categories and individual entries may also be easily hidden, customised, and/or added with ease. The [http://trizenx.blogspot.co.uk/2012/02/obmenu-generator.html official homepage] provides further information and screenshots.<br />
<br />
Below is an example of how obmenu-generator would be dynamically executed without icons in {{ic|~/.config/openbox/menu.xml}}:<br />
<br />
<?xml version="1.0" encoding="utf-8"?><br />
<openbox_menu><br />
<menu id="root-menu" label="OpenBox 3" execute="/usr/bin/obmenu-generator"><br />
</menu><br />
</openbox_menu><br />
<br />
To automatically iconify entries, the {{ic|-i}} option would be added:<br />
<br />
<menu id="root-menu" label="OpenBox 3" execute="/usr/bin/obmenu-generator -i"><br />
<br />
==== openbox-menu ====<br />
<br />
{{Tip|If this menu produces an error, it may be solved by enabling icons in {{ic|~/.config/openbox/rc.xml}}.}}<br />
<br />
{{AUR|openbox-menu}} uses the [[LXDE]] [http://sourceforge.net/projects/lxde/files/menu-cache/ menu-cache] to create dynamic menus. The [http://mimasgpc.free.fr/openbox-menu_en.html official homepage] provides further information and screenshots.<br />
<br />
==== obmenugen ==== <br />
<br />
{{AUR|Obmenugen}} is currently only available from the [[AUR]], and can be used to a generate static or dynamic application menu based on {{ic|.desktop}} files. The [http://obmenugen.sourceforge.net/ official homepage] provides further information.<br />
<br />
=== Menu icons ===<br />
<br />
To show icons next to menu entries, it will be necessary to ensure they are enabled in the {{ic|<menu>}} section of the {{ic|~/.config/openbox/rc.xml}} file:<br />
<br />
<applicationIcons>yes</applicationIcons><br />
<br />
Where using a static menu, it will then be necessary to edit the {{ic|~/.config/openbox/menu.xml}} file to provide both the {{ic|icon <nowiki>=</nowiki>}} command, along with the full path and icon name for each entry. An example of the syntax used to provide an icon for a category is:<br />
<br />
<menu id="apps-menu" label="[label name]" icon="[pathway to icon]/[icon name]"><br />
<br />
=== Desktop menu as a panel menu ===<br />
<br />
{{Tip|XDoTool can simulate any keybind for any action, and as such, it may therefore be used for many other purposes...}}<br />
<br />
{{Pkg|xdotool}} is a package that can issue commands to simulate key presses / keybinds, meaning that it is possible to use it to invoke keybind-related actions without having to actually press their assigned keys. As this includes the ability to invoke an assigned keybind for the Openbox desktop menu, it is therefore possible to use XDoTool to turn the Openbox desktop menu into a panel menu. Especially where the desktop menu is heavily customised and feature-rich, this may prove very useful to:<br />
<br />
* Replace an existing panel menu<br />
* Implement a panel menu where otherwise not provided or possible (e.g. for {{AUR|tint2-svn}})<br />
* Compensate where losing access to the desktop menu due to the use of an application like [[Openbox#xfdesktop|xfdesktop]] to [[Openbox#Desktop_Icons_and_Wallpapers|manage the desktop]].<br />
<br />
Once XDoTool has been installed - if not already present - it will be necessary to create a keybind to access the root menu in {{ic|~/.config/openbox/rc.xml}}, and again below the {{ic|<nowiki><</nowiki>!-- Keybindings for running aplications --<nowiki>></nowiki>}} heading. For example, the following code will bring up the menu by pressing {{ic|CTRL}} + {{ic|m}}:<br />
<br />
<keybind key="C-m"><br />
<action name="ShowMenu"><br />
<menu>root-menu</menu><br />
</action><br />
</keybind><br />
<br />
Openbox must then be [[Openbox#Openbox_Reconfiguration|re-configured]]. In this instance, XDoTool will be used to simulate the {{ic|CTRL}} + {{ic|m}} keypress to access the desktop menu with the following command (note the use of {{ic|+}} in place of {{ic|-}}):<br />
<br />
xdotool key control+m<br />
<br />
How this command may be used as a panel launcher / icon is largely dependent on the features of panel used. While some panels will allow the above command to be executed directly in the process of creating a new launcher, others may require the use of an executable script. As an example, a custom executable script called {{ic|obpanelmenu.sh}} will be created in the {{ic|~/.config}} folder:<br />
<br />
$ ''text editor'' ~/.config/obpanelmenu.sh<br />
<br />
Once the empty file has been opened, the appropriate XDoTool command must be added to the empty file (i.e. to simulate the {{ic|CTRL}} + {{ic|m}} keypress for this example):<br />
<br />
xdotool key control+m<br />
<br />
After the file has been saved and closed, it may then be made into an executable script with the following command:<br />
<br />
$ chmod +x ~/.config/obpanelmenu.sh<br />
<br />
Executing it will bring up the Openbox desktop menu. Consequently, where using a panel that supports drag-and-drop functionality to add new launchers, simply drag the executable script onto it before changing the icon to suit personal taste. For instructions on how to use this executable script with {{AUR|tint2-svn}} - a derivative of the popular {{Pkg|tint2}} panel that allows launchers to be added - see [[Tint2#Application_Launchers_in_tint2-svn_.28AUR.29|Tint2-Svn launchers]].<br />
<br />
== GTK+ desktop theming ==<br />
<br />
{{Tip|It is '''strongly advised''' to install the {{Pkg|obconf}} and {{Pkg|lxappearance-obconf}} GUI applications to configure visual settings and theming. The latter is particularly important as it is responsible for generating the {{ic|~/.gtkrc-2.0}} file (see the [[Openbox#GTK+ 2|GTK fix]] section).}}<br />
<br />
It is important to note that a substantial range of both '''Openbox-specific''' and generalised, '''Openbox-compatible''' [[GTK]] themes are available to change the look of window decorations and the desktop menu. ''Generalised'' themes are designed to be simultaneously compatible with a range of popular desktop environments and/or window managers, commonly including Openbox. For example, {{AUR|gtk-theme-numix-blue}} supports both Openbox and [[XFCE]].<br />
<br />
=== Configuration ===<br />
<br />
{{Pkg|obconf}} and/or {{Pkg|lxappearance-obconf}} should be used to select and configure available GTK themes. See [[Uniform Look for Qt and GTK Applications]] for information about theming Qt based applications like [[Virtualbox]] or [[Skype]].<br />
<br />
=== Installation: official and AUR ===<br />
<br />
A good selection of {{Pkg|openbox-themes}} are available from the official repositories.<br />
<br />
Both Openbox-specific and Openbox-compatible themes installed from the [[Official_repositories|official repositories]] and/or the [[AUR]] will be automatically installed to the {{ic|/usr/share/themes}} directory. Both will also be immediately available for selection.<br />
<br />
=== Installation: other sources ===<br />
<br />
[http://www.box-look.org/index.php?xcontentmode=7402 box-look.org] is an excellent and well-established source of themes. [http://www.deviantart.com/ deviantART.com] is another excellent resource. Many more can be found through the utilisation of a search engine.<br />
<br />
==== Zip and tar files ====<br />
<br />
Themes downloaded from other sources such as [http://box-look.org/ box-look.org] will usually be compressed in a {{ic|.tar.gz}} or {{ic|.zip}} format. Although [[tar]] will have been installed as part of the base arch installation to extract {{ic|.tar.gz}} files, it will be necessary to install a program such as {{Pkg|unzip}} to extract {{ic|.zip}} files in the terminal. user-friendly GUI archivers are also available; see [[List of applications#Compression_tools]] for further information.<br />
<br />
Extracted theme files should also be placed in the {{ic|/usr/share/themes}} directory. For example, assuming downloaded content is automatically stored in the {{ic|~/Downloads}} folder, to simultaneously extract and move a {{ic|.tar.gz}} theme file, the syntax of the command would be:<br />
<br />
# tar xvf ~/Downloads/<theme file name>.tar.gz -C /usr/share/themes/<br />
<br />
To use {{Pkg|unzip}} in the same scenario for a {{ic|.zip}} theme file, the syntax of the command would be:<br />
<br />
# unzip ~/Downloads/<theme file name>.zip -d /usr/share/themes/<br />
<br />
Alternatively, it is also possible to simply move / copy and paste the extracted files to the {{ic|/usr/share/themes}} directory using an installed file manager as '''root'''.<br />
<br />
=== Troubleshooting ===<br />
<br />
There are two particular problems that may be encountered on rare occasions, especially where downloading themes from unsupported websites. These have been addressed below.<br />
<br />
==== Theme cannot be used ====<br />
<br />
If for any reason the newly extracted theme cannot be selected, open the theme directory to first ensure that it is indeed compatible with Openbox by determining that an {{ic|openbox-3}} directory is present, and that within this directory a {{ic|themerc}} file is also present. An {{ic|.obt}} ('''O'''pen'''B'''ox '''T'''heme) file may also be present in some instances, which can then be manually loaded in {{Pkg|obconf}}.<br />
<br />
Where expected files and directories are present and correct, then on occasion it is possible that the theme author has not correctly set permission to access the file (e.g. permission may still be for the account of the author, rather than for '''root'''). To eliminate this possibility, ensure the folder and file permissions are for '''root''':<br />
<br />
# chown -R root /user/share/themes<br />
<br />
==== Theme looks broken ====<br />
<br />
Of course, the first line of enquiry would be to check that it is not just a badly made, broken theme! Otherwise, ensure that the [[Openbox#GTK+ 2|Openbox GTK fix]] has been implemented, and then re-start the session. Unfortunately some older themes can simply break if not maintained sufficiently to keep pace with the changes incurred by [[GTK]] updates. To avoid such occurrences, it is best to check that desired themes have recently been created or at least updated / patched.<br />
<br />
=== Edit or create new themes ===<br />
<br />
{{Tip|Where deciding to modify an existing theme (e.g. the colour scheme), it would be best to work on a copy of it, rather than the original. This will retain the original should anything go wrong, and ensure that your changes are not over-written through an update.}}<br />
<br />
The process of creating new or modifying existing themes is covered extensively at the official [http://openbox.org/wiki/Help:Themes openbox.org] website. A user-friendly GUI to do so - {{AUR|obtheme}} - is also available from the [[AUR]].<br />
<br />
== Compositing effects ==<br />
<br />
Openbox does not natively provide support for compositing, and it will therefore be necessary to install a compositor for this purpose. The use of compositing enables various desktop visual effects, including transparency, fading, and shadows. Although compositing is not a necessary component, it can help to provide a more pleasant-looking environment, and avoid common issues such as screen distortion when [[Openbox#Oblogout|oblogout]] is used, and visual glitches when terminal window transparency has been enabled. Three of the most common choices are:<br />
<br />
* [[Compton]]: Powerful and reliable, with extensive options<br />
* [[Xcompmgr]]: Older and simpler version of compton<br />
* [[Cairo Compmgr]]: Advanced compositing effects, plugin support, and a user-friendly GUI. Also more buggy and far heavier use of system resources.<br />
<br />
== Mouse cursor and application icon themes ==<br />
<br />
Any mouse cursor and/or application icon theme may be used with Openbox. Numerous themes are available from both the [[official repositories]] and the [[AUR]].<br />
<br />
=== xcursor themes (mouse) === <br />
<br />
{{Tip|Review the [[Xcursor]] article for an in-depth explanation.}}<br />
<br />
Standard xcursor theme packages available from the official repositories include {{Pkg|xcursor-themes}}, {{Pkg|xcursor-bluecurve}}, {{Pkg|xcursor-vanilla-dmz}}, and {{Pkg|xcursor-pinux}}. To search the official repositories for all available xcursor themes, enter the following command:<br />
<br />
$ pacman -Ss xcursor<br />
<br />
Installed x-cursor themes may then be set though using the {{Pkg|obconf}} and {{Pkg|lxappearance-obconf}} GUI applications. It may then be necessary to either log out and back in again to implement the change, or to [[Openbox#Openbox_Reconfiguration|reconfigure Openbox]].<br />
<br />
=== Application icon themes ===<br />
<br />
Standard xcursor theme packages available from the official repositories include the {{Pkg|gnome-icon-theme}} and {{Pkg|lxde-icon-theme}}. A nice icon theme currently available from the AUR is {{AUR|numix-icon-theme-git}}. To search the official repositories for all available icon themes, enter the following command:<br />
<br />
$ pacman -Ss icon-theme<br />
<br />
Again, installed icon themes may then be set though using the {{Pkg|obconf}} and {{Pkg|lxappearance-obconf}} GUI applications. It may then be necessary to either log out and back in again to implement the change, or to [[Openbox#Openbox_Reconfiguration|reconfigure Openbox]].<br />
<br />
== Desktop icons and wallpapers ==<br />
<br />
Openbox does not natively support the use of desktop icons or wallpapers. As a consequence, it will be necessary to install additional applications for this purpose, where desired.<br />
<br />
=== Desktop management using file managers ===<br />
<br />
Some file managers have the capacity to fully '''manage the desktop''', meaning that they may be used to provide wallpapers and enable the use of icons on the desktop. The [[LXDE]] desktop environment itself uses PCManFM for this purpose.<br />
<br />
* [[PCManFM]]: See the [[PCManFM#Desktop_management|PCManFM desktop management]] article.<br />
* [[SpaceFM]]: See the [[SpaceFM#Desktop_management|SpaceFM desktop management]] article.<br />
<br />
=== Wallpaper / background programs ===<br />
<br />
{{Tip|The wallpaper programs listed here will have many more options than shown in this brief overview, including the ability to use solid colours for backgrounds. Review their documentation and man pages for more information.}}<br />
<br />
There are numerous packages available to set desktop backgrounds in Openbox, each of which will need to be autostarted in the {{ic|~/.config/openbox/autostart}} file. A few of the most well known have been listed.<br />
<br />
==== nitrogen ====<br />
<br />
{{Tip|If nitrogen does not show in the desktop menu, then it can be manually added.}}<br />
<br />
[[nitrogen]] is a user-friendly choice, as it also provides a GUI window to browse and set installed images. To access the GUI, enter the following command in a terminal:<br />
<br />
$ nitrogen<br />
<br />
To use nitrogen as the background provider, add the following command to the {{ic|~/.config/openbox/autostart}} file so that it will restore the last set wallpaper:<br />
<br />
nitrogen --restore &<br />
<br />
==== feh ====<br />
<br />
[[Feh]] is a popular image viewer that may also be used to set wallpapers. In this instance, it will be necessary to add the full directory path and name of the image to be used as the wallpaper. To use Feh as the background provider, add the following command to the {{ic|~/.config/openbox/autostart}} file:<br />
<br />
feh --bg-scale ''/path/to/image.file'' &<br />
<br />
==== hsetroot ====<br />
<br />
{{Pkg|hsetroot}} is a command-line tool specifically designed to set wallpapers. As with Feh, it will be necessary to add the full directory path and name of the image to be used as the wallpaper. To use HSetRoot as the background provider, add the following command to the {{ic|~/.config/openbox/autostart}} file:<br />
<br />
hsetroot -fill ''/path/to/image.file'' &<br />
<br />
==== xsetroot ====<br />
<br />
{{ic|xsetroot}} is installed as part of the [[Xorg]] X-Windows system, and may be used to set simple background colours. For example, to use XSetRoot to set a black background, the following would be added to the {{ic|~/.config/openbox/autostart}} file:<br />
<br />
xsetroot -solid "#000000" &<br />
<br />
=== Icon programs ===<br />
<br />
While there are programs dedicated to enabling desktop icons alone, it would seem that they have greater drawbacks than the utilisation of file managers for the task. These programs are discussed briefly, below.<br />
<br />
==== idesk ====<br />
<br />
[[idesk]] is a simple program that can enable icons in addition to managing wallpaper. It will be necessary to create an {{ic|~/.idesktop}} directory, and desktop icons must also be manually created. To use idesk to provide icons, add the following command to the {{ic|~/.config/openbox/autostart}} file:<br />
<br />
idesk &<br />
<br />
==== xfdesktop ====<br />
<br />
{{Pkg|xfdesktop}} is the desktop manager for [[XFCE]]. The [[Thunar]] file manager will also be downloaded as a dependency. Where this is used, the Openbox desktop menu will no longer be accessible by right-clicking the background. <br />
<br />
As such, it will consequently be necessary to access it by other means, such as by [[Openbox#Desktop_Menu|creating a keybind]], and/or by - where permitted - re-configuring an installed panel to use the [[Openbox#Desktop_menu_as_a_panel_menu|desktop menu as a panel menu]]. To use xfdesktop to provide icons, add the following command to the {{ic|~/.config/openbox/autostart}} file:<br />
<br />
xfdesktop &<br />
<br />
=== conky reconfiguration ===<br />
<br />
Particularly where using a file manager to manage the desktop, it will be necessary to edit {{ic|~/.conkyrc}} to change the {{ic|own_window_type}} command in order for [[conky]] to continue to be displayed (where used). The revised command that should be used is:<br />
<br />
own_window_type normal<br />
<br />
== File managers ==<br />
<br />
Multiple [[List of applications#File managers|file managers]] may be used with Openbox, including [[PCManFM]], [[SpaceFM]], [[Thunar]], {{Pkg|xfe}}, and {{Pkg|qtfm}}. Thunar is the native file manager for [[Xfce]], and if installing be aware that some Xfce-related dependencies will also be installed, including {{Pkg|exo}} (set default applications) and '''xfce4-about''' (provide information about the Xfce deskop environment). The menu entries for these may consequently have to be hidden.<br />
<br />
A file manager alone will not provide the same features and functionality as provided by default in full desktop environments like [[Xfce]] and [[KDE]]. For example, it may not be initially possible to view or access other partitions or access removable media. See [[File manager functionality]] for further information.<br />
<br />
== oblogout ==<br />
<br />
See the [[Oblogout]] article for an overview on how to use this useful, graphical logout script.<br />
<br />
== Openbox for multihead users ==<br />
<br />
While Openbox provides better than average multihead support on its own, the {{AUR|openbox-multihead-git}} package from the [[AUR]] provides a development branch called '''Openbox Multihead''' that gives multihead users per-monitor desktops. This model is not commonly found in floating window managers, but exists mainly in tiling window managers. It is explained well on the [http://xmonad.org/tour.html#workspace Xmonad web site]. Also, please see [https://github.com/BurntSushi/openbox-multihead/blob/multihead/README.MULTIHEAD README.MULTIHEAD] for a more comprehensive description of the new features and configuration options found in Openbox Multihead.<br />
<br />
Openbox Multihead will function like normal Openbox when only a single head is available.<br />
<br />
A downside to using Openbox Multihead is that it breaks the EWMH assumption that one and only one desktop is visible at any time. Thus, existing pagers will not work well with it. To remedy this, {{AUR|pager-multihead-git}} can be found in the [[AUR]] and is compatible with Openbox Multihead. [http://imgur.com/a/cnZeq#y04nk Screenshots].<br />
<br />
Finally, a new version of [[PyTyle]] that will work with Openbox Multihead can also be found in the [[AUR]]: {{AUR|pytyle3-git}}.<br />
<br />
Both ''pytyle3'' and ''pager-multihead-git'' will work without Openbox Multihead if only one monitor is active.<br />
<br />
== Tips and tricks ==<br />
<br />
=== Packages for beginners ===<br />
<br />
{{Tip|See the [[List of applications]] article for many more possibilities.}}<br />
<br />
The packages listed below have been listed to aid newer users:<br />
<br />
* Display Manager: [[LXDM]] or [[LightDM]]<br />
* Audio: [[ALSA]]<br />
* Volume: {{Pkg|volumeicon}} or {{AUR|pnmixer}} with {{Pkg|gnome-alsamixer}}<br />
* Network: [[Network manager]] with {{Pkg|network-manager-applet}}<br />
* Panel: [[Tint2]] or [[Tint2#Application_Launchers_in_tint2-svn_.28AUR.29|Tint2-svn]]<br />
* Background: [[Nitrogen]] or [[Feh]]<br />
* Menu: [[Openbox#obmenu-generator|OBMenu-Generator]]<br />
* Compositor: [[Compton]]<br />
* Desktp Notifications: {{Pkg|xfce4-notifyd}}<br />
* Logout script: [[Oblogout]]<br />
* File Manager: [[PCManFM]], [[SpaceFM]], or [[Thunar]]<br />
* Clipboard Manager: {{Pkg|parcellite}}<br />
* Configuration GUIs: {{Pkg|obconf}}, {{Pkg|lxappearance-obconf}}, {{Pkg|lxrandr}}, {{Pkg|lxinput}}, {{AUR|tintwizard}} or {{AUR|tintwizard-svn}}<br />
<br />
=== Set default applications / file associations ===<br />
<br />
See the [[Default applications]] article.<br />
<br />
=== Terminal content copy and paste ===<br />
<br />
Within a terminal, either:<br />
<br />
* {{ic|Ctrl+Ins}} will copy and {{ic|Shift+Ins}} will paste. <br />
* {{ic|Ctrl+Shift+c}} will copy and '''mouse middle-click''' will paste.<br />
<br />
=== Ad-hoc window transparency ===<br />
<br />
{{Warning|This may not work where other actions are defined within the action group.}}<br />
The program {{Pkg|transset-df}} is available in the official repositories, and can enable window transparency on-the-fly.<br />
<br />
For example, using the following code in the {{ic|<mouse>}} section of the {{ic|~/.config/openbox/rc.xml}} file will enable control of application window transparency by hovering the mouse-pointer over the title bar and scrolling with the middle button:<br />
<br />
<context name="Titlebar"><br />
...<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 />
...<br />
</context><br />
<br />
=== Using obxprop for faster configuration ===<br />
<br />
{{Pkg|openbox}} package provides a {{ic|obxprop}} binary that can parse relevant values for applications settings in {{ic|rc.xml}}. Officially {{ic|<nowiki>obxprop | grep "^_OB_APP"</nowiki>}} is recommended for this task. Doing so for multiple applications and its windows can be very inefficient however. The following script {{ic|obxprop2obrc}} makes it much easier to configure even a large number of applications.<br />
<br />
{{bc|<nowiki><br />
#!/bin/bash<br />
##Script: obxprop-to-openbox-rc.sh<br />
##Recommended executable name: obxprop2obrc<br />
<br />
while [ $# -ne 0 ]; do<br />
case $1 in<br />
-f*)<br />
shift;<br />
FILE="$1";<br />
shift;<br />
;;<br />
-t*)<br />
shift;<br />
TIME="$1";<br />
shift;<br />
;;<br />
*)<br />
echo Usage: $0 [-f FILE_TEMPLATE] [-t WAIT_TO_KILL_TIME] <br />
exit 1;<br />
;;<br />
esac<br />
done<br />
<br />
if [ $TIME ]; then<br />
OBXPROPS=( $(obxprop | cat & (sleep $TIME && pkill -13 cat) | awk -F \" '/_OB_APP/{ print "\x22"$2"\x22" }' ) );<br />
else<br />
OBXPROPS=( $(obxprop | awk -F \" '/_OB_APP/{ print "\x22"$2"\x22" }' ) );<br />
fi<br />
OBPROPS=(TYPE TITLE GROUP_CLASS GROUP_NAME CLASS NAME ROLE);<br />
j=0;<br />
for i in $( seq 2 2 14 ); do<br />
OBPROP="$( echo ${OBXPROPS[@]} | awk -F \" '{ print $'$i'}' )";<br />
if [[ -z $OBPROP ]]; then <br />
declare ${OBPROPS[$j]}='"*"';<br />
else <br />
declare ${OBPROPS[$j]}="\"$OBPROP\"";<br />
fi<br />
j=$(($j+1));<br />
done;<br />
<br />
echo " <application type="$TYPE" title="$TITLE" class="$CLASS" name="$NAME" role="$ROLE">"<br />
if [ -f "$FILE" ]; then cat "$FILE" && exit; fi<br />
cat << EOF<br />
<desktop>1</desktop><br />
<desktop>all</desktop><br />
<decor>yes</decor><br />
<decor>no</decor><br />
<focus>yes</focus><br />
<focus>no</focus><br />
<fullscreen>yes</fullscreen><br />
<fullscreen>no</fullscreen><br />
<iconic>yes</iconic><br />
<iconic>no</iconic><br />
<maximized>yes</maximized><br />
<maximized>no</maximized><br />
<maximized>both</maximized><br />
<maximized>horizontal</maximized><br />
<maximized>vertical</maximized><br />
<monitor>0</monitor><br />
<monitor>1</monitor><br />
<position force="no"><br />
<position force="yes"><br />
<width>40%</width><br />
<height>30%</height><br />
<x>-1</x><br />
<y>-1</y><br />
<x>center</x><br />
<y>center</y><br />
</position><br />
<layer>above</layer><br />
<layer>normal</layer><br />
<layer>below</layer><br />
<shade>yes</shade><br />
<shade>no</shade><br />
<skip_pager>yes</skip_pager><br />
<skip_pager>no</skip_pager><br />
<skip_taskbar>yes</skip_taskbar><br />
<skip_taskbar>no</skip_taskbar><br />
</application><br />
EOF<br />
</nowiki>}}<br />
<br />
If no further options are used default configuration, that can be edited by deleting unnecessary lines, is printed out. This script can use templates with default values when using {{ic|-f}} switch:<br />
{{hc|<br />
$ obxprop2obrc -f templates-rc-inkscape-dialogs.sc > part-rc-applications-inkscape.xml<br />
$ cat part-rc-applications-inkscape.xml|<nowiki><br />
<application type="normal" title="Align and Distribute (Shift+Ctrl+A)" class="Inkscape" name="inkscape" role="*"><br />
<desktop>3</desktop><br />
<decor>yes</decor><br />
<maximized>no</maximized><br />
<position force="yes"><br />
<width>20%</width><br />
<height>30%</height><br />
<x>-1</x><br />
<y>-1</y><br />
</position><br />
<layer>normal</layer><br />
<shade>yes</shade><br />
</application><br />
</nowiki>}}<br />
<br />
It also has a time switch {{ic|-t}} which kills obxprop and thus can reduce time significantly in certain situations, although it may not work perfectly.<br />
<br />
=== Xprop values for applications ===<br />
<br />
{{Pkg|xorg-xprop}} is available in the official repositories, and can be used to relay property values for selected applications. Where frequently using per-application settings, the following [[Bash#Aliases|Bash Alias]] may be useful:<br />
dy:<br />
<br />
alias xp='xprop | grep "WM_WINDOW_ROLE\|WM_CLASS" && echo "WM_CLASS(STRING) = \"NAME\", \"CLASS\""'<br />
<br />
To use Xorg-XProp, run using the alias given {{ic|xp}}, and click on the active program desired to define with per-application settins. The results displayed will only be the information that Openbox itself requires, namely the {{ic|WM_WINDOW_ROLE}} and {{ic|WM_CLASS}} (name and class) values:<br />
<br />
WM_WINDOW_ROLE(STRING) = "roster"<br />
WM_CLASS(STRING) = "gajim.py", "Gajim.py"<br />
WM_CLASS(STRING) = "NAME", "CLASS"<br />
<br />
==== Firefox ====<br />
<br />
For whatever reason, Firefox and like-minded equivalents ignore application rules (e.g. ''<desktop>'') unless {{ic|class&#61;"Firefox*"}} is used. This applies irrespective of whatever values '''xprop''' may report for the program's {{ic|WM_CLASS}}.<br />
<br />
=== Switching between keyboard layouts ===<br />
<br />
See the article section [[Keyboard configuration in Xorg#Switching between keyboard layouts|switching between keyboard layouts]] for instructions.<br />
<br />
== Troubleshooting ==<br />
<br />
=== Windows load behind the active window ===<br />
<br />
Some application windows (such as Firefox windows) may load behind the currently active window, causing you to need to switch to the window you just created to focus it. To fix this behavior add this to your {{ic|~/.config/openbox/rc.xml}} file, inbetween the {{ic|1=<openbox_config>}} and {{ic|1=</openbox_config>}} tags:<br />
<br />
{{bc|1=<br />
<applications><br />
<application class="*"><br />
<focus>yes</focus><br />
</application><br />
</applications><br />
}}<br />
<br />
== See also ==<br />
<br />
* [http://openbox.org/ Openbox Website] - Official website<br />
* [http://planetob.openmonkey.com/ Planet Openbox] - Openbox news portal<br />
* [http://www.box-look.org/ Box-Look.org] - 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 />
* [http://urukrama.wordpress.com/openbox-guide/ An Openbox guide]</div>Tonyctlhttps://wiki.archlinux.org/index.php?title=Spotify&diff=311397Spotify2014-04-21T17:51:26Z<p>Tonyctl: /* Tips & Tricks */ Add script to skip overplayed radio tracks</p>
<hr />
<div>[[Category:Audio/Video]]<br />
[[Category:Wine]]<br />
[http://www.spotify.com/ Spotify] is a digital music service that gives you access to millions of songs.<br />
<br />
This Internet music service allows you to select any song in its database and stream for free. The service was recently introduced to the United States after previously being exclusive to Europe. The Linux client is only officially packaged for Debian and Fedora distributions, but is also available in the AUR: {{AUR|spotify}}. Officially, they recommend that Linux users run the windows client under Wine. There are also the occasional voice ads in between songs for users who do not wish to subscribe.<br />
<br />
Spotify also offers free users the ability to create playlist which can be shuffled, and set to repeat tracks. Content provided by Spotify comes in explicit versions as well as censored.<br />
<br />
<br />
== Installing The Client ==<br />
Choose which client you would prefer. The Linux client is receiving good reviews. However, if you are comfortable with wine and it's configuration, you might want to choose the windows client. Please note that you do NOT need to install both. <br />
<br />
=== Installation of Linux Client ===<br />
Follow the instructions for installing packages from the AUR: https://wiki.archlinux.org/index.php/AUR#Installing_packages and install the AUR package here: {{AUR|spotify}}. The pkgbuild will automatically download the software. It would be a good use of time to go to the spotify website and create your user account while it's building.<br />
If you wish to play local files you will need to install {{AUR|ffmpeg-spotify}} as well.<br />
You can also install {{AUR|spotify-gnome-git}} to control spotify with gnome's media keys.<br />
<br />
=== Installation of Windows Client using Wine===<br />
<br />
==== Install Wine ====<br />
First, you must ensure that you have [[Wine]] installed on your system. In addition to installing Wine you will need to take a moment to configure it for the user who will be running the application.<br />
<br />
Depending on your choice of architecture it may be necessary for you to enable the [[Official repositories#multilib|multilib]] repositories. This is necessary to install Wine on x86_64 systems, if not enabled [[pacman]] will inform you that the package was not found.<br />
<br />
# pacman -Syy<br />
# pacman -S wine wine_gecko<br />
<br />
==== Configure Wine ====<br />
<br />
When wine is installed you will need to change some configuration settings using the winecfg application on your every day user account (not root).<br />
<br />
$ winecfg<br />
<br />
After launching the winecfg application you will be presented with multiple tabs that can assist you in tweaking the performance of the emulator. However for this purpose your main focus will be the Audio tab.<br />
<br />
While under the audio tab, you will enable either the ALSA or OSS driver by clicking the check box next to them, depending on what software you prefer to use. Also note that the hardware acceleration will need to be changed from Full to Emulation. When done you may exit the winecfg application.<br />
<br />
Failure to perform the above task will result in the inability to hear playback.<br />
<br />
==== Run Installer ====<br />
<br />
Obtaining Spotify can be done by registering for an account on their Website, the application does not offer in-app registration.<br />
<br />
However you can obtain the application prior to registering by using the following URL. [http://download.spotify.com/Spotify%20Installer.exe]<br />
<br />
After you have registered and downloaded your copy of the installer you will need to run the application through Wine, depending on your setup you may be able to run the application by right clicking the file. If not terminal will work just fine, as long as you run the below command in the directory of your download.<br />
<br />
$ wine Spotify\ Installer.exe<br />
<br />
Once the application is successfully installed you may run Spotify by using one of the following commands in terminal, or in the ALT+F2 launcher:<br />
<br />
If you use a x86_64 copy of ArchLinux, you'll have to run it like this:<br />
<br />
$ wine "/home/username/.wine/drive_c/Program Files (x86)/Spotify/spotify.exe"<br />
<br />
If you use a x86 copy of ArchLinux, you can use this command just fine:<br />
<br />
$ wine ~/.wine/drive_c/Program\ Files/Spotify/spotify.exe<br />
<br />
If you have any additional problems, I recommend setting the winecfg to Windows XP or Windows 7 emulation.<br />
<br />
==Global Media Hotkeys==<br />
<br />
Spotify has support for media keys like {{ic|XF86AudioPlay}}, but out of the box they only work inside Spotify. We can use for example [[xbindkeys]] to catch the global media keypresses, and then forward them to Spotify using one of the methods below.<br />
<br />
===Linux Client===<br />
====Using Playerctl====<br />
<br />
The {{aur|playerctl}} utility provides a command line tool to send commands to the Spotify process. The only two commands you will likely need to bind globally are {{ic|play-pause}} and {{ic|next}}<br />
<br />
$ playerctl play-pause<br />
$ playerctl next<br />
<br />
Playerctl will send the command to the first player it finds, so this method will also work with others players such as [[vlc]]. To ignore other players, pass {{ic|--player&#61;spotify}} as an argument.<br />
<br />
====Using a bash-script and xdotool====<br />
With the help of {{ic|xdotool}} it is possible to send your hotkeys to the application. The following script is an example of how to control Spotify from the outside:<br />
#!/bin/sh<br />
<br />
case $1 in<br />
"play")<br />
key="XF86AudioPlay"<br />
;;<br />
"next")<br />
key="XF86AudioNext"<br />
;;<br />
"prev")<br />
key="XF86AudioPrev"<br />
;;<br />
*)<br />
echo "Usage: $0 play|next|prev"<br />
exit 1<br />
;;<br />
esac<br />
xdotool key --window $(xdotool search --name "Spotify (Premium )?- Linux Preview"|head -n1) $key<br />
exit 0<br />
<br />
Let's call it {{ic|musickeys.sh}}. Make the script executable:<br />
$ chmod +x musickeys.sh<br />
By executing {{ic|./musickeys.sh play}} you can now toggle playing a song. Now you can bind this script to any tool that catches keypresses, such as [[xbindkeys]]. For [[Openbox]] you can use the following example (see [[Openbox#Configuration]] for help):<br />
<keybind key="XF86AudioPlay"><br />
<action name="Execute"><br />
<execute>~/bin/musickeys.sh play</execute><br />
</action><br />
</keybind><br />
<keybind key="XF86AudioNext"><br />
<action name="Execute"><br />
<execute>~/bin/musickeys.sh next</execute><br />
</action><br />
</keybind><br />
<keybind key="XF86AudioPrev"><br />
<action name="Execute"><br />
<execute>~/bin/musickeys.sh prev</execute><br />
</action><br />
</keybind><br />
<br />
====D-Bus====<br />
<br />
An alternative to the above is [[D-Bus]], which should be available by default as it is a dependency of [[systemd]]. With D-Bus we have a consistent and reliable way to communicate with other processes, such as Spotify.<br />
To play or pause the current song in Spotify:<br />
$ dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.PlayPause<br />
<br />
In order to bind this and the other commands to the media keys you need to install [[Xbindkeys]] and edit your .xbindkeysrc and add the following lines:<br />
# Play/Pause<br />
"dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.PlayPause"<br />
XF86AudioPlay<br />
<br />
# Next<br />
"dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.Next"<br />
XF86AudioNext<br />
<br />
# Previous<br />
"dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.Previous"<br />
XF86AudioPrev<br />
<br />
# Stop<br />
"dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.Stop"<br />
XF86AudioStop<br />
<br />
===Windows-Client (via wine)===<br />
If you prefer the wine-version of Spotify, you can use [https://aur.archlinux.org/packages/spotifycmd/ spotifycmd] to send actions to Spotify.<br />
<br />
==Tips & Tricks==<br />
===Show Track Info Notifications===<br />
<br />
{{AUR|playerctl}} provides a library you can use with {{pkg|python-gobject}} and a notification daemon such as {{pkg|dunst}} to show the artist and title in a notification when the track changes.<br />
<br />
#!/usr/bin/env python3<br />
<br />
from gi.repository import Playerctl, GLib<br />
from subprocess import Popen<br />
<br />
player = Playerctl.Player()<br />
<br />
def on_track_change(player, e):<br />
track_info = '{artist} - {title}'.format(artist=player.get_artist(), title=player.get_title())<br />
Popen(['notify-send', track_info])<br />
<br />
player.on('metadata', on_track_change)<br />
<br />
GLib.MainLoop().run()<br />
<br />
===Skip Overplayed Radio Tracks===<br />
<br />
Another use of the {{AUR|playerctl}} library is to skip tracks that are played too much on radio when you do not necessarily want to downvote these tracks because you may want to hear them again later on that station.<br />
<br />
#!/usr/bin/env python3<br />
<br />
from gi.repository import Playerctl, GLib<br />
<br />
player = Playerctl.Player()<br />
<br />
played_out = ['Zu Fuss', 'Walk And Talk', 'Neuland']<br />
<br />
def on_track_change(player, e):<br />
if player.get_title() in played_out:<br />
player.next()<br />
<br />
player.on('metadata', on_track_change)<br />
<br />
GLib.MainLoop().run()<br />
<br />
===Mute Commercials===<br />
With [https://github.com/mikar/blockify blockify] you can mute commercials (works on both the Wine version and the native Linux client). It is available in the [[AUR]] as {{AUR|blockify}}.<br />
<br />
===Remote Control===<br />
====Send Commands via SSH====<br />
If you set up ssh on the server, you can send controls from a client to a remote Spotify instance with<br />
<br />
$ ssh user@host 'yourcommand'<br />
<br />
where yourcommand can be [https://aur.archlinux.org/packages/spotifycmd/ spotifycmd] that you installed on the server or a dbus script for the linux version, as described above.<br />
<br />
====Grab the Spotify Window via SSH====<br />
Aside from grabbing the whole desktop with TeamViewer or VNC to remotely control your server, you can also only grab the Spotify Window from the server to your client.<br />
<br />
To do that, you need to configure sshd on your server and install x11vnc on both server and client as well as tigervnc on the client. Then you can use these scripts to grab either the complete dektop or only the Spotify window, which essentially gets you GUI client-like behavior as with MPD.<br />
<br />
{{bc|<nowiki><br />
#!/bin/bash<br />
# vncget.sh<br />
<br />
if [[ $1 == all ]];then<br />
ssh -f -t -L 5900:localhost:5900 user@host "x11vnc -q -display :0 -auth .Xauthority"<br />
else<br />
ssh -f -t -L 5900:localhost:5900 user@host ".bin/vncgetspotify.sh"<br />
fi<br />
<br />
for i in {1..4}; do<br />
sleep 2<br />
if vncviewer localhost:0; then break; fi<br />
done</nowiki>}}<br />
<br />
{{bc|<nowiki><br />
#!/bin/bash<br />
# vncgetspotify.sh<br />
<br />
export DISPLAY=:0<br />
<br />
id=$(wmctrl -lx | awk '/spotify.exe.Wine/ {print $1}')<br />
[[ -z $id ]] && id=$(wmctrl -lx | awk '/spotify.Spotify/ {print $1}')<br />
<br />
x11vnc -sid $id -display :0 -auth .Xauthority<br />
</nowiki>}}<br />
<br />
You will need to copy the second script to ~/.bin/vncgetspotify.sh on the server and the first script to any place on your client.<br />
<br />
Finally, to grab the spotify window, run on the client:<br />
$ sh vncget.sh<br />
or, for the whole desktop:<br />
$ sh vncget.sh all<br />
<br />
== Troubleshooting ==<br />
<br />
=== Broken radio ===<br />
<br />
: Spotify [http://community.spotify.com/t5/Help-Desktop-Linux-Mac-and/Bug-Desktop-Linux-0-9-0-133-gd18ed589-Having-mixed-locale-breaks/td-p/418270 bug report] concerning mixed locales<br />
If your radio page is broken (stuck when starting and unsresponsive to input) you might be using a custom locale. Try setting the environment variable {{ic|LC_NUMERIC}} to {{ic|en_US.utf8}} before starting Spotify.<br />
<br />
<br />
=== Spotify won't play local files ===<br />
<br />
Try installing {{pkg|ffmpeg-compat}}, as per [https://bbs.archlinux.org/viewtopic.php?pid=1383240 this forum discussion].<br />
<br />
==See also==<br />
*[https://github.com/acrisci/playerctl playerctl]: A command-line utility and library for controlling media players<br />
*[[SpotCommander]]: A web based remote control for Spotify<br />
*http://www.spotify.com/int/help/faq/wine/<br />
*http://www.spotify.com/int/download/previews/</div>Tonyctlhttps://wiki.archlinux.org/index.php?title=Spotify&diff=311395Spotify2014-04-21T17:37:09Z<p>Tonyctl: /* Tips & Tricks */ Add script to show track info notifications</p>
<hr />
<div>[[Category:Audio/Video]]<br />
[[Category:Wine]]<br />
[http://www.spotify.com/ Spotify] is a digital music service that gives you access to millions of songs.<br />
<br />
This Internet music service allows you to select any song in its database and stream for free. The service was recently introduced to the United States after previously being exclusive to Europe. The Linux client is only officially packaged for Debian and Fedora distributions, but is also available in the AUR: {{AUR|spotify}}. Officially, they recommend that Linux users run the windows client under Wine. There are also the occasional voice ads in between songs for users who do not wish to subscribe.<br />
<br />
Spotify also offers free users the ability to create playlist which can be shuffled, and set to repeat tracks. Content provided by Spotify comes in explicit versions as well as censored.<br />
<br />
<br />
== Installing The Client ==<br />
Choose which client you would prefer. The Linux client is receiving good reviews. However, if you are comfortable with wine and it's configuration, you might want to choose the windows client. Please note that you do NOT need to install both. <br />
<br />
=== Installation of Linux Client ===<br />
Follow the instructions for installing packages from the AUR: https://wiki.archlinux.org/index.php/AUR#Installing_packages and install the AUR package here: {{AUR|spotify}}. The pkgbuild will automatically download the software. It would be a good use of time to go to the spotify website and create your user account while it's building.<br />
If you wish to play local files you will need to install {{AUR|ffmpeg-spotify}} as well.<br />
You can also install {{AUR|spotify-gnome-git}} to control spotify with gnome's media keys.<br />
<br />
=== Installation of Windows Client using Wine===<br />
<br />
==== Install Wine ====<br />
First, you must ensure that you have [[Wine]] installed on your system. In addition to installing Wine you will need to take a moment to configure it for the user who will be running the application.<br />
<br />
Depending on your choice of architecture it may be necessary for you to enable the [[Official repositories#multilib|multilib]] repositories. This is necessary to install Wine on x86_64 systems, if not enabled [[pacman]] will inform you that the package was not found.<br />
<br />
# pacman -Syy<br />
# pacman -S wine wine_gecko<br />
<br />
==== Configure Wine ====<br />
<br />
When wine is installed you will need to change some configuration settings using the winecfg application on your every day user account (not root).<br />
<br />
$ winecfg<br />
<br />
After launching the winecfg application you will be presented with multiple tabs that can assist you in tweaking the performance of the emulator. However for this purpose your main focus will be the Audio tab.<br />
<br />
While under the audio tab, you will enable either the ALSA or OSS driver by clicking the check box next to them, depending on what software you prefer to use. Also note that the hardware acceleration will need to be changed from Full to Emulation. When done you may exit the winecfg application.<br />
<br />
Failure to perform the above task will result in the inability to hear playback.<br />
<br />
==== Run Installer ====<br />
<br />
Obtaining Spotify can be done by registering for an account on their Website, the application does not offer in-app registration.<br />
<br />
However you can obtain the application prior to registering by using the following URL. [http://download.spotify.com/Spotify%20Installer.exe]<br />
<br />
After you have registered and downloaded your copy of the installer you will need to run the application through Wine, depending on your setup you may be able to run the application by right clicking the file. If not terminal will work just fine, as long as you run the below command in the directory of your download.<br />
<br />
$ wine Spotify\ Installer.exe<br />
<br />
Once the application is successfully installed you may run Spotify by using one of the following commands in terminal, or in the ALT+F2 launcher:<br />
<br />
If you use a x86_64 copy of ArchLinux, you'll have to run it like this:<br />
<br />
$ wine "/home/username/.wine/drive_c/Program Files (x86)/Spotify/spotify.exe"<br />
<br />
If you use a x86 copy of ArchLinux, you can use this command just fine:<br />
<br />
$ wine ~/.wine/drive_c/Program\ Files/Spotify/spotify.exe<br />
<br />
If you have any additional problems, I recommend setting the winecfg to Windows XP or Windows 7 emulation.<br />
<br />
==Global Media Hotkeys==<br />
<br />
Spotify has support for media keys like {{ic|XF86AudioPlay}}, but out of the box they only work inside Spotify. We can use for example [[xbindkeys]] to catch the global media keypresses, and then forward them to Spotify using one of the methods below.<br />
<br />
===Linux Client===<br />
====Using Playerctl====<br />
<br />
The {{aur|playerctl}} utility provides a command line tool to send commands to the Spotify process. The only two commands you will likely need to bind globally are {{ic|play-pause}} and {{ic|next}}<br />
<br />
$ playerctl play-pause<br />
$ playerctl next<br />
<br />
Playerctl will send the command to the first player it finds, so this method will also work with others players such as [[vlc]]. To ignore other players, pass {{ic|--player&#61;spotify}} as an argument.<br />
<br />
====Using a bash-script and xdotool====<br />
With the help of {{ic|xdotool}} it is possible to send your hotkeys to the application. The following script is an example of how to control Spotify from the outside:<br />
#!/bin/sh<br />
<br />
case $1 in<br />
"play")<br />
key="XF86AudioPlay"<br />
;;<br />
"next")<br />
key="XF86AudioNext"<br />
;;<br />
"prev")<br />
key="XF86AudioPrev"<br />
;;<br />
*)<br />
echo "Usage: $0 play|next|prev"<br />
exit 1<br />
;;<br />
esac<br />
xdotool key --window $(xdotool search --name "Spotify (Premium )?- Linux Preview"|head -n1) $key<br />
exit 0<br />
<br />
Let's call it {{ic|musickeys.sh}}. Make the script executable:<br />
$ chmod +x musickeys.sh<br />
By executing {{ic|./musickeys.sh play}} you can now toggle playing a song. Now you can bind this script to any tool that catches keypresses, such as [[xbindkeys]]. For [[Openbox]] you can use the following example (see [[Openbox#Configuration]] for help):<br />
<keybind key="XF86AudioPlay"><br />
<action name="Execute"><br />
<execute>~/bin/musickeys.sh play</execute><br />
</action><br />
</keybind><br />
<keybind key="XF86AudioNext"><br />
<action name="Execute"><br />
<execute>~/bin/musickeys.sh next</execute><br />
</action><br />
</keybind><br />
<keybind key="XF86AudioPrev"><br />
<action name="Execute"><br />
<execute>~/bin/musickeys.sh prev</execute><br />
</action><br />
</keybind><br />
<br />
====D-Bus====<br />
<br />
An alternative to the above is [[D-Bus]], which should be available by default as it is a dependency of [[systemd]]. With D-Bus we have a consistent and reliable way to communicate with other processes, such as Spotify.<br />
To play or pause the current song in Spotify:<br />
$ dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.PlayPause<br />
<br />
In order to bind this and the other commands to the media keys you need to install [[Xbindkeys]] and edit your .xbindkeysrc and add the following lines:<br />
# Play/Pause<br />
"dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.PlayPause"<br />
XF86AudioPlay<br />
<br />
# Next<br />
"dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.Next"<br />
XF86AudioNext<br />
<br />
# Previous<br />
"dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.Previous"<br />
XF86AudioPrev<br />
<br />
# Stop<br />
"dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.Stop"<br />
XF86AudioStop<br />
<br />
===Windows-Client (via wine)===<br />
If you prefer the wine-version of Spotify, you can use [https://aur.archlinux.org/packages/spotifycmd/ spotifycmd] to send actions to Spotify.<br />
<br />
==Tips & Tricks==<br />
===Show Track Info Notifications===<br />
<br />
{{AUR|playerctl}} provides a library you can use with {{pkg|python-gobject}} and a notification daemon such as {{pkg|dunst}} to show the artist and title in a notification when the track changes.<br />
<br />
#!/usr/bin/env python3<br />
<br />
from gi.repository import Playerctl, GLib<br />
from subprocess import Popen<br />
<br />
player = Playerctl.Player()<br />
<br />
def on_track_change(player, e):<br />
track_info = '{artist} - {title}'.format(artist=player.get_artist(), title=player.get_title())<br />
Popen(['notify-send', track_info])<br />
<br />
player.on('metadata', on_track_change)<br />
<br />
GLib.MainLoop().run()<br />
<br />
===Mute Commercials===<br />
With [https://github.com/mikar/blockify blockify] you can mute commercials (works on both the Wine version and the native Linux client). It is available in the [[AUR]] as {{AUR|blockify}}.<br />
<br />
===Remote Control===<br />
====Send Commands via SSH====<br />
If you set up ssh on the server, you can send controls from a client to a remote Spotify instance with<br />
<br />
$ ssh user@host 'yourcommand'<br />
<br />
where yourcommand can be [https://aur.archlinux.org/packages/spotifycmd/ spotifycmd] that you installed on the server or a dbus script for the linux version, as described above.<br />
<br />
====Grab the Spotify Window via SSH====<br />
Aside from grabbing the whole desktop with TeamViewer or VNC to remotely control your server, you can also only grab the Spotify Window from the server to your client.<br />
<br />
To do that, you need to configure sshd on your server and install x11vnc on both server and client as well as tigervnc on the client. Then you can use these scripts to grab either the complete dektop or only the Spotify window, which essentially gets you GUI client-like behavior as with MPD.<br />
<br />
{{bc|<nowiki><br />
#!/bin/bash<br />
# vncget.sh<br />
<br />
if [[ $1 == all ]];then<br />
ssh -f -t -L 5900:localhost:5900 user@host "x11vnc -q -display :0 -auth .Xauthority"<br />
else<br />
ssh -f -t -L 5900:localhost:5900 user@host ".bin/vncgetspotify.sh"<br />
fi<br />
<br />
for i in {1..4}; do<br />
sleep 2<br />
if vncviewer localhost:0; then break; fi<br />
done</nowiki>}}<br />
<br />
{{bc|<nowiki><br />
#!/bin/bash<br />
# vncgetspotify.sh<br />
<br />
export DISPLAY=:0<br />
<br />
id=$(wmctrl -lx | awk '/spotify.exe.Wine/ {print $1}')<br />
[[ -z $id ]] && id=$(wmctrl -lx | awk '/spotify.Spotify/ {print $1}')<br />
<br />
x11vnc -sid $id -display :0 -auth .Xauthority<br />
</nowiki>}}<br />
<br />
You will need to copy the second script to ~/.bin/vncgetspotify.sh on the server and the first script to any place on your client.<br />
<br />
Finally, to grab the spotify window, run on the client:<br />
$ sh vncget.sh<br />
or, for the whole desktop:<br />
$ sh vncget.sh all<br />
<br />
== Troubleshooting ==<br />
<br />
=== Broken radio ===<br />
<br />
: Spotify [http://community.spotify.com/t5/Help-Desktop-Linux-Mac-and/Bug-Desktop-Linux-0-9-0-133-gd18ed589-Having-mixed-locale-breaks/td-p/418270 bug report] concerning mixed locales<br />
If your radio page is broken (stuck when starting and unsresponsive to input) you might be using a custom locale. Try setting the environment variable {{ic|LC_NUMERIC}} to {{ic|en_US.utf8}} before starting Spotify.<br />
<br />
<br />
=== Spotify won't play local files ===<br />
<br />
Try installing {{pkg|ffmpeg-compat}}, as per [https://bbs.archlinux.org/viewtopic.php?pid=1383240 this forum discussion].<br />
<br />
==See also==<br />
*[https://github.com/acrisci/playerctl playerctl]: A command-line utility and library for controlling media players<br />
*[[SpotCommander]]: A web based remote control for Spotify<br />
*http://www.spotify.com/int/help/faq/wine/<br />
*http://www.spotify.com/int/download/previews/</div>Tonyctlhttps://wiki.archlinux.org/index.php?title=Spotify&diff=311393Spotify2014-04-21T17:24:34Z<p>Tonyctl: /* Linux Client */ Add info for binding keys globally with playerctl</p>
<hr />
<div>[[Category:Audio/Video]]<br />
[[Category:Wine]]<br />
[http://www.spotify.com/ Spotify] is a digital music service that gives you access to millions of songs.<br />
<br />
This Internet music service allows you to select any song in its database and stream for free. The service was recently introduced to the United States after previously being exclusive to Europe. The Linux client is only officially packaged for Debian and Fedora distributions, but is also available in the AUR: {{AUR|spotify}}. Officially, they recommend that Linux users run the windows client under Wine. There are also the occasional voice ads in between songs for users who do not wish to subscribe.<br />
<br />
Spotify also offers free users the ability to create playlist which can be shuffled, and set to repeat tracks. Content provided by Spotify comes in explicit versions as well as censored.<br />
<br />
<br />
== Installing The Client ==<br />
Choose which client you would prefer. The Linux client is receiving good reviews. However, if you are comfortable with wine and it's configuration, you might want to choose the windows client. Please note that you do NOT need to install both. <br />
<br />
=== Installation of Linux Client ===<br />
Follow the instructions for installing packages from the AUR: https://wiki.archlinux.org/index.php/AUR#Installing_packages and install the AUR package here: {{AUR|spotify}}. The pkgbuild will automatically download the software. It would be a good use of time to go to the spotify website and create your user account while it's building.<br />
If you wish to play local files you will need to install {{AUR|ffmpeg-spotify}} as well.<br />
You can also install {{AUR|spotify-gnome-git}} to control spotify with gnome's media keys.<br />
<br />
=== Installation of Windows Client using Wine===<br />
<br />
==== Install Wine ====<br />
First, you must ensure that you have [[Wine]] installed on your system. In addition to installing Wine you will need to take a moment to configure it for the user who will be running the application.<br />
<br />
Depending on your choice of architecture it may be necessary for you to enable the [[Official repositories#multilib|multilib]] repositories. This is necessary to install Wine on x86_64 systems, if not enabled [[pacman]] will inform you that the package was not found.<br />
<br />
# pacman -Syy<br />
# pacman -S wine wine_gecko<br />
<br />
==== Configure Wine ====<br />
<br />
When wine is installed you will need to change some configuration settings using the winecfg application on your every day user account (not root).<br />
<br />
$ winecfg<br />
<br />
After launching the winecfg application you will be presented with multiple tabs that can assist you in tweaking the performance of the emulator. However for this purpose your main focus will be the Audio tab.<br />
<br />
While under the audio tab, you will enable either the ALSA or OSS driver by clicking the check box next to them, depending on what software you prefer to use. Also note that the hardware acceleration will need to be changed from Full to Emulation. When done you may exit the winecfg application.<br />
<br />
Failure to perform the above task will result in the inability to hear playback.<br />
<br />
==== Run Installer ====<br />
<br />
Obtaining Spotify can be done by registering for an account on their Website, the application does not offer in-app registration.<br />
<br />
However you can obtain the application prior to registering by using the following URL. [http://download.spotify.com/Spotify%20Installer.exe]<br />
<br />
After you have registered and downloaded your copy of the installer you will need to run the application through Wine, depending on your setup you may be able to run the application by right clicking the file. If not terminal will work just fine, as long as you run the below command in the directory of your download.<br />
<br />
$ wine Spotify\ Installer.exe<br />
<br />
Once the application is successfully installed you may run Spotify by using one of the following commands in terminal, or in the ALT+F2 launcher:<br />
<br />
If you use a x86_64 copy of ArchLinux, you'll have to run it like this:<br />
<br />
$ wine "/home/username/.wine/drive_c/Program Files (x86)/Spotify/spotify.exe"<br />
<br />
If you use a x86 copy of ArchLinux, you can use this command just fine:<br />
<br />
$ wine ~/.wine/drive_c/Program\ Files/Spotify/spotify.exe<br />
<br />
If you have any additional problems, I recommend setting the winecfg to Windows XP or Windows 7 emulation.<br />
<br />
==Global Media Hotkeys==<br />
<br />
Spotify has support for media keys like {{ic|XF86AudioPlay}}, but out of the box they only work inside Spotify. We can use for example [[xbindkeys]] to catch the global media keypresses, and then forward them to Spotify using one of the methods below.<br />
<br />
===Linux Client===<br />
====Using Playerctl====<br />
<br />
The {{aur|playerctl}} utility provides a command line tool to send commands to the Spotify process. The only two commands you will likely need to bind globally are {{ic|play-pause}} and {{ic|next}}<br />
<br />
$ playerctl play-pause<br />
$ playerctl next<br />
<br />
Playerctl will send the command to the first player it finds, so this method will also work with others players such as [[vlc]]. To ignore other players, pass {{ic|--player&#61;spotify}} as an argument.<br />
<br />
====Using a bash-script and xdotool====<br />
With the help of {{ic|xdotool}} it is possible to send your hotkeys to the application. The following script is an example of how to control Spotify from the outside:<br />
#!/bin/sh<br />
<br />
case $1 in<br />
"play")<br />
key="XF86AudioPlay"<br />
;;<br />
"next")<br />
key="XF86AudioNext"<br />
;;<br />
"prev")<br />
key="XF86AudioPrev"<br />
;;<br />
*)<br />
echo "Usage: $0 play|next|prev"<br />
exit 1<br />
;;<br />
esac<br />
xdotool key --window $(xdotool search --name "Spotify (Premium )?- Linux Preview"|head -n1) $key<br />
exit 0<br />
<br />
Let's call it {{ic|musickeys.sh}}. Make the script executable:<br />
$ chmod +x musickeys.sh<br />
By executing {{ic|./musickeys.sh play}} you can now toggle playing a song. Now you can bind this script to any tool that catches keypresses, such as [[xbindkeys]]. For [[Openbox]] you can use the following example (see [[Openbox#Configuration]] for help):<br />
<keybind key="XF86AudioPlay"><br />
<action name="Execute"><br />
<execute>~/bin/musickeys.sh play</execute><br />
</action><br />
</keybind><br />
<keybind key="XF86AudioNext"><br />
<action name="Execute"><br />
<execute>~/bin/musickeys.sh next</execute><br />
</action><br />
</keybind><br />
<keybind key="XF86AudioPrev"><br />
<action name="Execute"><br />
<execute>~/bin/musickeys.sh prev</execute><br />
</action><br />
</keybind><br />
<br />
====D-Bus====<br />
<br />
An alternative to the above is [[D-Bus]], which should be available by default as it is a dependency of [[systemd]]. With D-Bus we have a consistent and reliable way to communicate with other processes, such as Spotify.<br />
To play or pause the current song in Spotify:<br />
$ dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.PlayPause<br />
<br />
In order to bind this and the other commands to the media keys you need to install [[Xbindkeys]] and edit your .xbindkeysrc and add the following lines:<br />
# Play/Pause<br />
"dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.PlayPause"<br />
XF86AudioPlay<br />
<br />
# Next<br />
"dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.Next"<br />
XF86AudioNext<br />
<br />
# Previous<br />
"dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.Previous"<br />
XF86AudioPrev<br />
<br />
# Stop<br />
"dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.Stop"<br />
XF86AudioStop<br />
<br />
===Windows-Client (via wine)===<br />
If you prefer the wine-version of Spotify, you can use [https://aur.archlinux.org/packages/spotifycmd/ spotifycmd] to send actions to Spotify.<br />
<br />
==Tips & Tricks==<br />
===Mute Commercials===<br />
With [https://github.com/mikar/blockify blockify] you can mute commercials (works on both the Wine version and the native Linux client). It is available in the [[AUR]] as {{AUR|blockify}}.<br />
<br />
===Remote Control===<br />
====Send Commands via SSH====<br />
If you set up ssh on the server, you can send controls from a client to a remote Spotify instance with<br />
<br />
$ ssh user@host 'yourcommand'<br />
<br />
where yourcommand can be [https://aur.archlinux.org/packages/spotifycmd/ spotifycmd] that you installed on the server or a dbus script for the linux version, as described above.<br />
<br />
====Grab the Spotify Window via SSH====<br />
Aside from grabbing the whole desktop with TeamViewer or VNC to remotely control your server, you can also only grab the Spotify Window from the server to your client.<br />
<br />
To do that, you need to configure sshd on your server and install x11vnc on both server and client as well as tigervnc on the client. Then you can use these scripts to grab either the complete dektop or only the Spotify window, which essentially gets you GUI client-like behavior as with MPD.<br />
<br />
{{bc|<nowiki><br />
#!/bin/bash<br />
# vncget.sh<br />
<br />
if [[ $1 == all ]];then<br />
ssh -f -t -L 5900:localhost:5900 user@host "x11vnc -q -display :0 -auth .Xauthority"<br />
else<br />
ssh -f -t -L 5900:localhost:5900 user@host ".bin/vncgetspotify.sh"<br />
fi<br />
<br />
for i in {1..4}; do<br />
sleep 2<br />
if vncviewer localhost:0; then break; fi<br />
done</nowiki>}}<br />
<br />
{{bc|<nowiki><br />
#!/bin/bash<br />
# vncgetspotify.sh<br />
<br />
export DISPLAY=:0<br />
<br />
id=$(wmctrl -lx | awk '/spotify.exe.Wine/ {print $1}')<br />
[[ -z $id ]] && id=$(wmctrl -lx | awk '/spotify.Spotify/ {print $1}')<br />
<br />
x11vnc -sid $id -display :0 -auth .Xauthority<br />
</nowiki>}}<br />
<br />
You will need to copy the second script to ~/.bin/vncgetspotify.sh on the server and the first script to any place on your client.<br />
<br />
Finally, to grab the spotify window, run on the client:<br />
$ sh vncget.sh<br />
or, for the whole desktop:<br />
$ sh vncget.sh all<br />
<br />
<br />
== Troubleshooting ==<br />
<br />
=== Broken radio ===<br />
<br />
: Spotify [http://community.spotify.com/t5/Help-Desktop-Linux-Mac-and/Bug-Desktop-Linux-0-9-0-133-gd18ed589-Having-mixed-locale-breaks/td-p/418270 bug report] concerning mixed locales<br />
If your radio page is broken (stuck when starting and unsresponsive to input) you might be using a custom locale. Try setting the environment variable {{ic|LC_NUMERIC}} to {{ic|en_US.utf8}} before starting Spotify.<br />
<br />
<br />
=== Spotify won't play local files ===<br />
<br />
Try installing {{pkg|ffmpeg-compat}}, as per [https://bbs.archlinux.org/viewtopic.php?pid=1383240 this forum discussion].<br />
<br />
==See also==<br />
*[https://github.com/acrisci/playerctl playerctl]: A command-line utility and library for controlling media players<br />
*[[SpotCommander]]: A web based remote control for Spotify<br />
*http://www.spotify.com/int/help/faq/wine/<br />
*http://www.spotify.com/int/download/previews/</div>Tonyctlhttps://wiki.archlinux.org/index.php?title=MPlayer&diff=310511MPlayer2014-04-15T13:13:57Z<p>Tonyctl: /* See also */ Add link to playerctl for controlling mplayer</p>
<hr />
<div>[[Category:Player]]<br />
[[cs:MPlayer]]<br />
[[el:MPlayer]]<br />
[[es:MPlayer]]<br />
[[fr:MPlayer]]<br />
[[it:MPlayer]]<br />
[[ja:MPlayer]]<br />
[[ru:MPlayer]]<br />
[[uk:MPlayer]]<br />
[[zh-CN:MPlayer]]<br />
'''MPlayer''' is a popular movie player for GNU/Linux. It has support for pretty much every video and audio format out there and is hence very versatile, even though most people use it for viewing videos.<br />
<br />
== Installation ==<br />
<br />
Various flavours of MPlayer can be [[pacman|installed]] from the [[official repositories]] or from the [[AUR]]:<br />
* {{Pkg|mplayer}} - Official package.<br />
<br />
Notable variants are:<br />
* {{Pkg|mplayer-vaapi}} - VAAPI-enabled version.<br />
* {{AUR|mplayer-svn}} - Development version.<br />
* {{AUR|mplayer2}} - Fork of MPlayer. with few [http://www.mplayer2.org/differences/ enhancements].<br />
* {{AUR|mplayer2-git}} - Development version of ''mplayer2''.<br />
{{Note|''mplayer2'' development seems to be ceased in favour of [[mpv]], which is focused on speed and quality of development, though this breaks compatibility with old hardware and software. Be aware of its [https://github.com/mpv-player/mpv/blob/master/DOCS/man/en/changes.rst differences] if you want to use it.}}<br />
<br />
== Additional installation tips ==<br />
<br />
=== Frontends/GUIs ===<br />
<br />
* {{App|Deepin Media Player|Rich GTK2/Python interface for the Deepin desktop.|http://www.linuxdeepin.com/|{{AUR|deepin-media-player}}}}<br />
* {{App|GNOME MPlayer|Simple GTK+-based GUI for MPlayer.|http://kdekorte.googlepages.com/gnomemplayer|{{Pkg|gnome-mplayer}}}}<br />
* {{App|KMPlayer|Video player plugin for Konqueror and basic MPlayer/Xine/ffmpeg/ffserver/VDR frontend for KDE.|http://kmplayer.kde.org/|{{AUR|kmplayer}}}}<br />
* {{App|Pymp|PyGTK frontend for MPlayer.|http://jdolan.dyndns.org/trac/wiki/Pymp|{{AUR|pymp}}}}<br />
* {{App|Rosa Media Player|Multimedia player based on SMPlayer with clean and elegant UI.|http://www.rosalab.com/|{{AUR|rosa-media-player}}}}<br />
* {{App|[[Wikipedia:SMPlayer|SMPlayer]]|Qt multimedia player with extra features (CSS themes, YouTube integration, etc.).|http://smplayer.sourceforge.net/|{{Pkg|smplayer}}}}<br />
* {{App|Xt7-Player|Graphical user interface for MPlayer written in Gambas, with a huge list of features.|http://xt7-player.sourceforge.net/xt7forum/|{{AUR|xt7-player}}}}<br />
<br />
=== Browser integration ===<br />
<br />
If you want to let MPlayer control video viewing in your favorite web browser, install one of the following plugins for your browser.<br />
<br />
==== Firefox ====<br />
<br />
A browser plugin is available in the official repositories with the {{Pkg|gecko-mediaplayer}} package.<br />
<br />
{{Note|It depends on {{Pkg|gnome-mplayer}}, which provides a complete frontend to MPlayer.}}<br />
<br />
==== Konqueror ====<br />
<br />
A plugin for Konqueror can be found in the [[AUR]] with the {{AUR|kmplayer}} package.<br />
<br />
{{Note|{{AUR|kmplayer}} also provides a complete frontend to MPlayer.}}<br />
<br />
==== Chromium ====<br />
<br />
The {{Pkg|gecko-mediaplayer}} plugin for Firefox also works in [[Chromium]].<br />
<br />
== Usage ==<br />
<br />
=== Configuration ===<br />
<br />
System-wide configuration is located in {{ic|/etc/mplayer/mplayer.conf}}, whereas the user-local settings are stored in {{ic|~/.mplayer/config}}. The file {{ic|/etc/mplayer/example.conf}} is a good starting point.<br />
<br />
An example configuration:<br />
<br />
{{hc|/etc/mplayer/example.conf|2=<br />
# default configuration that applies to every file<br />
[default]<br />
<br />
# use X11 for video output, use a framebuffer as fallback<br />
vo=xv,directfb<br />
<br />
# use alsa for audio output, choose oss4 as fallback<br />
ao=alsa,oss<br />
<br />
# multithreaded decoding of H264/MPEG-1/2 (valid: 1-8)<br />
lavdopts=threads=2<br />
<br />
# prefer using six channels audio<br />
channels = 6<br />
<br />
# scale the subtitles to the 3% of the screen size<br />
subfont-text-scale = 3<br />
<br />
# never use font config<br />
nofontconfig = 1<br />
<br />
# set the window title using the media filename, when not set with --title.<br />
use-filename-title=yes<br />
<br />
# add black borders so the movies have the same aspect ratio of the monitor<br />
# for wide screen monitors<br />
vf-add=expand=::::1:16/9:16<br />
<br />
# for non wide screen traditional monitors<br />
#vf-add=expand=::::1:4/3:16<br />
<br />
# disable screensaver<br />
heartbeat-cmd="xscreensaver-command -deactivate &" # stop xscreensaver<br />
stop-xscreensaver="yes" # stop gnome-screensaver<br />
<br />
# correct pitch when speed is faster or slower than 1.0<br />
af=scaletempo<br />
<br />
# allow to seek in a file which is still downloading whilst watching it<br />
idx=yes<br />
<br />
# allow to increase the maximal volume<br />
#softvol=1<br />
#softvol-max=600<br />
<br />
# skip displaying some frames to maintain A/V sync on slow systems<br />
framedrop=yes<br />
<br />
# more intense frame dropping (breaks decoding)<br />
#hardframedrop=yes<br />
<br />
# profile for up-mixing two channels audio to six channels<br />
# use -profile 2chto6ch to activate<br />
[2chto6ch]<br />
af-add=pan=6:1:0:.4:0:.6:2:0:1:0:.4:.6:2<br />
<br />
# profile to down-mixing six channels audio to two channels<br />
# use -profile 6chto2ch to activate<br />
[6chto2ch]<br />
af-add=pan=2:0.7:0:0:0.7:0.5:0:0:0.5:0.6:0.6:0:0<br />
<br />
}}<br />
<br />
=== Key bindings ===<br />
<br />
System key bindings are configured via {{ic|/etc/mplayer/input.conf}}. Personal key bindings are stored in {{ic|~/.mplayer/input.conf}}. This is a list of some basic default MPlayer keys. For a complete list of keyboard shortcuts look at {{ic|man mplayer}}.<br />
<br />
{|<br />
! width=85 align=left | Key<br />
! align=left | Description<br />
|-<br />
| {{ic|p}}<br />
| Toggle pause/play.<br />
|-<br />
| {{ic|Space}}<br />
| Toggle pause/play.<br />
|-<br />
|-<br />
| {{ic|Backspace}}<br />
| Return to menu when using dvdnav.<br />
|-<br />
| {{ic|&larr;}}<br />
| Seek backward ten seconds.<br />
|-<br />
| {{ic|&rarr;}}<br />
| Seek forward ten seconds.<br />
|-<br />
| {{ic|&darr;}}<br />
| Seek backward one minute.<br />
|-<br />
| {{ic|&uarr;}}<br />
| Seek forward one minute.<br />
|-<br />
| {{ic|<}}<br />
| Go back in the playlist.<br />
|-<br />
| {{ic|>}}<br />
| Go forward in the playlist.<br />
|-<br />
| {{ic|m}}<br />
| Mute the sound.<br />
|-<br />
| {{ic|0}}<br />
| Volume up.<br />
|-<br />
| {{ic|9}}<br />
| Volume down.<br />
|-<br />
| {{ic|f}}<br />
| Toggle fullscreen mode.<br />
|-<br />
| {{ic|o}}<br />
| Toggle OSD state.<br />
|-<br />
| {{ic|v}}<br />
| Toggle subtitle visibility.<br />
|-<br />
| {{ic|I}}<br />
| Show filename.<br />
|-<br />
| {{ic|1}}, {{ic|2}}<br />
| Adjust contrast.<br />
|-<br />
| {{ic|3}}, {{ic|4}}<br />
| Adjust brightness.<br />
|-<br />
| {{ic|j}}<br />
| Cycle through the available subtitles.<br />
|-<br />
| {{ic|#}}<br />
| Cycle through the available audio tracks.<br />
|}<br />
<br />
== Tips and tricks ==<br />
<br />
=== Automatic resuming from where you left off ===<br />
<br />
To get this behavior, you can install the {{AUR|mplayer-resumer}} package from the [[AUR]]. The package contains a Perl wrapper script for MPlayer which will allow you to autoresume playback from the point it was last stopped.<br />
<br />
To use it, simply call the wrapper script in place of MPlayer:<br />
$ mplayer-resumer ''options'' ''path/to/file''<br />
<br />
If this script is restarted within a short amount of time after closing MPayer (default 5 seconds) then it will delete the file used to keep track of the videos resume position, effectively starting the video from the beginning.<br />
<br />
If the video file to be played is on a read-only filesystem, or otherwise lives in a location that cannot be written to, resume will fail. This is because the current implementation uses a file parallel to the video file to store the timecode.<br />
<br />
=== Enabling VDPAU ===<br />
<br />
For a complete list of NVIDIA VDPAU capable hardware, see [http://en.wikipedia.org/wiki/PureVideo#Table_of_PureVideo_.28HD.29_GPUs this table]. Ensure the {{Pkg|nvidia}} driver is installed and consider one of the following two methods to automatically enable VDPAU for playback.<br />
<br />
For Intel/AMD, you can use {{pkg|libvdpau-va-gl}} — VAAPI backend for VDPAU. For AMD you should also install {{AUR|xvba-video}}. To use it, create:<br />
{{hc|/etc/profile.d/vdpau_vaapi.sh|<br />
#!/bin/sh<br />
export VDPAU_DRIVER&#61;va_gl<br />
}}<br />
and make it executable:<br />
# chmod +x /etc/profile.d/vdpau_vaapi.sh<br />
and reboot or relogin.<br />
<br />
==== Using a configuration file ====<br />
<br />
Append the following to either the system-wide ({{ic|/etc/mplayer/mplayer.conf}}) or user-specific ({{ic|~/.mplayer/config}}) configuration files:<br />
vo=vdpau,<br />
vc=ffh264vdpau,ffmpeg12vdpau,ffodivxvdpau,ffwmv3vdpau,ffvc1vdpau,<br />
<br />
{{Note|The trailing commas are important! They tell MPlayer to fall back on other drivers and codecs should the specified ones not be found.}}<br />
{{Warning|The {{ic|ffodivxvdpau}} codec is only supported by the most recent series of NVIDIA hardware. Consider omitting it based on your specific hardware. See [[NVIDIA#Enabling_Pure_Video_HD_.28VDPAU.2FVAAPI.29|the NVIDIA page]] for more information.}}<br />
<br />
==== Using a wrapper script ====<br />
<br />
The [[AUR]] contains a trivial Bash script called {{AUR|mplayer-vdpau-auto}} that detects which video codec to use and when to use VDPAU as the video output.<br />
<br />
Another simple wrapper is {{AUR|mplayer-vdpau-shell-git}}, which can recover from a VDPAU FATAL error.<br />
This wrapper uses the "-include" option to include a VDPAU configuration, so it will ignore any VDPAU specific settings in your {{ic|~/.mplayer/config}} file.<br />
<br />
=== Enabling VA-API ===<br />
<br />
Mainline MPlayer does not have VA-API support. There is however a the {{Pkg|mplayer-vaapi}} fork, available in the [[official repositories]]. <br />
<br />
MPlayer based players:<br />
* {{Pkg|gnome-mplayer}}: To enable hardware acceleration: ''Edit > Preferences > Player'', then set Video Output to {{ic|vaapi}}.<br />
* {{Pkg|smplayer}}: To enable hardware acceleration: ''Options > Preferences > General > Video'', then set Output driver to {{ic|vaapi}}.<br />
<br />
=== Translucent video with Radeon cards and Composite enabled ===<br />
<br />
To get translucent video output in X you have to enable textured video in MPlayer:<br />
$ mplayer -vo xv:adaptor=1 ''file''<br />
<br />
Or add the following line to {{ic|~/.mplayer/config}}:<br />
vo=xv:adaptor=1<br />
<br />
You can use {{ic|xvinfo}} to check which video modes your graphic card supports.<br />
<br />
=== Watching streamed video ===<br />
<br />
If you want to play a video stream (e.g an {{ic|ASX}} link) use:<br />
$ mplayer -playlist link-to-stream.asx<br />
The {{ic|-playlist}} option is necessary because these streams are actually playlists and cannot be played without it.<br />
<br />
==== DVD playing ====<br />
<br />
To play a DVD with MPlayer:<br />
<br />
$ mplayer dvd://''N''<br />
<br />
where ''N'' is the desired title number. Start at 1 and work up if unsure. To start at a specific chapter use the '-chapter' flag. For example, adding '-chapter 5' to the command starts the dvd playing at chapter five of the title.<br />
<br />
Mplayer checks {{ic|/dev/dvd}} by default. Tell it to use {{ic|/dev/sr0}} with the {{ic|dvd-device}} option at the command line, or the {{ic|dvd-device}} variable in {{ic|~/.mplayer/config}}.<br />
<br />
To play a DVD image file:<br />
<br />
$ mplayer -dvd-device movie.iso dvd://''N''<br />
<br />
To enable the DVD menu use:<br />
<br />
$ mplayer dvdnav://<br />
<br />
{{Note|You use arrow keys to navigate and the {{ic|Enter}} key to choose.}}<br />
To enable mouse support in DVD menus use:<br />
<br />
$ mplayer -mouse-movements dvdnav://<br />
<br />
To find the audio language, start MPlayer with the {{ic|-v}} switch to output audio IDs. An audio track is selected with {{ic|-aid ''audio_id''}}. Set a default audio language by editing {{ic|~/.mplayer/config}} and adding the line {{ic|1=alang=en}} for English. <br />
<br />
With MPlayer, the DVD could be set to a low volume. To increase the maximum volume to 400%, use {{ic|1=softvol=yes}} and {{ic|1=softvol-max=400}}. The startup volume defaults to 100% of software volume and the global mixer levels will remain untouched. Using the {ic|9}} and {{ic|0}} keys, volume can be adjusted between 0 and 400 percent.<br />
<br />
alang=en<br />
softvol=yes<br />
softvol-max=400<br />
<br />
==== DVB-T Streaming ====<br />
<br />
See [[DVB-T]] for more info.<br />
<br />
=== JACK support ===<br />
<br />
To have MPlayer audio output directed to [[JACK]] as its default behavior, edit {{ic|~/.mplayer/config}} and add:<br />
ao=jack<br />
<br />
If you don't have JACK running all the time, you can have MPlayer output to JACK on an as-needed basis by invoking MPlayer from the command line as such:<br />
$ mplayer -ao jack ''path/to/file''<br />
<br />
== Troubleshooting ==<br />
<br />
=== MPlayer fails to open files with spaces ===<br />
<br />
MPlayer can fail to open a file with spaces (e.g. 'The Movie') by saying that it could not open the file {{ic|file:///''The%20Movie''}} (where all spaces are converted to {{ic|%20}}). This can be fixed by editing {{ic|/usr/share/applications/mplayer.desktop}} to changing the following line from:<br />
Exec=mplayer %U<br />
to:<br />
Exec=mplayer "%F"<br />
<br />
If you use a frontend/GUI for MPlayer, enter its name in {{ic|<nowiki>Exec=gui_name "%F"</nowiki>}}.<br />
<br />
=== MPlayer has black or strange colored font for OSD and Subtitles ===<br />
<br />
There appears to be an issue with OSD and Subtitle colors when using vdpau output, which mplayer may be using by default. You can get around this issue by using xv instead of vdpau:<br />
<br />
As a command line option:<br />
mplayer -vo xv<br />
<br />
Adding the following line to your {{ic|~/.mplayer/config}} file :<br />
vo=xv<br />
<br />
See the original [https://bbs.archlinux.org/viewtopic.php?pid=1379141 forums thread] for details.<br />
<br />
=== SMPlayer: No video issue ===<br />
<br />
SMPlayer may have trouble opening some {{ic|MP4}} (and probably {{ic|FLV}}) videos. If it plays only audio without any video, a possible fix is to add the following lines to your {{ic|~/.mplayer/config}} file:<br />
[extension.mp4]<br />
demuxer=mov<br />
<br />
If problem persists after doing so, it is because SMPlayer is keeping settings for that specific file. Deleting the settings for all the files that SMPlayer is keeping will solve this problem:<br />
$ rm -rf ~/.config/smplayer/file_settings<br />
<br />
=== SMPlayer: fail to resume playback after pause ===<br />
<br />
SMPlayer might stop playing a video after pausing it if your audio output driver is incorrectly set. You can fix this by specifically setting your audio driver. For example, if you use PulseAudio, this can be done by starting MPlayer with the {{ic|-ao pulse}} argument or by adding<br />
the following to your {{ic|~/.mplayer/config}} file:<br />
ao=pulse<br />
<br />
You can also change this from SMPlayer by going to ''Options > Preferences > General > Audio'' and setting the ''Output Driver'' option to ''pulse''.<br />
<br />
=== SMPlayer: no video when using transparency in GNOME ===<br />
<br />
This problem may arise under GNOME when using Compiz to provide transparency: SMPlayer starts with a transparent screen with audio playing, but no video. To fix this, create (as root) a file with the contents:<br />
{{hc|/usr/local/bin/smplayer.helper|<nowiki><br />
export XLIB_SKIP_ARGB_VISUALS=1<br />
exec smplayer.real "$@"<br />
</nowiki>}}<br />
<br />
Then do the following:<br />
# chmod 755 /usr/local/bin/smplayer.helper<br />
# ln -sf /usr/local/bin/smplayer.helper /usr/local/bin/smplayer<br />
<br />
=== SMPlayer: OSD font too big / subtitle text too small ===<br />
<br />
Since SMPlayer 0.8.2.1 (with MPlayer2 20121128-1), the ratio of the subtitle font to the OSD font is very strange. This can result in the OSD text filling the whole screen while the subtitles are very small and unreadable. This problem can be solved by adding:<br />
-subfont-osd-scale 2<br />
or to the extra options passed to MPlayer from SMPlayer. These options are found in ''Options > Preferences > Advanced > Options for MPlayer''. This can also be achieved by adding the following line to {{ic|~/.mplayer/config}}:<br />
subfont-osd-scale=2<br />
<br />
== See also ==<br />
<br />
* [http://www.mplayerhq.hu/ Official MPlayer website]<br />
* [http://www.mplayer2.org/ Official MPlayer2 website]<br />
* [http://wiki.multimedia.cx/index.php?title=MPlayer_FAQ MPlayer FAQ]<br />
* [https://www.youtube.com/watch?v=n4Ul_A0VBVI MPlayer notes]<br />
* [https://help.ubuntu.com/community/MPlayerTips MPlayer tips]<br />
* [http://how-to.wikia.com/wiki/How_to_configure_MPlayer How to configure MPlayer]<br />
* [https://github.com/acrisci/playerctl playerctl]: A command-line utility and library for controlling media players</div>Tonyctlhttps://wiki.archlinux.org/index.php?title=VLC_media_player&diff=310504VLC media player2014-04-15T12:56:23Z<p>Tonyctl: /* See also */ Add link to playerctl for controlling vlc</p>
<hr />
<div>[[Category:Player]]<br />
[[ja:VLC media player]]<br />
From the project [http://www.videolan.org/vlc/ home page]:<br />
: ''VLC is a free and open source cross-platform multimedia player and framework that plays most multimedia files as well as DVD, Audio CD, VCD, and various streaming protocols.''<br />
<br />
== Installation ==<br />
<br />
[[pacman|Install]] {{Pkg|vlc}} from the [[official repositories]].<br />
<br />
Notable variants are:<br />
* {{AUR|vlc-git}} - Development branch.<br />
<br />
If you want to play audio CDs, you should also install {{Pkg|libcddb}}.<br />
<br />
== Language ==<br />
<br />
It seems VLC does not offer an option to change language in its ''Preferences'' menu. But you can use the ''LANGUAGE='' prefix. For instance, modify the {{ic|/usr/share/applications/vlc.desktop}} line:<br />
Exec=/usr/bin/vlc %U<br />
to:<br />
Exec=LANGUAGE=fr /usr/bin/vlc %U<br />
to switch VLC interface to French. <br />
<br />
== Skins ==<br />
<br />
VLC can be "skinned" for a different look and feel. You can obtain new skins for VLC from http://www.videolan.org/vlc/skins.php.<br />
<br />
Installation of skins is simple just download the skin you wish to use and copy it to:<br />
~/.local/share/vlc/skins2<br />
Open up VLC, click ''Tools > Preferences''. When the preferences window opens up you should be in the "Interface" tab<br />
<br />
Choose the "Use custom skin" radio button, and browse to the location of the downloaded skin.<br />
<br />
Restart VLC for the change to take effect.<br />
<br />
Note: You need to install {{Pkg|libtar}} from the [[official repositories]] to use the skinnable interface module.<br />
<br />
== Web interface ==<br />
<br />
Run VLC with the parameter {{ic|--extraintf&#61;http}} to use both the desktop and web interface. The {{ic|--http-host}} parameter specifies the address to, which is {{ic|localhost}} by default. To set a password, use {{ic|--http-password}}, otherwise VLC will not allow you to log in.<br />
# vlc --extraintf=http --http-host 0.0.0.0:8080 --http-password 'yourpasswordhere'<br />
<br />
Or you can enable this feature in the UI by navigating to ''View > Add Interface > Web Interface''.<br />
<br />
VLC defaults to port 8080: http://127.0.0.1:8080<br />
<br />
Edit {{ic|/usr/share/vlc/lua/http/.hosts}} to allow remote connections. You will need to restart VLC in order for changes to take effect.<br />
<br />
== Tips and tricks ==<br />
<br />
=== File association in GNOME ===<br />
<br />
Copy the system desktop file to the local one (local {{ic|.desktop}} files supersede the global ones):<br />
<br />
$ cp /usr/share/applications/vlc.desktop ~/.local/share/applications/<br />
<br />
Define its mime types (known playback file type abilities) by doing:<br />
<br />
{{bc|<nowiki><br />
sed -i 's|^Mimetype.*$|MimeType=video/dv;video/mpeg;video/x-mpeg;video/msvideo;video/quicktime;video/x-anim;video/x-avi;video/x-ms-asf;video/x-ms-wmv;video/x-msvideo;video/x-nsv;video/x-flc;video/x-fli;application/ogg;application/x-ogg;application/x-matroska;audio/x-mp3;audio/x-mpeg;audio/mpeg;audio/x-wav;audio/x-mpegurl;audio/x-scpls;audio/x-m4a;audio/x-ms-asf;audio/x-ms-asx;audio/x-ms-wax;application/vnd.rn-realmedia;audio/x-real-audio;audio/x-pn-realaudio;application/x-flac;audio/x-flac;application/x-shockwave-flash;misc/ultravox;audio/vnd.rn-realaudio;audio/x-pn-aiff;audio/x-pn-au;audio/x-pn-wav;audio/x-pn-windows-acm;image/vnd.rn-realpix;video/vnd.rn-realvideo;audio/x-pn-realaudio-plugin;application/x-extension-mp4;audio/mp4;video/mp4;video/mp4v-es;x-content/video-vcd;x-content/video-svcd;x-content/video-dvd;x-content/audio-cdda;x-content/audio-player;|' ~/.local/share/applications/vlc.desktop<br />
</nowiki>}}<br />
<br />
Then in ''System Settings > Details > Default Applications '' and on the ''Video'' drop-down menu, select ''Open VLC media player''.}}<br />
<br />
=== Control using hotkeys or cli ===<br />
<br />
Install {{Pkg|openbsd-netcat}}.<br />
<br />
Get script at: http://crunchbang.org/forums/viewtopic.php?pid=112035%23p112035#p112035<br />
<br />
Follow instructions in script to setup a socket for VLC.<br />
<br />
Either run the script from the command line or register the script with keyboard shortcuts through your desktop.<br />
<br />
=== Preventing multiple instances ===<br />
<br />
The default settings for VLC is to open a new instance of the program for each file that is opened. This can be annoying if you are using VLC for something like playing your music collection. To remedy the problem you can do the following:<br />
<br />
# Open VLC.<br />
# Go to ''Tools > Preferences'' ({{ic|Ctrl+P}}).<br />
# Go to the Interface tab and find the "Instances" section.<br />
# Tick "Allow only one instance".<br />
# Optionally tick "Enqueue files when in one instance mode". This will keep the current file playing and add any newly opened files to the current playlist.<br />
<br />
=== Harware acceleration support ===<br />
<br />
To enable hardware acceleration since version 2.1.x: ''Tools > Preferences > Input & Codecs'', then choose under ''Hardware-accelerated decoding'' the suitable item, e.g. {{ic|Video Acceleration (VA) API}} or {{ic|Video Decode and Presentation API for Unix (VDPAU)}}.<br />
<br />
To enable hardware acceleration in previous versions: ''Tools > Preferences > Input & Codecs'', then check {{ic|Use GPU accelerated decoding}}.<br />
<br />
== Troubleshooting ==<br />
<br />
=== PulseAudio lag ===<br />
<br />
When using PulseAudio as the audio output module, you might encounter audio/video sync problems. These problems can usually be [https://bbs.archlinux.org/viewtopic.php?pid=1101711#p1101711 fixed] by editing {{ic|/etc/pulse/default.pa}} or {{ic| ~/.pulse/default.pa}} to reflect the following changes. However, this can cause a new audio stuttering problem in some applications such as flash.<br />
{{bc|1=<br />
.ifexists module-udev-detect.so<br />
load-module module-udev-detect '''tsched=0'''<br />
.else<br />
}}<br />
<br />
=== Video broken or other issue after upgrade ===<br />
<br />
Now and then VLC will have some issues with configuration even in minor releases. Before making bug reports, remove or rename your configuration located at {{ic|~/.config/vlc}} and confirm whether the issue is still there.<br />
<br />
=== Segmentation fault ===<br />
<br />
When starting VLC you can get a segfault, a possible workaround to this is running the following:<br />
# /usr/lib/vlc/vlc-cache-gen -f usr/lib/vlc/plugins<br />
Then reinstall VLC.<br />
<br />
=== Missing icons in dropdown menus ===<br />
<br />
This can happen under XFCE, there will be no more icons in dropdown menus, like the or the PCI card icon.<br />
<br />
Execute these commands to reactivate these icons:<br />
{{bc|1=<br />
$ gconftool-2 --type boolean --set /desktop/gnome/interface/buttons_have_icons true<br />
$ gconftool-2 --type boolean --set /desktop/gnome/interface/menus_have_icons true<br />
}}<br />
<br />
== See also ==<br />
<br />
* [[List of applications#Multimedia]]<br />
* [http://www.videolan.org/vlc/ VLC homepage]<br />
* [https://github.com/acrisci/playerctl playerctl]: A command-line utility and library for controlling media players<br />
* [http://wiki.videolan.org/Control_VLC_via_a_browser Control VLC via a browser]</div>Tonyctlhttps://wiki.archlinux.org/index.php?title=Spotify&diff=310502Spotify2014-04-15T12:53:32Z<p>Tonyctl: /* See also */ Add link to playerctl for controlling spotify</p>
<hr />
<div>[[Category:Audio/Video]]<br />
[[Category:Wine]]<br />
[http://www.spotify.com/ Spotify] is a digital music service that gives you access to millions of songs.<br />
<br />
This Internet music service allows you to select any song in its database and stream for free. The service was recently introduced to the United States after previously being exclusive to Europe. The Linux client is only officially packaged for Debian and Fedora distributions, but is also available in the AUR: {{AUR|spotify}}. Officially, they recommend that Linux users run the windows client under Wine. There are also the occasional voice ads in between songs for users who do not wish to subscribe.<br />
<br />
Spotify also offers free users the ability to create playlist which can be shuffled, and set to repeat tracks. Content provided by Spotify comes in explicit versions as well as censored.<br />
<br />
<br />
== Installing The Client ==<br />
Choose which client you would prefer. The Linux client is receiving good reviews. However, if you are comfortable with wine and it's configuration, you might want to choose the windows client. Please note that you do NOT need to install both. <br />
<br />
=== Installation of Linux Client ===<br />
Follow the instructions for installing packages from the AUR: https://wiki.archlinux.org/index.php/AUR#Installing_packages and install the AUR package here: {{AUR|spotify}}. The pkgbuild will automatically download the software. It would be a good use of time to go to the spotify website and create your user account while it's building.<br />
If you wish to play local files you will need to install {{AUR|ffmpeg-spotify}} as well.<br />
You can also install {{AUR|spotify-gnome-git}} to control spotify with gnome's media keys.<br />
<br />
=== Installation of Windows Client using Wine===<br />
<br />
==== Install Wine ====<br />
First, you must ensure that you have [[Wine]] installed on your system. In addition to installing Wine you will need to take a moment to configure it for the user who will be running the application.<br />
<br />
Depending on your choice of architecture it may be necessary for you to enable the [[Official repositories#multilib|multilib]] repositories. This is necessary to install Wine on x86_64 systems, if not enabled [[pacman]] will inform you that the package was not found.<br />
<br />
# pacman -Syy<br />
# pacman -S wine wine_gecko<br />
<br />
==== Configure Wine ====<br />
<br />
When wine is installed you will need to change some configuration settings using the winecfg application on your every day user account (not root).<br />
<br />
$ winecfg<br />
<br />
After launching the winecfg application you will be presented with multiple tabs that can assist you in tweaking the performance of the emulator. However for this purpose your main focus will be the Audio tab.<br />
<br />
While under the audio tab, you will enable either the ALSA or OSS driver by clicking the check box next to them, depending on what software you prefer to use. Also note that the hardware acceleration will need to be changed from Full to Emulation. When done you may exit the winecfg application.<br />
<br />
Failure to perform the above task will result in the inability to hear playback.<br />
<br />
==== Run Installer ====<br />
<br />
Obtaining Spotify can be done by registering for an account on their Website, the application does not offer in-app registration.<br />
<br />
However you can obtain the application prior to registering by using the following URL. [http://download.spotify.com/Spotify%20Installer.exe]<br />
<br />
After you have registered and downloaded your copy of the installer you will need to run the application through Wine, depending on your setup you may be able to run the application by right clicking the file. If not terminal will work just fine, as long as you run the below command in the directory of your download.<br />
<br />
$ wine Spotify\ Installer.exe<br />
<br />
Once the application is successfully installed you may run Spotify by using one of the following commands in terminal, or in the ALT+F2 launcher:<br />
<br />
If you use a x86_64 copy of ArchLinux, you'll have to run it like this:<br />
<br />
$ wine "/home/username/.wine/drive_c/Program Files (x86)/Spotify/spotify.exe"<br />
<br />
If you use a x86 copy of ArchLinux, you can use this command just fine:<br />
<br />
$ wine ~/.wine/drive_c/Program\ Files/Spotify/spotify.exe<br />
<br />
If you have any additional problems, I recommend setting the winecfg to Windows XP or Windows 7 emulation.<br />
<br />
==Global Media Hotkeys==<br />
<br />
Spotify has support for media keys like {{ic|XF86AudioPlay}}, but out of the box they only work inside Spotify. We can use for example [[xbindkeys]] to catch the global media keypresses, and then forward them to Spotify using one of the methods below.<br />
<br />
===Linux Client===<br />
====Using a bash-script and xdotool====<br />
With the help of {{ic|xdotool}} it is possible to send your hotkeys to the application. The following script is an example of how to control Spotify from the outside:<br />
#!/bin/sh<br />
<br />
case $1 in<br />
"play")<br />
key="XF86AudioPlay"<br />
;;<br />
"next")<br />
key="XF86AudioNext"<br />
;;<br />
"prev")<br />
key="XF86AudioPrev"<br />
;;<br />
*)<br />
echo "Usage: $0 play|next|prev"<br />
exit 1<br />
;;<br />
esac<br />
xdotool key --window $(xdotool search --name "Spotify (Premium )?- Linux Preview"|head -n1) $key<br />
exit 0<br />
<br />
Let's call it {{ic|musickeys.sh}}. Make the script executable:<br />
$ chmod +x musickeys.sh<br />
By executing {{ic|./musickeys.sh play}} you can now toggle playing a song. Now you can bind this script to any tool that catches keypresses, such as [[xbindkeys]]. For [[Openbox]] you can use the following example (see [[Openbox#Configuration]] for help):<br />
<keybind key="XF86AudioPlay"><br />
<action name="Execute"><br />
<execute>~/bin/musickeys.sh play</execute><br />
</action><br />
</keybind><br />
<keybind key="XF86AudioNext"><br />
<action name="Execute"><br />
<execute>~/bin/musickeys.sh next</execute><br />
</action><br />
</keybind><br />
<keybind key="XF86AudioPrev"><br />
<action name="Execute"><br />
<execute>~/bin/musickeys.sh prev</execute><br />
</action><br />
</keybind><br />
<br />
====D-Bus====<br />
<br />
An alternative to the above is [[D-Bus]], which should be available by default as it is a dependency of [[systemd]]. With D-Bus we have a consistent and reliable way to communicate with other processes, such as Spotify.<br />
To play or pause the current song in Spotify:<br />
$ dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.PlayPause<br />
<br />
In order to bind this and the other commands to the media keys you need to install [[Xbindkeys]] and edit your .xbindkeysrc and add the following lines:<br />
# Play/Pause<br />
"dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.PlayPause"<br />
XF86AudioPlay<br />
<br />
# Next<br />
"dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.Next"<br />
XF86AudioNext<br />
<br />
# Previous<br />
"dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.Previous"<br />
XF86AudioPrev<br />
<br />
# Stop<br />
"dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.Stop"<br />
XF86AudioStop<br />
<br />
===Windows-Client (via wine)===<br />
If you prefer the wine-version of Spotify, you can use [https://aur.archlinux.org/packages/spotifycmd/ spotifycmd] to send actions to Spotify.<br />
<br />
==Tips & Tricks==<br />
===Mute Commercials===<br />
With [https://github.com/mikar/blockify blockify] you can mute commercials (works on both the Wine version and the native Linux client). It is available in the [[AUR]] as {{AUR|blockify}}.<br />
<br />
===Remote Control===<br />
====Send Commands via SSH====<br />
If you set up ssh on the server, you can send controls from a client to a remote Spotify instance with<br />
<br />
$ ssh user@host 'yourcommand'<br />
<br />
where yourcommand can be [https://aur.archlinux.org/packages/spotifycmd/ spotifycmd] that you installed on the server or a dbus script for the linux version, as described above.<br />
<br />
====Grab the Spotify Window via SSH====<br />
Aside from grabbing the whole desktop with TeamViewer or VNC to remotely control your server, you can also only grab the Spotify Window from the server to your client.<br />
<br />
To do that, you need to configure sshd on your server and install x11vnc on both server and client as well as tigervnc on the client. Then you can use these scripts to grab either the complete dektop or only the Spotify window, which essentially gets you GUI client-like behavior as with MPD.<br />
<br />
{{bc|<nowiki><br />
#!/bin/bash<br />
# vncget.sh<br />
<br />
if [[ $1 == all ]];then<br />
ssh -f -t -L 5900:localhost:5900 user@host "x11vnc -q -display :0 -auth .Xauthority"<br />
else<br />
ssh -f -t -L 5900:localhost:5900 user@host ".bin/vncgetspotify.sh"<br />
fi<br />
<br />
for i in {1..4}; do<br />
sleep 2<br />
if vncviewer localhost:0; then break; fi<br />
done</nowiki>}}<br />
<br />
{{bc|<nowiki><br />
#!/bin/bash<br />
# vncgetspotify.sh<br />
<br />
export DISPLAY=:0<br />
<br />
id=$(wmctrl -lx | awk '/spotify.exe.Wine/ {print $1}')<br />
[[ -z $id ]] && id=$(wmctrl -lx | awk '/spotify.Spotify/ {print $1}')<br />
<br />
x11vnc -sid $id -display :0 -auth .Xauthority<br />
</nowiki>}}<br />
<br />
You will need to copy the second script to ~/.bin/vncgetspotify.sh on the server and the first script to any place on your client.<br />
<br />
Finally, to grab the spotify window, run on the client:<br />
$ sh vncget.sh<br />
or, for the whole desktop:<br />
$ sh vncget.sh all<br />
<br />
<br />
== Troubleshooting ==<br />
<br />
=== Broken radio ===<br />
<br />
: Spotify [http://community.spotify.com/t5/Help-Desktop-Linux-Mac-and/Bug-Desktop-Linux-0-9-0-133-gd18ed589-Having-mixed-locale-breaks/td-p/418270 bug report] concerning mixed locales<br />
If your radio page is broken (stuck when starting and unsresponsive to input) you might be using a custom locale. Try setting the environment variable {{ic|LC_NUMERIC}} to {{ic|en_US.utf8}} before starting Spotify.<br />
<br />
<br />
=== Spotify won't play local files ===<br />
<br />
Try installing {{pkg|ffmpeg-compat}}, as per [https://bbs.archlinux.org/viewtopic.php?pid=1383240 this forum discussion].<br />
<br />
==See also==<br />
*[https://github.com/acrisci/playerctl playerctl]: A command-line utility and library for controlling media players<br />
*[[SpotCommander]]: A web based remote control for Spotify<br />
*http://www.spotify.com/int/help/faq/wine/<br />
*http://www.spotify.com/int/download/previews/</div>Tonyctlhttps://wiki.archlinux.org/index.php?title=I3&diff=310500I32014-04-15T12:48:26Z<p>Tonyctl: /* Configuration */ Add section about configuring themes and colorschemes</p>
<hr />
<div>{{DISPLAYTITLE:i3}}<br />
[[Category:Tiling WMs]]<br />
[[Category:Dynamic WMs]]<br />
[[ko:i3]]<br />
[[ru:i3]]<br />
[[zh-CN:i3]]<br />
{{Related articles start}}<br />
{{Related|Desktop environment}}<br />
{{Related|Display manager}}<br />
{{Related|File manager functionality}}<br />
{{Related|Window manager}}<br />
{{Related|Comparison of Tiling Window Managers}}<br />
{{Related|Clipboard}}<br />
{{Related|Autostarting#Graphical}}<br />
{{Related articles end}}<br />
<br />
[http://i3wm.org/ i3] is a dynamic [[Wikipedia:Tiling window manager|tiling window manager]] inspired by [[wmii]] that is primarily targeted at developers and advanced users.<br />
<br />
Clients (windows) are organized in a tree data structure within containers. The tree branches via horizontal or vertical splits, and containers can also be set to tabbed or stacked layouts. Floating windows are available for corner cases that don't mix well with tiling, and remain on a separate layer above the tiled windows.<br />
<br />
== Installation ==<br />
<br />
Install the {{Grp|i3}} [[Pacman#Installing package groups|package group]] from the [[official repositories]], which includes: {{Pkg|i3-wm}}, the window manager; {{Pkg|i3status}}, a package to write a status line to i3bar through [[Wikipedia:Standard streams#Standard output (stdout)|stdout]]; and {{Pkg|i3lock}}, an improved screenlocker.<br />
<br />
Additional packages are available in the [[Arch User Repository]]. Install {{AUR|i3-git}} for the development version.<br />
<br />
Install {{AUR|i3-gnome}} to add [[GNOME]] and X-sessions with {{Grp|i3}} running as the window manager. An Xsession starting just the window manager is included in {{Grp|i3}}.<br />
<br />
== Configuration ==<br />
<br />
Edit your {{ic|~/.xinitrc}} and add:<br />
exec i3<br />
<br />
If you want i3 to log its output (useful for debugging), add this line to {{ic|~/.xinitrc}}:<br />
exec i3 -V >> ~/.i3/i3log 2>&1<br />
<br />
If you use the Nvidia binary driver '''<302.17''' you need to add the {{ic|--force-xinerama}} flag to {{ic|~/.xinitrc}}. A detailed explanation can be found at [http://i3wm.org/docs/multi-monitor.html i3wm.org].<br />
exec i3 --force-xinerama<br />
<br />
If you have trouble with mapping keys (ie ; as semicolon), use {{Pkg|xorg-xev}} or see [[Extra Keyboard Keys]].<br />
$ xev | grep -A2 --line-buffered '^KeyRelease' | sed -n '/keycode /s/^.*keycode \([0-9]*\).* (.*, \(.*\)).*$/\1 \2/p'<br />
<br />
=== Status bar ===<br />
<br />
The internal status bar, i3-''ws''bar, was deprecated and replaced by i3bar in i3 v4.0.<br />
<br />
==== New method: i3bar ====<br />
<br />
Unlike i3-wsbar, which requires dzen2, i3bar does not have any dependencies other than {{Pkg|i3-wm}}. It can be used to view information generated by [[conky]] or i3status. For example (as of version 4.1):<br />
<br />
{{hc|~/.i3/config|<nowiki><br />
bar {<br />
output LVDS1<br />
status_command i3status<br />
position top<br />
mode hide<br />
workspace_buttons yes<br />
tray_output none<br />
<br />
font -misc-fixed-medium-r-normal--13-120-75-75-C-70-iso10646-1<br />
<br />
colors {<br />
background #000000<br />
statusline #ffffff<br />
<br />
focused_workspace #ffffff #285577<br />
active_workspace #ffffff #333333<br />
inactive_workspace #888888 #222222<br />
urgent_workspace #ffffff #900000<br />
}<br />
}<br />
</nowiki>}}<br />
<br />
For further information see the [http://i3wm.org/docs/userguide.html#_configuring_i3bar Configuring i3bar] section of the official User Guide.<br />
<br />
==== Alternatives to i3status ====<br />
<br />
* [https://github.com/vivien/i3blocks i3blocks] - Define the status line blocks with shell commands. It handles clicks, signals and different time intervals, in respect to the [http://i3wm.org/docs/i3bar-protocol.html i3bar protocol]. (AUR: {{AUR|i3blocks}})<br />
* [https://github.com/enkore/i3pystatus i3pystatus] - extensible i3status replacement with many modules and very flexible configuration. Multi-threaded and lock-up free. (AUR: {{AUR|i3pystatus-git}})<br />
* [https://github.com/HarveyHunt/i3situation i3situation] – a pure python 3 replacement with features provided by multithreaded plugins.<br />
* [https://github.com/ultrabug/py3status py3status] – an extensible i3status wrapper written in python<br />
* [[dzen]] – often used with [[conky]] to create completely custom status bars<br />
* [http://j4status.j4tools.org/ j4status] - j4status provides a status line using several plugin to retrieve information from your computer. j4status is a part of the [http://www.j4tools.org/ j4tools] - tools set to use with i3.<br />
* [[h2status]] - trivial bash wrapper to i3status that nevertheless allows to conveniently write custom json entries, handle click events and asynchronously update the status bar.<br />
<br />
==== Panel alternatives to status bar ====<br />
<br />
Some users may prefer panels such as those provided by conventional [[Desktop environment|Desktop Environments]]. This can be achieved within i3 by launching the panel application of choice during startup.<br />
<br />
For the [[Xfce#Panel|XFCE panel]], add the following line to {{ic|~/.i3/config}}:<br />
exec --no-startup-id xfce4-panel<br />
<br />
{{Note|Panel features that are specific to the [[Desktop environment|Desktop Environment]] (e.g., widgets for managing workspaces and sessions) will not work, though the normal i3 functionality will be unaffected.}}<br />
<br />
Disabling i3bar is as simple as commenting out the {{ic|bar{ &#125;}} section of {{ic|~/.i3/config}}.<br />
<br />
==== Iconic fonts in the status bar ====<br />
<br />
There is a patch for i3bar to make it properly support icons, but here we'll see how to take advantage of a couple of very complete iconic font sets in order to get really nice looking monochromatic icons in your status bar. Some ttf iconic font sets that are currently available in the AUR are:<br />
<br />
* {{AUR|ttf-font-awesome}} that has a cheatsheet showing the Unicode point for each glyph here [http://fortawesome.github.io/Font-Awesome/cheatsheet/].<br />
* {{AUR|ttf-font-icons}} provides the Icons font set, a non-overlapping and consistently sized mix of Awesome and Ionicons. This not only avoids the overlapping between Awesome and Ionicons but also some minor overlapping between the usual DejaVu Sans and Awesome. All in all it provides a ready to use solution for your status bar including lots of icons. The cheatsheet is here [https://www.dropbox.com/s/9iysh2i0gadi4ic/icons.pdf].<br />
<br />
Then you can combine these fonts by defining a font fallback sequence in your {{ic|~/.i3/config}}:<br />
<br />
bar {<br />
...<br />
font pango:DejaVu Sans Mono, '''Icons''' 8<br />
...<br />
}<br />
<br />
Notice that you have to first list the comma separated font families and then add only one size specification at the end of the string. Don't set a size for each family (even if it happens to be the same size for every family) and don't try to get the same result using multiple font directives, as the vertical alignments and heights of the different components of the i3bar will be wrong in unexpected ways. The correct pango descriptor syntax is as shown above.<br />
<br />
Finally, you will have to enter the iconic glyphs into the format strings in {{ic|~/.i3status.conf}}. For this, use the unicode numbers given in the cheatsheets linked above. For example, if you're using vim you can type <C-v>uXXXX, where XXXX is the unicode hexadecimal number for the glyph.<br />
<br />
=== Quickly jumping to open window ===<br />
<br />
* [https://github.com/proxypoke/quickswitch-for-i3 quickswitch-for-i3] – A Python utility to quickly change to and locate windows in i3<br />
* [https://github.com/yiuin/i3-wm-scripts i3-wm-scripts] – search for and jump to windows with particular names matching regexp<br />
* [https://github.com/ziberna/i3-py/tree/master/examples#winmenupy winmenupy] launches dmenu with a list of clients, sorted after workspaces. Selecting a client jumps to that window.<br />
<br />
=== i3status ===<br />
<br />
First we need to copy over the default configuration files that we will be working with to our home directory.<br />
<br />
$ cp /etc/i3status.conf ~/.i3status.conf<br />
<br />
{{Tip|The example configuration file uses {{ic|eth0}} and {{ic|wlan0}} as interface names, see [[Network configuration#Device names]] if they do not match with your system.}}<br />
<br />
==== Temperature status ====<br />
<br />
If you would like to add your CPU temperature to the i3status bar simply add these lines to {{ic|~/.i3status.conf}}:<br />
<br />
{{hc|~/.i3status.conf|2=<br />
order += "cpu_temperature 0"<br />
cpu_temperature 0 {<br />
format = "T: %degrees °C"<br />
max_threshold = 65<br />
path = "/sys/devices/platform/coretemp.0/temp1_input"<br />
}<br />
}}<br />
<br />
If the temperature column complains that it cannot get the temperature value then change the path line to:<br />
<br />
path = "/sys/class/thermal/thermal_zone0/temp"<br />
<br />
=== Volume manager ===<br />
<br />
To enable easy management of your system volume, you can install a volume manager applet such as {{AUR|pa-applet-git}} from the [[AUR]]. This should also allow you to use your keyboards volume up, volume down, and mute keys as well as using the applet directly to manage your volume. Once it is installed add the following line to your {{ic|~/.i3/config}} to auto start the applet:<br />
<br />
exec /usr/bin/pa-applet<br />
<br />
or configure it manually adding these lines:<br />
<br />
bindsym XF86AudioMute exec "pactl set-sink-mute SINK toggle"<br />
bindsym XF86AudioRaiseVolume exec "pactl set-sink-volume SINK +1%"<br />
bindsym XF86AudioLowerVolume exec "pactl set-sink-volume SINK -- -1%"<br />
<br />
where {{ic|SINK}} has to be the first or second column from {{ic|$ pactl list short sinks}} list for your desired device.<br />
<br />
A trick to get the status bar to refresh immediately after changing the volume is to send it the USR1 signal (note the lines are using {{ic|amixer}} instead of {{ic|pactl}}):<br />
<br />
bindsym XF86AudioMute exec "amixer set Master toggle && killall -USR1 i3status"<br />
bindsym XF86AudioRaiseVolume exec "amixer set Master 5%+ && killall -USR1 i3status"<br />
bindsym XF86AudioLowerVolume exec "amixer set Master 5%- && killall -USR1 i3status"<br />
<br />
=== Workspace names ===<br />
<br />
Although it is not required, many people prefer naming frequently used workspaces. First you need to determine which monitor you want the workspace to open to. Simply type {{ic|xrandr}} into a terminal and it will show you the available display ports. Some common ones are LVDS1 for laptops or VGA1, HDMI1, HDMI2, etc for external monitors. If you are using [[Multihead#Xinerama|Xinerama]] instead use the outputs xinerama-0, xinerama-1, etc. Add your workspace names to {{ic|~/.i3/config}} You also need to modify the corresponding lines to switch to your workspaces as well as moving focused containers to those workspaces.<br />
<br />
# Workspace names<br />
workspace "1:Web" output LVDS1<br />
workspace "2:Mail" output LVDS1<br />
workspace "3:Irc" output LVDS1<br />
workspace "4:Shell" output LVDS1<br />
<br />
# switch to workspace<br />
bindsym $mod+1 workspace 1:Web<br />
bindsym $mod+2 workspace 2:Mail<br />
bindsym $mod+3 workspace 3:Irc<br />
bindsym $mod+4 workspace 4:Shell<br />
<br />
# move focused container to workspace<br />
bindsym $mod+Shift+1 move container to workspace 1:Web<br />
bindsym $mod+Shift+2 move container to workspace 2:Mail<br />
bindsym $mod+Shift+3 move container to workspace 3:Irc<br />
bindsym $mod+Shift+4 move container to workspace 4:Shell<br />
<br />
=== Launching programs on specific workspaces ===<br />
<br />
To maximize efficiency you can setup certain programs to automatically launch to a specific workspace. This can be accomplished one of two ways. You could use the {{ic|assign}} command so when you manually launch a program it is directed to a the workspace you assigned. An example would be:<br />
<br />
# Assign URxvt terminals to workspace 2<br />
assign [class="URxvt"] 2<br />
<br />
Or if you have renamed the workspaces like the above examples then you must set the new workspace name instead of the number:<br />
<br />
# Assign URxvt terminals to workspace 4:Shell<br />
assign [class="URxvt"] 4:Shell<br />
<br />
{{Note|To be able to determine the class, title, instance, etc of an open window you can use the tool {{ic|xprop}} by installing the package {{Pkg|xorg-xprop}} from the Extra repository.}}<br />
<br />
Alternatively you can change to your target workspace with {{ic|i3-msg}} then have your frequently used programs start automatically with the {{ic|exec}} command:<br />
<br />
exec --no-startup-id i3-msg 'workspace 1:Web; exec /usr/bin/firefox' <br />
exec --no-startup-id i3-msg 'workspace 2:Mail; exec urxvt -name Mail -e /usr/bin/mutt'<br />
exec --no-startup-id i3-msg 'workspace 3:Irc; exec /usr/bin/urxvt -name irssi -e /usr/bin/irssi'<br />
exec --no-startup-id i3-msg 'workspace 4:Shell; exec /usr/bin/urxvt'<br />
<br />
=== Tabbed or stacked web-browsing ===<br />
<br />
Some web-browsers intentionally do not implement tabs, since managing tabs is considered to be the task of the window manager, not the task of the browser.<br />
<br />
To let i3 manage your tab-less web-browser, in this example for [[uzbl]], add the following line to your {{ic|~/.i3/config}}<br />
<br />
for_window [class="Uzbl-core"] focus child, layout stacking, focus<br />
<br />
This is for stacked web browsing, meaning that the windows will be shown vertically. The advantage over tabbed browsing is that the window-titles are fully visible, even if a lot of browser windows are open.<br />
<br />
If you prefer tabbed browsing, with windows in horizontal direction ('tabs'), use<br />
<br />
for_window [class="Uzbl-core"] focus child, layout tabbed, focus<br />
<br />
=== Desktop wallpaper ===<br />
<br />
To be able to manage the desktop wallpaper, you need a lightweight image viewer like [[Feh]] or [[Nitrogen]]. Install feh with the command {{ic|# pacman -S feh}}. Then you can set your wallpaper with the following command:<br />
<br />
$ feh --bg-scale /path/to/image.file<br />
<br />
To have feh set your image to the Desktop Wallpaper add the following line to your {{ic|~/.i3/config}}<br />
<br />
exec --no-startup-id sh ~/.fehbg<br />
<br />
=== Terminal emulator ===<br />
<br />
By default when you press {{ic|$mod+Return}} it launches the {{ic|i3-sensible-terminal}} which is a script that invokes a terminal. It attempts to start one of these terminals in the following order:<br />
<br />
* {{ic|$TERMINAL}}<br />
* [[urxvt]]<br />
* {{pkg|rxvt}}<br />
* [[terminator]]<br />
* {{AUR|Eterm}}<br />
* {{AUR|aterm}}<br />
* [[xterm]]<br />
* {{pkg|gnome-terminal}}<br />
* {{pkg|roxterm}}<br />
* {{pkg|xfce4-terminal}}<br />
<br />
You can force it to launch your terminal of choice by modifying this line<br />
<br />
bindsym $mod+Return exec i3-sensible-terminal<br />
<br />
=== Scratchpad ===<br />
<br />
Having a scratchpad to jot down or paste notes quickly is very handy! i3 has a feature that allows you to move a window to a scratchpad workspace. Basically it will be hidden from view until you recall it with the {{ic|scratchpad show}} command. To send a focused window to the scratchpad with {{ic|$mod+Shift+minus}} or to recall it with {{ic|$mod+minus}} enter these lines into your {{ic|~/.i3/config}}<br />
<br />
# Make the currently focused window a scratchpad<br />
bindsym $mod+Shift+minus move scratchpad<br />
<br />
# Show the first scratchpad window<br />
bindsym $mod+minus scratchpad show<br />
<br />
You can start your favorite editor (ie Gedit, vim, nano, etc) on startup and have it automatically moved to the scratchpad workspace to quickly recall it when needed. The following example when placed in {{ic|~/.i3/config}} shows how you can start the urxvt terminal, have it launch the nano editor, and then move it to the scratchpad:<br />
<br />
# starting a specially named term automatically <br />
exec --no-startup-id urxvt -name scratchpad -e /usr/bin/nano<br />
# move this to scratchpad, if active<br />
for_window [class="URxvt" instance="scratchpad"] move scratchpad<br />
<br />
=== Themes and Colorschemes ===<br />
<br />
The configuration file allows for customization of the colors of window decorations, but the syntax for doing so does not make it practical to create or share themes. There are several projects that can make this easier which include a variety of user-contributed themes that can be applied to your config.<br />
<br />
* [https://github.com/acrisci/i3-style i3-style] modifies your config in place from a theme stored in a JSON object designed for frequently tweaking or changing a colorscheme (available as {{AUR|nodejs-i3-style}} in the AUR).<br />
* [https://github.com/okraits/j4-make-config j4-make-config] compiles your config from a template file allowing for more flexible customization of the config.<br />
<br />
=== Shutdown, reboot, lock screen ===<br />
As there are no Shutdown, Reboot, or Lock Screen buttons, we can add some hotkey combinations to help us out. First we need to create this script and save it as {{ic|i3exit}}. Remember to make it executable with {{ic|chmod +x}} and to place it somewhere in your {{ic|$PATH}}. This script assumes that you have {{Pkg|polkit}} installed to allow unprivileged users to run [[systemd#Power_management|power management]] commands.<br />
<br />
{{bc|<nowiki><br />
#!/bin/sh<br />
lock() {<br />
i3lock<br />
}<br />
<br />
case "$1" in<br />
lock)<br />
lock<br />
;;<br />
logout)<br />
i3-msg exit<br />
;;<br />
suspend)<br />
lock && systemctl suspend<br />
;;<br />
hibernate)<br />
lock && systemctl hibernate<br />
;;<br />
reboot)<br />
systemctl reboot<br />
;;<br />
shutdown)<br />
systemctl poweroff<br />
;;<br />
*)<br />
echo "Usage: $0 {lock|logout|suspend|hibernate|reboot|shutdown}"<br />
exit 2<br />
esac<br />
<br />
exit 0<br />
</nowiki>}}<br />
<br />
Now add the following lines to your {{ic|~/.i3/config}} Once completed you will be presented with a prompt whenever you press {{ic|$mod+pause}}.<br />
<br />
set $mode_system System (l) lock, (e) logout, (s) suspend, (h) hibernate, (r) reboot, (Shift+s) shutdown<br />
mode "$mode_system" {<br />
bindsym l exec --no-startup-id i3exit lock, mode "default"<br />
bindsym e exec --no-startup-id i3exit logout, mode "default"<br />
bindsym s exec --no-startup-id i3exit suspend, mode "default"<br />
bindsym h exec --no-startup-id i3exit hibernate, mode "default"<br />
bindsym r exec --no-startup-id i3exit reboot, mode "default"<br />
bindsym Shift+s exec --no-startup-id i3exit shutdown, mode "default" <br />
<br />
# back to normal: Enter or Escape<br />
bindsym Return mode "default"<br />
bindsym Escape mode "default"<br />
}<br />
bindsym $mod+Pause mode "$mode_system"<br />
<br />
=== Screensaver and power management ===<br />
<br />
You can use [[Display_Power_Management_Signaling|DPMS]] to blank your screen or to suspend/poweroff your monitor. Adding the following line to your {{ic|~/.i3/config}} will suspend your monitor after 10 minutes.<br />
<br />
exec --no-startup-id xset dpms 600<br />
<br />
With {{AUR|xss-lock}} you can register a screenlocker for your i3 session. xss-lock subscribes to the systemd-events {{ic|suspend}}, {{ic|hibernate}}, {{ic|lock-session}}, and {{ic|unlock-session}} with appropriate actions (run locker and wait for user to unlock or kill locker). It also reacts to the [[Display Power Management Signaling#xset screen-saver control|X screensaver]] and runs or kills the locker in response to the x-server signals. Start xss-lock in your autostart like this:<br />
xss-lock -- i3lock -i ''background_image'' &<br />
<br />
== Usage ==<br />
<br />
See the [http://i3wm.org/docs official documentation] on this subject for more information: [http://i3wm.org/docs/userguide.html i3 User’s Guide]<br />
<br />
In i3, commands are invoked using a modifier key, which is referred to as {{ic|$mod}}. This is the Alt key (Mod1) by default, with the Windows key (Mod4) being a popular alternative.<br />
<br />
=== Default keybindings ===<br />
<br />
(Many thanks for Funtoo Linux team for the excellent wiki (http://www.funtoo.org/I3_Tiling_Window_Manager))<br />
<br />
{| class="wikitable"<br />
! Key !! Command<br />
|-<br />
|$mod + Enter || Open terminal<br />
|-<br />
|$mod + A || Focus Parent<br />
|-<br />
|$mod + S || Stacked Layout<br />
|-<br />
|$mod + W || Tabbed Layout<br />
|-<br />
|$mod + E || Default Layout<br />
|-<br />
|$mod + SpaceBar || Focus tiling/floating<br />
|-<br />
|$mod + D || dmenu<br />
|-<br />
|$mod + H || Split Horizontal<br />
|-<br />
|$mod + V || Split Vertically<br />
|-<br />
|$mod + J || Left<br />
|-<br />
|$mod + K || Down<br />
|-<br />
|$mod + J || Up<br />
|-<br />
|$mod + ; || Right<br />
|-<br />
|$mod + Shift + Q || Kill window<br />
|-<br />
|$mod + Shift + E || Exit i3<br />
|-<br />
|$mod + Shift + C || Reload i3config without restarting<br />
|-<br />
|$mod + Shift + R || Restart i3 (reloads i3config without exiting i3)<br />
|-<br />
|$mod + Shift + J || Move left<br />
|-<br />
|$mod + Shift + K || Move down<br />
|-<br />
|$mod + Shift + L || Move up<br />
|-<br />
|$mod + Shift + : || Move right<br />
|-<br />
|$mod + Shift + SpaceBar || Toggle tiling/floating<br />
|}<br />
<br />
=== Application launcher ===<br />
<br />
i3 currently uses [[dmenu]] as a application launcher, which is bound by default to {{ic|$mod+d}}.<br />
<br />
By default i3-dmenu-desktop is used as a wrapper for dmenu. i3-dmenu-desktop creates a list of all installed applications via their .desktop files. There is a rewrite of this perl script called {{AUR|j4-dmenu-desktop-git}}, which is a near-drop-in replacement for the script shipped with i3, but much faster.<br />
<br />
== Troubleshooting ==<br />
<br />
=== Mouse cursor remains in waiting mode ===<br />
<br />
When starting a shell script or an application which does not support startup notifications, mouse cursor will remain in busy/watch/clock mode for 60 seconds.<br />
<br />
To fix this issue, add {{ic|--no-startup-id}} parameter to that particular {{ic|exec}} command, for example:<br />
<br />
exec --no-startup-id ~/script<br />
bindsym $mod+d exec --no-startup-id dmenu_run<br />
<br />
== See also ==<br />
<br />
* [http://i3wm.org/docs/userguide.html i3 User Guide]<br />
* [[Comparison of Tiling Window Managers]]<br />
* [http://i3wm.org Official website]<br />
* [http://code.stapelberg.de/git/i3 Source code]<br />
* [http://github.com/acrisci/i3ipc-glib i3ipc-glib] - A library for i3 extensions<br />
* [https://github.com/ashinkarov/i3-extras Collection of scripts and patches]<br />
<br />
'''Arch Linux Forums'''<br />
* [https://bbs.archlinux.org/viewtopic.php?id=99064 The i3 thread] - A general discussion about i3<br />
* [https://bbs.archlinux.org/viewtopic.php?id=103369 i3 desktop screenshots and config sharing]</div>Tonyctlhttps://wiki.archlinux.org/index.php?title=I3&diff=310463I32014-04-15T11:45:54Z<p>Tonyctl: /* See also */ Add a link to the new i3ipc-glib library</p>
<hr />
<div>{{DISPLAYTITLE:i3}}<br />
[[Category:Tiling WMs]]<br />
[[Category:Dynamic WMs]]<br />
[[ko:i3]]<br />
[[ru:i3]]<br />
[[zh-CN:i3]]<br />
{{Related articles start}}<br />
{{Related|Desktop environment}}<br />
{{Related|Display manager}}<br />
{{Related|File manager functionality}}<br />
{{Related|Window manager}}<br />
{{Related|Comparison of Tiling Window Managers}}<br />
{{Related|Clipboard}}<br />
{{Related|Autostarting#Graphical}}<br />
{{Related articles end}}<br />
<br />
[http://i3wm.org/ i3] is a dynamic [[Wikipedia:Tiling window manager|tiling window manager]] inspired by [[wmii]] that is primarily targeted at developers and advanced users.<br />
<br />
Clients (windows) are organized in a tree data structure within containers. The tree branches via horizontal or vertical splits, and containers can also be set to tabbed or stacked layouts. Floating windows are available for corner cases that don't mix well with tiling, and remain on a separate layer above the tiled windows.<br />
<br />
== Installation ==<br />
<br />
Install the {{Grp|i3}} [[Pacman#Installing package groups|package group]] from the [[official repositories]], which includes: {{Pkg|i3-wm}}, the window manager; {{Pkg|i3status}}, a package to write a status line to i3bar through [[Wikipedia:Standard streams#Standard output (stdout)|stdout]]; and {{Pkg|i3lock}}, an improved screenlocker.<br />
<br />
Additional packages are available in the [[Arch User Repository]]. Install {{AUR|i3-git}} for the development version.<br />
<br />
Install {{AUR|i3-gnome}} to add [[GNOME]] and X-sessions with {{Grp|i3}} running as the window manager. An Xsession starting just the window manager is included in {{Grp|i3}}.<br />
<br />
== Configuration ==<br />
<br />
Edit your {{ic|~/.xinitrc}} and add:<br />
exec i3<br />
<br />
If you want i3 to log its output (useful for debugging), add this line to {{ic|~/.xinitrc}}:<br />
exec i3 -V >> ~/.i3/i3log 2>&1<br />
<br />
If you use the Nvidia binary driver '''<302.17''' you need to add the {{ic|--force-xinerama}} flag to {{ic|~/.xinitrc}}. A detailed explanation can be found at [http://i3wm.org/docs/multi-monitor.html i3wm.org].<br />
exec i3 --force-xinerama<br />
<br />
If you have trouble with mapping keys (ie ; as semicolon), use {{Pkg|xorg-xev}} or see [[Extra Keyboard Keys]].<br />
$ xev | grep -A2 --line-buffered '^KeyRelease' | sed -n '/keycode /s/^.*keycode \([0-9]*\).* (.*, \(.*\)).*$/\1 \2/p'<br />
<br />
=== Status bar ===<br />
<br />
The internal status bar, i3-''ws''bar, was deprecated and replaced by i3bar in i3 v4.0.<br />
<br />
==== New method: i3bar ====<br />
<br />
Unlike i3-wsbar, which requires dzen2, i3bar does not have any dependencies other than {{Pkg|i3-wm}}. It can be used to view information generated by [[conky]] or i3status. For example (as of version 4.1):<br />
<br />
{{hc|~/.i3/config|<nowiki><br />
bar {<br />
output LVDS1<br />
status_command i3status<br />
position top<br />
mode hide<br />
workspace_buttons yes<br />
tray_output none<br />
<br />
font -misc-fixed-medium-r-normal--13-120-75-75-C-70-iso10646-1<br />
<br />
colors {<br />
background #000000<br />
statusline #ffffff<br />
<br />
focused_workspace #ffffff #285577<br />
active_workspace #ffffff #333333<br />
inactive_workspace #888888 #222222<br />
urgent_workspace #ffffff #900000<br />
}<br />
}<br />
</nowiki>}}<br />
<br />
For further information see the [http://i3wm.org/docs/userguide.html#_configuring_i3bar Configuring i3bar] section of the official User Guide.<br />
<br />
==== Alternatives to i3status ====<br />
<br />
* [https://github.com/vivien/i3blocks i3blocks] - Define the status line blocks with shell commands. It handles clicks, signals and different time intervals, in respect to the [http://i3wm.org/docs/i3bar-protocol.html i3bar protocol]. (AUR: {{AUR|i3blocks}})<br />
* [https://github.com/enkore/i3pystatus i3pystatus] - extensible i3status replacement with many modules and very flexible configuration. Multi-threaded and lock-up free. (AUR: {{AUR|i3pystatus-git}})<br />
* [https://github.com/HarveyHunt/i3situation i3situation] – a pure python 3 replacement with features provided by multithreaded plugins.<br />
* [https://github.com/ultrabug/py3status py3status] – an extensible i3status wrapper written in python<br />
* [[dzen]] – often used with [[conky]] to create completely custom status bars<br />
* [http://j4status.j4tools.org/ j4status] - j4status provides a status line using several plugin to retrieve information from your computer. j4status is a part of the [http://www.j4tools.org/ j4tools] - tools set to use with i3.<br />
* [[h2status]] - trivial bash wrapper to i3status that nevertheless allows to conveniently write custom json entries, handle click events and asynchronously update the status bar.<br />
<br />
==== Panel alternatives to status bar ====<br />
<br />
Some users may prefer panels such as those provided by conventional [[Desktop environment|Desktop Environments]]. This can be achieved within i3 by launching the panel application of choice during startup.<br />
<br />
For the [[Xfce#Panel|XFCE panel]], add the following line to {{ic|~/.i3/config}}:<br />
exec --no-startup-id xfce4-panel<br />
<br />
{{Note|Panel features that are specific to the [[Desktop environment|Desktop Environment]] (e.g., widgets for managing workspaces and sessions) will not work, though the normal i3 functionality will be unaffected.}}<br />
<br />
Disabling i3bar is as simple as commenting out the {{ic|bar{ &#125;}} section of {{ic|~/.i3/config}}.<br />
<br />
==== Iconic fonts in the status bar ====<br />
<br />
There is a patch for i3bar to make it properly support icons, but here we'll see how to take advantage of a couple of very complete iconic font sets in order to get really nice looking monochromatic icons in your status bar. Some ttf iconic font sets that are currently available in the AUR are:<br />
<br />
* {{AUR|ttf-font-awesome}} that has a cheatsheet showing the Unicode point for each glyph here [http://fortawesome.github.io/Font-Awesome/cheatsheet/].<br />
* {{AUR|ttf-font-icons}} provides the Icons font set, a non-overlapping and consistently sized mix of Awesome and Ionicons. This not only avoids the overlapping between Awesome and Ionicons but also some minor overlapping between the usual DejaVu Sans and Awesome. All in all it provides a ready to use solution for your status bar including lots of icons. The cheatsheet is here [https://www.dropbox.com/s/9iysh2i0gadi4ic/icons.pdf].<br />
<br />
Then you can combine these fonts by defining a font fallback sequence in your {{ic|~/.i3/config}}:<br />
<br />
bar {<br />
...<br />
font pango:DejaVu Sans Mono, '''Icons''' 8<br />
...<br />
}<br />
<br />
Notice that you have to first list the comma separated font families and then add only one size specification at the end of the string. Don't set a size for each family (even if it happens to be the same size for every family) and don't try to get the same result using multiple font directives, as the vertical alignments and heights of the different components of the i3bar will be wrong in unexpected ways. The correct pango descriptor syntax is as shown above.<br />
<br />
Finally, you will have to enter the iconic glyphs into the format strings in {{ic|~/.i3status.conf}}. For this, use the unicode numbers given in the cheatsheets linked above. For example, if you're using vim you can type <C-v>uXXXX, where XXXX is the unicode hexadecimal number for the glyph.<br />
<br />
=== Quickly jumping to open window ===<br />
<br />
* [https://github.com/proxypoke/quickswitch-for-i3 quickswitch-for-i3] – A Python utility to quickly change to and locate windows in i3<br />
* [https://github.com/yiuin/i3-wm-scripts i3-wm-scripts] – search for and jump to windows with particular names matching regexp<br />
* [https://github.com/ziberna/i3-py/tree/master/examples#winmenupy winmenupy] launches dmenu with a list of clients, sorted after workspaces. Selecting a client jumps to that window.<br />
<br />
=== i3status ===<br />
<br />
First we need to copy over the default configuration files that we will be working with to our home directory.<br />
<br />
$ cp /etc/i3status.conf ~/.i3status.conf<br />
<br />
{{Tip|The example configuration file uses {{ic|eth0}} and {{ic|wlan0}} as interface names, see [[Network configuration#Device names]] if they do not match with your system.}}<br />
<br />
==== Temperature status ====<br />
<br />
If you would like to add your CPU temperature to the i3status bar simply add these lines to {{ic|~/.i3status.conf}}:<br />
<br />
{{hc|~/.i3status.conf|2=<br />
order += "cpu_temperature 0"<br />
cpu_temperature 0 {<br />
format = "T: %degrees °C"<br />
max_threshold = 65<br />
path = "/sys/devices/platform/coretemp.0/temp1_input"<br />
}<br />
}}<br />
<br />
If the temperature column complains that it cannot get the temperature value then change the path line to:<br />
<br />
path = "/sys/class/thermal/thermal_zone0/temp"<br />
<br />
=== Volume manager ===<br />
<br />
To enable easy management of your system volume, you can install a volume manager applet such as {{AUR|pa-applet-git}} from the [[AUR]]. This should also allow you to use your keyboards volume up, volume down, and mute keys as well as using the applet directly to manage your volume. Once it is installed add the following line to your {{ic|~/.i3/config}} to auto start the applet:<br />
<br />
exec /usr/bin/pa-applet<br />
<br />
or configure it manually adding these lines:<br />
<br />
bindsym XF86AudioMute exec "pactl set-sink-mute SINK toggle"<br />
bindsym XF86AudioRaiseVolume exec "pactl set-sink-volume SINK +1%"<br />
bindsym XF86AudioLowerVolume exec "pactl set-sink-volume SINK -- -1%"<br />
<br />
where {{ic|SINK}} has to be the first or second column from {{ic|$ pactl list short sinks}} list for your desired device.<br />
<br />
A trick to get the status bar to refresh immediately after changing the volume is to send it the USR1 signal (note the lines are using {{ic|amixer}} instead of {{ic|pactl}}):<br />
<br />
bindsym XF86AudioMute exec "amixer set Master toggle && killall -USR1 i3status"<br />
bindsym XF86AudioRaiseVolume exec "amixer set Master 5%+ && killall -USR1 i3status"<br />
bindsym XF86AudioLowerVolume exec "amixer set Master 5%- && killall -USR1 i3status"<br />
<br />
=== Workspace names ===<br />
<br />
Although it is not required, many people prefer naming frequently used workspaces. First you need to determine which monitor you want the workspace to open to. Simply type {{ic|xrandr}} into a terminal and it will show you the available display ports. Some common ones are LVDS1 for laptops or VGA1, HDMI1, HDMI2, etc for external monitors. If you are using [[Multihead#Xinerama|Xinerama]] instead use the outputs xinerama-0, xinerama-1, etc. Add your workspace names to {{ic|~/.i3/config}} You also need to modify the corresponding lines to switch to your workspaces as well as moving focused containers to those workspaces.<br />
<br />
# Workspace names<br />
workspace "1:Web" output LVDS1<br />
workspace "2:Mail" output LVDS1<br />
workspace "3:Irc" output LVDS1<br />
workspace "4:Shell" output LVDS1<br />
<br />
# switch to workspace<br />
bindsym $mod+1 workspace 1:Web<br />
bindsym $mod+2 workspace 2:Mail<br />
bindsym $mod+3 workspace 3:Irc<br />
bindsym $mod+4 workspace 4:Shell<br />
<br />
# move focused container to workspace<br />
bindsym $mod+Shift+1 move container to workspace 1:Web<br />
bindsym $mod+Shift+2 move container to workspace 2:Mail<br />
bindsym $mod+Shift+3 move container to workspace 3:Irc<br />
bindsym $mod+Shift+4 move container to workspace 4:Shell<br />
<br />
=== Launching programs on specific workspaces ===<br />
<br />
To maximize efficiency you can setup certain programs to automatically launch to a specific workspace. This can be accomplished one of two ways. You could use the {{ic|assign}} command so when you manually launch a program it is directed to a the workspace you assigned. An example would be:<br />
<br />
# Assign URxvt terminals to workspace 2<br />
assign [class="URxvt"] 2<br />
<br />
Or if you have renamed the workspaces like the above examples then you must set the new workspace name instead of the number:<br />
<br />
# Assign URxvt terminals to workspace 4:Shell<br />
assign [class="URxvt"] 4:Shell<br />
<br />
{{Note|To be able to determine the class, title, instance, etc of an open window you can use the tool {{ic|xprop}} by installing the package {{Pkg|xorg-xprop}} from the Extra repository.}}<br />
<br />
Alternatively you can change to your target workspace with {{ic|i3-msg}} then have your frequently used programs start automatically with the {{ic|exec}} command:<br />
<br />
exec --no-startup-id i3-msg 'workspace 1:Web; exec /usr/bin/firefox' <br />
exec --no-startup-id i3-msg 'workspace 2:Mail; exec urxvt -name Mail -e /usr/bin/mutt'<br />
exec --no-startup-id i3-msg 'workspace 3:Irc; exec /usr/bin/urxvt -name irssi -e /usr/bin/irssi'<br />
exec --no-startup-id i3-msg 'workspace 4:Shell; exec /usr/bin/urxvt'<br />
<br />
=== Tabbed or stacked web-browsing ===<br />
<br />
Some web-browsers intentionally do not implement tabs, since managing tabs is considered to be the task of the window manager, not the task of the browser.<br />
<br />
To let i3 manage your tab-less web-browser, in this example for [[uzbl]], add the following line to your {{ic|~/.i3/config}}<br />
<br />
for_window [class="Uzbl-core"] focus child, layout stacking, focus<br />
<br />
This is for stacked web browsing, meaning that the windows will be shown vertically. The advantage over tabbed browsing is that the window-titles are fully visible, even if a lot of browser windows are open.<br />
<br />
If you prefer tabbed browsing, with windows in horizontal direction ('tabs'), use<br />
<br />
for_window [class="Uzbl-core"] focus child, layout tabbed, focus<br />
<br />
=== Desktop wallpaper ===<br />
<br />
To be able to manage the desktop wallpaper, you need a lightweight image viewer like [[Feh]] or [[Nitrogen]]. Install feh with the command {{ic|# pacman -S feh}}. Then you can set your wallpaper with the following command:<br />
<br />
$ feh --bg-scale /path/to/image.file<br />
<br />
To have feh set your image to the Desktop Wallpaper add the following line to your {{ic|~/.i3/config}}<br />
<br />
exec --no-startup-id sh ~/.fehbg<br />
<br />
=== Terminal emulator ===<br />
<br />
By default when you press {{ic|$mod+Return}} it launches the {{ic|i3-sensible-terminal}} which is a script that invokes a terminal. It attempts to start one of these terminals in the following order:<br />
<br />
* {{ic|$TERMINAL}}<br />
* [[urxvt]]<br />
* {{pkg|rxvt}}<br />
* [[terminator]]<br />
* {{AUR|Eterm}}<br />
* {{AUR|aterm}}<br />
* [[xterm]]<br />
* {{pkg|gnome-terminal}}<br />
* {{pkg|roxterm}}<br />
* {{pkg|xfce4-terminal}}<br />
<br />
You can force it to launch your terminal of choice by modifying this line<br />
<br />
bindsym $mod+Return exec i3-sensible-terminal<br />
<br />
=== Scratchpad ===<br />
<br />
Having a scratchpad to jot down or paste notes quickly is very handy! i3 has a feature that allows you to move a window to a scratchpad workspace. Basically it will be hidden from view until you recall it with the {{ic|scratchpad show}} command. To send a focused window to the scratchpad with {{ic|$mod+Shift+minus}} or to recall it with {{ic|$mod+minus}} enter these lines into your {{ic|~/.i3/config}}<br />
<br />
# Make the currently focused window a scratchpad<br />
bindsym $mod+Shift+minus move scratchpad<br />
<br />
# Show the first scratchpad window<br />
bindsym $mod+minus scratchpad show<br />
<br />
You can start your favorite editor (ie Gedit, vim, nano, etc) on startup and have it automatically moved to the scratchpad workspace to quickly recall it when needed. The following example when placed in {{ic|~/.i3/config}} shows how you can start the urxvt terminal, have it launch the nano editor, and then move it to the scratchpad:<br />
<br />
# starting a specially named term automatically <br />
exec --no-startup-id urxvt -name scratchpad -e /usr/bin/nano<br />
# move this to scratchpad, if active<br />
for_window [class="URxvt" instance="scratchpad"] move scratchpad<br />
<br />
=== Shutdown, reboot, lock screen ===<br />
As there are no Shutdown, Reboot, or Lock Screen buttons, we can add some hotkey combinations to help us out. First we need to create this script and save it as {{ic|i3exit}}. Remember to make it executable with {{ic|chmod +x}} and to place it somewhere in your {{ic|$PATH}}. This script assumes that you have {{Pkg|polkit}} installed to allow unprivileged users to run [[systemd#Power_management|power management]] commands.<br />
<br />
{{bc|<nowiki><br />
#!/bin/sh<br />
lock() {<br />
i3lock<br />
}<br />
<br />
case "$1" in<br />
lock)<br />
lock<br />
;;<br />
logout)<br />
i3-msg exit<br />
;;<br />
suspend)<br />
lock && systemctl suspend<br />
;;<br />
hibernate)<br />
lock && systemctl hibernate<br />
;;<br />
reboot)<br />
systemctl reboot<br />
;;<br />
shutdown)<br />
systemctl poweroff<br />
;;<br />
*)<br />
echo "Usage: $0 {lock|logout|suspend|hibernate|reboot|shutdown}"<br />
exit 2<br />
esac<br />
<br />
exit 0<br />
</nowiki>}}<br />
<br />
Now add the following lines to your {{ic|~/.i3/config}} Once completed you will be presented with a prompt whenever you press {{ic|$mod+pause}}.<br />
<br />
set $mode_system System (l) lock, (e) logout, (s) suspend, (h) hibernate, (r) reboot, (Shift+s) shutdown<br />
mode "$mode_system" {<br />
bindsym l exec --no-startup-id i3exit lock, mode "default"<br />
bindsym e exec --no-startup-id i3exit logout, mode "default"<br />
bindsym s exec --no-startup-id i3exit suspend, mode "default"<br />
bindsym h exec --no-startup-id i3exit hibernate, mode "default"<br />
bindsym r exec --no-startup-id i3exit reboot, mode "default"<br />
bindsym Shift+s exec --no-startup-id i3exit shutdown, mode "default" <br />
<br />
# back to normal: Enter or Escape<br />
bindsym Return mode "default"<br />
bindsym Escape mode "default"<br />
}<br />
bindsym $mod+Pause mode "$mode_system"<br />
<br />
=== Screensaver and power management ===<br />
<br />
You can use [[Display_Power_Management_Signaling|DPMS]] to blank your screen or to suspend/poweroff your monitor. Adding the following line to your {{ic|~/.i3/config}} will suspend your monitor after 10 minutes.<br />
<br />
exec --no-startup-id xset dpms 600<br />
<br />
With {{AUR|xss-lock}} you can register a screenlocker for your i3 session. xss-lock subscribes to the systemd-events {{ic|suspend}}, {{ic|hibernate}}, {{ic|lock-session}}, and {{ic|unlock-session}} with appropriate actions (run locker and wait for user to unlock or kill locker). It also reacts to the [[Display Power Management Signaling#xset screen-saver control|X screensaver]] and runs or kills the locker in response to the x-server signals. Start xss-lock in your autostart like this:<br />
xss-lock -- i3lock -i ''background_image'' &<br />
<br />
== Usage ==<br />
<br />
See the [http://i3wm.org/docs official documentation] on this subject for more information: [http://i3wm.org/docs/userguide.html i3 User’s Guide]<br />
<br />
In i3, commands are invoked using a modifier key, which is referred to as {{ic|$mod}}. This is the Alt key (Mod1) by default, with the Windows key (Mod4) being a popular alternative.<br />
<br />
=== Default keybindings ===<br />
<br />
(Many thanks for Funtoo Linux team for the excellent wiki (http://www.funtoo.org/I3_Tiling_Window_Manager))<br />
<br />
{| class="wikitable"<br />
! Key !! Command<br />
|-<br />
|$mod + Enter || Open terminal<br />
|-<br />
|$mod + A || Focus Parent<br />
|-<br />
|$mod + S || Stacked Layout<br />
|-<br />
|$mod + W || Tabbed Layout<br />
|-<br />
|$mod + E || Default Layout<br />
|-<br />
|$mod + SpaceBar || Focus tiling/floating<br />
|-<br />
|$mod + D || dmenu<br />
|-<br />
|$mod + H || Split Horizontal<br />
|-<br />
|$mod + V || Split Vertically<br />
|-<br />
|$mod + J || Left<br />
|-<br />
|$mod + K || Down<br />
|-<br />
|$mod + J || Up<br />
|-<br />
|$mod + ; || Right<br />
|-<br />
|$mod + Shift + Q || Kill window<br />
|-<br />
|$mod + Shift + E || Exit i3<br />
|-<br />
|$mod + Shift + C || Reload i3config without restarting<br />
|-<br />
|$mod + Shift + R || Restart i3 (reloads i3config without exiting i3)<br />
|-<br />
|$mod + Shift + J || Move left<br />
|-<br />
|$mod + Shift + K || Move down<br />
|-<br />
|$mod + Shift + L || Move up<br />
|-<br />
|$mod + Shift + : || Move right<br />
|-<br />
|$mod + Shift + SpaceBar || Toggle tiling/floating<br />
|}<br />
<br />
=== Application launcher ===<br />
<br />
i3 currently uses [[dmenu]] as a application launcher, which is bound by default to {{ic|$mod+d}}.<br />
<br />
By default i3-dmenu-desktop is used as a wrapper for dmenu. i3-dmenu-desktop creates a list of all installed applications via their .desktop files. There is a rewrite of this perl script called {{AUR|j4-dmenu-desktop-git}}, which is a near-drop-in replacement for the script shipped with i3, but much faster.<br />
<br />
== Troubleshooting ==<br />
<br />
=== Mouse cursor remains in waiting mode ===<br />
<br />
When starting a shell script or an application which does not support startup notifications, mouse cursor will remain in busy/watch/clock mode for 60 seconds.<br />
<br />
To fix this issue, add {{ic|--no-startup-id}} parameter to that particular {{ic|exec}} command, for example:<br />
<br />
exec --no-startup-id ~/script<br />
bindsym $mod+d exec --no-startup-id dmenu_run<br />
<br />
== See also ==<br />
<br />
* [http://i3wm.org/docs/userguide.html i3 User Guide]<br />
* [[Comparison of Tiling Window Managers]]<br />
* [http://i3wm.org Official website]<br />
* [http://code.stapelberg.de/git/i3 Source code]<br />
* [http://github.com/acrisci/i3ipc-glib i3ipc-glib] - A library for i3 extensions<br />
* [https://github.com/ashinkarov/i3-extras Collection of scripts and patches]<br />
<br />
'''Arch Linux Forums'''<br />
* [https://bbs.archlinux.org/viewtopic.php?id=99064 The i3 thread] - A general discussion about i3<br />
* [https://bbs.archlinux.org/viewtopic.php?id=103369 i3 desktop screenshots and config sharing]</div>Tonyctlhttps://wiki.archlinux.org/index.php?title=User_talk:Tonyctl&diff=310457User talk:Tonyctl2014-04-15T11:28:31Z<p>Tonyctl: Add my talk page</p>
<hr />
<div>=== Hello ===<br />
<br />
This is my talk page.<br />
<br />
[[User:Tonyctl|Tonyctl]] ([[User talk:Tonyctl|talk]]) 11:28, 15 April 2014 (UTC)</div>Tonyctlhttps://wiki.archlinux.org/index.php?title=User:Tonyctl&diff=310456User:Tonyctl2014-04-15T11:25:35Z<p>Tonyctl: Really add my user page</p>
<hr />
<div><div style="width: 500px">I'm a developer who contributes mostly to small community projects for Linux desktop like i3 window manager and I've made a few utilities that help people make their desktops easier to use and more expressive of their style. My goal is to promote the Linux desktop and my favorite projects for fun and profit and to help others appreciate the real depth of its abilities. If I start to break anything, please let me know and I will stop.</div><br />
<br />
[[User:Tonyctl|Tonyctl]] ([[User talk:Tonyctl|talk]]) 11:25, 15 April 2014 (UTC)</div>Tonyctlhttps://wiki.archlinux.org/index.php?title=User_talk:Tonyctl&diff=310455User talk:Tonyctl2014-04-15T11:21:52Z<p>Tonyctl: Add my user page</p>
<hr />
<div>I'm a developer who contributes mostly to small community projects for Linux desktop like [[i3|i3 window manager]] and I've made a few utilities that help people make their desktops easier to use and more expressive of their style. My goal is to promote the Linux desktop and my favorite projects for fun and profit and to help others appreciate the real depth of its abilities. If I start to break anything, please let me know and I will stop.</div>Tonyctlhttps://wiki.archlinux.org/index.php?title=Firefox/Tweaks&diff=296676Firefox/Tweaks2014-02-09T14:05:49Z<p>Tonyctl: Add information about website styles and style-managing add-ons</p>
<hr />
<div>[[tr:Firefox İpuçları]]<br />
[[Category:Web Browser]]<br />
{{Related articles start}}<br />
{{Related|Firefox}}<br />
{{Related|Browser Plugins}}<br />
{{Related|Firefox Ramdisk}}<br />
{{Related articles end}}<br />
<br />
This page contains advanced Firefox configuration options and performance tweaks.<br />
<br />
== Performance ==<br />
<br />
Improving Firefox's performance is divided into parameters that can be inputted while running Firefox or otherwise modifying its configuration as intended by the developers, and advanced procedures that involve foreign programs or scripts.<br />
<br />
{{Note|Always use the latest version of Firefox.}}<br />
<br />
=== Advanced Firefox options ===<br />
This section contains advanced Firefox options for performance tweaking. For additional information see [http://kb.mozillazine.org/Category:Tweaking_preferences these Mozillazine forum posts].<br />
<br />
==== Network settings ====<br />
<br />
Advanced network settings can be found on the {{ic|about:config}} page (try searching for ''network'').<br />
<br />
{| class="wikitable" border="1" style="width: 100%;" cellpadding="5" cellspacing="0"<br />
|+ Recommended values for a 1.5Mb connection<br />
! Key || Value || Description<br />
|-<br />
| network.http.pipelining || true || Enable [http://www-archive.mozilla.org/projects/netlib/http/pipelining-faq.html pipelining] for normal connections<br />
|-<br />
| network.http.proxy.pipelining || true || Enable pipelining for proxy connections<br />
|-<br />
| network.http.pipelining.maxrequests || 8 || Maximum HTTP requests per pipeline<br />
|-<br />
| network.http.max-connections || 64 || Maximum number of total HTTP connections<br />
|-<br />
| network.http.max-connections-per-server || 16 || Maximum number of any type of connections per server<br />
|-<br />
| network.http.max-persistent-connections-per-proxy || 16 || Maximum number of keep-alive type connections per proxy<br />
|-<br />
| network.http.max-persistent-connections-per-server || 8 || Maximum number of keep-alive type connections per server<br />
|-<br />
| network.dns.disableIPv6 || true || Disable IPv6 support<br />
|}<br />
<br />
{{Note|These settings need to be configured based on your connection.}}<br />
<br />
==== Turn off anti-phishing ====<br />
{{Note|Deleting files from your profile folder is potentially dangerous, so it is recommended that you back it up first.}}<br />
<br />
The anti-phishing features of Firefox may cause Firefox to become slow to start or exit. The problem is that Firefox maintains an [[Sqlite]] database that can grow quite big which makes reading and writing slower after repeated use. If you feel that you do not need Firefox to tell you which sites may be suspect you can disable this feature:<br />
<br />
* Turn off the following options under the security tab in preferences: ''"Block reported attack sites"'' and ''"Block reported web forgeries"''.<br />
<br />
* Delete all files beginning with {{ic|urlclassifier}} in your profile folder ({{ic|~/.mozilla/firefox/<profile_dir>/}}):<br />
$ rm -i ~/.mozilla/firefox/<profile_dir>/urlclassifier*<br />
<br />
:Some of these files might be recreated by Firefox, but they won't grow any larger than their initial size.<br />
<br />
==== Stop urlclassifier3.sqlite from being created again ====<br />
If you did remove all the {{ic|urlclassifier*}} files as mentioned above, you may find out that {{ic|urlclassifier3.sqlite}} keeps growing again after a certain time. Here is a simple solution to avoid it for now and ever.<br />
<br />
$ cd ~/.mozilla/firefox/<profile_dir><br />
$ echo "" > urlclassifier3.sqlite<br />
$ chmod 400 urlclassifier3.sqlite<br />
<br />
This effectively makes the file empty and then read-only so Firefox cannot write to it anymore.<br />
<br />
==== Turn off OCSP validation ====<br />
The OCSP validation of Firefox may cause Firefox to become slow every time a HTTPS connections to a new site is done (see [http://news.netcraft.com/archives/2013/04/16/certificate-revocation-and-the-performance-of-ocsp.html this article] for details). This may be particularly bad in recent times where web gadgets are included in pages via HTTPS (the "like" buttons of the social networks for example) resulting in many HTTPS connections for a single URL loaded.<br />
<br />
* Turn off the following option under the advanced tab in preferences -> Encryption -> Validation: ''"Use the Online Certificate Status Protocol (OCSP) to confirm the current validity of certificates"''.<br />
<br />
{{Note|Disabling OCSP valdation makes browser vulnerable to man-in-the-middle attacks.}}<br />
<br />
==== Turn off the disk cache ====<br />
Every object loaded (html pages, jpeg images, css stylesheets, gif banners) is saved in the Firefox cache, to be loaded in the future without to download it again from the server, but only fraction of these objects will be really reused without download (usually the 30%). This because of too short expiration times for the objects, updates or simply the user behavior (to load new pages instead the ones already visited). The Firefox cache is divided in memory and disk cache and using the disk cache results to frequent disk writes, because every time an object loaded it is written to the disk and some older object is removed.<br />
<br />
* Turn on the following option under the advanced tab in preferences -> Network -> Validation: ''"Override automatic cache management"'' and specify zero in ''"Limit cache to"''.<br />
<br />
==== Longer interval to save session ====<br />
The Firefox session store automatically saves the current status (opened urls, cookies, history and bookmarks) to the disk every 15 seconds. It may be too frequent for the user needs, resulting in a frequent disk access. <br />
<br />
This setting can be found on the {{ic|about:config}} page (try searching for ''sessionstore'').<br />
<br />
* browser.sessionstore.interval 300000<br />
<br />
=== Other modifications ===<br />
This section contains some other modifications that may increase Firefox's performance.<br />
<br />
==== Reduce load time by compressing the Firefox binary with UPX ====<br />
[http://upx.sourceforge.net/ UPX] is an executable packer that supports very fast decompression and induces no memory overhead. It can be [[pacman|installed]] with the {{Pkg|upx}} package, availalble in the [[official repositories]].<br />
<br />
Before using {{ic|upx}} to compress the Firefox executable, make a backup of the binary:<br />
# cp /usr/lib/firefox/firefox /usr/lib/firefox/firefox.backup<br />
<br />
Finally, invoke {{ic|upx}}, applying the best possible compression level:<br />
# upx --best /usr/lib/firefox/firefox<br />
<br />
==== Defragment the profile's SQLite databases ====<br />
{{Warning|This procedure may damage the databases in such a way that sessions are not saved properly.}}<br />
<br />
In Firefox 3.0, bookmarks, history, passwords are kept in an SQLite databases. SQLite databases become fragmented over time and empty spaces appear all around. But, since there are no managing processes checking and optimizing the database, these factors eventually result in a performance hit. A good way to improve start-up and some other bookmarks and history related tasks is to defragment and trim unused space from these databases.<br />
<br />
{{AUR|profile-cleaner}} in the [[AUR]] does just this.<br />
<br />
{| class="wikitable" border="1" style="width: 100%;" cellpadding="5" cellspacing="0"<br />
|+ Sample size differences comparison<br />
! SQLite database || Size Before || Size After || % change<br />
|- <br />
|urlclassifier3.sqlite|| 37 M || 30 M || 19 %<br />
|-<br />
|places.sqlite || 16 M || 2.4 M || 85 %<br />
|-<br />
|}<br />
<br />
==== Cache the entire profile into RAM via tmpfs ====<br />
If the system has memory to spare, {{ic|tmpfs}} can be used to [[Firefox Ramdisk|cache the entire profile directory]], which might result in increased Firefox responsiveness.<br />
<br />
== Appearance ==<br />
=== Fonts ===<br />
{{Box||See the main article: [[Font Configuration]]|#E5E5FF|#FCFCFC}}<br />
<br />
==== Configure the DPI value ====<br />
Modifying the following value can help improve the way fonts looks in Firefox if the system's DPI is below 96. Firefox, by default, uses 96 and only uses the system's DPI if it is a higher value. To force the system's DPI regardless of its value, type {{ic|about:config}} into the address bar and set {{ic|layout.css.dpi}} to '''0'''.<br />
<br />
Note that the above method only affects the Firefox user interface's DPI settings. Web page contents still use a DPI value of 96, which may look ugly or, in the case of high-resolution displays, may be rendered too small to read. A solution is to change {{ic|layout.css.devPixelsPerPx}} to system's DPI divided by 96. For example, if your system's DPI is 144, then the value to add is 144/96 = 1.5. Changing {{ic|layout.css.devPixelsPerPx}} to '''1.5''' makes web page contents use a DPI of 144, which looks much better.<br />
<br />
==== Default font settings from Microsoft Windows ====<br />
Below are the default font preferences when Firefox is installed in Microsoft Windows. Many web sites use the Microsoft fonts.<br />
{{bc|<br />
Proportional: Serif Size (pixels): 16<br />
Serif: Times New Roman<br />
Sans-serif: Arial<br />
Monospace: Courier New Size (pixels): 13<br />
}}<br />
<br />
=== General user interface CSS settings ===<br />
Firefox's user interface can be modified by editing the {{ic|userChrome.css}} and {{ic|userContent.css}} files in {{ic|~/.mozilla/firefox/<profile_dir>/chrome/}} (''profile_dir'' is of the form ''hash.name'', where the ''hash'' is an 8 character, seemingly random string and the profile ''name'' is usually ''default'').<br />
<br />
{{Note|The {{ic|chrome/}} folder and {{ic|userChrome.css}}/{{ic|userContent.css}} files may not necessarily exist, so you have to create them.}}<br />
<br />
This section only deals with the {{ic|userChrome.css}} file which modifies Firefox's user interface, and not web pages.<br />
<br />
==== Change the font ====<br />
The setting effectively overrides the global GTK+ font preferences, and does not affect webpages, only the user interface itself:<br />
{{hc|~/.mozilla/firefox/<profile_dir>/chrome/userChrome.css|<br />
* {<br />
font-family: "FONT_NAME";<br />
}<br />
}}<br />
<br />
==== Hide button icons ====<br />
Enables text-only buttons:<br />
{{hc|~/.mozilla/firefox/<profile_dir>/chrome/userChrome.css|<br />
.button-box .button-icon {<br />
display: none;<br />
}<br />
}}<br />
<br />
==== Hiding various tab buttons ====<br />
These settings hide the arrows that appear to the horizontal edges of the tab bar, the button that toggles the "all tabs" drop-down list, and the plus sign button that creates a new tab.<br />
{{hc|~/.mozilla/firefox/<profile_dir>/chrome/userChrome.css|<nowiki><br />
/* Tab bar */<br />
<br />
.tabbrowser-strip *[class^="scrollbutton"] {<br />
/* Hide tab scroll buttons */<br />
display: none;<br />
}<br />
<br />
.tabbrowser-strip *[class^="tabs-alltabs"] {<br />
/* Hide tab drop-down list */<br />
display: none;<br />
}<br />
<br />
.tabbrowser-strip *[class^="tabs-newtab-button"] {<br />
/* Hide new-tab button */<br />
display: none;<br />
}</nowiki><br />
}}<br />
<br />
==== Horizontal tabs ====<br />
To place the tab bar horizontally stacked along the sides of the browser window:<br />
{{hc|~/.mozilla/firefox/<profile_dir>/chrome/userChrome.css|<br />
/* Display the tabbar on the left */<br />
#content > tabbox {<br />
-moz-box-orient: horizontal;<br />
}<br />
<br />
.tabbrowser-strip {<br />
-moz-box-orient: vertical;<br />
/*<br />
* You can set this to -moz-scrollbars-vertical instead,<br />
* but then the scrollbar will *always* be visible. this way<br />
* there is never a scrollbar, so it behaves like the tab bar<br />
* normally does<br />
*/<br />
overflow: -moz-scrollbars-none;<br />
}<br />
<br />
.tabbrowser-tabs {<br />
-moz-box-orient: horizontal;<br />
min-width: 20ex; /* You may want to increase this value */<br />
-mox-box-pack: start;<br />
-moz-box-align: start;<br />
}<br />
<br />
.tabbrowser-tabs > hbox {<br />
-moz-box-orient: vertical;<br />
-moz-box-align: stretch;<br />
-moz-box-pack: start;<br />
}<br />
<br />
.tabbrowser-tabs > hbox > tab {<br />
-moz-box-align: start;<br />
-moz-box-orient: horizontal;<br />
}<br />
}}<br />
<br />
==== Auto-hide Bookmarks Toolbar ====<br />
{{hc|~/.mozilla/firefox/<profile_dir>/chrome/userChrome.css|<br />
#PersonalToolbar {<br />
visibility: collapse !important;<br />
}<br />
<br />
#navigator-toolbox:hover > #PersonalToolbar {<br />
visibility: visible !important;<br />
}<br />
}}<br />
<br />
==== Remove sidebar width restrictions ====<br />
{{hc|~/.mozilla/firefox/<profile_dir>/chrome/userChrome.css|<br />
/* remove maximum/minimum width restriction of sidebar */<br />
#sidebar {<br />
max-width: none !important;<br />
min-width: 0px !important;<br />
}<br />
}}<br />
<br />
=== Web content CSS settings ===<br />
This section deals with the {{ic|userContent.css}} file in which you can add custom CSS rules for web content. Changes to this file will take effect once the browser is restarted.<br />
<br />
This file can be used for making small fixes or to apply personal styles to frequently visited websites. Custom stylesheets for popular websites are available from sources such as [http://userstyles.org/ userstyles.org]. You can install an add-on such as [https://addons.mozilla.org/en-US/firefox/addon/superusercontent/ superUserContent] to manage themes. This add-on creates the directory {{ic|chrome/userContent.css.d}} and applies changes to the CSS files therein when the page is refreshed.<br />
<br />
=== Import other CSS files === <br />
{{hc|~/.mozilla/firefox/<profile_dir>/chrome/userContent.css|<br />
@import url("./imports/some_file.css");<br />
}}<br />
<br />
<br />
<br />
==== Block certain parts of a domain ====<br />
{{hc|~/.mozilla/firefox/<profile_dir>/chrome/userContent.css|<br />
@-moz-document domain(example.com) {<br />
div#header {<br />
background-image: none !important;<br />
} <br />
}<br />
}}<br />
<br />
==== Add [pdf] after links to PDF files ====<br />
{{hc|~/.mozilla/firefox/<profile_dir>/chrome/userContent.css|<nowiki><br />
/* add '[pdf]' next to links to PDF files */<br />
a[href$=".pdf"]:after {<br />
font-size: smaller;<br />
content: " [pdf]";<br />
}</nowiki><br />
}}<br />
<br />
==== Show URLs at the bottom of the screen when hovering a link ====<br />
{{hc|~/.mozilla/firefox/<profile_dir>/chrome/userContent.css|<br />
a[href]:hover {<br />
text-decoration: none !important;<br />
}<br />
<br />
a[href]:hover:after {<br />
content: attr(href);<br />
position: fixed; left: 0px; bottom: 0px;<br />
padding: 0 2px !important;<br />
max-width: 95%; overflow: hidden;<br />
white-space: nowrap; text-overflow: ellipsis;<br />
font:10pt sans-serif !important;<br />
background-color: black !important;<br />
color: white !important;<br />
opacity: 0.7;<br />
z-index: 9999;<br />
}<br />
}}<br />
<br />
==== Firefox 4 New Menu Bar/Firefox Button ====<br />
To toggle between the new Firefox button and the classic menu bar:<br />
* if the button is active, check ''Preferences > Menu Bar'', or right click in the toolbar area and check ''Menu Bar''.<br />
* if the menu bar is active, uncheck ''View > Toolbars > Menu Bar'', or right click in the toolbar area and uncheck ''Menu Bar''.<br />
<br />
In GNU/Linux, you will just get a plain grey button instead of the new orange one from Windows. However you can change this to either a Firefox icon or the icon followed by the "Firefox" text.<br />
<br />
Adding the following to your {{ic|~/.mozilla/firefox/userprofile/chrome/userChrome.css}} file will place the icon before the text:<br />
{{bc|<br />
#appmenu-toolbar-button {<br />
list-style-image: url("chrome://branding/content/icon16.png");<br />
}<br />
}}<br />
<br />
Adding the following to the same file will ''remove'' the "Firefox" text:<br />
{{bc|<br />
#appmenu-toolbar-button > .toolbarbutton-text,<br />
#appmenu-toolbar-button > .toolbarbutton-menu-dropmarker {<br />
display: none !important;<br />
}<br />
}}<br />
<br />
<br />
This userChrome.css configuration copies the default Windows Firefox 4+ look and adds an orange background to the button, with a purple background in Private Browsing mode:<br />
{{bc|<br />
#main-window:not([privatebrowsingmode]) #appmenu-toolbar-button {<br />
-moz-appearance: none !important;<br />
color: #FEEDFC !important;<br />
background: -moz-linear-gradient(hsl(34,85%,60%), hsl(26,72%,53%) 95%) !important;<br />
border: 1px solid #000000 !important;<br />
}<br />
<br />
#main-window:not([privatebrowsingmode]) #appmenu-toolbar-button:hover:not(:active):not([open]) {<br />
-moz-appearance: none !important;<br />
color: #FEEDFC !important;<br />
background: -moz-linear-gradient(hsl(26,72%,53%), hsl(34,85%,60%) 95%) !important;<br />
border: 1px solid #000000 !important;<br />
}<br />
<br />
<br />
#main-window:not([privatebrowsingmode]) #appmenu-toolbar-button:hover:active,<br />
#main-window:not([privatebrowsingmode]) #appmenu-toolbar-button[open] {<br />
-moz-appearance: none !important;<br />
color: #FEEDFC !important;<br />
background: -moz-linear-gradient(hsl(26,72%,53%), hsl(26,72%,53%) 95%) !important;<br />
border: 1px solid #000000 !important;<br />
}<br />
<br />
#appmenu-toolbar-button {<br />
-moz-appearance: none !important;<br />
color: #FEEDFC !important;<br />
background: -moz-linear-gradient(hsl(279,70%,46%), hsl(276,75%,38%) 95%) !important;<br />
border: 1px solid #000000 !important;<br />
}<br />
<br />
<br />
#main-window #appmenu-toolbar-button:hover:not(:active):not([open]) {<br />
-moz-appearance: none !important;<br />
color: #FEEDFC !important;<br />
background: -moz-linear-gradient(hsl(276,75%,38%), hsl(279,70%,46%) 95%) !important;<br />
border: 1px solid #000000 !important;<br />
}<br />
<br />
<br />
#main-window #appmenu-toolbar-button:hover:active,<br />
#main-window #appmenu-toolbar-button[open] {<br />
-moz-appearance: none !important;<br />
color: #FEEDFC !important;<br />
background: -moz-linear-gradient(hsl(276,75%,38%), hsl(276,75%,38%) 95%) !important;<br />
border: 1px solid #000000 !important;<br />
}<br />
}}<br />
<br />
{{Note|You need to create both the {{ic|chrome}} directory and {{ic|userChrome.css}}, if they do not already exist.}}<br />
<br />
==== Block ads ====<br />
<br />
See [http://www.floppymoose.com floppymoose.com] for an example of how to use {{ic|userContent.css}} as a basic ad-blocker.<br />
<br />
== Miscellaneous ==<br />
<br />
Other tips and tweaks.<br />
<br />
=== Mouse wheel scroll speed ===<br />
<br />
To modify the default values (i.e. speed-up) of the mouse wheel scroll speed, go to {{ic|about:config}} and search for {{ic|mousewheel.acceleration}}. This will show the available options, modifying the following:<br />
<br />
* Set {{ic|mousewheel.acceleration.start}} to '''-1'''.<br />
* Set {{ic|mousewheel.acceleration.factor}} to the desired number (10 to 20 are common values).<br />
<br />
Alternatively you can install the [http://smoothwheel.mozdev.org/ SmoothWheel add-on].<br />
<br />
=== Change the order of search engines in the Firefox Search Bar ===<br />
<br />
To change the order search engines are displayed in:<br />
* Open the drop-down list of search engines and click ''Manage Search Engines...'' entry.<br />
* Highlight the engine you want to move and use ''Move Up'' or ''Move Down'' to move it. Alternatively, you can use drag-and-drop.<br />
<br />
=== How to open a *.doc automatically with Abiword or LibreOffice Writer ===<br />
<br />
Go to ''Preferences > Applications'' and search for ''Word Document'' (or ''Word 2007 Document'' for {{ic|*.docx}}). After finding it, click the drop-down list and select ''Use other...''. From there you have to specify the exact path to the Abiword or Writer executable (i.e.{{ic|/usr/bin/abiword}} or {{ic|/usr/bin/lowriter}}).<br />
<br />
=== "I'm Feeling Lucky" mode ===<br />
Some search engines have a feeling lucky feature. For example Google has "I'm Feeling Lucky" and DuckDuckGo has "I'm Feeling Ducky".<br />
<br />
To activate them:<br />
# Type {{ic|about:config}} in the address bar.<br />
# Search for the string {{ic|keyword.url}}.<br />
# Modify its value (if any) to the URL of the search engine. <br />
<br />
For Google, set it to:<br />
{{bc|<nowiki>http://www.google.com/search?btnI=I%27m+Feeling+Lucky&q=</nowiki>}}<br />
For DuckDuckGo, set it to:<br />
{{bc|<nowiki>https://duckduckgo.com/?q=\</nowiki>}}<br />
For Google Encrypted (RCA-4 128bit High security encyption), set it to:<br />
{{bc|<nowiki>https://encrypted.google.com/search?btnI=I%27m+Feeling+Lucky&q=</nowiki>}}<br />
<br />
=== Secure DNS with DNSSEC validator ===<br />
<br />
You can enable [[DNSSEC]] support for safer browsing.<br />
<br />
=== Adding magnet protocol association ===<br />
<br />
In {{ic|about:config}} set {{ic|network.protocol-handler.expose.magnet}} to '''false'''.<br />
<br />
The next time you open a magnet link, you will be prompted with a {{ic|Launch Application}} dialogue. From there simply select your chosen torrent client. This technique can also be used with other protocols.<br />
<br />
=== Prevent accidental closing ===<br />
<br />
The [https://addons.mozilla.org/en-us/firefox/addon/disable-ctrl-q-shortcut/ Disable Ctrl-Q Shortcut] extension can be installed to prevent unwanted closing of the browser.<br />
<br />
An alternative is to add a rule in your window manager configuration file. For example in openbox add:<br />
<keybind key="C-q"><br />
<action name="Execute"><br />
<execute>false</execute><br />
</action><br />
</keybind><br />
in the ''<keyboard>'' section of your {{ic|rc.xml}} file.<br />
{{Note|This will be effective for every application used under a graphic server.}}<br />
<br />
=== Plugins don't work with latest version ===<br />
<br />
Due to Arch's bleeding edge nature, there can be some compatibility issues with plugins not working with the latest Firefox install (e.g. [http://5digits.org/pentadactyl/index Pentadactyl]). If possible, try installing the nightly/beta builds available, or see [[Downgrading Packages]].<br />
<br />
[https://addons.mozilla.org/en-us/firefox/addon/checkcompatibility/?src=userprofile Disable Add-on Compatibility Checks] plugin should take care of spurious compatibility issues when the plugins get disabled, even though they work just fine with the new version.<br />
<br />
== See also ==<br />
<br />
* [http://kb.mozillazine.org/Knowledge_Base MozillaZine Wiki]<br />
* [http://kb.mozillazine.org/About:config_entries about:config Entries Explained]<br />
* [http://linuxtidbits.wordpress.com/2009/08/01/better-fox-cat-and-weasel/ Firefox tuneup: configuration necessities]<br />
* [http://linuxtidbits.wordpress.com/2013/03/08/firefox-defining-font-type-and-size/ Firefox: Defining font type and size]</div>Tonyctl