Zathura PDF viewer

Word processors, spreadsheets, presentations, translation, etc.
Message
Author
User avatar
Iguleder
Posts: 2026
Joined: Tue 11 Aug 2009, 09:36
Location: Israel, somewhere in the beautiful desert
Contact:

Zathura PDF viewer

#1 Post by Iguleder »

Here's the best PDF viewer I've ever seen: Zathura.

Very minimalistic, very very very lightweight and awesome for small screens.

Image
Attachments
zathura-0.0.8.3.pet
(30.27 KiB) Downloaded 1417 times
zathura-0.0.8.3.tar.gz
sources
(33.58 KiB) Downloaded 1136 times
[url=http://dimakrasner.com/]My homepage[/url]
[url=https://github.com/dimkr]My GitHub profile[/url]
User avatar
vovchik
Posts: 1507
Joined: Tue 24 Oct 2006, 00:02
Location: Ukraine

zathura documentation

#2 Post by vovchik »

Dear Iguleder,

Many thanks for this little gem. It actually works nicely, but you have to know the keystrokes, which might not be obvious. To that end, here is a little pdf file made from the man page. The main thing to remember are the keys "a" and "s" (zoom to fit and zoom to fit respectively).

With kind regards,
vovchik

PS. It compiles nearly instantly with a simple make file.
Attachments
zathura.pdf.tar.gz
(25.86 KiB) Downloaded 1175 times
User avatar
ttuuxxx
Posts: 11171
Joined: Sat 05 May 2007, 10:00
Location: Ontario Canada,Sydney Australia
Contact:

#3 Post by ttuuxxx »

sounds like someone should take this on as a project and add a simple gui with zoom/print screen, file open dialog, next and previous page and that's about it :)
ttuuxxx
http://audio.online-convert.com/ <-- excellent site
http://samples.mplayerhq.hu/A-codecs/ <-- Codec Test Files
http://html5games.com/ <-- excellent HTML5 games :)
User avatar
L18L
Posts: 3479
Joined: Sat 19 Jun 2010, 18:56
Location: www.eussenheim.de/

Zathura PDF viewer

#4 Post by L18L »

ttuuxxx wrote:sounds like someone should take this on as a project and add a simple gui with zoom/print screen, file open dialog, next and previous page and that's about it :)
ttuuxxx
Maybe I could be the one if it worked in wary :( :?:

Code: Select all

# zathura
zathura: error while loading shared libraries: libpoppler-glib.so.4: cannot open shared object file: No such file or directory
# 
User avatar
ttuuxxx
Posts: 11171
Joined: Sat 05 May 2007, 10:00
Location: Ontario Canada,Sydney Australia
Contact:

Re: Zathura PDF viewer

#5 Post by ttuuxxx »

L18L wrote:
ttuuxxx wrote:sounds like someone should take this on as a project and add a simple gui with zoom/print screen, file open dialog, next and previous page and that's about it :)
ttuuxxx
Maybe I could be the one if it worked in wary :( :?:

Code: Select all

# zathura
zathura: error while loading shared libraries: libpoppler-glib.so.4: cannot open shared object file: No such file or directory
# 
just locate libpoppler-glib.so and make a system link called libpoppler-glib.so.4 and iy should work.
ttuuxxx
http://audio.online-convert.com/ <-- excellent site
http://samples.mplayerhq.hu/A-codecs/ <-- Codec Test Files
http://html5games.com/ <-- excellent HTML5 games :)
User avatar
L18L
Posts: 3479
Joined: Sat 19 Jun 2010, 18:56
Location: www.eussenheim.de/

Re: Zathura PDF viewer

#6 Post by L18L »

ttuuxxx wrote:just locate libpoppler-glib.so and make a system link called libpoppler-glib.so.4 and iy should work.

Code: Select all

# ln -s /usr/lib/libpoppler-glib.so.5.0.0 /usr/lib/libpoppler-glib.so.4
Thank you :)
that was in wary511q
User avatar
L18L
Posts: 3479
Joined: Sat 19 Jun 2010, 18:56
Location: www.eussenheim.de/

Zathura PDF viewer

#7 Post by L18L »

simplePDFreader
download to /root/my-applications/bin
dependency: yad (pet-packages-common: yad and yad-nls)

Code: Select all

#!/bin/sh
#
# simplePDFreader: gui for zathura pdf reader
# 2011-07-14 2011-07-17 L18L seaside
# required: yad version >= 0.9.0
#
RESTART=$0
file=$1            # file to read
#
export TEXTDOMAIN=simple_yad
export OUTPUT_CHARSET=UTF-8
#

title=$(gettext "simplePDFreader zathura")
zathura_manual=`find -name zathura.pdf` # <smile>
echo $zathura_manual

shortcuts="<b> $(gettext 'Shortcuts (^ is Ctrl)') </b> 
 <span color='red'>J</span>	$(gettext 'Go to next page')
 K	$(gettext 'Go to previous page') 
 h	$(gettext 'Scroll to the left') 
 k	$(gettext 'Scroll upwards') 
 j	$(gettext 'Scroll downwards') 
 ^f	$(gettext 'Scroll page down')
 ^b	$(gettext 'Scroll page up') 
 ^d	$(gettext 'Scroll half a page down')
 ^u	$(gettext 'Scroll half a page up')
 l	$(gettext 'Scroll to the right') 
 <span color='red'>+</span>	$(gettext 'Zoom in') 
 -	$(gettext 'Zoom out')"
 
exitus(){
 kill `cat /tmp/simplePDFreader_PID` 2> /dev/null
 kill `cat /tmp/simplePDFreader_mPID` 2> /dev/null
 exit 0	
}

select_directory()
{
 dir=$(yad --title="$title" \
           --width="450"    \
           --height="300"   \
           --separator=""   \
           --text="    <span stretch='expanded' color='#330099'>$(gettext 'select the <b>directory</b> where to search for PDF files</span>')"   \
           --file-selection           \
           --directory      \
           --filename="/usr/share/examples/"      \
       )
[[ $? -eq 1 ]] && exitus
 list_pdfs_of_dir $dir
}

list_pdfs_of_dir()
{
 dir=$1
 file="" 
 until [ "$file" != "" ]
 do
  file=$(find $1 -name '*.pdf' | yad --title="$title" \
        --height="250"                                \
        --separator=""                                \
        --text="    <span stretch='expanded' color='#009933'><i>$(gettext 'Select the <b>file</b> you want to read:</i></span>')"   \
        --list --column="PDF files in your $dir directory"  \
        --button="gtk-go-up:3" \
        --button="gtk-find:2"  \
		--button="gtk-help:4"  \
		--button="gtk-quit:1"  \
		--button="gtk-ok:0"    \
       )
  result=$?      
  case $result in
  1) exitus ;;
  2) select_directory ;;
  3) dir=`dirname $dir` ; list_pdfs_of_dir $dir ;;
  4) if [ "$zathura_manual" != "" ] 
     then
      shortcuts 
      zathura "$zathura_manual" & 
      mPID=$!
      echo $mPID > /tmp/simplePDFreader_mPID
     else yad --button="gtk-ok" --text="Sorry, missing zathura.pdf"
     fi
     ;;
  esac
 done
 echo "file=$file"
 [ "$file" = "" ] && select_directory 
}

shortcuts()
{
 if [ `ps | grep 'yad --title=simplePDFreader' | wc -l` -lt 2 ] 
 then
  ## Shortcuts top left sticky
  yad --title="simplePDFreader" --text="$shortcuts" --no-buttons --geometry="80x200+0+0" --sticky &
  sPID=$!
  echo $sPID > /tmp/simplePDFreader_PID
 fi 
}

##  if no argument we start showing a list of pdf files under $HOME
 [ ! -f "$file" ] && list_pdfs_of_dir $HOME

shortcuts

## lauch viewer
echo lauch viewer $file
zathura "$file"

# continue
file="`echo $file | tr ' ' '_'`"     # just to make sure that dirname will work
echo "file=$file"
dir=`dirname $file`
 [ "$dir" = "" ] && dir=/usr/share     # there are some pdf's
echo "continue dir=$dir/"
list_pdfs_of_dir "$dir/"
$RESTART "$file"
#end of script
Attachments
zathura-gui.png
-
(20.72 KiB) Downloaded 9003 times
Last edited by L18L on Sun 17 Jul 2011, 12:29, edited 3 times in total.
seaside
Posts: 934
Joined: Thu 12 Apr 2007, 00:19

#8 Post by seaside »

L18L,

That's a good start for a Zathura PDF viewer gui.

There are a few items that you might want to add.

If you use this following form of directory selection, you won't need two dialogs, be able to go to any directory and, additionally, you'll get a *.pdf filter.

Code: Select all

yad  --file-selection --file-filter="Pdf files | *.pdf"
Also, the font command is "--font=" (not "--fontname=") and the "on-top" command doesn't work, but can be utilized by making a "--class" with a matching entry in JWM.

Cheers,
s
User avatar
L18L
Posts: 3479
Joined: Sat 19 Jun 2010, 18:56
Location: www.eussenheim.de/

Zathura PDF viewer

#9 Post by L18L »

seaside,

thank you for your comment
on-top does not work
fontname does not work -> it is used for preselecting a font in fontselect

Thanks for explaining the filter thing

But I want 2 dialogs:

Starting the script with a file, after closing zathura you get a list of pdf files to choose from
because I think this is the intuitive way to continue.
Another choice is using the find button and here see only directories.
The default is now /usr/share/examples where there are pdf´s.

Starting without a file, all pdf´s under $HOME are listed.

I am going to overwrite the above script now. go-up button added.
Attachments
zathura-gui2.png
script see 2 posts up
(25.66 KiB) Downloaded 7804 times
User avatar
don570
Posts: 5528
Joined: Wed 10 Mar 2010, 19:58
Location: Ontario

#10 Post by don570 »

I put Zathura in Right-click-4.9.7
for Lucid Puppyand Wary

To remind people of the key shortcuts I put
'a' and 's' in the right click menu
Image

For more info
http://www.murga-linux.com/puppy/viewtopic.php?t=67013
seaside
Posts: 934
Joined: Thu 12 Apr 2007, 00:19

Re: Zathura PDF viewer

#11 Post by seaside »

L18L wrote: Starting the script with a file, after closing zathura you get a list of pdf files to choose from
because I think this is the intuitive way to continue.
Another choice is using the find button and here see only directories.
The default is now /usr/share/examples where there are pdf´s.

.
L18L,

I have tested this with Yad 0.9.0 on pup431 (would have to upgrade GTK to compile the latest Yad :) ) and the "find" button doesn't produce anything. The reason is that there are several options used which are newer and not in Yad 0.9.0.

What version of Yad are you using?

Cheers,
s

EDIT:

Actually, if the following change is made, it works as you described. Change "--file' to "--file-selection" and delete "--dclick-action" in the "select_directory" function. It would now read -

Code: Select all

select_directory()
{
 dir=$(yad --title="$title" \
           --width="450"    \
           --height="300"   \
           --separator=""   \
           --text="    <span stretch='expanded' color='#330099'>$(gettext 'select the <b>directory</b> where to search for PDF files</span>')"   \
           --file-selection           \
           --directory      \
           --filename="/usr/share/examples/"      \
           
       )
[[ $? -eq 1 ]] && exitus
 list_pdfs_of_dir $dir
}
User avatar
L18L
Posts: 3479
Joined: Sat 19 Jun 2010, 18:56
Location: www.eussenheim.de/

Zathura PDF viewer

#12 Post by L18L »

seaside,
thank you. It is very good making this script workable in yad 0.9, too :D

I have been overwriting the script (see 5 posts above) now,
added a help button
which launches vovchik´s zathura.pdf
if available anywhere on the system.

vovchik,
where did you get the man page from?
(I think the help button should point to the man page directly)

Thanks for testing and feedback
l
Attachments
zathura-gui3.png
script see 5 posts above
(16.18 KiB) Downloaded 7858 times
Last edited by L18L on Sun 17 Jul 2011, 12:55, edited 1 time in total.
User avatar
vovchik
Posts: 1507
Joined: Tue 24 Oct 2006, 00:02
Location: Ukraine

zathura manual

#13 Post by vovchik »

Dear L18L,

I got the manpage from the tarball and made my own pdf :) The archived manpage is attached. The tarball is here: https://pwmt.org/projects/zathura/.

With kind regards,
vovchik
Attachments
zathura.1.tar.gz
(1.67 KiB) Downloaded 1350 times
User avatar
L18L
Posts: 3479
Joined: Sat 19 Jun 2010, 18:56
Location: www.eussenheim.de/

zathura manual

#14 Post by L18L »

Dear vovchik,

thank you very much making me RTFM (read the Fine manual) :)
Moved zathura.1.gz to /usr/share/man/1 and

Code: Select all

man zathura
works.

Kind regards
l
Version 0.0.8.4 fixes several bugs
keniv
Posts: 583
Joined: Tue 06 Oct 2009, 21:00
Location: Scotland

#15 Post by keniv »

Hi L18L

I cannot get your gui script to work on 525. I am not sure I am doing the right thing. This is what I have done. I copied your script to a new file in my-applications/bin. I made this file executable. When I click on this file I get a small box With "simple pdf read" and a cancel and ok box. This box does nothing and cannot be closed or killed. To get rid of it I have to restart X. I am using the version of yad in your link. Bellow is the output when I run the script in a terminal then press the ok button on the box that appears.

.

Code: Select all

/root/my-applications/bin/NewFile: line 70: --height=250: command not found
/root/my-applications/bin/NewFile: line 71: --separator=: command not found
/root/my-applications/bin/NewFile: line 72: --text=    <span stretch='expanded' color='#009933'><i>Select the <b>file</b> you want to read:</i></span>: No such file or directory
/root/my-applications/bin/NewFile: line 73: --list: command not found
/root/my-applications/bin/NewFile: line 74: --button=gtk-go-up:3: command not found
/root/my-applications/bin/NewFile: line 75: --button=gtk-find:2: command not found
/root/my-applications/bin/NewFile: line 76: --button=gtk-help:4: command not found
/root/my-applications/bin/NewFile: line 77: --button=gtk-quit:1: command not found
/root/my-applications/bin/NewFile: line 78: --button=gtk-ok:0: command not found
Zathura itself is working ok. I really like it.

I would appreciate any help you can give me.

Regards,

Ken.
User avatar
don570
Posts: 5528
Joined: Wed 10 Mar 2010, 19:58
Location: Ontario

GUI for zathura

#16 Post by don570 »

http://www.murga-linux.com/puppy/viewto ... 268#545268

I made a simple GUI (in French and English)
to open PDF files with zathura.

___________________________________
seaside
Posts: 934
Joined: Thu 12 Apr 2007, 00:19

#17 Post by seaside »

keniv,

This looks to me that the paste into the file was off.

Try another select and paste and see if that works.

Thanks for showing the errors, as that's always a big help in troubleshooting.

Cheers,
s
keniv
Posts: 583
Joined: Tue 06 Oct 2009, 21:00
Location: Scotland

#18 Post by keniv »

Hi Seaside

Have produced a new script file using copy and paste as described before but got the same outcome when I ran it. Compared both files with Xfdiff and they were identical so if I am doing something wrong then at least I am doing it consistently. I have done this before with other scripts and it has worked.

Hi Don570

Have just tried your gui pet for zathura and it worked. I like the " key shortcuts". I though it was a good idea to bring them up then minimise them so as if I forgot one I could bring them up again. However, if I minimise the short cuts the rest of the gui becomes unresponsive. Should I be able to minimise the shortcuts in this way? I also like your "right-click" pet. Its very useful.

Could I ask if it would be possible to convert the " simplePDFreader script submitted by L18L into a pet? I have no idea how to do this myself and do not know how mush work this involves and so I hope I am not asking to much.

Regards,

Ken.
User avatar
L18L
Posts: 3479
Joined: Sat 19 Jun 2010, 18:56
Location: www.eussenheim.de/

Zathura PDF viewer

#19 Post by L18L »

keniv,
I have tested in lupu525 and cannot reproduce your result.
A test in drake01 has brought up a missing dependency in drake01, so your comment was useful, thanks again.
you wrote:Could I ask if it would be possible to convert the " simplePDFreader script submitted by L18L into a pet? I have no idea how to do this myself and do not know how mush work this involves and so I hope I am not asking to much.
Yes, it is possible...
Wait a moment... or 2?
User avatar
L18L
Posts: 3479
Joined: Sat 19 Jun 2010, 18:56
Location: www.eussenheim.de/

Zathura PDF viewer

#20 Post by L18L »

keniv (and all :) )

your wish has been a command
Here it is, my 1st pet this year (2nd in total).

Hope it helps

Feedback appreciated

Edit
bugfixed version uploaded, 0.1 deleted
Attachments
zathura-gui-0.2.pet
bugfix
(1.83 KiB) Downloaded 626 times
Last edited by L18L on Tue 19 Jul 2011, 16:21, edited 1 time in total.
Post Reply