3 # Insert updated menu "Valid sections" list into the desktop template file.
4 # This needs to be run only when the menus have changed.
7 path=$(dirname "$(realpath "$0")")
8 srcpath=$(dirname "$path")/src/layout_util.c
9 templatepath=$(dirname "$path")/plugins/template.desktop.in
11 awk -v src_path="$srcpath" 'BEGIN {
19 {while ((getline line < src_path) > 0 )
21 if (line == "\"<ui>\"")
25 if (line == "\"<\057ui>\";")
31 gsub(/\047|"|\/|<|>/, "", line)
32 split(line, lineArr, "=")
34 if (index(lineArr[1], "menu action") > 0)
40 print "# " menu[1] "/" menu[2] "/" lineArr[2]
44 print "# " menu[1] "/" lineArr[2]
51 if (index(lineArr[1], "placeholder name"))
55 print "# " menu[1] "/" menu[2] "/" lineArr[2]
59 print "# " menu[1] "/" lineArr[2]
72 /Valid sections/ {template_flag = 1; print; get_menus()}
73 /This is a filter/ {template_flag = 0; print ""}
74 (template_flag == 0) {print}
75 ' "$templatepath" > "$tmp_file"
77 zenity --text-info < "$tmp_file"
80 mv "$tmp_file" "$templatepath"