Use GdkPoint in PAN_ITEM_TRIANGLE coord
[geeqie.git] / scripts / template-desktop.sh
index 25940f2..60a22c9 100755 (executable)
@@ -1,4 +1,4 @@
-#! /bin/bash
+#!/bin/sh
 
 
 ## @file
@@ -7,10 +7,10 @@
 ## This needs to be run only when the menus have changed.
 ##
 
-tmp_file=$(mktemp)
+tmp_file=$(mktemp "${TMPDIR:-/tmp}/geeqie.XXXXXXXXXX")
 path=$(dirname "$(realpath "$0")")
-srcpath=$(dirname "$path")/src/layout_util.c
-templatepath=$(dirname "$path")/plugins/template.desktop.in
+srcpath=$(dirname "$path")/src/ui/menu-classic.ui
+templatepath=$(dirname "$path")/plugins/org.geeqie.template.desktop.in
 
 awk -v src_path="$srcpath" 'BEGIN {
 menu_flag = 0
@@ -22,11 +22,11 @@ function get_menus()
 {
        {while ((getline line < src_path) > 0 )
                {
-               if (line == "\"<ui>\"")
+               if (line == "<ui>")
                        {
                        menu_flag = 1
                        }
-               if (line == "\"<\057ui>\";")
+               if (line == "<\047ui>")
                        {
                        menu_flag = 0
                        }
@@ -68,22 +68,24 @@ function get_menus()
                                {
                                i = i - 1
                                }
+                       if (lineArr[2] == "PluginsMenu")
+                               {
+                               i = i - 1
+                               }
                        }
                }
        }
 }
 
 /Valid sections/ {template_flag = 1; print; get_menus()}
-/This is a filter/ {template_flag = 0; print ""}
+/For other keys/ {template_flag = 0; print ""}
 (template_flag == 0) {print}
 '  "$templatepath" > "$tmp_file"
 
-cat $tmp_file
-echo $PWD
-
-diff --unified=0 "./plugins/template.desktop.in" "$tmp_file" | zenity --title="Plugin template update" --text-info --width=700 --height=400
+cat "$tmp_file"
+printf '%s\n' "$PWD"
 
-if [ "$?" == 0 ]
+if diff --unified=0 "./plugins/org.geeqie.template.desktop.in" "$tmp_file" | zenity --title="Plugin template update" --text-info --width=700 --height=400
 then
        mv "$tmp_file" "$templatepath"
 else