Explorar o código

Adding pot terminal image backend (#1482)

SeungheonOh %!s(int64=5) %!d(string=hai) anos
pai
achega
77a34f884d
Modificáronse 1 ficheiros con 12 adicións e 4 borrados
  1. 12 4
      neofetch

+ 12 - 4
neofetch

@@ -732,7 +732,7 @@ disk_display="off"
 #
 #
 # Default:  'ascii'
 # Default:  'ascii'
 # Values:   'ascii', 'caca', 'chafa', 'jp2a', 'iterm2', 'off',
 # Values:   'ascii', 'caca', 'chafa', 'jp2a', 'iterm2', 'off',
-#           'termpix', 'pixterm', 'tycat', 'w3m', 'kitty'
+#           'pot', 'termpix', 'pixterm', 'tycat', 'w3m', 'kitty'
 # Flag:     --backend
 # Flag:     --backend
 image_backend="ascii"
 image_backend="ascii"
 
 
@@ -3792,7 +3792,7 @@ image_backend() {
         "off") image_backend="off" ;;
         "off") image_backend="off" ;;
 
 
         "caca" | "chafa" | "jp2a" | "iterm2" | "termpix" |\
         "caca" | "chafa" | "jp2a" | "iterm2" | "termpix" |\
-        "tycat" | "w3m" | "sixel" | "pixterm" | "kitty")
+        "tycat" | "w3m" | "sixel" | "pixterm" | "kitty" | "pot")
             get_image_source
             get_image_source
 
 
             [[ ! -f "$image" ]] && {
             [[ ! -f "$image" ]] && {
@@ -3817,7 +3817,7 @@ image_backend() {
         *)
         *)
             err "Image: Unknown image backend specified '$image_backend'."
             err "Image: Unknown image backend specified '$image_backend'."
             err "Image: Valid backends are: 'ascii', 'caca', 'chafa', 'jp2a', 'iterm2', 'kitty',
             err "Image: Valid backends are: 'ascii', 'caca', 'chafa', 'jp2a', 'iterm2', 'kitty',
-                                            'off', 'sixel', 'pixterm', 'termpix', 'tycat', 'w3m')"
+                                            'off', 'sixel', 'pot', 'pixterm', 'termpix', 'tycat', 'w3m')"
             err "Image: Falling back to ascii mode."
             err "Image: Falling back to ascii mode."
             print_ascii
             print_ascii
         ;;
         ;;
@@ -4219,6 +4219,13 @@ display_image() {
             "$image"
             "$image"
         ;;
         ;;
 
 
+        "pot")
+            pot \
+                "$image" \
+                --size="$((width / font_width))x$((height / font_height))" \
+                --loader=std
+        ;;
+
         "pixterm")
         "pixterm")
             pixterm \
             pixterm \
                 -tc "$((width / font_width))" \
                 -tc "$((width / font_width))" \
@@ -4845,6 +4852,7 @@ IMAGE BACKEND:
     --iterm2 source             Shortcut to use 'iterm2' backend.
     --iterm2 source             Shortcut to use 'iterm2' backend.
     --jp2a source               Shortcut to use 'jp2a' backend.
     --jp2a source               Shortcut to use 'jp2a' backend.
     --kitty source              Shortcut to use 'kitty' backend.
     --kitty source              Shortcut to use 'kitty' backend.
+    --pot source                Shortcut to use 'pot' backend.
     --pixterm source            Shortcut to use 'pixterm' backend.
     --pixterm source            Shortcut to use 'pixterm' backend.
     --sixel source              Shortcut to use 'sixel' backend.
     --sixel source              Shortcut to use 'sixel' backend.
     --termpix source            Shortcut to use 'termpix' backend.
     --termpix source            Shortcut to use 'termpix' backend.
@@ -5062,7 +5070,7 @@ get_args() {
             # Image backend
             # Image backend
             "--backend") image_backend="$2" ;;
             "--backend") image_backend="$2" ;;
             "--source") image_source="$2" ;;
             "--source") image_source="$2" ;;
-            "--ascii" | "--caca" | "--chafa" | "--jp2a" | "--iterm2" | "--off" | "--pixterm" |\
+            "--ascii" | "--caca" | "--chafa" | "--jp2a" | "--iterm2" | "--off" | "--pot" | "--pixterm" |\
             "--sixel" | "--termpix" | "--tycat" | "--w3m" | "--kitty")
             "--sixel" | "--termpix" | "--tycat" | "--w3m" | "--kitty")
                 image_backend="${1/--}"
                 image_backend="${1/--}"
                 case $2 in
                 case $2 in