Learning GtkDialog (hopefully) -- and I have questions...
OK, prototype script attached... let me know what I did wrong
- Attachments
-
- launcher-refresh.sh.gz
- fake *.gz -- remove extension; do not use gunzip...
- (7.34 KiB) Downloaded 183 times
Program Launcher
starhawk,
Technosaurus made a quick parsing utility for Desktop files which I've modified and added an icon finder that you may wish to use. The rest of the program categories could be added for each notebook.
Probably needs work to get the icons lined up nicely.
Cheers,
s
Technosaurus made a quick parsing utility for Desktop files which I've modified and added an icon finder that you may wish to use. The rest of the program categories could be added for each notebook.
Code: Select all
#!/bin/sh
# Program Launcher
iconfind() {
[ -f /usr/local/lib/X11/mini-icons/$ICON ] && ICON=/usr/local/lib/X11/mini-icons/$ICON
[ -f /usr/local/lib/X11/pixmaps/$ICON ] && ICON=usr/local/lib/X11/pixmaps/$ICON
[ -f /usr/share/pixmaps/$ICON ] && ICON=/usr/share/pixmaps/$ICON
[ -f /usr/local/share/pixmaps/$ICON ] && ICON=/usr/local/share/pixmaps/$ICON
#ICON=`find /usr -name "$ICON" -print -quit`
echo $ICON #exit
}
export -f iconfind
for DESKTOP_FILE in /usr/share/applications/*.desktop ; do
ICON="" CATS="" NAME="" EXEC="" LINE="" #prevent carryover from previous file
while read LINE || [ "$LINE" ]; do
case $LINE in
Name=*) NAME="${LINE#*=}"'' ;;
Icon=*) ICON="${LINE#*=}"''
[[ ! "$ICON" == */* ]] && iconfind ;;
Categories=*) CATS="${LINE#*=}"'' ;;
Exec=*) EXEC="${LINE#*=}"'' ;;
esac
done < $DESKTOP_FILE
case "$CATS" in
FileManager|X-FilesystemMount|X-FilesystemFind|X-FilesystemUtility) APPLIST_FILESYSTEM="$APPLIST_FILESYSTEM<button><label>$NAME</label><input file>$ICON</input><action>$EXEC</action></button>" ;;
X-Graphic-paint|RasterGraphics|X-Graphic-draw|VectorGraphics|X-Graphic-flow|Chart|Flowchart|Presentation|X-Graphic-viewer|X-Graphic-camera|Photography|X-Graphic-scanner|Scanning|OCR|X-Graphic-print|X-Graphic-utility|X-GraphicUtility) APPLIST_GRAPHICS="$APPLIST_GRAPHICS<button><label>$NAME</label><input file>$ICON</input><action>$EXEC</action></button>" ;;
esac
done
export LAUNCHER='
<window title="Program Launcher">
<vbox>
<notebook labels="Filesystem|Graphic">
<frame>
<text use-markup="true"><label>"<b>Filesystem</b>"</label></text>
'"$APPLIST_FILESYSTEM"'
</frame>
<frame>
<text use-markup="true"><label>"<b>Graphic</b>"</label></text>
'"$APPLIST_GRAPHICS"'
</frame>
</notebook>
<hbox homogeneous="true">
<button cancel></button>
</hbox>
</vbox>
</window>'
gtkdialog -p LAUNCHER
Cheers,
s
seaside, that's interesting -- I like the Icon Finder part -- but I'm afraid I don't think it'll work for me. I want the GtkNotebook to update whenever someone runs a "fixmenus" style script -- such as the one attached to my last post. The script you posted doesn't allow for that
Can someone PLEASE look at my script and tell me if there are any bugs?
Can someone PLEASE look at my script and tell me if there are any bugs?
Hi Starhawk,
Is the script already supposed to run?
I tried it in Quirky Tahr, but it refuses to start up.
Looked briefly at your code and could not find the reason.
Could be me though, not seeing the obvious
Anyway, great start of what looked like a crazy endeavor at first!
Is the script already supposed to run?
I tried it in Quirky Tahr, but it refuses to start up.
Looked briefly at your code and could not find the reason.
Could be me though, not seeing the obvious
Anyway, great start of what looked like a crazy endeavor at first!
[url=http://pupsearch.weebly.com/][img]http://pupsearch.weebly.com/uploads/7/4/6/4/7464374/125791.gif[/img][/url]
[url=https://startpage.com/do/search?q=host%3Awww.murga-linux.com%2F][img]http://i.imgur.com/XJ9Tqc7.png[/img][/url]
[url=https://startpage.com/do/search?q=host%3Awww.murga-linux.com%2F][img]http://i.imgur.com/XJ9Tqc7.png[/img][/url]
Bert -- not sure why it didn't work* -- it /should/ run -- obviously it needs debugging!
Can you see anything in the code that would either (a) not work as needed or (b) not work at all? The idea is that it reads through the pile of *.desktop files at /usr/share/applications and compiles a list, which it then categorizes and dumps into a set of text files. (The text files are later read by the Launcher app, which should be fun...)
*I have a hunch, actually. I wrote it in pristine Slacko 56 -- meaning boot from RAM, with work saved to a flash drive, lol -- so maybe Quirky has a different GtkDialog version?
Can you see anything in the code that would either (a) not work as needed or (b) not work at all? The idea is that it reads through the pile of *.desktop files at /usr/share/applications and compiles a list, which it then categorizes and dumps into a set of text files. (The text files are later read by the Launcher app, which should be fun...)
*I have a hunch, actually. I wrote it in pristine Slacko 56 -- meaning boot from RAM, with work saved to a flash drive, lol -- so maybe Quirky has a different GtkDialog version?
In your script, you probably need to changestarhawk wrote:Bert -- not sure why it didn't work* -- it /should/ run -- obviously it needs debugging!
Can you see anything in the code that would either (a) not work as needed or (b) not work at all? The idea is that it reads through the pile of *.desktop files at /usr/share/applications and compiles a list, which it then categorizes and dumps into a set of text files. (The text files are later read by the Launcher app, which should be fun...)
*I have a hunch, actually. I wrote it in pristine Slacko 56 -- meaning boot from RAM, with work saved to a flash drive, lol -- so maybe Quirky has a different GtkDialog version?
if [ `$i".desktop" |
to
if [ `cat $i".desktop" |
[b][url=https://bit.ly/2KjtxoD]Pkg[/url], [url=https://bit.ly/2U6dzxV]mdsh[/url], [url=https://bit.ly/2G49OE8]Woofy[/url], [url=http://goo.gl/bzBU1]Akita[/url], [url=http://goo.gl/SO5ug]VLC-GTK[/url], [url=https://tiny.cc/c2hnfz]Search[/url][/b]
- L18L
- Posts: 3479
- Joined: Sat 19 Jun 2010, 18:56
- Location: www.eussenheim.de/
You can see it running if you launch it from console.starhawk wrote:Bert -- not sure why it didn't work* -- it /should/ run --
Code: Select all
# ./laun*
Rebuilding SmallScreen Launcher application-list files...
./launcher-refresh.sh: line 51: Abiword-wordprocessor.desktop: command not found
./launcher-refresh.sh: line 51: ALSA-sound-Wizard.desktop: command not found
./launcher-refresh.sh: line 51: Bcrypt-file-encryption.desktop: command not found
./launcher-refresh.sh: line 51: BootFlash-usb-installer.desktop: command not fou...................
Code: Select all
# egrep --help | grep egrep
Usage: egrep [OPTION]... PATTERN [FILE]...
Example: egrep -i 'hello world' menu.h main.c
Invocation as 'egrep' is deprecated; use 'grep -E' instead.
#