You are not logged in.

#1 2010-04-22 14:14:52

rangalo
Member
Registered: 2008-06-25
Posts: 108
Website

xmonad with dual screen strange bug or feature !

Hi,

I am running xmonad with dual screen. The strange thing (bug or feature) I noticed that when I move a window to another screen and then try to change the workspace, the window moves along to the same workspace but lands on the other screen.

Is there any way to switch off this feature. I googled a bit and replaced the greedyView parameter with view but it didn't help.

regards,
Hardik

Offline

#2 2010-04-22 14:33:54

lifeafter2am
Member
From: 127.0.0.1
Registered: 2009-06-10
Posts: 1,332

Re: xmonad with dual screen strange bug or feature !

Whats your xmonad.hs look like?  I remember having a dev help me on IRC b/c the documentation was incomplete as to exactly how to turn off greedyView.  This was almost 8 months ago now though.


#binarii @ irc.binarii.net
Matrix Server: https://matrix.binarii.net
-------------
Allan -> ArchBang is not supported because it is stupid.

Offline

#3 2010-04-22 14:45:20

rangalo
Member
Registered: 2008-06-25
Posts: 108
Website

Re: xmonad with dual screen strange bug or feature !

Here is my  xmonad.hs

import XMonad
import System.Exit
import qualified XMonad.StackSet as W
import qualified Data.Map        as M
import XMonad.Util.Run
import XMonad.Hooks.DynamicLog
import XMonad.Hooks.ManageDocks
import XMonad.Layout.NoBorders
import XMonad.Hooks.SetWMName
import XMonad.Hooks.ManageHelpers (isFullscreen, doFullFloat, doCenterFloat)
import XMonad.Layout.Tabbed
import System.IO
 
 
-- -xos4-terminus-medium-r-*-*-14-*-*-*-*-*-*-*
myLauncher :: String
myLauncher = "`dmenu_path | dmenu -fn '-xos4-terminus-medium-r-*-*-14-*-*-*-*-*-*-*' -nb '#303030' -nf '#959595' -sf '#FFFFFF' -sb '#606060'`"
myKeys conf@(XConfig {XMonad.modMask = modMask}) = M.fromList $
    [ ((modMask .|. shiftMask, xK_Return), spawn $ XMonad.terminal conf)
    , ((modMask,               xK_p     ), spawn myLauncher)
    , ((modMask .|. shiftMask, xK_c     ), kill)
    , ((mod4Mask .|. controlMask, xK_Down     ), spawn "/home/hardik/bin/decrease-aumix-vol.sh")
    , ((0                       , 0x1008ff11  ), spawn "/home/hardik/bin/decrease-aumix-vol.sh")
    , ((mod4Mask .|. controlMask, xK_Up     ), spawn "/home/hardik/bin/increase-aumix-vol.sh")
    , ((0                       , 0x1008ff13  ), spawn "/home/hardik/bin/increase-aumix-vol.sh")
    , ((mod4Mask .|. controlMask, xK_m     ), spawn "/home/hardik/bin/toggle-aumix-mute.sh")
    , ((0                       , 0x1008ff12 ), spawn "/home/hardik/bin/toggle-aumix-mute.sh")
    , ((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_k     ), windows W.focusUp  )
    , ((modMask,               xK_m     ), windows W.focusMaster  )
    , ((modMask,               xK_Return), windows W.swapMaster)
    , ((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_comma ), sendMessage (IncMasterN 1))
    , ((modMask              , xK_period), sendMessage (IncMasterN (-1)))
    , ((modMask .|. shiftMask, xK_q     ), io (exitWith ExitSuccess))
--    , ((modMask              , xK_q     ), restart "xmonad" True)
    , ((modMask              , xK_q     ), spawn "killall conky dzen2 && xmonad --recompile && xmonad --restart")
    , ((modMask .|.shiftMask .|. controlMask  , xK_c ), spawn "emacs ~/.xmonad/xmonad.hs")
    , ((modMask .|. controlMask               , xK_l ), spawn "xscreensaver-command -lock")
    , ((modMask .|. controlMask               , xK_k ), spawn "python ~/pythonScripts/SwitchKbLayoutDesk/src/setNextKbLayout.py")
    , ((modMask              , xK_b     ), sendMessage ToggleStruts)
    ]
    ++
    [((m .|. controlMask, k), windows $ f i)
        | (i, k) <- zip (XMonad.workspaces conf) [xK_F1 .. xK_F4]
        , (f, m) <- [(W.view, 0), (W.shift, shiftMask)]]
--        , (f, m) <- [(W.greedyView, 0), (W.shift, shiftMask)]]
    ++
    --
    -- mod-{w,e,r}, Switch to physical/Xinerama screens 1, 2, or 3
    -- mod-shift-{w,e,r}, Move client to screen 1, 2, or 3
    --
    [((m .|. modMask, key), screenWorkspace sc >>= flip whenJust (windows . f))
        | (key, sc) <- zip [xK_w, xK_e] [0..]
        , (f, m) <- [(W.view, 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))
    ]
 
 
