Getting trayer to work with dual screen setup

I'm using XMonad as my window manager, and want to use trayer as a icon panel for things like nm-applet.

The problem was that the panel wouldn't appear on the top of the screen. If I set it to the bottom it just appeared.

After a lot of trying, I found out it is because my xorg.conf is setup for dualscreens, and probably the trayer panel is spawned outside my view (I currently have only a single screen, but I switch a lot).

After manualy tweaking the xorg.conf file to allow for just one screen, the panel appears on the right spot.

These are the things I had to modify:

Section "Monitor" Identifier "0-LVDS" Option "VendorName" "ATI Proprietary Driver" Option "ModelName" "Generic Autodetecting Monitor" Option "DPMS" "true" Option "PreferredMode" "1366x768" Option "TargetRefresh" "60" Option "Position" "0 0" # Was 1280 256 Option "Rotate" "normal" Option "Disable" "false"
EndSection
SubSection "Display" Viewport 0 0 Virtual 1366 768 # Was 2646 2646 Depth 24
EndSubSection

The problem is ofcourse that I can't use my dual screen setup anymore. Is there a way to force trayer on the right position even with the dualscreen setup?

3 Answers

Yes, I think you are right when you say "the trayer panel is spawned outside my view". I just posted this answer in another forum ()

I think the problem is the interaction between where you place trayer and the virtual screen size and layout. I had a similar problem where the trayer (bottom right) disappeared with my dual screen set up. In my case, I got into trouble doing this:

xrandr --output LVDS1 --auto --primary --rotate normal --pos 0x0 --output VGA1 --rotate normal --left-of LVSD1
trayer --edge bottom --align right --SetDockType true --SetPartialStrut true --expand true --widthtype request --transparent true --tint 0x191970 --height 12 --distance 20 --distancefrom right

(LVSD1 is my laptop)

The problem is that the left monitor is 1280x1024 whereas the laptop is 1600x900. That means that the trayer (--edge bottom) is located below the lower part of the laptop's screen. An easy fix is to align the bottom of the two screens, for instance doing (with my setup)

xrandr --output LVDS1 --auto --primary --rotate normal --pos 1280x124 --output VGA1 --rotate normal --auto --pos 0x0

Maybe in your case its just a matter of specifying the position of your primary monitor AND the trayer edge option so that they play nicely with each other.

P.S.1. I think in most recent distros with recent xorg, you do not really need to specify an xorg.conf file.

1

Another approach you can take is to use a fork of trayer that has multi-monitor support:

1

I'm using stalonetray right now. This application allows you to absolutely place the traybar, which solves the problem.

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like