home bbs files messages ]

Forums before death by AOL, social media and spammers... "We can't have nice things"

   alt.os.linux.mint      Looks pretty on the outside, thats it!      30,566 messages   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]

   Message 29,535 of 30,566   
   Paul to Jeff Layman   
   Re: DistroWatch Q&A: Advice for new Linu   
   30 Oct 25 13:51:21   
   
   XPost: alt.comp.os.windows-10   
   From: nospam@needed.invalid   
      
   On Thu, 10/30/2025 10:35 AM, Jeff Layman wrote:   
   > On 30/10/2025 13:13, Dan Purgert wrote:   
   >> On 2025-10-30, Jeff Layman wrote:   
   >>> On 30/10/2025 10:28, Dan Purgert wrote:   
   >>>> On 2025-10-30, Jeff Layman wrote:   
   >>>>> On 29/10/2025 21:57, Lawrence D’Oliveiro wrote:   
   >>>>>> gunzip -c $(man -w bash) | groff -ktman -Tpdf | okular -   
   >>>>>   
   >>>>> (computer name):~$ gunzip -c $(man -w bash) | groff -ktman -Tpdf |   
   okular -   
   >>>>>   
   >>>>> groff: fatal error: cannot load 'DESC' description file for device 'pdf'   
   >>>>> org.kde.okular.core: No plugin for mimetype '"application/x-zerosize"'.   
   >>>>   
   >>>> Chances are you've only got 'groff-base' installed, rather than the full   
   >>>> 'groff' package.   
   >>>> [...]   
   >>>>     3. "apt install groff" to install the full package.   
   >>>   
   >>> Successfully installed. There's quite a lot of it, but I've plenty of   
   >>> disk space.   
   >>   
   >> Yeah, the "quite a lot" is why it's not installed by default, same as   
   >> other things like vim.  Most people don't need all the fluff, so I guess   
   >> the idea is to save space on the install ISOs.   
   >>>   
   >>>>     4. Run that command from Lawrence again   
   >>>   
   >>> It worked perfectly and that pdf is *much* easier to read than a   
   >>> screenful of "manual" instructions in the Terminal. I've saved it for   
   >>> future reference.   
   >>   
   >> Great! Something you might want to consider here is making yourself a   
   >> little manpage wrapper script so you can get the PDF output for any   
   >> manpages you want to read.   
   >>   
   >> Something like this ought to do it -- though admittedly this is rather   
   >> off the cuff, so might have an egregious error or three.   
   >>   
   >>    #!/usr/bin/env bash   
   >>       #usage reminder if we forgot the input parameter, or had too many   
   >>    if [[ $# -ne 1 ]]; then   
   >>      printf "man2pdf error: incorrect number of parameters given.\n"   
   >>      printf "usage: man2pdf  (e.g. man2pdf bash).\n"   
   >>      exit 1   
   >>    fi   
   >>   
   >>    #'man -w' will return 0 only if the manpage exists   
   >>    if $(man -w $1 &>/dev/null ) ; then   
   >>      gunzip -c $(man -w "$1") | groff -ktman -Tpdf | okular -   
   >>    else   
   >>      printf "man2pdf error: No manual page for \"$1\" found.\n"   
   >>    fi   
   >>   
   >> Save it as say "/usr/local/bin/man2pdf", and make sure it's executable.   
   >>   
   >> Alternatively, in Mint, I believe that if you create a $HOME/bin/   
   >> directory, it will be added to your $PATH on the next login.  But that   
   >> has the "downside" of not being globally accessible then (mostly a   
   >> concern if you have multiple users on your PCs -- SO, kids,   
   >> just-for-banking, whatever).   
   >   
   > Thanks for the script. I'm the only user of this laptop, so I'll probably do   
   it via a $HOME/bin/ directory. I've never made an executable file, but I'll   
   have a read up on how to do it.   
   >   
   > I have a question or perhaps two (they might be related) - which perhaps   
   should be directed to Lawrence, but I'm pretty sure you'll know the answer.   
   After running:   
   > :~$ gunzip -c $(man -w bash) | groff -ktman -Tpdf | okular -   
   > the terminal remained open, and when I tried to close it was warned that   
   there was still a process running in it, and closing the terminal would kill   
   it. Why does that script not end cleanly (if that's the right term)?   
   >   
   > Also, at the end, he said:   
   > (Substitution of alternative PDF viewer is left as an exercise for the   
   > reader.)   
   > I tried the $ gunzip... expression he used, but substituting qpdfview for   
   okular.   
   >   
   > That, however, resulted in qpdfview opening, but with an error message:   
   > "Warning   
   > Could not open '-' "   
   >   
   > I was a bit puzzled, but then remembered that when Okular opened with the   
   manual text, I tried to save it but couldn't as both "Save" and "Save as" were   
   greyed out. I was able to print that manual as "another" pdf, and that's what   
   I was referring to in    
   my reply as being much easier to use.   
   >   
   > Okular is not only a pdf reader, but the properties of that manual document   
   refer to it as being a pdf (v 1.4). Why was it not saveable directly as a pdf,   
   and what went wrong with the qpdfview command if it is a pdf?   
   >   
      
   okular - &          # Detach the process from the terminal ?   
                       # Can still close if parent is lost.   
                       # I don't know if there is a way to make "init" inherit   
   the process (the boss parent)   
      
   groff -ktman -Tpdf | tee filename.pdf | okular - &    # tee makes a copy of a   
   stream, as well as passing it on   
                                                         # Normally I would use   
   tee, only on a text stream.   
                                                         # While piping is cool,   
   you can also break it down to separate commands   
                                                         # Separate commands   
   allows checking errno or whatever   
      
   For filename, the already-evaluated   $(man -w "$1")  could   
   be stored in a variable, and will require removing the zip extension   
   from the end and slapping the .pdf on the end. A real scriptor   
   will have to code this for you.   
      
      Paul (who is not a bash scriptor, nor a .bat scriptor either :-) )   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]


(c) 1994,  bbs@darkrealms.ca