l themes: fix startup
This commit is contained in:
parent
4815c90f4d
commit
92d5eacd6d
|
@ -1,12 +1,18 @@
|
||||||
{ config, lib, pkgs, ... }: let
|
{ config, lib, pkgs, ... }: let
|
||||||
|
|
||||||
switch-theme = pkgs.writers.writeDashBin "switch-theme" ''
|
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/
|
${pkgs.rsync}/bin/rsync --chown=lass:users -a --delete "/etc/themes/$1/" /var/theme/config/
|
||||||
echo "$1" > /var/theme/current_theme
|
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
|
${pkgs.procps}/bin/pkill -HUP xsettingsd
|
||||||
|
|
||||||
else
|
else
|
||||||
echo "theme $1 not found"
|
echo "theme $1 not found"
|
||||||
fi
|
fi
|
||||||
|
@ -15,6 +21,7 @@
|
||||||
in {
|
in {
|
||||||
systemd.services.xsettingsd = {
|
systemd.services.xsettingsd = {
|
||||||
wantedBy = [ "multi-user.target" ];
|
wantedBy = [ "multi-user.target" ];
|
||||||
|
after = [ "display-manager.service" ];
|
||||||
environment.DISPLAY = ":0";
|
environment.DISPLAY = ":0";
|
||||||
serviceConfig = {
|
serviceConfig = {
|
||||||
ExecStart = "${pkgs.xsettingsd}/bin/xsettingsd -c /var/theme/config/xsettings.conf";
|
ExecStart = "${pkgs.xsettingsd}/bin/xsettingsd -c /var/theme/config/xsettings.conf";
|
||||||
|
|
Loading…
Reference in a new issue