You are not logged in.

#1 2013-03-30 09:49:14

White girl
Member
Registered: 2012-12-24
Posts: 34

Xmonad - How do you make a certain workspace float all windows?

I tried googling for it, but I couldn't find anything, to my surprise. sad

I want to make the workspace ["3:steam"] to auto-float all windows what's in there.

Offline

#2 2013-03-30 12:01:37

Nepherte
Member
From: Singapore
Registered: 2008-09-09
Posts: 427

Re: Xmonad - How do you make a certain workspace float all windows?

Something like this:

import XMonad
import XMonad.Layout.SimpleFloat
import XMonad.Layout.PerWorkspace (onWorkspace)

-- defaultLayouts = <put yours here>

myLayouts = onWorkspace "3:steam" simpleFloat $ defaultLayouts

main = do
	xmonad $ defaultConfig {
		layoutHook  = myLayouts
	}

Dont't forget to uncomment defaultLayouts and to put your normal layouts in there.

Offline

#3 2013-03-30 12:41:24

White girl
Member
Registered: 2012-12-24
Posts: 34

Re: Xmonad - How do you make a certain workspace float all windows?

Nepherte wrote:

Something like this:

import XMonad
import XMonad.Layout.SimpleFloat
import XMonad.Layout.PerWorkspace (onWorkspace)

-- defaultLayouts = <put yours here>

myLayouts = onWorkspace "3:steam" simpleFloat $ defaultLayouts

main = do
	xmonad $ defaultConfig {
		layoutHook  = myLayouts
	}

Dont't forget to uncomment defaultLayouts and to put your normal layouts in there.

Thanks! Though how can I add myLayouts to this current:

layoutHook = smartBorders $ myLayout

in main function?

Last edited by White girl (2013-03-30 12:41:34)

Offline

#4 2013-03-30 13:06:03

Nepherte
Member
From: Singapore
Registered: 2008-09-09
Posts: 427

Re: Xmonad - How do you make a certain workspace float all windows?

If you want to use smartBorders $ myLayout on any other workspace, assign it to the variable defaultLayouts in my example:

defaultLayouts = smartBorders $ myLayout

then the layoutHook of my example should take care of the rest:

layoutHook = myLayouts

You could probably eliminate myLayout all together by putting its content directly in defaultLayouts. But for that, I would need to see your xmonad.hs

Offline

#5 2013-03-30 13:43:30

White girl
Member
Registered: 2012-12-24
Posts: 34

Re: Xmonad - How do you make a certain workspace float all windows?

Error detected while loading xmonad configuration file: /home/dana/.xmonad/xmonad.hs

xmonad.hs:362:16: parse error on input `='

Please check the file for errors.]

http://pastebin.com/VTeGU4fe

What was I doing wrong?

Last edited by White girl (2013-03-30 13:53:57)

Offline

#6 2013-03-30 14:21:55

Nepherte
Member
From: Singapore
Registered: 2008-09-09
Posts: 427

Re: Xmonad - How do you make a certain workspace float all windows?

The indentation is wrong. Line 362 should start with no whitespace at all. Note that Haskell is rather sensitive to it. See https://en.wikibooks.org/wiki/Haskell/Indentation for more information.

Offline

#7 2013-03-30 14:28:12

White girl
Member
Registered: 2012-12-24
Posts: 34

Re: Xmonad - How do you make a certain workspace float all windows?

Nepherte wrote:

The indentation is wrong. Line 362 should start with no whitespace at all. Note that Haskell is rather sensitive to it. See https://en.wikibooks.org/wiki/Haskell/Indentation for more information.

Removed the indentation.

Error detected while loading xmonad configuration file: /home/dana/.xmonad/xmonad.hs

xmonad.hs:362:47: Not in scope: `defaultLayouts'

xmonad.hs:387:5:
    `defaultLayouts' is not a (visible) constructor field name

Please check the file for errors.

Offline

#8 2013-03-30 14:52:13

Nepherte
Member
From: Singapore
Registered: 2008-09-09
Posts: 427

Re: Xmonad - How do you make a certain workspace float all windows?

You defined defaultLayouts inside the scope of defaultConfig. Outside that scope it is not visible, which is exactly what you're trying to do at line 362. In addition, you treat defaultLayouts as a property of defaultConfig, which it isn't (line 387).

I think you're also a bit confused with defaults and defaultConfig. You're overriding the layoutHook in defaultConfig at line 388, storing the modified defaultConfig as defaults. Then you override the layoutHook from defaults at line 351 by the original layoutHook from defaultConfig, losing the changes you made in your custom defaults configuration.

Try something like this:

defaultLayouts = avoidStruts (
    Tall 1 (3/100) (1/2) |||
    Mirror (Tall 1 (3/100) (1/2)) |||
    tabbed shrinkText tabConfig |||
    Full |||
    spiral (6/7)) |||
    noBorders (fullscreenFull Full)

myLayouts = onWorkspace "three" simpleFloat $ defaultLayouts

main = do  
 xmproc <- spawnPipe "/usr/bin/xmobar ~/.xmobarrc"  
 xmonad $ defaults  
      { manageHook = manageDocks <+> manageHook defaultConfig  
      , layoutHook = avoidStruts $ myLayouts
      , logHook = dynamicLogWithPP xmobarPP  
           { ppOutput = hPutStrLn xmproc  
           , ppTitle = xmobarColor "#657b83" "" . shorten 100  
           , ppCurrent = xmobarColor "#c0c0c0" "" . wrap "" ""
           , ppSep     = xmobarColor "#c0c0c0" "" " | "
           , ppUrgent  = xmobarColor "#ff69b4" ""
           , ppLayout = const "" -- to disable the layout info on xmobar  
           }
     } 

defaults = defaultConfig {
    -- simple stuff
    terminal = myTerminal,
    focusFollowsMouse = myFocusFollowsMouse,
    borderWidth = myBorderWidth,
    modMask = myModMask,
    workspaces = myWorkspaces,
    normalBorderColor = myNormalBorderColor,
    focusedBorderColor = myFocusedBorderColor,
 
    -- key bindings
    keys = myKeys,
    mouseBindings = myMouseBindings,
 
    -- hooks, layouts
    -- defaultLayouts = smartBorders $ myLayout,
    -- layoutHook = myLayouts,
    manageHook = myManageHook,
    startupHook = myStartupHook
}

Offline

#9 2013-03-30 16:29:20

White girl
Member
Registered: 2012-12-24
Posts: 34

Re: Xmonad - How do you make a certain workspace float all windows?

Thank you very much, Nepherte! It's now working. Not exactly what intended, but better than nothing!

Somtimes when I open a new window, it opens in background. And the title bar appears, but it disappears if I move the window:
xKzdYSk.png

But thanks again!

EDIT: how do you add more than one workspace to float?

Last edited by White girl (2013-03-30 16:38:12)

Offline

#10 2013-03-30 19:23:13

Nepherte
Member
From: Singapore
Registered: 2008-09-09
Posts: 427

Re: Xmonad - How do you make a certain workspace float all windows?

White girl wrote:

EDIT: how do you add more than one workspace to float?

You either repeat the onWorkspace directive like this:

myLayouts = onWorkspace "two" simpleFloat $ onWorkspace "three" simpleFloat $ defaultLayouts

or you use the more convenient onWorkspaces directive like this:

myLayouts = onWorkspaces ["two","three"] simpleFloat $ defaultLayouts

Don't forget to import the necessary module XMonad.Layout.PerWorkspace.

Offline

#11 2013-03-30 19:27:58

Nepherte
Member
From: Singapore
Registered: 2008-09-09
Posts: 427

Re: Xmonad - How do you make a certain workspace float all windows?

White girl wrote:

Somtimes when I open a new window, it opens in background. And the title bar appears, but it disappears if I move the window

Not sure what you mean by "opens in background". Can you elaborate? Note that there exist several floating layouts. For example XMonad.Layout.SimplestFloat, which is the same as SimpleFloat but without the title bar.

Offline

#12 2013-03-31 00:12:52

White girl
Member
Registered: 2012-12-24
Posts: 34

Re: Xmonad - How do you make a certain workspace float all windows?

Nepherte wrote:
White girl wrote:

Somtimes when I open a new window, it opens in background. And the title bar appears, but it disappears if I move the window

Not sure what you mean by "opens in background". Can you elaborate? Note that there exist several floating layouts. For example XMonad.Layout.SimplestFloat, which is the same as SimpleFloat but without the title bar.

SimpleFloat works well, thanks.

And well, on Steam, when I click "install" on any game, it opens an installation window in background, I have to move the window around so I could see the new window.

Offline

Board footer

Powered by FluxBB