Default session in GDM #220

Closed
opened 2016-05-21 10:33:40 +00:00 by philm · 4 comments
philm commented 2016-05-21 10:33:40 +00:00 (Migrated from gitlab2.manjaro.org)

Created by: philmmanjaro

We are currently don't set the default session in GDM.

A global default session can be defined in /etc/gdm/custom.conf:

[daemon]
DefaultSession=mate.desktop

That said, GDM stores each user's last session in /var/lib/AccountsService/users/$USER:

[User]
Language=en_US.utf8
XSession=mate
SystemAccount=false

I do not know of a way to configure GDM to ignore the last session used and force using a desired default with each new login. A work-around would be to run a PostSession script to always modify /var/lib/AccountsService/users/$USER.

In /etc/gdm/PostSession/Default, try adding something like this:

sed -i 's|^XSession=.*|XSession=mate|' /var/lib/AccountsService/users/$USER

*Created by: philmmanjaro* We are currently don't set the default session in GDM. A global default session can be defined in `/etc/gdm/custom.conf`: ``` [daemon] DefaultSession=mate.desktop ``` That said, GDM stores each user's last session in `/var/lib/AccountsService/users/$USER`: ``` [User] Language=en_US.utf8 XSession=mate SystemAccount=false ``` I do not know of a way to configure GDM to ignore the last session used and force using a desired default with each new login. A work-around would be to run a PostSession script to always modify `/var/lib/AccountsService/users/$USER`. In /etc/gdm/PostSession/Default, try adding something like this: `sed -i 's|^XSession=.*|XSession=mate|' /var/lib/AccountsService/users/$USER`
philm commented 2016-05-21 11:16:15 +00:00 (Migrated from gitlab2.manjaro.org)

Created by: philmmanjaro

In Thus we use this for GDM:

        # Setup gdm
        if os.path.exists("{0}/usr/bin/gdm".format(DEST_DIR)):
            default_desktop_environment = self.find_desktop_environment()
            os.system("echo \"[User]\" > {0}/var/lib/AccountsService/users/{1}".format(DEST_DIR, username))
            if default_desktop_environment is not None:
                os.system("echo \"XSession={0}\" >> \
                {1}/var/lib/AccountsService/users/{2}".format(default_desktop_environment.desktop_file, DEST_DIR, username))
                os.system("echo \"Icon=\" >> {0}/var/lib/AccountsService/users/{1}".format(DEST_DIR, username))
            self.desktop_manager = 'gdm'
*Created by: philmmanjaro* In **Thus** we use this for GDM: ``` # Setup gdm if os.path.exists("{0}/usr/bin/gdm".format(DEST_DIR)): default_desktop_environment = self.find_desktop_environment() os.system("echo \"[User]\" > {0}/var/lib/AccountsService/users/{1}".format(DEST_DIR, username)) if default_desktop_environment is not None: os.system("echo \"XSession={0}\" >> \ {1}/var/lib/AccountsService/users/{2}".format(default_desktop_environment.desktop_file, DEST_DIR, username)) os.system("echo \"Icon=\" >> {0}/var/lib/AccountsService/users/{1}".format(DEST_DIR, username)) self.desktop_manager = 'gdm' ```
philm commented 2016-05-21 15:52:26 +00:00 (Migrated from gitlab2.manjaro.org)

Created by: philmmanjaro

Hmm, seems we have it after all ...

# $1: chroot
# $2: user
configure_accountsservice(){
    msg2 "Configuring accountsservice ..."
    local path=$1/var/lib/AccountsService/users
    if [ -d "${path}" ] ; then
        echo "[User]" > ${path}/$2
        echo "XSession=${default_desktop_file}" >> ${path}/$2
        if [[ -f "/var/lib/AccountsService/icons/$2.png" ]];then
            echo "Icon=/var/lib/AccountsService/icons/$2.png" >> ${path}/$2
        fi
    fi
}
*Created by: philmmanjaro* Hmm, seems we have it after all ... ``` # $1: chroot # $2: user configure_accountsservice(){ msg2 "Configuring accountsservice ..." local path=$1/var/lib/AccountsService/users if [ -d "${path}" ] ; then echo "[User]" > ${path}/$2 echo "XSession=${default_desktop_file}" >> ${path}/$2 if [[ -f "/var/lib/AccountsService/icons/$2.png" ]];then echo "Icon=/var/lib/AccountsService/icons/$2.png" >> ${path}/$2 fi fi } ```
philm commented 2016-05-22 17:55:17 +00:00 (Migrated from gitlab2.manjaro.org)

Created by: udeved

Yep, that's the way we configure gdm.
Does it still need to attention?

*Created by: udeved* Yep, that's the way we configure gdm. Does it still need to attention?
philm commented 2016-05-22 20:28:37 +00:00 (Migrated from gitlab2.manjaro.org)

Created by: philmmanjaro

Hmm, I don't think so. If I'll reopen it.

*Created by: philmmanjaro* Hmm, I don't think so. If I'll reopen it.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
tools/manjaro-tools#220
No description provided.