appfinder - finds menu apps

For discussions about programming, programming questions/advice, and projects that don't really have anything to do with Puppy.
Post Reply
Message
Author
jpeps
Posts: 3179
Joined: Sat 31 May 2008, 19:00

appfinder - finds menu apps

#1 Post by jpeps »

Helpful for quickly locating name/location of menu apps.
Shows desktop entry and exec; accepts '*' in search.

USAGE: appfinder [search]

Code: Select all

#!/bin/sh

VAR="$(find /usr/share/applications  | grep -i "$1")"
echo "$VAR"

EXEC="$(cat "$VAR" | grep Exec | cut -d"=" -f2)"

LOC="$(which "$EXEC")"
echo "$LOC"
Attachments
appfinder.png
(4.65 KiB) Downloaded 713 times

big_bass
Posts: 1740
Joined: Mon 13 Aug 2007, 12:21

#2 Post by big_bass »

Hey jpeps

do a search for pmenu


you will find a lot of good stuff you could use

here are some links

http://www.murga-linux.com/puppy/viewto ... 48&t=40277
http://www.murga-linux.com/puppy/viewto ... 48&t=57805

Joe

jpeps
Posts: 3179
Joined: Sat 31 May 2008, 19:00

#3 Post by jpeps »

big_bass wrote:Hey jpeps

do a search for pmenu
you will find a lot of good stuff you could use
here are some links
Hi Joe.
Thanks...pmenu looks good. It's great to have useful apps written in script, so that they can be easily adapted. For example, I might change the remove path so it's not taking up ram. Looks like you had similar ideas with TXZ packages. I use appfinder as part of a remaster script where removed items get placed in an SFS package.

edit: also, pmemu doesn't give you the /path/name of the app.

aragon
Posts: 1698
Joined: Mon 15 Oct 2007, 12:18
Location: Germany

#4 Post by aragon »

hi jpeps,

your result confuses me a little

you're searching for

"pcurl*"

and you're getting

"pcur"

that does not contain the search-string in my opinion???

aragon

jpeps
Posts: 3179
Joined: Sat 31 May 2008, 19:00

#5 Post by jpeps »

aragon wrote:hi jpeps,

your result confuses me a little

you're searching for

"pcurl*"

and you're getting

"pcur"

that does not contain the search-string in my opinion???

aragon
Hi aragon,

Works with "*". I demo'd this because PcurlFtp is menu listing.

Code: Select all

find /usr/share/applications | grep -i pcurl*
Last edited by jpeps on Wed 29 Dec 2010, 01:32, edited 1 time in total.

jpeps
Posts: 3179
Joined: Sat 31 May 2008, 19:00

#6 Post by jpeps »

More sophisticated version; gets menu items not listed in /usr/share/applications (shutdown, restart, etc) * and non-menu apps; included some idiot checks and help (-h).

*should work with any wm as long as there's a .jwmrc file.

Code: Select all

#!/bin/sh

if [ "$1" == "" -o "$1" == "-h" ]; then
 echo "USAGE: appfinder [search]"
exit
fi

DESK="$(sudo find /usr/share/applications  | grep -i "$1")"
[ "$DESK" ] && echo "$DESK"

[ -e "$DESK" ] && EXEC="$(cat "$DESK" | grep Exec | cut -d"=" -f2)"

LOC="$(which "$EXEC")"
[ "$LOC" ] && echo "$LOC"

## Find menu apps not in .desktop 
if [ "$DESK" == "" -a "$1" ]; then

VAR="$(cat /root/.jwmrc | grep -i  "$1" | cut -f2 -d ">" | cut -d"<" -f1 | cut -d" " -f2)" 
[ "$VAR" ] && JWM="$(which ${VAR})"
[ "$JWM" ] && echo "$JWM"
[ "$1" == "Restart JWM" ] && echo "jwm -restart"

## Non Menu Apps
[ "$VAR" ] || which "$1"
fi

Post Reply