[xmonad] Code Freeze for v0.12 and Time to Test!
Tuncer Ayaz
tuncer.ayaz at gmail.com
Tue Dec 29 11:30:39 UTC 2015
I've removed leftover rules for mupdf and llpp. There's also no need
for making Gimp floating, because Gimp stable version has a
single-window mode, and there's no collection of windows anymore, if
you enable that. One thing I've noticed with mpv (and mplayer) is that
if you enter and leave fullscreen, then the video (inside window) is
cropped by at least one column of pixels, and the window is not
restored to its original floating position but moved right+down by one
or more pixels. These two effects are probably related, but I don't
see anything wrong with the config. Any idea what's wrong?
Here's v3 with more fixes and better wording:
xmonad and xmonad-contrib have evolved a lot over the years, and
therefore it's a good idea to showcase a modern xmonad.hs. The
config below will give you a good starter xmonad setup with minor
customizations. These are:
(1) Ask for confirmation before exiting
(2) Replace default launcher binding with built-in shellPrompt, which
is friendlier to use and does not require dmenu.
Arguably, these customizations should be the default, but as it
requires xmonad-contrib, we can not really make it the default.
Things you might want to configure next:
* customize looks
* control volume and display back-light
* customize layouts
* customize mouse behavior
* add more prompts (ssh, man, password, etc.)
* whatever you can imagine and/or need
Save this as ~/.xmonad/xmonad.hs:
import System.Exit
import XMonad
import XMonad.Hooks.DynamicLog
import XMonad.Hooks.ManageDocks
import XMonad.Hooks.ManageHelpers
import XMonad.Layout.Fullscreen
import XMonad.Layout.LayoutHints
import XMonad.Layout.NoBorders
import XMonad.Prompt
import XMonad.Prompt.ConfirmPrompt
import XMonad.Prompt.Shell
import XMonad.Util.EZConfig
import XMonad.Util.Run(hPutStrLn, spawnPipe)
main = do
xmproc <- spawnPipe "xmobar ~/.xmonad/xmobarrc"
xmonad $ defaultConfig
{
terminal = "xterm"
, manageHook = myManageHook <+> fullscreenManageHook <+> manageDocks
<+> manageHook defaultConfig
, layoutHook = fullscreenFloat $ fullscreenFocus $ layoutHints
$ smartBorders $ avoidStruts $ layoutHook defaultConfig
, handleEventHook = fullscreenEventHook
, logHook = dynamicLogWithPP $ xmobarPP { ppOutput = hPutStrLn xmproc }
}
`additionalKeysP`
[
-- Ask for confirmation before exiting by replacing the default
-- binding with a custom one.
("M-S-q", confirmPrompt myXPConfig "exit" $ io exitSuccess)
-- Replace M-p launcher binding with built-in shellPrompt, which
-- is friendlier and does not require dmenu.
, ("M-p", shellPrompt myXPConfig)
]
`additionalKeys`
[ ((mod4Mask, xK_q), spawn "xmonad --recompile && xmonad --restart") ]
-- see http://xmonad.org/xmonad-docs/xmonad-contrib/XMonad-Prompt.html#t:XPConfig
myXPConfig = defaultXPConfig
{
position = Top
, promptBorderWidth = 0
, defaultText = ""
, alwaysHighlight = True
, font = "9x15"
}
-- see http://xmonad.org/xmonad-docs/xmonad/XMonad-ManageHook.html
myManageHook = composeAll
[
className =? "Pidgin" --> doFloat
, className =? "XCalc" --> doFloat
, className =? "mpv" --> doFloat
]
-------------- next part --------------
A non-text attachment was scrubbed...
Name: sample-xmonad.hs
Type: application/octet-stream
Size: 2081 bytes
Desc: not available
URL: <http://mail.haskell.org/pipermail/xmonad/attachments/20151229/cf234457/attachment.obj>
More information about the xmonad
mailing list