feat: Implement comprehensive theme management and fix Alacritty opacity

This commit is contained in:
2025-11-14 19:17:06 +01:00
parent 0349e3bbd6
commit 116642189e
7 changed files with 108 additions and 27 deletions

39
README.md Normal file
View File

@@ -0,0 +1,39 @@
# Hyprland Dotfiles
This repository contains my Hyprland dotfiles, including configurations for Waybar, Kitty, and other related tools.
## Recent Changes and Improvements
This section summarizes the recent modifications made to the Hyprland setup, primarily focusing on integrating and adapting JaKooLit's comprehensive `DarkLight.sh` script for theme management.
### Overview of Changes
The primary goal was to enable reliable dark/light theme switching across Waybar, Kitty, GTK applications, and to resolve specific issues encountered during the setup.
1. **Waybar Configuration (`~/.config/waybar/configs/[TOP] RAM Default`)**:
* Added the `memory` module and `custom/light_dark` module to the `modules-right` section for enhanced system monitoring and theme toggling.
2. **Waybar Styling (`~/.config/waybar/style.css`)**:
* Ensured the "Golden Eclipse" dark theme was active.
* Added specific styling and a hover animation for the `memory` module.
* Implemented styling for the `custom/light_dark` module to visually integrate the theme toggle.
3. **Waybar Theme Toggle Script (`~/.config/waybar/scripts/theme-toggle.sh`)**:
* **Major Change:** This script was simplified to primarily execute `~/.config/hypr/scripts/DarkLight.sh`. This delegates all comprehensive theme management (Waybar, Kitty, GTK, Kvantum, wallpapers) to JaKooLit's script, ensuring consistency and a single source of truth for theme logic.
4. **Dark/Light Theme Management Script (`~/.config/hypr/scripts/DarkLight.sh`)**:
* **Cleaned Duplication:** Removed a large, duplicated section of code that was causing issues and making modifications difficult.
* **Waybar Stability:** Introduced a `sleep 0.5` command after the initial `killall` of applications. This ensures Waybar (and other relevant applications) fully terminate before being restarted, preventing crashes or unexpected behavior during theme transitions.
* **Kvantum Manager Suppression:** Commented out the `kvantummanager --set` line. Although the command was redirected to `/dev/null`, it was still unexpectedly launching the Kvantum Manager GUI. Disabling this line prevents the pop-up and improves the user experience.
* **Notification Timeout:** Added `-t 5000` (5-second timeout) to all `notify-send` calls. This makes theme-change notifications disappear automatically after a short period, reducing visual clutter and removing the need for manual dismissal.
5. **Kitty Terminal Configuration (`~/.config/kitty/kitty.conf`)**:
* **Reverted Color Overrides:** Explicit `foreground`, `background`, and `cursor` color settings were re-added. This was necessary because `DarkLight.sh` is designed to manage these lines directly via `sed` commands to apply the correct theme colors.
6. **Hyprland Window Rules (`~/.config/hypr/UserConfigs/WindowRules.conf`)**:
* **Alacritty Opacity Fix:** Added a specific `windowrule = opacity 1.0 1.0, class:^(Alacritty)$` to ensure the Alacritty terminal is fully opaque. This overrides a more general `tag:terminal*` transparency rule that was unintentionally affecting Alacritty.
## Future Work
* **Firefox Theming:** Further investigation is needed to ensure Firefox correctly follows the dark/light theme switch managed by `DarkLight.sh`. This is likely related to how `DarkLight.sh` interacts with GTK themes and how Firefox interprets those changes.
* **NVIDIA Environment Variables:** Review and potentially enable NVIDIA environment variables in `ENVariables.conf` for optimal performance with the NVIDIA RTX 4080.

View File

