Merge remote-tracking branch 'origin/github/pr/102'
[grml-etc-core.git] / etc / zsh / zshrc
index 2875222..31b83a0 100644 (file)
@@ -843,6 +843,8 @@ function grmlcomp () {
       localname=$(hostname)
     elif check_com hostnamectl ; then
       localname=$(hostnamectl --static)
+    else
+      localname="$(uname -n)"
     fi
 
     hosts=(
@@ -1864,7 +1866,7 @@ done
 function batterydarwin () {
 GRML_BATTERY_LEVEL=''
 local -a table
-table=( ${$(pmset -g ps)[(w)7,8]%%(\%|);} )
+table=( ${$(pmset -g ps)[(w)8,9]%%(\%|);} )
 if [[ -n $table[2] ]] ; then
     case $table[2] in
         charging)
@@ -2522,6 +2524,8 @@ function grml_maintain_name () {
       localname=$(hostname)
     elif check_com hostnamectl ; then
       localname=$(hostnamectl --static)
+    else
+      localname="$(uname -n)"
     fi
 
     # set hostname if not running on local machine
@@ -3490,6 +3494,11 @@ function simple-extract () {
                 USES_STDIN=true
                 USES_STDOUT=false
                 ;;
+            *tar.zst)
+                DECOMP_CMD="tar --zstd -xvf -"
+                USES_STDIN=true
+                USES_STDOUT=false
+                ;;
             *tar)
                 DECOMP_CMD="tar -xvf -"
                 USES_STDIN=true
@@ -3535,6 +3544,11 @@ function simple-extract () {
                 USES_STDIN=true
                 USES_STDOUT=true
                 ;;
+            *zst)
+                DECOMP_CMD="zstd -d -c -"
+                USES_STDIN=true
+                USES_STDOUT=true
+                ;;
             *)
                 print "ERROR: '$ARCHIVE' has unrecognized archive type." >&2
                 RC=$((RC+1))