From e5198c535fd5dd310dde69ac40c6a4bfebf8f07f Mon Sep 17 00:00:00 2001 From: Rutherther Date: Sun, 17 Aug 2025 17:03:57 +0200 Subject: [PATCH] fix: prevent error loading shell profile when tty empty When started out of tty, $(tty) is null, and [ $(tty) = /dev/tty1 ] ends up in [ = /dev/tty1 ], and this produces an error. Instead, switch to bash syntax with double [, and move it to bash profile to prevent issues in case ~/.profile is actually loaded from sh and not bash. --- home/home-configuration.scm | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/home/home-configuration.scm b/home/home-configuration.scm index 4e93dab5b25f10a7c1d8a554b0937841b7daec82..175fadedfb385f8d3146e0f8153ce4ae355789ba 100644 --- a/home/home-configuration.scm +++ b/home/home-configuration.scm @@ -296,20 +296,22 @@ $XDG_DATA_DIRS") (simple-service 'start-dwl-on-tty - home-shell-profile-service-type - (list - (mixed-text-file "start-dwl-tty" - #~(format - #f - "[ $(tty) = /dev/tty~a ] && \\ + home-bash-service-type + (home-bash-extension + (bash-profile + (list + (mixed-text-file "start-dwl-tty" + #~(format + #f + "[[ $(tty) = /dev/tty~a ]] && \\ ~a -p \"$(~a ~a)\" && \\ exec ~a ~a" - 1 - #$(file-append coreutils "/bin/mkdir") - #$(file-append coreutils "/bin/dirname") - "$XDG_STATE_HOME/log/dwl.log" - #$(start-dwl #:dwl dwl-mine #:waybar waybar-mine) - #$(string-join (list ">>" "$XDG_STATE_HOME/log/dwl.log" "2>&1") " "))))) + 1 + #$(file-append coreutils "/bin/mkdir") + #$(file-append coreutils "/bin/dirname") + "$XDG_STATE_HOME/log/dwl.log" + #$(start-dwl #:dwl dwl-mine #:waybar waybar-mine) + #$(string-join (list ">>" "$XDG_STATE_HOME/log/dwl.log" "2>&1") " "))))))) (simple-service 'default-fonts home-fontconfig-service-type