diff options
| author | Don Williams <don.e.williams@gmail.com> | 2026-01-08 21:22:30 -0500 |
|---|---|---|
| committer | Don Williams <don.e.williams@gmail.com> | 2026-01-08 21:22:30 -0500 |
| commit | 3a423138021325a6d97ab0538625305795a6b1c1 (patch) | |
| tree | fada90c1aceaa89c96639ded30ae802a8dd03c4c /config/hypr/scripts/sddm_wallpaper.sh | |
| parent | 320d2a64813a537f45a986eb4a85fb7b82ed7316 (diff) | |
Fixing the next three scripts
- `Tak0-Per-Window-Switch.sh` now records the listener PID in ``~/.cache/kb_layout_per_window.listener.pid``
- reuses it if still running, preventing multiple background listeners
- reports missing Hyprland sockets without exiting the main script.
- `WaybarScripts.sh` adds a `launch_files()` helper that checks `$files` before execution;
- if unset, it shows a notification instead of running an empty command.
- `sddm_wallpaper.sh` validates `~/.config/rofi/wallust/colors-rofi.rasi` before use
- extracts colors via a helper, and aborts with a notification if any required colors are missing.
On branch development
Your branch is up to date with 'origin/development'.
Changes to be committed:
modified: CHANGELOG.md
modified: config/hypr/scripts/Tak0-Per-Window-Switch.sh
modified: config/hypr/scripts/WaybarScripts.sh
modified: config/hypr/scripts/sddm_wallpaper.sh
Diffstat (limited to 'config/hypr/scripts/sddm_wallpaper.sh')
| -rwxr-xr-x | config/hypr/scripts/sddm_wallpaper.sh | 37 |
1 files changed, 30 insertions, 7 deletions
diff --git a/config/hypr/scripts/sddm_wallpaper.sh b/config/hypr/scripts/sddm_wallpaper.sh index 5ebab44c..b83f800a 100755 --- a/config/hypr/scripts/sddm_wallpaper.sh +++ b/config/hypr/scripts/sddm_wallpaper.sh @@ -21,6 +21,10 @@ sddm_simple="$sddm_themes_dir/simple_sddm_2" # rofi-wallust-sddm colors path rofi_wallust="$HOME/.config/rofi/wallust/colors-rofi.rasi" sddm_theme_conf="$sddm_simple/theme.conf" +if [[ ! -f "$rofi_wallust" ]]; then + notify-send -i "$iDIR/error.png" "SDDM" "Wallust colors file not found ($rofi_wallust). Aborting." + exit 1 +fi # Directory for swaync iDIR="$HOME/.config/swaync/images" @@ -36,13 +40,32 @@ fi # Extract colors from rofi wallust config -color0=$(grep -oP 'color1:\s*\K#[A-Fa-f0-9]+' "$rofi_wallust") -color1=$(grep -oP 'color0:\s*\K#[A-Fa-f0-9]+' "$rofi_wallust") -color7=$(grep -oP 'color14:\s*\K#[A-Fa-f0-9]+' "$rofi_wallust") -color10=$(grep -oP 'color10:\s*\K#[A-Fa-f0-9]+' "$rofi_wallust") -color12=$(grep -oP 'color12:\s*\K#[A-Fa-f0-9]+' "$rofi_wallust") -color13=$(grep -oP 'color13:\s*\K#[A-Fa-f0-9]+' "$rofi_wallust") -foreground=$(grep -oP 'foreground:\s*\K#[A-Fa-f0-9]+' "$rofi_wallust") +extract_color() { + local key="$1" + local value + value=$(grep -oP "$key:\s*\K#[A-Fa-f0-9]+" "$rofi_wallust" | head -n1) + echo "$value" +} + +color0=$(extract_color "color1") +color1=$(extract_color "color0") +color7=$(extract_color "color14") +color10=$(extract_color "color10") +color12=$(extract_color "color12") +color13=$(extract_color "color13") +foreground=$(extract_color "foreground") + +missing_colors=() +for var in color0 color1 color7 color10 color12 color13 foreground; do + if [[ -z "${!var}" ]]; then + missing_colors+=("$var") + fi +done + +if [[ ${#missing_colors[@]} -gt 0 ]]; then + notify-send -i "$iDIR/error.png" "SDDM" "Missing color(s): ${missing_colors[*]}. Run Wallust first." + exit 1 +fi #background-color=$(grep -oP 'background:\s*\K#[A-Fa-f0-9]+' "$rofi_wallust") # wallpaper to use |
