Files
dotfiles/install.sh
tekki e84a2d888a feat: add battery-watch daemon and notification urgency support
- new battery-watch daemon: warnt bei 25% und 15% per dunst-Notification
- notify-waybar.sh schreibt jetzt auch Urgency-Level in /tmp
- notif-status.sh: neues waybar-Skript mit urgency-CSS-Klasse
- hyprland.conf: battery-watch als exec-once, clipboard-bind entfernt
- config.jsonc: Brave-Icon hinzugefügt, Battery-Schwellen auf 25/15 korrigiert
- generate.py: Font Awesome Brands ergänzt, transition:none für critical-blink
- reload.sh: waybar-Start korrigiert (disown als eigene Zeile)
- install.sh: startet dunst und battery-watch nach Theme-Load neu
2026-04-22 20:56:34 +02:00

82 lines
2.8 KiB
Bash
Executable File

#!/bin/bash
set -e
PROFILE_DIR="$(cd "$(dirname "$0")" && pwd)"
PROFILE_NAME="$(basename "$PROFILE_DIR")"
echo "Installing profile: $PROFILE_NAME"
CONFIG_DIRS=(hypr waybar dunst kitty wofi gtk-3.0 gtk-4.0 wal)
# Symlink each config dir (backup real dirs first)
for dir in "${CONFIG_DIRS[@]}"; do
source="$PROFILE_DIR/config/$dir"
target="$HOME/.config/$dir"
[[ ! -d "$source" ]] && continue
if [[ -d "$target" && ! -L "$target" ]]; then
echo " backing up $target -> ${target}.bak"
mv "$target" "${target}.bak"
fi
ln -sfn "$source" "$target"
echo " linked ~/.config/$dir"
done
# Set active profile
ln -sfn "$PROFILE_DIR" "$HOME/.active_profile"
echo " active profile -> $PROFILE_NAME"
# Set default theme if none is active yet, or active theme is not from this profile
current_theme=$(readlink "$HOME/.active_theme" 2>/dev/null || echo "")
if [[ -z "$current_theme" || ! "$current_theme" == "$PROFILE_DIR/themes/"* ]]; then
default_theme=$(ls "$PROFILE_DIR/themes/" | sort | head -1)
ln -sfn "$PROFILE_DIR/themes/$default_theme" "$HOME/.active_theme"
echo " active theme -> $default_theme"
fi
# Pre-create cache symlinks immediately so Hyprland never sees them missing
# (avoids config errors if Hyprland re-reads its config during the dir swap)
mkdir -p ~/.cache/wal
[[ -f ~/.cache/wal/colors-hypr.conf ]] && ln -sf ~/.cache/wal/colors-hypr.conf ~/.config/hypr/colors.conf
[[ -f ~/.cache/wal/waybar-style.css ]] && ln -sf ~/.cache/wal/waybar-style.css ~/.config/waybar/style.css
[[ -f ~/.cache/wal/wofi-style.css ]] && ln -sf ~/.cache/wal/wofi-style.css ~/.config/wofi/style.css
# Install global scripts to ~/.local/bin
mkdir -p "$HOME/.local/bin"
for script in "$PROFILE_DIR/scripts/"*.sh; do
name=$(basename "$script")
cp "$script" "$HOME/.local/bin/${name%.sh}"
chmod +x "$HOME/.local/bin/${name%.sh}"
echo " installed ~/.local/bin/${name%.sh}"
done
# Make sure ~/.local/bin is in PATH
if ! echo "$PATH" | grep -q "$HOME/.local/bin"; then
echo ""
echo "NOTE: Add ~/.local/bin to your PATH if not already done:"
echo " echo 'export PATH=\"\$HOME/.local/bin:\$PATH\"' >> ~/.zshrc"
fi
# Load theme
echo ""
echo "Loading theme..."
~/.config/wal/reload.sh
# Restart dunst so new dunstrc and scripts take effect
pkill dunst 2>/dev/null; sleep 0.1; dunst > /dev/null 2>&1 &
disown
echo " restarted dunst"
# Start battery-watch for current session (exec-once handles future logins)
pkill -f battery-watch 2>/dev/null
~/.local/bin/battery-watch > /dev/null 2>&1 &
disown
echo " started battery-watch"
echo ""
echo "Profile '$PROFILE_NAME' installed."
echo ""
echo "To install required packages run:"
echo " sudo pacman -S \$(grep -v '^#' '$PROFILE_DIR/packages.txt' | grep -v '^\s*$' | grep -v '^#.*AUR' | tr '\n' ' ')"
echo " # AUR packages (with yay/paru): see packages.txt"