You are not logged in.
I tried googling for it, but I couldn't find anything, to my surprise. ![]()
I want to make the workspace ["3:steam"] to auto-float all windows what's in there.
Offline
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
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 $ myLayoutin main function?
Last edited by White girl (2013-03-30 12:41:34)
Offline
If you want to use smartBorders $ myLayout on any other workspace, assign it to the variable defaultLayouts in my example:
defaultLayouts = smartBorders $ myLayoutthen the layoutHook of my example should take care of the rest:
layoutHook = myLayoutsYou 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
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.]What was I doing wrong?
Last edited by White girl (2013-03-30 13:53:57)
Offline
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
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
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
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:
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
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 $ defaultLayoutsor you use the more convenient onWorkspaces directive like this:
myLayouts = onWorkspaces ["two","three"] simpleFloat $ defaultLayoutsDon't forget to import the necessary module XMonad.Layout.PerWorkspace.
Offline
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
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