Would you like to react to this message? Create an account in a few clicks or log in to continue.

2 posters
  • Post new topic
  • Reply to topic

Another way to get logout sounds in XFCE

avatar
davecs


Posts : 110
Join date : 2024-05-14

Another way to get logout sounds in XFCE Empty Another way to get logout sounds in XFCE

Post by davecs 20th August 2024, 12:01 pm

I don't actually know why using the XFCE Session and Startup applet to include logout sounds doesn't actually work. What I suspect is that the log out is so fast these days, that XFCE has been killed and control handed over to the Lightdm Desktop Manager before the sound has a chance to play.

Upgreyed came up with an idea which causes the Logout sound to play whenever the LogOut dialogue is run. Which after a few weeks going with it, I find rather irritating. If you run the Logout Dialogue, the logout sound is played even if you cancel the logout, and it's played and done before you log out. All seems odd to me.

However, there is another way! It takes advantage of the fact that, in the $PATH variable, for users (but not for root), /usr/local/bin comes before /usr/bin. The executable file that runs the XFCE desktop is called xfce4-session, and what you have to do is to create a script in /usr/local/bin with the same name, which will be run in preference to the XFCE executable. You have to create a file, in /usr/local/bin/ as root, called xfce4-session. It should be marked as executable.

It reads as follows:
Code:

#!/bin/bash

# Run xfce then play sound on exit.
# Note that you must include the full path to the XFCE executable, to ensure that
# the script doesn't just keep calling itself!

/usr/bin/xfce4-session

# On exit, play the sound:
play -v 1.0 --magic /usr/share/sounds/`xfconf-query -c xsettings -p /Net/SoundThemeName`/stereo/desktop-logout.*

My earlier attempt at this involved renaming the XFCE executable, and putting the script in /usr/bin, obviously the line to call the executable would be different to reflect that. But then I thought: What if there is an update to the XFCE executable? This way we're covered!

Obviously this way also has its disadvantages, in that control cannot be passed to LightDM, or the computer cannot shutdown or reboot, until the sound has finished playing. It's down to personal preference.
Upgreyed
Upgreyed
Admin


Posts : 129
Join date : 2024-05-12
Location : The Sunshine State FL USA

Another way to get logout sounds in XFCE Empty Re: Another way to get logout sounds in XFCE

Post by Upgreyed 20th August 2024, 2:51 pm

@ davecs

The logout sound is somewhat annoying if it plays too long in some of the themes. I think that maybe just add a quick simple logout sound for the logout session would be best. That's my thought on it. I personally don't care for too many sounds. Maybe a just boot up sound and an error sound file works for me but they are there for the user to choose from. If you want to change up some of the theme sounds then message me about it. Wink
avatar
davecs


Posts : 110
Join date : 2024-05-14

Another way to get logout sounds in XFCE Empty Re: Another way to get logout sounds in XFCE

Post by davecs 21st August 2024, 5:21 am

I think it's possible to speed up sounds without changing their pitch, using audacity. Also it can be used to cut off any silent moments at the end, and to fade out more quickly. Might be worth a look.

Sponsored content


Another way to get logout sounds in XFCE Empty Re: Another way to get logout sounds in XFCE

Post by Sponsored content

  • Post new topic
  • Reply to topic

Current date/time is 21st September 2024, 12:37 am