3 # Create menu/desktop entries for an application
4 # This is used by the IShellLink interface
6 # Copyright 2000 Alexandre Julliard
20 usage: wineshelllink options
23 --desktop create a desktop link
24 --menu create a menu entry
25 --path xx path to the application
26 --link xx name of link to create
27 --args xx command-line arguments for the application
28 --icon xx icon to display
29 --workdir xx working directory for the application
30 --descr xx application description
36 if [ $# -eq 0 ] ; then
43 (--desktop) mode
="desktop"; shift 1 ;;
44 (--menu) mode
="menu"; shift 1 ;;
45 (--path) path
=$2; shift 2 ;;
46 (--link) link
=$2; shift 2 ;;
47 (--args) args
=$2; shift 2 ;;
48 (--icon) icon
=$2; shift 2 ;;
49 (--descr) descr
=$2; shift 2 ;;
50 (--workdir) workdir
=$2; shift 2 ;;
55 if [ "$mode" = "" ] ; then
56 echo Either
--desktop or
--menu required
60 if [ "$link" = "" ] ; then
61 echo You must specify a link name with
--link
70 Name=`basename "$link"`
71 Exec=wine "$path" $args
75 [ -z "$workdir" ] ||
echo "Path=\"$workdir\""
76 [ -z "$xpmicon" ] ||
echo "Icon=$xpmicon"
83 Name=`basename "$link"`
84 Exec=wine "$path" $args
88 [ -z "$workdir" ] ||
echo "Path=\"$workdir\""
89 [ -z "$xpmicon" ] ||
echo "Icon=$xpmicon"
92 # copy the icon file to a specified dir and set xpmicon to the resulting path
97 mkdir
-p "$dir/""`dirname "$link"`" || true
100 cp "$icon" "$dir/$link.xpm"
101 xpmicon
="$dir/$link.xpm"
109 if [ -d "$HOME/.kde" ]
111 copy_icon
"$HOME/.kde/share/applnk/Wine"
112 if [ $mode = "menu" ]
114 kde_entry
> "$HOME/.kde/share/applnk/Wine/$link.kdelnk"
116 # KDE 1.x kludge. Wake up KDE, if we can find kpanel running
117 type kwmcom
>/dev
/null
2>/dev
/null
&& \
118 ps u
-C kpanel
>/dev
/null
2>/dev
/null
&& \
119 kwmcom kpanel
:restart
121 elif [ -d "$HOME/Desktop" ]
123 kde_entry
> "$HOME/Desktop/$link.kdelnk"
124 # KDE 1.x kludge: wake up KDE, if we can find kfm running...
125 type kfmclient
>/dev
/null
2>/dev
/null
&& \
126 ps u
-C kfm
>/dev
/null
2>/dev
/null
&& \
127 kfmclient refreshDesktop
131 if [ -d "$HOME/.kde2" ]
133 copy_icon
"$HOME/.kde2/share/applnk/Wine"
134 if [ $mode = "menu" ]
136 gnome_entry
> "$HOME/.kde2/share/applnk/Wine/$link.desktop"
137 elif [ -d "$HOME/Desktop2" ]
139 gnome_entry
> "$HOME/Desktop2/$link.desktop"
148 if [ -d "$HOME/.gnome" ]
150 copy_icon
"$HOME/.gnome/apps/Wine"
151 if [ $mode = "menu" ]
153 gnome_entry
> "$HOME/.gnome/apps/Wine/$link.desktop"
154 elif [ -d "$HOME/.gnome-desktop" ]
156 gnome_entry
> "$HOME/.gnome-desktop/$link.desktop"