Git Product home page Git Product logo

xmonad's Introduction

XMonad logo

Hackage License Made in Haskell
Stack Cabal Nix
GitHub Sponsors Open Collective
Chat on #xmonad@irc.libera.chat Chat on #xmonad:matrix.org

xmonad

A tiling window manager for X11.

XMonad is a tiling window manager for X11. Windows are arranged automatically to tile the screen without gaps or overlap, maximising screen use. Window manager features are accessible from the keyboard: a mouse is optional. xmonad is written, configured and extensible in Haskell. Custom layout algorithms, key bindings and other extensions may be written by the user in config files. 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.

This repository contains the xmonad package, a minimal, stable, yet extensible core. It is accompanied by xmonad-contrib, a library of hundreds of additional community-maintained tiling algorithms and extension modules. The two combined make for a powerful X11 window-manager with endless customization possibilities. They are, quite literally, libraries for creating your own window manager.

Installation

For installation and configuration instructions, please see:

If you run into any trouble, consult our documentation or ask the community for help.

Contributing

We welcome all forms of contributions:

Please do read the CONTRIBUTING document for more information about bug reporting and code contributions. For a brief overview of the architecture and code conventions, see the documentation for the XMonad.Doc.Developing module. If in doubt, talk to us.

Authors

Started in 2007 by Spencer Janssen, Don Stewart and Jason Creighton, the XMonad project lives on thanks to new generations of maintainers and dozens of contributors.

xmonad's People

Contributors

a5ob7r avatar aavogt avatar alec avatar byorgey avatar colonelpanic8 avatar dependabot[bot] avatar dmwit avatar donsbot avatar geekosaur avatar github-actions[bot] avatar glguy avatar greedy avatar gwern avatar jasoncreighton avatar liskin avatar lsleary avatar mauke avatar ndmitchell avatar nomeata avatar pdewacht avatar peti avatar pjones avatar psibi avatar slotthe avatar sorear avatar spencerjanssen avatar themc47 avatar topox avatar vmchale avatar wygulmage avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

xmonad's Issues

Use proper folder structure for config

