summaryrefslogtreecommitdiffstats
path: root/lass/2configs/themes.nix
diff options
context:
space:
mode:
authorlassulus <lassulus@lassul.us>2022-04-15 18:42:28 +0200
committerlassulus <lassulus@lassul.us>2022-04-15 18:42:28 +0200
commit92d5eacd6d9e530c4d1ea0dec2652417b0fde78a (patch)
tree1f7222e38ea35976848e125a158abf04b57e52d9 /lass/2configs/themes.nix
parent4815c90f4d9fe281779f5f474543d62d60be3ab3 (diff)
l themes: fix startup
Diffstat (limited to 'lass/2configs/themes.nix')
-rw-r--r--lass/2configs/themes.nix13
1 files changed, 10 insertions, 3 deletions
diff --git a/lass/2configs/themes.nix b/lass/2configs/themes.nix
index dd98b2ef2..118619c1d 100644
--- a/lass/2configs/themes.nix
+++ b/lass/2configs/themes.nix
@@ -1,12 +1,18 @@
{ config, lib, pkgs, ... }: let
switch-theme = pkgs.writers.writeDashBin "switch-theme" ''
- if test -e "/etc/themes/$1"; then
+ set -efux
+ if [ "$1" = toggle ]; then
+ if [ "$(${pkgs.coreutils}/bin/cat /var/theme/current_theme)" = dark ]; then
+ ${placeholder "out"}/bin/switch-theme light
+ else
+ ${placeholder "out"}/bin/switch-theme dark
+ fi
+ elif test -e "/etc/themes/$1"; then
${pkgs.rsync}/bin/rsync --chown=lass:users -a --delete "/etc/themes/$1/" /var/theme/config/
echo "$1" > /var/theme/current_theme
- chown lass:users /var/theme/current_theme
+ ${pkgs.coreutils}/bin/chown lass:users /var/theme/current_theme
${pkgs.procps}/bin/pkill -HUP xsettingsd
-
else
echo "theme $1 not found"
fi
@@ -15,6 +21,7 @@
in {
systemd.services.xsettingsd = {
wantedBy = [ "multi-user.target" ];
+ after = [ "display-manager.service" ];
environment.DISPLAY = ":0";
serviceConfig = {
ExecStart = "${pkgs.xsettingsd}/bin/xsettingsd -c /var/theme/config/xsettings.conf";