~ruther/guix-config

e5198c535fd5dd310dde69ac40c6a4bfebf8f07f — Rutherther 30 days ago ce137e8
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.
1 files changed, 14 insertions(+), 12 deletions(-)

M home/home-configuration.scm
M home/home-configuration.scm => home/home-configuration.scm +14 -12
@@ 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