
I'm attempting to ease into using xmonad by using the gnome integration. I have a dual monitor setup and I want to turn greedy views off and have each screen have its own set of workspaces, so if I'm on the main monitor, it has its own workspace 1-9 and the same for the second screen. starting from various faqs, I came up with this: import XMonad import XMonad.Config.Gnome import XMonad.Layout.NoBorders import qualified XMonad.StackSet as W import XMonad.Util.EZConfig (additionalKeys) import XMonad.Layout.IndependentScreens main = do xmonad $ gnomeConfig { workspaces = withScreens 2 ["1", "2", "3", "4", "5", "6", "7", "8", "9"] , modMask = mod4Mask , terminal = "gnome-terminal" , layoutHook = smartBorders (layoutHook gnomeConfig) } `additionalKeys` myKeys myKeys = [ -- rebind meta-p to dmenu ((mod4Mask, xK_p), spawn "exe=`dmenu_path | dmenu` && eval \"exec $exe\"") ] ++ [ ((m .|. mod4Mask, k), windows $ onCurrentScreen f i) | (i, k) <- zip (workspaces' conf) [xK_1 .. xK_9] , (f, m) <- [(W.view, 0), (W.shift, shiftMask)] ] but conf on this line isn't in scope: | (i, k) <- zip (workspaces' conf) [xK_1 .. xK_9] gnomeConfig is in scope but that doesn't seem to make a difference and it kills the rebind for dmenu. pointers greatly appreciated.

On Wed, Jan 19, 2011 at 09:41:49AM -0500, Sean Allen wrote:
I'm attempting to ease into using xmonad by using the gnome integration.
I have a dual monitor setup and I want to turn greedy views off and have each screen have its own set of workspaces, so if I'm on the main monitor, it has its own workspace 1-9 and the same for the second screen.
starting from various faqs, I came up with this:
import XMonad import XMonad.Config.Gnome import XMonad.Layout.NoBorders import qualified XMonad.StackSet as W import XMonad.Util.EZConfig (additionalKeys) import XMonad.Layout.IndependentScreens main = do xmonad $ gnomeConfig { workspaces = withScreens 2 ["1", "2", "3", "4", "5", "6", "7", "8", "9"] , modMask = mod4Mask , terminal = "gnome-terminal" , layoutHook = smartBorders (layoutHook gnomeConfig) } `additionalKeys` myKeys
myKeys = [ -- rebind meta-p to dmenu ((mod4Mask, xK_p), spawn "exe=`dmenu_path | dmenu` && eval \"exec $exe\"") ] ++ [ ((m .|. mod4Mask, k), windows $ onCurrentScreen f i) | (i, k) <- zip (workspaces' conf) [xK_1 .. xK_9] , (f, m) <- [(W.view, 0), (W.shift, shiftMask)] ]
but conf on this line isn't in scope:
| (i, k) <- zip (workspaces' conf) [xK_1 .. xK_9]
gnomeConfig is in scope but that doesn't seem to make a difference and it kills the rebind for dmenu. pointers greatly appreciated.
The intention there is to get the list of workspaces from your configuration, but it's probably easier just to define your list of workspaces separately and use it in two places, like so: myWorkspaces = map show [1..9] main = xmonad $ gnomeConfig { workspaces = withScreens 2 myWorkspaces ... | (i,k) <- zip myWorkspaces [xK_1 .. xK_9] -Brent

Excerpts from Sean Allen's message of Wed Jan 19 15:41:49 +0100 2011:
myKeys = [ -- rebind meta-p to dmenu ((mod4Mask, xK_p), spawn "exe=`dmenu_path | dmenu` && eval \"exec $exe\"") ] ++ [ ((m .|. mod4Mask, k), windows $ onCurrentScreen f i) | (i, k) <- zip (workspaces' conf) [xK_1 .. xK_9] , (f, m) <- [(W.view, 0), (W.shift, shiftMask)] ]
but conf on this line isn't in scope:
| (i, k) <- zip (workspaces' conf) [xK_1 .. xK_9]
myKeys is given the config as an argument, which the author of the code that causes the error assumed to be named conf. So you'd have to write: myKeys conf = .. Regards, Daniel

For the edification of others who come later, I got this working w/ a little off list help from a list member... plus addressed a couple other issues I was having and my beginner config now looks like: import XMonad import XMonad.Config.Gnome import XMonad.Layout.NoBorders import qualified XMonad.StackSet as W import XMonad.Util.EZConfig (additionalKeys) import XMonad.Layout.IndependentScreens import XMonad.Actions.UpdatePointer import XMonad.Hooks.DynamicLog conf = gnomeConfig { workspaces = myWorkspaces , modMask = mod4Mask , terminal = "gnome-terminal" , layoutHook = smartBorders (layoutHook gnomeConfig) , logHook = dynamicLog >> updatePointer (Relative 0.5 0.5) } `additionalKeys` myKeys myWorkspaces = withScreens 2 ["1", "2", "3", "4", "5", "6", "7", "8", "9"] myKeys = [ -- workspaces are distinct by screen ((m .|. mod4Mask, k), windows $ onCurrentScreen f i) | (i, k) <- zip (workspaces' conf) [xK_1 .. xK_9] , (f, m) <- [(W.view, 0), (W.shift, shiftMask)] ] ++ [ -- swap screen order ((m .|. mod4Mask, key), screenWorkspace sc >>= flip whenJust (windows . f)) | (key, sc) <- zip [xK_w, xK_e, xK_r] [1,0,2] , (f, m) <- [(W.view, 0), (W.shift, shiftMask)]] ++ [ -- rebind meta-p to dmenu ((mod4Mask, xK_p), spawn "exe=`dmenu_path | dmenu` && eval \"exec $exe\"") ] main = xmonad conf On Thu, Jan 20, 2011 at 12:44 PM, Daniel Schoepe < daniel.schoepe@googlemail.com> wrote:
Excerpts from Sean Allen's message of Wed Jan 19 15:41:49 +0100 2011:
myKeys = [ -- rebind meta-p to dmenu ((mod4Mask, xK_p), spawn "exe=`dmenu_path | dmenu` && eval \"exec $exe\"") ] ++ [ ((m .|. mod4Mask, k), windows $ onCurrentScreen f i) | (i, k) <- zip (workspaces' conf) [xK_1 .. xK_9] , (f, m) <- [(W.view, 0), (W.shift, shiftMask)] ]
but conf on this line isn't in scope:
| (i, k) <- zip (workspaces' conf) [xK_1 .. xK_9]
myKeys is given the config as an argument, which the author of the code that causes the error assumed to be named conf. So you'd have to write:
myKeys conf = ..
Regards, Daniel
_______________________________________________ xmonad mailing list xmonad@haskell.org http://www.haskell.org/mailman/listinfo/xmonad
participants (3)
-
Brent Yorgey
-
Daniel Schoepe
-
Sean Allen