You are not logged in.

#1 2010-02-24 12:36:53

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

xmonad doesn't respect dual screen

I have a dual screen setup.

When I run xmonad it maximizes the windows across the screens and not on each monitor.

Do I have to change something in the config file ?

regards,

Offline

#2 2010-02-24 14:16:03

Cyrusm
Member
From: Bozeman, MT
Registered: 2007-11-15
Posts: 1,053

Re: xmonad doesn't respect dual screen

that's a really interesting problem! Xmonad should work correctly out of the box for dual monitors....

could you post your xmonad.hs and xorg.conf? (remember to use code tags!)  and we'll see what we can do for you smile


Hofstadter's Law:
           It always takes longer than you expect, even when you take into account Hofstadter's Law.

Offline

#3 2010-02-25 09:53:27

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

Re: xmonad doesn't respect dual screen

Hi here is the xmonad.sh

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.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)
    , ((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 .|.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 .|. modMask, k), windows $ f i)
        | (i, k) <- zip (XMonad.workspaces conf) [xK_1 .. xK_6]
        , (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))
    ]
 
 
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
    , resource  =? "desktop_window" --> doIgnore ]

myStartupHook :: X ()
myStartupHook = do 
                spawn "xset -b"
                spawn "xrdb -load ~/.Xdafaults"
                spawn "xmodmap ~/.Xmodmap"
                spawn "xscreensaver -no-splash"
 
 
main = do 
h <- spawnPipe "dzen2  -w 1024 -ta l -fn ' -*-lucida-*-*-normal-*-14-*-*-*-*-*-*-*' -bg '#303030' -fg '#FFFFFF'"
xmonad $ defaultConfig {
        terminal           = "xterm",
        focusFollowsMouse  = True,
        borderWidth        = 1,
        modMask            = mod1Mask,
        workspaces         = [" colnsole "," dev "," email "," browser "," SSH ", " extra "],
        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 = wrap " ^fg(#FFFFFF)^bg()" "^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
                        }
    }

here the xorg.conf


# xorg.conf (X.Org X Window System server configuration file)
#
# This file was generated by dexconf, the Debian X Configuration tool, using
# values from the debconf database.
#
# Edit this file with caution, and see the xorg.conf manual page.
# (Type "man xorg.conf" at the shell prompt.)
#
# This file is automatically updated on xserver-xorg package upgrades *only*
# if it has not been modified since the last upgrade of the xserver-xorg
# package.
#
# If you have edited this file but would like it to be automatically updated
# again, run the following command:
#   sudo dpkg-reconfigure -phigh xserver-xorg

Section "Screen"
    Identifier    "Default Screen"
    Monitor        "Configured Monitor"
    Device        "Configured Video Device"
    Defaultdepth    24
EndSection

Section "Device"
    Identifier    "Configured Video Device"
    Option        "UseFBDev"    "true"
    Option        "VideoOverlay"    "on"
    Option        "OpenGLOverlay"    "off"
    Driver        "fglrx"
EndSection

Section "InputDevice"
    Identifier    "Generic Keyboard"
    Driver        "kbd"
    Option        "XkbRules"    "xorg"
    Option        "XkbModel"    "pc105"
    #Option        "XkbLayout"    "us"
    #Option        "XkbVariant"    "us"
    #Option      "XkbOptions"    "compose:lwin" 
    #Option      "XkbOptions"    "compose:rwin" 
EndSection

Section "InputDevice"
    Identifier    "Configured Mouse"
    Driver        "mouse"
    Option        "CorePointer"
EndSection

Section "ServerLayout"
    Identifier    "Default Layout"
  screen "Default Screen"
EndSection

Section "Monitor"
    Identifier    "Configured Monitor"
EndSection

Section "Extensions"
    Option        "Composite"    "Enable"
EndSection

Offline

#4 2010-02-25 23:35:02

Cyrusm
Member
From: Bozeman, MT
Registered: 2007-11-15
Posts: 1,053

Re: xmonad doesn't respect dual screen

