Some additional testing:

Custom entries in ~/.local/share/applications are correctly picked up.
"NoDisplay=true" appended to *.desktop entries is honored.
The script provides another way to remove clutter from menu's.

My modified script with _shutdown group enabled commands:

ignore_files=$(mktemp)
trap "rm -f $ignore_files" EXIT
cat <<'EOF' >${ignore_files}
foot-server.desktop
footclient.desktop
geoclue-where-am-i.desktop
gtk3-demo.desktop
gtk3-icon-browser.desktop
gtk3-widget-factory.desktop
org.gnome.Adwaita1.Demo.desktop
org.gnome.Yelp.desktop
org.gnome.Zenity.desktop
xdg-desktop-portal-gtk.desktop
EOF

printf '%b\n' '<?xml version="1.0" encoding="UTF-8"?>
<openbox_menu>
<menu id="root-menu" label="root-menu">
  <item label="Applications  ">
  </item>
  <separator />'

# -b|--bare    Disables header and footer
# -i|--ignore  Excludes all .desktop files listed at the top of this file
labwc-menu-generator --bare --icons --ignore "${ignore_files}"

# -b|--bare    Disables header and footer
# -i|--ignore  Excludes all .desktop files listed at the top of this file
labwc-menu-generator --bare --icons --ignore "${ignore_files}"

printf '%b\n' '<separator />
  <item label="Logoff" icon="system-log-out">
    <action name="Exit" />
  </item>
  <item label="Reboot" icon="system-reboot">
    <action name="Execute">
      <command>/sbin/shutdown -r now</command>
</action> </item>
  <item label="Shutdown" icon="system-shutdown">
    <action name="Execute">
      <command>/sbin/shutdown -hp now</command>
    </action>
  </item>
</menu> <!-- root-menu -->
</openbox_menu>'


--
J. Scott Heppler

Reply via email to