summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormartin <martin@NetBSD.org>2022-07-24 11:51:22 +0000
committermartin <martin@NetBSD.org>2022-07-24 11:51:22 +0000
commita8d10c0df3ffe806700102c829c46600c4698907 (patch)
treeea8a8f607bf35e5152eaea6262f70fb72f88fa8d
parent19abef2d6c0590829f035950a69d76bde8f64b50 (diff)
Pull up following revision(s) (requested by nia in ticket #1481):
external/mit/ctwm/libexec/ctwm_app_menu: revision 1.5 (via patch) ctwm_app_menu: Work around "emacs being installed results in the generated ctwmrc containing invalid syntax" problem. Emacs installs a desktop file called "emacsclient" that contains "doublequotes" in its exec string. Pending a better solution for dumping escaped shell lines into the config file, hide or sanitize desktop entires that might mess up the internal ctwmrc quoting rules.
-rw-r--r--external/mit/ctwm/libexec/ctwm_app_menu12
1 files changed, 9 insertions, 3 deletions
diff --git a/external/mit/ctwm/libexec/ctwm_app_menu b/external/mit/ctwm/libexec/ctwm_app_menu
index f3709fa0c87..f50fd1b6c1e 100644
--- a/external/mit/ctwm/libexec/ctwm_app_menu
+++ b/external/mit/ctwm/libexec/ctwm_app_menu
@@ -1,12 +1,13 @@
#!/bin/sh
-# $NetBSD: ctwm_app_menu,v 1.1.2.2 2020/10/08 16:04:07 martin Exp $
+# $NetBSD: ctwm_app_menu,v 1.1.2.3 2022/07/24 11:51:22 martin Exp $
OFS=$IFS
IFS='
'
printf 'menu "appmenu"\n'
printf '{\n'
printf '\t"Applications"\tf.title\n'
-for app in $(find /usr/pkg/share/applications -name '*.desktop');
+LOCALBASE=$(pkg_info -Q LOCALBASE pkg_install 2>/dev/null || echo /usr/pkg)
+for app in $(find $LOCALBASE/share/applications -name '*.desktop')
do
name=""
exec=""
@@ -18,13 +19,18 @@ do
Name=*)
if ! [ -n "$name" ];
then
- name=$(printf '%s' "$line" | cut -c6- | tr -d '\r')
+ name=$(printf '%s' "$line" | cut -c6- | tr -d '\r"')
fi
;;
Exec=*)
if ! [ -n "$exec" ];
then
exec=$(printf '%s' "$line" | cut -c6- | sed -e 's/ %.*//g' | tr -d '\r')
+ if printf '%s' "$exec" | grep -q '"'; then
+ # results in malformed config file, better way
+ # to handle this...?
+ nodisplay="true"
+ fi
fi
;;
Terminal=true)