Page 1 of 2 12 LastLast
Results 1 to 10 of 13

Thread: there is no ~/.xsession file - what selects the DE to run?

  1. #1
    Join Date
    Jan 2010
    Location
    Wheeling WV USA
    Beans
    2,023
    Distro
    Xubuntu 20.04 Focal Fossa

    there is no ~/.xsession file - what selects the DE to run?

    there is no ~/.xsession file - what selects the DE to run? i have a script that back traces process parentage/ancestry but it goes from terminal to init (PID 1). so everything was backgrounded and i can't see what started what without stracing everything opendm does.
    Mask wearer, Social distancer, System Administrator, Programmer, Linux advocate, Command Line user, Ham radio operator (KA9WGN/8, tech), Photographer (hobby), occasional tweetXer

  2. #2
    Join Date
    Jun 2016
    Beans
    2,831
    Distro
    Xubuntu

    Re: there is no ~/.xsession file - what selects the DE to run?

    The display manager. You choose it in the display manager greeter before you log in. For Xubuntu at least some of the options are stored in /usr/share/xsessions/ I don't know if that's the only place though.
    Xubuntu 22.04, ArchLinux ♦ System76 hardware, virt-manager/KVM, VirtualBox
    When your questions are resolved to your satisfaction, please use Thread Tools > "Mark this thread as solved..."

  3. #3
    Join Date
    Jan 2010
    Location
    Wheeling WV USA
    Beans
    2,023
    Distro
    Xubuntu 20.04 Focal Fossa

    Re: there is no ~/.xsession file - what selects the DE to run?

    what chooses to start Xfce in Xubuntu ... or ... what designates that the user is an Xubuntu/Xfxe (or whatever DM) user? is it something in lightdm?

    what i want to do is run some additional code (in a Python script or an ELF binary ... that i could build statically linked if necessary, so PATH is not needed, yet) for every user at login time. running this AS that user with no privilege to become root is OK. but needs to, at least, know which user (it will switch real and effective user to be that user, if it is root). this code is intended to do some cleanup before anything (else) starts.
    Mask wearer, Social distancer, System Administrator, Programmer, Linux advocate, Command Line user, Ham radio operator (KA9WGN/8, tech), Photographer (hobby), occasional tweetXer

  4. #4
    GhX6GZMB is offline Iced Almond Soy Ubuntu, No Foam
    Join Date
    Jun 2019
    Beans
    1,093

    Re: there is no ~/.xsession file - what selects the DE to run?

    I run Lubuntu myself with SDDM as display manager, but I imagine the setups are pretty much alike.

    The items for the environment choices during login are in /usr/share/xsessions

    As far as I can tell, the default or last chosen environment is defined in etc/sddm.conf, in your case probably /etc/lightdm.conf or /etc/lightdm/lightdm.conf

    https://wiki.ubuntu.com/LightDM
    Last edited by GhX6GZMB; June 10th, 2021 at 08:41 PM.

  5. #5
    Join Date
    Jun 2016
    Beans
    2,831
    Distro
    Xubuntu

    Re: there is no ~/.xsession file - what selects the DE to run?

    Quote Originally Posted by Skaperen View Post
    what chooses to start Xfce in Xubuntu ... or ... what designates that the user is an Xubuntu/Xfxe (or whatever DM) user? is it something in lightdm?
    Yes. I wonder if that is stored in /var/cache/lightdm ?

    what i want to do is run some additional code (in a Python script or an ELF binary ... that i could build statically linked if necessary, so PATH is not needed, yet) for every user at login time.
    Can you try editing the file in /usr/share/xsessions (or copying one and creating a new one) to somehow run your Python script before running the existing user session command?
    Xubuntu 22.04, ArchLinux ♦ System76 hardware, virt-manager/KVM, VirtualBox
    When your questions are resolved to your satisfaction, please use Thread Tools > "Mark this thread as solved..."

  6. #6
    Join Date
    Apr 2011
    Location
    Mystletainn Kick!
    Beans
    13,616
    Distro
    Ubuntu

    Re: there is no ~/.xsession file - what selects the DE to run?

    User info like Xsession the user has set is stored in /var/lib/AccountsService/users/Username.
    Splat Double Splat Triple Splat
    Earn Your Keep
    Don't mind me, I'm only passing through.
    Once in a blue moon, I'm actually helpful
    .

  7. #7
    GhX6GZMB is offline Iced Almond Soy Ubuntu, No Foam
    Join Date
    Jun 2019
    Beans
    1,093

    Re: there is no ~/.xsession file - what selects the DE to run?

    That one's empty on my machine.

  8. #8
    Join Date
    Jan 2010
    Location
    Wheeling WV USA
    Beans
    2,023
    Distro
    Xubuntu 20.04 Focal Fossa

    Re: there is no ~/.xsession file - what selects the DE to run?

    if something(s) hold what DE the user has chosen then i need the map of DE to /what/to/run. either i fudge the map or stub the files to run. i need my script to run ASAP after user credentials are authenticated for a login. i will need to know or find out which DE the user is expecting (iff they chose a different one at login then i need to know or find out what that is).
    Mask wearer, Social distancer, System Administrator, Programmer, Linux advocate, Command Line user, Ham radio operator (KA9WGN/8, tech), Photographer (hobby), occasional tweetXer

  9. #9
    Join Date
    Jun 2016
    Beans
    2,831
    Distro
    Xubuntu

    Re: there is no ~/.xsession file - what selects the DE to run?

    If I were doing this I would edit (or better, if possible, copy somewhere it would override the original and edit the copy) the /usr/share/xsessions/*.desktop files to point to a wrapper script that calls your script with the DE name as an argument, and after your script is done exec the command that was originally in said .desktop file. I'd have your script keep its own track of what DEs the user logs into.

    Unless you also need this for non-GUI/tty sessions?
    Xubuntu 22.04, ArchLinux ♦ System76 hardware, virt-manager/KVM, VirtualBox
    When your questions are resolved to your satisfaction, please use Thread Tools > "Mark this thread as solved..."

  10. #10
    Join Date
    Apr 2021
    Beans
    198
    Distro
    Ubuntu 20.04 Focal Fossa

    Re: there is no ~/.xsession file - what selects the DE to run?

    An xprofile file, ~/.xprofile and /etc/xprofile, allows you to execute commands at the beginning of the X user session - before the window manager is started.
    https://wiki.archlinux.org/title/Xprofile

    sounds like what your looking for

Page 1 of 2 12 LastLast

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •