PDA

View Full Version : Fedora 9 run ~/.xsession from GDM



mattcen
21st August 2008, 04:28 AM
Hi all,

Sorry if this has already been answered - I did do a search, but couldn't find anything (It was difficult to find appropriate search terms).

Anyway, here's my situation:
I have an almost fresh Fedora 9 installation, and have a ~/.xsession file to start my window manager and an xterm etc.
My dilemma is that I can't get GDM to run the ~/.xsession files - It always starts a specific window manager (based on what WM is selected via the dropdown at the bottom of the screen), as opposed to the ~/.xsession file.
Any ideas how I can make it run this file?

Thanks,
Mattcen.

marcrblevins
21st August 2008, 08:59 AM
I heard gdm was change from scratch.
Can you search for /etc/sysconfig/desktop on this forum?

I think this serves the same purpose?
I created this file myself.


[root@kiriyamablevins ~]# cat /etc/sysconfig/desktop
DESKTOP="KDE"
DISPLAYMANAGER="KDE"
[root@kiriyamablevins ~]#

LordMorgul
22nd August 2008, 02:54 AM
Anyway, here's my situation:
I have an almost fresh Fedora 9 installation, and have a ~/.xsession file to start my window manager and an xterm etc.
My dilemma is that I can't get GDM to run the ~/.xsession files - It always starts a specific window manager (based on what WM is selected via the dropdown at the bottom of the screen), as opposed to the ~/.xsession file.
Any ideas how I can make it run this file?

Is the purpose to get some chosen applications and your preferred window manager running WITHIN gnome? Or is your purpose to get a different desktop environment started (perhaps a very basic X session and a window manager, ala the old 'TWM' environment)?

If you just want to start another window manager within gnome (like compiz) then you can add an entry to the gnome session which will call compiz --replace.

mattcen
22nd August 2008, 03:17 AM
Thank you both for your replies.

Below is basically the '.xsession' script I would like to run. I want to run 'fluxbox', as well as an 'xterm', (after configuring it with 'xrdb') and 'xautolock'.



#!/bin/bash

xrdb ~/.Xdefaults

/usr/bin/xterm /bin/bash -geometry 80x50+5+3 &
/usr/bin/xterm /bin/bash -geometry 80x50+512+3 &

# Disable shell beep
set b off

xautolock -time 1 -locker 'xlock -mode blank' -nowlocker 'xlock -mode blank' &

exec /usr/bin/fluxbox


This works fine on my Fedora 8 server, but not with GDM on Fedora 9.

mattcen
27th August 2008, 02:30 PM
Can anybody else shed some light on my situation :S?

bingoUV
27th August 2008, 03:57 PM
In fedora 9, the list of session types you get in GDM comes from /usr/share/xsessions/. Create a new file here, say fluxbox.desktop. Call your .xsession file from here. Now if you choose the fluxbox session from GDM you will go into this environment.

vallimar
27th August 2008, 05:16 PM
yum info xorg-x11-xinit-session

I don't use it, but you should try it.

mattcen
28th August 2008, 02:29 AM
Thanks for your suggestions.

BingoUV, I forgot to mention that I had already tried what you suggested. I copied the fluxbox.destop file (created by the fluxbox installation), and modified it to run my ~/.xsession, but it wouldn't show up in the GDM menu of sessions for some reason. I think that perhaps I shouldn't have tried to execute .xsession straight off, but run another program to execute it. I might try and figure this out later

Vallimar your suggestion worked! It created a new file in the xsessions folder (xinit-compat.desktop), which ran my ~/.xsession script without any problems! It ran mt .xsession with 'sh -c exec ~/.xsession', which is probably what I needed to do for BingoUV's suggestion to work.

Thank you all for your help,

Sincerely,
Matt

eliashickman
14th December 2008, 05:38 AM
If anyone is checking this post still, GDM is not reading the xinit-compat.desktop file for some reason.
My .xsession is executable and has the programs that I want to load in it but it's not executing for some reason. I have GDM set to autologin, could this be why?

