Re: How to use mouse click as part of a keyboard shortcut? (Solved, kludge A)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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.

---------------------------------------------------------------------
To unsubscribe, e-mail: trinity-users-unsubscribe@xxxxxxxxxxxxxxxxxxxxxxxxxx
For additional commands, e-mail: trinity-users-help@xxxxxxxxxxxxxxxxxxxxxxxxxx
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





[Index of Archives]     [Trinity Devel]     [KDE]     [Linux Sound]     [ALSA Users]     [ALSA Devel]     [Linux Audio Users]     [Linux Media]     [Kernel]     [Gimp]     [Yosemite News]     [Linux Media]     [Trinity Desktop Environment]

  Powered by Linux