sdushantha / fontpreview

Highly customizable and minimal font previewer written in bash

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

sxiv: no more files to display, aborting

opened this issue · comments

on my system it displays the first font fine,
then after selecting the second it doesnt display anything.
any chance to fix? thank you @sdushantha

@0rb677 Could you be so kind and send a screen recording of that is happening?

@sdushantha yes
on arch works good.
on fedora-25 seem error. maybe sxiv outdated?
on fedora i use binary fzf and sxiv 24

asciinema play fontpreview.json

fontpreview.zip

Got the same on Fedora 31:

$ > fzf --version
0.20.0
$ > sxiv -v
sxiv 25
$ > bash -x ./fontpreview
++ mktemp -d --tmpdir fontpreview_dir_XXXXXXXX
+ FONTPREVIEW_DIR=/tmp/fontpreview_dir_ez1CV4HM
++ mktemp --tmpdir=/tmp/fontpreview_dir_ez1CV4HM fontpreview_XXXXXXXX.pid
+ PIDFILE=/tmp/fontpreview_dir_ez1CV4HM/fontpreview_CF71akJz.pid
++ mktemp --tmpdir=/tmp/fontpreview_dir_ez1CV4HM fontpreview_XXXXXXXX.png
+ FONT_PREVIEW=/tmp/fontpreview_dir_ez1CV4HM/fontpreview_KAfQT7vV.png
++ mktemp --tmpdir=/tmp/fontpreview_dir_ez1CV4HM fontpreview_XXXXXXXX.termpid
+ TERMWIN_IDFILE=/tmp/fontpreview_dir_ez1CV4HM/fontpreview_qYpLIhfy.termpid
+ VERSION=1.0.0
+ SEARCH_PROMPT=''
+ SIZE=532x365
+ POSITION=+0+0
+ FONT_SIZE=38
+ BG_COLOR='#ffffff'
+ FG_COLOR='#000000'
+ PREVIEW_TEXT='ABCDEFGHIJKLM\nNOPQRSTUVWXYZ\nabcdefghijklm\nnopqrstuvwxyz\n1234567890\n!@$\%(){}[]'
+ trap '' SIGTSTP
+ trap pre_exit EXIT
++ getopt -o h --long position:,size:,version,search-prompt:,font-size:,bg-color:,fg-color:,preview-text:,help --
+ options=' --'
+ eval set -- ' --'
++ set -- --
+ true
+ case "$1" in
+ shift
+ break
+ main
+ dependencies=(xdotool sxiv convert fzf)
+ for dependency in "${dependencies[@]}"
+ type -p xdotool
+ for dependency in "${dependencies[@]}"
+ type -p sxiv
+ for dependency in "${dependencies[@]}"
+ type -p convert
+ for dependency in "${dependencies[@]}"
+ type -p fzf
+ [[ '' != '' ]]
+ [[ '' != '' ]]
+ [[ '' != '' ]]
+ [[ '' != '' ]]
+ [[ '' != '' ]]
+ [[ '' != '' ]]
+ [[ '' != '' ]]
+ xdotool getactivewindow
+ FIRST_RUN=true
+ true
++ convert -list font
++ awk -F: '/^[ ]*Font: /{print substr($NF,2)}'
++ fzf '--prompt=❯ '
+ font=AvantGarde-Book
+ [[ -z AvantGarde-Book ]]
+ generate_preview AvantGarde-Book
+ convert -size 532x365 xc:#ffffff -gravity center -pointsize 38 -font AvantGarde-Book -fill '#000000' -annotate +0+0 'ABCDEFGHIJKLM\nNOPQRSTUVWXYZ\nabcdefghijklm\nnopqrstuvwxyz\n1234567890\n!@$\%(){}[]' -flatten /tmp/fontpreview_dir_ez1CV4HM/fontpreview_KAfQT7vV.png
+ '[' true == true ']'
+ FIRST_RUN=false
+ sxiv -N fontpreview -b -g 532x365+0+0 /tmp/fontpreview_dir_ez1CV4HM/fontpreview_KAfQT7vV.png
++ cat /tmp/fontpreview_dir_ez1CV4HM/fontpreview_qYpLIhfy.termpid
+ xdotool windowfocus 29360142
+ echo 1527903
+ true
++ convert -list font
++ awk -F: '/^[ ]*Font: /{print substr($NF,2)}'
++ fzf '--prompt=❯ '
+ font=AvantGarde-Demi
+ [[ -z AvantGarde-Demi ]]
+ generate_preview AvantGarde-Demi
+ convert -size 532x365 xc:#ffffff -gravity center -pointsize 38 -font AvantGarde-Demi -fill '#000000' -annotate +0+0 'ABCDEFGHIJKLM\nNOPQRSTUVWXYZ\nabcdefghijklm\nnopqrstuvwxyz\n1234567890\n!@$\%(){}[]' -flatten /tmp/fontpreview_dir_ez1CV4HM/fontpreview_KAfQT7vV.png
sxiv: no more files to display, aborting
+ '[' false == true ']'
+ true
++ convert -list font
++ fzf '--prompt=❯ '
++ awk -F: '/^[ ]*Font: /{print substr($NF,2)}'
+ font=
+ [[ -z '' ]]
+ return
+ pre_exit
++ cat /tmp/fontpreview_dir_ez1CV4HM/fontpreview_CF71akJz.pid
+ kill -9 1527903

