mirror of
https://github.com/eRgo35/dots.git
synced 2025-12-16 15:36:11 +01:00
feat: light dark theming
This commit is contained in:
@@ -9,5 +9,6 @@
|
|||||||
"height": 1378
|
"height": 1378
|
||||||
},
|
},
|
||||||
"SKIP_HOST_UPDATE": true,
|
"SKIP_HOST_UPDATE": true,
|
||||||
"BACKGROUND_COLOR": "#000000"
|
"BACKGROUND_COLOR": "#000000",
|
||||||
|
"offloadAdmControls": false
|
||||||
}
|
}
|
||||||
@@ -73,3 +73,4 @@ end
|
|||||||
|
|
||||||
# Created by `pipx` on 2025-06-04 15:36:28
|
# Created by `pipx` on 2025-06-04 15:36:28
|
||||||
set PATH $PATH /home/mike/.local/bin
|
set PATH $PATH /home/mike/.local/bin
|
||||||
|
[ -f "$HOME/.theme_env" ] && source "$HOME/.theme_env"
|
||||||
|
|||||||
@@ -1,17 +1,4 @@
|
|||||||
[Settings]
|
[Settings]
|
||||||
|
gtk-application-prefer-dark-theme=true
|
||||||
gtk-theme-name=Rosepine-Dark
|
gtk-theme-name=Rosepine-Dark
|
||||||
gtk-icon-theme-name=Papirus-Dark
|
gtk-icon-theme-name=Papirus-Dark
|
||||||
gtk-font-name=Cantarell 11
|
|
||||||
gtk-cursor-theme-name=elementary
|
|
||||||
gtk-cursor-theme-size=24
|
|
||||||
gtk-toolbar-style=GTK_TOOLBAR_ICONS
|
|
||||||
gtk-toolbar-icon-size=GTK_ICON_SIZE_LARGE_TOOLBAR
|
|
||||||
gtk-button-images=0
|
|
||||||
gtk-menu-images=0
|
|
||||||
gtk-enable-event-sounds=1
|
|
||||||
gtk-enable-input-feedback-sounds=0
|
|
||||||
gtk-xft-antialias=1
|
|
||||||
gtk-xft-hinting=1
|
|
||||||
gtk-xft-hintstyle=hintslight
|
|
||||||
gtk-xft-rgba=rgb
|
|
||||||
gtk-application-prefer-dark-theme=1
|
|
||||||
|
|||||||
@@ -1,7 +1,4 @@
|
|||||||
[Settings]
|
[Settings]
|
||||||
|
gtk-application-prefer-dark-theme=true
|
||||||
gtk-theme-name=Rosepine-Dark
|
gtk-theme-name=Rosepine-Dark
|
||||||
gtk-icon-theme-name=Papirus-Dark
|
gtk-icon-theme-name=Papirus-Dark
|
||||||
gtk-font-name=Cantarell 11
|
|
||||||
gtk-cursor-theme-name=elementary
|
|
||||||
gtk-cursor-theme-size=24
|
|
||||||
gtk-application-prefer-dark-theme=1
|
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
[Appearance]
|
[Appearance]
|
||||||
color_scheme_path=/usr/share/qt5ct/colors/airy.conf
|
color_scheme_path=/home/mike/.config/qt5ct/colors/rose-pine.conf
|
||||||
custom_palette=false
|
custom_palette=true
|
||||||
icon_theme=Papirus-Light
|
icon_theme=Papirus-Light
|
||||||
standard_dialogs=default
|
standard_dialogs=default
|
||||||
style=rose-pine
|
style=Windows
|
||||||
|
|
||||||
[Fonts]
|
[Fonts]
|
||||||
fixed="Noto Sans,10,-1,5,50,0,0,0,0,0,Regular"
|
fixed="Noto Sans,10,-1,5,50,0,0,0,0,0,Regular"
|
||||||
@@ -25,7 +25,7 @@ underline_shortcut=1
|
|||||||
wheel_scroll_lines=3
|
wheel_scroll_lines=3
|
||||||
|
|
||||||
[SettingsWindow]
|
[SettingsWindow]
|
||||||
geometry=@ByteArray(\x1\xd9\xd0\xcb\0\x3\0\0\0\0\r\x1\0\0\0\x34\0\0\x11`\0\0\x2\xda\0\0\r\x2\0\0\0\x35\0\0\x11_\0\0\x2\xd9\0\0\0\0\0\0\0\0\n\0\0\0\r\x2\0\0\0\x35\0\0\x11_\0\0\x2\xd9)
|
geometry=@ByteArray(\x1\xd9\xd0\xcb\0\x3\0\0\0\0\a\x9e\0\0\0\x34\0\0\x11\x61\0\0\x5\x95\0\0\a\x9e\0\0\0\x34\0\0\x11\x61\0\0\x5\x95\0\0\0\0\0\0\0\0\n\0\0\0\a\x9e\0\0\0\x34\0\0\x11\x61\0\0\x5\x95)
|
||||||
|
|
||||||
[Troubleshooting]
|
[Troubleshooting]
|
||||||
force_raster_widgets=1
|
force_raster_widgets=1
|
||||||
|
|||||||
@@ -133,3 +133,4 @@
|
|||||||
margin: 0px 0.3em 0em 0em;
|
margin: 0px 0.3em 0em 0em;
|
||||||
text-color: @grn;
|
text-color: @grn;
|
||||||
}
|
}
|
||||||
|
@theme "rose-pine"
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
[location]
|
[location]
|
||||||
lat = 50.15
|
lat = 50.27
|
||||||
lon = 18.82
|
lon = 19.04
|
||||||
|
|
||||||
[setter]
|
[setter]
|
||||||
# command = ['feh', '--bg-fill', '%f']
|
command = ['feh', '--bg-fill', '%f']
|
||||||
command = ['swww', 'img', '%f']
|
# command = ['swww', 'img', '%f']
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ config.keys = {
|
|||||||
local theme = wezterm.plugin.require('https://github.com/neapsix/wezterm').main
|
local theme = wezterm.plugin.require('https://github.com/neapsix/wezterm').main
|
||||||
|
|
||||||
-- This is where you actually apply your config choices
|
-- This is where you actually apply your config choices
|
||||||
-- config.color_scheme = "rose-pine"
|
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- config.color_scheme = "rose-pine" -- Using custom Rose Pine theme
|
||||||
-- the font is named 'Source Code Pro ExtraLight', but I actually use the DemiBold weight. looks awesome
|
-- the font is named 'Source Code Pro ExtraLight', but I actually use the DemiBold weight. looks awesome
|
||||||
config.font = wezterm.font('Hack Nerd Font')
|
config.font = wezterm.font('Hack Nerd Font')
|
||||||
config.colors = theme.colors()
|
config.colors = theme.colors()
|
||||||
|
|||||||
197
.local/bin/dark
197
.local/bin/dark
@@ -1,7 +1,8 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
# Set theme environment variable
|
# Set theme environment variable for current session and future sessions
|
||||||
export THEME="dark"
|
export THEME="dark"
|
||||||
|
echo "export THEME=dark" > "$HOME/.theme_env"
|
||||||
|
|
||||||
# Update GTK theme using gsettings (more reliable)
|
# Update GTK theme using gsettings (more reliable)
|
||||||
if command -v gsettings >/dev/null 2>&1; then
|
if command -v gsettings >/dev/null 2>&1; then
|
||||||
@@ -38,42 +39,153 @@ EOF
|
|||||||
# Update Qt6 theme using qt6ct
|
# Update Qt6 theme using qt6ct
|
||||||
if command -v qt6ct >/dev/null 2>&1; then
|
if command -v qt6ct >/dev/null 2>&1; then
|
||||||
export QT_QPA_PLATFORMTHEME=qt6ct
|
export QT_QPA_PLATFORMTHEME=qt6ct
|
||||||
mkdir -p "$HOME/.config/qt6ct"
|
mkdir -p "$HOME/.config/qt6ct/colors"
|
||||||
if [ -f "$HOME/.config/qt6ct/qt6ct.conf" ]; then
|
if [ -f "$HOME/.config/qt6ct/qt6ct.conf" ]; then
|
||||||
sed -i 's/^style=.*/style=rose-pine/' "$HOME/.config/qt6ct/qt6ct.conf"
|
sed -i 's/^color_scheme_path=.*/color_scheme_path=\/home\/mike\/.config\/qt6ct\/colors\/rose-pine.conf/' "$HOME/.config/qt6ct/qt6ct.conf"
|
||||||
sed -i 's/^color_scheme=.*/color_scheme=rose-pine/' "$HOME/.config/qt6ct/qt6ct.conf"
|
sed -i 's/^color_scheme=.*/color_scheme=rose-pine/' "$HOME/.config/qt6ct/qt6ct.conf"
|
||||||
|
else
|
||||||
|
# Create basic qt6ct config if it doesn't exist
|
||||||
|
cat > "$HOME/.config/qt6ct/qt6ct.conf" << EOF
|
||||||
|
[Appearance]
|
||||||
|
color_scheme_path=/home/mike/.config/qt6ct/colors/rose-pine.conf
|
||||||
|
color_scheme=rose-pine
|
||||||
|
custom_palette=true
|
||||||
|
standard_dialogs=default
|
||||||
|
style=Fusion
|
||||||
|
|
||||||
|
[Fonts]
|
||||||
|
fixed=@Variant(\0\0\0@\0\0\0\x12\0M\0o\0n\0o\0s\0p\0\x61\0\x63\0\x65@\"\0\0\0\0\0\0\xff\xff\xff\xff\x5\x1\0\x32\x10)
|
||||||
|
general=@Variant(\0\0\0@\0\0\0\x12\0U\0\x62\0u\0n\0t\0u@\"\0\0\0\0\0\0\xff\xff\xff\xff\x5\x1\0\x32\x10)
|
||||||
|
|
||||||
|
[Interface]
|
||||||
|
activate_item_on_single_click=1
|
||||||
|
buttonbox_layout=0
|
||||||
|
cursor_flash_time=1000
|
||||||
|
dialog_buttons_have_icons=1
|
||||||
|
double_click_interval=400
|
||||||
|
gui_effects=@Invalid()
|
||||||
|
keyboard_scheme=2
|
||||||
|
menus_have_icons=true
|
||||||
|
show_shortcuts_in_context_menus=true
|
||||||
|
stylesheets=@Invalid()
|
||||||
|
toolbutton_style=4
|
||||||
|
underline_shortcut=1
|
||||||
|
wheel_scroll_lines=3
|
||||||
|
|
||||||
|
[SettingsWindow]
|
||||||
|
geometry=@ByteArray()
|
||||||
|
EOF
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Update Qt5 theme using qt5ct
|
# Update Qt5 theme using qt5ct
|
||||||
if command -v qt5ct >/dev/null 2>&1; then
|
if command -v qt5ct >/dev/null 2>&1; then
|
||||||
export QT_QPA_PLATFORMTHEME=qt5ct
|
export QT_QPA_PLATFORMTHEME=qt5ct
|
||||||
mkdir -p "$HOME/.config/qt5ct"
|
mkdir -p "$HOME/.config/qt5ct/colors"
|
||||||
if [ -f "$HOME/.config/qt5ct/qt5ct.conf" ]; then
|
if [ -f "$HOME/.config/qt5ct/qt5ct.conf" ]; then
|
||||||
sed -i 's/^style=.*/style=rose-pine/' "$HOME/.config/qt5ct/qt5ct.conf"
|
sed -i 's/^color_scheme_path=.*/color_scheme_path=\/home\/mike\/.config\/qt5ct\/colors\/rose-pine.conf/' "$HOME/.config/qt5ct/qt5ct.conf"
|
||||||
sed -i 's/^color_scheme=.*/color_scheme=rose-pine/' "$HOME/.config/qt5ct/qt5ct.conf"
|
sed -i 's/^color_scheme=.*/color_scheme=rose-pine/' "$HOME/.config/qt5ct/qt5ct.conf"
|
||||||
|
else
|
||||||
|
# Create basic qt5ct config if it doesn't exist
|
||||||
|
cat > "$HOME/.config/qt5ct/qt5ct.conf" << EOF
|
||||||
|
[Appearance]
|
||||||
|
color_scheme_path=/home/mike/.config/qt5ct/colors/rose-pine.conf
|
||||||
|
color_scheme=rose-pine
|
||||||
|
custom_palette=true
|
||||||
|
standard_dialogs=default
|
||||||
|
style=Fusion
|
||||||
|
|
||||||
|
[Fonts]
|
||||||
|
fixed=@Variant(\0\0\0@\0\0\0\x12\0M\0o\0n\0o\0s\0p\0\x61\0\x63\0\x65@\"\0\0\0\0\0\0\xff\xff\xff\xff\x5\x1\0\x32\x10)
|
||||||
|
general=@Variant(\0\0\0@\0\0\0\x12\0U\0\x62\0u\0n\0t\0u@\"\0\0\0\0\0\0\xff\xff\xff\xff\x5\x1\0\x32\x10)
|
||||||
|
|
||||||
|
[Interface]
|
||||||
|
activate_item_on_single_click=1
|
||||||
|
buttonbox_layout=0
|
||||||
|
cursor_flash_time=1000
|
||||||
|
dialog_buttons_have_icons=1
|
||||||
|
double_click_interval=400
|
||||||
|
gui_effects=@Invalid()
|
||||||
|
keyboard_scheme=2
|
||||||
|
menus_have_icons=true
|
||||||
|
show_shortcuts_in_context_menus=true
|
||||||
|
stylesheets=@Invalid()
|
||||||
|
toolbutton_style=4
|
||||||
|
underline_shortcut=1
|
||||||
|
wheel_scroll_lines=3
|
||||||
|
|
||||||
|
[SettingsWindow]
|
||||||
|
geometry=@ByteArray()
|
||||||
|
EOF
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Update Rofi theme
|
# Update Rofi theme
|
||||||
|
mkdir -p "$HOME/.config/rofi"
|
||||||
if [ -f "$HOME/.config/rofi/config.rasi" ]; then
|
if [ -f "$HOME/.config/rofi/config.rasi" ]; then
|
||||||
sed -i 's/@theme ".*"/@theme "rose-pine"/' "$HOME/.config/rofi/config.rasi"
|
# Update existing config.rasi
|
||||||
elif [ -f "$HOME/.config/rofi/config" ]; then
|
if grep -q "@theme" "$HOME/.config/rofi/config.rasi"; then
|
||||||
sed -i 's/rofi.theme:.*/rofi.theme: rose-pine/' "$HOME/.config/rofi/config"
|
sed -i 's/@theme ".*"/@theme "rose-pine"/' "$HOME/.config/rofi/config.rasi"
|
||||||
|
else
|
||||||
|
echo '@theme "rose-pine"' >> "$HOME/.config/rofi/config.rasi"
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
# Create new config.rasi with Rose Pine (dark) theme
|
||||||
|
cat > "$HOME/.config/rofi/config.rasi" << EOF
|
||||||
|
configuration {
|
||||||
|
modi: "drun,run,window";
|
||||||
|
show-icons: true;
|
||||||
|
icon-theme: "Papirus-Dark";
|
||||||
|
display-drun: "";
|
||||||
|
display-run: "";
|
||||||
|
display-window: "";
|
||||||
|
drun-display-format: "{name}";
|
||||||
|
disable-history: false;
|
||||||
|
hide-scrollbar: true;
|
||||||
|
sidebar-mode: false;
|
||||||
|
}
|
||||||
|
|
||||||
|
@theme "rose-pine"
|
||||||
|
EOF
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Update Wezterm theme
|
# Update Wezterm theme
|
||||||
if [ -f "$HOME/.config/wezterm/wezterm.lua" ]; then
|
if [ -f "$HOME/.config/wezterm/wezterm.lua" ]; then
|
||||||
sed -i 's/config.color_scheme = .*/config.color_scheme = "rose-pine"/' "$HOME/.config/wezterm/wezterm.lua"
|
# Update Rose Pine theme variant to main (dark)
|
||||||
|
sed -i "s/local theme = wezterm\.plugin\.require('https:\/\/github\.com\/neapsix\/wezterm')\.\(main\|moon\|dawn\)/local theme = wezterm.plugin.require('https:\/\/github.com\/neapsix\/wezterm').main/" "$HOME/.config/wezterm/wezterm.lua"
|
||||||
|
# Also handle manual require statements
|
||||||
|
sed -i "s/local theme = require('lua\/rose-pine')\.\(main\|moon\|dawn\)/local theme = require('lua\/rose-pine').main/" "$HOME/.config/wezterm/wezterm.lua"
|
||||||
|
# Fallback for older color_scheme format
|
||||||
|
sed -i 's/config.color_scheme = .*/-- config.color_scheme = "rose-pine" -- Using custom Rose Pine theme/' "$HOME/.config/wezterm/wezterm.lua"
|
||||||
elif [ -f "$HOME/.wezterm.lua" ]; then
|
elif [ -f "$HOME/.wezterm.lua" ]; then
|
||||||
sed -i 's/config.color_scheme = .*/config.color_scheme = "rose-pine"/' "$HOME/.wezterm.lua"
|
# Update Rose Pine theme variant to main (dark)
|
||||||
|
sed -i "s/local theme = wezterm\.plugin\.require('https:\/\/github\.com\/neapsix\/wezterm')\.\(main\|moon\|dawn\)/local theme = wezterm.plugin.require('https:\/\/github.com\/neapsix\/wezterm').main/" "$HOME/.wezterm.lua"
|
||||||
|
# Also handle manual require statements
|
||||||
|
sed -i "s/local theme = require('lua\/rose-pine')\.\(main\|moon\|dawn\)/local theme = require('lua\/rose-pine').main/" "$HOME/.wezterm.lua"
|
||||||
|
# Fallback for older color_scheme format
|
||||||
|
sed -i 's/config.color_scheme = .*/-- config.color_scheme = "rose-pine" -- Using custom Rose Pine theme/' "$HOME/.wezterm.lua"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Set environment variables for current session
|
# Set environment variables for current session
|
||||||
|
export THEME="dark"
|
||||||
export GTK_THEME="Rosepine-Dark:dark"
|
export GTK_THEME="Rosepine-Dark:dark"
|
||||||
|
|
||||||
# Reload applications that support theme changes
|
# Create theme indicator file for bar.sh to detect
|
||||||
pkill -USR1 wezterm >/dev/null 2>&1 || true
|
echo "dark" > "$HOME/.current_theme"
|
||||||
|
|
||||||
|
# Verify the file was written
|
||||||
|
if [ "$(cat "$HOME/.current_theme")" = "dark" ]; then
|
||||||
|
echo "✓ Theme file updated to 'dark'"
|
||||||
|
else
|
||||||
|
echo "✗ Failed to update theme file"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Check if bar is running
|
||||||
|
if pgrep -f "bar.sh" > /dev/null; then
|
||||||
|
echo "✓ Bar is running - theme should update immediately"
|
||||||
|
else
|
||||||
|
echo "⚠ Bar is not running - start it with: ~/repos/dwm/bar.sh"
|
||||||
|
fi
|
||||||
|
|
||||||
# Try to reload GTK applications via xsettingsd if available
|
# Try to reload GTK applications via xsettingsd if available
|
||||||
if command -v xsettingsd >/dev/null 2>&1; then
|
if command -v xsettingsd >/dev/null 2>&1; then
|
||||||
@@ -85,5 +197,66 @@ if pgrep -x "gnome-session" >/dev/null; then
|
|||||||
dbus-send --session --type=method_call --dest=org.gnome.SettingsDaemon.Color /org/gnome/SettingsDaemon/Color org.gnome.SettingsDaemon.Color.ApplySettings >/dev/null 2>&1 || true
|
dbus-send --session --type=method_call --dest=org.gnome.SettingsDaemon.Color /org/gnome/SettingsDaemon/Color org.gnome.SettingsDaemon.Color.ApplySettings >/dev/null 2>&1 || true
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Update theme state file for bar.sh
|
||||||
|
echo "dark" > "$HOME/.current_theme"
|
||||||
|
|
||||||
|
# Load dark theme Xresources and reload dwm colors
|
||||||
|
if [ -f "$HOME/.Xresources.dark" ]; then
|
||||||
|
echo "Loading dark theme Xresources..."
|
||||||
|
xrdb -merge "$HOME/.Xresources.dark"
|
||||||
|
|
||||||
|
# Send signal to dwm to reload colors (equivalent to Mod+Shift+F5)
|
||||||
|
# First try using xdotool to simulate the key combination
|
||||||
|
if command -v xdotool >/dev/null 2>&1; then
|
||||||
|
xdotool key --clearmodifiers Super_L+shift+F5 2>/dev/null || true
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Alternative: if you have dwm-msg or similar IPC tool
|
||||||
|
# dwm-msg run_command xrdb 2>/dev/null || true
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Refresh system tray icons and Qt applications
|
||||||
|
echo "Refreshing system tray and Qt applications..."
|
||||||
|
|
||||||
|
# Restart common tray applications to refresh their icons
|
||||||
|
for app in nm-applet blueman-applet pasystray; do
|
||||||
|
if pgrep "$app" >/dev/null; then
|
||||||
|
pkill "$app" 2>/dev/null
|
||||||
|
sleep 0.5
|
||||||
|
nohup "$app" >/dev/null 2>&1 &
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
# Notify Qt applications of theme change
|
||||||
|
if command -v qt5ct >/dev/null 2>&1; then
|
||||||
|
export QT_QPA_PLATFORMTHEME=qt5ct
|
||||||
|
fi
|
||||||
|
if command -v qt6ct >/dev/null 2>&1; then
|
||||||
|
export QT_QPA_PLATFORMTHEME=qt6ct
|
||||||
|
fi
|
||||||
|
|
||||||
# Notify about theme change
|
# Notify about theme change
|
||||||
echo "Switched to Rose Pine (dark) theme"
|
echo "Switched to Rose Pine (dark) theme"
|
||||||
|
|
||||||
|
# Update shell configuration to source theme on new terminals
|
||||||
|
if [ -n "$SHELL" ]; then
|
||||||
|
shell_name=$(basename "$SHELL")
|
||||||
|
case "$shell_name" in
|
||||||
|
"bash")
|
||||||
|
if ! grep -q "source.*\.theme_env" "$HOME/.bashrc" 2>/dev/null; then
|
||||||
|
echo "[ -f \"\$HOME/.theme_env\" ] && source \"\$HOME/.theme_env\"" >> "$HOME/.bashrc"
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
"fish")
|
||||||
|
mkdir -p "$HOME/.config/fish"
|
||||||
|
if ! grep -q "source.*\.theme_env" "$HOME/.config/fish/config.fish" 2>/dev/null; then
|
||||||
|
echo "[ -f \"\$HOME/.theme_env\" ] && source \"\$HOME/.theme_env\"" >> "$HOME/.config/fish/config.fish"
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
"zsh")
|
||||||
|
if ! grep -q "source.*\.theme_env" "$HOME/.zshrc" 2>/dev/null; then
|
||||||
|
echo "[ -f \"\$HOME/.theme_env\" ] && source \"\$HOME/.theme_env\"" >> "$HOME/.zshrc"
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
fi
|
||||||
|
|||||||
197
.local/bin/light
197
.local/bin/light
@@ -1,7 +1,8 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
# Set theme environment variable
|
# Set theme environment variable for current session and future sessions
|
||||||
export THEME="light"
|
export THEME="light"
|
||||||
|
echo "export THEME=light" > "$HOME/.theme_env"
|
||||||
|
|
||||||
# Update GTK theme using gsettings (more reliable)
|
# Update GTK theme using gsettings (more reliable)
|
||||||
if command -v gsettings >/dev/null 2>&1; then
|
if command -v gsettings >/dev/null 2>&1; then
|
||||||
@@ -38,43 +39,154 @@ EOF
|
|||||||
# Update Qt6 theme using qt6ct
|
# Update Qt6 theme using qt6ct
|
||||||
if command -v qt6ct >/dev/null 2>&1; then
|
if command -v qt6ct >/dev/null 2>&1; then
|
||||||
export QT_QPA_PLATFORMTHEME=qt6ct
|
export QT_QPA_PLATFORMTHEME=qt6ct
|
||||||
mkdir -p "$HOME/.config/qt6ct"
|
mkdir -p "$HOME/.config/qt6ct/colors"
|
||||||
if [ -f "$HOME/.config/qt6ct/qt6ct.conf" ]; then
|
if [ -f "$HOME/.config/qt6ct/qt6ct.conf" ]; then
|
||||||
sed -i 's/^style=.*/style=rose-pine-dawn/' "$HOME/.config/qt6ct/qt6ct.conf"
|
sed -i 's/^color_scheme_path=.*/color_scheme_path=\/home\/mike\/.config\/qt6ct\/colors\/rose-pine-dawn.conf/' "$HOME/.config/qt6ct/qt6ct.conf"
|
||||||
sed -i 's/^color_scheme=.*/color_scheme=rose-pine-dawn/' "$HOME/.config/qt6ct/qt6ct.conf"
|
sed -i 's/^color_scheme=.*/color_scheme=rose-pine-dawn/' "$HOME/.config/qt6ct/qt6ct.conf"
|
||||||
|
else
|
||||||
|
# Create basic qt6ct config if it doesn't exist
|
||||||
|
cat > "$HOME/.config/qt6ct/qt6ct.conf" << EOF
|
||||||
|
[Appearance]
|
||||||
|
color_scheme_path=/home/mike/.config/qt6ct/colors/rose-pine-dawn.conf
|
||||||
|
color_scheme=rose-pine-dawn
|
||||||
|
custom_palette=true
|
||||||
|
standard_dialogs=default
|
||||||
|
style=Fusion
|
||||||
|
|
||||||
|
[Fonts]
|
||||||
|
fixed=@Variant(\0\0\0@\0\0\0\x12\0M\0o\0n\0o\0s\0p\0\x61\0\x63\0\x65@\"\0\0\0\0\0\0\xff\xff\xff\xff\x5\x1\0\x32\x10)
|
||||||
|
general=@Variant(\0\0\0@\0\0\0\x12\0U\0\x62\0u\0n\0t\0u@\"\0\0\0\0\0\0\xff\xff\xff\xff\x5\x1\0\x32\x10)
|
||||||
|
|
||||||
|
[Interface]
|
||||||
|
activate_item_on_single_click=1
|
||||||
|
buttonbox_layout=0
|
||||||
|
cursor_flash_time=1000
|
||||||
|
dialog_buttons_have_icons=1
|
||||||
|
double_click_interval=400
|
||||||
|
gui_effects=@Invalid()
|
||||||
|
keyboard_scheme=2
|
||||||
|
menus_have_icons=true
|
||||||
|
show_shortcuts_in_context_menus=true
|
||||||
|
stylesheets=@Invalid()
|
||||||
|
toolbutton_style=4
|
||||||
|
underline_shortcut=1
|
||||||
|
wheel_scroll_lines=3
|
||||||
|
|
||||||
|
[SettingsWindow]
|
||||||
|
geometry=@ByteArray()
|
||||||
|
EOF
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Update Qt5 theme using qt5ct
|
# Update Qt5 theme using qt5ct
|
||||||
if command -v qt5ct >/dev/null 2>&1; then
|
if command -v qt5ct >/dev/null 2>&1; then
|
||||||
export QT_QPA_PLATFORMTHEME=qt5ct
|
export QT_QPA_PLATFORMTHEME=qt5ct
|
||||||
mkdir -p "$HOME/.config/qt5ct"
|
mkdir -p "$HOME/.config/qt5ct/colors"
|
||||||
if [ -f "$HOME/.config/qt5ct/qt5ct.conf" ]; then
|
if [ -f "$HOME/.config/qt5ct/qt5ct.conf" ]; then
|
||||||
sed -i 's/^style=.*/style=rose-pine-dawn/' "$HOME/.config/qt5ct/qt5ct.conf"
|
sed -i 's/^color_scheme_path=.*/color_scheme_path=\/home\/mike\/.config\/qt5ct\/colors\/rose-pine-dawn.conf/' "$HOME/.config/qt5ct/qt5ct.conf"
|
||||||
sed -i 's/^color_scheme=.*/color_scheme=rose-pine-dawn/' "$HOME/.config/qt5ct/qt5ct.conf"
|
sed -i 's/^color_scheme=.*/color_scheme=rose-pine-dawn/' "$HOME/.config/qt5ct/qt5ct.conf"
|
||||||
|
else
|
||||||
|
# Create basic qt5ct config if it doesn't exist
|
||||||
|
cat > "$HOME/.config/qt5ct/qt5ct.conf" << EOF
|
||||||
|
[Appearance]
|
||||||
|
color_scheme_path=/home/mike/.config/qt5ct/colors/rose-pine-dawn.conf
|
||||||
|
color_scheme=rose-pine-dawn
|
||||||
|
custom_palette=true
|
||||||
|
standard_dialogs=default
|
||||||
|
style=Fusion
|
||||||
|
|
||||||
|
[Fonts]
|
||||||
|
fixed=@Variant(\0\0\0@\0\0\0\x12\0M\0o\0n\0o\0s\0p\0\x61\0\x63\0\x65@\"\0\0\0\0\0\0\xff\xff\xff\xff\x5\x1\0\x32\x10)
|
||||||
|
general=@Variant(\0\0\0@\0\0\0\x12\0U\0\x62\0u\0n\0t\0u@\"\0\0\0\0\0\0\xff\xff\xff\xff\x5\x1\0\x32\x10)
|
||||||
|
|
||||||
|
[Interface]
|
||||||
|
activate_item_on_single_click=1
|
||||||
|
buttonbox_layout=0
|
||||||
|
cursor_flash_time=1000
|
||||||
|
dialog_buttons_have_icons=1
|
||||||
|
double_click_interval=400
|
||||||
|
gui_effects=@Invalid()
|
||||||
|
keyboard_scheme=2
|
||||||
|
menus_have_icons=true
|
||||||
|
show_shortcuts_in_context_menus=true
|
||||||
|
stylesheets=@Invalid()
|
||||||
|
toolbutton_style=4
|
||||||
|
underline_shortcut=1
|
||||||
|
wheel_scroll_lines=3
|
||||||
|
|
||||||
|
[SettingsWindow]
|
||||||
|
geometry=@ByteArray()
|
||||||
|
EOF
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Update Rofi theme
|
# Update Rofi theme
|
||||||
|
mkdir -p "$HOME/.config/rofi"
|
||||||
if [ -f "$HOME/.config/rofi/config.rasi" ]; then
|
if [ -f "$HOME/.config/rofi/config.rasi" ]; then
|
||||||
sed -i 's/@theme ".*"/@theme "rose-pine-dawn"/' "$HOME/.config/rofi/config.rasi"
|
# Update existing config.rasi
|
||||||
elif [ -f "$HOME/.config/rofi/config" ]; then
|
if grep -q "@theme" "$HOME/.config/rofi/config.rasi"; then
|
||||||
sed -i 's/rofi.theme:.*/rofi.theme: rose-pine-dawn/' "$HOME/.config/rofi/config"
|
sed -i 's/@theme ".*"/@theme "rose-pine-dawn"/' "$HOME/.config/rofi/config.rasi"
|
||||||
|
else
|
||||||
|
echo '@theme "rose-pine-dawn"' >> "$HOME/.config/rofi/config.rasi"
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
# Create new config.rasi with Rose Pine Dawn (light) theme
|
||||||
|
cat > "$HOME/.config/rofi/config.rasi" << EOF
|
||||||
|
configuration {
|
||||||
|
modi: "drun,run,window";
|
||||||
|
show-icons: true;
|
||||||
|
icon-theme: "Papirus-Light";
|
||||||
|
display-drun: "";
|
||||||
|
display-run: "";
|
||||||
|
display-window: "";
|
||||||
|
drun-display-format: "{name}";
|
||||||
|
disable-history: false;
|
||||||
|
hide-scrollbar: true;
|
||||||
|
sidebar-mode: false;
|
||||||
|
}
|
||||||
|
|
||||||
|
@theme "rose-pine-dawn"
|
||||||
|
EOF
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Update Wezterm theme
|
# Update Wezterm theme
|
||||||
if [ -f "$HOME/.config/wezterm/wezterm.lua" ]; then
|
if [ -f "$HOME/.config/wezterm/wezterm.lua" ]; then
|
||||||
sed -i 's/config.color_scheme = .*/config.color_scheme = "rose-pine-dawn"/' "$HOME/.config/wezterm/wezterm.lua"
|
# Update Rose Pine theme variant to dawn (light)
|
||||||
|
sed -i "s/local theme = wezterm\.plugin\.require('https:\/\/github\.com\/neapsix\/wezterm')\.\(main\|moon\|dawn\)/local theme = wezterm.plugin.require('https:\/\/github.com\/neapsix\/wezterm').dawn/" "$HOME/.config/wezterm/wezterm.lua"
|
||||||
|
# Also handle manual require statements
|
||||||
|
sed -i "s/local theme = require('lua\/rose-pine')\.\(main\|moon\|dawn\)/local theme = require('lua\/rose-pine').dawn/" "$HOME/.config/wezterm/wezterm.lua"
|
||||||
|
# Fallback for older color_scheme format
|
||||||
|
sed -i 's/config.color_scheme = .*/-- config.color_scheme = "rose-pine-dawn" -- Using custom Rose Pine theme/' "$HOME/.config/wezterm/wezterm.lua"
|
||||||
elif [ -f "$HOME/.wezterm.lua" ]; then
|
elif [ -f "$HOME/.wezterm.lua" ]; then
|
||||||
sed -i 's/config.color_scheme = .*/config.color_scheme = "rose-pine-dawn"/' "$HOME/.wezterm.lua"
|
# Update Rose Pine theme variant to dawn (light)
|
||||||
|
sed -i "s/local theme = wezterm\.plugin\.require('https:\/\/github\.com\/neapsix\/wezterm')\.\(main\|moon\|dawn\)/local theme = wezterm.plugin.require('https:\/\/github.com\/neapsix\/wezterm').dawn/" "$HOME/.wezterm.lua"
|
||||||
|
# Also handle manual require statements
|
||||||
|
sed -i "s/local theme = require('lua\/rose-pine')\.\(main\|moon\|dawn\)/local theme = require('lua\/rose-pine').dawn/" "$HOME/.wezterm.lua"
|
||||||
|
# Fallback for older color_scheme format
|
||||||
|
sed -i 's/config.color_scheme = .*/-- config.color_scheme = "rose-pine-dawn" -- Using custom Rose Pine theme/' "$HOME/.wezterm.lua"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Set environment variables for current session
|
# Set environment variables for current session
|
||||||
|
export THEME="light"
|
||||||
export GTK_THEME=""
|
export GTK_THEME=""
|
||||||
unset GTK_THEME # Unset to use theme from config files
|
unset GTK_THEME # Unset to use theme from config files
|
||||||
|
|
||||||
# Reload applications that support theme changes
|
# Create theme indicator file for bar.sh to detect
|
||||||
pkill -USR1 wezterm >/dev/null 2>&1 || true
|
echo "light" > "$HOME/.current_theme"
|
||||||
|
|
||||||
|
# Verify the file was written
|
||||||
|
if [ "$(cat "$HOME/.current_theme")" = "light" ]; then
|
||||||
|
echo "✓ Theme file updated to 'light'"
|
||||||
|
else
|
||||||
|
echo "✗ Failed to update theme file"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Check if bar is running
|
||||||
|
if pgrep -f "bar.sh" > /dev/null; then
|
||||||
|
echo "✓ Bar is running - theme should update immediately"
|
||||||
|
else
|
||||||
|
echo "⚠ Bar is not running - start it with: ~/repos/dwm/bar.sh"
|
||||||
|
fi
|
||||||
|
|
||||||
# Try to reload GTK applications via xsettingsd if available
|
# Try to reload GTK applications via xsettingsd if available
|
||||||
if command -v xsettingsd >/dev/null 2>&1; then
|
if command -v xsettingsd >/dev/null 2>&1; then
|
||||||
@@ -86,5 +198,66 @@ if pgrep -x "gnome-session" >/dev/null; then
|
|||||||
dbus-send --session --type=method_call --dest=org.gnome.SettingsDaemon.Color /org/gnome/SettingsDaemon/Color org.gnome.SettingsDaemon.Color.ApplySettings >/dev/null 2>&1 || true
|
dbus-send --session --type=method_call --dest=org.gnome.SettingsDaemon.Color /org/gnome/SettingsDaemon/Color org.gnome.SettingsDaemon.Color.ApplySettings >/dev/null 2>&1 || true
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Update theme state file for bar.sh
|
||||||
|
echo "light" > "$HOME/.current_theme"
|
||||||
|
|
||||||
|
# Load light theme Xresources and reload dwm colors
|
||||||
|
if [ -f "$HOME/.Xresources.light" ]; then
|
||||||
|
echo "Loading light theme Xresources..."
|
||||||
|
xrdb -merge "$HOME/.Xresources.light"
|
||||||
|
|
||||||
|
# Send signal to dwm to reload colors (equivalent to Mod+Shift+F5)
|
||||||
|
# First try using xdotool to simulate the key combination
|
||||||
|
if command -v xdotool >/dev/null 2>&1; then
|
||||||
|
xdotool key --clearmodifiers Super_L+shift+F5 2>/dev/null || true
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Alternative: if you have dwm-msg or similar IPC tool
|
||||||
|
# dwm-msg run_command xrdb 2>/dev/null || true
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Refresh system tray icons and Qt applications
|
||||||
|
echo "Refreshing system tray and Qt applications..."
|
||||||
|
|
||||||
|
# Restart common tray applications to refresh their icons
|
||||||
|
for app in nm-applet blueman-applet pasystray; do
|
||||||
|
if pgrep "$app" >/dev/null; then
|
||||||
|
pkill "$app" 2>/dev/null
|
||||||
|
sleep 0.5
|
||||||
|
nohup "$app" >/dev/null 2>&1 &
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
# Notify Qt applications of theme change
|
||||||
|
if command -v qt5ct >/dev/null 2>&1; then
|
||||||
|
export QT_QPA_PLATFORMTHEME=qt5ct
|
||||||
|
fi
|
||||||
|
if command -v qt6ct >/dev/null 2>&1; then
|
||||||
|
export QT_QPA_PLATFORMTHEME=qt6ct
|
||||||
|
fi
|
||||||
|
|
||||||
# Notify about theme change
|
# Notify about theme change
|
||||||
echo "Switched to Rose Pine Dawn (light) theme"
|
echo "Switched to Rose Pine Dawn (light) theme"
|
||||||
|
|
||||||
|
# Update shell configuration to source theme on new terminals
|
||||||
|
if [ -n "$SHELL" ]; then
|
||||||
|
shell_name=$(basename "$SHELL")
|
||||||
|
case "$shell_name" in
|
||||||
|
"bash")
|
||||||
|
if ! grep -q "source.*\.theme_env" "$HOME/.bashrc" 2>/dev/null; then
|
||||||
|
echo "[ -f \"\$HOME/.theme_env\" ] && source \"\$HOME/.theme_env\"" >> "$HOME/.bashrc"
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
"fish")
|
||||||
|
mkdir -p "$HOME/.config/fish"
|
||||||
|
if ! grep -q "source.*\.theme_env" "$HOME/.config/fish/config.fish" 2>/dev/null; then
|
||||||
|
echo "[ -f \"\$HOME/.theme_env\" ] && source \"\$HOME/.theme_env\"" >> "$HOME/.config/fish/config.fish"
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
"zsh")
|
||||||
|
if ! grep -q "source.*\.theme_env" "$HOME/.zshrc" 2>/dev/null; then
|
||||||
|
echo "[ -f \"\$HOME/.theme_env\" ] && source \"\$HOME/.theme_env\"" >> "$HOME/.zshrc"
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
fi
|
||||||
|
|||||||
7
.xinitrc
7
.xinitrc
@@ -28,7 +28,6 @@ export SSH_AUTH_SOCK;
|
|||||||
#then
|
#then
|
||||||
# SSH_ASKPASS=/usr/lib/ssh/x11-ssh-askpass ssh-add < /dev/null
|
# SSH_ASKPASS=/usr/lib/ssh/x11-ssh-askpass ssh-add < /dev/null
|
||||||
#fi
|
#fi
|
||||||
|
|
||||||
# theming
|
# theming
|
||||||
export QT_QPA_PLATFORMTHEME=qt5ct
|
export QT_QPA_PLATFORMTHEME=qt5ct
|
||||||
export DESKTOP_SESSION=plasma
|
export DESKTOP_SESSION=plasma
|
||||||
@@ -127,7 +126,8 @@ fi
|
|||||||
# wallpaper engine and theming
|
# wallpaper engine and theming
|
||||||
# nitrogen --restore &
|
# nitrogen --restore &
|
||||||
# wal --backend colorz -i $HOME/.dots/nitrogen/.config/nitrogen/pexels-engin-akyurt-1435752.jpg &
|
# wal --backend colorz -i $HOME/.dots/nitrogen/.config/nitrogen/pexels-engin-akyurt-1435752.jpg &
|
||||||
. ~/.fehbg &
|
# . ~/.fehbg &
|
||||||
|
timewall set $HOME/Pictures/Arenales_del_Sol.heic --daemon &
|
||||||
|
|
||||||
## Set screen locker
|
## Set screen locker
|
||||||
xss-lock -v -- betterlockscreen -l --time-format '%I:%M %p' &
|
xss-lock -v -- betterlockscreen -l --time-format '%I:%M %p' &
|
||||||
@@ -152,7 +152,8 @@ caffeine >/dev/null 2>&1 &
|
|||||||
|
|
||||||
redshift &
|
redshift &
|
||||||
|
|
||||||
export THEME=dark
|
# Qt5ct and qt6ct theming used
|
||||||
|
export QT_QPA_PLATFORMTHEME=qt6ct
|
||||||
|
|
||||||
## Ulauncher
|
## Ulauncher
|
||||||
# ulauncher --hide-window --no-window-shadow >/dev/null 2>&1 &
|
# ulauncher --hide-window --no-window-shadow >/dev/null 2>&1 &
|
||||||
|
|||||||
Reference in New Issue
Block a user