My nix-darwin and NixOS config
3
fork

Configure Feed

Select the types of activity you want to include in your feed.

feat: add diagnostic script

+141
+141
scripts/diagnose-wallpaper.sh
··· 1 + #!/usr/bin/env bash 2 + # Wallpaper diagnostic script for KDE Plasma 3 + 4 + echo "==========================================" 5 + echo "KDE PLASMA WALLPAPER DIAGNOSTIC" 6 + echo "==========================================" 7 + echo "" 8 + 9 + # Colors 10 + RED='\033[0;31m' 11 + GREEN='\033[0;32m' 12 + YELLOW='\033[1;33m' 13 + NC='\033[0m' # No Color 14 + 15 + # 1. Check if wallpaper file exists 16 + echo "1. Checking wallpaper file..." 17 + WALLPAPER_PATH="$HOME/.config/nix-config/wallpapers/wallpaper.jpg" 18 + if [ -f "$WALLPAPER_PATH" ]; then 19 + echo -e "${GREEN}✓${NC} Wallpaper file exists: $WALLPAPER_PATH" 20 + ls -lh "$WALLPAPER_PATH" 21 + file "$WALLPAPER_PATH" 22 + else 23 + echo -e "${RED}✗${NC} Wallpaper file NOT found: $WALLPAPER_PATH" 24 + fi 25 + echo "" 26 + 27 + # 2. Check if file is in nix store 28 + echo "2. Checking if wallpaper is in Nix store..." 29 + NIX_WALLPAPER=$(find /nix/store -name "wallpaper.jpg" 2>/dev/null | grep -v "\.drv$" | head -1) 30 + if [ -n "$NIX_WALLPAPER" ]; then 31 + echo -e "${GREEN}✓${NC} Found in Nix store: $NIX_WALLPAPER" 32 + else 33 + echo -e "${YELLOW}⚠${NC} Not found in Nix store (may be normal)" 34 + fi 35 + echo "" 36 + 37 + # 3. Check plasma configuration files 38 + echo "3. Checking KDE Plasma config files..." 39 + PLASMA_CONFIG="$HOME/.config/plasma-org.kde.plasma.desktop-appletsrc" 40 + if [ -f "$PLASMA_CONFIG" ]; then 41 + echo -e "${GREEN}✓${NC} Config file exists: $PLASMA_CONFIG" 42 + echo " Searching for wallpaper settings..." 43 + grep -i "wallpaper\|image" "$PLASMA_CONFIG" | head -20 44 + else 45 + echo -e "${RED}✗${NC} Config file NOT found: $PLASMA_CONFIG" 46 + fi 47 + echo "" 48 + 49 + # 4. Check plasmashell wallpaper plugin config 50 + echo "4. Checking wallpaper plugin config..." 51 + WALLPAPER_CONFIG="$HOME/.config/plasmarc" 52 + if [ -f "$WALLPAPER_CONFIG" ]; then 53 + echo -e "${GREEN}✓${NC} plasmarc exists" 54 + grep -A 5 "\[Wallpaper\]" "$WALLPAPER_CONFIG" || echo " No [Wallpaper] section found" 55 + else 56 + echo -e "${YELLOW}⚠${NC} plasmarc not found" 57 + fi 58 + echo "" 59 + 60 + # 5. Check if plasma-manager generated config 61 + echo "5. Checking Home Manager generation..." 62 + CURRENT_GEN=$(readlink -f ~/.local/state/home-manager/gcroots/current-home) 63 + if [ -n "$CURRENT_GEN" ]; then 64 + echo -e "${GREEN}✓${NC} Current generation: $CURRENT_GEN" 65 + 66 + # Look for plasma configuration in the generation 67 + if [ -d "$CURRENT_GEN/home-files/.config" ]; then 68 + echo " Searching for plasma configs in generation..." 69 + find "$CURRENT_GEN/home-files/.config" -name "*plasma*" -o -name "*wallpaper*" 2>/dev/null | head -10 70 + fi 71 + else 72 + echo -e "${YELLOW}⚠${NC} Could not find current Home Manager generation" 73 + fi 74 + echo "" 75 + 76 + # 6. Check kwriteconfig5 / kreadconfig5 77 + echo "6. Checking current plasma wallpaper setting..." 78 + if command -v kreadconfig5 &> /dev/null; then 79 + echo " Using kreadconfig5..." 80 + # Try different possible locations 81 + kreadconfig5 --file plasma-org.kde.plasma.desktop-appletsrc --group Containments --group 1 --group Wallpaper --group org.kde.image --group General --key Image 2>/dev/null || echo " (Could not read with kreadconfig5 method 1)" 82 + else 83 + echo -e "${YELLOW}⚠${NC} kreadconfig5 not available" 84 + fi 85 + echo "" 86 + 87 + # 7. Check if plasma-manager service ran 88 + echo "7. Checking systemd user services..." 89 + if systemctl --user list-units --all | grep -q plasma-manager; then 90 + echo -e "${GREEN}✓${NC} plasma-manager service found" 91 + systemctl --user status plasma-manager-apply.service --no-pager -l || true 92 + else 93 + echo -e "${YELLOW}⚠${NC} No plasma-manager service found" 94 + fi 95 + echo "" 96 + 97 + # 8. Check desktop containments 98 + echo "8. Checking desktop containments..." 99 + if [ -f "$PLASMA_CONFIG" ]; then 100 + echo " Containment IDs:" 101 + grep "^\[Containments\]\[" "$PLASMA_CONFIG" | head -10 102 + fi 103 + echo "" 104 + 105 + # 9. Direct search in all plasma configs 106 + echo "9. Searching ALL plasma config files for wallpaper references..." 107 + find ~/.config -name "*plasma*" -type f 2>/dev/null | while read config; do 108 + if grep -qi "wallpaper\|image.*jpg\|image.*png" "$config" 2>/dev/null; then 109 + echo -e "${GREEN}Found in:${NC} $config" 110 + grep -i "wallpaper\|image.*jpg\|image.*png" "$config" | head -5 111 + echo "" 112 + fi 113 + done 114 + echo "" 115 + 116 + # 10. Check if the path in nix config is valid 117 + echo "10. Checking Nix configuration..." 118 + if [ -f "$HOME/.config/nix-config/settings/plasma/default.nix" ]; then 119 + echo -e "${GREEN}✓${NC} Plasma config exists" 120 + echo " Wallpaper line:" 121 + grep -A 1 "wallpaper" "$HOME/.config/nix-config/settings/plasma/default.nix" | head -3 122 + else 123 + echo -e "${RED}✗${NC} Plasma config not found" 124 + fi 125 + echo "" 126 + 127 + echo "==========================================" 128 + echo "DIAGNOSTIC COMPLETE" 129 + echo "==========================================" 130 + echo "" 131 + echo "NEXT STEPS:" 132 + echo "1. If wallpaper file exists but isn't being applied:" 133 + echo " - Try: systemctl --user restart plasma-plasmashell" 134 + echo " - Or log out and back in" 135 + echo "" 136 + echo "2. If plasma-manager service failed:" 137 + echo " - Check: journalctl --user -u plasma-manager-apply.service" 138 + echo "" 139 + echo "3. If wallpaper is not in any config files:" 140 + echo " - Rebuild: sudo nixos-rebuild switch" 141 + echo " - Then log out/in"