
Two questions for those who've been using this nice WM longer than I have ... 1. I have two monitors, one that's nice and big, and one that's attached to my laptop. How do I swap the workspaces on them? That is, if they currently show workspaces A and B, what action should I bind to a key to make them show B and A? I imagine this is just a matter of transforming StackSet the right way, but I haven't been able to figure out exactly how. 2. Currently, I've bound mod-Right/Left and ctrl-mod-Right/Left to switching to the next Xinerama screen and the next visible window in that direction: import qualified XMonad.Actions.CycleWS as CWS import qualified XMonad.Layout.WindowNavigation as WN , ((modMask x, xK_Right), CWS.nextScreen) , ((modMask x, xK_Left), CWS.prevScreen) , ((modMask x .|. controlMask, xK_Right), sendMessage $ WN.Go WN.R) , ((modMask x .|. controlMask, xK_Left ), sendMessage $ WN.Go WN.L) However, what I'd like to do is have just one binding for these two tasks, so that mod-Right would switch focus to the next window to the right until it reached the edge of the screen, and then the next press would switch focus to the leftmost window on the Xinerama screen to the right of the one where I just was. -- Karl Hasselström, kha@treskal.com www.treskal.com/kalle

On Mon, Jan 26, 2009 at 11:36:05AM +0100, Karl Hasselström wrote:
Two questions for those who've been using this nice WM longer than I have ...
1. I have two monitors, one that's nice and big, and one that's attached to my laptop. How do I swap the workspaces on them? That is, if they currently show workspaces A and B, what action should I bind to a key to make them show B and A?
I imagine this is just a matter of transforming StackSet the right way, but I haven't been able to figure out exactly how.
Try the "swapNextScreen" function from CycleWS.
2. Currently, I've bound mod-Right/Left and ctrl-mod-Right/Left to switching to the next Xinerama screen and the next visible window in that direction:
import qualified XMonad.Actions.CycleWS as CWS import qualified XMonad.Layout.WindowNavigation as WN
, ((modMask x, xK_Right), CWS.nextScreen) , ((modMask x, xK_Left), CWS.prevScreen) , ((modMask x .|. controlMask, xK_Right), sendMessage $ WN.Go WN.R) , ((modMask x .|. controlMask, xK_Left ), sendMessage $ WN.Go WN.L)
However, what I'd like to do is have just one binding for these two tasks, so that mod-Right would switch focus to the next window to the right until it reached the edge of the screen, and then the next press would switch focus to the leftmost window on the Xinerama screen to the right of the one where I just was.
Hmm, that's a tricky one. It should be possible in theory, but you would need to implement something pretty low-level to make it work, maybe even a brand new layout modifier based on the WindowNavigation one. This could make a nice project for someone. The problem is that there's no way (currently) for the WindowNavigation layout modifier to report what it did (whether it actually moved the focus to a different window or not), so no way to take another action conditioned on that result. -Brent

Karl Hasselström wrote:
2. Currently, I've bound mod-Right/Left and ctrl-mod-Right/Left to switching to the next Xinerama screen and the next visible window in that direction:
import qualified XMonad.Actions.CycleWS as CWS import qualified XMonad.Layout.WindowNavigation as WN
, ((modMask x, xK_Right), CWS.nextScreen) , ((modMask x, xK_Left), CWS.prevScreen) , ((modMask x .|. controlMask, xK_Right), sendMessage $ WN.Go WN.R) , ((modMask x .|. controlMask, xK_Left ), sendMessage $ WN.Go WN.L)
However, what I'd like to do is have just one binding for these two tasks, so that mod-Right would switch focus to the next window to the right until it reached the edge of the screen, and then the next press would switch focus to the leftmost window on the Xinerama screen to the right of the one where I just was.
Since last time, regarding your layout question, I read your request backward re /unfocused/focused/ I'm hesitant to reply. ;) Hopefully I have read correctly this time. The Actions.WindowNavigation module moves focus and swaps windows across screen borders directionally nicely as far as I've seen, although it's marked experimental. (I'm running darcs version, but afaik is in 0.8 too) regards -- wmw

On 2009-01-27 17:06:09 -0700, wirtwolff wrote:
Since last time, regarding your layout question, I read your request backward re /unfocused/focused/ I'm hesitant to reply. ;) Hopefully I have read correctly this time.
I won't bite if you don't get my question right, honest ...
The Actions.WindowNavigation module moves focus and swaps windows across screen borders directionally nicely as far as I've seen, although it's marked experimental. (I'm running darcs version, but afaik is in 0.8 too)
It works beautifully! I can move the focus left and right even across screen borders. Moving the focus up also works. Moving it down doesn't, though. I see the window border flashing, but nothing else happens. And shifting windows up and down took my Gnome panel down from the top of the screen and into the managed grid, which I didn't want at all. ;-) (I almost never use the up/down movements, though, so I'll keep this config since it's much better than what I used to have.) This is with xmonad 0.8 from the Ubuntu archives, and a config like this: main = do let c1 = CG.gnomeConfig { modMask = mod4Mask , layoutHook = layouts , manageHook = manageHook CG.gnomeConfig <+> myManageHook , keys = \x -> M.union (M.fromList (myKeys x)) (keys CG.gnomeConfig x) , focusFollowsMouse = False , borderWidth = 2 } c2 <- WN.withWindowNavigation (xK_Up, xK_Left, xK_Down, xK_Right) c1 xmonad c2 (The complete config is attached in case someone is interested.) -- Karl Hasselström, kha@treskal.com www.treskal.com/kalle
participants (3)
-
Brent Yorgey
-
Karl Hasselström
-
wirtwolff