You are not logged in.
I have extended the menu.xml provided by @malm in labwc with the screenshot tool 'grim / slurp' to take screenshots from the left-click menu. The corresponding section looks like this:
<menu id="root-menu">
<item label="Screenshot">
<action name="Execute" command="grim" />
</item>
<item label="screenclip">
<action name="Execute" command="slurp | grim -g -" />
</item>
<item label="Web browser">
<action name="Execute" command="vieb" />
</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>
This also works wonderfully
But I want 'grim' to wait 5 seconds with the screen. It does this perfectly in the terminal:
sleep 5 ; grim
Unfortunately this does not work in the .xml file. I have consulted manpages etc. I'm running out of ideas.
grim -help
Usage: grim [options...] [output-file]
-h Show help message and quit.
-s <factor> Set the output image scale factor. Defaults to the
greatest output scale factor.
-g <geometry> Set the region to capture.
-t png|ppm|jpeg Set the output filetype. Defaults to png.
-q <quality> Set the JPEG filetype quality 0-100. Defaults to 80.
-l <level> Set the PNG filetype compression level 0-9. Defaults to 6.
-o <output> Set the output name to capture.
-c Include cursors in the screenshot.
slurp -help
Usage: slurp [options...]
-h Show help message and quit.
-d Display dimensions of selection.
-b #rrggbbaa Set background color.
-c #rrggbbaa Set border color.
-s #rrggbbaa Set selection color.
-B #rrggbbaa Set option box color.
-F s Set the font family for the dimensions.
-w n Set border weight.
-f s Set output format.
-o Select a display output.
-p Select a single point.
-r Restrict selection to predefined boxes.
-a w:h Force aspect ratio.
Maybe someone of you has an idea?
Thank you!
Last edited by unklar (2024-05-09 09:43:45)
Offline
Hi @unklar
The shorthand syntax won't work, however the `xml` is adaptable
This syntax works:
<?xml version="1.0" ?>
<openbox_menu>
<menu id="root-menu" label="">
<item label="Run Program"><action name="Execute" command="tofi-drun" /></item>
<item label="Screenshot">
<action name="Execute">
<command>bash -c "sleep 5; grim -g \"`slurp`\""</command>
</action>
</item>
<item label="File Manager"><action name="Execute" command="thunar" /></item>
<item label="Web Browser"><action name="Execute" command="netsurf" /></item>
<item label="Terminal"><action name="Execute" command="lxterminal" /></item>
<item label="Reconfigure"><action name="Reconfigure" /></item>
<item label="Exit"><action name="Execute" command="blw-exit" /></item>
</menu>
</openbox_menu>
Just be careful to escape quotes. You can use
\"$(prog)\"
syntax if you prefer.
HTH
#!/bin/sh
echo '#include <stdio.h>\nvoid main() { printf("Hi, bunsenlabs\\n"); return; }' > bunsen.c
gcc bunsen.c -o bunsen
./bunsen
Offline
What I find interesting is how OpenBox changes from time to time.
between
<item label="Thunar">
<action name="Execute">
<execute>thunar</execute>
</action>
</item>
and
<item label="Thunar">
<action name="Execute">
<command>thunar</command>
</action>
</item>
And now I see a section of unklar's OB menu:
<item label="Thunar">
<action name="Execute" command="thunar" />
</item>
I'm just glad it works!
{koff koff} when it works.
Debian 12 Beardog, SoxDog and still a Conky 1.9er
Offline
Hi @unklar
The shorthand syntax won't work, however the `xml` is adaptable
This syntax works:
<?xml version="1.0" ?> <openbox_menu> <menu id="root-menu" label=""> <item label="Run Program"><action name="Execute" command="tofi-drun" /></item> <item label="Screenshot"> <action name="Execute"> <command>bash -c "sleep 5; grim -g \"`slurp`\""</command> </action> </item> <item label="File Manager"><action name="Execute" command="thunar" /></item> <item label="Web Browser"><action name="Execute" command="netsurf" /></item> <item label="Terminal"><action name="Execute" command="lxterminal" /></item> <item label="Reconfigure"><action name="Reconfigure" /></item> <item label="Exit"><action name="Execute" command="blw-exit" /></item> </menu> </openbox_menu>
Just be careful to escape quotes. You can use
\"$(prog)\"
syntax if you prefer.
HTH
BINGO! @micko01
Many thanks for your tip. It works. Grim waits 5 sec. with the picture. So I can show the menu
@Sector11,
in reality I have no idea about the openbox menu. I can't get to you!
Offline
@Sector11,
in reality I have no idea about the openbox menu. I can't get to you!
Quite possibly a change due to Wayland.
Debian 12 Beardog, SoxDog and still a Conky 1.9er
Offline
There is no openbox on Wayland. I think @malm's labwc uses a very similar menu though.
...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 )
Offline
^ https://github.com/labwc/labwc?tab=read … cification
I haven't done it, but you can compare the defaults with Openbox if you care too...
No, he can't sleep on the floor. What do you think I'm yelling for?!!!
Offline
Yes that's rc.xml which does look a lot like openbox's. I think menu.xml too.
I've grown to like jgmenu so much though, I won't enjoy coming back to openbox-style xml menu configs.
Especially if it will mean having to cludge artificial keystrokes to bring up a custom menu from a script. And of course there's no xdotool on Wayland.
...although there are a lot more tools for working with xml than csv.
...how OpenBox changes from time to time.
<item label="Thunar"> <action name="Execute"> <command>thunar</command> </action> </item>
And now I see a section of unklar's OB menu:
<item label="Thunar"> <action name="Execute" command="thunar" /> </item>
That's a difference between how labwc does the menu and how openbox itself does it. In labwc "command" is an attribute of the <action> tag while in openbox it's a <command> tag inside <action>. I'm sure @malm had a reason for making that change.
Last edited by johnraff (2024-05-10 04:44:52)
...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 )
Offline
OOOOOHHH! My OOPS! I did not realize there was no OB on Wayland.
I'll be losing the two of best things of what I like about Linux, conky v9 and Openbox
Debian 12 Beardog, SoxDog and still a Conky 1.9er
Offline
I've grown to like jgmenu so much though, I won't enjoy coming back to openbox-style xml menu configs.
jgmenu works on Wayland. I've used it with sway, river, and labwc.
And of course there's no xdotool on Wayland.
as well as numlockx, wmctrl, etc ... Wayland has some catching up to do to get tools like these available.
You must unlearn what you have learned.
-- yoda
Offline
johnraff wrote:I've grown to like jgmenu so much though, I won't enjoy coming back to openbox-style xml menu configs.
jgmenu works on Wayland. I've used it with sway, river, and labwc.
Great news!
Is that on xwayland?
I read this in 2022 about porting jgmenu to wayland:
This would be pretty hard and messy.
The replacement menu he referrred to is still a WIP: https://github.com/johanmalm/trappist
Still no pipemenus it seems.
Last edited by johnraff (2024-05-11 02:18:24)
...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 )
Offline
Is that on xwayland?
With certainty, yes.
Offline
PackRat wrote:johnraff wrote:I've grown to like jgmenu so much though, I won't enjoy coming back to openbox-style xml menu configs.
jgmenu works on Wayland. I've used it with sway, river, and labwc.
Great news!
Is that on xwayland?I read this in 2022 about porting jgmenu to wayland:
malm wrote:This would be pretty hard and messy.
The replacement menu he referrred to is still a WIP: https://github.com/johanmalm/trappist
Still no pipemenus it seems.
Most likely, as unklar pointed out. And I don't do anything fancy with it.
You must unlearn what you have learned.
-- yoda
Offline
johnraff wrote:PackRat wrote:jgmenu works on Wayland. I've used it with sway, river, and labwc.
Great news!
Is that on xwayland?I read this in 2022 about porting jgmenu to wayland:
malm wrote:This would be pretty hard and messy.
The replacement menu he referrred to is still a WIP: https://github.com/johanmalm/trappist
Still no pipemenus it seems.Most likely, as unklar pointed out. And I don't do anything fancy with it.
I had two installations:
- the pure Wayland (sway)
- the Xwayland (labwc + sway)
After a long time and a lot of frustration, I decided to install Xwayland on top of sway with the pure wayland.
People need a little comfort
Offline
I had two installations:
- the pure Wayland (sway)
- the Xwayland (labwc + sway)
After a long time and a lot of frustration, I decided to install Xwayland on top of sway with the pure wayland.
People need a little comfort
For a user, I think that's exactly right.
As developers, I think it would be good for BL to push as hard as possible for a pure Wayland version, and at the end, when we've done as much as we can, at that point to add xwayland so our users can have some comfort.
...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 )
Offline
unklar wrote:I had two installations:
- the pure Wayland (sway)
- the Xwayland (labwc + sway)
After a long time and a lot of frustration, I decided to install Xwayland on top of sway with the pure wayland.
People need a little comfortFor a user, I think that's exactly right.
As developers, I think it would be good for BL to push as hard as possible for a pure Wayland version, and at the end, when we've done as much as we can, at that point to add xwayland so our users can have some comfort.
I guess as Wayland is the future. X11 still will hang around until Wayland becomes feature complete and mature, if ever.
Real Men Use Linux
Offline
^...if ever.
Well, probably Wayland will be complete some day, unless yet another windowing system comes in before then.
Meanwhile, devs have their own opinions but I don't see BunsenLabs Carbon as being anything other than X11 based. But we might be able to put out something minimal for the more adventurous users alongside that. A lot of interesting work is being done round here (not by me though).
But as for Nitrogen, who knows?
...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 )
Offline
Maybe I'm getting something wrong...
From what I've read about Wayland so far, Wayland is actually 'finished'.
What is not 'finished' are the many, many applications that only 'can' use the previous X server and do not 'understand' wayland. That's why Xwayland was invented as an interim solution so that these applications can 'communicate' again. Unfortunately, this does not apply to ALL applications.
A good example in this context is my problem labwc + flameshot. If there was a dbus for wayland, flameshot would have no problems with the display. But then it wouldn't be wayland.
Offline
I suppose many people when they say "Wayland" mean "a Wayland-powered desktop".
By that meaning, a "feature-complete Wayland" would imply that all - or at least most - of the functionality that current users of X11-based desktops expect, would be available.
We have to wait for either:
1) most of the applications we use on X11 become usable on Wayland
or
2) alternative applications become available for most of those functions
...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 )
Offline
Offline