[PATCH REPOST] tools/wineshelllink *METHODS 1 & 2*

Speeddymon speeddymon at yahoo.com
Thu Apr 25 16:40:31 CDT 2002


*** ok for some reason not all of my patches got
posted so here they are again

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

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

method 1 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
 









__________________________________________________
Do You Yahoo!?
Yahoo! Games - play chess, backgammon, pool and more
http://games.yahoo.com/
-------------- next part --------------
Name: tools_wineshelllink-dnavea-patch_fixed-METHOD1
ModifiedFiles: tools/wineshelllink
ChangeLog: 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 07:54:17 2002
@@ -145,30 +145,52 @@
     xpmicon=""
   fi
   mdk_entry >> "$HOME/.menu/wine"
+  if [ -d "/usr/lib/menu" ]
+  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" ]
+    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
-    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
+      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 +204,6 @@
   then
     gnome_entry > "$HOME/Desktop2/$link.desktop"
   fi
-
-
 fi
 
 
-------------- next part --------------
Name: tools_wineshelllink-dnavea-patch_fixed-METHOD2
ModifiedFiles: tools/wineshelllink
ChangeLog: checks for /usr/lib/menu and if it exists copies menu config
	     info to there
	     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 which uses a K Menu
	     format that is different from the KDE Default (i.e. Mandrake)
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 07:59:43 2002
@@ -145,6 +145,10 @@
     xpmicon=""
   fi
   mdk_entry >> "$HOME/.menu/wine"
+  if [ -d "/usr/lib/menu" ]
+  then
+    mdk_entry >> "/usr/lib/menu/wine"
+  fi
   update-menus > /dev/null 2>&1
 fi
 
@@ -182,8 +186,6 @@
   then
     gnome_entry > "$HOME/Desktop2/$link.desktop"
   fi
-
-
 fi
 
 


More information about the wine-patches mailing list