[PATCH UPDATE] tools/wineconf *METHOD3*

Speeddymon speeddymon at yahoo.com
Thu Apr 25 15:59:44 CDT 2002


this is the updated version of tools/wineshelllink
method 1 to add menu items for installed programs

works on mandrake and debian (both as root) and should
work for redhat

determines kde version by piping kde-config -v output
through grep and then sed and outputting it to a file
(${HOME}/kdever)

sed's that file to grab the first number in the file
(1 or 2) and uses that to determine whether to do a
kde 1.x-type menu install or a kde 2.x-type menu
install

note that users with distros that leave the kde 2.x
directories alone (~/.kde2 and ~/Desktop2) will have
no problem using this as that functionality is still
there

this just adds the checks for the distro's that have
KDE 2.x but use ~/.kde and ~/Desktop

it also still has functionality for kde 1.x users on
all distros


*NOTE* this is exactly the same as method 1 but works
for all users (as long as they run it in a terminal)
by asking for the root password to install to the
mandrake/debian menu directory

__________________________________________________
Do You Yahoo!?
Yahoo! Games - play chess, backgammon, pool and more
http://games.yahoo.com/
-------------- next part --------------
Name: tools_wineshelllink-dnavea-patch_fixed-METHOD3
ModifiedFiles: tools/wineshelllink
ChangeLog: checks if you are root and if not performs su, checks
	     for /usr/lib/menu and if it exists copies menu config
	     info to there, checks for kde-config binary and sends the
	     version output through some pipes to get just the number and
	     stores it in a file, uses that stored number to decide which
	     install path to take (KDE 1.x or 2.x)
	   NOTE: this is the fixed patch, the last one had not been
	     tested well enough to be used on any system but my own
	   NOTE2: this patch should fix any system that has had problems
	     with wineshelllink not making menu changes, including those
	     with kde2 but a .kde dir in their home dir
Licensed-to: WineHQ, TransGaming, CodeWeavers, anyone else
Author: Dustin Navea
===============================================================================
--- /wine-20020411/tools/wineshelllink.backup	Thu Apr 25 07:51:41 2002
+++ /wine-20020411/tools/wineshelllink	Thu Apr 25 08:02:21 2002
@@ -145,30 +145,57 @@
     xpmicon=""
   fi
   mdk_entry >> "$HOME/.menu/wine"
+  if [ -d "/usr/lib/menu" -a "$mode" = "menu" -a ! `whoami` = "root" ]
+  then
+    echo "You must be root to install menu items, please type in the
+    echo "root password."
+    su -c "mdk_entry >> \"/usr/lib/menu/wine\""
+  elif [ `whoami` = "root" ]
+  then
+    mdk_entry >> "/usr/lib/menu/wine"
+  fi
   update-menus > /dev/null 2>&1
 fi
 
+if [ `which kde-config >/dev/null 2>&1` ]
+then
+  kde-config -v | grep KDE: | sed -n "s/KDE: \(.*\)/\1/p" >${HOME}/kdever
+fi
+
 # KDE
 
 if [ -d "$HOME/.kde" ]
 then
-  copy_icon "$HOME/.kde/share/applnk/Wine"
-  if [ $mode = "menu" ]
+  if [ `sed -n "s/\(.*\)..../\1/p" ${HOME}/kdever` = 1 -o `sed -n "s/\(.*\)../\1/p" ${HOME}/kdever` = 1 -o ! -f ${HOME}/kdever ]
   then
-    kde_entry > "$HOME/.kde/share/applnk/Wine/$link.kdelnk"
-
-    # KDE 1.x kludge.  Wake up KDE, if we can find kpanel running
-    which kwmcom >/dev/null 2>/dev/null && \
-      ps u -C kpanel >/dev/null 2>/dev/null && \
-        kwmcom kpanel:restart
-
-  elif [ -d "$HOME/Desktop" ]
-  then
-    kde_entry > "$HOME/Desktop/$link.kdelnk"
-    #   KDE 1.x kludge:  wake up KDE, if we can find kfm running...
-    which kfmclient >/dev/null 2>/dev/null && \
-      ps u -C kfm >/dev/null 2>/dev/null  && \
-        kfmclient refreshDesktop
+    copy_icon "$HOME/.kde/share/applnk/Wine"
+    if [ $mode = "menu" ]
+    then
+      kde_entry > "$HOME/.kde/share/applnk/Wine/$link.kdelnk"
+
+      # KDE 1.x kludge.  Wake up KDE, if we can find kpanel running
+      which kwmcom >/dev/null 2>/dev/null && \
+        ps u -C kpanel >/dev/null 2>/dev/null && \
+          kwmcom kpanel:restart
+
+    elif [ -d "$HOME/Desktop" ]
+    then
+      kde_entry > "$HOME/Desktop/$link.kdelnk"
+      #   KDE 1.x kludge:  wake up KDE, if we can find kfm running...
+      which kfmclient >/dev/null 2>/dev/null && \
+        ps u -C kfm >/dev/null 2>/dev/null  && \
+          kfmclient refreshDesktop
+    fi
+  elif [ `sed -n "s/\(.*\)..../\1/p" ${HOME}/kdever` = 2 -o `sed -n "s/\(.*\)../\1/p" ${HOME}/kdever` = 2 ]
+  then
+    copy_icon "$HOME/.kde/share/applnk/Wine"
+    if [ $mode = "menu" ]
+    then
+      gnome_entry > "$HOME/.kde/share/applnk/Wine/$link.desktop"
+    elif [ -d "$HOME/Desktop" ]
+    then
+      gnome_entry > "$HOME/Desktop/$link.desktop"
+    fi
   fi
 fi
 
@@ -182,8 +209,6 @@
   then
     gnome_entry > "$HOME/Desktop2/$link.desktop"
   fi
-
-
 fi
 
 


More information about the wine-patches mailing list