LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Fedora (https://www.linuxquestions.org/questions/fedora-35/)
-   -   FC3 adding to session list (blackbox, etc) (https://www.linuxquestions.org/questions/fedora-35/fc3-adding-to-session-list-blackbox-etc-262726/)

paegus 12-05-2004 12:09 AM

FC3 adding to session list (blackbox, etc)
 
I would like to add 3rd party session managers to the default list so you can pick them at login and set them as default via switchdesk.

how can i do this or at least where should i be looking?

Winno 12-07-2004 08:54 AM

I could be wrong in this, but this could be a starting point for those who want to experiment. Notice the /etc/X11 directory

As root:

Copy and modify one of the KDE/GNOME scripts in this folder:
/etc/X11/gdm/Sessions

Open file /etc/X11/xdm/Xsession, locate the section below (about halfway down) and copy and modify the KDE line

Code:

# now, we see if xdm/gdm/kdm has asked for a specific environment
case $# in
1)
    if [ -x "$SWITCHDESKPATH/Xclients.$1" ]; then
      exec -l $SHELL -c "$SSHAGENT $SWITCHDESKPATH/Xclients.$1";
    fi;

    case "$1" in
    failsafe)
      exec -l $SHELL -c "xterm -geometry 80x24-0-0"
      ;;
    gnome)
      exec -l $SHELL -c "$SSHAGENT gnome-session"
      ;;
    kde|kde1|kde2)
      exec -l $SHELL -c "$SSHAGENT $SWITCHDESKPATH/Xclients.kde"
      ;;


To set a default graphical environment, open up /etc/X11/xinit/Xclients and alter the defaults. This section is about 1/3 of the way down. Here's my swapped section:

Code:

if [ -z "$PREFERRED" ]; then

    GSESSION=gnome-session
    STARTKDE=startkde

    # by default, we run KDE.
    if which $STARTKDE >/dev/null 2>&1; then
        exec `which $STARTKDE`
    fi

    # if KDE isn't installed, try GNOME.
    if which $GSESSION >/dev/null 2>&1; then
        exec `which $GSESSION`
    fi
fi

I know this is messy, but hopefully one day someone (or even myself) could come up with a nice GUI to work this out.

Hope this helps

triet 12-07-2004 04:48 PM

This is what i did (for Xfce4):

1. Copy the desktop entry file of your 3rd party session manager into /usr/share/xsessions folder. In my case, i installed Xfce to /2nd/programs/xfce-4RC1 folder, this is what i did:

# cp /2nd/programs/xfce-4RC1/share/examples/xfce42.desktop /usr/share/xsessions/

This adds an entry of Xfce42 to the login screen next too Gnome, KDE, failsafe...

2. To make it the default:

Go to your home folder:
# cd ~
Make a backup copy of your current .Xclients-default just in case:
# cp .Xclients-default .Xclients-default.backup
Change .Xclients-default to contain this:
#!/bin/bash
exec <fullpath-to-startYourSessionManager> (in my case it's exec /2nd/programs/xfce-4RC1/bin/startxfce4)
exit 1

This makes xfce4 the default manager already, no need to run switchdesk. It actually doesn't show up on switchdesk.

This way is not sophisticated like Winno's way but i found it's less headace. :D Hope it can help you. I'll try Winno's way now.

dolvmin 01-15-2005 09:21 AM

Quote:

Originally posted by Winno
I could be wrong in this, but this could be a starting point for those who want to experiment. Notice the /etc/X11 directory

As root:

Copy and modify one of the KDE/GNOME scripts in this folder:
/etc/X11/gdm/Sessions

Open file /etc/X11/xdm/Xsession, locate the section below (about halfway down) and copy and modify the KDE line

Code:

# now, we see if xdm/gdm/kdm has asked for a specific environment
case $# in
1)
    if [ -x "$SWITCHDESKPATH/Xclients.$1" ]; then
      exec -l $SHELL -c "$SSHAGENT $SWITCHDESKPATH/Xclients.$1";
    fi;

    case "$1" in
    failsafe)
      exec -l $SHELL -c "xterm -geometry 80x24-0-0"
      ;;
    gnome)
      exec -l $SHELL -c "$SSHAGENT gnome-session"
      ;;
    kde|kde1|kde2)
      exec -l $SHELL -c "$SSHAGENT $SWITCHDESKPATH/Xclients.kde"
      ;;


To set a default graphical environment, open up /etc/X11/xinit/Xclients and alter the defaults. This section is about 1/3 of the way down. Here's my swapped section:

Code:

if [ -z "$PREFERRED" ]; then

    GSESSION=gnome-session
    STARTKDE=startkde

    # by default, we run KDE.
    if which $STARTKDE >/dev/null 2>&1; then
        exec `which $STARTKDE`
    fi

    # if KDE isn't installed, try GNOME.
    if which $GSESSION >/dev/null 2>&1; then
        exec `which $GSESSION`
    fi
fi

I know this is messy, but hopefully one day someone (or even myself) could come up with a nice GUI to work this out.

Hope this helps

Dude, don't know why you are looking for a 3rd party program when you already have gnome-session*rpm installed. It's part of the FC3 package. Only difference between FC2 and FC3 is FC2 has a GUI program that allows changing the default desktop. On either FC2 or FC3, you can use the following command to change the default desktop. If you installed blackbox as a RPM, you shouldn't have to do anything with code.
Code:

switchdesk "desktop name"

(eg. switchdesk kde, switchdesk gnome, switchdesk xfce, (and in your case) switchdesk blackbox)

That's it. 2 word syntex to fix all your problems!

If you need to step away from gnome-session*rpm, I don't think there is one. But if you are interested in changing this in the gui, just make a small script program and have it linked to a icon you create on the desired desktop. Or learn VC++ and QDesigner and create some widgets. Hope this helps bud. =)

dolvmin 01-15-2005 09:24 AM

This is what I did:
Code:

switchdesk blackbox
Of corse, this does not apply if you install blackbox with make.

dolvmin 01-15-2005 10:11 AM

Making a GUI for this should not be that tough. All they need to do is this:
Code:

//Assuming C++
//Declaring major varables.
int SessionOptions = 4;
char Session[SessionOptions] = { "gnome", "kde", "xfce", "blackbox" };
int SessionDesired;

// Program Execution
cin >> SessionDesired;  // Replace with widgets from QT Designer
System( "gnome-session" Session[SessionDesired] );

Of corse this is a very crude and simple program. It may not even work without some alteration, but it's complexity should be the same. Addition syntex would be added for addition support. Addition support could be security, error control, addition compatibility functionality, etc. If I knew how to use QT Designer, I would have made this in a heart beat, and thrown it as a RPM for the public.

jspaar 01-15-2005 04:05 PM

I don't know how to add something to switchdesk's list. But you can add stuff to the gdm Sessions menu pretty easily:

# cd /etc/X11/dm/Sessions
# cp gnome.desktop foo.desktop

edit foo.desktop:
change Name=GNOME to Name=foo
change Exec=gnome-session to Exec=foo-session

Create a /usr/local/bin/foo-session script that starts your session.

Next time you start gdm, "foo" will appear as an option on the Sessions drop down.


All times are GMT -5. The time now is 02:03 PM.