#Name[de]=Vorlage
# Replace "command" with the actual command or script:
-Exec=command %f
+Exec=command <param>
+# Where <param> may be:
+# omitted If no parameter is given the command will be executed in the
+# current folder. If a parameter is given but the current folder
+# does not contain any files, the command will not be run.
+#
# %f A single file name, even if multiple files are selected. The
# system reading the desktop entry should recognize that the program in
# question cannot handle multiple file arguments, and it should should
Categories=X-Geeqie;
OnlyShowIn=X-Geeqie;
-# Uncomment the following line to include in a Geeqie menu,
-# other than in the default path of EditMenu/ExternalMenu
+# Uncomment the following line to include in a Geeqie menu
+# other than in the default path of PluginsMenu
#X-Geeqie-Menu-Path=<FileMenuPath>
# e.g.
# ViewMenu/ViewSection
# ViewMenu/ToolsSection
# ViewMenu/SlideShowSection
+# WindowsMenu
+# WindowsMenu/NewWindow
# HelpMenu
# HelpMenu/HelpSection
# This is a filter - see symlink.desktop and geeqie-symlink for an example
-# how to use this feature
+# of how to use this feature, or the Plugins section of the Help file.
#X-Geeqie-Filter=true
# It can be made verbose
#X-Geeqie-Verbose=true
+
+# For other keys such as MimeType see https://developer.gnome.org/desktop-entry-spec/
--- /dev/null
+#! /bin/bash
+
+# Insert updated menu "Valid sections" list into the desktop template file.
+# This needs to be run only when the menus have changed.
+
+tmp_file=$(mktemp)
+path=$(dirname $(realpath $0))
+srcpath=$(dirname $path)"/src/layout_util.c"
+templatepath=$(dirname $path)"/plugins/template.desktop.in"
+
+awk -v src_path=$srcpath 'BEGIN {
+menu_flag = 0
+template_flag = 0
+i = 0
+}
+
+function get_menus()
+{
+ {while ((getline line < src_path) > 0 )
+ {
+ if (line == "\"<ui>\"")
+ {
+ menu_flag = 1
+ }
+ if (line == "\"<\057ui>\";")
+ {
+ menu_flag = 0
+ }
+ if (menu_flag >= 1)
+ {
+ gsub(/\047|"|\/|<|>/, "", line)
+ split(line, lineArr, "=")
+
+ if (index(lineArr[1], "menu action") > 0)
+ {
+ i = i + 1
+ menu[i] = lineArr[2]
+ if ( i == 3)
+ {
+ print "# " menu[1] "/" menu[2] "/" lineArr[2]
+ }
+ if ( i == 2)
+ {
+ print "# " menu[1] "/" lineArr[2]
+ }
+ if (i == 1)
+ {
+ print "# " lineArr[2]
+ }
+ }
+ if (index(lineArr[1], "placeholder name"))
+ {
+ if ( i == 2)
+ {
+ print "# " menu[1] "/" menu[2] "/" lineArr[2]
+ }
+ else
+ {
+ print "# " menu[1] "/" lineArr[2]
+ }
+ }
+ gsub(" ", "", line)
+ if (line == "menu")
+ {
+ i = i - 1
+ }
+ }
+ }
+ }
+}
+
+/Valid sections/ {template_flag = 1; print; get_menus()}
+/This is a filter/ {template_flag = 0; print ""}
+(template_flag == 0) {print}
+' $templatepath > $tmp_file
+
+zenity --text-info < $tmp_file
+if [ $? == 0 ]
+then
+ mv $tmp_file $templatepath
+else
+ rm $tmp_file
+fi