scwrypts v3 refactor

This commit is contained in:
2023-06-27 16:53:59 -06:00
parent 02ed7d615a
commit 1a64551465
57 changed files with 590 additions and 501 deletions

View File

@@ -0,0 +1,38 @@
#####################################################################
DEPENDENCIES+=(
canberra-gtk-play
)
REQUIRED_ENV+=()
use desktop/notify --group dotwryn
#####################################################################
MEDIA__PLAY_SFX() {
local SFX_FILE
case $1 in
volume ) SFX_FILE=$DESKTOP__SFX_PATH/yaru-message.oga ;;
mute ) SFX_FILE=$DESKTOP__SFX_PATH/smooth-dialog-warning.oga ;;
backlight ) SFX_FILE=$DESKTOP__SFX_PATH/yaru-audio-volume-change.oga ;;
login ) SFX_FILE=$DESKTOP__SFX_PATH/yaru-desktop-login.oga ;;
logout ) SFX_FILE=$DESKTOP__SFX_PATH/smooth-desktop-login.oga ;;
notify ) SFX_FILE=$DESKTOP__SFX_PATH/yaru-complete.oga ;;
undock ) SFX_FILE=$DESKTOP__SFX_PATH/yaru-desktop-login.oga ;;
homedock ) SFX_FILE=$DESKTOP__SFX_PATH/homedock.oga ;;
gamedock ) SFX_FILE=$DESKTOP__SFX_PATH/gamedock.oga ;;
* ) SFX_FILE="$1"
;;
esac
[ -f $SFX_FILE ] \
&& STATUS "detected file '$SFX_FILE'" \
|| NOTIFY_FAIL 1 "unable to locate sfx file '$1'" \
;
STATUS 'starting playback'
canberra-gtk-play -f "$SFX_FILE" \
&& SUCCESS "finished output of '$SFX_FILE'" \
|| NOTIFY_FAIL 1 "something went wrong playing file '$SFX_FILE'"
}