My /etc/gdm/custom.conf looks like this:


# GDM configuration storage

[xdmcp]

[chooser]

[security]

[debug]

[daemon]
AutomaticLoginEnable=true
AutomaticLogin=Elias
TimedLoginEnable=true
TimedLogin=Elias
TimedLoginDelay=0


I actually got it to work now, but for some reason my ~/.xsession file doesn't want to execute properly.

Here it is...


#!/bin/sh

# Uncomment the following two lines for normal desktop:
# unset SESSION_MANAGER
# exec /etc/X11/xinit/xinitrc

vuze &
amarok &
skype &
deluge &
amule &
gnome-session &

eliashickman
14th December 2008, 08:17 AM
Got it to work!
Just removed the last amperstand after "gnome-session"

By the way, this is a great way to run your desktop especially if you use "vnc" with the same user.
I originally had a problem with my vnc sessions starting everything I had in my normal sessions. Now I have two independent sessions running and both start each others apps independently. :)

antofthy
14th April 2009, 01:20 AM
I had the same problem as the above, unable to run my .xsession.

However I run .xsession for a very different reasons.


I want to be able to set up things BEFORE and AFTER the Gnome session manager.

specifically. BEFORE gnome, I make symbolic links for gnome to select what type of gnome session environment I run. That is the ".gconf" directory is really a symbolic link to one of a number of different ".gconf" configurations. same goes for all the other gnome configuration directories.

More specifically as my home is shared over a number of different versions of OS (multiple root's for testing various linux's, and even NFS shared to other machines!). For example I often use the same home directory for ubuntu, fedora, and even different releases of those. I needed to be able to 'select' a ".gconf" that WORKS for each linux, without it 'destroying' or going haywire every time I change OS!

As such before starting gnome I need to 'setup' the right gnome configuration for the current OS, and afterwards I need to remove it again.

Also being able to tell "firefox" that I logged out normally, and as such do not want it to 'remember' what I was looking at previously is useful (just delete ".mozilla/firefox/*/sessionstore.js" file)


I also like to having a simple shell script to launch my initial applications, and adjust them (for example, start firefox, then iconify it) appropriately is a great thing.


I really don't know why Linux moved away from Xsession files. I always thought it was a stupid move!

eliashickman
14th April 2009, 06:25 AM
I also like to having a simple shell script to launch my initial applications, and adjust them (for example, start firefox, then iconify it) appropriately is a great thing.


How do you start Firefox iconified? Is this an argument that I could pass to other processes, like say Eclipse or rssOwl?

antofthy
14th April 2009, 07:55 AM
I created a shell script called "xwinfind" which will 'wait' for a specific window to appear and return the X window id (a number) for that window. I then use "xwit" to iconify that window.

It is a bit like using "devilspie" but only ONCE, not all the time.

Script "xwinfind" is at http://www.cit.gu.edu.au/~anthony/software/xwin_find.sh

I then have this in my x client ("session") script


# Start firefox in background
firefox &

# wait for it to appear, and position it
if id=`xwin_find 60 ".* Mozilla Firefox"`; then
# size, position, and iconify
xwit -resize 820 1000 -move 530 70 -iconify -id $id
fi

On screen the window will appear in full momentarily, but then 'iconify' automatically.

I do similar things for many other clients with impaired X window options, of modern applications.

It would be good if "Devilspie" has a 'do this ONCE only' type functionality, or even similar functions in window managers like "OpenBox". Unfortunately they only provide a 'always do this when seen' type handling.

Their is another similar application called "wmctrl" that also has similar capabilities to "xwit" but with a more window manager focus. I believe that one ac also set a applications desktop. I just haven't really tried it yet.

eliashickman
15th April 2009, 12:57 AM
Sweet! Thanks a million. I'll have to try that out.