diff options
| author | Michael Hoang <enzime@users.noreply.github.com> | 2024-07-23 11:14:49 +1000 |
|---|---|---|
| committer | Michael Hoang <enzime@users.noreply.github.com> | 2024-07-25 12:24:30 +1000 |
| commit | a566238826fc77b2322b62cd52c321db8c30a1f4 (patch) | |
| tree | f0137fcc993ecc226d56c012acc9bb292f9dfee0 /modules | |
| parent | 2ae24bcafdb88fdf70b061cc8b18d070dbd9013a (diff) | |
defaults: only restart Dock when user is logged in
Diffstat (limited to 'modules')
| -rw-r--r-- | modules/system/defaults-write.nix | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/modules/system/defaults-write.nix b/modules/system/defaults-write.nix index 33e918e..18be408 100644 --- a/modules/system/defaults-write.nix +++ b/modules/system/defaults-write.nix @@ -109,8 +109,11 @@ in ${concatStringsSep "\n" CustomUserPreferences} ${optionalString (length dock > 0) '' - echo >&2 "restarting Dock..." - killall Dock + # Only restart Dock if current user is logged in + if pgrep -xu $UID Dock; then + echo >&2 "restarting Dock..." + killall Dock || true + fi ''} ''; |
