Setting Primary Monitor with F14 - dual monitors

Duncan 1i5t5.duncan at cox.net
Fri May 20 23:48:48 BST 2011


CS DBA posted on Fri, 20 May 2011 13:18:54 -0600 as excerpted:

> I asked this in the Fedora list with no response yet, I'm wondering if
> maybe it's a KDE thing... anyone have any thoughts per the following?
> 
> I just installed Fedora 14 and generally everything works great. One
> nuisance I'd like to fix is per the primary monitor.
> If I boot up with dual monitors then Fedora places my task manager /
> menu bar, etc on the external monitor. I can use xrandr like this to fix
> it:
> 
>   xrandr --output LVDS1 --primary
> 
> 
> However, I'd like the system to use my laptop screen as the default
> monitor always. Is this possible?

Yes.  You already understand RandR's primary monitor concept and know that 
it solves your problem, so you're well on your way there. =8^)

There's at least four different ways that I know of to do the same thing, 
altho kde may have problems remembering it currently, as it only has one 
"default" setting ATM.  A planned future feature very helpful for laptop 
users will be "layout profiles" such that it'll be possible for kde to 
detect and automatically switch to separate profiles, each with its own 
defaults, for say work (one external monitor plugged), home/computing (a 
different external plugged), home/entertainment (a big-screen TV plugged 
for videos or gaming), and commute (video/game/web-surfing on the train 
ride home, internal-only).  But unfortunately at this time, kde only 
remembers one default.  However, that should be enough for at least the 
two X-related methods.  I'm not sure if the two kde methods can adjust 
that way, since you consistently want the internal as primary, or not, yet.

1) Using kde's kcontrol (umm... systemsettings that aren't actually 
systemsettings, but rather mostly user-specific kde settings, so I still 
use the more accurate kde3 name, kcontrol), hardware, display and monitor, 
size and orientation.  Near the bottom of the middle column,, there's a 
drop-down selector for primary output.  If you select the internal display 
and save as default, it /may/ be able to remember that across external 
display plug/unplug as long as you don't try to set the external display 
as primary for some other case.  Or it may not, but you can at least hit 
apply there and get it for a single session.

2) Using kde's systray applet, krandrtray, for the same thing.  You can 
run krandrtray from krunner or it's on the apps menu under system.  You 
can then set kde's session control to run it as part of the session every 
time kde starts (kcontrol, system administration, startup and shutdown, 
session management), or specifically set it to startup with kde (same 
kcontrol group, system administration, startup and shutdown, but under 
autostart).

If you left click the tray icon, you get the same display settings dialog 
as in kcontrol (with a couple other tabs found in kcontrol as separate 
modules, as well).

If you right click the tray icon, you get a menu allowing you to change 
settings on the fly.  Again, selecting the proper primary here may or may 
not be retained, until they get the planned display profile support, but 
it can be done for a single session at least.

3) Using xrandr and the above autostart functionality.  This is perhaps 
the simplest mechanism, since you already know the xrandr command to use 
AND know that it works. =:^)

Create a script with that command in it, name the file xrandr-primary.sh 
or similar (the .sh bit is important) and set the permissions executable.  

Traditionally, users put such things in ~/bin, or for system-wide access, 
you'd set the owner and permissions appropriately and drop it in 
/usr/local/bin or the like.  In that case, in kcontrol, system 
administration, startup and shutdown, autostart, you'd add a script and 
ensure the create as symlink box is checked.

But since we're mostly concerned with kde running it at kde start, you 
could drop the script itself into the appropriate directory, instead.  
(The directory location is configurable.  Look in kcontrol, common 
appearance and behavior, account details, paths, and check the autostart 
path, to see what it's configured for, for your case.)  If you use the GUI 
and create a symlink, this is where the symlink will be, but you can 
either create the symlink manually or drop the script itself into this 
location too.  It doesn't matter.  Just be sure the script name ends 
in .sh and that it's set executable.

That should do what you want, since it'd run at each kde start, and as I 
said, since you already know the command you want to run and that it does 
what you want, this is probably the simplest method.

4) You can configure X itself to always use your internal monitor as 
primary, by setting...

Option "Primary" "On"

...in the appropriate Section "Monitor" in xorg.conf or a file in 
xorg.conf.d (the latter is recommended for newer systems, xorg.conf itself 
is backward compatibility legacy, these days).  (A similar "Off" setting 
can be used for the other monitor sections, if desired or to force the 
point.)

Old-time Linux users who are used to editing xorg.conf(.d) will probably 
prefer this method, but many newer users may not have even touched xorg's 
config since it normally "just works" these days, and they'd likely prefer 
option three or better yet, a GUI method like the kde methods, if they 
work.  Thus, I'm not going to explain this one in detail, just point you 
at the xorg.conf (5) manpage for more info if you're interested, since 
you'll likely already be familiar with xorg.conf(.d) and not need the 
detailed instructions if this option appeals to you.

-- 
Duncan - List replies preferred.   No HTML msgs.
"Every nonfree program has a lord, a master --
and if you use the program, he is your master."  Richard Stallman

___________________________________________________
This message is from the kde mailing list.
Account management:  https://mail.kde.org/mailman/listinfo/kde.
Archives: http://lists.kde.org/.
More info: http://www.kde.org/faq.html.




More information about the kde mailing list