forked from e16/e16
1
0
Fork 0

make this more sun freindly :)

SVN revision: 801
This commit is contained in:
Carsten Haitzler 1999-10-12 14:16:06 +00:00
parent 8762510ab0
commit 0bacc4b28b
2 changed files with 42 additions and 10 deletions

View File

@ -67,6 +67,38 @@ find_app_base_dir() {
ADIR=/opt/local/share/apps
fi
}
find_icon_base_dir() {
IDIR=`gnome-config --prefix`"/share/pixmaps"
if [ ! -f $IDIR"/gnome-help.png" ]; then
IDIR=/usr/share/pixmaps
fi
if [ ! -f $IDIR"/gnome-help.png" ]; then
IDIR=/usr/share/gnome/pixmaps
fi
if [ ! -f $IDIR"/gnome-help.png" ]; then
IDIR=/usr/local/share/pixmaps
fi
if [ ! -f $IDIR"/gnome-help.png" ]; then
IDIR=/usr/gnome/share/pixmaps
fi
if [ ! -f $IDIR"/gnome-help.png" ]; then
IDIR=/usr/local/gnome/share/pixmaps
fi
if [ ! -f $IDIR"/gnome-help.png" ]; then
IDIR=/opt/gnome/share/pixmaps
fi
if [ ! -f $IDIR"/gnome-help.png" ]; then
IDIR=/opt/gnome/share/gnome/pixmaps
fi
if [ ! -f $IDIR"/gnome-help.png" ]; then
IDIR=/usr/X11R6/share/gnome/pixmaps
fi
if [ ! -f $IDIR"/gnome-help.png" ]; then
IDIR=/opt/local/share/pixmaps
fi
}
if [ $# -eq 4 ]; then
DIR=$4
else
@ -76,8 +108,8 @@ fi
# In most cases I believe the icons can be found in the directory that is
# ../../pixmaps from $ADIR.
find_app_base_dir
GICONDIR=$ADIR/../../pixmaps
find_icon_base_dir
GICONDIR=$IDIR
# if the apps dir doesn't exist in the end then exit
if [ ! -d "$DIR" ]; then
@ -88,14 +120,14 @@ if [ ! -d "$ODIR" ]; then
mkdir $ODIR
fi
# function to check its a KDE kdelnk file
# function to check its a GNOME desktop file
is_desktop() {
VAL=`grep "\[Desktop Entry\]" $1`
if [ -n "$VAL" ]; then
VAL=`grep '^Name=' $1 | head -1`
if [ -n "$VAL" ]; then
NAME=`echo $VAL | awk -F= '{printf("%s", $2);}'`
echo -n $NAME
echo $NAME | tr -d '\n'
return 0
fi
fi
@ -162,7 +194,7 @@ get_icon() {
fi
fi
fi
echo -n "$EICON"
echo "$EICON" | tr -d '\n'
return 0
fi
return 1

View File

@ -111,7 +111,7 @@ is_kdelnk() {
VAL=`grep '^Name=' $1 | head -1`
if [ -n "$VAL" ]; then
NAME=`echo $VAL | awk -F= '{printf("%s", $2);}'`
echo -n $NAME
echo $NAME | tr -d '\n'
return 0
fi
fi
@ -123,7 +123,7 @@ get_sortorder() {
VAL=`grep '^SortOrder=' $1 | head -1`
if [ -n "$VAL" ]; then
VAL2=`echo $VAL | awk -F= '{printf("%s", $2);}' | sed "s/,/ /g"`
echo -n $VAL2
echo $VAL2 | tr -d '\n'
return 0
fi
return 1
@ -133,7 +133,7 @@ get_icon() {
VAL=`grep '^Icon=' $1 | head -1`
if [ -n "$VAL" ]; then
VAL2=`echo $VAL | awk -F= '{printf("%s", $2);}'`
echo -n $VAL2
echo $VAL2 | tr -d '\n'
return 0
fi
return 1
@ -143,7 +143,7 @@ get_miniicon() {
VAL=`grep '^MiniIcon=' $1 | head -1`
if [ -n "$VAL" ]; then
VAL2=`echo $VAL | awk -F= '{printf("%s", $2);}'`
echo -n $VAL2
echo $VAL2 | tr -d '\n'
return 0
else
get_icon $1
@ -165,7 +165,7 @@ get_exec() {
VAL2=`echo $VAL2 | sed "s:\%f:blank:g"`
VAL2=`echo $VAL2 | sed "s:\%n:NONE:g"`
VAL2=`echo $VAL2 | sed "s:\%d:$HOME:g"`
echo -n $VAL2
echo $VAL2 | tr -d '\n'
return 0
fi
return 1