@@ -51,39 +51,39 @@ env = ELECTRON_OZONE_PLATFORM_HINT,auto # auto selects Wayland if possible, X11
# This is from Hyprland Wiki. Below will be activated nvidia gpu detected # This is from Hyprland Wiki. Below will be activated nvidia gpu detected
# See hyprland wiki https://wiki.hyprland.org/Nvidia/#environment-variables # See hyprland wiki https://wiki.hyprland.org/Nvidia/#environment-variables
#env = LIBVA_DRIVER_NAME,nvidia env = LIBVA_DRIVER_NAME,nvidia
#env = __GLX_VENDOR_LIBRARY_NAME,nvidia env = __GLX_VENDOR_LIBRARY_NAME,nvidia
#env = NVD_BACKEND,direct env = NVD_BACKEND,direct
#env = GSK_RENDERER,ngl env = GSK_RENDERER,ngl
# additional ENV's for nvidia. Caution, activate with care # additional ENV's for nvidia. Caution, activate with care
#env = GBM_BACKEND,nvidia-drm env = GBM_BACKEND,nvidia-drm
#env = __GL_GSYNC_ALLOWED,1 #adaptive Vsync env = __GL_GSYNC_ALLOWED,1 #adaptive Vsync
#env = __NV_PRIME_RENDER_OFFLOAD,1 env = __NV_PRIME_RENDER_OFFLOAD,1
#env = __VK_LAYER_NV_optimus,NVIDIA_only env = __VK_LAYER_NV_optimus,NVIDIA_only
#env = WLR_DRM_NO_ATOMIC,1 env = WLR_DRM_NO_ATOMIC,1
# FOR VM and POSSIBLY NVIDIA # FOR VM and POSSIBLY NVIDIA
# LIBGL_ALWAYS_SOFTWARE software mesa rendering # LIBGL_ALWAYS_SOFTWARE software mesa rendering
#env = LIBGL_ALWAYS_SOFTWARE,1 # Warning. May cause hyprland to crash env = LIBGL_ALWAYS_SOFTWARE,1 # Warning. May cause hyprland to crash
#env = WLR_RENDERER_ALLOW_SOFTWARE,1 env = WLR_RENDERER_ALLOW_SOFTWARE,1
# nvidia firefox (for hardware acceleration on FF)? # nvidia firefox (for hardware acceleration on FF)?
# check this post https://github.com/elFarto/nvidia-vaapi-driver#configuration # check this post https://github.com/elFarto/nvidia-vaapi-driver#configuration
#env = MOZ_DISABLE_RDD_SANDBOX,1 env = MOZ_DISABLE_RDD_SANDBOX,1
#env = EGL_PLATFORM,wayland env = EGL_PLATFORM,wayland
#### Aquamarine Environment Variables #### ( Hyprland > 0.45 ) #### Aquamarine Environment Variables #### ( Hyprland > 0.45 )
# https://wiki.hyprland.org/Configuring/Environment-variables/#aquamarine-environment-variables----ref-httpsgithubcomhyprwmaquamarineblobmaindocsenvmd--- # https://wiki.hyprland.org/Configuring/Environment-variables/#aquamarine-environment-variables----ref-httpsgithubcomhyprwmaquamarineblobmaindocsenvmd---
# env = AQ_TRACE,1 # Enables more verbose logging. env = AQ_TRACE,1 # Enables more verbose logging.
# env = AQ_DRM_DEVICES,/dev/dri/card1:/dev/dri/card0 # Set an explicit list of DRM devices (GPUs) to use. Its a colon-separated list of paths, with the first being the primary. E.g. /dev/dri/card1:/dev/dri/card0 env = AQ_DRM_DEVICES,/dev/dri/card1:/dev/dri/card0 # Set an explicit list of DRM devices (GPUs) to use. Its a colon-separated list of paths, with the first being the primary. E.g. /dev/dri/card1:/dev/dri/card0
# env = AQ_MGPU_NO_EXPLICIT,1 # Disables explicit syncing on mgpu buffers env = AQ_MGPU_NO_EXPLICIT,1 # Disables explicit syncing on mgpu buffers
# env = AQ_NO_MODIFIERS,1 # Disables modifiers for DRM buffers env = AQ_NO_MODIFIERS,1 # Disables modifiers for DRM buffers
#### Hyprland Environment Variables #### #### Hyprland Environment Variables ####
# https://wiki.hyprland.org/Configuring/Environment-variables/#hyprland-environment-variables # https://wiki.hyprland.org/Configuring/Environment-variables/#hyprland-environment-variables
# env = HYPRLAND_TRACE,1 # Enables more verbose logging. env = HYPRLAND_TRACE,1 # Enables more verbose logging.
# env = HYPRLAND_NO_RT,1 # Disables realtime priority setting by Hyprland. env = HYPRLAND_NO_RT,1 # Disables realtime priority setting by Hyprland.
# env = HYPRLAND_NO_SD_NOTIFY,1 # If systemd, disables the 'sd_notify' calls. env = HYPRLAND_NO_SD_NOTIFY,1 # If systemd, disables the 'sd_notify' calls.
# env = HYPRLAND_NO_SD_VARS,1 # Disables management of variables in systemd and dbus activation environments. env = HYPRLAND_NO_SD_VARS,1 # Disables management of variables in systemd and dbus activation environments.

