You are not logged in.
thanks
Offline
And a question about Xmonad itself:
3) In awesome, I was able to launch new clients but keep the master window the same (i.e. my workspace for internet, when I open a console i'd like it launch in the bottom 1/2 of the screen, and not replace opera.) I looked into Xmonad.Application.DwmPromote, but I don't think that's what I want.
Found an answer to my own question, posting it for help to others that may want this setup:
2.5 Make new windows appear 'below' rather than 'above' the current window
Add doF W.swapDown to your manageHook. For instance, a minimal config would look like this:
import XMonad
import qualified XMonad.StackSet as W
main = xmonad defaultConfig
{ manageHook = (doF W.swapDown) <+> manageHook defaultConfig
}
Thanks to Vintendo for the link http://haskell.org/haskellwiki/Xmonad/F … _questions
Offline
Did you guys have to learn Haskell to make these? I'm just starting out with Haskell and I can't really say I like it all that much
Offline
Did you guys have to learn Haskell to make these? I'm just starting out with Haskell and I can't really say I like it all that much
You don't necessarily need to know it, since you can pretty blindly combine the good elements of two example configs, and it works, provided you follow the 'layout rule' of indentations.
But if you mix things badly, or want to combine stuff in different ways (you can say, have a sub-mode by getting sub mapped commands call the submap after completing), then you need to know a bit of haskell.
But for the most part, other people have added tons of useful functionality into contrib modules, which have explanations how to use them.
Offline
Did you guys have to learn Haskell to make these? I'm just starting out with Haskell and I can't really say I like it all that much
Knowing Haskell certainly made configuring XMonad a whole lot easier, but it's not necessary. With no understanding of the language whatsoever you can still mess around with key-bindings, etc.
stick with it, and I'm sure you will see the advantages of Haskell soon enough. It's tough at first, I know, especially if you're coming from an imperative language. But don't give up!
and if you get stuck at some point configuring your xmonad.hs, ask the people in #xmonad.
abcdefghijklmnopqrstuvwxyz
Offline
Hi!
I write a game which creates 800x600 window. As you know, xmonad dictates size of every new window when it appears. So after launching this game it has invalid size. I cannot code because of it.
I tried to make it float in front of all other windows (emacs, launching-console, git-console), but unsuccessfully.
As far as I know I should make a rule or a hook for floating. It doesn't have WM_CLASS, only WM_NAME:
maciek:~$ xprop
WM_ICON_NAME(STRING) = "Hipmunk"
WM_NAME(STRING) = "Hipmunk"
WM_STATE(WM_STATE):
window state: Normal
icon window: 0x0
WM_NORMAL_HINTS(WM_SIZE_HINTS):
WM_PROTOCOLS(ATOM): protocols WM_DELETE_WINDOW, _NET_WM_PING
"Hipmunk" is title of my game.
So I tried to set a rule for floating by title:
myManageHook = composeAll . concat $
[ [ title =? t --> doFloat | t <- myOtherFloats] ]
where
myOtherFloats = ["xclock", "Hipmunk"]
But it doesn't work, I don't know why, because xclock sets itself to float layer.
Can somebody help my developing my game?
Best solution would be pointing a mistake in my config file, but also saying how to set WM_CLASS would be good solution. Thanks in advance.
My Xmonad version is 0.7.
edit:
Some helpful guy on gentoo forums solved my problem:
http://forums.gentoo.org/viewtopic-p-51 … ml#5192240
Last edited by kmp (2008-08-23 09:37:30)
Offline
After editing my xmonad.hs I keep getting this error: "parse error on 66:0 probably wrong indentation"
I have no idea why as I see no identation error on line 66 (the line with myLogHook h .. ). What's wrong?
xmonad.hs:
import XMonad
import System.Exit
import XMonad.Hooks.DynamicLog
import XMonad.Hooks.ManageDocks
import XMonad.Util.Run (spawnPipe)
import System.IO (hPutStrLn)
import XMonad.Util.Loggers
import qualified XMonad.StackSet as W
import qualified Data.Map as M
dmenuExec =
"exe=`dmenu_path | dmenu -b -nb black -nf white -sb gray -sf black` && eval \"exec $exe\""
myKeys conf@(XConfig {XMonad.modMask = modMask}) = M.fromList $
[ ((modMask, xK_Return), spawn $ XMonad.terminal conf)
, ((modMask, xK_g ), spawn "gmrun")
, ((modMask, xK_f ), spawn "firefox")
, ((modMask .|. shiftMask, xK_c ), kill)
, ((modMask, xK_space ), sendMessage NextLayout)
, ((modMask .|. shiftMask, xK_space ), setLayout $ XMonad.layoutHook conf)
, ((modMask, xK_n ), refresh)
, ((modMask, xK_Tab ), windows W.focusDown)
, ((modMask, xK_j ), windows W.focusDown)
, ((modMask, xK_e ), windows W.focusDown)
, ((modMask, xK_Right ), windows W.focusDown)
, ((modMask, xK_k ), windows W.focusUp )
, ((modMask, xK_Left ), windows W.focusUp )
, ((modMask, xK_m ), windows W.focusMaster )
, ((modMask .|. shiftMask, xK_Return), windows W.swapMaster)
, ((modMask .|. shiftMask, xK_e ), windows W.swapDown )
, ((modMask .|. shiftMask, xK_j ), windows W.swapDown )
, ((modMask .|. shiftMask, xK_k ), windows W.swapUp )
, ((modMask, xK_h ), sendMessage Shrink)
, ((modMask, xK_l ), sendMessage Expand)
, ((modMask, xK_t ), withFocused $ windows . W.sink)
, ((modMask , xK_b ), sendMessage ToggleStruts)
, ((modMask .|. shiftMask, xK_q ), io (exitWith ExitSuccess))
, ((modMask , xK_q ),
broadcastMessage ReleaseResources >> restart "xmonad" True)
]
++
[((m .|. modMask, k), windows $ f i)
| (i, k) <- zip (XMonad.workspaces conf) [xK_1 .. xK_9]
, (f, m) <- [(W.greedyView, 0), (W.shift, shiftMask)]]
myMouseBindings (XConfig {XMonad.modMask = modMask}) = M.fromList $
[ ((modMask, button1), (\w -> focus w >> mouseMoveWindow w))
, ((modMask, button2), (\w -> focus w >> windows W.swapMaster))
, ((modMask, button3), (\w -> focus w >> mouseResizeWindow w))
]
myLayout = avoidStruts (tall ||| Mirror tall ||| Full)
where
tall = Tall nmaster delta ratio
nmaster = 1
ratio = 1/2
delta = 2/100
myManageHook = composeAll
[ className =? "MPlayer" --> doFloat
, className =? "Gimp" --> doFloat
, className =? "Gran Paradiso" --> doF (W.shift "web")
, resource =? "desktop_window" --> doIgnore
myLogHook h = dynamicLogWithPP $ defaultPP {
ppCurrent = dzenColor "#222222" "white" . pad
, ppVisible = dzenColor "white" "black" . pad
, ppHidden = dzenColor "white" "#222222" . pad
, ppHiddenNoWindows = dzenColor "#777777" "#222222" . pad
, ppUrgent = dzenColor "red" "yellow"
, ppWsSep = "^r(2x17)"
, ppSep = "^r(5x4)"
, ppLayout = dzenColor "white" "#222222" .
(\ x -> fill (case x of
"Tall" -> icon "tall.xbm"
"Mirror Tall" -> icon "mtall.xbm"
"Full" -> icon "full.xbm"
_ -> pad x) 4)
, ppTitle = ("^fg(white) " ++) . dzenEscape
-- , ppExtras = wrap date "%a"
, ppOutput = hPutStrLn h
}
where
icon h = "^i(/home/edgar/dzen_bitmaps/" ++ h ++ ")"
fill :: String -> Int -> String
fill h i = "^p(" ++ show i ++ ")" ++ h ++ "^p(" ++ show i ++ ")"
myStatusBar = "dzen2 -fn '-*-dina-*-r-*-*-14-*-*-*-*-*-*-*' -bg '#222222' -fg '#777777' -h 16 -w 1280 -sa c -e '' -ta l"
main = do din <- spawnPipe myStatusBar
xmonad $ defaultConfig {
terminal = "urxvtc",
focusFollowsMouse = True,
borderWidth = 1,
modMask = mod1Mask,
numlockMask = mod2Mask,
workspaces = ["main","web","dev","fun","music"],
normalBorderColor = "#000000",
focusedBorderColor = "white",
-- key bindings
keys = myKeys,
mouseBindings = myMouseBindings,
-- hooks, layouts
layoutHook = myLayout,
manageHook = myManageHook,
logHook = myLogHook din
}
Thanks
Offline
After editing my xmonad.hs I keep getting this error: "parse error on 66:0 probably wrong indentation"
I have no idea why as I see no identation error on line 66 (the line with myLogHook h .. ). What's wrong?
xmonad.hs:
import XMonad import System.Exit import XMonad.Hooks.DynamicLog import XMonad.Hooks.ManageDocks import XMonad.Util.Run (spawnPipe) import System.IO (hPutStrLn) import XMonad.Util.Loggers import qualified XMonad.StackSet as W import qualified Data.Map as M dmenuExec = "exe=`dmenu_path | dmenu -b -nb black -nf white -sb gray -sf black` && eval \"exec $exe\"" myKeys conf@(XConfig {XMonad.modMask = modMask}) = M.fromList $ [ ((modMask, xK_Return), spawn $ XMonad.terminal conf) , ((modMask, xK_g ), spawn "gmrun") , ((modMask, xK_f ), spawn "firefox") , ((modMask .|. shiftMask, xK_c ), kill) , ((modMask, xK_space ), sendMessage NextLayout) , ((modMask .|. shiftMask, xK_space ), setLayout $ XMonad.layoutHook conf) , ((modMask, xK_n ), refresh) , ((modMask, xK_Tab ), windows W.focusDown) , ((modMask, xK_j ), windows W.focusDown) , ((modMask, xK_e ), windows W.focusDown) , ((modMask, xK_Right ), windows W.focusDown) , ((modMask, xK_k ), windows W.focusUp ) , ((modMask, xK_Left ), windows W.focusUp ) , ((modMask, xK_m ), windows W.focusMaster ) , ((modMask .|. shiftMask, xK_Return), windows W.swapMaster) , ((modMask .|. shiftMask, xK_e ), windows W.swapDown ) , ((modMask .|. shiftMask, xK_j ), windows W.swapDown ) , ((modMask .|. shiftMask, xK_k ), windows W.swapUp ) , ((modMask, xK_h ), sendMessage Shrink) , ((modMask, xK_l ), sendMessage Expand) , ((modMask, xK_t ), withFocused $ windows . W.sink) , ((modMask , xK_b ), sendMessage ToggleStruts) , ((modMask .|. shiftMask, xK_q ), io (exitWith ExitSuccess)) , ((modMask , xK_q ), broadcastMessage ReleaseResources >> restart "xmonad" True) ] ++ [((m .|. modMask, k), windows $ f i) | (i, k) <- zip (XMonad.workspaces conf) [xK_1 .. xK_9] , (f, m) <- [(W.greedyView, 0), (W.shift, shiftMask)]] myMouseBindings (XConfig {XMonad.modMask = modMask}) = M.fromList $ [ ((modMask, button1), (\w -> focus w >> mouseMoveWindow w)) , ((modMask, button2), (\w -> focus w >> windows W.swapMaster)) , ((modMask, button3), (\w -> focus w >> mouseResizeWindow w)) ] myLayout = avoidStruts (tall ||| Mirror tall ||| Full) where tall = Tall nmaster delta ratio nmaster = 1 ratio = 1/2 delta = 2/100 myManageHook = composeAll [ className =? "MPlayer" --> doFloat , className =? "Gimp" --> doFloat , className =? "Gran Paradiso" --> doF (W.shift "web") , resource =? "desktop_window" --> doIgnore myLogHook h = dynamicLogWithPP $ defaultPP { ppCurrent = dzenColor "#222222" "white" . pad , ppVisible = dzenColor "white" "black" . pad , ppHidden = dzenColor "white" "#222222" . pad , ppHiddenNoWindows = dzenColor "#777777" "#222222" . pad , ppUrgent = dzenColor "red" "yellow" , ppWsSep = "^r(2x17)" , ppSep = "^r(5x4)" , ppLayout = dzenColor "white" "#222222" . (\ x -> fill (case x of "Tall" -> icon "tall.xbm" "Mirror Tall" -> icon "mtall.xbm" "Full" -> icon "full.xbm" _ -> pad x) 4) , ppTitle = ("^fg(white) " ++) . dzenEscape -- , ppExtras = wrap date "%a" , ppOutput = hPutStrLn h } where icon h = "^i(/home/edgar/dzen_bitmaps/" ++ h ++ ")" fill :: String -> Int -> String fill h i = "^p(" ++ show i ++ ")" ++ h ++ "^p(" ++ show i ++ ")" myStatusBar = "dzen2 -fn '-*-dina-*-r-*-*-14-*-*-*-*-*-*-*' -bg '#222222' -fg '#777777' -h 16 -w 1280 -sa c -e '' -ta l" main = do din <- spawnPipe myStatusBar xmonad $ defaultConfig { terminal = "urxvtc", focusFollowsMouse = True, borderWidth = 1, modMask = mod1Mask, numlockMask = mod2Mask, workspaces = ["main","web","dev","fun","music"], normalBorderColor = "#000000", focusedBorderColor = "white", -- key bindings keys = myKeys, mouseBindings = myMouseBindings, -- hooks, layouts layoutHook = myLayout, manageHook = myManageHook, logHook = myLogHook din }
Thanks
You have two leading spaces on all the elements on that list other than the first, make them all the same and it should work out ok. I think haskell is a bit pedantic about that sort of thing.
Offline
Thanks for the suggestion chimpyw, but found out that the problem was a missing bracket in the section of line 66.
Sometimes the smallest mistakes can the longest time to figure out.
Offline
I'm currently having quite the personal renaissance with Xmonad. It really is very extensible, but have this minor annoyance that I can't seem to figure out.
How do I get a dwm-like switching of workspaces with a simple left click of the mouse on one of the workspace "tags"? I figure there must be some kind of contrib/module/workaround that would enable this.
Thanks. Any ideas are welcome.
Offline
Wellll...no. And yes. Kinda.
See this config and it's worth reading that entire thread if you're really interested, since he updates his configs later on.
If this situation has changed I'd love to be shown the error of my ways, but at present I think this is it as far as solutions go.
Cthulhu For President!
Offline
XMonad.Hooks.EwmhDesktops and a ewmh compliant pager, like the one in gnome-panel should do what you want.
Offline
Thanks buttons, I've read the thread, but I can't decipher what exactly in redbeard's script/xmonad.hs that enables this feature. I'll have to look harder I guess. Maybe this will be a good reason to get a better understanding of Haskell and try figure how Xmonad works with dzen2 concerning workspaces.
vogt> Thanks for the suggestion, but this is not what I'm looking for exactly. Why have a separate pager when one could just click the workspace tag like in Dwm? But I guess it would be a possible workaround.
Last edited by Ashren (2008-08-30 11:28:09)
Offline
I was having some problems with awesome (after some time, it would use +100MB of RAM), so I decided to give Xmonad a second chance.
Something that passed unnoticed by me the last time I tried it was the number of layouts that one could use after installing xmonad-contrib. But even with all these layouts, everybody seems to use gimp as a floating application. Isn't there a layout that would be suitable? Layout.ThreeColumns would be perfect if the master window occupied the centre of the screen.
One more question. I've configured a MangeHook so urxvt goes to a specific workspace. The problem is that I use ncmpcpp (actually, urxvt -e ncmpcpp) to control my MPD, and it goes to the same workspace when I run it. How can I make urxvt follow a rule and ncmpcpp another?
(lambda ())
Offline
I was having some problems with awesome (after some time, it would use +100MB of RAM), so I decided to give Xmonad a second chance.
Something that passed unnoticed by me the last time I tried it was the number of layouts that one could use after installing xmonad-contrib. But even with all these layouts, everybody seems to use gimp as a floating application. Isn't there a layout that would be suitable? Layout.ThreeColumns would be perfect if the master window occupied the centre of the screen.
One more question. I've configured a MangeHook so urxvt goes to a specific workspace. The problem is that I use ncmpcpp (actually, urxvt -e ncmpcpp) to control my MPD, and it goes to the same workspace when I run it. How can I make urxvt follow a rule and ncmpcpp another?
what you can try is to do the following:
1. "urxvt -T ncmpcpp -e ncmpcpp" to define a different window title
2. set a rule in your manageHook based on this specific title.
Offline
Thanks! I was using the -name argument, but it wasn't doing what I wanted.
About gimp, I'll probably try something this weekend, but if anyone has any thought on it, I'd be glad to hear it.
(lambda ())
Offline
I'm sorry for bumping this topic, but I have another question.
How can I set a new window to be slave and not master? (automatically)
Edit: Nevermind. I found it out.
on my ManageHook:
myManageHook = composeAll . concat $
[
...
, [className =? "app" --> doF (W.swapDown)]
]
edit2: about gimp, this is the layout I've been using with it. You probably will have to change the ratios, because I have a small screen (1024x768)
import XMonad.Layout
import XMonad.Layout.PerWorkspace
import XMonad.Layout.Master
...
tiled = Tall 1 (3/100) (67/100)
gimp = mastered (3/100) (1/5) $ Tall 1 (3/100) (75/100)
myLayoutHook = avoidStruts $ onWorkspace "www" Full $
onWorkspace "mpc" Full $
onWorkspace "pdf" Full $
onWorkspace "gimp" gimp $
tiled ||| Mirror tiled ||| Full
Last edited by andre.ramaciotti (2008-11-21 22:15:04)
(lambda ())
Offline
Quick question. How does one get new floating windows to float on top? Most of mine are underneath other windows.
Last edited by Intrepid (2009-01-02 19:37:32)
Intrepid (adj.): Resolutely courageous; fearless.
Offline
Is there a way to join this two lines in my manageHook?
, [className =? "Pidgin" --> doF (W.shift "im")]
, [className =? "Pidgin" --> doF (W.swapDown)]
What I want is that when a new conversation starts, it will be placed on "im" workspace and will be swapped down. The master pane is used by the contacts list, that's why I want to swap down chat windows.
(lambda ())
Offline
Is there a way to join this two lines in my manageHook?
, [className =? "Pidgin" --> doF (W.shift "im")] , [className =? "Pidgin" --> doF (W.swapDown)]
What I want is that when a new conversation starts, it will be placed on "im" workspace and will be swapped down. The master pane is used by the contacts list, that's why I want to swap down chat windows.
After reading the manageHook doc and asking a bit on Xmonad irc I got the following possible solution.
className =? "Pidgin" --> doF (W.shift "im") <+> doF (W.swapdown)
See if this does what you want.
Offline
It doesn't work exactly how I wanted, but it solves one problem.
On both cases, if I'm on the "im" workspace, it works as it should. But let's say that I'm on the "term" workspace, with two open terminals. As it was, when someone started a conversation with me, the new created window would go to the "im" workspace and the terminals would swap places. Now, this undesired effect doesn't happen anymore.
Still, if I'm not on the "im" workspace, the new created window will be sent to there, but it won't swap down, so it will stay where the contacts list should be.
I've tried using XMonad.Layout.IM, but all pidgin windows have the same ClassName...
(some time later...) I rechecked XMonad.Layout.IM page, and I found out I don't need to use strictly the ClassName. I'll try it again.
Thank you, Ashren.
Edit: It's working how I wanted now. If someone is interested, here is the relevant part of the code:
import XMonad.Layout.PerWorkspace
import XMonad.Layout.IM
import XMonad.Layout.Mirror
import Data.Ratio ((%))
...
myManageHook = composeAll . concat $
[ [className =? c --> doFloat | c <- myFloats]
, [title =? t --> doFloat | t <- myOtherFloats]
, [className =? r --> doIgnore | r <- myIgnores]
...
, [className =? "Pidgin" --> doF (W.shift "im") ]
]
...
myIM = withIM (1%4) (Title "Buddy List") $ Tall 2 (3/100) (50/100)
tiled = Tall 1 (3/100) (67/100)
myLayoutHook = avoidStruts $ onWorkspace "www" (Full ||| tiled ||| Mirror tiled) $
onWorkspace "mpc" Full $
onWorkspace "pdf" Full $
onWorkspace "im" myIM $
tiled ||| Mirror tiled ||| Full
Last edited by andre.ramaciotti (2009-01-03 22:58:36)
(lambda ())
Offline
Did anyone noticed that no matter what Layout you start with. (I tried TwoPane and DwmStyleFloat)
Gimp is always started in the float layer.
What's going one?
Offline
Did anyone noticed that no matter what Layout you start with. (I tried TwoPane and DwmStyleFloat)
Gimp is always started in the float layer.
What's going one?
In the default config, there is a manageHook that floats gimp (by class). If you don't want it floated, replace that hook with one that doesn't do that; check out the config that is run by default: http://haskell.org/haskellwiki/Xmonad/C … _xmonad.hs
Offline
Wrong thread, sorry.
OT:
Dzen has undergone some changes lately and now supports, besides XFT fonts, clickable areas.
See HERE for further details.
Comments and possible bug/testing reports welcome.
Last edited by gotmor (2009-02-13 18:23:56)
Offline
Hey!
I uploaded my xmonad.hs on my webspace:
A little screenshot showing irssi, ncmpcpp and mutt:
www.n-sch.de/bilder/xmonad3.png
A few features:
-- Modkey: Mod4 ("windows-key")
-- Urgency Hooks, switch to urgent windows with M-q
-- Multimedia-Keys for MPD and alsamixer
-- Run all your applications with M-F1 to M-F8 and have them on the desired workspaces
-- Resizeable Layouts
-- Toggle fullscreen with M-f
-- Gimp & Pidgin 2 3 layouts
-- Clickable dzen bars (see this thread). Controll your workspaces, mutt, mpd etc with your mouse!
And some more!
See also:
My icon-pack and my conky bar.
Have fun!
McManiaC
Last edited by McManiaC (2009-03-18 15:39:26)
Offline