feat: Implement comprehensive theme management and fix Alacritty opacity
This commit is contained in:
@@ -25,6 +25,7 @@ for pid in waybar rofi swaync ags swaybg; do
|
||||
killall -SIGUSR1 "$pid"
|
||||
done
|
||||
|
||||
sleep 0.5 # Added sleep to ensure applications fully terminate
|
||||
|
||||
# Initialize swww if needed
|
||||
swww query || swww-daemon --format xrgb
|
||||
@@ -51,7 +52,7 @@ update_theme_mode() {
|
||||
|
||||
# Function to 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
|
||||
@@ -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=$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
|
||||
@@ -248,7 +249,9 @@ ${SCRIPTSDIR}/Refresh.sh
|
||||
|
||||
sleep 0.5
|
||||
# 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
|
||||
|
||||
|
||||
|
||||
|
||||
34
scripts/README.md
Normal file
34
scripts/README.md
Normal 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.
|
||||
Reference in New Issue
Block a user