1

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.

Sergiy Kolodyazhnyy
  • 105,154
  • 20
  • 279
  • 497
Marton
  • 403

1 Answers1

9
  1. Open terminal ( or also known as command line ) by pressing together CtrlAltT or by finding it in dash.

  2. Run this command sudo gedit /etc/lightdm/lightdm.conf. This opens text editor with lightdm.conf file located in /etc/lightdm folder.

  3. In the file you should have this line [SeatDefaults] . Bellow this line , enter session-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 running sudo chmod +x /path/to/script.sh

  4. 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