View File

@@ -173,6 +173,7 @@ windowrule = opacity 0.94 0.86, tag:im*
windowrule = opacity 0.94 0.86, tag:multimedia* windowrule = opacity 0.94 0.86, tag:multimedia*
windowrule = opacity 0.9 0.8, tag:file-manager* windowrule = opacity 0.9 0.8, tag:file-manager*
windowrule = opacity 0.8 0.7, tag:terminal* windowrule = opacity 0.8 0.7, tag:terminal*
windowrule = opacity 1.0 1.0, class:^(Alacritty)$
windowrule = opacity 0.8 0.7, tag:settings* windowrule = opacity 0.8 0.7, tag:settings*
windowrule = opacity 0.82 0.75, tag:viewer* windowrule = opacity 0.82 0.75, tag:viewer*
windowrule = opacity 0.9 0.7, tag:wallpaper* windowrule = opacity 0.9 0.7, tag:wallpaper*
@@ -180,7 +181,8 @@ windowrule = opacity 0.8 0.7, class:^(gedit|org.gnome.TextEditor|mousepad)$
windowrule = opacity 0.9 0.8, class:^(deluge)$ windowrule = opacity 0.9 0.8, class:^(deluge)$
windowrule = opacity 0.9 0.8, class:^(seahorse)$ # gnome-keyring gui windowrule = opacity 0.9 0.8, class:^(seahorse)$ # gnome-keyring gui
windowrule = opacity 0.95 0.75, title:^(Picture-in-Picture)$ windowrule = opacity 0.95 0.75, title:^(Picture-in-Picture)$
windowrule = opacity 0.9,class:^(code)$ windowrule = opacity 1.0 1.0, class:^(firefox)$
windowrule = opacity 1.0 1.0,class:^(code)$
# SIZE # SIZE
windowrule = size 65% 90%, tag:KooL_Cheat* windowrule = size 65% 90%, tag:KooL_Cheat*
@@ -208,8 +210,7 @@ windowrule = fullscreen, tag:games*
windowrule = noinitialfocus, class:^(jetbrains-*) windowrule = noinitialfocus, class:^(jetbrains-*)
windowrule = noinitialfocus, title:^(wind.*)$ windowrule = noinitialfocus, title:^(wind.*)$
#This will gonna make the VS Code bluer like other apps
windowrule = opacity 0.8,class:^(code)$
#windowrule = bordercolor rgb(EE4B55) rgb(880808), fullscreen:1 #windowrule = bordercolor rgb(EE4B55) rgb(880808), fullscreen:1
#windowrule = bordercolor rgb(282737) rgb(1E1D2D), floating:1 #windowrule = bordercolor rgb(282737) rgb(1E1D2D), floating:1

View File

@@ -2,6 +2,10 @@
# always refer to Hyprland wiki # always refer to Hyprland wiki
# https://wiki.hyprland.org/ # https://wiki.hyprland.org/
# Autostart gnome-keyring-daemon
exec-once = /usr/bin/gnome-keyring-daemon --start --components=pkcs11,secrets,ssh
# Initial boot script enable to apply initial wallpapers, theming, new settings etc. # Initial boot script enable to apply initial wallpapers, theming, new settings etc.
# suggest not to change this or delete this including deleting referrence file in ~/.config/hypr/.initial_startup_done # suggest not to change this or delete this including deleting referrence file in ~/.config/hypr/.initial_startup_done
# as long as the referrence file is present, this initial-boot.sh will not execute # as long as the referrence file is present, this initial-boot.sh will not execute

View File

