From 7d490453085ae084ce0e3875952eae1d3ad7b1ab Mon Sep 17 00:00:00 2001 From: Craig Jennings Date: Mon, 26 Jan 2026 16:57:37 -0600 Subject: refactor(shell): reorganize shell config for proper separation Restructure shell configuration to follow standard conventions: - .profile: Environment variables only (POSIX compatible) - .bash_profile: NEW - sources .profile and .bashrc for login shells - .bashrc: Bash-specific settings, sources .bashrc.d/ - .zshrc: Zsh-specific settings, sources .zshrc.d/ New modular directories: - .bashrc.d/: aliases, emacs, fzf, git, media, utilities - .zshrc.d/: same as bashrc.d plus arch-downgrade (zsh-only) - .profile.d/: reduced to env-only files (display, framework, auto-tmux) Fixes: - Remove duplicate .profile sourcing in .bashrc - Remove broken XDG_CURRENT_DESKTOP=GNOME line from display.sh - Move aliases/functions from .profile to appropriate .d/ directories - Shell-specific init (zoxide, fzf) now in .bashrc/.zshrc directly - FreeBSD bindkey fix now in .zshrc directly Also adds CLAUDE.md session context file. Co-Authored-By: Claude Opus 4.5 --- dotfiles/system/.profile.d/chronographic.sh | 120 ---------------------------- 1 file changed, 120 deletions(-) delete mode 100644 dotfiles/system/.profile.d/chronographic.sh (limited to 'dotfiles/system/.profile.d/chronographic.sh') diff --git a/dotfiles/system/.profile.d/chronographic.sh b/dotfiles/system/.profile.d/chronographic.sh deleted file mode 100644 index 41c1860..0000000 --- a/dotfiles/system/.profile.d/chronographic.sh +++ /dev/null @@ -1,120 +0,0 @@ -#!/bin/sh - -# chronographic.sh -# Craig Jennings -# quick and dirty terminal clock, timer, alarm and stopwatch functions - -alias beep='paplay $BEEP' -export BEEP="/usr/share/sounds/freedesktop/stereo/bell.oga" - -## -## CLOCK -## - -clock() { - while true; do tput clear; echo ""; date +" %l : %M %p" | figlet -f roman -w 200 ; sleep 1; done -} - -## -## TIMER -## - -timer() { - # Ensure we have at least two arguments - if [ "$#" -lt 2 ]; then - echo "Pass the time and a notification. Example: timer 1h30m Parking expiring" - return 1 - fi - message="${@:2}" - start_time=$(date +"%H:%M:%S %p") - printf "\nStarting %s timer at $start_time\n" "$1" - snore "$1" && paplay "$BEEP" && notify-send "Timer" "$message" && echo "" -} - -## -## ALARM -## - -alarm() { - # Ensure we have two or more arguments - if [ "$#" -lt 2 ]; then - echo "Pass both the time and a message. Example: alarm 1:45pm Time to eat!" - return 1 - fi - - # Validate the first argument is a valid time - ! date -d "$1" >/dev/null 2>&1 && echo "Invalid time: $1" && return 1 - - # silently schedule the command using 'at' command - echo "paplay \$BEEP && notify-send \"Alarm\" \"$@\"" | at "$1" >> /dev/null 2>&1 - echo "" - echo "Alarm '${@:2}' is queued for $1." - echo "To see all alarms, issue the command: 'atq'" - echo "To remove an alarm, issue the command: 'atrm' and the number of entry from atq" - echo "" -} - -## -## STOPWATCH FUNCTIONS -## - -sw_start_time=0 -sw_started=0 - -swreset() { - sw_start_time=0 - sw_started=0 - echo "Stopwatch reset" -} - -swshow() { - if [ "$sw_started" = 0 ] ; then - echo "Error: Stopwatch not started" >&2 && return 1 - fi - - current_time=$(date +%s) - elapsed_time=$((current_time - sw_start_time)) - - if (( elapsed_time < 60 )); then - # Display elapsed time in seconds - echo "Elapsed time: $elapsed_time seconds" - elif (( elapsed_time < 3600 )); then - # Display elapsed time in minutes and seconds - minutes=$((elapsed_time / 60)) - seconds=$((elapsed_time % 60)) - echo "Elapsed time: $minutes minutes, $seconds seconds" - else - # Display elapsed time in hours, minutes, and seconds - hours=$((elapsed_time / 3600)) - minutes=$(((elapsed_time / 60) % 60)) - seconds=$((elapsed_time % 60)) - echo "Elapsed time: $hours hours, $minutes minutes, and $seconds seconds" - fi -} - -swstop() { - swshow - swreset -} - -swstart() { - if [ "$sw_started" = 1 ] ; then - printf "Stopwatch is already started. Reset? (y/n): " - read -r answer - if [ "$answer" = "y" -o "$answer" = "Y" ]; then - swreset - # continue on to start the new timer - elif [ "$answer" = "n" -o "$answer" = "N" ]; then - echo "Stopwatch not reset." - swshow - # return to avoid restarting the timer - return - else - echo "Error: Invalid input. Exiting." >&2 && return 1 - fi - fi - - sw_started=1 - sw_start_time=$(date +%s) - printf "Stopwatch started at %s\n\n" "$(date +"%H:%M:%S %p")" -} -- cgit v1.2.3