I modified the original sorttable (comments are in my code) to integrate better with my other bookmarking scripts and I renamed it to SORTable.
This is the readme.txt
Pale Moon Browser Bookmarking script.
Tag bookmarks into predefined categories and save them as 'pdf' and 'web page complete'.
Requires accompanying script SORTable.js (modified by me) which sorts by time and domain.
Requires xclip, xdotool, yad, youtube-dl, imagemagick and a correctly configured file and folder structure.
I am using it with Puppy Linux Quirky Tahr 6.05.
Install Pale Moon browser Version 25.3.1 (x86).
During normal use ensure only one browser instance is running.
There is a reason I am using the Pale Moon in-built 'pdf' and 'web page complete' save dialogs.
These dialogs are reliable and work, "so why re-invent the wheel?".
I spent weeks messing with other methods which eventually I abandoned due to several issues one of which was UTF8 encoding issues.
My method automates the running of the Pale Moon save dialogs by using xdotool.
Un-install CUPS so that the browser print dialog only has "Print to File" and there are no printers.
Setup browser Print dialog > Page Setup > Paper Orientation to Landscape (displays pdfs better without the right side text cropped).
'/' and '?' and '#' are replaced by '_' in '$title' . . . as forward slashes etc. in the pdf filenames cause errors when saving the pdfs.
Install Evince and set default display to full screen - when in full screen type ctrl + T to set as default.
Install MPlayer for viewing the videos.
In the file /root/.mplayer/config add a line . . . osdlevel=3 . . . so that the seek times are displayed.
Go into Pale Moon > Edit > Preferences > Applications and set PDF file action = Use evince. Set video/mp4 action = Use mplayer.
Install xclip if not already installed.
Install xdotool.
Install youtube-dl.
Install YAD (version 27) in Puppy Linux install Geoffrey's .pet linked from the forums.
Setup a quick way to access the bookmarks and their configuration scripts as described below.
1. Copy the the 5 bookmark folders to your root folder (in puppy linux /root/) . . . /root/.bookmarks/ , /root/.bookmarks-02/ , /root/.bookmarks-03/ , /root/.bookmarks-04/ , /root/.bookmarks-05/
2. Add a bookmark to the Pale Moon toolbar . . . file:///root/.bookmarks/bm0/index.html
3. Add 2 shortcuts to your Openbox menu (or another launcher method) . . . use sh -c ' ' if necessary.
I used this:
Code: Select all
<item label="BM" icon="/usr/share/pixmaps/filezilla.png"><action name="Execute"><command>/root/.bookmarks/bm/launcher.sh</command></action></item>
<item label="BV" icon="/usr/share/pixmaps/filezilla.png"><action name="Execute"><command>sh -c '/root/.bookmarks/bv/launcher.sh'</command></action></item>
If something goes wrong then dive in and try to hack a fix. For example when 'web page complete' is saved:
If a saved web page file extension is .htm or .xhtml then manually rename it to .html (after the script has made the .html link).
If a saved web page file extension is .txt (very rare) then manually rename it to .html (after the script has made the .html link).
I might one day automate the above two.
Also if the file extension was .txt then after renaming it to .html you could in the file add <html><body> tags and also add a <br> after every line.
IMPORTANT: the bookmark button names (tags) must not have any spaces e.g. one word only for each tag. Add these manually by editing tags.txt
ALSO: make sure the browser refresh button is accessible, as this may often need to be clicked, for 'script caused changes' to take effect.
BE VERY CAREFUL tinkering and experimenting with bash scripts especially with commands that delete or remove things.
This is a work in progress, the code has been developed over the last 3 months and I now use it with my browser every day.
I am no expert and find out what works by searching the internet for solutions. Stack Overflow is most useful in this respect.
Some of the code could be improved and made more efficient or extra features added, or the structure simplified.
I made use of the features inherent in CSS / Files and Folders / Other Tools where possible and used YAD as the interface to my scripts.
There were many other approaches possible (ie more use of arrays and loops, instead of hardwired, or utilizing the browser database) my approach might not be the best, but I like it and it works for me.
I will be posting this in the Puppy Linux Forum http://murga-linux.com/puppy/ programming section where snippets of code are show-cased and discussed.
Comments and suggestions welcome.
kjdixo
April 23 2016