FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Debian > Debian User

 
 
LinkBack Thread Tools
 
Old 08-15-2011, 11:03 AM
Ralf Jung
 
Default Running a script on monitor connect/disconnect

Hi,

I am having trouble getting my multi-monitor setup running properly using the
proprietary AMD drivers in Debian testing using XRandR. My hardware is an HP
Compaw 615 Laptop, with a Radeon HD 3200 graphics card. I am using KDE 4.6.5.
I want the external screen, if it is connected, to be to the right of my
internal laptop screen, both using their native resolution. I quickly found
out that no GUI will be of any help here...

I ended up editing the xorg.conf to force the resolution of my internal
monitor to the native one, to prevent X.org from automatically choosing a
lower resolution that's also supported by the external screen (since it
defaults to cloning). I also had to increase the size of the virtual desktop.
Finally, to get the screen setup I want, I added some commands to
/etc/kde4/kdm/Xsetup to detect whether a monitor is connected and do the
actual setup using xrandr. You can find both configuration files attached.

However, when I plug in the screen after logging in, (of course) I manually
have to execute xrandr again to enable the external monitor. Is there a way to
call a shell script on monitor connect/disconnect events where I can then set
up everything the way I want to?

Also, I wonder if there is no better way to specify a default setup that's not
"clone same image on all screens". I tried to add the external monitor to the
xorg.conf (fearing trouble for the case where it is not connected), and added
the "RightOf" option, but both monitors would still use the same (non-native)
resolution. And I absolutely do not want to hard-code the resolution of the
external monitor since there are several monitors I connect to, with different
resolutions.

Kind regards,
Ralf
Section "Device"
Identifier "Radeon HD 3200 Graphics"
Driver "fglrx"
Option "Monitor-LVDS" "LVDS"
EndSection

Section "Monitor"
Identifier "LVDS"
Option "PreferredMode" "1366x768"
Option "Primary" "true"
EndSection

Section "Screen"
Identifier "The One And Only Screen"
Monitor "LVDS"
Device "Radeon HD 3200 Graphics"
SubSection "Display"
# Necessary to make dual-view work
Virtual 3000 3000
EndSubSection
EndSection
 
Old 08-15-2011, 11:50 AM
Camaleón
 
Default Running a script on monitor connect/disconnect

On Mon, 15 Aug 2011 13:03:07 +0200, Ralf Jung wrote:

> I am having trouble getting my multi-monitor setup running properly
> using the proprietary AMD drivers in Debian testing using XRandR. My
> hardware is an HP Compaw 615 Laptop, with a Radeon HD 3200 graphics
> card. I am using KDE 4.6.5. I want the external screen, if it is
> connected, to be to the right of my internal laptop screen, both using
> their native resolution. I quickly found out that no GUI will be of any
> help here...

(...)

Just a quick note here. Not sure if you have tried with "krandrtray" or
better yet, as you are using the ATI closed drivers, you may test their
catalyst control center utility to handle video screens (resolution/
position, etc...).

I bet with the open radeon drivers this would be very easy to achieve...

Greetings,

--
Camaleón


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: pan.2011.08.15.11.50.44@gmail.com">http://lists.debian.org/pan.2011.08.15.11.50.44@gmail.com
 
Old 08-15-2011, 07:11 PM
Ralf Jung
 
Default Running a script on monitor connect/disconnect

Hi,

> (...)
>
> Just a quick note here. Not sure if you have tried with "krandrtray" or
> better yet, as you are using the ATI closed drivers, you may test their
> catalyst control center utility to handle video screens (resolution/
> position, etc...).
>
> I bet with the open radeon drivers this would be very easy to achieve...
I used krandr as well, but it has a bunch of bugs in 4.6 that got fixed for
4.7, so I went one level down and used xrandr directly. Even if krandr worked,
I would not know how to set up a default configuration that's automatically
applied on boot, or should it do that automatically?
I used to get a message from KDE saying a new screen was attached and whether
I wanted to open the KCM module, but since the KCM module for display
management has even more bugs than krandr, I disabled it and now I do not know
how to get it back. Maybe doing so and upgrading to KDE 4.7 will indeed solve
my issues (if the Plasma bugs I ran into got fixed as well).

