How to run script at logout? (solved)

Post Reply
Message
Author
Vincent17
Posts: 75
Joined: Tue Feb 20, 2018 1:07 am

How to run script at logout? (solved)

#1 Post by Vincent17 »

Is there a good way to run a script at logout (that is, xfce4-session-logout)?

1) Rename /usr/bin/xfce4-session-logout and replace it with a script which ends by calling the renamed xfce4-session-logout. https://forum.xfce.org/viewtopic.php?id=10859 This works, but I don't like it. :mad:

2) In /etc/lightdm/lightdm.conf, session-cleanup-script=my-script: "The script runs when I log out by restarting the machine, but it does not run when I merely log out without restarting." https://ubuntuforums.org/showthread.php?t=1918649

3) command in .bash_logout "does not run for an ordinary logout." https://superuser.com/questions/410525/ ... -commands

Thanks
Last edited by Vincent17 on Tue Jul 30, 2019 4:40 pm, edited 1 time in total.

davemx
Posts: 319
Joined: Sun Aug 12, 2018 2:31 pm

Re: How to run script at logout?

#2 Post by davemx »

MX does this with XFCE4 already, in order to run the "shutdown" sound. The file is /usr/local/bin/xfce4-session. There is another script also, /usr/local/bin/xfce4-session-logout.

You could edit one of these?
Desktop: Mini-Box M350 with Asus H110i-plus motherboard, Pentium G4600 processor, 2TB SSD and 16Gb RAM DDR4-2133
Printer/Scanner: Brother MFC-J5335W
Laptop: Lenovo V15 ADA
Media Centre: Lenovo Q190

User avatar
dolphin_oracle
Developer
Posts: 19926
Joined: Sun Dec 16, 2007 1:17 pm

Re: How to run script at logout?

#3 Post by dolphin_oracle »

mx19 will support this feature. for 18, you will need to do as davemx says.
http://www.youtube.com/runwiththedolphin
lenovo ThinkPad X1 Extreme Gen 4 - MX-23
FYI: mx "test" repo is not the same thing as debian testing repo.

davemx
Posts: 319
Joined: Sun Aug 12, 2018 2:31 pm

Re: How to run script at logout?

#4 Post by davemx »

dolphin_oracle wrote: Tue Jul 30, 2019 4:26 pm mx19 will support this feature. for 18, you will need to do as davemx says.
Yes, I should have said. XFCE is adding the feature you want to XFCE4.14, so you might want to wait until until MX19. You have to admire the MX devs for their inventiveness in adding features to XFCE via the /usr/local folders, hopefully their job will be simplified!
Desktop: Mini-Box M350 with Asus H110i-plus motherboard, Pentium G4600 processor, 2TB SSD and 16Gb RAM DDR4-2133
Printer/Scanner: Brother MFC-J5335W
Laptop: Lenovo V15 ADA
Media Centre: Lenovo Q190

Vincent17
Posts: 75
Joined: Tue Feb 20, 2018 1:07 am

Re: How to run script at logout?

#5 Post by Vincent17 »

Thanks to both of you. This will do nicely!

Post Reply

Return to “XFCE Desktop Environment”