It seems sxiv doesn't reload the $FONT_PREVIEW file when it is overwritten.

@0rb677 @SmartFinn Could you guys try updating to the latest version of sxiv?
I am currently running the latest version and dont have a problem:

$ sxiv -v
sxiv 26

@sdushantha unfortunately, upgrade to sxiv 26 didn't solve the issue. Let's find a difference in system setup.

It's not SElinux (I disabled it). It's not an tmpfs issue because I tried to save tmp files to btrfs with env TMPDIR="$PWD" bash fontpreview but got the same message.

Well, I dont know what to say about my system...
Here you have this in case that interests you:

$ uname -a
Linux unicorn 5.4.17-1-MANJARO #1 SMP PREEMPT Tue Feb 4 11:40:50 UTC 2020 x86_64 GNU/Linux

Is there something specific you want to know?

@sdushantha could you upload /usr/bin/sxiv file here? I'll try to run on my system.

@sdushantha Thanks. But no luck.

Also had this bug on sxiv 2.6 26 but was fixed with fontpreview 1.0.2 version bump :)

@kraem Thank for letting us know about that!
@SmartFinn Did version 1.0.2 fix the issue for you?

There is no 1.0.2 version. I tested with sxiv 1.3.2 with the following results: sxiv doesn't crash, but the newly generated image doesn't load.

@SmartFinn Oh sorry, my bad. I meant the latest version of fontpreview :)

@sdushantha kinda, sxiv shows the generated image but:

image

@SmartFinn
#23 Would solve this problem, but I think it would take some time to make it

@sdushantha Hi. i just upgraded dom0 to fedora 31 (i use Qubes 4.1 hypervisor)
Fedora 31 Dom0
fzf - 0.20.0
sxiv - 25
xdotool - 3.20190727.1
ImageMagick - 6.9.10-86

Fontpreview works better. Thank you! But if i press q from fzf

[0rb@dom0 ~]$ fontpreview
sxiv: no more files to display, aborting
Restart sxiv - You maybe using a obsolete version. 
/usr/bin/fontpreview: line 46: 65336 Killed                  sxiv -g "$SIZE$POSITION" "$FONT_PREVIEW" -N "fontpreview" -b

sxiv: no more files to display, aborting

Could you check if the image file still exists after getting that error message?

@0rb677

@0rb677 Could you try the latest version of sxiv?
https://github.com/muennich/sxiv/releases/tag/v26

@sdushantha master branch, i also have ueberzug

[0rb@dom0 ~]$ sxiv -version
sxiv v26
[0rb@dom0 ~]$ fontpreview
sxiv: no more files to display, aborting
Restart sxiv - You maybe using a obsolete version. 
[0rb@dom0 ~]$ 

@0rb677

i also have ueberzug

That does not matter right now because fontpreview does not use it now.

Could you check if the image file still exists after you quit fontpreview?

It's been around 2 months and there is not activity. I will be closing this issue since I assume it might be fixed and for the sake of cleaning the open issues. I'll be more than happy to reopen this incase anyone encounters this issue again :)