On my old installation I used the AMD catalyst, it's horrible - changing the
multi-monitor setup requires a reboot, and it meddles with the Xorg.conf in
bad ways. Not to mention a strange screen overlap issue (one column of pixels
from the left screen appearing on the right one). Really, what I got running
now is already much better than anything I was able to do with that tool

Kind regards,
Ralf


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: 201108152111.28913.ralfjung-e@gmx.de">http://lists.debian.org/201108152111.28913.ralfjung-e@gmx.de
 
Old 08-16-2011, 12:05 PM
Camaleón
 
Default Running a script on monitor connect/disconnect

On Mon, 15 Aug 2011 21:11:28 +0200, Ralf Jung wrote:

>> Just a quick note here. Not sure if you have tried with "krandrtray" or
>> better yet, as you are using the ATI closed drivers, you may test their
>> catalyst control center utility to handle video screens (resolution/
>> position, etc...).
>>
>> I bet with the open radeon drivers this would be very easy to
>> achieve...

> I used krandr as well, but it has a bunch of bugs in 4.6 that got fixed
> for 4.7, so I went one level down and used xrandr directly. Even if
> krandr worked, I would not know how to set up a default configuration
> that's automatically applied on boot, or should it do that
> automatically?

Settings applied from the xrandr applet can be stored in a file at your
home user's profile so they are kept after booting and set as soon as you
login (at least this is how it works in GNOME).

Time ago I read a very good doc that talked about this:

https://wiki.ubuntu.com/X/Config/Resolution#Setting_xrandr_changes_persistently

(hope not yet obsoleted...)

> I used to get a message from KDE saying a new screen was
> attached and whether I wanted to open the KCM module, but since the KCM
> module for display management has even more bugs than krandr, I disabled
> it and now I do not know how to get it back. Maybe doing so and
> upgrading to KDE 4.7 will indeed solve my issues (if the Plasma bugs I
> ran into got fixed as well).

I can't tell for KDE, I don't use it. Maybe someone that uses KDE as well
as kxrandrtray can expand that information or helping you with this :-?

> On my old installation I used the AMD catalyst, it's horrible - changing
> the multi-monitor setup requires a reboot, and it meddles with the
> Xorg.conf in bad ways. Not to mention a strange screen overlap issue
> (one column of pixels from the left screen appearing on the right one).
> Really, what I got running now is already much better than anything I
> was able to do with that tool

Oh, I didn't know. The nvidia counterpart tool is very nice, maybe I
overestimate the ATI one :-)

May I ask why not using the open source driver (radeon)? For non
intensive 3D tasks should be just fine, in fact nowadays I'd say is the
best shaped VGA open source driver available.

Greetings,

--
Camaleón


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: pan.2011.08.16.12.05.15@gmail.com">http://lists.debian.org/pan.2011.08.16.12.05.15@gmail.com
 
Old 08-17-2011, 08:20 PM
Ralf Jung
 
Default Running a script on monitor connect/disconnect

Hi,

> Settings applied from the xrandr applet can be stored in a file at your
> home user's profile so they are kept after booting and set as soon as you
> login (at least this is how it works in GNOME).
>
> Time ago I read a very good doc that talked about this:
>
> https://wiki.ubuntu.com/X/Config/Resolution#Setting_xrandr_changes_persiste
> ntly
>
> (hope not yet obsoleted...)

> I can't tell for KDE, I don't use it. Maybe someone that uses KDE as well
> as kxrandrtray can expand that information or helping you with this :-?
I will have a look at that doc, thanks.

> Oh, I didn't know. The nvidia counterpart tool is very nice, maybe I
> overestimate the ATI one :-)
OTOH, the ATI driver supports xrandr 1.2 perfectly (as far as I can tell), so
I can use the common open-source configuration tools ;-) . IMHO, that's better
than a well-working vendor-provided tool (from all I read, NVidia barely
supports xrandr).
My problem is solely on the "getting the xrandr tools and desktop to play
nice" side, I don't think the driver is an issue.

> May I ask why not using the open source driver (radeon)? For non
> intensive 3D tasks should be just fine, in fact nowadays I'd say is the
> best shaped VGA open source driver available.
I'd like to run some Windows (DX9) games in wine, which works fine with fglrx,
but last time I tried did not work at all using the open-source driver. Even
simple games like Neverball or Supertux did not work. So, no go here

