Skip to content

Instantly share code, notes, and snippets.

@rbecheras
Last active January 17, 2018 14:24
Show Gist options
  • Save rbecheras/ac96fea0bfccd2540b96fe14b1d3dbaa to your computer and use it in GitHub Desktop.
Save rbecheras/ac96fea0bfccd2540b96fe14b1d3dbaa to your computer and use it in GitHub Desktop.
Ringtone Beep on Ubuntu Gnome
#!/bin/bash
BEEP=/usr/share/sounds/gnome/default/alerts/glass.ogg
VOL_MAX=35536
CENT=100
if [[ -z $1 ]]
then
CURSOR=100
else
CURSOR=$1
fi
VOL=$((VOL_MAX * CURSOR / CENT))
echo "Play ringtone at $CURSOR% ($VOL/$VOL_MAX)"
paplay --volume="$VOL" "$BEEP"
@rbecheras
Copy link
Author

rbecheras commented Jan 17, 2018

Install it:

$ sudo cp beep.sh /usr/bin/beep
$ sudo chown +x /usr/bin/beep

Use it

$ beep
Play ringtone at 100% (35536/35536)

$ beep 75
Play ringtone at 75% (26652/35536)

$ beep 50
Play ringtone at 50% (17768/35536)

$ beep 25
Play ringtone at 25% (8884/35536)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment