hackerb9 / lsix

Like "ls", but for images. Shows thumbnails in terminal using sixel graphics.
GNU General Public License v3.0
3.99k stars 129 forks source link

Not worked for arch linux + Konsole #7

Closed zw963 closed 5 years ago

zw963 commented 5 years ago

Following is debug info:

 ╰─ $ lsix *.png
+ numcolors=16
+ background=white
+ foreground=black
+ width=800
+ tilesize=120
+ tilewidth=120
+ tileheight=120
+ fontsize=12
+ [[ 4 -gt 3 ]]
+ timeout=0.25
+ command -v montage
+ trap cleanup SIGINT SIGHUP SIGABRT EXIT
+ main DeepinScreenshot_select-area_20181013011712.png DeepinScreenshot_select-area_20181014150216.png DeepinScreenshot_select-area_20181014150620.png DeepinScreenshot_select-area_20181025221736.png
+ autodetect
+ stty -echo
+ IFS=';'
+ read -a REPLY -s -t 0.25 -d S -p ''
+ [[ '' == \0 ]]
+ [[ xterm-256color =~ mlterm ]]
+ [[ 16 -lt 256 ]]
+ IFS=';'
+ read -a REPLY -s -t 0.25 -d S -p ''
+ [[ '' == \0 ]]
+ IFS=';:/'
+ read -a REPLY -r -s -t 0.25 -d '\' -p '\'
\+ [[ rgb =~ ^rgb ]]
+ background='#000000000000'
+ IFS=';:/'
+ read -a REPLY -r -s -t 0.25 -d '\' -p '\'
\+ [[ '' =~ ^rgb ]]
+ IFS=';'
+ read -a REPLY -s -t 0.25 -d t -p ''
+ [[ 142 == 0 ]]
+ [[ xterm-256color =~ xterm ]]
+ [[ 800 -ge 1000 ]]
+ tilexspace=3
+ tileyspace=1
+ numtiles=6
+ [[ 4 == 0 ]]
+ resize='[120x120]'
+ imoptions='-tile 6x1'
+ imoptions+=' -geometry 120x120>+3+1'
+ imoptions+=' -background #000000000000 -fill black'
+ imoptions+=' -auto-orient '
+ [[ 16 -gt 16 ]]
+ [[ -n '' ]]
+ [[ -n 12 ]]
+ imoptions+=' -pointsize 12 '
+ '[' 4 -gt 0 ']'
+ onerow=()
+ goal=-2
+ '[' 4 -gt 0 -a 4 -gt -2 ']'
+ len=0
+ onerow[len++]=-label
++ processlabel DeepinScreenshot_select-area_20181013011712.png
++ span=15
++ echo -n DeepinScreenshot_select-area_20181013011712.png
++ sed 's|\[0]$||;'
++ tr '[:cntrl:]' '?'
++ awk -v span=15 -v ORS= '
        function halve(s,      l,h) {   # l and h are locals
            l=length(s);  h=int(l/2);
            if (l <= span) { return s; }
            return halve(substr(s, 1, h))  "\n"  halve(substr(s, h+1));
        }
        {
          if ( length($0) > span ) gsub(/\..?.?.?.?$/, "");
          print halve($0);
        }
++ sed 's|%|%%|g; s|\\|\\\\|g; s|@|\\@|g;'
        '
+ onerow[len++]='DeepinScre
enshot_sele
ct-area_201
81013011712'
+ onerow[len++]=DeepinScreenshot_select-area_20181013011712.png
+ shift
+ '[' 3 -gt 0 -a 3 -gt -2 ']'
+ len=3
+ onerow[len++]=-label
++ processlabel DeepinScreenshot_select-area_20181014150216.png
++ span=15
++ echo -n DeepinScreenshot_select-area_20181014150216.png
++ sed 's|\[0]$||;'
++ tr '[:cntrl:]' '?'
++ awk -v span=15 -v ORS= '
        function halve(s,      l,h) {   # l and h are locals
            l=length(s);  h=int(l/2);
            if (l <= span) { return s; }
            return halve(substr(s, 1, h))  "\n"  halve(substr(s, h+1));
        }
        {
          if ( length($0) > span ) gsub(/\..?.?.?.?$/, "");
          print halve($0);
        }
++ sed 's|%|%%|g; s|\\|\\\\|g; s|@|\\@|g;'
        '
+ onerow[len++]='DeepinScre
enshot_sele
ct-area_201
81014150216'
+ onerow[len++]=DeepinScreenshot_select-area_20181014150216.png
+ shift
+ '[' 2 -gt 0 -a 2 -gt -2 ']'
+ len=6
+ onerow[len++]=-label
++ processlabel DeepinScreenshot_select-area_20181014150620.png
++ span=15
++ echo -n DeepinScreenshot_select-area_20181014150620.png
++ sed 's|\[0]$||;'
++ tr '[:cntrl:]' '?'
++ awk -v span=15 -v ORS= '
        function halve(s,      l,h) {   # l and h are locals
            l=length(s);  h=int(l/2);
            if (l <= span) { return s; }
            return halve(substr(s, 1, h))  "\n"  halve(substr(s, h+1));
        }
        {
          if ( length($0) > span ) gsub(/\..?.?.?.?$/, "");
          print halve($0);
        }
        '
++ sed 's|%|%%|g; s|\\|\\\\|g; s|@|\\@|g;'
+ onerow[len++]='DeepinScre
enshot_sele
ct-area_201
81014150620'
+ onerow[len++]=DeepinScreenshot_select-area_20181014150620.png
+ shift
+ '[' 1 -gt 0 -a 1 -gt -2 ']'
+ len=9
+ onerow[len++]=-label
++ processlabel DeepinScreenshot_select-area_20181025221736.png
++ span=15
++ echo -n DeepinScreenshot_select-area_20181025221736.png
++ sed 's|\[0]$||;'
++ tr '[:cntrl:]' '?'
++ awk -v span=15 -v ORS= '
        function halve(s,      l,h) {   # l and h are locals
            l=length(s);  h=int(l/2);
            if (l <= span) { return s; }
            return halve(substr(s, 1, h))  "\n"  halve(substr(s, h+1));
        }
        {
          if ( length($0) > span ) gsub(/\..?.?.?.?$/, "");
          print halve($0);
        }
        '
++ sed 's|%|%%|g; s|\\|\\\\|g; s|@|\\@|g;'
+ onerow[len++]='DeepinScre
enshot_sele
ct-area_201
81025221736'
+ onerow[len++]=DeepinScreenshot_select-area_20181025221736.png
+ shift
+ '[' 0 -gt 0 -a 0 -gt -2 ']'
+ convert - -colors 16 sixel:-
+ montage -label 'DeepinScre
enshot_sele
ct-area_201
81013011712' DeepinScreenshot_select-area_20181013011712.png -label 'DeepinScre
enshot_sele
ct-area_201
81014150216' DeepinScreenshot_select-area_20181014150216.png -label 'DeepinScre
enshot_sele
ct-area_201
81014150620' DeepinScreenshot_select-area_20181014150620.png -label 'DeepinScre
enshot_sele
ct-area_201
81025221736' DeepinScreenshot_select-area_20181025221736.png -tile 6x1 -geometry '120x120>+3+1' -background '#000000000000' -fill black -auto-orient -pointsize 12 gif:-
+ '[' 0 -gt 0 ']'
+ read -s -t 60 -d c -p ''
+ cleanup
+ echo -n ''
+ stty echo
+ exit 0

Thanks

Environment

Arch linux + Gnome 3 + Xorg

zw963 commented 5 years ago

I try it in gnome terminal, it is not work too.

╰─ $ lsix
 ╰─ $ lsix *.png
+ numcolors=16
+ background=white
+ foreground=black
+ width=800
+ tilesize=120
+ tilewidth=120
+ tileheight=120
+ fontsize=12
+ [[ 4 -gt 3 ]]
+ timeout=0.25
+ command -v montage
+ trap cleanup SIGINT SIGHUP SIGABRT EXIT
+ main DeepinScreenshot_select-area_20181013011712.png DeepinScreenshot_select-area_20181014150216.png DeepinScreenshot_select-area_20181014150620.png DeepinScreenshot_select-area_20181025221736.png
+ autodetect
+ stty -echo
+ IFS=';'
+ read -a REPLY -s -t 0.25 -d S -p ''
+ [[ '' == \0 ]]
+ [[ xterm-256color =~ mlterm ]]
+ [[ 16 -lt 256 ]]
+ IFS=';'
+ read -a REPLY -s -t 0.25 -d S -p ''
+ [[ '' == \0 ]]
+ IFS=';:/'
+ read -a REPLY -r -s -t 0.25 -d '\' -p ''
+ [[ rgb =~ ^rgb ]]
+ background='#ffffffffffff'
+ IFS=';:/'
+ read -a REPLY -r -s -t 0.25 -d '\' -p ''
+ [[ rgb =~ ^rgb ]]
+ foreground='#ffffffffffff'
+ IFS=';?$'
+ read -a REPLY -s -t 0.25 -d y -p ''
+ [[ rgb:2e2e/3434/3636]
+ [[ rgb:2e2e/3434/3636]
+ IFS=';'
+ read -a REPLY -s -t 0.25 -d t -p ''
+ [[ 0 == 0 ]]
+ [[ 1904 -gt 0 ]]
+ width=1904
+ [[ xterm-256color =~ xterm ]]
+ [[ 1904 -ge 1000 ]]
+ width=1000
+ tilexspace=4
+ tileyspace=2
+ numtiles=7
+ [[ 4 == 0 ]]
+ resize='[120x120]'
+ imoptions='-tile 7x1'
+ imoptions+=' -geometry 120x120>+4+2'
+ imoptions+=' -background #ffffffffffff -fill #ffffffffffff'
+ imoptions+=' -auto-orient '
+ [[ 16 -gt 16 ]]
+ [[ -n '' ]]
+ [[ -n 12 ]]
+ imoptions+=' -pointsize 12 '
+ '[' 4 -gt 0 ']'
+ onerow=()
+ goal=-3
+ '[' 4 -gt 0 -a 4 -gt -3 ']'
+ len=0
+ onerow[len++]=-label
++ processlabel DeepinScreenshot_select-area_20181013011712.png
++ span=15
++ echo -n DeepinScreenshot_select-area_20181013011712.png
++ sed 's|\[0]$||;'
++ tr '[:cntrl:]' '?'
++ awk -v span=15 -v ORS= '
    function halve(s,      l,h) {   # l and h are locals
        l=length(s);  h=int(l/2);
        if (l <= span) { return s; }
        return halve(substr(s, 1, h))  "\n"  halve(substr(s, h+1));
    }
    {
      if ( length($0) > span ) gsub(/\..?.?.?.?$/, "");
      print halve($0);
        }
        '
++ sed 's|%|%%|g; s|\\|\\\\|g; s|@|\\@|g;'
+ onerow[len++]='DeepinScre
enshot_sele
ct-area_201
81013011712'
+ onerow[len++]=DeepinScreenshot_select-area_20181013011712.png
+ shift
+ '[' 3 -gt 0 -a 3 -gt -3 ']'
+ len=3
+ onerow[len++]=-label
++ processlabel DeepinScreenshot_select-area_20181014150216.png
++ span=15
++ echo -n DeepinScreenshot_select-area_20181014150216.png
++ sed 's|\[0]$||;'
++ tr '[:cntrl:]' '?'
++ awk -v span=15 -v ORS= '
    function halve(s,      l,h) {   # l and h are locals
        l=length(s);  h=int(l/2);
        if (l <= span) { return s; }
        return halve(substr(s, 1, h))  "\n"  halve(substr(s, h+1));
    }
    {
      if ( length($0) > span ) gsub(/\..?.?.?.?$/, "");
      print halve($0);
        }
        '
++ sed 's|%|%%|g; s|\\|\\\\|g; s|@|\\@|g;'
+ onerow[len++]='DeepinScre
enshot_sele
ct-area_201
81014150216'
+ onerow[len++]=DeepinScreenshot_select-area_20181014150216.png
+ shift
+ '[' 2 -gt 0 -a 2 -gt -3 ']'
+ len=6
+ onerow[len++]=-label
++ processlabel DeepinScreenshot_select-area_20181014150620.png
++ span=15
++ echo -n DeepinScreenshot_select-area_20181014150620.png
++ sed 's|\[0]$||;'
++ tr '[:cntrl:]' '?'
++ awk -v span=15 -v ORS= '
    function halve(s,      l,h) {   # l and h are locals
        l=length(s);  h=int(l/2);
        if (l <= span) { return s; }
        return halve(substr(s, 1, h))  "\n"  halve(substr(s, h+1));
    }
    {
      if ( length($0) > span ) gsub(/\..?.?.?.?$/, "");
      print halve($0);
        }
        '
++ sed 's|%|%%|g; s|\\|\\\\|g; s|@|\\@|g;'
+ onerow[len++]='DeepinScre
enshot_sele
ct-area_201
81014150620'
+ onerow[len++]=DeepinScreenshot_select-area_20181014150620.png
+ shift
+ '[' 1 -gt 0 -a 1 -gt -3 ']'
+ len=9
+ onerow[len++]=-label
++ processlabel DeepinScreenshot_select-area_20181025221736.png
++ span=15
++ echo -n DeepinScreenshot_select-area_20181025221736.png
++ sed 's|\[0]$||;'
++ tr '[:cntrl:]' '?'
++ awk -v span=15 -v ORS= '
    function halve(s,      l,h) {   # l and h are locals
        l=length(s);  h=int(l/2);
        if (l <= span) { return s; }
        return halve(substr(s, 1, h))  "\n"  halve(substr(s, h+1));
    }
    {
      if ( length($0) > span ) gsub(/\..?.?.?.?$/, "");
      print halve($0);
        }
        '
++ sed 's|%|%%|g; s|\\|\\\\|g; s|@|\\@|g;'
+ onerow[len++]='DeepinScre
enshot_sele
ct-area_201
81025221736'
+ onerow[len++]=DeepinScreenshot_select-area_20181025221736.png
+ shift
+ '[' 0 -gt 0 -a 0 -gt -3 ']'
+ montage -label 'DeepinScre
enshot_sele
ct-area_201
81013011712' DeepinScreenshot_select-area_20181013011712.png -label 'DeepinScre
enshot_sele
ct-area_201
+ convert - -colors 16 sixel:-
81014150216' DeepinScreenshot_select-area_20181014150216.png -label 'DeepinScre
enshot_sele
ct-area_201
81014150620' DeepinScreenshot_select-area_20181014150620.png -label 'DeepinScre
enshot_sele
ct-area_201
81025221736' DeepinScreenshot_select-area_20181025221736.png -tile 7x1 -geometry '120x120>+4+2' -background '#ffffffffffff' -fill '#ffffffffffff' -auto-orient -pointsize 12 gif:-
+ '[' 0 -gt 0 ']'
+ read -s -t 60 -d c -p ''
+ cleanup
+ echo -n ''
+ stty echo
+ exit 0
hackerb9 commented 5 years ago

Do Konsole and Gnome Terminal support the Sixel graphics protocol? Last time I used them, they did not. Try running xterm in vt340 terminal mode like so:

xterm -ti vt340

Does lsix work for you inside xterm?

If it does, you can set up xterm's default terminal type to always be vt340 by following the instructions here:

https://github.com/hackerb9/lsix#your-terminal-must-support-sixel-graphics