https://wiki.archlinux.org/api.php?action=feedcontributions&user=Wildeyes&feedformat=atomArchWiki - User contributions [en]2024-03-19T07:26:05ZUser contributionsMediaWiki 1.41.0https://wiki.archlinux.org/index.php?title=Xmonad&diff=341875Xmonad2014-10-26T08:43:02Z<p>Wildeyes: This is the actual location</p>
<hr />
<div>[[Category:Tiling WMs]]<br />
{{lowercase title}}<br />
[[fr:Xmonad]]<br />
[[ja:Xmonad]]<br />
[[tr:Xmonad_Pencere_Yöneticisi]]<br />
[[zh-CN:Xmonad]]<br />
[http://xmonad.org/ xmonad] is a tiling window manager for X. Windows are arranged automatically to tile the screen without gaps or overlap, maximizing screen use. Window manager features are accessible from the keyboard: a mouse is optional.<br />
<br />
xmonad is written, configured and extensible in [http://haskell.org/ Haskell]. Custom layout algorithms, key bindings and other extensions may be written by the user in config files.<br />
<br />
Layouts are applied dynamically, and different layouts may be used on each workspace. Xinerama is fully supported, allowing windows to be tiled on several physical screens.<br />
<br />
For more information, please visit the xmonad website: http://xmonad.org/<br />
<br />
== Installation ==<br />
<br />
{{Pkg|xmonad}} and {{Pkg|xmonad-contrib}} are currently available in the [[official repositories]]. A build for the current development snapshot (darcs) is in the [[Arch User Repository|AUR]]. The following instructions are for {{AUR|xmonad-darcs}}, the development snapshot.<br />
<br />
{{Note|If you choose to use the [[ArchHaskell]] repositories, you need to install the ''haskell-xmonad'' package instead of {{Pkg|xmonad}} (which is in the official community repo and has different dependencies).}}<br />
<br />
=== Development version (xmonad-darcs) ===<br />
<br />
The xmonad-darcs development version can be installed from the [[Arch User Repository|AUR]], with some additional dependencies in the [[official repositories]]. [[pacman|Install]] them in the following order:<br />
<br />
* {{AUR|xmonad-darcs}} -- The core window manager<br />
* {{AUR|xmonad-contrib-darcs}} -- Contributed extensions providing custom layouts, configurations, etc.<br />
<br />
== Configuration ==<br />
<br />
=== Starting xmonad ===<br />
To start xmonad automatically, simply add the command {{Ic|xmonad}} to your startup script (e.g. {{ic|~/.xinitrc}} if you use startx, {{ic|~/.xsession}} if you use xdm login manager). GDM and KDM users can create a new session file and then select xmonad from the appropriate Session menu.<br />
<br />
{{Note|By default, xmonad does not set an X cursor, therefore the "cross" cursor is usually displayed which can be confusing for new users (thinking that xmonad has not launched correctly). To set the expected left-pointer, add the following to your startup file (e.g. {{ic|~/.xinitrc}}):<br><br />
{{bc|xsetroot -cursor_name left_ptr}}}}<br />
<br />
Also, xmonad defaults to the U.S. keyboard layout, so if you want, for example, the German keyboard layout, add the following to {{ic|~/.xinitrc}} or read more about setting keyboard layouts [[Keyboard_configuration_in_Xorg|here]]:<br />
setxkbmap -layout de<br />
<br />
Example {{ic|~/.xinitrc}}:<br />
# set the cursor<br />
xsetroot -cursor_name left_ptr<br />
# set German keyboard layout<br />
setxkbmap -layout de<br />
# start xmonad<br />
exec xmonad<br />
<br />
If, for some reason, xmonad does not start, check if you have an {{ic|.xmonad}} directory in your home directory. If not, create it:<br />
mkdir ~/.xmonad<br />
<br />
See [[xinitrc]] for details, such as preserving the logind session.<br />
<br />
=== Configuring xmonad ===<br />
<br />
xmonad users can modify, override or extend the default settings with the {{ic|~/.xmonad/xmonad.hs}} configuration file. Recompiling is done on the fly, with the Mod+q shortcut.<br />
<br />
If you find you do not have a directory at {{ic|~/.xmonad}}, run {{Ic|xmonad --recompile}} to create it.<br />
<br />
The "default config" for xmonad is quite usable and it is achieved by simply running without an {{ic|xmonad.hs}} entirely. Therefore, even after you run {{Ic|xmonad --recompile}} you will most likely not have an {{ic|~/.xmonad/xmonad.hs}} file. If you would like to start tweaking things, simply create the file and edit it as described below.<br />
<br />
Because the xmonad configuration file is written in Haskell, non-programmers may have a difficult time adjusting settings. For detailed HOWTO's and example configs, we refer you to the following resources:<br />
<br />
* [http://haskell.org/haskellwiki/Xmonad xmonad wiki]<br />
* [http://haskell.org/haskellwiki/Xmonad/Config_archive xmonad config archive]<br />
* [http://haskell.org/haskellwiki/Xmonad/Frequently_asked_questions xmonad FAQ]<br />
* Arch Linux [https://bbs.archlinux.org/viewtopic.php?id=40636 forum thread]<br />
<br />
The best approach is to only place your changes and customizations in {{ic|~/.xmonad/xmonad.hs}} and write it such that any unset parameters are picked up from the built-in defaultConfig.<br />
<br />
This is achieved by writing an {{ic|xmonad.hs}} like this:<br />
<br />
import XMonad<br />
<br />
main = xmonad defaultConfig<br />
{ terminal = "urxvt"<br />
, modMask = mod4Mask<br />
, borderWidth = 3<br />
}<br />
<br />
This simply overrides the default terminal and borderWidth while leaving all other settings at their defaults (inherited from the function defaultConfig).<br />
<br />
As things get more complicated, it can be handy to call configuration options by function name inside the main function, and define these separately in their own sections of your {{ic|~/.xmonad/xmonad.hs}}. This makes large customizations like your layout and manage hooks easier to visualize and maintain.<br />
<br />
The simple {{ic|xmonad.hs}} from above could have been written like this:<br />
<br />
import XMonad<br />
<br />
main = do<br />
xmonad $ defaultConfig<br />
{ terminal = myTerminal<br />
, modMask = myModMask<br />
, borderWidth = myBorderWidth<br />
}<br />
<br />
-- yes, these are functions; just very simple ones<br />
-- that accept no input and return static values<br />
myTerminal = "urxvt"<br />
myModMask = mod4Mask -- Win key or Super_L<br />
myBorderWidth = 3<br />
<br />
Also, order at top level (main, myTerminal, myModMask etc.), or within the {} does not matter in Haskell, as long as imports come first.<br />
<br />
The following is taken from the 0.9 config file template found [http://haskell.org/haskellwiki/Xmonad/Config_archive/Template_xmonad.hs_(0.9) here]. It is an example of the most common functions one might want to define in their main do block.<br />
<br />
{<br />
terminal = myTerminal,<br />
focusFollowsMouse = myFocusFollowsMouse,<br />
borderWidth = myBorderWidth,<br />
modMask = myModMask,<br />
-- numlockMask deprecated in 0.9.1<br />
-- numlockMask = myNumlockMask,<br />
workspaces = myWorkspaces,<br />
normalBorderColor = myNormalBorderColor,<br />
focusedBorderColor = myFocusedBorderColor,<br />
<br />
-- key bindings<br />
keys = myKeys,<br />
mouseBindings = myMouseBindings,<br />
<br />
-- hooks, layouts<br />
layoutHook = myLayout,<br />
manageHook = myManageHook,<br />
handleEventHook = myEventHook,<br />
logHook = myLogHook,<br />
startupHook = myStartupHook<br />
}<br />
<br />
Also consider copying/starting with {{ic|/usr/share/x86_64-linux-ghc-VERSION/monad-VERSION/man/xmonad.hs}}, which is the latest official example xmonad.hs that comes with the '''xmonad''' Haskell module.<br />
<br />
=== Exiting xmonad ===<br />
To end the current xmonad session, press {{ic|Mod+Shift+Q}}. By default, {{ic|Mod}} is the {{ic|Alt}} key.<br />
<br />
== Tips and tricks ==<br />
=== X-Selection-Paste ===<br />
The keyboard-centered operation in Xmonad can be further supported with a keyboard shortcut for [[Keyboard shortcuts#Key_Binding_for_X-Selection-Paste|X-Selection-Paste]].<br />
<br />
Also, there exists a function "pasteSelection" in XMonad.Util.Paste that can be bound to a key using a line like:<br />
{{hc|xmonad.hs|<br />
-- X-selection-paste buffer<br />
, ((0, xK_Insert), pasteSelection)}}<br />
Pressing the "Insert" key will now paste the mouse buffer in the active window.<br />
<br />
=== Complementary applications ===<br />
There are number of complementary utilities that work well with xmonad. The most common of these include:<br />
<br />
* [[dmenu]]<br />
* [[xmobar]]<br />
* [[dzen]]<br />
* [[Conky]] and {{AUR|conky-cli}}<br />
* [[gmrun]]<br />
* [[Unclutter]] - a small utility to hide the mouse pointer<br />
* [http://uhsure.com/xmonad-log-applet.html XMonad-log-applet] - a GNOME applet for the gnome-panel (the package is in the [[Official repositories]])<br />
<br />
=== Increase the number of workspaces ===<br />
By default, xmonad uses 9 workspaces. You can increase this to 14 by extending the following line like this:<br />
{{hc|xmonad.hs|<br />
-- (i, k) <- zip (XMonad.workspaces conf) [xK_1, xK_2, xK_3, xK_4, xK_5, xK_6, xK_7, xK_8, xK_9]<br />
(i, k) <- zip (XMonad.workspaces conf) [xK_grave, xK_1, xK_2, xK_3, xK_4, xK_5, xK_6, xK_7, xK_8, xK_9, xK_0, xK_minus, xK_equal, xK_BackSpace]}}<br />
<br />
=== Making room for Conky or tray apps ===<br />
Wrap your layouts with avoidStruts from XMonad.Hooks.ManageDocks for automatic dock/panel/trayer spacing:<br />
<br />
import XMonad<br />
import XMonad.Hooks.ManageDocks<br />
<br />
main=do<br />
xmonad $ defaultConfig<br />
{ ...<br />
, layoutHook=avoidStruts $ layoutHook defaultConfig<br />
, manageHook=manageHook defaultConfig <+> manageDocks<br />
, ...<br />
}<br />
<br />
If you ever want to toggle the gaps, this action can be added to your key bindings:<br />
,((modMask x, xK_b ), sendMessage ToggleStruts)<br />
<br />
=== Using xmobar with xmonad ===<br />
'''[[xmobar]]''' is a light and minimalistic text-based bar, designed to work with xmonad.<br />
To use xmobar with xmonad, you will need two packages in addition to the {{Pkg|xmonad}} package. These packages are {{Pkg|xmonad-contrib}} and {{Pkg|xmobar}} from the [[official repositories]], or you can use {{AUR|xmobar-git}} from the [[Arch User Repository|AUR]] instead of the official {{Pkg|xmobar}} package.<br />
<br />
Here we will start xmobar from within xmonad, which reloads xmobar whenever you reload xmonad.<br />
<br />
Open {{ic|~/.xmonad/xmonad.hs}} in your favorite editor, and choose one of the two following options:<br />
<br />
==== Option 1: Quick, less flexible ====<br />
{{Note|There is also {{Pkg|dzen2}} which you can substitute for {{Pkg|xmobar}} in either case.}}<br />
<br />
Common imports:<br />
import XMonad<br />
import XMonad.Hooks.DynamicLog<br />
<br />
The xmobar action starts xmobar and returns a modified configuration that includes all of the options described in the [[xmonad#Option 2: More configurable|xmonad:Option2: More configurable]] choice.<br />
main = xmonad =<< xmobar defaultConfig { modMask = mod4Mask {- or any other configurations here ... -}}<br />
<br />
==== Option 2: More Configurable ====<br />
As of xmonad(-contrib) 0.9, there is a new [http://xmonad.org/xmonad-docs/xmonad-contrib/XMonad-Hooks-DynamicLog.html#v%3AstatusBar statusBar] function in [http://xmonad.org/xmonad-docs/xmonad-contrib/XMonad-Hooks-DynamicLog.html XMonad.Hooks.DynamicLog]. It allows you to use your own configuration for:<br />
* The command used to execute the bar<br />
* The PP that determines what is being written to the bar<br />
* The key binding to toggle the gap for the bar<br />
<br />
The following is an example of how to use it:<br />
{{hc|~/.xmonad/xmonad.hs|<nowiki><br />
-- Imports.<br />
import XMonad<br />
import XMonad.Hooks.DynamicLog<br />
<br />
-- The main function.<br />
main = xmonad =<< statusBar myBar myPP toggleStrutsKey myConfig<br />
<br />
-- Command to launch the bar.<br />
myBar = "xmobar"<br />
<br />
-- Custom PP, configure it as you like. It determines what is being written to the bar.<br />
myPP = xmobarPP { ppCurrent = xmobarColor "#429942" "" . wrap "<" ">" }<br />
<br />
-- Key binding to toggle the gap for the bar.<br />
toggleStrutsKey XConfig {XMonad.modMask = modMask} = (modMask, xK_b)<br />
<br />
-- Main configuration, override the defaults to your liking.<br />
myConfig = defaultConfig { modMask = mod4Mask }<br />
</nowiki>}}<br />
<br />
==== Verify XMobar Config ====<br />
The template and default xmobarrc contains this.<br />
<br />
At last, open up {{ic|~/.xmobarrc}} and make sure you have {{ic|StdinReader}} in the template and run the plugin. E.g.<br />
{{hc|~/.xmobarrc|<nowiki><br />
Config { ...<br />
, commands = [ Run StdinReader .... ]<br />
...<br />
, template = " %StdinReader% ... "<br />
}<br />
</nowiki>}}<br />
<br />
Now, all you should have to do is either to start, or restart, xmonad.<br />
<br />
=== Controlling xmonad with external scripts ===<br />
There are at least two ways to do this.<br />
<br />
Firstly, you can use the following xmonad extension, [http://xmonad.org/xmonad-docs/xmonad-contrib/XMonad-Hooks-ServerMode.html XMonad.Hooks.ServerMode].<br />
<br />
Secondly, you can simulate keypress events using {{Pkg|xdotool}} or similar programs. See this [http://ubuntuforums.org/archive/index.php/t-658040.html Ubuntu forums thread]. The following command would simulate the keypress {{ic|Super+n}}:<br />
xdotool key Super+n<br />
<br />
=== Launching another window manager within xmonad ===<br />
If you are using {{AUR|xmonad-darcs}}, as of January of 2011, you can restart to another window manager from within xmonad. You just need to write a small script, and add stuff to your {{ic|~/.xmonad/xmonad.hs}}. Here is the script.<br />
<br />
{{hc|~/bin/obtoxmd|<nowiki><br />
#!/bin/sh<br />
openbox<br />
xmonad<br />
</nowiki>}}<br />
<br />
And here are the modifications you need to add to your {{ic|~/.xmonad/xmonad.hs}}:<br />
<br />
{{hc|~/.xmonad/xmonad.hs|<nowiki><br />
import XMonad<br />
--You need to add this import<br />
import XMonad.Util.Replace<br />
<br />
main do<br />
-- And this "replace"<br />
replace<br />
xmonad $ defaultConfig<br />
{<br />
--Add the usual here<br />
}<br />
<br />
</nowiki>}}<br />
<br />
You also need to add the following key binding:<br />
{{hc|~/xmonad/xmonad.hs|<nowiki><br />
--Add a keybinding as follows:<br />
((modm .|. shiftMask, xK_o ), restart "/home/abijr/bin/obtoxmd" True)<br />
</nowiki>}}<br />
<br />
Just remember to add a comma before or after and change the path to your actual script path. Now just {{ic|Mod+q}} (restart xmonad to refresh the config), and then hit {{ic|Mod+Shift+o}} and you should have Openbox running with the same windows open as in xmonad. To return to xmonad you should just exit Openbox. Here is a link to adamvo's {{ic|~/.xmonad/xmonad.hs}} which uses this setup [http://www.haskell.org/haskellwiki/Xmonad/Config_archive/adamvo%27s_xmonad.hs Adamvo's xmonad.hs]<br />
<br />
=== KDE and xmonad ===<br />
The xmonad wiki has instructions on how to [https://www.haskell.org/haskellwiki/Xmonad/Using_xmonad_in_KDE run xmonad inside KDE]<br />
<br />
It also might be a good idea to set a global keyboard shortcut in KDE to start xmonad in case it is accidentally killed or closed.<br />
<br />
=== IM Layout for Skype ===<br />
In orded to create an IM layout for the newer versions of skype, the following code can be used:<br />
{{hc|xmonad.hs|<nowiki><br />
myIMLayout = withIM (1%7) skype Grid<br />
where<br />
skype = And (ClassName "Skype") (Role "")<br />
</nowiki>}}<br />
<br />
=== Example configurations ===<br />
Below are some example configurations from fellow xmonad users. Feel free to add links to your own.<br />
* brisbin33 :: simple, useful, readable :: [https://github.com/pbrisbin/xmonad-config config] [http://files.pbrisbin.com/screenshots/current_desktop.png screenshot]<br />
* jelly :: Configuration with prompt, different layouts, twinview with xmobar :: [http://github.com/jelly/dotfiles/tree/master/.xmonad/xmonad.hs xmonad.hs]<br />
* MrElendig :: Simple configuration, with xmobar :: [http://github.com/MrElendig/dotfiles-alice/blob/master/.xmonad/xmonad.hs xmonad.hs], [http://github.com/MrElendig/dotfiles-alice/blob/master/.xmobarrc .xmobarrc], [http://arch.har-ikkje.net/gfx/ss/2010-09-05-163305_2960x1050_scrot.png screenshot].<br />
* thayer :: A minimal mouse-friendly config ideal for netbooks :: [http://haskell.org/haskellwiki/Xmonad/Config_archive/Thayer_Williams%27_xmonad.hs configs] [http://haskell.org/haskellwiki/Image:Thayer-xmonad-20110511.png screenshot]<br />
* vicfryzel :: Beautiful and usable xmonad configuration, along with xmobar configuration, xinitrc, dmenu, and other scripts that make xmonad more usable. :: [https://github.com/vicfryzel/xmonad-config git repository], [https://github.com/vicfryzel/xmonad-config/raw/master/screenshot.png screenshot].<br />
* vogt :: Check out adamvo's config and many others in the official [http://haskell.org/haskellwiki/Xmonad/Config_archive Xmonad/Config archive]<br />
<br />
== Troubleshooting ==<br />
=== GNOME 3 and xmonad ===<br />
With the release of [[GNOME]] 3, some additional steps are necessary to make GNOME play nicely with xmonad.<br />
<br />
Either install {{AUR|xmonad-gnome3}} from the AUR, or, manually:<br />
<br />
Add an xmonad session file for use by gnome-session ({{ic|/usr/share/gnome-session/sessions/xmonad.session}}):<br />
<br />
{{bc|1=<br />
[GNOME Session]<br />
Name=Xmonad session<br />
RequiredComponents=gnome-panel;gnome-settings-daemon;<br />
RequiredProviders=windowmanager;notifications;<br />
DefaultProvider-windowmanager=xmonad<br />
DefaultProvider-notifications=notification-daemon<br />
}}<br />
<br />
Create a desktop file for GDM ({{ic|/usr/share/xsessions/xmonad-gnome-session.desktop}}):<br />
{{bc|1=<br />
[Desktop Entry]<br />
Name=Xmonad GNOME<br />
Comment=Tiling window manager<br />
TryExec=/usr/bin/gnome-session<br />
Exec=gnome-session --session=xmonad<br />
Type=XSession<br />
}}<br />
<br />
Create or edit this file ({{ic|/usr/share/applications/xmonad.desktop}}):<br />
{{bc|1=<br />
[Desktop Entry]<br />
Type=Application<br />
Encoding=UTF-8<br />
Name=Xmonad<br />
Exec=xmonad<br />
NoDisplay=true<br />
X-GNOME-WMName=Xmonad<br />
X-GNOME-Autostart-Phase=WindowManager<br />
X-GNOME-Provides=windowmanager<br />
X-GNOME-Autostart-Notify=false<br />
}}<br />
<br />
Finally, install {{pkg|xmonad-contrib}} and create or edit {{ic|~/.xmonad/xmonad.hs}} to have the following<br />
<br />
{{bc|1=<br />
import XMonad<br />
import XMonad.Config.Gnome<br />
<br />
main = xmonad gnomeConfig<br />
}}<br />
<br />
Xmonad should now appear in the list of GDM sessions and also play nicely with gnome-session itself.<br />
<br />
==== Compositing in GNOME and Xmonad ====<br />
Some applications look better (e.g. GNOME Do) when composition is enabled. This is, however not, the case in the default Xmonad window manager. To enable it add an additional .desktop file {{ic|/usr/share/xsessions/xmonad-gnome-session-composite.desktop}}:<br />
{{bc|1=<br />
[Desktop Entry]<br />
Name=Xmonad GNOME (Composite)<br />
Comment=Tiling window manager<br />
TryExec=/usr/bin/gnome-session<br />
Exec=/usr/sbin/gnome-xmonad-composite<br />
Type=XSession<br />
}}<br />
<br />
And create {{ic|/usr/sbin/gnome-xmonad-composite}} and {{ic|chmod +x /usr/sbin/gnome-xmonad-composite}}:<br />
{{bc|1=<br />
xcompmgr &<br />
gnome-session --session=xmonad<br />
}}<br />
Now choose "Xmonad GNOME (Composite)" in the list of sessions during login. Reference {{ic|man xcompmgr}} for additional "eye candy".<br />
<br />
=== GDM 2.x/KDM cannot find xmonad ===<br />
You can force GDM to launch xmonad by creating the file {{ic|xmonad.desktop}} in the {{ic|/usr/share/xsessions}} directory and add the contents:<br />
<br />
[Desktop Entry]<br />
Encoding=UTF-8<br />
Name=xmonad<br />
Comment=This session starts xmonad<br />
Exec=/usr/bin/xmonad<br />
Type=Application<br />
<br />
Now xmonad will show in your GDM session menu. Thanks to [http://santanuchatterjee.blogspot.com/2009/03/making-xmonad-to-show-up-in-gdm-session.html Santanu Chatterjee] for the hint.<br />
<br />
For KDM, you will need to create the file here as {{ic|/usr/share/apps/kdm/sessions/xmonad.desktop}}<br />
<br />
Official documentation can be found here:<br />
[http://www.haskell.org/haskellwiki/Xmonad/Frequently_asked_questions#How_can_I_use_xmonad_with_a_display_manager.3F_.28xdm.2C_kdm.2C_gdm.29 Haskell Documentation Page]<br />
<br />
=== Xfce 4 and xmonad ===<br />
Use xfceConfig instead of defaultConfig after importing XMonad.Config.Xfce in {{ic|~/.xmonad/xmonad.hs}}, e.g. adapting the minimal config above:<br />
<br />
import XMonad<br />
import XMonad.Config.Xfce<br />
<br />
main = xmonad xfceConfig<br />
{ terminal = "urxvt"<br />
, modMask = mod4Mask<br />
}<br />
<br />
Also add an entry to Settings->Session and Startup->Application Autostart that runs {{ic|xmonad --replace}}.<br />
<br />
=== Missing xmonad-i386-linux or xmonad-x86_64-linux ===<br />
Xmonad should automatically create the {{ic|xmonad-i386-linux}} file (in {{ic|~/.xmonad/}}). If this it not the case you can grab a cool looking config file from the [http://haskell.org/haskellwiki/Xmonad/Config_archive xmonad wiki] or create your [http://haskell.org/haskellwiki/Xmonad/Config_archive/John_Goerzen's_Configuration own]. Put the {{ic|.hs}} and all others files in {{ic|~/.xmonad/}} and run this command from the folder:<br />
xmonad --recompile<br />
<br />
Now you should see the file.<br />
<br />
{{Note|A reason you may get an error message saying that xmonad-x86_64-linux is missing is that {{Pkg|xmonad-contrib}} is not installed.}}<br />
<br />
=== Problems with Java applications ===<br />
The standard Java GUI toolkit has a hard-coded list of "non-reparenting" window managers. Since xmonad is not in that list, there can be some problems with running some Java applications. One of the most common problems is "gray blobs", when the Java application renders as a plain gray box instead of rendering the GUI.<br />
<br />
There are several things that may help:<br />
* If you are using {{Pkg|jre7-openjdk}}, uncomment the line {{Ic|1=export _JAVA_AWT_WM_NONREPARENTING=1}} in {{ic|/etc/profile.d/jre.sh}}. Then, source the file {{ic|/etc/profile.d/jre.sh}} or log out and log back in.<br />
* If you are using Oracle's JRE/JDK, the best solution is usually to use [http://xmonad.org/xmonad-docs/xmonad-contrib/XMonad-Hooks-SetWMName.html SetWMName.] However, its effect may be nullified if one also uses XMonad.Hooks.EwmhDesktops, in which case<br />
>> setWMName "LG3D"<br />
added to the LogHook may help.<br />
<br />
For more details about the problem, refer to the [http://haskell.org/haskellwiki/Xmonad/Frequently_asked_questions#Problems_with_Java_applications.2C_Applet_java_console xmonad FAQ.]<br />
<br />
=== Empty space at the bottom of gvim or terminals ===<br />
See [[Vim#Empty space at the bottom of gVim windows]] for a solution which makes the area match the background color.<br />
<br />
For [[rxvt-unicode]], you can use {{AUR|rxvt-unicode-patched}}.<br />
<br />
You can also configure xmonad to respect size hints, but this will leave a gap instead. See [http://www.eng.uwaterloo.ca/~aavogt/xmonad/docs/xmonad-contrib/XMonad-Layout-LayoutHints.html the documentation on Xmonad.Layout.LayoutHints].<br />
<br />
=== Chromium/Chrome will not go fullscreen ===<br />
If Chrome fails to go fullscreen when {{ic|F11}} is pressed, you can use the [http://xmonad.org/xmonad-docs/xmonad-contrib/XMonad-Hooks-EwmhDesktops.html XMonad.Hooks.EwmhDesktops] extension found in the {{Pkg|xmonad-contrib}} package. Simply add the {{ic|import}} statement to your {{ic|~/.xmonad/xmonad.hs}}:<br />
import XMonad.Hooks.EwmhDesktops<br />
<br />
and then add {{ic|handleEventHook <nowiki>=</nowiki> fullscreenEventHook}} to the appropriate place; for example:<br />
{{bc|<nowiki><br />
...<br />
xmonad $ defaultConfig<br />
{ modMask = mod4Mask<br />
, handleEventHook = fullscreenEventHook<br />
}<br />
...<br />
</nowiki>}}<br />
<br />
After a recompile/restart of xmonad, Chromium should now respond to {{ic|F11}} (fullscreen) as expected.<br />
<br />
=== Multitouch / touchegg ===<br />
Touchégg polls the window manager for the _NET_CLIENT_LIST (in order to fetch a list of windows it should listen for mouse events on.) By default, xmonad does not supply this property. To enable this, use the [http://xmonad.org/xmonad-docs/xmonad-contrib/XMonad-Hooks-EwmhDesktops.html XMonad.Hooks.EwmhDesktops] extension found in the {{Pkg|xmonad-contrib}} package.<br />
<br />
=== Keybinding issues with an azerty keyboard layout ===<br />
Users with a keyboard with azerty layout can run into issues with certain keybindings. Using the [http://xmonad.org/xmonad-docs/xmonad-contrib/XMonad-Config-Azerty.html XMonad.Config.Azerty] module will solve this.<br />
<br />
=== GNOME 3 mod4+p changes display configuration instead of launching dmenu ===<br />
If you do not need the capability to switch the display-setup in the gnome-control-center, just execute<br />
{{bc|<nowiki>dconf write /org/gnome/settings-daemon/plugins/xrandr/active false</nowiki>}}<br />
as your user, to disable the xrandr plugin which grabs Super+p.<br />
<br />
=== Problems with focused border in VirtualBox ===<br />
A known issue with Virtualbox ([https://www.virtualbox.org/ticket/6479 Ticket #6479]) can cause problems with the focused window border. A solution can be found by installing a compositing manager like [[xcompmgr]] which overrides the incorrect behavior of vboxvideo.<br />
<br />
=== Steam games (Half-Life, Left 4 Dead, …) and xmonad ===<br />
There seems to be some trouble with Source engine based game (like Half-Life). If they don't start or get stuck with a black screen a workaround it to start them in window mode: right click on the game in your library and choose properties, click on launch options and enter <br />
-windowed<br />
That should fix the issue.<br />
<br />
Source: http://steamcommunity.com/app/221410/discussions/0/864960353968561426/<br />
<br />
Another solution is to float the window of the game using the manage hook. For example, the following line can be used for Half-Life:<br />
<br />
className =? "hl_linux" --> doFloat<br />
<br />
== Other Resources ==<br />
*[http://xmonad.org/ xmonad] - The official xmonad website<br />
*[http://haskell.org/haskellwiki/Xmonad/Config_archive/Template_xmonad.hs_(0.9) xmonad.hs] - Template xmonad.hs<br />
*[http://xmonad.org/tour.html xmonad: a guided tour]<br />
*[[dzen]] - General purpose messaging and notification program<br />
*[[dmenu]] - Dynamic X menu for the quick launching of programs<br />
*[[Comparison of Tiling Window Managers]] - Arch wiki article providing an overview of mainstream tiling window managers<br />
*[https://bbs.archlinux.org/viewtopic.php?id=94969 Share your xmonad desktop!]<br />
*[https://bbs.archlinux.org/viewtopic.php?id=40636 xmonad hacking thread]</div>Wildeyeshttps://wiki.archlinux.org/index.php?title=Sxhkd&diff=283521Sxhkd2013-11-18T12:45:50Z<p>Wildeyes: /* Configuration */</p>
<hr />
<div>[[Category:Keyboards]]<br />
[[Category:X Server]]<br />
[https://github.com/baskerville/sxhkd sxhkd] is a simple X hotkey daemon. It is intended to replace [[xbindkeys]]. Its forum thread is [https://bbs.archlinux.org/viewtopic.php?id=155613 here].<br />
<br />
==Installation==<br />
Download the {{AUR|sxhkd-git}} package from the [[AUR]]. Then, as a non-root user, run:<br />
<br />
$ makepkg -i<br />
<br />
while in the directory of the saved PKGBUILD. All the files will be retrieved, and the package will be built and installed.<br />
<br />
==Configuration==<br />
sxhkd defaults to {{ic|$XDG_CONFIG_HOME/sxhkd/sxhkdrc}} for its configuration file. An alternate configuration file can be specified with the {{ic|-e}} option. <br />
<br />
Each line of the configuration file is interpreted as so:<br />
<br />
* If it starts with {{ic|#}}, it is ignored.<br />
* If it starts with one or more white space commands, it is read as a command.<br />
* Otherwise, it is parsed as a hotkey: each key name is separated by spaces and/or {{ic|+}} characters.<br />
<br />
General syntax:<br />
<br />
[MODIFIER + ]*[@|!]KEYSYM<br />
COMMAND<br />
Where {{ic|MODIFIER}} is one of the following names: {{ic|super}}, {{ic|hyper}}, {{ic|meta}}, {{ic|alt}}, {{ic|control}}, {{ic|ctrl}}, {{ic|shift}}, {{ic|mode_switch}}, {{ic|lock}}, {{ic|mod1}}, {{ic|mod2}}, {{ic|mod3}}, {{ic|mod4}}, {{ic|mod5}}.<br />
<br />
If {{ic|@}} is added at the beginning of the keysym, the command will be run on key release events, otherwise on key press events.<br />
<br />
If {{ic|!}} is added at the beginning of the keysym, the command will be run on motion notify events and must contain two integer conversion specifications which will be replaced by the x and y coordinates of the pointer relative to the root window referential (the only valid button keysyms for this type of hotkeys are: {{ic|button1}}, ..., {{ic|button5}}).<br />
<br />
The {{ic|KEYSYM}} names are those your will get from {{ic|xev}}.<br />
<br />
Mouse hotkeys can be defined by using one of the following special keysym names: {{ic|button1}}, {{ic|button2}}, {{ic|button3}}, ..., {{ic|button24}}.<br />
<br />
The hotkey can contain a sequence of the form ({{ic|STRING_1}},…,{{ic|STRING_N}}), in which case, the command must also contain a sequence with ''N'' elements: the pairing of the two sequences generates ''N'' hotkeys.<br />
<br />
In addition, the sequences can contain ranges of the form {{ic|A-Z}} where ''A'' and ''Z'' are alphanumeric characters.<br />
<br />
What is actually executed is {{ic|SHELL -c COMMAND}}, which means you can use environment variables in {{ic|COMMAND}}.<br />
<br />
{{ic|SHELL}} will be the content of the first defined environment variable in the following list: {{ic|SXHKD_SHELL}}, {{ic|SHELL}}.<br />
<br />
If sxhkd receives a {{ic|SIGUSR1}} signal, it will reload its configuration file.</div>Wildeyeshttps://wiki.archlinux.org/index.php?title=Map_scancodes_to_keycodes&diff=283494Map scancodes to keycodes2013-11-18T11:20:29Z<p>Wildeyes: /* Using setkeycodes */</p>
<hr />
<div>[[Category:Keyboards]]<br />
{{Note|This page assumes that you have read [[Extra Keyboard Keys]], which provides wider context to the problem.}}<br />
<br />
Mapping ''scancodes'' to ''keycodes'' is universal and not specific to Linux console or Xorg, which means that changes to this mapping will be effective in both.<br />
<br />
There are two ways of mapping ''scancodes'' to ''keycodes'':<br />
* Using [[udev]]<br />
* Using ''setkeycodes''<br />
<br />
The preferred method is to use ''udev'' because it uses hardware information (which is a quite reliable source) to choose the keyboard model in a database. It means that if your keyboard model has been found in the database, your keys are recognized ''out of the box''.<br />
<br />
== Identifying scancodes ==<br />
<br />
You need to know the ''scancodes'' of keys you wish to remap. See [[Extra Keyboard Keys#Scancodes]] for details.<br />
<br />
== Using udev ==<br />
<br />
[[udev]] provides a builtin function called ''hwdb'' to maintain the hardware database index in {{ic|/etc/udev/hwdb.bin}}. The database is compiled from files with ''.hwdb'' extension located in directories {{ic|/usr/lib/udev/hwdb.d/}}, {{ic|/run/udev/hwdb.d/}} and {{ic|/etc/udev/hwdb.d/}}. The default ''scancodes-to-keycodes'' mapping file is {{ic|/usr/lib/udev/hwdb.d/60-keyboard.hwdb}}. See {{ic|man udev}} for details.<br />
<br />
The ''.hwdb'' file can contain multiple blocks of mappings for different keyboards, or one block can be applied to multiple keyboards. The {{ic|keyboard:}} prefix is used to match a block against a hardware, the following hardware matches are supported:<br />
<br />
* USB keyboards identified by the usb kernel modalias: {{bc|keyboard:usb:v''<vendor_id>''p''<product_id>''*}} where {{ic|''<vendor_id>''}} and {{ic|''<product_id>''}} are the 4-digit hex uppercase vendor and product IDs (you can find those by running the {{ic|lsusb}} command).<br />
* AT keyboard DMI data matches: {{bc|keyboard:dmi:bvn*:bvr*:bd*:svn''<vendor>'':pn''<product>'':pvr*}} where {{ic|''<vendor>''}} and {{ic|''<product>''}} are the firmware-provided strings exported by the kernel DMI modalias.<br />
* Platform driver device name and DMI data match: {{bc|keyboard:name:''<input_device_name>'':dmi:bvn*:bvr*:bd*:svn''<vendor>'':pn*}} where {{ic|''<input_device_name>''}} is the name device specified by the driver and {{ic|''<vendor>''}} is the firmware-provided string exported by the kernel DMI modalias.<br />
<br />
The format of each line in the block body is {{ic|1=KEYBOARD_KEY_''<scancode>''=''<keycode>''}}. The value of {{ic|''<scancode>''}} is hexadecimal, but without the leading {{ic|0x}} (i.e. specify {{ic|a0}} instead of {{ic|0xa0}}), whereas the value of {{ic|''<keycode>''}} is the lower-case keycode name string as listed in {{ic|/usr/include/linux/input.h}} (see the {{ic|KEY_''<KEYCODE>''}} variables), a sorted list is available at [http://hal.freedesktop.org/quirk/quirk-keymap-list.txt]. It is not possible to specify decimal value in {{ic|''<keycode>''}}.<br />
<br />
Here is an example to match all USB and AT keyboards:<br />
<br />
{{hc|/etc/udev/hwdb.d/90-custom-keyboard.hwdb|<nowiki><br />
keyboard:usb:v*p*<br />
keyboard:dmi:bvn*:bvr*:bd*:svn*:pn*:pvr*<br />
KEYBOARD_KEY_10=suspend<br />
KEYBOARD_KEY_a0=search<br />
</nowiki>}}<br />
<br />
After changing the configuration files, the hardware database index needs to be rebuilt. This is done on reboot, or manually using the following command:<br />
<br />
# udevadm hwdb --update<br />
<br />
== Using setkeycodes ==<br />
<br />
''setkeycodes'' is a tool to load ''scancodes''-to-''keycodes'' mapping table into Linux kernel. Its usage is:<br />
<br />
# [sudo] setkeycodes ''scancode'' ''keycode'' ...<br />
<br />
It is possible to specify multiple pairs at once. ''Scancodes'' are given in hexadecimal, ''keycodes'' in decimal.<br />
<br />
Note; if used without root permissions, setkeycodes outputs a very unhelpful message: ''Couldn't get a file descriptor referring to the console''.</div>Wildeyes