Page 1 of 2

Zathura PDF viewer

Posted: Fri 08 Jul 2011, 13:16
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

zathura documentation

Posted: Fri 08 Jul 2011, 14:00
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.

Posted: Fri 08 Jul 2011, 14:08
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

Zathura PDF viewer

Posted: Tue 12 Jul 2011, 17:42
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
# 

Re: Zathura PDF viewer

Posted: Tue 12 Jul 2011, 19:22
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

Re: Zathura PDF viewer

Posted: Tue 12 Jul 2011, 19:58
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

Zathura PDF viewer

Posted: Thu 14 Jul 2011, 19:15
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

Posted: Thu 14 Jul 2011, 22:16
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

Zathura PDF viewer

Posted: Fri 15 Jul 2011, 20:42
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.

Posted: Sat 16 Jul 2011, 15:53
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

Re: Zathura PDF viewer

Posted: Sat 16 Jul 2011, 21:03
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
}

Zathura PDF viewer

Posted: Sun 17 Jul 2011, 12:25
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

zathura manual

Posted: Sun 17 Jul 2011, 12:47
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

zathura manual

Posted: Sun 17 Jul 2011, 13:20
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

Posted: Mon 18 Jul 2011, 22:37
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.

GUI for zathura

Posted: Mon 18 Jul 2011, 23:59
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.

___________________________________

Posted: Tue 19 Jul 2011, 00:17
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

Posted: Tue 19 Jul 2011, 11:38
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.

Zathura PDF viewer

Posted: Tue 19 Jul 2011, 11:55
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?

Zathura PDF viewer

Posted: Tue 19 Jul 2011, 13:19
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