I'm not sure if this will help. but try putting this

    ++
    --
    -- 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 .|. modm, key), screenWorkspace sc >>= flip whenJust (windows . f))
        | (key, sc) <- zip [xK_w, xK_e, xK_r] [0..]
        , (f, m) <- [(W.view, 0), (W.shift, shiftMask)]]

into your myKeys section and see if that changes anything.  otherwise I'm stumped.


Hofstadter's Law:
           It always takes longer than you expect, even when you take into account Hofstadter's Law.

Offline

#5 2010-02-26 17:19:34

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

Re: xmonad doesn't respect dual screen

The suggestion didn't work

Offline

#6 2010-02-26 17:54:53

jrs
Member
Registered: 2009-12-03
Posts: 23

Re: xmonad doesn't respect dual screen

I think this will be related to the fglrx driver, xrandr neither works with fglrx, with radeon xmonad should detect the monitors perfectly.

Offline

#7 2010-02-26 19:49:59

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

Re: xmonad doesn't respect dual screen

hi,

with raedon, I don't have dual monitor support. The driver is installed by envy-ng program on kubuntu...

Offline

#8 2010-02-26 21:04:53

jrs
Member
Registered: 2009-12-03
Posts: 23

Re: xmonad doesn't respect dual screen

Hm thats weird.. to eliminate the driver thing, you could check if xrandr detects the right resolutions..
I don't have any experience with fglrx and xmonad, but as long as the monitors are correctly detected, xmonad should handle it smile
Just to be sure, did you uninstall fglrx before testing it with the open source driver? The radeon driver doesn't work correctly if fglrx is still installed

Offline

#9 2010-03-19 14:38:05

cra
Member
From: Sweden
Registered: 2009-09-25
Posts: 70

Re: xmonad doesn't respect dual screen

have you tried mess with xrandr?
Sometimes
xrandr --output VGA --left-of --output LVDS
work for me


Thou shalt not make a machine in the likeness of a human mind

Offline

#10 2010-05-24 02:48:58

princeamd
Member
From: Guyana
Registered: 2009-06-08
Posts: 57

Re: xmonad doesn't respect dual screen

xrandr does work with fglrx
here is my xorg for hd 5770 this also worked on my hd3xxx onboard card with dvi+vga
EDIT: i used amdcccle to generate this file, just run xrandr get both screens up n then run amdcccle

Section "ServerLayout"
    Identifier     "amdcccle Layout"
    Screen      0  "amdcccle-Screen[1]-0" 0 0
EndSection

Section "Files"
EndSection

Section "Module"
EndSection

Section "Monitor"
    Identifier   "0-DFP3"
    Option        "VendorName" "ATI Proprietary Driver"
    Option        "ModelName" "Generic Autodetecting Monitor"
    Option        "DPMS" "true"
    Option        "PreferredMode" "1680x1050"
    Option        "TargetRefresh" "60"
    Option        "Position" "0 0"
    Option        "Rotate" "normal"
    Option        "Disable" "false"
EndSection

Section "Monitor"
    Identifier   "0-DFP4"
    Option        "VendorName" "ATI Proprietary Driver"
    Option        "ModelName" "Generic Autodetecting Monitor"
    Option        "DPMS" "true"
    Option        "PreferredMode" "1680x1050"
    Option        "TargetRefresh" "60"
    Option        "Position" "1680 0"
    Option        "Rotate" "normal"
    Option        "Disable" "false"
EndSection

Section "Device"
    Identifier  "amdcccle-Device[1]-0"
    Driver      "fglrx"
    Option        "Monitor-DFP3" "0-DFP3"
    Option        "Monitor-DFP4" "0-DFP4"
    BusID       "PCI:1:0:0"
EndSection

Section "Screen"
    Identifier "amdcccle-Screen[1]-0"
    Device     "amdcccle-Device[1]-0"
    DefaultDepth     24
    SubSection "Display"
        Viewport   0 0
        Virtual   3360 3360
        Depth     24
    EndSubSection
EndSection

Last edited by princeamd (2010-05-24 02:50:06)

Offline

Board footer

Powered by FluxBB