HyprPolkitAgent
The Challenge
Section titled “The Challenge”Some background services (like polkit agents) read their theme from environment variables when they start. To change the theme, you must:
- Update the environment variable definition.
- Import that variable into the
systemd --usersession. - Restart the service.
2. Themis’s Approach
Section titled “2. Themis’s Approach”This requires a Script Integration because it involves multiple sequential steps involving system state.
3. Configuration Example
Section titled “3. Configuration Example”Script: ~/.config/themis/scripts/update_polkit.sh
#!/bin/bash
# 1. Map Themis vars to Polkit varsexport QT_QUICK_CONTROLS_MATERIAL_THEME="$1" # Passed as argexport QT_QUICK_CONTROLS_STYLE="Material"
# 2. Import to Systemdsystemctl --user import-environment QT_QUICK_CONTROLS_MATERIAL_THEME QT_QUICK_CONTROLS_STYLE
# 3. Restart Servicesystemctl --user restart hyprpolkitagentThemis Config:
enroll: polkit: type: script path: "~/.config/themis/scripts/update_polkit.sh" # Pass the theme name (e.g., "Dark" or "Light") # Note: You might need a custom variable 'polkit_theme_name' in your profile # if it differs from the standard preset name. args: ["{{ polkit_theme_name | default(value='Dark') }}"]