Xfce Forum

Sub domains
 

You are not logged in.

#1 2021-02-12 11:31:56

JacquesOlivier
Member
Registered: 2021-02-12
Posts: 3

Login script after opening a session

Hi,

I am using XFCE4 on ubuntu 20.04.02 LTS
I am trying to add a script, as a user, after authentification.

I tried to add these sentences in /etc/lightdm/lightdm.conf.d/myparameters.conf and also  /etc/lightdm/lightdm-gtk-greeter.conf

display-setup-script=/usr/local/bin/ur1-login-display.sh
greeter-setup-script=/usr/local/bin/ur1-login-greeter.sh
session-setup-script==/usr/local/bin/ur1-login-session.sh
session-cleanup-script=/usr/local/bin/ur1-logout.sh

all these scripts try to create a file in the homedir of the user :

#!/bin/bash
touch ~/test.txt
echo "Hello world" >> ~/test.txt

But nothing happened in the user's directory.

Am i doing something wrong ?

Offline

#2 2021-02-12 15:20:31

ToZ
Moderator
From: Canada
Registered: 2011-06-02
Posts: 7,415

Re: Login script after opening a session

From the /etc/lightdm.conf file:

# greeter-setup-script = Script to run when starting a greeter (runs as root)
# session-setup-script = Script to run when starting a user session (runs as root)
# session-cleanup-script = Script to run when quitting a user session (runs as root)

The easiest way to get a script to run as a user during login is via autostart (Settings Manager > Session and Startup > Application Autostart).

Offline

Board footer

Powered by FluxBB