~chambln/xdgmenu

d683399c894468ffbed6c12c7940dba6b59e2449 — Gregory Chamberlain 14 days ago 667527d
Add generic-names.patch
2 files changed, 21 insertions(+), 4 deletions(-)

A patches/generic-names.patch
M xdgmenu
A patches/generic-names.patch => patches/generic-names.patch +20 -0
@@ 0,0 1,20 @@
diff --git a/xdgmenu b/xdgmenu
--- a/xdgmenu
+++ b/xdgmenu
@@ -40,6 +40,7 @@ regenerate_cache() {
                       Exec) exec=$value ;;
                       Name) name=$value ;;
                       NoDisplay) [ _"$value" = _true ] && continue 2 ;;
+                      GenericName) generic=$value ;;
                   esac
               done < "$file"
 
@@ -47,7 +48,7 @@ regenerate_cache() {
               # because we first check whether it is non-empty using :+
               # parameter expansion.
               # shellcheck disable=SC2154
-              printf '%s\t%s\n' "$name" "$exec"
+              printf '%s\t%s\n' "$name${generic:+ ($generic)}" "$exec"
           done
     done > "$CACHE"/entries
 }

M xdgmenu => xdgmenu +1 -4
@@ 40,9 40,6 @@ regenerate_cache() {
                      Exec) exec=$value ;;
                      Name) name=$value ;;
                      NoDisplay) [ _"$value" = _true ] && continue 2 ;;

                      # Uncomment the line below to show generic names.
                      #GenericName) generic=$value ;;
                  esac
              done < "$file"



@@ 50,7 47,7 @@ regenerate_cache() {
              # because we first check whether it is non-empty using :+
              # parameter expansion.
              # shellcheck disable=SC2154
              printf '%s\t%s\n' "$name${generic:+ ($generic)}" "$exec"
              printf '%s\t%s\n' "$name" "$exec"
          done
    done > "$CACHE"/entries
}