diff options
author | William Carroll <wpcarro@gmail.com> | 2019-03-18T14·14+0000 |
---|---|---|
committer | William Carroll <wpcarro@gmail.com> | 2019-03-18T14·14+0000 |
commit | f7b3e0a7a92903307ef1f4c66992721be6e01e08 (patch) | |
tree | 11f1959ee6dc34d2f8b20e6425cbb85700b55c63 /configs/shared/misc/.config/i3/dmenu_timer.sh | |
parent | bf33edaa6efbf3572d9335bb07b530af249de0d2 (diff) |
Drop OSX support; support desktop, laptop, cloudtop
Dropping support for OSX. Moving forward these dotfiles will depend on Linux systems. Furthermore, since I'm support a ~/bin, the machines that consume these dotfiles depend on i386 architectures. Linux and i386 are two dependencies that I'm okay with since the leverage this assumption provides, makes their existence tolerable. There is some Google leakage herein, which includes aliases, functions, and mentions of cloudtop. For now, this is okay. I may break the Google specific code into its own repository, but for now, this is less maintenance. This also introduces a ~/.profile instead of erroneously defining environment variables in my zshrc file, which was unadvised. This is a large commit and also introduces new aliases, variables, functions that I accumulated over the past week or so while migrating away from OSX and onto my new setup. Hopefully in the future I'll be more precise with my commits.
Diffstat (limited to 'configs/shared/misc/.config/i3/dmenu_timer.sh')
-rwxr-xr-x | configs/shared/misc/.config/i3/dmenu_timer.sh | 113 |
1 files changed, 113 insertions, 0 deletions
diff --git a/configs/shared/misc/.config/i3/dmenu_timer.sh b/configs/shared/misc/.config/i3/dmenu_timer.sh new file mode 100755 index 000000000000..9d62ead73091 --- /dev/null +++ b/configs/shared/misc/.config/i3/dmenu_timer.sh @@ -0,0 +1,113 @@ +#!/usr/bin/env bash + +# Select common timer intervals with dmenu and play an alarm sound when +# finished. Useful if you bind a KBD in a window manager such as i3. Pass the +# path to the alarm mp3 as the only argument. +# +# Usage: ./dmenu_timer.sh path/to/alarm.mp3 + +times=$(cat <<EOF +1 minute +2 minutes +3 minutes +4 minutes +5 minutes +10 minutes +15 minutes +20 minutes +30 minutes +45 minutes +1 hour +2 hours +EOF +) +selection=$(echo "$times" | dmenu) + +case $selection in + '1 minute') + notify-send 'Timer' 'Set for 1 minute' && \ + sleep 1m && \ + notify-send 'Timer' 'Finished.' && \ + mpg123 $1 && \ + exit 0 + ;; + '2 minutes') + notify-send 'Timer' 'Set for 2 minute' && \ + sleep 2m && \ + notify-send 'Timer' 'Finished.' && \ + mpg123 $1 && \ + exit 0 + ;; + '3 minutes') + notify-send 'Timer' 'Set for 3 minutes' && \ + sleep 3m && \ + notify-send 'Timer' 'Finished.' && \ + mpg123 $1 && \ + exit 0 + ;; + '4 minutes') + notify-send 'Timer' 'Set for 4 minutes' && \ + sleep 4m && \ + notify-send 'Timer' 'Finished.' && \ + mpg123 $1 && \ + exit 0 + ;; + '5 minutes') + notify-send 'Timer' 'Set for 5 minutes' && \ + sleep 5m && \ + notify-send 'Timer' 'Finished.' && \ + mpg123 $1 && \ + exit 0 + ;; + '10 minutes') + notify-send 'Timer' 'Set for 10 minutes' && \ + sleep 10m && \ + notify-send 'Timer' 'Finished.' && \ + mpg123 $1 && \ + exit 0 + ;; + '15 minutes') + notify-send 'Timer' 'Set for 15 minutes' && \ + sleep 15m && \ + notify-send 'Timer' 'Finished.' && \ + mpg123 $1 && \ + exit 0 + ;; + '20 minutes') + notify-send 'Timer' 'Set for 20 minutes' && \ + sleep 20m && \ + notify-send 'Timer' 'Finished.' && \ + mpg123 $1 && \ + exit 0 + ;; + '30 minutes') + notify-send 'Timer' 'Set for 30 minutes' && \ + sleep 30m && \ + notify-send 'Timer' 'Finished.' && \ + mpg123 $1 && \ + exit 0 + ;; + '45 minutes') + notify-send 'Timer' 'Set for 45 minutes' && \ + sleep 45m && \ + notify-send 'Timer' 'Finished.' && \ + mpg123 $1 && \ + exit 0 + ;; + '1 hour') + notify-send 'Timer' 'Set for 1 hour' && \ + sleep 1h && \ + notify-send 'Timer' 'Finished.' && \ + mpg123 $1 && \ + exit 0 + ;; + '2 hours') + notify-send 'Timer' 'Set for 2 hours' && \ + sleep 2h && \ + notify-send 'Timer' 'Finished.' && \ + mpg123 $1 && \ + exit 0 + ;; + *) + notify-send 'Timer' 'No supported time selected. Exiting...' && exit 1 +esac |