Explorar el Código

[F] Fix hostname compatibility

https://github.com/dylanaraps/neofetch/pull/2095
https://github.com/dylanaraps/neofetch/issues/2094
Azalea (on HyDEV-Daisy) hace 3 años
padre
commit
ccecf6424d
Se han modificado 1 ficheros con 4 adiciones y 1 borrados
  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}