summaryrefslogtreecommitdiff
path: root/dotfiles/hyprland/.local
diff options
context:
space:
mode:
authorCraig Jennings <c@cjennings.net>2026-01-25 23:01:47 -0600
committerCraig Jennings <c@cjennings.net>2026-01-25 23:01:47 -0600
commit717f5fe83960bd308ecff6a77c0dc3f516efad55 (patch)
tree5f884e3e42ad82204796e62c1a376e0b5fbf224c /dotfiles/hyprland/.local
parentc1195946fe6c72365310919a6250d1fdb6dd215f (diff)
feat(hyprland): add theme switching between dupre and hudson
Add two complete themes: - dupre: warm earthy colors from Emacs dupre-theme.el - hudson: Tomorrow Night + Goldenrod accent (original) Theme files cover: foot, fuzzel, waybar, dunst, hyprland borders. Add set-theme script with: - set-theme <name>: apply a theme - set-theme --toggle: switch between themes - set-theme --pick: fuzzel picker Keybindings: - $mod Y: toggle theme - $mod Shift Y: pick theme with fuzzel Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Diffstat (limited to 'dotfiles/hyprland/.local')
-rwxr-xr-xdotfiles/hyprland/.local/bin/set-theme119
1 files changed, 119 insertions, 0 deletions
diff --git a/dotfiles/hyprland/.local/bin/set-theme b/dotfiles/hyprland/.local/bin/set-theme
new file mode 100755
index 0000000..48fc8ee
--- /dev/null
+++ b/dotfiles/hyprland/.local/bin/set-theme
@@ -0,0 +1,119 @@
+#!/bin/sh
+# Theme switcher for Hyprland desktop
+# Usage: set-theme <theme-name>
+# set-theme --toggle
+# set-theme --current
+# Available themes: dupre, hudson
+
+THEME_DIR="$HOME/.config/themes"
+CURRENT_FILE="$HOME/.config/current-theme"
+
+# Get current theme
+get_current() {
+ if [ -f "$CURRENT_FILE" ]; then
+ cat "$CURRENT_FILE"
+ else
+ echo "hudson" # default
+ fi
+}
+
+# List available themes
+list_themes() {
+ for dir in "$THEME_DIR"/*/; do
+ basename "$dir"
+ done
+}
+
+# Apply a theme
+apply_theme() {
+ theme="$1"
+
+ if [ ! -d "$THEME_DIR/$theme" ]; then
+ echo "Error: Theme '$theme' not found in $THEME_DIR"
+ echo "Available themes: $(list_themes | tr '\n' ' ')"
+ exit 1
+ fi
+
+ echo "Applying theme: $theme"
+
+ # Copy configs that don't support sourcing
+ cp "$THEME_DIR/$theme/foot.ini" "$HOME/.config/foot/foot.ini"
+ cp "$THEME_DIR/$theme/fuzzel.ini" "$HOME/.config/fuzzel/fuzzel.ini"
+ cp "$THEME_DIR/$theme/waybar.css" "$HOME/.config/waybar/style.css"
+ cp "$THEME_DIR/$theme/dunstrc" "$HOME/.config/dunst/dunstrc"
+
+ # Apply Hyprland colors directly via hyprctl
+ case "$theme" in
+ dupre)
+ hyprctl keyword general:col.active_border "rgba(d7af5fff)"
+ hyprctl keyword general:col.inactive_border "rgba(474544ff)"
+ ;;
+ hudson)
+ hyprctl keyword general:col.active_border "rgba(daa520ff)"
+ hyprctl keyword general:col.inactive_border "rgba(444444ff)"
+ ;;
+ esac
+
+ # Save current theme
+ echo "$theme" > "$CURRENT_FILE"
+
+ # Reload applications
+ killall -SIGUSR2 waybar 2>/dev/null
+ pkill dunst && dunst &
+
+ # Notify user
+ notify-send "Theme" "Switched to $theme" -t 2000
+
+ echo "Theme '$theme' applied. Open new terminals to see changes."
+}
+
+# Toggle between themes
+toggle_theme() {
+ current=$(get_current)
+ case "$current" in
+ dupre) apply_theme "hudson" ;;
+ hudson) apply_theme "dupre" ;;
+ *) apply_theme "dupre" ;;
+ esac
+}
+
+# Show picker with fuzzel
+pick_theme() {
+ themes=$(list_themes)
+ current=$(get_current)
+ selected=$(echo "$themes" | fuzzel --dmenu --prompt "Theme (current: $current): ")
+ if [ -n "$selected" ]; then
+ apply_theme "$selected"
+ fi
+}
+
+# Main
+case "$1" in
+ --toggle|-t)
+ toggle_theme
+ ;;
+ --current|-c)
+ get_current
+ ;;
+ --list|-l)
+ list_themes
+ ;;
+ --pick|-p)
+ pick_theme
+ ;;
+ --help|-h)
+ echo "Usage: set-theme <theme-name>"
+ echo " set-theme --toggle Toggle between themes"
+ echo " set-theme --current Show current theme"
+ echo " set-theme --list List available themes"
+ echo " set-theme --pick Pick theme with fuzzel"
+ echo ""
+ echo "Available themes: $(list_themes | tr '\n' ' ')"
+ ;;
+ "")
+ pick_theme
+ ;;
+ *)
+ apply_theme "$1"
+ ;;
+esac