You are not logged in.

#1 2026-01-08 06:41:54

johnraff
nullglob
From: Nagoya, Japan
Registered: 2015-09-09
Posts: 13,050
Website

bl-menu menu launcher

I just want to throw this in at the last minute - a tiny script to launch jgmenu or <whatever launches the labwc menu> depending on if the session is using X11 or wayland:

#!/bin/sh

# small wrapper to launch right menu for x11 or wayland

x11_menu=jgmenu_run
wayland_menu=''

# BUNSEN_SESSION_TYPE is exported by bunsenlabs-session
case $BUNSEN_SESSION_TYPE in
x11)
    menucmd=$x11_menu
    ;;
wayland)
    menucmd=$wayland_menu
    ;;
*)
    echo "$0: unexpected session type: $BUNSEN_SESSION_TYPE" >&2
    exit 1
    ;;
esac

[ -z "$menucmd" ] && {
    echo "$0: no $menucmd is set for session type: $BUNSEN_SESSION_TYPE" >&2
    exit 1
}

exec "$menucmd"

If the xfce4-panel flame-icon launcher is set to execute 'bl-menu' then it will work regardless of the session type.
Might be nice to be able to use the same xfce4-panel config for both X11 and wayland sessions.
Users won't see any difference, so I'd like to put it in bunsen-configs before the final Carbon build.
Does that seem reasonable?

---
PS I've had a quick look at labwc and it doesn't seem as if there is any command to launch the menu, only keybinds. neutral
So for Wayland we'd be reduced to using something clunky like xdotool to simulate keybinds. A pity, because it's very useful for scripts to be able to put up custom pipemenus on demand.

Last edited by johnraff (2026-01-08 07:19:31)


...elevator in the Brain Hotel, broken down but just as well...
( a boring Japan blog (currently paused), now on Bluesky, there's also some GitStuff )

Introduction to the Bunsenlabs Boron Desktop

Offline

#2 2026-01-08 09:43:14

unklar
Back to the roots 1.9
From: #! BL
Registered: 2015-10-31
Posts: 2,844

Re: bl-menu menu launcher

johnraff wrote:

Does that seem reasonable?

^absolutely!
Great work, big thank you.  smile

PS I've had a quick look at labwc and it doesn't seem as if there is any command to launch the menu, only keybinds. neutral
So for Wayland we'd be reduced to using something clunky like xdotool to simulate keybinds. A pity, because it's very useful for scripts to be able to put up custom pipemenus on demand.

Unfortunately, I don't have a proper understanding of this. That's why I had years ago in labwc/siduction
I created this right/left click menu, which is still enough for me today.

<?xml version="1.0" encoding="UTF-8"?>

<openbox_menu>
<!-- Note: for localization support of menu items "client-menu" has to be removed here -->
<menu id="client-menu">
  <item label="Minimize">
    <action name="Iconify" />
  </item>
  <item label="Maximize">
    <action name="ToggleMaximize" />
  </item>
  <item label="Fullscreen">
    <action name="ToggleFullscreen" />
  </item>
  <item label="Decorations">
    <action name="ToggleDecorations" />
  </item>
  <item label="Always on Top">
    <action name="ToggleAlwaysOnTop" />
  </item>
  <!--
    Any menu with the id "workspaces" will be hidden
    if there is only a single workspace available.
  -->
  <menu id="workspaces" label="Workspace">
    <item label="Move left">
      <action name="SendToDesktop" to="left" />
    </item>
    <item label="Move right">
      <action name="SendToDesktop" to="right" />
    </item>
    <separator />
    <item label="Always on Visible Workspace">
      <action name="ToggleOmnipresent" />
    </item>
  </menu>
  <item label="Close">
    <action name="Close" />
  </item>
</menu>

<menu id="root-menu">
  <item label="Screenshot">
    <action name="Execute">
      <command>bash -c "sleep 5; grim"</command>
    </action>
  </item>
  <item label="screenclip">
    <action name="Execute"> 
      <command>bash -c "slurp | grim -g -"</command>
    </action>
  </item>
  <item label="Web browser">
    <action name="Execute" command="firefox-esr" />
  </item>
  <item label="Terminal">
    <action name="Execute" command="foot" />
  </item>
  <item label="Thunar">
    <action name="Execute" command="thunar" />
  </item>
  <item label="Conky">
    <action name="Execute" command="conky -c ~/.conky/rcmus_conkyrc10" />
  </item>
  <item label="killConky">
    <action name="Execute" command="killall conky" />
  </item>
  <item label="Reconfigure">
    <action name="Reconfigure" />
  </item>
  <item label="Logout">
    <action name="Exit" />
  </item>
    <item label="Suspend">
    <action name="Execute" command="systemctl -i suspend" />
  </item>
    <item label="Reboot">
    <action name="Execute" command="systemctl -i reboot" />
  </item>
  <item label="Poweroff">
    <action name="Execute" command="systemctl -i poweroff" />
  </item>
</menu>

<menu id="some-custom-menu">
  <item label="Reconfigure">
    <action name="Reconfigure" />
  </item>
  <item label="Exit">
    <action name="Exit" />
  </item>
</menu>

</openbox_menu>

and, I'll do the rest via fuzzel. I know that doesn't help you either...  sad

Last edited by unklar (2026-01-08 09:50:07)

Offline

#3 2026-01-08 17:07:35

malm
jgmenu developer
Registered: 2016-10-13
Posts: 752
Website

Re: bl-menu menu launcher

PS I've had a quick look at labwc and it doesn't seem as if there is any command to launch the menu, only keybinds.

Yes. That is the case. It's not trivial to implement in a non-hacky way. Same for Openbox I think.

So for Wayland we'd be reduced to using something clunky like xdotool to simulate keybinds. A pity, because it's very useful for scripts to be able to put up custom pipemenus on demand.

Happy to brainstorm requirements/needs/ideas.

Offline

#4 2026-01-09 00:40:41

johnraff
nullglob
From: Nagoya, Japan
Registered: 2015-09-09
Posts: 13,050
Website

Re: bl-menu menu launcher

^Hi @malm!

Programatically launched menus is one of the benefits of jgmenu, at least for me, but if it's hard to do nicely with a compositor then it's not the end of the world. With openbox we had xdotool which will emulate keypresses, and there's now ydotool, and yesterday I learned about wtype, both of which look usable on Wayland.

But if you know of any user activity in that direction in the labwc world, then links would be welcome! smile

EDIT just found this: https://github.com/labwc/labwc/issues/2726
(Did a search on the labwc issues yesterday but must have used the wrong keywords because nothing came up.)

Last edited by johnraff (2026-01-09 00:53:13)


...elevator in the Brain Hotel, broken down but just as well...
( a boring Japan blog (currently paused), now on Bluesky, there's also some GitStuff )

Introduction to the Bunsenlabs Boron Desktop

Offline

Board footer

Powered by FluxBB