Hi All,
In a boneheaded move, I ended up deleting quite a few of my .config files (user/.trinity/…) and while I’ve restored/fixed almost everything back to the way it was, I can’t seem to re-figure out how I used a mouse click in keyboard shortcuts.
I had this working globally:
{Windows Key} + {left mouse click} = Minimize application under mouse cursor
If you get use to it, it’s insanely useful and much easier than tracking down each app’s minimize button.
# # #
I thought I had originally set it up in the Trinity Control Center:
Trinity Control Center >> Regional & Accessibility >> Keyboard Shortcuts (Global Shortcuts >> Windows >> Minimize Window)
But I can’t get that to take a mouse click in the “Configure Shortcut” popup. {Windows Key} + {space} works.
AFAIK I didn’t install anything else to do this:
michael@local [~/.trinity/share]# which file xbindkeys xdotool xautomation easystroke xev
/usr/bin/file /usr/bin/xev
# # #
So a couple questions:
- Does the “Configure Shortcut” popup take mouse clicks for anyone else?
- Can anyone point me in the right direction on what I need to dig back into to restore/fix it’s config so mouse clicks can be use in keyboard shortcuts again?
Thanks All, Michael
On Wednesday 27 June 2018 03:37:33 pm Michael wrote:
Hi All,
In a boneheaded move, I ended up deleting quite a few of my .config files (user/.trinity/…) and while I’ve restored/fixed almost everything back to the way it was, I can’t seem to re-figure out how I used a mouse click in keyboard shortcuts.
I had this working globally:
{Windows Key} + {left mouse click} = Minimize application under mouse cursor
If you get use to it, it’s insanely useful and much easier than tracking down each app’s minimize button.
# # #
I thought I had originally set it up in the Trinity Control Center:
Trinity Control Center >> Regional & Accessibility >> Keyboard Shortcuts (Global Shortcuts >> Windows >> Minimize Window)
But I can’t get that to take a mouse click in the “Configure Shortcut” popup. {Windows Key} + {space} works.
AFAIK I didn’t install anything else to do this:
michael@local [~/.trinity/share]# which file xbindkeys xdotool xautomation easystroke xev
/usr/bin/file /usr/bin/xev
# # #
So a couple questions:
- Does the “Configure Shortcut” popup take mouse clicks for anyone else?
Would some kind person, see if their TCC Keyboard Shortcuts will accept mouse clicks as part of a shortcut?
- Can anyone point me in the right direction on what I need to dig back
into to restore/fix it’s config so mouse clicks can be use in keyboard shortcuts again?
After installing xbindkeys and futzing with xev and xbindkeys-config, xev is showing the mouse button clicks firing, but xbindkeys-config doesn’t seem to see the mouse clicks, or at least it’s not capturing them in its Get Key function. Anyone have a guess what might be blocking xbindkeys from seeing mouse events? Or diags to run to narrow it down?
Thanks, Michael
On Wed July 4 2018 16:54:20 Michael wrote:
Would some kind person, see if their TCC Keyboard Shortcuts will accept mouse clicks as part of a shortcut?
I don't know how to facilitate minimize window by that route.
Would it help to configure your desktop so that double clicking on a window title bar would minimize instead of shading?
--Mike
Am Donnerstag 05 Juli 2018 schrieb Mike Bird:
On Wed July 4 2018 16:54:20 Michael wrote:
Would some kind person, see if their TCC Keyboard Shortcuts will accept mouse clicks as part of a shortcut?
I don't know how to facilitate minimize window by that route.
Would it help to configure your desktop so that double clicking on a window title bar would minimize instead of shading?
Hello Mike,
in TCC -> Desktop -> Window Behavior -> Title Bar Actions / Window Actions
are a couple options to control window behavior with mouse clicks on the title bar and window area etc.
I have found no way to assign a mouse click to a specific shortcut for a program, though, at a glance.
HTH.
Regards, Stefan
On Thu July 5 2018 01:12:42 Stefan Krusche wrote:
Am Donnerstag 05 Juli 2018 schrieb Mike Bird:
I don't know how to facilitate minimize window by that route.
Would it help to configure your desktop so that double clicking on a window title bar would minimize instead of shading?
Hello Mike,
in TCC -> Desktop -> Window Behavior -> Title Bar Actions / Window Actions
are a couple options to control window behavior with mouse clicks on the title bar and window area etc.
Also right-click on any title bar and then Configure Window Behavior / Actions.
I have found no way to assign a mouse click to a specific shortcut for a program, though, at a glance.
xbindkeys can start commands using clicks and modifiers but I don't know how to "minimize window" as OP Michael desires using clicks and modifiers.
There are also mouse gestures and voice commands available in TCC / / Regional & Accessibility / Input Actions but I have not used them.
--Mike
Am Donnerstag 05 Juli 2018 schrieb Mike Bird:
Hello Mike,
in TCC -> Desktop -> Window Behavior -> Title Bar Actions / Window Actions
are a couple options to control window behavior with mouse clicks on the title bar and window area etc.
Also right-click on any title bar and then Configure Window Behavior / Actions.
I have found no way to assign a mouse click to a specific shortcut for a program, though, at a glance.
xbindkeys can start commands using clicks and modifiers but I don't know how to "minimize window" as OP Michael desires using clicks and modifiers.
It's possible, I just tried and succeeded.
TCC > Desktop > Window Behavior > Window Actions > Inner Window, Title Bar & Frame: for "Modifier Key + left button" choose from drop down menu on right side.
Somewhere you can configure which key is the "Modifier Key".
Kind Regards, Stefan
Am Donnerstag, 5. Juli 2018 schrieb Stefan Krusche:
Am Donnerstag 05 Juli 2018 schrieb Mike Bird:
Hello Mike,
in TCC -> Desktop -> Window Behavior -> Title Bar Actions / Window Actions
are a couple options to control window behavior with mouse clicks on the title bar and window area etc.
Also right-click on any title bar and then Configure Window Behavior / Actions.
I have found no way to assign a mouse click to a specific shortcut for a program, though, at a glance.
xbindkeys can start commands using clicks and modifiers but I don't know how to "minimize window" as OP Michael desires using clicks and modifiers.
It's possible, I just tried and succeeded.
TCC > Desktop > Window Behavior > Window Actions > Inner Window, Title Bar & Frame: for "Modifier Key + left button" choose from drop down menu on right side.
Somewhere you can configure which key is the "Modifier Key".
Now this is cute :-)
Maybe you could add it to the wiki page?
Nik
Am Donnerstag 05 Juli 2018 schrieb Dr. Nikolaus Klepp:
Am Donnerstag, 5. Juli 2018 schrieb Stefan Krusche:
Am Donnerstag 05 Juli 2018 schrieb Mike Bird:
Hello Mike,
in TCC -> Desktop -> Window Behavior -> Title Bar Actions / Window Actions
are a couple options to control window behavior with mouse clicks on the title bar and window area etc.
Also right-click on any title bar and then Configure Window Behavior / Actions.
I have found no way to assign a mouse click to a specific shortcut for a program, though, at a glance.
xbindkeys can start commands using clicks and modifiers but I don't know how to "minimize window" as OP Michael desires using clicks and modifiers.
It's possible, I just tried and succeeded.
TCC > Desktop > Window Behavior > Window Actions > Inner Window, Title Bar & Frame: for "Modifier Key + left button" choose from drop down menu on right side.
Somewhere you can configure which key is the "Modifier Key".
Now this is cute :-)
Maybe you could add it to the wiki page?
Could you please write a cute manual how to do that? ;-)
Stefan
On Thursday 05 July 2018 07:19:10 am Stefan Krusche wrote:
Am Donnerstag 05 Juli 2018 schrieb Dr. Nikolaus Klepp:
Am Donnerstag, 5. Juli 2018 schrieb Stefan Krusche:
Am Donnerstag 05 Juli 2018 schrieb Mike Bird:
Hello Mike,
in TCC -> Desktop -> Window Behavior -> Title Bar Actions / Window Actions
are a couple options to control window behavior with mouse clicks on the title bar and window area etc.
Also right-click on any title bar and then Configure Window Behavior / Actions.
I have found no way to assign a mouse click to a specific shortcut for a program, though, at a glance.
xbindkeys can start commands using clicks and modifiers but I don't know how to "minimize window" as OP Michael desires using clicks and modifiers.
It's possible, I just tried and succeeded.
TCC > Desktop > Window Behavior > Window Actions > Inner Window, Title Bar & Frame: for "Modifier Key + left button" choose from drop down menu on right side.
Somewhere you can configure which key is the "Modifier Key".
Now this is cute :-)
Maybe you could add it to the wiki page?
Could you please write a cute manual how to do that? ;-)
Thanks All!,
Definitely sparking my memory. And, alas, the stupid keystrokes are so embedded in my muscle memory I’m still doing it and wondering why it’s not triggering. I’m also wondering just how many years ago I set this up as the hazy memory I have is that the post I got it from wasn’t really talking about Keyboard shortcuts at all, but it had the clue on how to do step 2 below.
# Step 1
The Windows Behavior was definitely the first step, e.g. assigning the Modifier key + middle button to Minimize. I’ve been on a laptop for 20 years, so I never really had a mouse middle button, and I’ve never gotten use to doing the two button click to emulate it, which is why I picked it.
I also remember leaving the Modifier key set to Alt, as a) changing it would mess up normally used stuff, and b) I’m not sure I ever explored just what changing it to “Meta” would do. (“Meta” being my only other choice I have for Modifier key. FWIW, I am pretty sure somewhere in TCC I have seen a place to change the Modifier key.)
# Step 2
The second step was to get {Windows Key} + {mouse left button} to emulate, or trigger, the {ALT} + {mouse middle button}. Since no one else can get TCC to accept a mouse click, I’m pretty sure this had to be done completely outside of TCC, which excludes things like Input Actions linked to DCOP or the like. [1]
While I’d still like to figure out what I did originally (I’m still grepping the haystacks), I don’t have any issue going with xbindkeys and DCOP/D-Bus as I have the xbindkeys part down and just need the appropriate ‘command’ to tell the application under the mouse to minimize. I’ve used qdbusviewer very infrequently in the past (CentOS/KDE?), but I don’t seem to have it installed here. And, ‘eh, to be honest I don’t really know which TDE uses :(
$ qdbusviewer qdbusviewer: could not exec '/usr/lib/x86_64-linux-gnu/qt4/bin/qdbusviewer': No such file or directory
So . . . . Two things,
A) Would someone either show me what the command(s) would be to minimize whatever is the top most window under the current mouse position. Or point me at the right tool to be able to find it?
B) I’ll gladly write this up as a cute manual and (if I still have access) publish it on the wiki page. (It’s not like I’m not the wordy type...)
Best and Thanks, Michael
[1] Trying to recreate this I have found it {can be?} done with xbindkeys and DCOP.
https://blog.hanschen.org/2009/10/13/mouse-shortcuts-with-xbindkeys/
Adding this to $HOME/.xbindkeysrc allows {Windows Key} + {mouse left button} to launch notepad. I had to manually combine the raw codes, but couldn’t figure out what the ‘pretty name’ would be for left mouse button.
#Test001 "/usr/bin/notepad" m:0x40 + c:133 + b:1 # Mod4 + Super_L + ???
And this should also be possible with xbindkeys and xte, but I can’t seem to get that to work. I’ve tried multiple variations of Test002, which have all failed, but I think it’s a xte typo/misconfig on my part as Test003 does work.
#Test002 "xte 'keydown Alt_L' 'mouseclick 2' 'keyup Alt_L'" m:0x40 + c:133 + b:1
#Test003 "xte 'mousermove 100 100'" m:0x40 + c:133 + b:1
Note: You have to restart xbindkeys to apply changes. It’s buried in the blog post.
$ killall xbindkeys && xbindkeys
Hi!
Am Donnerstag, 5. Juli 2018 schrieb Michael:
[...]
A) Would someone either show me what the command(s) would be to minimize whatever is the top most window under the current mouse position. Or point me at the right tool to be able to find it? [...]
You could try "xdotool getactivewindow windowminimize".
nik
On Thursday 05 July 2018 02:42:51 pm Dr. Nikolaus Klepp wrote:
Am Donnerstag, 5. Juli 2018 schrieb Michael:
[...] A) Would someone either show me what the command(s) would be to minimize whatever is the top most window under the current mouse position. Or point me at the right tool to be able to find it? [...]
You could try "xdotool getactivewindow windowminimize".
Thanks Nik,
I so wanted this to work, but it doesn’t. It closes the active window not the window under the mouse. I wasn’t able to find any other workaround (xdotool seems to have a bug with non-active window usage).
Anyone know the ‘dcop’ or ‘kdesktop’ commands? Is there a GUI assist tool for either?
Best, Michael
#### The results of testing:
Further testing of xdotool shows that, while it does maintain consistent [window] variable values across instances, it doesn’t report the correct [window] or [window_id] for anything but the active window. Which kills about all of it’s ability to be scripted. And subsequently to do about anything with a random non-active window under the mouse.
The tell is that different [window] values ($WINDOW, $WINDOWFOCUS below) are returned for the same window.
When the mouse is over, and clicked in, the currently active window (Konsole shell) this:
#!/bin/bash eval $(xdotool getmouselocation --shell) echo "|$X,$Y|" echo S: "|$SCREEN|" echo W: "|$WINDOW|" echo A1 xdotool selectwindow echo A2 xdotool windowminimize --sync $WINDOW echo B1 xdotool getwindowname $WINDOW echo B2 xdotool getwindowname echo C # xdotool getwindowfocus echo D WINDOWFOCUS=`xdotool getwindowfocus -f` echo WF: $WINDOWFOCUS echo E xdotool getwindowname $WINDOWFOCUS echo F xdotool getactivewindow echo G #windowunmap [options] [window_id=%1] xdotool windowunmap window_id=$WINDOW echo H xdotool search --sync --onlyvisible --name ".*" echo I
Results in:
|1233,467| S: |0| W: |23068904| A1 23068904 A2 B1
B2 There are no windows in the stack Invalid window '%1' Usage: getwindowname [window=%1] If no window is given, %1 is used. See WINDOW STACK in xdotool(1) C D WF: 44040202 E Shell - Konsole F 44040202 G X Error of failed request: BadWindow (invalid Window parameter) Major opcode of failed request: 10 (X_UnmapWindow) Resource id in failed request: 0x0 Serial number of failed request: 17 Current serial number in output stream: 19 H 926 23069862 23068879 23198258 {snip ~780 entires} I
Ref: http://manpages.ubuntu.com/manpages/trusty/man1/xdotool.1.html
####
I also tried these variations in the .xbindkeysrc file:
## Works, minimizes wrong window #"xdotool getactivewindow windowminimize" #"xdotool key super+space"
## Does nothing #"xdotool keydown alt click 2 keyup alt" #"xdotool getmouselocation windowminimize" #"xdotool getmouselocation windowactivate windowminimize" #"xdotool selectwindow windowactivate windowminimize" #"xdotool selectwindow windowminimize" #"xdotool click 1"
Oddly both 23068904 and 44040202 are contained in the ‘xdotool search’ output, so my best guess is it’s a deeper bug within xdotool, especially since the ‘selectwindow’ attempts didn’t even set the focus on, or activate, the window under the mouse.
Hi!
Am Freitag, 6. Juli 2018 schrieb Michael:
On Thursday 05 July 2018 02:42:51 pm Dr. Nikolaus Klepp wrote:
Am Donnerstag, 5. Juli 2018 schrieb Michael:
[...] A) Would someone either show me what the command(s) would be to minimize whatever is the top most window under the current mouse position. Or point me at the right tool to be able to find it? [...]
You could try "xdotool getactivewindow windowminimize".
Thanks Nik,
I so wanted this to work, but it doesn’t. It closes the active window not the window under the mouse. I wasn’t able to find any other workaround (xdotool seems to have a bug with non-active window usage).
Oh, I always use "focus + raise window under mouse", so I didn't notice :-) Have you tried to send a mousebuttondown-event before minimizing, e.g.:
xdotool click 1 xdotool getactivewindow windowminimize
This will bring the window under the mouse to the to of the stack and then minize it.
Nik
Anyone know the ‘dcop’ or ‘kdesktop’ commands? Is there a GUI assist tool for either?
Best, Michael
#### The results of testing:
Further testing of xdotool shows that, while it does maintain consistent [window] variable values across instances, it doesn’t report the correct [window] or [window_id] for anything but the active window. Which kills about all of it’s ability to be scripted. And subsequently to do about anything with a random non-active window under the mouse.
The tell is that different [window] values ($WINDOW, $WINDOWFOCUS below) are returned for the same window.
When the mouse is over, and clicked in, the currently active window (Konsole shell) this:
#!/bin/bash eval $(xdotool getmouselocation --shell) echo "|$X,$Y|" echo S: "|$SCREEN|" echo W: "|$WINDOW|" echo A1 xdotool selectwindow echo A2 xdotool windowminimize --sync $WINDOW echo B1 xdotool getwindowname $WINDOW echo B2 xdotool getwindowname echo C # xdotool getwindowfocus echo D WINDOWFOCUS=`xdotool getwindowfocus -f` echo WF: $WINDOWFOCUS echo E xdotool getwindowname $WINDOWFOCUS echo F xdotool getactivewindow echo G #windowunmap [options] [window_id=%1] xdotool windowunmap window_id=$WINDOW echo H xdotool search --sync --onlyvisible --name ".*" echo I
Results in:
|1233,467| S: |0| W: |23068904| A1 23068904 A2 B1
B2 There are no windows in the stack Invalid window '%1' Usage: getwindowname [window=%1] If no window is given, %1 is used. See WINDOW STACK in xdotool(1) C D WF: 44040202 E Shell - Konsole F 44040202 G X Error of failed request: BadWindow (invalid Window parameter) Major opcode of failed request: 10 (X_UnmapWindow) Resource id in failed request: 0x0 Serial number of failed request: 17 Current serial number in output stream: 19 H 926 23069862 23068879 23198258 {snip ~780 entires} I
Ref: http://manpages.ubuntu.com/manpages/trusty/man1/xdotool.1.html
####
I also tried these variations in the .xbindkeysrc file:
## Works, minimizes wrong window #"xdotool getactivewindow windowminimize" #"xdotool key super+space"
## Does nothing #"xdotool keydown alt click 2 keyup alt" #"xdotool getmouselocation windowminimize" #"xdotool getmouselocation windowactivate windowminimize" #"xdotool selectwindow windowactivate windowminimize" #"xdotool selectwindow windowminimize" #"xdotool click 1"
Oddly both 23068904 and 44040202 are contained in the ‘xdotool search’ output, so my best guess is it’s a deeper bug within xdotool, especially since the ‘selectwindow’ attempts didn’t even set the focus on, or activate, the window under the mouse.
To unsubscribe, e-mail: trinity-users-unsubscribe@lists.pearsoncomputing.net For additional commands, e-mail: trinity-users-help@lists.pearsoncomputing.net Read list messages on the web archive: http://trinity-users.pearsoncomputing.net/ Please remember not to top-post: http://trinity.pearsoncomputing.net/mailing_lists/#top-posting
On Friday 06 July 2018 02:11:20 pm Dr. Nikolaus Klepp wrote:
Am Freitag, 6. Juli 2018 schrieb Michael:
On Thursday 05 July 2018 02:42:51 pm Dr. Nikolaus Klepp wrote:
Am Donnerstag, 5. Juli 2018 schrieb Michael:
[...] A) Would someone either show me what the command(s) would be to minimize whatever is the top most window under the current mouse position. Or point me at the right tool to be able to find it? [...]
You could try "xdotool getactivewindow windowminimize".
Thanks Nik,
I so wanted this to work, but it doesn’t. It closes the active window not the window under the mouse. I wasn’t able to find any other workaround (xdotool seems to have a bug with non-active window usage).
Oh, I always use "focus + raise window under mouse", so I didn't notice :-) Have you tried to send a mousebuttondown-event before minimizing, e.g.:
xdotool click 1 xdotool getactivewindow windowminimize
Hi Nik,
Ah, you’re running commands in the ‘behave’ space, which acts a bit different from the other commands, as it already knows in which window the event it’s listening for occurs.
But based upon all your help, I did patch together a pretty ugly kludge that works.
#MinimizeWindowUnderMouse "xdotool click --clearmodifiers 1 key super+space" m:0x40 + c:133 + b:1 + release
Definitely not as elegant as the original solution, as neither xbindkeys or xdotool was needed and the original solution minimized the background window without having to make it active first.
I tried several variations of getactivewindow and windowminimize for ‘key super+space’ that failed in one way or another. The ‘prettiest’ would cascade minimize every open app on the desktop.
I’ll polish up a wiki entry, do you have any particular place in the wiki you want it?
Here’s a summary for the interim.
#### Summary
A):
Trinity Control Center >> Regional & Accessibility >> Keyboard Shortcuts Shortcuts Schemes >> Global Shortcuts >> Windows
- Set "Minimize Window" to “Win+Space”
B):
- Issue command(s) as root
$ apt-get install xbindkeys $ apt-get install xdotool $ apt-get install xbindkeys-config # << optional
C):
- Edit $HOME/.xbindkeysrc - Add:
#MinimizeWindowUnderMouse "xdotool click --clearmodifiers 1 key super+space" m:0x40 + c:133 + b:1 + release
Note: xbindkeys does not like superfluous comments within it’s definitions. Leaving prior entries commented out within a config caused odd, and inconsistent, results. ymmv.
D):
- Issue command(s) as yourself
$ killall xbindkeys && xbindkeys
E):
To minimize any window, combine Window key and the left mouse click.
To be added:
- How to find any key’s identifier for use with xbindkeys.