f7b3e0a7a9
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.
113 lines
2.5 KiB
Bash
Executable file
113 lines
2.5 KiB
Bash
Executable file
#!/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
|