Kind regards,
Ralf


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: 201108172220.22010.ralfjung-e@gmx.de">http://lists.debian.org/201108172220.22010.ralfjung-e@gmx.de
 
Old 08-19-2011, 07:46 PM
Camaleón
 
Default Running a script on monitor connect/disconnect

On Wed, 17 Aug 2011 22:20:21 +0200, Ralf Jung wrote:

(...)

>> Oh, I didn't know. The nvidia counterpart tool is very nice, maybe I
>> overestimate the ATI one :-)

> OTOH, the ATI driver supports xrandr 1.2 perfectly (as far as I can
> tell), so I can use the common open-source configuration tools ;-) .
> IMHO, that's better than a well-working vendor-provided tool (from all I
> read, NVidia barely supports xrandr).

(...)

And who needs xrandr if you can have the layout you want in a
straightforward way by directly editing the xorg.conf file or by using
nvidia-settings tool? (we are now in a loop ;-P)

>> May I ask why not using the open source driver (radeon)? For non
>> intensive 3D tasks should be just fine, in fact nowadays I'd say is the
>> best shaped VGA open source driver available.

> I'd like to run some Windows (DX9) games in wine, which works fine with
> fglrx, but last time I tried did not work at all using the open-source
> driver. Even simple games like Neverball or Supertux did not work. So,
> no go here

Uh? That's strange. Maybe you had a problem for getting the radeon 3D
acceleration features enabled... did you review this list of supported
games/cards on wine/native environment?

http://www.x.org/wiki/RadeonProgram

Greetings,

--
Camaleón


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: pan.2011.08.19.19.46.14@gmail.com">http://lists.debian.org/pan.2011.08.19.19.46.14@gmail.com
 
Old 08-23-2011, 10:57 AM
Ralf Jung
 
Default Running a script on monitor connect/disconnect

Hi,


> And who needs xrandr if you can have the layout you want in a
> straightforward way by directly editing the xorg.conf file or by using
> nvidia-settings tool? (we are now in a loop ;-P)
Editing xorg.conf requires an X-server restart after each setup change, which
is ridiculous. In the end, I do not care which means a tool uses to set up the
screens, whether it's xrandr or that nvidia-specific way. I just want it to
work, without the need to restart anything. And for everything except for
NVidia cards, xrandr is the way to go ;-)

> Uh? That's strange. Maybe you had a problem for getting the radeon 3D
> acceleration features enabled... did you review this list of supported
> games/cards on wine/native environment?
I just tried again. Neverball is now working fine, however from the three
Windows games I tried, only one started, the others showed no useful content
on screen. So, I have to stick with the closed-source driver for now

The driver is not the issue though, xrandr works the way it is supposed to, as
far as I can tell. I just want to take some action when a monitor is
connected, which xrandr does detect, it just does not tell me. That's all

Kind regards,
Ralf


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: 201108231257.06899.ralfjung-e@gmx.de">http://lists.debian.org/201108231257.06899.ralfjung-e@gmx.de
 
Old 08-30-2011, 10:28 AM
Camaleón
 
Default Running a script on monitor connect/disconnect

On Tue, 23 Aug 2011 12:57:06 +0200, Ralf Jung wrote:

>> And who needs xrandr if you can have the layout you want in a
>> straightforward way by directly editing the xorg.conf file or by using
>> nvidia-settings tool? (we are now in a loop ;-P)

> Editing xorg.conf requires an X-server restart after each setup change,
> which is ridiculous.

Why ridiculous? :-?

Xorg is running and you need it to re-read the configuration file again
like any other service :-)

> In the end, I do not care which means a tool uses to set up the
> screens, whether it's xrandr or that nvidia-specific way.
> I just want it to work, without the need to restart anything. And for
> everything except for NVidia cards, xrandr is the way to go ;-)

Xrandr also works with nvidia, but anyway, better that one or another
tool is having different options to get the job done.

>> Uh? That's strange. Maybe you had a problem for getting the radeon 3D
>> acceleration features enabled... did you review this list of supported
>> games/cards on wine/native environment?