myLayouts = tiled ||| Mirror tiled ||| noBorders Full ||| simpleTabbedBottom
  where
    tiled = Tall 1 (2/100) (1/2)
 
myManageHook = composeAll
    [ className =? "MPlayer"        --> doFloat
    , className =? "Gimp"           --> doFloat
    , className =? "Gimp"           --> doFloat
    , className =? "IDEA"           --> doFloat
    , resource  =? "desktop_window" --> doIgnore
    , isFullscreen                  --> doFullFloat ]

myStartupHook :: X ()
myStartupHook = do 
                setWMName "LG3D"
                spawn "xset -b"
                spawn "xrdb -load ~/.Xdafaults"
                spawn "xscreensaver -no-splash"
                spawn "numlockx on"
                spawn "eval `cat $HOME/.fehbg`"
                spawn "conky -c ~/.conkyrc_dzen | dzen2 -ta r -x 600 -bg '#303030' -fn '-*-lucida-*-*-normal-*-12-*-*-*-*-*-*-*' &"
                spawn "conky &"
--                spawn "conky -c ~/.conkyrc_time &"
 
 
shortened :: Int -> String -> String
shortened n xs | length xs < n = xs
               | otherwise = (take ( n - length end) xs) ++ end
    where
        end = "..."


main = do 

h <- spawnPipe "dzen2 -w 600 -ta l -fn ' -*-lucida-*-*-normal-*-12-*-*-*-*-*-*-*' -bg '#303030' -fg '#FFFFFF'"


xmonad $ defaultConfig {
        terminal           = "urxvt",
        focusFollowsMouse  = True,
        borderWidth        = 1,
        modMask            = mod1Mask,
        workspaces         = [" console "," dev "," misc "," browser "],
        normalBorderColor  = "#303030",
        focusedBorderColor = "#55BBFF",
        keys               = myKeys,
        mouseBindings      = myMouseBindings,
        layoutHook         = avoidStruts $ smartBorders myLayouts,
        manageHook         = myManageHook <+> manageDocks,
        startupHook        = myStartupHook,
        logHook            = dynamicLogWithPP $ defaultPP {
                         ppCurrent = wrap "^fg(#FFFFFF)^bg(#606060)" "^fg()^bg()"
                        ,ppVisible = wrap "^fg(#FFFFFF)^bg()" "^fg()^bg()"
                        ,ppHidden = wrap "^fg(#55BBFF)^bg()" "^fg()^bg()"
                        ,ppHiddenNoWindows = wrap "^fg(#808080)^bg()" "^fg()^bg()"
                        ,ppUrgent = wrap "^fg(#FF0000)^bg()" "^fg()^bg()"
                        ,ppTitle  = \x -> if null x 
                                             then ""
                                             else  "< ^fg(#FFFFFF)^bg()" ++ shortened 23 x ++ "^fg()^bg() >"
                        ,ppLayout = \x -> "^fg(#FFBB00)^bg()"
                                              ++ case x of
                                                       "Tall" -> "Tiled"
                                                       "Full" -> "Full"
                                                       "Mirror Tall" -> "Tiled Bottom"
                                                       "Tabbed Bottom Simplest" -> "Tabbed"
                                                       _                        -> x
                                                       ++ "^fg()^bg()"
                        ,ppSep = " "
                        ,ppWsSep = ""
                        ,ppOutput = hPutStrLn h
                        }
    }

Last edited by rangalo (2010-04-22 14:52:13)

Offline

#4 2010-04-22 15:01:05

lifeafter2am
Member
From: 127.0.0.1
Registered: 2009-06-10
Posts: 1,332

Re: xmonad with dual screen strange bug or feature !

Besides a different struture, the only thing I can see that is different is how you are calling your window names.  You define them as workspaces, but then call them in that hook as (XMonad.workspaces conf).  Here's my snippit as an example:

myWorkspaces =  ["term","irc","www","media","5","6","7","8","9"]

......................

[((m .|. mod4Mask, k), windows $ f i)
        | (i, k) <- zip (myWorkspaces) [xK_1 .. xK_9]
        , (f, m) <- [(W.view, 0), (W.shift, shiftMask)]])

#binarii @ irc.binarii.net
Matrix Server: https://matrix.binarii.net
-------------
Allan -> ArchBang is not supported because it is stupid.

Offline

#5 2010-04-22 15:19:02

rangalo
Member
Registered: 2008-06-25
Posts: 108
Website

Re: xmonad with dual screen strange bug or feature !

I changed it, but no success. Still the same greedyView behavior.

Offline

Board footer

Powered by FluxBB