This repository has no description
0

Configure Feed

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

2configs/themes: integrate noctalia-shell theme switching

+33
+15
2configs/themes.nix
··· 10 10 ${placeholder "out"}/bin/switch-theme dark 11 11 fi 12 12 elif test -e "/etc/themes/$1"; then 13 + # Skip if already on the requested theme (prevents loops with noctalia hook) 14 + if [ "$(${pkgs.coreutils}/bin/cat /var/theme/current_theme 2>/dev/null)" = "$1" ]; then 15 + exit 0 16 + fi 13 17 ${pkgs.coreutils}/bin/mkdir -p /var/theme/config 14 18 ${pkgs.rsync}/bin/rsync --chown=lass:users -a --delete "/etc/themes/$1/" /var/theme/config/ 15 19 echo "$1" > /var/theme/current_theme ··· 27 31 ${pkgs.kitty}/bin/kitten @ --to unix:"$sock" set-colors -a /var/theme/config/kitty-colors.conf 2>/dev/null || : 28 32 done 29 33 set -f 34 + # Update noctalia-shell dark mode setting (it watches settings.json for changes) 35 + noctalia_settings="''${XDG_CONFIG_HOME:-$HOME/.config}/noctalia/settings.json" 36 + if test -f "$noctalia_settings"; then 37 + if [ "$1" = dark ]; then 38 + noctalia_dark=true 39 + else 40 + noctalia_dark=false 41 + fi 42 + ${pkgs.jq}/bin/jq ".colorSchemes.darkMode = $noctalia_dark" "$noctalia_settings" > "$noctalia_settings.tmp" && \ 43 + ${pkgs.coreutils}/bin/mv "$noctalia_settings.tmp" "$noctalia_settings" || : 44 + fi 30 45 else 31 46 echo "theme $1 not found" 32 47 fi
+18
2configs/desktops/sway/noctalia.nix
··· 74 74 services.udev.extraRules = '' 75 75 SUBSYSTEM=="powercap", ACTION=="add", RUN+="${pkgs.coreutils}/bin/chmod a+r /sys/class/powercap/%k/energy_uj" 76 76 ''; 77 + 78 + # Configure noctalia darkModeChange hook to trigger switch-theme 79 + # This makes noctalia's dark mode button also switch the system theme 80 + system.activationScripts.noctalia-hooks.text = 81 + let 82 + jq = "${pkgs.jq}/bin/jq"; 83 + settingsFile = "/home/${config.users.users.mainUser.name}/.config/noctalia/settings.json"; 84 + in 85 + '' 86 + if [ -f "${settingsFile}" ]; then 87 + ${jq} ' 88 + .hooks.enabled = true | 89 + .hooks.darkModeChange = "if [ \"$1\" = \"true\" ]; then switch-theme dark; else switch-theme light; fi" 90 + ' "${settingsFile}" > "${settingsFile}.tmp" && \ 91 + mv "${settingsFile}.tmp" "${settingsFile}" && \ 92 + chown ${config.users.users.mainUser.name}:users "${settingsFile}" || true 93 + fi 94 + ''; 77 95 }