From 1c0382befa70a2236be393469277ed66ab04a569 Mon Sep 17 00:00:00 2001 From: Nathan McCarty Date: Wed, 19 Apr 2023 18:32:01 -0400 Subject: [PATCH] Move glpaper to a user service --- machines/levitation/home.nix | 26 +++++++++++++++++++++----- 1 file changed, 21 insertions(+), 5 deletions(-) diff --git a/machines/levitation/home.nix b/machines/levitation/home.nix index a6df25d..94293d0 100644 --- a/machines/levitation/home.nix +++ b/machines/levitation/home.nix @@ -26,16 +26,32 @@ }; input = { "type:pointer" = { pointer_accel = "-0.3"; }; }; startup = [ - # GLPaper - # { command = "glpaper DP-1 ${../../custom-files/sway/selen.frag} --fork"; } - { - command = "glpaper DP-1 ${../../custom-files/sway/selen.frag} --fork"; - } # Up the mouse dpi { command = "solaar config 1 dpi 4000"; } ]; }; + # Sway background + + # Spin up glpaper as a user service so we can have it restart on failure (liable due to kvm switch + # disconnecting input) + systemd.user.services.glpaper-dp1 = { + Unit = { + Description = "glpaper (DP-1)"; + After = [ "graphical-session.target" ]; + }; + Service = { + Type = "simple"; + ExecStart = '' + /etc/profiles/per-user/nathan/bin/glpaper DP-1 ${ + ../../custom-files/sway/selen.frag + } + ''; + Restart = "always"; + }; + Install = { WantedBy = [ "graphical-session.target" ]; }; + }; + # Gammastep services.gammastep = { enable = true;