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,098 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/lightdmfolder.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.shSave 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
- 103,293
- 19
- 273
- 492
-
Thank you for replying but this config file doesn't exist. – Marton May 16 '15 at 16:53
-
1In case the config file does not exist, I think you should just create it in this location. Don't forget to add the headline `[SeatDefaults]` as well then. – Byte Commander Mar 17 '16 at 15:46
-
The solution [here](http://askubuntu.com/a/624489/410689) worked but the config file was not located in `/etc/lightdm/lightdm.conf` but in `/usr/share/lightdm/lightdm.conf.d/50-unity-greeter.conf`. – Marton May 16 '15 at 18:13
-
I've addressed the existence of the file issue – Sergiy Kolodyazhnyy Mar 18 '16 at 13:49