You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
40 lines
773 B
Bash
40 lines
773 B
Bash
#!/bin/bash
|
|
##
|
|
# Some commonly used functions for clopper-ob
|
|
|
|
here() {
|
|
dirname "$(readlink -f "${BASH_SOURCE[0]}")"
|
|
}
|
|
|
|
bar() {
|
|
declare -i count="$1"
|
|
[[ $count -eq 0 ]] && return 0
|
|
printf '─'
|
|
((count--))
|
|
bar "$count"
|
|
}
|
|
|
|
icon() {
|
|
declare notif_icons='/usr/share/icons/Numix/48/notifications'
|
|
case "$1" in
|
|
brightness)
|
|
echo -n "$notif_icons/notification-display-brightness.svg"
|
|
;;
|
|
sound-up)
|
|
echo -n "$notif_icons/notification-audio-volume-high.svg"
|
|
;;
|
|
sound-off)
|
|
echo -n "$notif_icons/notification-audio-volume-muted.svg"
|
|
;;
|
|
esac
|
|
}
|
|
|
|
play-sound() {
|
|
declare sound_dir='/usr/share/sounds/freedesktop/stereo'
|
|
case "$1" in
|
|
volume-change)
|
|
ogg123 "$sound_dir/audio-volume-change.oga"
|
|
;;
|
|
esac
|
|
}
|