Browse Source

[F] Fix hostname compatibility

https://github.com/dylanaraps/neofetch/pull/2095
https://github.com/dylanaraps/neofetch/issues/2094
Azalea (on HyDEV-Daisy) 2 years ago
parent
commit
ccecf6424d
1 changed files with 4 additions and 1 deletions
  1. 4 1
      neofetch

+ 4 - 1
neofetch

@@ -1604,7 +1604,10 @@ get_title() {
 
     case $title_fqdn in
         on) hostname=$(hostname -f) ;;
-        *)  hostname=$(hostname | cut -d. -f1);;
+        *)  
+            hostname=${HOSTNAME:-$(hostname)}
+            hostname=${hostname%.*}
+        ;;
     esac
 
     title=${title_color}${bold}${user}${at_color}@${title_color}${bold}${hostname}