sdushantha / fontpreview

Highly customizable and minimal font previewer written in bash
MIT License
916 stars 39 forks source link

sxiv: no more files to display, aborting #14

Closed ghost closed 4 years ago

ghost commented 4 years ago

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

sdushantha commented 4 years ago

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

ghost commented 4 years ago

@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

SmartFinn commented 4 years ago

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.

sdushantha commented 4 years ago

@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
SmartFinn commented 4 years ago

@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.

sdushantha commented 4 years ago

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?

SmartFinn commented 4 years ago

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

sdushantha commented 4 years ago

@SmartFinn https://0x0.st/i-i5.so

SmartFinn commented 4 years ago

@sdushantha Thanks. But no luck.

kraem commented 4 years ago

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

sdushantha commented 4 years ago

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

SmartFinn commented 4 years ago

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.

sdushantha commented 4 years ago

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

SmartFinn commented 4 years ago

@sdushantha kinda, sxiv shows the generated image but:

image

sdushantha commented 4 years ago

@SmartFinn

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

ghost commented 4 years ago

@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
sdushantha commented 4 years ago

sxiv: no more files to display, aborting

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

@0rb677

sdushantha commented 4 years ago

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

ghost commented 4 years ago

@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 ~]$ 
sdushantha commented 4 years ago

@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?

sdushantha commented 4 years ago

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 :)