diff options
| author | Don Williams <Don.e.williams@gmail.com> | 2026-02-19 01:01:59 -0500 |
|---|---|---|
| committer | Don Williams <Don.e.williams@gmail.com> | 2026-02-19 01:01:59 -0500 |
| commit | 7a7334f1ce95ea946506b37193ef4fb71f8f6744 (patch) | |
| tree | 535f1b6f2457c6d95b39b1f389e6d65dc6e95a8a /archive | |
| parent | 17faea007e32355bc52a0f639746dc9b549e6218 (diff) | |
Added config files for waybar-weather Added settinmgs to toggle C/F
On branch development
Your branch is up to date with 'origin/development'.
Changes to be committed:
modified: CHANGELOG.md
renamed: update-dots.sh -> archive/update-dots.sh
modified: config/hypr/scripts/Kool_Quick_Settings.sh
new file: config/hypr/scripts/Toggle-weather-waybar-units.sh
new file: config/waybar-weather/cityname.txt
new file: config/waybar-weather/config.toml
new file: config/waybar-weather/geolocation.txt
modified: copy.sh
Diffstat (limited to 'archive')
| -rwxr-xr-x | archive/update-dots.sh | 81 |
1 files changed, 81 insertions, 0 deletions
diff --git a/archive/update-dots.sh b/archive/update-dots.sh new file mode 100755 index 00000000..84bd7611 --- /dev/null +++ b/archive/update-dots.sh @@ -0,0 +1,81 @@ +#!/usr/bin/env bash +set -euo pipefail +IFS=$'\n\t' + +if [[ -t 1 ]]; then + BOLD="$(tput bold || true)" + DIM="$(tput dim || true)" + RED="$(tput setaf 1 || true)" + GREEN="$(tput setaf 2 || true)" + YELLOW="$(tput setaf 3 || true)" + BLUE="$(tput setaf 4 || true)" + RESET="$(tput sgr0 || true)" +else + BOLD=""; DIM=""; RED=""; GREEN=""; YELLOW=""; BLUE=""; RESET="" +fi + +log() { printf "%b\n" "${BLUE}==>${RESET} $*"; } +ok() { printf "%b\n" "${GREEN}✔${RESET} $*"; } +warn() { printf "%b\n" "${YELLOW}⚠${RESET} $*"; } +err() { printf "%b\n" "${RED}✖${RESET} $*"; } + +log "${BOLD}Hyprland-Dots updater${RESET}" + +if ! git rev-parse --is-inside-work-tree >/dev/null 2>&1; then + err "Not inside a git repository." + exit 1 +fi + +branch="$(git rev-parse --abbrev-ref HEAD)" +if [[ "$branch" == "HEAD" ]]; then + warn "Detached HEAD state detected." +fi + +log "Fetching remote updates..." +git fetch --tags --quiet + +upstream="" +if git rev-parse --abbrev-ref --symbolic-full-name "@{u}" >/dev/null 2>&1; then + upstream="$(git rev-parse --abbrev-ref --symbolic-full-name "@{u}")" +else + if git show-ref --verify --quiet "refs/remotes/origin/${branch}"; then + upstream="origin/${branch}" + fi +fi + +if [[ -z "$upstream" ]]; then + err "No upstream found for branch '${branch}'." + exit 1 +fi + +log "Current branch: ${BOLD}${branch}${RESET}" +log "Upstream: ${BOLD}${upstream}${RESET}" + +behind_count="$(git rev-list --count "HEAD..${upstream}")" +ahead_count="$(git rev-list --count "${upstream}..HEAD")" + +if [[ "$behind_count" -eq 0 ]]; then + ok "Already up to date with ${upstream}." + if [[ "$ahead_count" -gt 0 ]]; then + warn "Local branch is ahead by ${ahead_count} commit(s)." + fi + exit 0 +fi + +warn "Updates available: behind by ${behind_count} commit(s)." +read -r -p "Update now? [y/N] " reply +case "${reply:-}" in + y|Y|yes|YES) + log "Stashing local changes..." + git stash -u + + log "Pulling latest changes from ${upstream}..." + git pull + + ok "Update complete." + printf "%b\n" "${DIM}Next: run ./copy.sh to upgrade the Hyprland dotfiles.${RESET}" + ;; + *) + warn "Update cancelled." + ;; +esac |