I like to keep a modular config for XMonad. Currently, if I have to import a custom module (let's say Keys.hs), I need to keep it in a folder ~/.xmonad/lib, and the module name has to be to Keys. Then I have to import it by calling import Keys in xmonad.hs.

This is very counter intuitive and is grossly incompatible with ghc-mod, or hsdevtools or any other thing for that matter. Doesn't let me properly organize my config and work with the types and all offered by these tools. I can't even compile my xmonad.hs (not of use though) with ghc xmonad.hs.

I see this thing has been hard coded here in the source.

Views on this? Should we not have the regular haskell project module organization? Let's say, any folder. I'd make a folder named "Configs". Keep my modules there with names like "Configs.Keys" and import them in the same way too.

How I can prevent applications grab window focus

Some applications shows modal windows that can be annoying some times and make unexpected consequences (like gets dangerous key combos that supposed to be sent to another application). I wish I could be able to prevent windows grabbing focus, I imagine white-list of applications that can do it and any other can't. Some applications also trying to regrab the focus to modal window if main window got focused, and if autofocus by mouse turned on it can have insane results, lags and stuff. I hope we can just ignore this tries to grab focus, without back-switching hacks.

Missing dropdowns in Chromium, unworkable menus in Qt5 apps on dual monitors

Hello I'm using Xmonad for a couple of years and at the start of this year I started seeing invisible dropdown in Chromium: Chromium bug but it seems that it isn't just Chromium problem. At the start Dropdown always worked on one screen and not on the other but now sometimes it doesn't show on both and it is annoying. But bigger problems are Qt5 apps like qtcreator and calibre since non of the menus work or right clicks or tab completitions. (seems that floating windows are a problem) All of this things work in Fluxbox so it seems that Xmonad is the reason.

EDIT: none of the problem appear when faking multiple screens with XMonad.Layout.LayoutScreens.

I'm using Xmonad 0.12 Xorg-server 1.18.4-1 Arch Linux with: 4.6.4-1-ARCH on i5-3570K with integrated graphic card with mesa: 12.0.1-5 and xf86-video-intel 1:2.99.917+676+g26f8ab5-1

I'm using two identical 1280x1024 monitors. Xorg config

Xmonad config

For example I open calibre on right monitor and all the menus and right clicks work. I can switch from the workspace with calibre to another and when I switch back everything still works. But everytime I swap right workspace with the left so that calibre is now on the left workspace menu and right clicks stop working. And when I switch back sometimes menu works and sometimes it doesn't. Seems that order of switches is important.

I can also open Calibre on left monitor and everything will work and after some combination of swaping and moving it will stop working. (menus and right clicks)

If I swap calibre worspace with a different one and open calibre on the left without explicitely swapping menus and right cliks work. And when I now swap so that calibre is on the right. Menus are shown on left screen but right clicks don't work.

There are no errors in console from apps.

With Qt designer in Qt4 it works without a problem. Qt 5 version has same issues as calibre and qtCreator.

Tabbed decoration broken with LayoutBuilder

When any of XMonad.Layout.Tabbed layouts used in layoutN, layoutAll, … from XMonad.Layout.LayoutBuilder, it would introduce various graphics artifacts present on all workspaces.

For example, with following layout

wmii = (layoutN 1 (relBox 0 0 ratio 1) Nothing stabbed) $
            (layoutAll (relBox ratio 0 1 1) stabbed)
        stabbed = tabbedAlways shrinkText defaultTheme
        ratio   = 61/100

if you start add clients like 3 or more xterms, content of tab bars starts get garbled. Window names out of position or quite missing, bar from 1st workspace visible on all other workspaces, missing fragments in border around tabs etc.

Tabbed layouts works well on the same machine, either standalone or combined with different combinators like Combo, DragPane, TwoPane, Master and others. Issue is only in combination with LayoutBuilder.

memory leak on master

It consumed (rss) half a gig for me in two days. @bgamari noticed his xmonad consuming 2.5GB. Consumes only 27MB after a restart for me. It may be a result of using ghc-8.0.1.

Restart fails with large serialized state .

I'm using lots of layout modifiers.. the serialized state for a running sessions is usually about 150-200kb after some hours..

I haven't really programmed any Haskell in recent years so I just bashed this out as quickly as possible inside my own config.

-- WIP restart state via file modification
-- TODO: handle file system errors properly
-- TODO: convert into xmonad patch
-- TODO: add --resumefile argument into xmonad and tempfile as state transfer holder(?)

stateFile = "xmonadargs.txt"

restartFile :: String -> Bool -> X ()
restartFile prog resume = do
    broadcastMessage ReleaseResources
    io . flush =<< asks display
    let wsData = show . W.mapLayout show . windowset
        maybeShow (t, Right (PersistentExtension ext)) = Just (t, show ext)
        maybeShow (t, Left str) = Just (t, str)
        maybeShow _ = Nothing
        extState = return . show . mapMaybe maybeShow . M.toList . extensibleState
    args <- if resume then return ["--resume"] else return []
    when resume $ do
      argsstr <- gets (\s ->  intercalate "\n" ("--resume":wsData s:extState s))
      catchIO $ writeFile stateFile argsstr
      return ()
    catchIO (executeFile prog True args Nothing)

catchAny :: IO a -> (SomeException -> IO a) -> IO a
catchAny = Control.Exception.catch

resumeArgsFromFile :: IO [String]
resumeArgsFromFile = do
  let readLines = liftM lines . readFile $ stateFile
  args <- getArgs
  if ["--resume"] == args then
    catchAny readLines $ \e -> do
      putStrLn $ "got error" ++ show e
      return args
  else return args

Currently I'm just adding this to my main function

main :: IO ()
main = do
  args <- getArgs
  when ("--replace" `elem` args) replace
  newArgs <- resumeArgsFromFile
  withArgs newArgs $ xmonad =<< a00001Config

RGB Terminal w3m-img display

I remember Geekosaur told me on #xmonad freenode that there was an upcoming fix for RGB terminals. I use ranger and have turned on image preview which uses the w3m-img image server. Termite shows the images properly on other WM's. On XMonad, ranger with urxvt properly shows the images, but not with termite.

I remember Geekosaur told me that this is a known bug and was in the process of getting patched?

Multiple mouse cursors works buggy

When I try to add additional cursor in xmonad-session additional cursor is always blinking and in Firefox input fields I can type only at least 2 chars and no one more, rest of the keys just ignored. I tried it in Openbox and there it works fine, so I guess this is XMonad issue.

How I create additional cursor:

xinput list # and find id of my additional mouse (for example 15)
xinput create-master foo
xinput list # and find id of master 'foo' (for example 20)
xinput reattach 15 20 # attach additional mouse to new master
$ uname -a
Linux unclefarm23 4.7.5-100.fc23.x86_64 #1 SMP Mon Sep 26 19:29:03 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux
$ cat /etc/fedora-release 
Fedora release 23 (Twenty Three)

scratchpadManageHook broken with urxvt with tabbedex extension.

I use the Scratchpad extension with urxvt and a custom scratchpadManageHook (using RationalRect 0.1 0.1 0.8 0.8). This should (and does) put the terminal in a large centered rectangle, but when urxvt's tabbedex perl extension is enabled, the scratchpad terminal appears instead in a small window somewhere on the top left of the screen. Disabling the extension in .Xresources fixes the bug, reactivating it reintroduces it.

I'm on ArchLinux with xmonad 0.12 and urxvt 9.22. Relevant parts of my xmonad.hs include:


myKeys :: XConfig Layout -> M.Map (KeyMask, KeySym) (X ())
myKeys conf@XConfig {XMonad.modMask = modMask} = M.fromList $
  [

  , ((modMask, xK_s ), scratchpadSpawnActionTerminal $ terminal conf)
]


main :: IO ()
main = do
  
  xmonad def
    {
      
      terminal = "urxvt"
    , manageHook = composeAll 
      [
        className =? "Gloobus-preview" --> doFloat
      , scratchpadManageHook $ XSS.RationalRect 0.1 0.1 0.8 0.8
      ]
    }

This issue doesn't appear with the standard tabbed

Uneven monitor hotplugging

To reproduce (probably don't need the exact hardware, just the primary monitor at nonzero y offset):

  1. Have setup with 1366x768 laptop monitor at (0,256) and 1280x1024 VGA monitor at (1366,0).
  2. Have udev rule to run xrandr --output VGA1 --off when monitor is disconnected and xrandr --output LVDS1 --auto --pos "0x256" --output VGA1 --auto --pos "1366x0" when monitor is connected.
  3. Start with monitor plugged in. Spawn and close some windows.
  4. Unplug monitor. Spawn and close some windows.

Expected behavior: Windows spawn at (0,256) (filling the laptop screen) when monitor is plugged in, and (0,0) (filling the laptop screen) when monitor is unplugged.

Observed behavior: Windows spawn at (0,256) (filling the laptop screen) when monitor is plugged in, and (0,256) (leaving the top 256 rows blank) when monitor is unplugged. Persists until xmonad --restart.

WM freezes on ASUS K53E with Arch Linux on a board

Hi there!
First thanks for xmonad WM, love it!
Bug Description
System: Arch Linux
Kernel: 4.4.5-1
WM installed from official Arch Linux repositories with a pacman.
To produce a bug, two actions need tobe taken:
xmonad --recompile
And Ctrl+Alt+Q to exit from WM straight after recompilation.
Also, if system left with no activity for 10-15 min about same freezes can be achieved by just launching new terminal window.
There's no hardware problem, sure.
I've got second Arch Linux installation with an Openbox WM on it and it's rolling smoothly.
Thank you for profesional advize.

 ┌─ tozen {Linux 4.4.5-1-ARCH x86_64} /home/tozen 
07:01:53
└─> $ lspci
00:00.0 Host bridge: Intel Corporation 2nd Generation Core Processor Family DRAM Controller (rev 09)
00:02.0 VGA compatible controller: Intel Corporation 2nd Generation Core Processor Family Integrated Graphics Controller (rev 09)
00:16.0 Communication controller: Intel Corporation 6 Series/C200 Series Chipset Family MEI Controller #1 (rev 04)
00:1a.0 USB controller: Intel Corporation 6 Series/C200 Series Chipset Family USB Enhanced Host Controller #2 (rev 05)
00:1b.0 Audio device: Intel Corporation 6 Series/C200 Series Chipset Family High Definition Audio Controller (rev 05)
00:1c.0 PCI bridge: Intel Corporation 6 Series/C200 Series Chipset Family PCI Express Root Port 1 (rev b5)
00:1c.1 PCI bridge: Intel Corporation 6 Series/C200 Series Chipset Family PCI Express Root Port 2 (rev b5)
00:1c.5 PCI bridge: Intel Corporation 6 Series/C200 Series Chipset Family PCI Express Root Port 6 (rev b5)
00:1d.0 USB controller: Intel Corporation 6 Series/C200 Series Chipset Family USB Enhanced Host Controller #1 (rev 05)
00:1f.0 ISA bridge: Intel Corporation HM65 Express Chipset Family LPC Controller (rev 05)
00:1f.2 SATA controller: Intel Corporation 6 Series/C200 Series Chipset Family 6 port SATA AHCI Controller (rev 05)
00:1f.3 SMBus: Intel Corporation 6 Series/C200 Series Chipset Family SMBus Controller (rev 05)
02:00.0 Network controller: Realtek Semiconductor Co., Ltd. RTL8188CE 802.11b/g/n WiFi Adapter (rev 01)
03:00.0 Ethernet controller: Qualcomm Atheros AR8151 v2.0 Gigabit Ethernet (rev c0)

Test suite failure with GHC 8

> /tmp/stackage-build9/xmonad-0.12$ runghc -clear-package-db -global-package-db -package-db=/home/stackage/work/builds/nightly/pkgdb Setup configure --enable-tests --package-db=clear --package-db=global --package-db=/home/stackage/work/builds/nightly/pkgdb --libdir=/home/stackage/work/builds/nightly/lib --bindir=/home/stackage/work/builds/nightly/bin --datadir=/home/stackage/work/builds/nightly/share --libexecdir=/home/stackage/work/builds/nightly/libexec --sysconfdir=/home/stackage/work/builds/nightly/etc --docdir=/home/stackage/work/builds/nightly/doc/xmonad-0.12 --htmldir=/home/stackage/work/builds/nightly/doc/xmonad-0.12 --haddockdir=/home/stackage/work/builds/nightly/doc/xmonad-0.12 --flags=
Configuring xmonad-0.12...
Warning: 'ghc-options: -prof' is not necessary and will lead to problems when
used on a library. Use the configure flag --enable-library-profiling and/or
--enable-profiling.
> /tmp/stackage-build9/xmonad-0.12$ runghc -clear-package-db -global-package-db -package-db=/home/stackage/work/builds/nightly/pkgdb Setup build
Building xmonad-0.12...
Preprocessing library xmonad-0.12...
[1 of 9] Compiling Paths_xmonad     ( dist/build/autogen/Paths_xmonad.hs, dist/build/Paths_xmonad.o )
[2 of 9] Compiling XMonad.StackSet  ( src/XMonad/StackSet.hs, dist/build/XMonad/StackSet.o )

src/XMonad/StackSet.hs:485:1: warning: [-Wredundant-constraints]
    • Redundant constraint: Eq s
    • In the type signature for:
           delete' :: (Eq a, Eq s) =>
                      a -> StackSet i l a s sd -> StackSet i l a s sd

src/XMonad/StackSet.hs:550:1: warning: [-Wredundant-constraints]
    • Redundant constraint: Eq a
    • In the type signature for:
           shiftWin :: (Ord a, Eq a, Eq s, Eq i) =>
                       i -> a -> StackSet i l a s sd -> StackSet i l a s sd
[3 of 9] Compiling XMonad.Core      ( src/XMonad/Core.hs, dist/build/XMonad/Core.o )

src/XMonad/Core.hs:37:1: warning: [-Wunused-imports]
    The import of ‘Control.Applicative’ is redundant
      except perhaps to import instances from ‘Control.Applicative’
    To import instances alone, use: import Control.Applicative()
[4 of 9] Compiling XMonad.Layout    ( src/XMonad/Layout.hs, dist/build/XMonad/Layout.o )

src/XMonad/Layout.hs:140:1: warning: [-Wredundant-constraints]
    • Redundant constraints: (LayoutClass l a, LayoutClass r a)
    • In the type signature for:
           (|||) :: (LayoutClass l a, LayoutClass r a) =>
                    l a -> r a -> Choose l r a
[5 of 9] Compiling XMonad.Operations ( src/XMonad/Operations.hs, dist/build/XMonad/Operations.o )

src/XMonad/Operations.hs:32:1: warning: [-Wunused-imports]
    The import of ‘Control.Applicative’ is redundant
      except perhaps to import instances from ‘Control.Applicative’
    To import instances alone, use: import Control.Applicative()
[6 of 9] Compiling XMonad.ManageHook ( src/XMonad/ManageHook.hs, dist/build/XMonad/ManageHook.o )
[7 of 9] Compiling XMonad.Config    ( src/XMonad/Config.hs, dist/build/XMonad/Config.o )
[8 of 9] Compiling XMonad.Main      ( src/XMonad/Main.hs, dist/build/XMonad/Main.o )
[9 of 9] Compiling XMonad           ( src/XMonad.hs, dist/build/XMonad.o )
Preprocessing executable 'xmonad' for xmonad-0.12...
[1 of 1] Compiling Main             ( Main.hs, dist/build/xmonad/xmonad-tmp/Main.o )
Linking dist/build/xmonad/xmonad ...
Preprocessing test suite 'properties' for xmonad-0.12...
[ 1 of 18] Compiling Properties.Failure ( tests/Properties/Failure.hs, dist/build/properties/properties-tmp/Properties/Failure.o )
[ 2 of 18] Compiling Utils            ( tests/Utils.hs, dist/build/properties/properties-tmp/Utils.o )
[ 3 of 18] Compiling Instances        ( tests/Instances.hs, dist/build/properties/properties-tmp/Instances.o )
[ 4 of 18] Compiling Properties.Floating ( tests/Properties/Floating.hs, dist/build/properties/properties-tmp/Properties/Floating.o )
[ 5 of 18] Compiling Properties.Stack ( tests/Properties/Stack.hs, dist/build/properties/properties-tmp/Properties/Stack.o )
[ 6 of 18] Compiling Properties.Layout.Full ( tests/Properties/Layout/Full.hs, dist/build/properties/properties-tmp/Properties/Layout/Full.o )
[ 7 of 18] Compiling Properties.Delete ( tests/Properties/Delete.hs, dist/build/properties/properties-tmp/Properties/Delete.o )
[ 8 of 18] Compiling Properties.Focus ( tests/Properties/Focus.hs, dist/build/properties/properties-tmp/Properties/Focus.o )
[ 9 of 18] Compiling Properties.GreedyView ( tests/Properties/GreedyView.hs, dist/build/properties/properties-tmp/Properties/GreedyView.o )
[10 of 18] Compiling Properties.Insert ( tests/Properties/Insert.hs, dist/build/properties/properties-tmp/Properties/Insert.o )
[11 of 18] Compiling Properties.Screen ( tests/Properties/Screen.hs, dist/build/properties/properties-tmp/Properties/Screen.o )
[12 of 18] Compiling Properties.Shift ( tests/Properties/Shift.hs, dist/build/properties/properties-tmp/Properties/Shift.o )
[13 of 18] Compiling Properties.StackSet ( tests/Properties/StackSet.hs, dist/build/properties/properties-tmp/Properties/StackSet.o )
[14 of 18] Compiling Properties.Swap  ( tests/Properties/Swap.hs, dist/build/properties/properties-tmp/Properties/Swap.o )
[15 of 18] Compiling Properties.View  ( tests/Properties/View.hs, dist/build/properties/properties-tmp/Properties/View.o )
[16 of 18] Compiling Properties.Workspace ( tests/Properties/Workspace.hs, dist/build/properties/properties-tmp/Properties/Workspace.o )
[17 of 18] Compiling Properties.Layout.Tall ( tests/Properties/Layout/Tall.hs, dist/build/properties/properties-tmp/Properties/Layout/Tall.o )
[18 of 18] Compiling Main             ( tests/Properties.hs, dist/build/properties/properties-tmp/Main.o )
Linking dist/build/properties/properties ...
> /tmp/stackage-build9/xmonad-0.12$ dist/build/properties/properties
StackSet invariants                : +++ OK, passed 100 tests.
empty: invariant                   : +++ OK, passed 100 tests.
empty is empty                     : +++ OK, passed 100 tests.
empty / current                    : +++ OK, passed 100 tests.
empty / member                     : +++ OK, passed 100 tests.
view : invariant                   : +++ OK, passed 100 tests.
view sets current                  : +++ OK, passed 100 tests.
view idempotent                    : +++ OK, passed 100 tests.
view reversible                    : +++ OK, passed 100 tests.
view is local                      : +++ OK, passed 100 tests.
greedyView : invariant             : +++ OK, passed 100 tests.
greedyView sets current            : +++ OK, passed 100 tests.
greedyView is safe                 : +++ OK, passed 100 tests.
greedyView idempotent              : +++ OK, passed 100 tests.
greedyView reversible              : +++ OK, passed 100 tests.
greedyView is local                : +++ OK, passed 100 tests.
peek/member                        : +++ OK, passed 100 tests.
index/length                       : +++ OK, passed 100 tests.
focus left : invariant             : +++ OK, passed 100 tests.
focus master : invariant           : +++ OK, passed 100 tests.
focus right: invariant             : +++ OK, passed 100 tests.
focusWindow: invariant             : +++ OK, passed 100 tests.
focus left/master                  : +++ OK, passed 100 tests.
focus right/master                 : +++ OK, passed 100 tests.
focus master/master                : +++ OK, passed 100 tests.
focusWindow master                 : +++ OK, passed 100 tests.
focus left/right                   : +++ OK, passed 100 tests.
focus right/left                   : +++ OK, passed 100 tests.
focus all left                     : +++ OK, passed 100 tests.
focus all right                    : +++ OK, passed 100 tests.
focus down is local                : +++ OK, passed 100 tests.
focus up is local                  : +++ OK, passed 100 tests.
focus master is local              : +++ OK, passed 100 tests.
focus master idemp                 : +++ OK, passed 100 tests.
focusWindow is local               : +++ OK, passed 100 tests.
focusWindow works                  : +++ OK, passed 100 tests.
focusWindow identity               : +++ OK, passed 100 tests.
findTag                            : +++ OK, passed 100 tests.
allWindows/member                  : +++ OK, passed 100 tests.
currentTag                         : +++ OK, passed 100 tests.
insert: invariant                  : +++ OK, passed 100 tests.
insert/new                         : +++ OK, passed 100 tests.
insert is idempotent               : +++ OK, passed 100 tests.
insert is reversible               : +++ OK, passed 100 tests.
insert is local                    : +++ OK, passed 100 tests.
insert duplicates                  : +++ OK, passed 100 tests.
insert/peek                        : +++ OK, passed 100 tests.
insert/size                        : +++ OK, passed 100 tests.
delete: invariant                  : +++ OK, passed 100 tests.
delete/empty                       : +++ OK, passed 100 tests.
delete/member                      : +++ OK, passed 100 tests.
delete is reversible               : +++ OK, passed 100 tests.
delete is local                    : +++ OK, passed 100 tests.
delete/focus                       : +++ OK, passed 100 tests.
delete  last/focus up              : +++ OK, passed 100 tests.
delete ~last/focus down            : +++ OK, passed 100 tests.
filter preserves order             : +++ OK, passed 100 tests.
swapLeft                           : +++ OK, passed 100 tests.
swapRight                          : +++ OK, passed 100 tests.
swapMaster: invariant              : +++ OK, passed 100 tests.
swapUp: invariant                  : +++ OK, passed 100 tests.
swapDown: invariant                : +++ OK, passed 100 tests.
swapMaster id on focus             : +++ OK, passed 100 tests.
swapUp id on focus                 : +++ OK, passed 100 tests.
swapDown id on focus               : +++ OK, passed 100 tests.
swapMaster is idempotent           : +++ OK, passed 100 tests.
swap all left                      : +++ OK, passed 100 tests.
swap all right                     : +++ OK, passed 100 tests.
swapMaster is local                : +++ OK, passed 100 tests.
swapUp is local                    : +++ OK, passed 100 tests.
swapDown is local                  : +++ OK, passed 100 tests.
shiftMaster id on focus            : +++ OK, passed 100 tests.
shiftMaster is local               : +++ OK, passed 100 tests.
shiftMaster is idempotent          : +++ OK, passed 100 tests.
shiftMaster preserves ordering     : +++ OK, passed 100 tests.
shift: invariant                   : +++ OK, passed 100 tests.
shift is reversible                : +++ OK, passed 100 tests.
shiftWin: invariant                : +++ OK, passed 100 tests.
shiftWin is shift on focus         : +++ OK, passed 100 tests.
shiftWin fix current               : +++ OK, passed 100 tests.
shiftWin identity                  : +++ OK, passed 100 tests.
floating is reversible             : +++ OK, passed 100 tests.
floating sets geometry             : +++ OK, passed 100 tests.
floats can be deleted              : +++ OK, passed 100 tests.
screens includes current           : +++ OK, passed 100 tests.
differentiate works                : +++ OK, passed 100 tests.
lookupTagOnScreen                  : +++ OK, passed 100 tests.
lookupTagOnVisbleScreen            : +++ OK, passed 100 tests.
screens works                      : +++ OK, passed 100 tests.
renaming works                     : +++ OK, passed 100 tests.
ensure works                       : +++ OK, passed 100 tests.
ensure hidden semantics            : +++ OK, passed 100 tests.
mapWorkspace id                    : +++ OK, passed 100 tests.
mapWorkspace inverse               : +++ OK, passed 100 tests.
mapLayout id                       : +++ OK, passed 100 tests.
mapLayout inverse                  : +++ OK, passed 100 tests.
abort fails                        : *** Failed! Falsifiable (after 1 test): 
0
new fails with abort               : *** Failed! Falsifiable (after 1 test): 
0
point within                       : +++ OK, passed 100 tests.
tile 1 window fullsize             : +++ OK, passed 100 tests.
tiles never overlap                : +++ OK, passed 100 tests.
split horizontal                   : +++ OK, passed 100 tests.
split vertical                     : +++ OK, passed 100 tests.
pure layout tall                   : +++ OK, passed 100 tests.
send shrink    tall                : +++ OK, passed 100 tests.
send expand    tall                : +++ OK, passed 100 tests.
send incmaster tall                : +++ OK, passed 100 tests.
pure layout full                   : +++ OK, passed 100 tests.
send message full                  : +++ OK, passed 100 tests.
describe full                      : +++ OK, passed 100 tests.
describe mirror                    : +++ OK, passed 100 tests.
window resize hints: inc           : +++ OK, passed 100 tests.
window resize hints: inc all       : +++ OK, passed 100 tests.
window resize hints: max           : +++ OK, passed 100 tests.
window resize hints: max all       : +++ OK, passed 100 tests.
window aspect hints: fits          : +++ OK, passed 100 tests.
window aspect hints: shrinks       : +++ OK, passed 100 tests.
pointWithin                        : +++ OK, passed 100 tests.
pointWithin mirror                 : +++ OK, passed 100 tests.
properties: 2 test(s) failed
CallStack (from HasCallStack):
  error, called at tests/Properties.hs:39:20 in main:Main

fullscreen videos in browser not working as expected

When clicking the fullscreen button in videos running in a browser (for example on youtube) I get the following problems:

  • On chrome it works but a small part of the window is cutoff on the lower end. When changing the xMonad layout three times, i.e. klicking mod-space three times, the window is shown as it should be, without the cutoff.
  • On firefox the window does not appear in fullscreen and I cannot navigate the browser anymore, while the video still plays.

Can anyone reproduce these? I would like to try understanding what goes on and try fixing it, but I could not figure out what happens at the Xmonad level when a window is put to fullscreen by an external signal. Can anyone point me in the right direction here? How is the event handled by Xmonad?

Separate focus for tiled and floating layers

Originally reported on Google Code with ID 4

Add support for floating windows.  Stages:

 - modify StackSet to store floating status
 - store preferred window position in XState
 - update layout algorithm
 - add keybindings to float/unfloat windows

Reported by SpencerJanssen on 2007-05-01 21:06:45

avoidStruts isn't working on workspace 1

I'm using xmonad 0.12, xmonad-contrib 0.12 and xmobar on archlinux. After the upgrade from 0.11 to 0.12 avoidStruts isn't working on workspace 1. On all other workspaces my config works like expected.

my xmonad config

import XMonad

import System.Exit

import qualified XMonad.StackSet as W
import qualified Data.Map as M
import qualified XMonad.Actions.FlexibleResize as Flex

import XMonad.Util.Run
import XMonad.Actions.CycleWS
import Graphics.X11.ExtraTypes.XF86

import XMonad.Hooks.DynamicLog
import XMonad.Hooks.ManageDocks
import XMonad.Hooks.ManageHelpers
import XMonad.Hooks.EwmhDesktops
import XMonad.Hooks.SetWMName

import XMonad.Layout.Named
import XMonad.Layout.TrackFloating
import XMonad.Layout.ResizableTile


flexoKeyBindings conf@(XConfig {XMonad.modMask = modm}) = M.fromList $
    [ ((modm, xK_Return), spawn "termite"),
      ((modm, xK_r), spawn "rofi -terminal termite -modi run -show run"),
      ((modm .|. shiftMask, xK_Print), spawn "scrot"),
      ((modm, xK_Print), spawn "scrot -u"),

      ((0, xF86XK_LaunchA), spawn "xset dpms force off"),

      ((0, xF86XK_AudioRaiseVolume), spawn "ponymix --max-volume 100 increase 2"),
      ((0, xF86XK_AudioLowerVolume), spawn "ponymix --max-volume 100 decrease 2"),
      ((0, xF86XK_AudioMute), spawn "ponymix toggle"),
      ((0, xF86XK_MonBrightnessDown), spawn "xbacklight -dec 5"),
      ((0, xF86XK_MonBrightnessUp), spawn "xbacklight -inc 5"),

      ((modm .|. mod1Mask, xK_p), spawn "systemctl poweroff"),
      ((modm .|. mod1Mask, xK_r), spawn "systemctl reboot"),
      ((modm .|. mod1Mask, xK_l), spawn "slock"),

      ((modm .|. mod1Mask, xK_q), io (exitWith ExitSuccess)),

      ((modm, xK_q), kill),

      ((modm, xK_space ), sendMessage NextLayout),

      ((modm, xK_t), withFocused $ windows . W.sink),

      ((modm, xK_u), sendMessage (IncMasterN 1)),
      ((modm, xK_i), sendMessage (IncMasterN (-1))),


      -- focus
      ((modm, xK_n), windows W.focusDown),
      ((modm, xK_p), windows W.focusUp),
      ((modm, xK_Down), windows W.focusDown),
      ((modm, xK_Up), windows W.focusUp),

      ((modm, xK_comma), prevWS),
      ((modm, xK_period), nextWS),

      ((modm, xK_BackSpace), nextScreen),
      ((modm .|. shiftMask, xK_BackSpace), prevScreen),

      ((modm, xK_Escape), toggleWS),


      -- swap
      ((modm .|. shiftMask, xK_n), windows W.swapDown),
      ((modm .|. shiftMask, xK_p), windows W.swapUp),
      ((modm .|. shiftMask, xK_Down), windows W.swapDown),
      ((modm .|. shiftMask, xK_Up), windows W.swapUp),

      ((modm .|. shiftMask, xK_comma), shiftToPrev >> prevWS),
      ((modm .|. shiftMask, xK_period), shiftToNext >> nextWS),

      ((modm .|. shiftMask, xK_Return), windows W.swapMaster),


      -- resize
      ((modm .|. controlMask, xK_b), sendMessage Shrink),
      ((modm .|. controlMask, xK_f), sendMessage Expand),
      ((modm .|. controlMask, xK_n), sendMessage MirrorShrink),
      ((modm .|. controlMask, xK_p), sendMessage MirrorExpand),
      ((modm .|. controlMask, xK_Left), sendMessage Shrink),
      ((modm .|. controlMask, xK_Right), sendMessage Expand),
      ((modm .|. controlMask, xK_Down), sendMessage MirrorShrink),
      ((modm .|. controlMask, xK_Up), sendMessage MirrorExpand)
    ]

    ++

    [ ((m .|. modm, k), windows $ f i) | (i, k) <- zip (XMonad.workspaces conf) [xK_1,xK_2,xK_3,xK_4,xK_5,xK_6,xK_7,xK_8,xK_9,xK_0],
      (f, m) <- [(W.greedyView, 0), (W.shift, shiftMask)]
    ]


flexoMouseBindings (XConfig {XMonad.modMask = modm}) = M.fromList $
    [ ((modm, button1), (\w -> focus w >> mouseMoveWindow w >> windows W.shiftMaster)),
      ((modm, button3), (\w -> focus w >> Flex.mouseResizeWindow w))
    ]


flexoConfig = defaultConfig {
    normalBorderColor = "#aaaaaa",
    focusedBorderColor = "#ef2929",

    workspaces = ["1","2","3","4","5","6","7","8","9","10"],

    modMask = mod4Mask,
    keys = flexoKeyBindings,
    mouseBindings = flexoMouseBindings
}


main = do
    xmproc <- spawnPipe "xmobar ~/.xmonad/xmobar.hs"
    xmonad $ ewmh flexoConfig {
        logHook = do
            ewmhDesktopsLogHook >> setWMName "LG3D"
            dynamicLogWithPP xmobarPP {
                ppOutput = hPutStrLn xmproc,
                ppOrder = \(ws:l:t:[]) -> [l],
                ppLayout = xmobarColor "#ef2929" ""
            },

        startupHook = do
            ewmhDesktopsStartup
            spawn "hsetroot -fill $HOME/Dotfiles/background.png"
            spawn "xrdb $HOME/.Xresources",

        handleEventHook = do
            ewmhDesktopsEventHook
            docksEventHook
            fullscreenEventHook,

        manageHook =
            manageDocks <+>
            (isDialog --> doCenterFloat) <+>
            (isFullscreen --> doFullFloat) <+>
            composeAll [
                className =? "Pavucontrol" --> doCenterFloat,
                className =? "Eom" --> doCenterFloat,
                className =? "VirtualBox" --> doCenterFloat,
                className =? "Arandr" --> doCenterFloat,
                className =? "Remmina" --> doCenterFloat
            ],

        layoutHook = trackFloating $ avoidStruts $
            named "T" (ResizableTall 1 (2/100) (1/2) []) |||
            named "F" (Full)
}

my xmobar config

Config {
    font = "xft:Dejavu Sans Mono:size=10:antialias=true",
    bgColor = "#000000",
    fgColor = "#aaaaaa",
    position = Top,
    alignSep = "}{",
    commands = [
        Run Com "uname" ["-n"] "hostname" 0,
        Run Com "uname" ["-r"] "kernel" 0,

        Run BatteryN ["BAT0"] ["-t", "<left>"] 310 "BAT0",
        Run BatteryN ["BAT1"] ["-t", "<left>"] 310 "BAT1",

        Run Date "%a, %b %d %H:%M" "date" 100,
        Run StdinReader
    ],
    template = " <fc=#ef2929><icon=./.xmonad/heart.xbm/></fc> <fc=#ffffff>%hostname%</fc> %kernel%}{%StdinReader%  BAT <fc=#ffffff>%BAT0%</fc> <fc=#ffffff>%BAT1%</fc>  <fc=#ffffff>%date%</fc> "
}

Best,
Marco

LibreOffice floating windows renders system unresponsive

I was trying to work with LibreOffice Calc charts when it stroke me. Whenever I opened a floating dialog (for changing chart properties and data range), there was high probability of the system stopping to react to input. Sometimes I had trouble clicking the OK button, but eventually it made the entire system unresponsive, and I couldn't even switch workspaces. So I had to switch to another vterm and kill LibreOffice.

Should be easy to reproduce: try drawing some charts, then edit it by opening and using the dialogs.

Security issue: mate-screensaver lock screen becomes a tile

I am not sure whether this is a bug in xmonad or a bug in mate-screensaver, but I am reporting it regardless because it is a serious security issue.

Using mate-screensaver 1.14.1 and xmonad 0.12, the lock screen becomes a tile. This means that you can just resize the screensaver using the mouse, and interact with running applications, thus circumventing the purpose of locking the screen.

See also mate-desktop/mate-screensaver#96

Stable numlock handling.

Originally reported on Google Code with ID 1

Handling of input in the presence of numlock is fragile. Come up with a
proper solutoin to this for 0.2

Reported by dons00 on 2007-04-29 05:11:14

Optional feature to disable keeping proportion between displays for floating windows

When I have displays with different resolution most of the floating windows looks broken on one of displays (usually on one with smaller resolution). See screenshots below that demonstrate the issue:

I also discussed it before on #xmonad on freenode IRC as I remember with @geekosaur , and he was approved this and said that keeping proportion for floating windows makes no sense and should be fixed.

Border width and color are not configurable

Originally reported on Google Code with ID 2

Border width/color cannot be set in Config.hs because they're needed in
Operations.hs, which is included by Config.hs

Reported by jcreigh on 2007-04-29 05:21:54

Wayland Support

Since wayland is becoming the mainstream display server for linux and X will only be supported through xwayland, would it make sense to support wayland too?

Error Xmonad

Hello, i have these errors in my xmonad.errors, can you help me please ?

xmonad.hs:33:10: Warning:
In the use of ‘defaultPP’ (imported from XMonad.Hooks.DynamicLog):
Deprecated: "Use def (from Data.Default, and re-exported by XMonad.Hooks.DynamicLog) instead."

xmonad.hs:54:11: Warning:
In the use of ‘defaultPP’ (imported from XMonad.Hooks.DynamicLog):
Deprecated: "Use def (from Data.Default, and re-exported by XMonad.Hooks.DynamicLog) instead."

xmonad.hs:88:9: Warning: Tab character

xmonad.hs:100:14: Warning:
In the use of ‘defaultConfig’
(imported from XMonad, but defined in XMonad.Config):
Deprecated: "Use def (from Data.Default, and re-exported by XMonad and XMonad.Config) instead."

xmonad.hs:101:60: Warning:
In the use of ‘defaultConfig’
(imported from XMonad, but defined in XMonad.Config):
Deprecated: "Use def (from Data.Default, and re-exported by XMonad and XMonad.Config) instead."

Xmonad Freezing

Heya,

Seems to be a few people running ArchLinux w/ Xmonad running in a few freezing issues. The current window that you are in still works fine, but you xmonad itself becomes unresponsive (doesn't respond to shortcuts etc). If you switch to a new tty or are currently in a terminal you can issue the following pkill command to unfreeze the xmonad session:
pkill -CONT xmonad-x86_64-l

Links to arch bbs with more info:
https://bbs.archlinux.org/viewtopic.php?id=216074
https://bbs.archlinux.org/viewtopic.php?id=216293

Let me know if there is any more info I can provide.

Cheers,

Current focused window don't get highlighted with the border`

It was working before but stop working suddenly. I think I accidentally uninstalled some dependencies.



{-# OPTIONS -fno-warn-missing-signatures #-}
-----------------------------------------------------------------------------
-- |
-- Module      :  XMonad.Config
-- Copyright   :  (c) Spencer Janssen 2007
-- License     :  BSD3-style (see LICENSE)
--
-- Maintainer  :  [email protected]
-- Stability   :  stable
-- Portability :  portable
--
-- This module specifies the default configuration values for xmonad.
--
-- DO NOT MODIFY THIS FILE!  It won't work.  You may configure xmonad
-- by providing your own @~\/.xmonad\/xmonad.hs@ that overrides
-- specific fields in 'defaultConfig'.  For a starting point, you can
-- copy the @xmonad.hs@ found in the @man@ directory, or look at
-- examples on the xmonad wiki.
--
------------------------------------------------------------------------

module XMonad.Config (defaultConfig) where

--
-- Useful imports
--
import XMonad.Core as XMonad hiding
    (workspaces,manageHook,keys,logHook,startupHook,borderWidth,mouseBindings
    ,layoutHook,modMask,terminal,normalBorderColor,focusedBorderColor,focusFollowsMouse
    ,handleEventHook,clickJustFocuses)
import qualified XMonad.Core as XMonad
    (workspaces,manageHook,keys,logHook,startupHook,borderWidth,mouseBindings
    ,layoutHook,modMask,terminal,normalBorderColor,focusedBorderColor,focusFollowsMouse
    ,handleEventHook,clickJustFocuses)

import XMonad.Layout
import XMonad.Operations
import XMonad.ManageHook
import qualified XMonad.StackSet as W
import Data.Bits ((.|.))
import Data.Monoid
import qualified Data.Map as M
import System.Exit
import Graphics.X11.Xlib
import Graphics.X11.Xlib.Extras

-- | The default number of workspaces (virtual screens) and their names.
-- By default we use numeric strings, but any string may be used as a
-- workspace name. The number of workspaces is determined by the length
-- of this list.
--
-- A tagging example:
--
-- > workspaces = ["web", "irc", "code" ] ++ map show [4..9]
--
workspaces :: [WorkspaceId]
workspaces = map show [1 .. 9 :: Int]

-- | modMask lets you specify which modkey you want to use. The default
-- is mod1Mask ("left alt").  You may also consider using mod3Mask
-- ("right alt"), which does not conflict with emacs keybindings. The
-- "windows key" is usually mod4Mask.
--
defaultModMask :: KeyMask
defaultModMask = mod1Mask

-- | Width of the window border in pixels.
--
borderWidth :: Dimension
borderWidth = 1

-- | Border colors for unfocused and focused windows, respectively.
--
normalBorderColor, focusedBorderColor :: String
normalBorderColor  = "gray" -- "#dddddd"
focusedBorderColor = "red"  -- "#ff0000" don't use hex, not <24 bit safe

------------------------------------------------------------------------
-- Window rules

-- | Execute arbitrary actions and WindowSet manipulations when managing
-- a new window. You can use this to, for example, always float a
-- particular program, or have a client always appear on a particular
-- workspace.
--
-- To find the property name associated with a program, use
--  xprop | grep WM_CLASS
-- and click on the client you're interested in.
--
manageHook :: ManageHook
manageHook = composeAll
                [ className =? "MPlayer"        --> doFloat
                , className =? "Gimp"           --> doFloat ]

------------------------------------------------------------------------
-- Logging

-- | Perform an arbitrary action on each internal state change or X event.
-- Examples include:
--
--      * do nothing
--
--      * log the state to stdout
--
-- See the 'DynamicLog' extension for examples.
--
logHook :: X ()
logHook = return ()

------------------------------------------------------------------------
-- Event handling

-- | Defines a custom handler function for X Events. The function should
-- return (All True) if the default handler is to be run afterwards.
-- To combine event hooks, use mappend or mconcat from Data.Monoid.
handleEventHook :: Event -> X All
handleEventHook _ = return (All True)

-- | Perform an arbitrary action at xmonad startup.
startupHook :: X ()
startupHook = return ()

------------------------------------------------------------------------
-- Extensible layouts
--
-- You can specify and transform your layouts by modifying these values.
-- If you change layout bindings be sure to use 'mod-shift-space' after
-- restarting (with 'mod-q') to reset your layout state to the new
-- defaults, as xmonad preserves your old layout settings by default.
--

-- | The available layouts.  Note that each layout is separated by |||, which
-- denotes layout choice.
layout = tiled ||| Mirror tiled ||| Full
  where
     -- default tiling algorithm partitions the screen into two panes
     tiled   = Tall nmaster delta ratio

     -- The default number of windows in the master pane
     nmaster = 1

     -- Default proportion of screen occupied by master pane
     ratio   = 1/2

     -- Percent of screen to increment by when resizing panes
     delta   = 3/100

------------------------------------------------------------------------
-- Key bindings:

-- | The preferred terminal program, which is used in a binding below and by
-- certain contrib modules.
terminal :: String
terminal = "xterm"

-- | Whether focus follows the mouse pointer.
focusFollowsMouse :: Bool
focusFollowsMouse = True

-- | Whether a mouse click select the focus or is just passed to the window
clickJustFocuses :: Bool
clickJustFocuses = True


-- | The xmonad key bindings. Add, modify or remove key bindings here.
--
-- (The comment formatting character is used when generating the manpage)
--
keys :: XConfig Layout -> M.Map (KeyMask, KeySym) (X ())
keys conf@(XConfig {XMonad.modMask = modMask}) = M.fromList $
    -- launching and killing programs
    [ ((modMask .|. shiftMask, xK_Return), spawn $ XMonad.terminal conf) -- %! Launch terminal
    , ((modMask,               xK_p     ), spawn "dmenu_run") -- %! Launch dmenu
    , ((modMask .|. shiftMask, xK_p     ), spawn "gmrun") -- %! Launch gmrun
    , ((modMask .|. shiftMask, xK_c     ), kill) -- %! Close the focused window

    , ((modMask,               xK_space ), sendMessage NextLayout) -- %! Rotate through the available layout algorithms
    , ((modMask .|. shiftMask, xK_space ), setLayout $ XMonad.layoutHook conf) -- %!  Reset the layouts on the current workspace to default

    , ((modMask,               xK_n     ), refresh) -- %! Resize viewed windows to the correct size

    -- move focus up or down the window stack
    , ((modMask,               xK_Tab   ), windows W.focusDown) -- %! Move focus to the next window
    , ((modMask .|. shiftMask, xK_Tab   ), windows W.focusUp  ) -- %! Move focus to the previous window
    , ((modMask,               xK_j     ), windows W.focusDown) -- %! Move focus to the next window
    , ((modMask,               xK_k     ), windows W.focusUp  ) -- %! Move focus to the previous window
    , ((modMask,               xK_m     ), windows W.focusMaster  ) -- %! Move focus to the master window

    -- modifying the window order
    , ((modMask,               xK_Return), windows W.swapMaster) -- %! Swap the focused window and the master window
    , ((modMask .|. shiftMask, xK_j     ), windows W.swapDown  ) -- %! Swap the focused window with the next window
    , ((modMask .|. shiftMask, xK_k     ), windows W.swapUp    ) -- %! Swap the focused window with the previous window

    -- resizing the master/slave ratio
    , ((modMask,               xK_h     ), sendMessage Shrink) -- %! Shrink the master area
    , ((modMask,               xK_l     ), sendMessage Expand) -- %! Expand the master area

    -- floating layer support
    , ((modMask,               xK_t     ), withFocused $ windows . W.sink) -- %! Push window back into tiling

    -- increase or decrease number of windows in the master area
    , ((modMask              , xK_comma ), sendMessage (IncMasterN 1)) -- %! Increment the number of windows in the master area
    , ((modMask              , xK_period), sendMessage (IncMasterN (-1))) -- %! Deincrement the number of windows in the master area

    -- quit, or restart
    , ((modMask .|. shiftMask, xK_q     ), io (exitWith ExitSuccess)) -- %! Quit xmonad
    , ((modMask              , xK_q     ), spawn "if type xmonad; then xmonad --recompile && xmonad --restart; else xmessage xmonad not in \\$PATH: \"$PATH\"; fi") -- %! Restart xmonad

    , ((modMask .|. shiftMask, xK_slash ), spawn ("echo \"" ++ help ++ "\" | xmessage -file -")) -- %! Run xmessage with a summary of the default keybindings (useful for beginners)
    -- repeat the binding for non-American layout keyboards
    , ((modMask              , xK_question), spawn ("echo \"" ++ help ++ "\" | xmessage -file -"))
    ]
    ++
    -- mod-[1..9] %! Switch to workspace N
    -- mod-shift-[1..9] %! Move client to workspace N
    [((m .|. modMask, k), windows $ f i)
        | (i, k) <- zip (XMonad.workspaces conf) [xK_1 .. xK_9]
        , (f, m) <- [(W.greedyView, 0), (W.shift, shiftMask)]]
    ++
    -- mod-{w,e,r} %! Switch to physical/Xinerama screens 1, 2, or 3
    -- mod-shift-{w,e,r} %! Move client to screen 1, 2, or 3
    [((m .|. modMask, key), screenWorkspace sc >>= flip whenJust (windows . f))
        | (key, sc) <- zip [xK_w, xK_e, xK_r] [0..]
        , (f, m) <- [(W.view, 0), (W.shift, shiftMask)]]

-- | Mouse bindings: default actions bound to mouse events
mouseBindings :: XConfig Layout -> M.Map (KeyMask, Button) (Window -> X ())
mouseBindings (XConfig {XMonad.modMask = modMask}) = M.fromList
    -- mod-button1 %! Set the window to floating mode and move by dragging
    [ ((modMask, button1), \w -> focus w >> mouseMoveWindow w
                                          >> windows W.shiftMaster)
    -- mod-button2 %! Raise the window to the top of the stack
    , ((modMask, button2), windows . (W.shiftMaster .) . W.focusWindow)
    -- mod-button3 %! Set the window to floating mode and resize by dragging
    , ((modMask, button3), \w -> focus w >> mouseResizeWindow w
                                         >> windows W.shiftMaster)
    -- you may also bind events to the mouse scroll wheel (button4 and button5)
    ]

-- | The default set of configuration values itself
defaultConfig = XConfig
    { XMonad.borderWidth        = borderWidth
    , XMonad.workspaces         = workspaces
    , XMonad.layoutHook         = layout
    , XMonad.terminal           = terminal
    , XMonad.normalBorderColor  = normalBorderColor
    , XMonad.focusedBorderColor = focusedBorderColor
    , XMonad.modMask            = defaultModMask
    , XMonad.keys               = keys
    , XMonad.logHook            = logHook
    , XMonad.startupHook        = startupHook
    , XMonad.mouseBindings      = mouseBindings
    , XMonad.manageHook         = manageHook
    , XMonad.handleEventHook    = handleEventHook
    , XMonad.focusFollowsMouse  = focusFollowsMouse
    , XMonad.clickJustFocuses       = clickJustFocuses
    }

-- | Finally, a copy of the default bindings in simple textual tabular format.
help :: String
help = unlines ["The default modifier key is 'alt'. Default keybindings:",
    "",
    "-- launching and killing programs",
    "mod-Shift-Enter  Launch xterminal",
    "mod-p            Launch dmenu",
    "mod-Shift-p      Launch gmrun",
    "mod-Shift-c      Close/kill the focused window",
    "mod-Space        Rotate through the available layout algorithms",
    "mod-Shift-Space  Reset the layouts on the current workSpace to default",
    "mod-n            Resize/refresh viewed windows to the correct size",
    "",
    "-- move focus up or down the window stack",
    "mod-Tab        Move focus to the next window",
    "mod-Shift-Tab  Move focus to the previous window",
    "mod-j          Move focus to the next window",
    "mod-k          Move focus to the previous window",
    "mod-m          Move focus to the master window",
    "",
    "-- modifying the window order",
    "mod-Return   Swap the focused window and the master window",
    "mod-Shift-j  Swap the focused window with the next window",
    "mod-Shift-k  Swap the focused window with the previous window",
    "",
    "-- resizing the master/slave ratio",
    "mod-h  Shrink the master area",
    "mod-l  Expand the master area",
    "",
    "-- floating layer support",
    "mod-t  Push window back into tiling; unfloat and re-tile it",
    "",
    "-- increase or decrease number of windows in the master area",
    "mod-comma  (mod-,)   Increment the number of windows in the master area",
    "mod-period (mod-.)   Deincrement the number of windows in the master area",
    "",
    "-- quit, or restart",
    "mod-Shift-q  Quit xmonad",
    "mod-q        Restart xmonad",
    "mod-[1..9]   Switch to workSpace N",
    "",
    "-- Workspaces & screens",
    "mod-Shift-[1..9]   Move client to workspace N",
    "mod-{w,e,r}        Switch to physical/Xinerama screens 1, 2, or 3",
    "mod-Shift-{w,e,r}  Move client to screen 1, 2, or 3",
    "",
    "-- Mouse bindings: default actions bound to mouse events",
    "mod-button1  Set the window to floating mode and move by dragging",
    "mod-button2  Raise the window to the top of the stack",
    "mod-button3  Set the window to floating mode and resize by dragging"]

Feature request: see all windows in menu bar

Would be great if there was a option to show all the windows of the current workspace in the menu bar (xmobar or dzen2) istead of one.

For example: |Firefox| urxvt pavucontrol. where firefox is the current active window.

Floating window resize issue

So making a summary for this isn't easy. Here's the setup:

  • two monitors
  • different resolutions (important!)
  • keyboard focus on A
  • cursor on B

When using a manage hook to float dialogs (isDialog --> doFloat), it is stored in the layout according to the cursor screen resolution (B). When the window actually appears, it shows up next to the currently focused window (on A). However, because the resolutions are different, the ratio stored in XMonad for its location is a different size. When the window appears, XMonad resizes it to be the same ratio, but that means the resolution is different. Dialogs (possibly made worse due to improper size hints) then either get inflated with empty space or squished together with overlapping widgets.

The fix should be to determine the ratio of new windows based on where they will appear rather than the cursor-current screen resolution.

See coldfix/udiskie#79.

Signal (Chromium app) to workspace

I just installed Signal, which is a chromium app. When I launch it, I want the window to go to my fourth workspace. So I added the following line to myManageHook:

, title =? "Signal" --> doShift "4:chat"

But the app just launches in my current workspace.
I checked the window with xprop, which returns:

WM_NAME(UTF8_STRING) = "Signal"
_NET_WM_NAME(UTF8_STRING) = "Signal"

Is this a bug or am I doing something wrong?

Xmonad compatibility with RandR >= 1.4 and dual-GPUs in multihead

I was using xmonad in a very satisfying fashion until the fateful day when I upgraded the nvidia drivers on my Ubuntu laptop, powered by an Optimus enabled GPU.

My typical workflow was to:

  • Set the window arrangement with xrandr, typically along the lines of xrandr --output eDP --auto --output DP-0 --right-of eDP. Note that the integrated graphics is connected to the Intel chip while the external ports are connected to the discrete NVIDIA card.
  • Start xmonad with the appropriate number of screens (workspaces = withScreens 2 $ map show [1..9]).
    It worked very well.

With the latest update (nvidia-331 => nvidia-367, I also checked a few in between with the same results), xrandr succeeds without problems in turning on both displays but xmonad only uses one screen, in my case the external display:

  • xmobar only appears on that screen
  • It is impossible to move a window to/from a screen to the other with <ctrl+w/e>
  • Impossible of course to open a window in this display

I wonder if there is any way to fix this?

Accessing Xlib from Haskell or Python, I can see the following:

  • screen_count is 1
  • screen resolution is 3840x1080, so both screens merged
  • xrrGetScreenResources does return all modes for both screens, so there is probably a way to identify them there
  • nvidia-settings only report one screen (the external one, connected to the nvidia card)

Finally, let me say that Xmonad is not alone in this... I tried:

  • Unity presents a garbled display, stretched across screens and basically unusable
  • Gnome with Xmonad fails to start
  • Xfce works just fine
  • Xmonad in Xfce does not behave better

Thanks for the great software :)

Emacs window clips to half its size in xmonad

I am not sure if this is an xmonad or an emacs bug, but as it is really disruptive for my workflow I appreciate any help.

After starting Emacs in xmonad (v0.11, Debian testing package version 0.11.1-4) on some workspace with emacs -Q, switching to another work space, and then switching back to Emacs, the Emacs window becomes "cropped". It then still occupies the same space as a window in the window manager and the menu bar still extends to the full width of the window, but emacs only draws its "content" in the upper left quarter of the available space and all emacs windows are resized as if the whole
window had been resized.

The problem is 100% reproducible and happens independently of the used xmonad layout and even in floating mode. Sometimes more than one switch to another work space is required to trigger the behavior. When the window size changes (by switching to a different layout for example) Emacs again draws in the whole available space.

I am happy to provide additional details if you tell me what to do.

xmonad steals input if Config.hs refers to unbound keys

Originally reported on Google Code with ID 3

(As discussed briefly on #xmonad on 2007-04-28...)

If Config.hs contains the following line:

    , ((none,                  xK_F20   ), spawn "urxvt")

and F20 is unmapped (ie no key is bound to it, no xmodmap entry,
etc.) then xmonad seems to steal all input.  That is, all other
xmonad bindings seem to work fine (in particular, eg, mod-p for dmenu
and mod-shift-return to launch a terminal) but no launched
applications receive keypresses.  If you launch urxvt (eg via dmenu),
then on every keypress that window flickers as if losing focus
momentarily (xterm doesn't seem to do this).

I have observed similar behaviour in dwm and wmii, so perhaps the
problem is mine rather than xmonad's.  Furthermore, jcreigh was apparently
unable to reproduce this behaviour.

In dwm a config.h line as follows causes the same behaviour:

    { None,     XK_F20, spawn,      "exec xterm" }, \

(In http://www.suckless.org/pipermail/dwm/2006-October/001078.html
Anselm suggests that AnyModifier should be used rather than 0/None;
however, that causes dwm to fail to launch, with the following output:

    dwm: fatal error: request code=33, error code=2
    X Error of failed request: BadValue (integer parameter out of
    range for operation)
      Major opcode of failed request:  33 (X_GrabKey)
      Value in failed request:  0x8002
      Serial number of failed request:  39
      Current serial number in output stream:  246

so I think that's a red herring.  Nonetheless, that thread describes
essentially the same symptoms, so it's worth taking a look at.)

In wmii, the problem can be caused by:

  on_key("F20"){ system("wmiisetsid urxvt &") }

in wmiirc-config.rb (note use of ruby extension here).

Environment
===========

FreeBSD 6.1-SECURITY #0 (kernel built Wed Feb 14 15:48:51 UTC 2007).
Latest xmonad from darcs at time of writing
dwm 4.0
dmenu 2.7
wmii 3.1 with several patches and ruby configs
xorg versions (port numbers reported by FreeBSD pkg_info):
  xorg-clients-6.9.0_3
  xorg-libraries-6.9.0_1
  xorg-nestserver-6.9.0_1 (problems occur in and outside nesting)
  xorg-server-6.8.99.903_1

~/.xmodmap & .xsession attached.

Reported by combinator on 2007-04-29 18:38:59


- _Attachment: [.xmodmap](https://storage.googleapis.com/google-code-attachments/xmonad/issue-3/comment-0/.xmodmap)_ - _Attachment: [.xsession](https://storage.googleapis.com/google-code-attachments/xmonad/issue-3/comment-0/.xsession)_

someone missed a `getWindowAttributes` somewhere

so our recent crash reports on Arch have been identified, and they're what I suspected/feared

[16 00:36:20] <coltfred__> I just installed xmonad on a fresh arch. I've used it before on ubuntu and in general everything is basically working. However, when I try and start hexchat (only in xmonad) or if I try and kill stalonetray I get an error in my .xsession-error file about "user error (Error in function getWindowAttributes)". If I start in awesomewm or something else I don't have problems launching the application.

not clear where this is happening as yet though

Rebuild if existing executable does not start

This is forwarded from http://bugs.debian.org/808422

It may be that after a system upgrade, the compiled xmonad binary does not work any more, due to missing shared libraries. A simple recompilation would amend the problem, and not lock out the user. It would be nice if the xmonad wrapper binary would try that if starting the xmonad binary fails very quickly. Probably needs a few heuristics, but would be very useful.

multiple modules errors after today's xmonad update to v 0.12.11

Here's error log on recompilation process:
`Error detected while loading xmonad configuration file: /home/haron/.xmonad/xmonad.hs

xmonad.hs:13:1: error:
Failed to load interface for ‘XMonad.Actions.CycleWS’
Use -v to see a list of the files searched for.

xmonad.hs:14:1: error:
Failed to load interface for ‘XMonad.Actions.FloatSnap’
Use -v to see a list of the files searched for.

xmonad.hs:15:1: error:
Failed to load interface for ‘XMonad.Actions.FloatKeys’
Use -v to see a list of the files searched for.

xmonad.hs:16:1: error:
Failed to load interface for ‘XMonad.Actions.OnScreen’
Use -v to see a list of the files searched for.

xmonad.hs:17:1: error:
Failed to load interface for ‘XMonad.Actions.Promote’
Use -v to see a list of the files searched for.

xmonad.hs:18:1: error:
Failed to load interface for ‘XMonad.Actions.SpawnOn’
Use -v to see a list of the files searched for.

xmonad.hs:19:1: error:
Failed to load interface for ‘XMonad.Actions.SwapWorkspaces’
Use -v to see a list of the files searched for.

xmonad.hs:20:1: error:
Failed to load interface for ‘XMonad.Actions.UpdateFocus’
Use -v to see a list of the files searched for.

xmonad.hs:24:1: error:
Failed to load interface for ‘XMonad.Hooks.DynamicLog’
Use -v to see a list of the files searched for.

xmonad.hs:25:1: error:
Failed to load interface for ‘XMonad.Hooks.EwmhDesktops’
Use -v to see a list of the files searched for.

xmonad.hs:26:1: error:
Failed to load interface for ‘XMonad.Hooks.InsertPosition’
Use -v to see a list of the files searched for.

xmonad.hs:27:1: error:
Failed to load interface for ‘XMonad.Hooks.ManageDocks’
Use -v to see a list of the files searched for.

xmonad.hs:28:1: error:
Failed to load interface for ‘XMonad.Hooks.ManageHelpers’
Use -v to see a list of the files searched for.

xmonad.hs:29:1: error:
Failed to load interface for ‘XMonad.Hooks.Place’
Use -v to see a list of the files searched for.

xmonad.hs:30:1: error:
Failed to load interface for ‘XMonad.Hooks.SetWMName’
Use -v to see a list of the files searched for.

xmonad.hs:31:1: error:
Failed to load interface for ‘XMonad.Hooks.WorkspaceByPos’
Use -v to see a list of the files searched for.

xmonad.hs:32:1: error:
Failed to load interface for ‘XMonad.Hooks.UrgencyHook’
Use -v to see a list of the files searched for.

xmonad.hs:37:1: error:
Failed to load interface for ‘XMonad.Layout.Grid’
Perhaps you meant XMonad.Layout (from xmonad-0.12)
Use -v to see a list of the files searched for.

xmonad.hs:38:1: error:
Failed to load interface for ‘XMonad.Layout.IM’
Perhaps you meant XMonad.Layout (from xmonad-0.12)
Use -v to see a list of the files searched for.

xmonad.hs:39:1: error:
Failed to load interface for ‘XMonad.Layout.LayoutCombinators’
Use -v to see a list of the files searched for.

xmonad.hs:40:1: error:
Failed to load interface for ‘XMonad.Layout.NoBorders’
Use -v to see a list of the files searched for.

xmonad.hs:41:1: error:
Failed to load interface for ‘XMonad.Layout.PerWorkspace’
Use -v to see a list of the files searched for.

xmonad.hs:42:1: error:
Failed to load interface for ‘XMonad.Layout.Spacing’
Use -v to see a list of the files searched for.

xmonad.hs:43:1: error:
Failed to load interface for ‘XMonad.Layout.MouseResizableTile’
Use -v to see a list of the files searched for.

xmonad.hs:46:1: error:
Failed to load interface for ‘XMonad.Layout.ToggleLayouts’
Use -v to see a list of the files searched for.

xmonad.hs:49:1: error:
Failed to load interface for ‘XMonad.Prompt’
Use -v to see a list of the files searched for.

xmonad.hs:50:1: error:
Failed to load interface for ‘XMonad.Prompt.Man’
Use -v to see a list of the files searched for.

xmonad.hs:51:1: error:
Failed to load interface for ‘XMonad.Prompt.RunOrRaise’
Use -v to see a list of the files searched for.

xmonad.hs:52:1: error:
Failed to load interface for ‘XMonad.Prompt.Shell’
Use -v to see a list of t
he files searched for.

xmonad.hs:55:1: error:
Failed to load interface for ‘XMonad.Util.Scratchpad’
Use -v to see a list of the files searched for.

xmonad.hs:56:1: error:
Failed to load interface for ‘XMonad.Util.NamedScratchpad’
Use -v to see a list of the files searched for.

xmonad.hs:57:1: error:
Failed to load interface for ‘XMonad.Util.Run’
Use -v to see a list of the files searched for.

xmonad.hs:58:1: error:
Failed to load interface for ‘XMonad.Util.EZConfig’
Use -v to see a list of the files searched for.`

Upgrading to 0.12 change first Workspace behavior

Hi !

I just upgraded to xmonad 0.12, and I have two xmobar process. With xmonad 0.11, no problem, opening several windows on the first workspace is working as expected. Now, with 0.12, windows is above the second xmobar menu (as soon as I open one window). It's not happening on other workspaces.

An idea ?

Here is my xmonad.hs : http://lpaste.net/5889344209512562688

Thanks.

N.B. : the second xmobar menu is launched by my ~/.xinitrc

Regression: dzen2 now gets obscured by windows

Since upgrading xmonad from 0.11.1 to 0.12 and xmonad-contrib from 0.11.4 to 0.12, I noticed that on the first workspace dzen2-0.9.5 would always overlap with the windows, causing it to become obscured whenever a tiled window is present. But this problem does not afflict other workspaces. Did something change with how avoidStruts works?

The issue persists even if I reload the configuration, and remains on the first workspace (even if I reload on a different workspace).

This is the config I use: xmonad.hs. I am on Arch Linux.

Support for custom config locations and recompile strategies

I believe that the two topics mentioned in the subject of this issue are related and can be solved together. I'm bringing in everyone from issues #8, #7, #56, and #53. Sorry for the spam if you are no longer interested in these issues.

Broadly speaking, there are two main groups of xmonad users:

  1. Those who treat xmonad as a window manager with a configuration file. Typically these users have xmonad started by a login manager. In turn, xmonad compiles the configuration file as necessary and then uses exec to replace itself with the binary generated by compiling the configuration file. Some of these users are happy to keep their config files in ~/.xmonad, others would prefer the XDG config directory.

  2. Those who treat xmonad as a window manager construction kit. Instead of thinking about their xmonad.hs file as a configuration file, these users build up a set of files, possibly in ~/.xmonad/lib, and possibly using a full cabal project. These users therefore might not want to even use the ~/.xmonad directory or the xmonad binary that comes with the core package.

Of course, every user is going to fall somewhere in between those two groupings. However, I think we can solve all of the issues above if we encourage users to adopt one of the two mentioned groups.

For group 1 we should update Main.hs to first look for xmonad.hs in the XDG configuration directory, and the compiled configuration binary in the XDG data directory. Then fallback to ~/.xmonad. Recent versions of the System.Directory module have support for XDG.

Group 2 is more diverse and complicated. I think this group of users should abandon the xmonad executable and directly use the one generated by compiling their configuration. This means users would have to arrange to have their executable started by their login manager instead of the main xmonad executable, and replace their key binding for xmonad --recompile with a custom script that can build from cabal, stack, whatever. To facilitate this I suggest a new config option to force xmonad to bootstrap itself without execing anything.

Both groups require that any code in xmonad-contrib that reads/writes files to ~/.xmonad be patched to first use XDG directories. Group 1 for obvious reasons, but group 2 as well because they may not even be using ~/.xmonad anymore. If that directory doesn't exist some code in xmonad-contrib will throw an exception.

For transparency, I find myself in group 2. I use ~/.xinitrc to start xmonad directly and would prefer to start my custom xmonad binary instead. I currently build with stack but I'm switching to cabal new-build. I run NixOS and my end goal is to put my custom xmonad binary in the Nix store and not use ~/.xmonad. When I make changes to my .hs files I simply want to nix-build or nix-env and then replace the running xmonad.

Before I work on a PR, I wanted to get feedback. I really do want to unify all of these open issues in a way that will make xmonad flexible enough for all of us. So please add a comment and let me know how far off I am or if this solution would work for you. Thanks.

/cc @siddharthist @sgf-dma @zabbal @zsedem @NeQuissimus @Philonous

Dragging a window that moves other windows in response to being moved is bugged

When you drag the main window of an application that has custom code to move other windows belonging to the same application (for example tool windows) in response to the move event on the main window, then the main window will jump between the drag target point and its original location.

A real-world application where this occurs is the Android Emulator:

emulator

If you move the main window, the toolbar window will automatically be moved as well so that it is always next to the main window.

If you try to do this in XMonad, what happens is that you cannot move the emulator's main window, because when you try to drag it, it will start to jump between the where the mouse is (drag target position) and its original position (where it was before the dragging started).

Trayer not working properly with xmonad/xmobar

I have the following in a bash script which is executed by spawn :: string -> IO ()

trayer --SetDockType true --expand true --edge top --align right --width 15 --height 18 --transparent true --alpha 255 &

Now, everything works properly when I look for the process with ps ax | grep trayer. The output indicates that the process is indeed running. However, opening up relevant processes such as transmission-gtk and skype will not bring up the icon in the sys tray. However, when I pkill trayer, and then run trayer again, it will then show the icons. Is there something peculiar to xmonad or xmobar that could be hiding the systray due to a race condition of some sort?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.