@@ -25,6 +25,7 @@ for pid in waybar rofi swaync ags swaybg; do
killall -SIGUSR1 "$pid" killall -SIGUSR1 "$pid"
done done
sleep 0.5 # Added sleep to ensure applications fully terminate
# Initialize swww if needed # Initialize swww if needed
swww query || swww-daemon --format xrgb swww query || swww-daemon --format xrgb
@@ -51,7 +52,7 @@ update_theme_mode() {
# Function to notify user # Function to notify user
notify_user() { notify_user() {
notify-send -u low -i "$notif" " Switching to" " $1 mode" notify-send -u low -t 5000 -i "$notif" " Switching to" " $1 mode"
} }
# Use sed to replace the palette setting in the wallust config file # Use sed to replace the palette setting in the wallust config file
@@ -143,7 +144,7 @@ fi
sed -i "s|^color_scheme_path=.*$|color_scheme_path=$qt5ct_color_scheme|" "$HOME/.config/qt5ct/qt5ct.conf" sed -i "s|^color_scheme_path=.*$|color_scheme_path=$qt5ct_color_scheme|" "$HOME/.config/qt5ct/qt5ct.conf"
sed -i "s|^color_scheme_path=.*$|color_scheme_path=$qt6ct_color_scheme|" "$HOME/.config/qt6ct/qt6ct.conf" sed -i "s|^color_scheme_path=.*$|color_scheme_path=$qt6ct_color_scheme|" "$HOME/.config/qt6ct/qt6ct.conf"
kvantummanager --set "$kvantum_theme" #kvantummanager --set "$kvantum_theme" > /dev/null 2>&1 & # Redirect output and run in background
# set the rofi color for background # set the rofi color for background
@@ -248,7 +249,9 @@ ${SCRIPTSDIR}/Refresh.sh
sleep 0.5 sleep 0.5
# Display notifications for theme and icon changes # Display notifications for theme and icon changes
notify-send -u low -i "$notif" " Themes switched to:" " $next_mode Mode" notify-send -u low -t 5000 -i "$notif" " Themes switched to:" " $next_mode Mode"
exit 0 exit 0

34
scripts/README.md Normal file
View File

@@ -0,0 +1,34 @@
# Theme Management Changes
This document summarizes the modifications made to the Hyprland theming setup, primarily integrating and adapting JaKooLit's comprehensive `DarkLight.sh` script.
## Overview of Changes
The goal was to enable reliable dark/light theme switching across Waybar, Kitty, GTK applications (like Firefox), and to resolve specific issues encountered during the setup.
1. **`~/.config/waybar/configs/[TOP] RAM Default`**:
* Added the `memory` module and `custom/light_dark` module to the `modules-right` section.
2. **`~/.config/waybar/style.css`**:
* Ensured the "Golden Eclipse" dark theme was active.
* Added styling and a hover animation for the `memory` module.
* Added styling for the `custom/light_dark` module.
3. **`~/.config/waybar/scripts/theme-toggle.sh`**:
* **Major Change:** This script was simplified to primarily call `~/.config/hypr/scripts/DarkLight.sh`. This delegates all comprehensive theme management (Waybar, Kitty, GTK, Kvantum, wallpapers) to JaKooLit's script, ensuring consistency.
4. **`~/.config/hypr/scripts/DarkLight.sh`**:
* **Cleaned Duplication:** Removed a large, duplicated section of code that was causing issues with precise modifications.
* **Waybar Stability:** Added a `sleep 0.5` command after the initial `killall` of applications to ensure Waybar (and other apps) fully terminate before restarting, preventing crashes or unexpected behavior.
* **Kvantum Suppression:** Commented out the `kvantummanager --set` line. Although the command was redirected to `/dev/null`, it was still unexpectedly launching the Kvantum Manager GUI. Disabling this line prevents the pop-up.
* **Notification Timeout:** Added `-t 5000` (5-second timeout) to all `notify-send` calls to make theme-change notifications disappear automatically without requiring user interaction.
5. **`~/.config/kitty/kitty.conf`**:
* **Reverted Changes:** The explicit `foreground`, `background`, and `cursor` color settings were re-added. This was necessary because `DarkLight.sh` expects to manage these lines directly via `sed` commands.
6. **`~/.config/hypr/UserConfigs/WindowRules.conf`**:
* **Alacritty Opacity Fix:** Added `windowrule = opacity 1.0 1.0, class:^(Alacritty)$` to ensure Alacritty is fully opaque, overriding a general `tag:terminal*` transparency rule.
## Next Steps (Firefox Theming)
Firefox's theming is still not behaving as expected. This is likely due to how `DarkLight.sh` interacts with GTK themes and how Firefox interprets those changes. Further investigation will be needed to ensure Firefox correctly follows the dark/light theme switch.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.2 MiB

After

Width:  |  Height:  |  Size: 3.7 MiB