switchdesk?
switchdesk?
Hi All,
Unlike most of my posts here, this should be a simple question to answer. When a user gives the command "switchdesk XXX" with XXX being kde, gnome or whatever, what file is modified to change the user's desktop to XXX?
I did check the man page on switchdesk, but it provided no clues as to the actual file modified. It seems like it should be a "." file somewhere in the user's home directory, but I'll be darned if I can find it.
Thanks (as always) in advance for any pointers.
Jim
Unlike most of my posts here, this should be a simple question to answer. When a user gives the command "switchdesk XXX" with XXX being kde, gnome or whatever, what file is modified to change the user's desktop to XXX?
I did check the man page on switchdesk, but it provided no clues as to the actual file modified. It seems like it should be a "." file somewhere in the user's home directory, but I'll be darned if I can find it.
Thanks (as always) in advance for any pointers.
Jim
This is my /~/.Xclients-default
This was listed (along with .Xclients) as the files modified in the manpage for switchdesk. Of course dotfiles are hidden by default, so you can't see it when ls-ing normally. Use "ls -a".
Code: Select all
#!/bin/bash
# (c) 2001 Red Hat, Inc.
WM="gnome-session"
WMPATH="/usr/bin /usr/X11R6/bin /usr/local/bin"
for p in $WMPATH ; do
[ -x $p/$WM ] && exec $p/$WM
done
exit 1
Hey Worker201,
Thanks for the prompt reply, but on my FC3 install, a ls-a .X* gives the following:
And a "man switchdesk" gives the following very useless info:
So I have a .Xauthority, but no .Xclients or .Xclients-default. So what is the file that "switchdesk XXX" changes in FC3 that selects my desktop?
It's not that anything isn't working properly, and I can change desktops with the "switchdeck" command, but I am curious about the actual file changed by the command.
Jim
Thanks for the prompt reply, but on my FC3 install, a ls-a .X* gives the following:
Code: Select all
[dishawjp@eunix ~]$ pwd
/home/dishawjp
[dishawjp@eunix ~]$ ls -a .X*
.Xauthority
[dishawjp@eunix ~]$
Code: Select all
[dishawjp@eunix ~]$ man switchdesk >nnn
[dishawjp@eunix ~]$ more nnn
SWITCHDESK(1) SWITCHDESK(1)
NAME
switchdesk - graphical and text mode interface for choosing desktop
environment
SYNOPSIS
switchdesk [desktop name]
DESCRIPTION
switchdesk provides a simple method of choosing between the various
desktop environments available under Red Hat Linux, including GNOME,
KDE, and FVWM2. If X Windows is running, switchdesk will bring up a
dialog box which allows the user to choose between the available desk-
tops installed on the system. This dialog follows the appearance of
the user’s current desktop as closely as possible. If a desktop name
(KDE, GNOME, XFce4, FVWM, WINDOWMAKER) is supplied as an argument, or
X is not running, switchdesk can be used from the command line.
RETURN CODES
switchdesk returns 0 on success, 1 on error.
FILES
~/.Xclients, ~/.Xclients-default
Stores the currently selected desktop.
AUTHOR
Than Ngo <than@redhat.com>
Preston Brown <pbrown@redhat.com>
4th Berkeley Distribution Mon Feb 14 2000 SWITCHDESK(1)
[dishawjp@eunix ~]$
It's not that anything isn't working properly, and I can change desktops with the "switchdeck" command, but I am curious about the actual file changed by the command.
Jim
Why not just look at the /usr/bin/switchdesk command? It's just a small script that calls another small python script in /usr/share/switchdesk directory. Also in that directory you will find the Xclients scripts for each window manager that switchdesk. I think you should be able to follow through the scripts and get the idea of what they do.
Voidmain,
Well, I am not a programmer or even much of a scripter..., I just do a bit of perl and I suck at that. But looking the script over, it looks like it refers to /usr/bin/switchdesk-helper, also a shell script.
That script seems to point at ~/.xsession or to ~/,xinitrc and then sets up a ~/Xclients file with the variable $DNAME (as selected by the user allowing gnome, kde, fvwm, enlightenment and etc. as choices) as the window manager. The "DESKTOP=`echo $1 |tr a-z A-Z`" line looks like it is permitting lower case letters instead of uppercase for the window manager selection in the DNAME variable.
But I don't have either a ~/.xsession or a ~/.xinitrc file.
I always thought that this was in the ~/.xsession file, but when I went to look for the file, it wasn't there.
Anyway, thanks again Worker and Voidmain for the assistance.
Jim
Well, I am not a programmer or even much of a scripter..., I just do a bit of perl and I suck at that. But looking the script over, it looks like it refers to /usr/bin/switchdesk-helper, also a shell script.
That script seems to point at ~/.xsession or to ~/,xinitrc and then sets up a ~/Xclients file with the variable $DNAME (as selected by the user allowing gnome, kde, fvwm, enlightenment and etc. as choices) as the window manager. The "DESKTOP=`echo $1 |tr a-z A-Z`" line looks like it is permitting lower case letters instead of uppercase for the window manager selection in the DNAME variable.
But I don't have either a ~/.xsession or a ~/.xinitrc file.
Code: Select all
[dishawjp@eunix ~]$ ls .x*
.xscreensaver
.xmms:
config menurc Plugins Skins xmms.m3u
[dishawjp@eunix ~]$
Anyway, thanks again Worker and Voidmain for the assistance.
Jim
-
- administrator
- Posts: 239
- Joined: Fri Jan 10, 2003 2:06 pm
Try this file
I'm not sure if this is the global or local setting.
I recall that there is another file that is either global or user specific, obviously it would be the opposite of this one.
Code: Select all
/etc/sysconfig/desktop
I recall that there is another file that is either global or user specific, obviously it would be the opposite of this one.
When I type "switchdesk KDE" it's pretty obvious what it does:
If yours isn't doing that I would have to guess something is broken. The /etc/sysconfig/desktop contains the "default" Window manager for when a user hasn't picked one.
When I do a "switchdesk KDE" I end up with an .Xclients-default that contains "WM=startkde" as you can see and if I did a "switchdesk GNOME" it contains "WM=gnome-session". startkde is the startup script for KDE and gnome-session is the startup script for GNOME.
Code: Select all
[void@laplinux ~]$ switchdesk KDE
Red Hat Linux switchdesk 4.0
Copyright (C) 1999-2004 Red Hat, Inc
Redistributable under the terms of the GNU General Public License
saving /home/void/.Xclients as /home/void/.Xclients.switchdesk
Desktop now set up to run KDE.
Code: Select all
[void@laplinux ~]$ ls -alp .Xcl*
-rwxr-xr-x 1 void void 189 Apr 9 07:35 .Xclients
-rwxr-xr-x 1 void void 189 Apr 9 07:35 .Xclients-default
-rwxrwxr-x 1 void void 20 Dec 18 2003 .Xclients-default.old
-rwxr-xr-x 1 void void 188 Dec 18 2003 .Xclients.switchdesk
Code: Select all
[void@laplinux ~]$ more .Xclients
#! /bin/bash
# Created by Red Hat Desktop Switcher
if [ -e "$HOME/.Xclients-$HOSTNAME$DISPLAY" ]; then
exec $HOME/.Xclients-$HOSTNAME$DISPLAY
else
exec $HOME/.Xclients-default
fi
Code: Select all
[void@laplinux ~]$ more .Xclients-default
#! /bin/bash
# Created by Red Hat Desktop Switcher
WM="startkde"
WMPATH="/usr/bin /opt/bin /usr/local/bin /usr/X11R6/bin"
for p in $WMPATH ; do
[ -x $p/$WM ] && exec $p/$WM
done
exit 1
When I do a "switchdesk KDE" I end up with an .Xclients-default that contains "WM=startkde" as you can see and if I did a "switchdesk GNOME" it contains "WM=gnome-session". startkde is the startup script for KDE and gnome-session is the startup script for GNOME.
Ah-ha!
Thanks Voidmain!
That's the answer. Although I have used "switchdesk kde" for my daughter's account on this machine to set her up with KDE, I have always used Gnome in my account. Since the files aren't created until a non-default WM is used for that account, I didn't have the files and was defaulting to the /etc/sysconfig/desktop WM. I never thought to run switchdesk from the command line in my account and follow the output.
Thanks again!
Jim
Thanks Voidmain!
That's the answer. Although I have used "switchdesk kde" for my daughter's account on this machine to set her up with KDE, I have always used Gnome in my account. Since the files aren't created until a non-default WM is used for that account, I didn't have the files and was defaulting to the /etc/sysconfig/desktop WM. I never thought to run switchdesk from the command line in my account and follow the output.
Thanks again!
Jim