Skip to content

A hardened Linux desktop, rebuilt from scratch, with your Windows apps built in. Free and open source.

880 B
Raw Blame
#!/bin/sh
# Plays desktop-logout from the chosen sound scheme when the session ends
# (wildos-logout-sound.service). It follows Settings > Sound: it plays only
# when the shutdown sound is turned on there (wildosrc [Sound]
# ShutdownSound, off by default, since shut down waits for it to finish)
# and the scheme isn't No sounds.
read_kde() { kreadconfig6 --file "$1" --group "$2" --key "$3" 2>/dev/null; }

[ "$(read_kde wildosrc Sound ShutdownSound)" = true ] || exit 0
[ "$(read_kde kdeglobals Sounds Enable)" = false ] && exit 0
theme=$(read_kde kdeglobals Sounds Theme)
file=
for dir in "${XDG_DATA_HOME:-$HOME/.local/share}" /usr/local/share /usr/share; do
    if [ -f "$dir/sounds/${theme:-ocean}/stereo/desktop-logout.oga" ]; then
        file="$dir/sounds/${theme:-ocean}/stereo/desktop-logout.oga"
        break
    fi
done
[ -n "$file" ] || exit 0
exec pw-play "$file"