Please find attached a wrapper script which will enable you to run as a
stand-alone app the SQLiteManager extension available on some Mozilla-
type browsers. (E.g. Firefox, SeaMonkey, and similar.)
This is an overblown edit of a one-liner written by BK way back when.
~~~~~~~~~~
Requirements --
-- A Mozilla-type browser
-- its SQLiteManager extension.
-- The new yaf-splash utility (all Puppies have it now).
Features --
-- It checks if you have the extension and then an MZ browser; tells you
if you don't and exits.
-- SQLiteManager.desktop file provided for convenience; will show in
Business or Database sub-section of your menu.
-- Issues messages in console if run from console, through yaf-splash
if run from X
Peculiarity --
-- If you have installed the SQLiteManager extension, say, in Light and in
SeaMonkey, it will run the first one it finds (In alphabetical order) and exit
~~~~~~~~~~
Constructive or improvement-oriented comments welcome.
Enjoy.
~~~~~~~~~~
Code: Select all
#!/bin/sh
# sqlitemanager.sh
# Original script by Barry Kauler, 2009? ;-)
# Edited for MRUF-lst by musher0. # Edit 2: 2017-08-05, 13 h 55. GPL3
# Please see https://opensource.org/licenses/GPL-3.
####
# Note --
# Sqlitemanager does not have position handling for the command line.
# We should try to "cd" as close as we can to the DB file before running it.
case "${LANG:0:2}" in fr)TXTMSG3="
SQLiteManager se lance.
... Merci de votre patience ...
"
TXTMSG4="
On n'a trouvé aucun navigateur
qui supporte sqlitemanager.
"
TXTMSG5="
SQLitemanager n'est pas installé.
" ;;
en|*)TXTMSG3="
SQLiteManager is launching.
... Thanks for waiting ...
"
TXTMSG4="
No browser was found
to support sqlitemanager.
"
TXTMSG5="
SQLitemanager is not installed.
" ;;
esac
PasInstalle () {
yaf-splash -font Liberation -fontsize 13 -margin 1 -fg grey91 -bg black -bg_gradient true -icon /usr/local/share/pixmaps/5817-64_SQLiteManager.png -wrap false -timeout 6 -text "$TXTMSG5" &
}
PasTrouve () {
yaf-splash -font Liberation -fontsize 13 -margin 1 -fg grey91 -bg black -bg_gradient true -icon /usr/local/share/pixmaps/5817-64_SQLiteManager.png -wrap false -timeout 6 -text "$TXTMSG4" &
}
Attente () {
yaf-splash -font Liberation -fontsize 13 -margin 1 -fg grey91 -bg black -bg_gradient true -icon /usr/local/share/pixmaps/5817-64_SQLiteManager.png -wrap false -timeout 6 -text "$TXTMSG3" &
# Why bcm is not showing any text for this, I don't know.
# But I'm leaving the code here in case someone does.
# bcm -u /usr/local/share/pixmaps/5817-64_SQLiteManager.png -a 1 -g c:c -d 6 -b "#000000FF" -c "#0c0c0c8F" -t "<span font='LiberationSerif Bold Italic 18' color='$Color1' gravity='north' gravity_hint='line'>"$TXTMSG3"</span>" 2>/dev/null &
}
MZBrwsrChck () {
if [ "`which $BrowseR`" = "" ];then
if [ -t 1 ];then echo "TXTMSG4"
else PasTrouve
fi
else # sqlitemanager is launched
SqliT="chrome chrome://sqlitemanager/content/sqlitemanager.xul"
[ -t 1 ] && echo "$TXTMSG3" || Attente
$BrowseR --$SqliT 2>/dev/null
exit # The script runs the first SQLiteManager it finds and exits.
fi; }
## Action
for brwsr in light mozilla # We can add palemoon, etc.
do S="`tree -fi ~/.$brwsr/* -L 3 | grep SQLite`"
if [ "${S}" ];then BrowseR="`echo "$S" | awk -F"/" '{ print $4 }'`"
MZBrwsrChck
else
if [ -t 1 ];then echo "STXTMSG5."
else PasInstalle
fi
fi
done