Commit e2b4efbd authored by Alexandre Julliard's avatar Alexandre Julliard

Create Gnome/KDE desktop and menu entries from IShellLink

interface. Based on the work of James Thomson and Dusan Lacko.
parent cf94bf88
/* XPM */
static char * wine_xpm[] = {
"48 48 159 2",
" c None",
". c #010101",
"+ c #030303",
"@ c #000000",
"# c #040404",
"$ c #0D0D0D",
"% c #222222",
"& c #090909",
"* c #050505",
"= c #101010",
"- c #0B0B0B",
"; c #131313",
"> c #1C1C1C",
", c #232323",
"' c #161616",
") c #020202",
"! c #2F2F2F",
"~ c #212121",
"{ c #060606",
"] c #292929",
"^ c #0A0A0A",
"/ c #111111",
"( c #252525",
"_ c #0E0E0E",
": c #262626",
"< c #0C0005",
"[ c #100308",
"} c #2D2D2D",
"| c #2A2A2A",
"1 c #360013",
"2 c #59001C",
"3 c #120006",
"4 c #080808",
"5 c #141414",
"6 c #090707",
"7 c #0A0003",
"8 c #0E0003",
"9 c #0B0205",
"0 c #191919",
"a c #6A0022",
"b c #AC0033",
"c c #730024",
"d c #4F0019",
"e c #470016",
"f c #4B0019",
"g c #5D001E",
"h c #690022",
"i c #6E0023",
"j c #660021",
"k c #410012",
"l c #1B080D",
"m c #171717",
"n c #160007",
"o c #8E002E",
"p c #B60038",
"q c #AE0038",
"r c #A90035",
"s c #A60033",
"t c #A60035",
"u c #AF0038",
"v c #B10038",
"w c #B00038",
"x c #A10031",
"y c #6D0020",
"z c #1A0007",
"A c #121212",
"B c #3D0014",
"C c #A70033",
"D c #AE0039",
"E c #B30038",
"F c #B20038",
"G c #B70038",
"H c #98002E",
"I c #2E000F",
"J c #52021A",
"K c #7C0026",
"L c #AC0035",
"M c #AD0038",
"N c #B50038",
"O c #830029",
"P c #1A0008",
"Q c #490017",
"R c #A00033",
"S c #B20039",
"T c #53001B",
"U c #3C0014",
"V c #A20032",
"W c #AD0039",
"X c #B40038",
"Y c #8F002D",
"Z c #1E0008",
"` c #171616",
" . c #51001A",
".. c #A80035",
"+. c #B20037",
"@. c #700025",
"#. c #0A0104",
"$. c #090204",
"%. c #B00039",
"&. c #A40033",
"*. c #32000F",
"=. c #110005",
"-. c #730026",
";. c #AF0039",
">. c #810029",
",. c #0A0002",
"'. c #1D0009",
"). c #820029",
"!. c #410014",
"~. c #21000A",
"{. c #87002A",
"]. c #88002C",
"^. c #8B002A",
"/. c #3C0015",
"(. c #20000A",
"_. c #86002A",
":. c #B50037",
"<. c #710022",
"[. c #080002",
"}. c #130006",
"|. c #790026",
"1. c #7A0128",
"2. c #140007",
"3. c #0D0608",
"4. c #650021",
"5. c #90002E",
"6. c #290310",
"7. c #181818",
"8. c #390013",
"9. c #9A0032",
"0. c #B40039",
"a. c #B10037",
"b. c #91002D",
"c. c #3E0014",
"d. c #0C0407",
"e. c #0A0004",
"f. c #4A001A",
"g. c #92002D",
"h. c #A50034",
"i. c #94002E",
"j. c #6C0122",
"k. c #2E0210",
"l. c #0B0406",
"m. c #070707",
"n. c #090003",
"o. c #26000C",
"p. c #370414",
"q. c #28000C",
"r. c #060303",
"s. c #191818",
"t. c #1F1F1F",
"u. c #0F0F0F",
"v. c #1D1D1D",
"w. c #3E3E3E",
"x. c #2B2B2B",
"y. c #1A1A1A",
"z. c #323232",
"A. c #2E2E2E",
"B. c #1E1E1E",
" . + @ @ # ",
" $ % & . * ",
" & . = & - ",
" @ ; - # ",
" > @ , # ",
" . ' ) ",
" ! # ~ * ",
" { @ # @ ",
" . > . * ",
" ] ^ / ( _ : ",
" $ < [ } + + ",
" | ' 1 2 3 4 5 / 6 7 8 9 $ & 0 ",
" ^ * a b c d e f g h i j k l m & ' ",
" @ n o p q r s t u q v w x y z @ ",
" A B C u D E F v q F u u G H I @ ",
" J K L E D F M v u M E q N O P ",
" Q R E q S u v M F u E q r T + ",
" { U V v F W w v v w F M X Y Z ",
" ` ...F u D F u w v w M +.@.#. ",
" $.a w w v %.v u u w v w &.*.. ",
" =.-.w w v ;.u v u w M G >.,.@ ",
" '.).w v u W v q v u v E !.@ ",
" ~.{.E u F D F u w v X ].7 # ",
" ~.^.F F q S u v M F X /.@ ",
" (._.X u E W u v v :.<.[.@ ",
" }.|.w F q D F v v 1.2.4 ",
" 3.4.w w F %.F X 5.6.. 7. ",
" ^ 8.9.G v 0.a.b.c.d.. ",
" e.f.g.h.i.j.k.l.m. ",
" - n.o.p.q.3 4 ^ ",
" r.@ @ . @ @ ",
" s.@ @ @ ",
" > @ ) ",
" t.. u. ",
" > + ",
" > v. ",
" 5 ' ",
" # ",
" v. ",
" @ ( ",
" w.x.] _ @ ( ",
" @ @ @ @ & / - @ @ @ ( ",
" { & @ @ @ @ @ @ & ( ",
" = / m.@ @ @ @ = 5 ) ",
" y.@ @ @ @ @ @ @ - ",
" z.^ @ @ @ @ m.# ",
" A _ . @ . & ",
" A.B.; "};
......@@ -42,8 +42,9 @@ bin2res: bin2res.o
install:: $(PROGRAMS) $(INSTALLSUBDIRS:%=%/__install__)
[ -d $(bindir) ] || $(MKDIR) $(bindir)
$(INSTALL_PROGRAM) fnt2bdf $(bindir)/fnt2bdf
$(INSTALL_PROGRAM) wineshelllink $(bindir)/wineshelllink
uninstall:: $(PROGRAMS) $(INSTALLSUBDIRS:%=%/__uninstall__)
$(RM) $(bindir)/fnt2bdf
$(RM) $(bindir)/fnt2bdf $(bindir)/wineshelllink
### Dependencies:
#!/bin/sh
#
# Create menu/desktop entries for an application
# This is used by the IShellLink interface
#
# Copyright 2000 Alexandre Julliard
#
mode=""
args=""
menu=""
icon=""
descr=""
link=""
path=""
workdir=""
usage()
{
cat <<EOF
usage: wineshelllink options
options:
--desktop create a desktop link
--menu create a menu entry
--path xx path to the application
--link xx name of link to create
--args xx command-line arguments for the application
--icon xx icon to display
--workdir xx working directory for the application
--descr xx application description
EOF
exit 1
}
while [ $# -gt 0 ]
do
case "$1" in
(--desktop) mode="desktop"; shift 1 ;;
(--menu) mode="menu"; shift 1 ;;
(--path) path=$2; shift 2 ;;
(--link) link=$2; shift 2 ;;
(--args) args=$2; shift 2 ;;
(--icon) icon=$2; shift 2 ;;
(--descr) descr=$2; shift 2 ;;
(--workdir) workdir=$2; shift 2 ;;
(*) usage ;;
esac
done
kde_entry()
{
cat <<EOF
# KDE Config File
[KDE Desktop Entry]
Name=`basename "$link"`
Exec=wine "$path" $args
Type=Application
Comment=$descr
EOF
[ -z "$workdir" ] || echo "Path=\"$workdir\""
[ -z "$xpmicon" ] || echo "Icon=$xpmicon"
}
gnome_entry()
{
cat <<EOF
[Desktop Entry]
Name=`basename "$link"`
Exec=wine "$path" $args
Type=Application
Comment=$descr
EOF
[ -z "$workdir" ] || echo "Path=\"$workdir\""
[ -z "$xpmicon" ] || echo "Icon=$xpmicon"
}
# copy the icon file to a specified dir and set xpmicon to the resulting path
copy_icon()
{
dir=$1
mkdir -p "$dir"
mkdir -p "$dir/"`dirname "$link"` || true
if [ -f "$icon" ]
then
cp "$icon" "$dir/$link.xpm"
xpmicon="$dir/$link.xpm"
else
xpmicon=""
fi
}
# KDE
if [ -d "$HOME/.kde" ]
then
copy_icon "$HOME/.kde/share/applnk/Wine"
if [ $mode = "menu" ]
then
kde_entry > "$HOME/.kde/share/applnk/Wine/$link.kdelnk"
elif [ -d "$HOME/Desktop" ]
then
kde_entry > "$HOME/Desktop/$link.kdelnk"
fi
fi
# Gnome
if [ -d "$HOME/.gnome" ]
then
copy_icon "$HOME/.gnome/apps/Wine"
if [ $mode = "menu" ]
then
gnome_entry > "$HOME/.gnome/apps/Wine/$link.desktop"
elif [ -d "$HOME/.gnome-desktop" ]
then
gnome_entry > "$HOME/.gnome-desktop/$link.desktop"
fi
fi
exit 0
......@@ -56,6 +56,7 @@ Temp=e:\
Path=c:\windows;c:\windows\system;e:\;e:\test;f:\
Profile=c:\windows\Profiles\Administrator
GraphicsDriver=x11drv
ShellLinker=wineshelllink
# <wineconf>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment