dotfiles/scripts/timer
rpriven 5b6af65def
Organize scripts and clean up dotfiles
Changes:
- Added 80+ scripts with organized structure
  - payloads/ for third-party pentesting tools
  - pentesting/ for custom security scripts
  - Daily drivers remain flat for fast access
- Converted wes() function to proper script
- Removed .sh extensions from pentesting scripts
- Cleaned up aliases (removed 31 redundant lines)
- Added kanata/, build artifacts to gitignore
- Removed old fre.sh scripts and empty a.out
- Updated configs: helix, tmux, zsh, ulauncher, redshift

Security: All sensitive data excluded via gitignore
2025-11-07 14:48:21 -07:00

40 lines
1.1 KiB
Bash
Executable file

#!/usr/bin/env bash
set -euo pipefail
# Script Name: timer
# Description: Countdown timer with audio and notification
# Source: https://evanhahn.com/scripts-i-wrote-that-i-use-all-the-time/
# Usage: timer 5m
# timer 30s
# timer 1h
if [[ $# -ne 1 ]]; then
echo "Usage: timer <duration>" >&2
echo "Examples: timer 5m, timer 30s, timer 1h" >&2
exit 1
fi
duration="$1"
# Show countdown timer with gum if available
if command -v gum &>/dev/null; then
echo "⏱️ Timer started for $duration"
sleep "$duration"
else
echo "⏱️ Timer started for $duration (sleeping...)"
sleep "$duration"
fi
# Play notification sound if available
if command -v paplay &>/dev/null && [[ -f /usr/share/sounds/freedesktop/stereo/complete.oga ]]; then
paplay /usr/share/sounds/freedesktop/stereo/complete.oga &
elif command -v aplay &>/dev/null && [[ -f /usr/share/sounds/freedesktop/stereo/complete.wav ]]; then
aplay /usr/share/sounds/freedesktop/stereo/complete.wav &
fi
# Send desktop notification
if command -v notify-send &>/dev/null; then
notify-send "⏰ Timer Complete" "Timer finished: $duration"
fi
echo "✅ Timer complete: $duration"