I want to run a script when I log out through unity. I read something about lightdm but I don't really know what it is and the config file didn't exist. The config file mentioned here doesn't exist! And manualy creating it doesn't solve my problem.
Asked
Active
Viewed 5,161 times
1 Answers
9
Open terminal ( or also known as command line ) by pressing together CtrlAltT or by finding it in dash.
Run this command
sudo gedit /etc/lightdm/lightdm.conf
. This opens text editor with lightdm.conf file located in/etc/lightdm
folder.In the file you should have this line
[SeatDefaults]
. Bellow this line , entersession-cleanup-script=/path/to/your-script.sh
, where /path/to/your-script.sh is the actuall address of the script that you want to run. Note: make sure your script is set to executable by runningsudo chmod +x /path/to/script.sh
Save and exit
NOTE: as of 14.04 version, the config file doesn't exist and must be created manually OR copied from an example file using the following command
sudo sh -c ' zcat /usr/share/doc/lightdm/lightdm.conf.gz > /etc/lightdm/lightdm.conf`

Sergiy Kolodyazhnyy
- 105,154
- 20
- 279
- 497
[SeatDefaults]
as well then. – Byte Commander Mar 17 '16 at 15:46/etc/lightdm/lightdm.conf
but in/usr/share/lightdm/lightdm.conf.d/50-unity-greeter.conf
. – Marton May 16 '15 at 18:13