From aab6df0298963fe91a6ebfd1dadbc1530eceeff7 Mon Sep 17 00:00:00 2001 From: Andrew Tropin Date: Thu, 7 Oct 2021 08:12:04 +0300 Subject: [PATCH] home-services: on-first-login: Check if XDG_RUNTIME_DIR exists. * gnu/home-services.scm (on-first-login): on-first-login won't execute anything if XDG_RUNTIME_DIR doesn't exists. --- gnu/home-services.scm | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/gnu/home-services.scm b/gnu/home-services.scm index 9f1e986616..0b77a1321d 100644 --- a/gnu/home-services.scm +++ b/gnu/home-services.scm @@ -286,8 +286,11 @@ will be put in @file{~/.guix-home/files}."))) ;; XDG_RUNTIME_DIR dissapears on logout, that means such trick ;; allows to launch on-first-login script on first login only ;; after complete logout/reboot. - (when (not (file-exists? flag-file-path)) - (begin #$@gexps (touch flag-file-path)))))) + (if (file-exists? xdg-runtime-dir) + (when (not (file-exists? flag-file-path)) + (begin #$@gexps (touch flag-file-path))) + (display "XDG_RUNTIME_DIR doesn't exists, the session wasn't +created, on-first-login script won't execute anything."))))) (define (on-first-login-script-entry m-on-first-login) "Return, as a monadic value, an entry for the on-first-login script -- 2.33.0