> I just tried again. Neverball is now working fine, however from the
> three Windows games I tried, only one started, the others showed no
> useful content on screen. So, I have to stick with the closed-source
> driver for now

Maybe you can find the origin of the problem by reading the xorg log.

> The driver is not the issue though, xrandr works the way it is supposed
> to, as far as I can tell. I just want to take some action when a monitor
> is connected, which xrandr does detect, it just does not tell me. That's
> all

I already gave you some hints... krandtray is one option (GUI based) and
you can always make your own script to run a set of xrandr commands with
just one-click.

Greetings,

--
Camaleón


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: pan.2011.08.30.10.28.30@gmail.com">http://lists.debian.org/pan.2011.08.30.10.28.30@gmail.com
 
Old 08-31-2011, 09:08 AM
Ralf Jung
 
Default Running a script on monitor connect/disconnect

Hi,

> > Editing xorg.conf requires an X-server restart after each setup change,
> > which is ridiculous.
>
> Why ridiculous? :-?
>
> Xorg is running and you need it to re-read the configuration file again
> like any other service :-)
Sorry, I should have boon more clear: It is of course not ridiculous that re-
reading the config file takes an X server restart. It is however ridiculous that
changing the monitor setup requires an X server restart, so the config file is
the wrong place for that.


> > The driver is not the issue though, xrandr works the way it is supposed
> > to, as far as I can tell. I just want to take some action when a monitor
> > is connected, which xrandr does detect, it just does not tell me. That's
> > all
>
> I already gave you some hints... krandtray is one option (GUI based) and
> you can always make your own script to run a set of xrandr commands with
> just one-click.
Sure, and I did exactly that (the script) and it is working. It's just that I
have to call it manually after plugging in the external monitor, it'd be
better/nicer/cooler if that happened automatically.
krandrtray is broken in various ways since testing is still on KDE 4.6, see
http://www.afiestas.org/display-configuration-in-kde-workspace-4-7-1/

Kind regards,
Ralf


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: 201108311108.03634.ralfjung-e@gmx.de">http://lists.debian.org/201108311108.03634.ralfjung-e@gmx.de
 
Old 08-31-2011, 12:14 PM
Camaleón
 
Default Running a script on monitor connect/disconnect

On Wed, 31 Aug 2011 11:08:03 +0200, Ralf Jung wrote:

> Hi,
>
>> > Editing xorg.conf requires an X-server restart after each setup
>> > change, which is ridiculous.
>>
>> Why ridiculous? :-?
>>
>> Xorg is running and you need it to re-read the configuration file again
>> like any other service :-)

> Sorry, I should have boon more clear: It is of course not ridiculous
> that re- reading the config file takes an X server restart. It is
> however ridiculous that changing the monitor setup requires an X server
> restart, so the config file is the wrong place for that.

Ah, okay, I know what you meant. Yes, and that's why Xorg has turned more
plug&play (but you know... plu&play does not always work as it should,
and not only for Xorg :-P).

>> > The driver is not the issue though, xrandr works the way it is
>> > supposed to, as far as I can tell. I just want to take some action
>> > when a monitor is connected, which xrandr does detect, it just does
>> > not tell me. That's all
>>
>> I already gave you some hints... krandtray is one option (GUI based)
>> and you can always make your own script to run a set of xrandr commands
>> with just one-click.

> Sure, and I did exactly that (the script) and it is working. It's just
> that I have to call it manually after plugging in the external monitor,
> it'd be better/nicer/cooler if that happened automatically.

I agree, there could be "profiles" (which holds the settings for added
monitors, like resolution and screen position) that have been previosuly
saved by the user and as soon as you connect an additional display, the
DE should ask you to apply for such profiles and apply them accordingly.

> krandrtray is broken in various ways since testing is still on KDE 4.6,
> see http://www.afiestas.org/display-configuration-in-kde-workspace-4-7-1/

Hmmm, that's a pity (but a matter of time it gets working again ;-(

Greetings,

--
Camaleón


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: pan.2011.08.31.12.14.53@gmail.com">http://lists.debian.org/pan.2011.08.31.12.14.53@gmail.com
 

Thread Tools




All times are GMT. The time now is 02:39 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright ©2007 - 2008, www.linux-archive.org