fix stylix stylesheet
This commit is contained in:
@@ -30,9 +30,10 @@ if STYLIX.get("enable", False):
|
|||||||
stylix_css_path = get_stylix_css_path()
|
stylix_css_path = get_stylix_css_path()
|
||||||
if stylix_css_path:
|
if stylix_css_path:
|
||||||
logger.info("[Bar] Using Stylix CSS")
|
logger.info("[Bar] Using Stylix CSS")
|
||||||
app.set_stylesheet_from_file(stylix_css_path)
|
# Load base styles first for structure
|
||||||
# Also load base styles for imports
|
|
||||||
app.set_stylesheet_from_file(get_relative_path("styles/main.css"))
|
app.set_stylesheet_from_file(get_relative_path("styles/main.css"))
|
||||||
|
# Then apply Stylix theme colors
|
||||||
|
app.set_stylesheet_from_file(stylix_css_path)
|
||||||
else:
|
else:
|
||||||
logger.warning("[Bar] Stylix enabled but CSS generation failed, falling back to default")
|
logger.warning("[Bar] Stylix enabled but CSS generation failed, falling back to default")
|
||||||
app.set_stylesheet_from_file(get_relative_path("styles/main.css"))
|
app.set_stylesheet_from_file(get_relative_path("styles/main.css"))
|
||||||
|
|||||||
@@ -40,23 +40,8 @@ def generate_stylix_css():
|
|||||||
font_family = fonts.get("sansSerif", "sans-serif")
|
font_family = fonts.get("sansSerif", "sans-serif")
|
||||||
font_size = fonts.get("sizes", {}).get("applications", 14)
|
font_size = fonts.get("sizes", {}).get("applications", 14)
|
||||||
|
|
||||||
css_content = f"""
|
# Generate GTK CSS with Stylix colors
|
||||||
/* Stylix-generated colors */
|
css_content = f"""/* Stylix-generated theme */
|
||||||
:root {{
|
|
||||||
--window-bg: #{colors["base00"]};
|
|
||||||
--module-bg: #{colors["base01"]};
|
|
||||||
--border-color: #{colors["base02"]};
|
|
||||||
--foreground: #{colors["base05"]};
|
|
||||||
--red: #{colors["base08"]};
|
|
||||||
--orange: #{colors["base09"]};
|
|
||||||
--yellow: #{colors["base0A"]};
|
|
||||||
--green: #{colors["base0B"]};
|
|
||||||
--cyan: #{colors["base0C"]};
|
|
||||||
--blue: #{colors["base0D"]};
|
|
||||||
--violet: #{colors["base0E"]};
|
|
||||||
--purple: #{colors["base0E"]};
|
|
||||||
--brown: #{colors["base0F"]};
|
|
||||||
}}
|
|
||||||
|
|
||||||
/* Apply Stylix font */
|
/* Apply Stylix font */
|
||||||
* {{
|
* {{
|
||||||
@@ -64,38 +49,73 @@ def generate_stylix_css():
|
|||||||
font-size: {font_size}px;
|
font-size: {font_size}px;
|
||||||
}}
|
}}
|
||||||
|
|
||||||
/* Workspace styling */
|
|
||||||
.workspace-button {{
|
|
||||||
background-color: #{colors["base01"]};
|
|
||||||
color: #{colors["base05"]};
|
|
||||||
border: 1px solid #{colors["base02"]};
|
|
||||||
border-radius: 4px;
|
|
||||||
padding: 4px 8px;
|
|
||||||
margin: 2px;
|
|
||||||
}}
|
|
||||||
|
|
||||||
.workspace-button.active {{
|
|
||||||
background-color: #{colors["base0D"]};
|
|
||||||
color: #{colors["base00"]};
|
|
||||||
}}
|
|
||||||
|
|
||||||
.workspace-button.urgent {{
|
|
||||||
background-color: #{colors["base08"]};
|
|
||||||
color: #{colors["base00"]};
|
|
||||||
}}
|
|
||||||
|
|
||||||
/* Bar styling */
|
/* Bar styling */
|
||||||
#bar-inner {{
|
#bar-inner {{
|
||||||
|
padding: 4px;
|
||||||
|
border-bottom: solid 2px;
|
||||||
|
border-color: #{colors["base02"]};
|
||||||
background-color: #{colors["base00"]};
|
background-color: #{colors["base00"]};
|
||||||
border-bottom: 2px solid #{colors["base02"]};
|
|
||||||
}}
|
}}
|
||||||
|
|
||||||
/* System tray */
|
#center-container {{
|
||||||
#system-tray {{
|
color: #{colors["base05"]};
|
||||||
|
}}
|
||||||
|
|
||||||
|
.active-window {{
|
||||||
|
color: #{colors["base05"]};
|
||||||
|
font-weight: bold;
|
||||||
|
}}
|
||||||
|
|
||||||
|
/* Battery */
|
||||||
|
#battery-widget {{
|
||||||
background-color: #{colors["base01"]};
|
background-color: #{colors["base01"]};
|
||||||
|
padding: 4px 8px;
|
||||||
border-radius: 4px;
|
border-radius: 4px;
|
||||||
}}
|
}}
|
||||||
|
|
||||||
|
#bat-icon {{
|
||||||
|
color: #{colors["base0D"]};
|
||||||
|
margin-right: 2px;
|
||||||
|
}}
|
||||||
|
|
||||||
|
#bat-label {{
|
||||||
|
color: #{colors["base05"]};
|
||||||
|
font-size: 14px;
|
||||||
|
}}
|
||||||
|
|
||||||
|
#bat-label.battery-low {{
|
||||||
|
color: #{colors["base08"]};
|
||||||
|
font-weight: bold;
|
||||||
|
}}
|
||||||
|
|
||||||
|
/* Progress bars */
|
||||||
|
#cpu-progress-bar,
|
||||||
|
#ram-progress-bar,
|
||||||
|
#volume-progress-bar {{
|
||||||
|
color: transparent;
|
||||||
|
background-color: transparent;
|
||||||
|
}}
|
||||||
|
|
||||||
|
#cpu-progress-bar {{
|
||||||
|
border: solid 0px alpha(#{colors["base0E"]}, 0.8);
|
||||||
|
}}
|
||||||
|
|
||||||
|
#ram-progress-bar,
|
||||||
|
#volume-progress-bar {{
|
||||||
|
border: solid 0px #{colors["base0D"]};
|
||||||
|
}}
|
||||||
|
|
||||||
|
/* Widgets container */
|
||||||
|
#widgets-container {{
|
||||||
|
background-color: #{colors["base01"]};
|
||||||
|
padding: 2px;
|
||||||
|
}}
|
||||||
|
|
||||||
|
/* NixOS label */
|
||||||
|
#nixos-label {{
|
||||||
|
color: #{colors["base0D"]};
|
||||||
|
}}
|
||||||
|
|
||||||
/* Date time */
|
/* Date time */
|
||||||
#date-time {{
|
#date-time {{
|
||||||
color: #{colors["base05"]};
|
color: #{colors["base05"]};
|
||||||
@@ -104,56 +124,37 @@ def generate_stylix_css():
|
|||||||
border-radius: 4px;
|
border-radius: 4px;
|
||||||
}}
|
}}
|
||||||
|
|
||||||
/* Progress bars */
|
/* Tooltips */
|
||||||
#cpu-progress-bar {{
|
|
||||||
color: #{colors["base0E"]};
|
|
||||||
}}
|
|
||||||
|
|
||||||
#ram-progress-bar,
|
|
||||||
#volume-progress-bar {{
|
|
||||||
color: #{colors["base0D"]};
|
|
||||||
}}
|
|
||||||
|
|
||||||
/* Battery */
|
|
||||||
#battery-widget {{
|
|
||||||
background-color: #{colors["base01"]};
|
|
||||||
border-radius: 4px;
|
|
||||||
}}
|
|
||||||
|
|
||||||
#bat-icon {{
|
|
||||||
color: #{colors["base0D"]};
|
|
||||||
}}
|
|
||||||
|
|
||||||
#bat-label {{
|
|
||||||
color: #{colors["base05"]};
|
|
||||||
}}
|
|
||||||
|
|
||||||
#bat-label.battery-low {{
|
|
||||||
color: #{colors["base08"]};
|
|
||||||
}}
|
|
||||||
|
|
||||||
/* Active window */
|
|
||||||
.active-window {{
|
|
||||||
color: #{colors["base05"]};
|
|
||||||
}}
|
|
||||||
|
|
||||||
/* NixOS label */
|
|
||||||
#nixos-label {{
|
|
||||||
color: #{colors["base0D"]};
|
|
||||||
}}
|
|
||||||
|
|
||||||
/* Widgets container */
|
|
||||||
#widgets-container {{
|
|
||||||
background-color: #{colors["base01"]};
|
|
||||||
border-radius: 4px;
|
|
||||||
}}
|
|
||||||
|
|
||||||
/* Tooltip */
|
|
||||||
tooltip {{
|
tooltip {{
|
||||||
|
border: solid 2px;
|
||||||
|
border-color: #{colors["base02"]};
|
||||||
background-color: #{colors["base00"]};
|
background-color: #{colors["base00"]};
|
||||||
border: 2px solid #{colors["base02"]};
|
|
||||||
color: #{colors["base05"]};
|
color: #{colors["base05"]};
|
||||||
}}
|
}}
|
||||||
|
|
||||||
|
tooltip>* {{
|
||||||
|
padding: 2px 4px;
|
||||||
|
}}
|
||||||
|
|
||||||
|
/* Workspaces */
|
||||||
|
.workspace {{
|
||||||
|
background-color: #{colors["base01"]};
|
||||||
|
border: 1px solid #{colors["base02"]};
|
||||||
|
border-radius: 4px;
|
||||||
|
color: #{colors["base05"]};
|
||||||
|
padding: 2px 8px;
|
||||||
|
margin: 0 2px;
|
||||||
|
}}
|
||||||
|
|
||||||
|
.workspace.active {{
|
||||||
|
background-color: #{colors["base0D"]};
|
||||||
|
color: #{colors["base00"]};
|
||||||
|
}}
|
||||||
|
|
||||||
|
.workspace.urgent {{
|
||||||
|
background-color: #{colors["base08"]};
|
||||||
|
color: #{colors["base00"]};
|
||||||
|
}}
|
||||||
"""
|
"""
|
||||||
|
|
||||||
# Write to temporary file
|
# Write to temporary file
|
||||||
|
|||||||
Reference in New Issue
Block a user