You are not logged in.
I'd like to have both dmenu and the main menu appear in the same screenshot, but one excludes the other.
Is there a way to show the root-menu from a shell command, or alternatively to be able to have dmenu release the keyboard or mouse?
I suspect the answer is either blindingly obvious, or impossible, because extensive googling hasn't helped!
Be Excellent to Each Other...
The Bunsenlabs Lithium Desktop » Here
FORUM RULES and posting guidelines «» Help page for forum post formatting
Artwork on DeviantArt «» BunsenLabs on DeviantArt
Offline
You could use xdotool to 'right-click' somewhere on the desktop after spawning dmenu from a subshell, I imagine.
Music makes us braver
Offline
You could use xdotool to 'right-click' somewhere on the desktop after spawning dmenu from a subshell, I imagine.
That is effectively what I have been trying to do, but perhaps I have the subshell syntax wrong. Whatever - one or the other grabs the keyboard. I have tried various combinations of starting one before the other. If dmenu starts first, the main menu doesn't show; if the desktop click is first I get a "cannot grab keyboard" error message in the terminal.
This is the last code I tried (snippet from a test script):
wmctrl -k on #show desktop
xdotool mousemove --sync $posX $posy
(xdotool click 3 && sleep 2 && xdotool click 1) & # "click" on desktop
(.config/dmenu/dmenu-bind.sh) &
sleep 2s && xdotool key Escape # close dmenu
I can run a scrot command after starting one or the other, so I guess it must be because only one process can have the keyboard at any one time.
Be Excellent to Each Other...
The Bunsenlabs Lithium Desktop » Here
FORUM RULES and posting guidelines «» Help page for forum post formatting
Artwork on DeviantArt «» BunsenLabs on DeviantArt
Offline
It would be interesting to know whether x considers the windows for both as dialogs as well, since dialogs traditionally grab focus. Of course, both are designed to lose focus as soon as a command is selected. Reason I am saying this, is because if you could convince one or the other to temporarily act as a window, that would at least be part of the battle solved.
Last edited by tknomanzr (2015-10-11 02:06:36)
Offline
Maybe make a pipemenu that calls dmenu? As you scroll over the entry dmenu pops up and the root menu shouldn't go away. I can't test this because I'm not in openbox right now.
<menu id="dmenu" label="Show dmenu" execute="dmenu" />
Offline
Ugly solution: change dmenu's source code to not grab the keyboard. It will lose focus right away so you'll have to pipe into it whatever you want to show in the scrot when you spawn it, and you'll have to kill it with `killall` or whatever you prefer to use to kill stuff.
diff --git a/dmenu.c b/dmenu.c
old mode 100644
new mode 100755
index 0c53e59..ae02e77
--- a/dmenu.c
+++ b/dmenu.c
@@ -113,12 +113,12 @@ main(int argc, char *argv[]) {
initfont(dc, font ? font : DEFAULTFN);
if(fast) {
- grabkeyboard();
+ /*grabkeyboard();*/
readstdin();
}
else {
readstdin();
- grabkeyboard();
+ /*grabkeyboard();*/
}
setup();
run();
If you can't sit by a cozy fire with your code in hand enjoying its simplicity and clarity, it needs more work. --Carlos Torres
Offline
Thanks for the imaginative replies
The reason for wanting it is to script a screenshot of a user's set up, with a representative appearance. Which means no fiddling with dmenu source code, or changing the menu.
If it was just for me I would take 2 scrots and merge them with gimp
Be Excellent to Each Other...
The Bunsenlabs Lithium Desktop » Here
FORUM RULES and posting guidelines «» Help page for forum post formatting
Artwork on DeviantArt «» BunsenLabs on DeviantArt
Offline
There is probably a way to automate this by using two or three scrots,
a. empty
b. with rootmenu
c. with dmenu
and doing some sort of empty + diff:rootmenu + diff:dmenu > final
stuff.
http://www.imagemagick.org/script/compare.php
(Have not test this personally)
Last edited by brontosaurusrex (2015-10-11 11:41:54)
Online
There is probably a way to automate this by using two or three scrots,
a. empty
b. with rootmenu
c. with dmenuand doing some sort of empty + diff:rootmenu + diff:dmenu > final
stuff.
http://www.imagemagick.org/script/compare.php
(Have not test this personally)
It had also occurred to me to use IM in this way, but I decided to put it off until it is a last resort!
Be Excellent to Each Other...
The Bunsenlabs Lithium Desktop » Here
FORUM RULES and posting guidelines «» Help page for forum post formatting
Artwork on DeviantArt «» BunsenLabs on DeviantArt
Offline
Doing some quick tests, but its not even remotely doing what I want.
Online
@damo - how are you starting the root menu and dmenu?
In fluxbox, I use key bindings to activate the menu or dmenu. I can get both in a screenshot if I -
1. Open a terminal and start scrot with a time delay - you can minimize the terminal if you don't want it in the shot.
2. Open root menu
3. Open dmenu
Wait for scrot to finish.
Does the openbox menu automatically close if the mouse is moved off / loses focus? I don't have it installed so I cant't check that.
edit - dmenu steals keyboard in fluxbox as well
Last edited by PackRat (2015-10-11 19:48:55)
You must unlearn what you have learned.
-- yoda
Online
In Openbox I haven't yet found a way to open both at the same time. either by scripting, terminal commands or keys. The menu disappears when it loses focus, and dmenu grabs the keyboard when it runs.
They are mutually exclusive it seems
Be Excellent to Each Other...
The Bunsenlabs Lithium Desktop » Here
FORUM RULES and posting guidelines «» Help page for forum post formatting
Artwork on DeviantArt «» BunsenLabs on DeviantArt
Offline
In Fluxbox it's easy. Left click and drag on any menu/submenu title will hold it visible until you press Esc even if you launch menu items. I've never heard of a similar feature in OB.
Offline
As PackRat says;
...and I am assuming that you have 2 or more desktops available;
1. From desktop #1 set up dmenu and main menu and decoration as you like.
2. From desktop #2 invoke 'scrot -d 5' (this will give a 5 second delay to switch back to your nicely configured 'pre-screenshot' on desktop #1
3. ...wait
4. You should have a nice scrot of your desired desktop...
Offline
In Openbox I haven't yet found a way to open both at the same time.
But you can take a screenshot when either one is open by itself, correct?
1. Take one screenshot with dmenu open.
2. Set the screenshot as your wallpaper
3. Take second screenshot with root menu open.
You must unlearn what you have learned.
-- yoda
Online
@mrneilypops & @PackRat
Dontcha just love ingenious workarounds!
I should be able to script that, and clean things up afterwards.
Be Excellent to Each Other...
The Bunsenlabs Lithium Desktop » Here
FORUM RULES and posting guidelines «» Help page for forum post formatting
Artwork on DeviantArt «» BunsenLabs on DeviantArt
Offline