DEV Community

Brisbane Web Developer
Brisbane Web Developer

Posted on • Updated on

Avoid AutoRaise to activate the window while pressing down the Command Key

UPDATE: The author of AutoRaise spent time to take care of the issue I encountered initially. And therefore, what I initially tried to avoid is no longer an issue. However, I got another situation so that I am still applying this hack to my laptop.

UPDATE: After I sent the Pull Request with this amendment, I was told to try mouseStop=true, and that kind of works, but it's not perfect so that I am using both the feature and my amendment at the moment.

Summary

  • I use Bartender and AutoRaise (installed via Homebrew), and the window usually gets activated by AutoRaise when I want to select the icon in Bartender's hidden menu bar.

  • I decided to avoid AutoRaise to activate the window while I am pressing the command key.

With above amendment, I can select the icon in Bartender's hidden menu bar as follows:

  • Move the mouse to the menu bar.
  • Show Bartender's hidden menu bar and then press the command key.
  • Keep pressing down the command key until the mouse cursor reaches to the icon.
  • Release the command key.
  • Click the icon (The icon doesn't move to the menu bar and shows the sub menus if you kept pressing down the command key).

This hack avoids AutoRaise to get activated while pressing the command key so that it gets easier to reach to the window when there is another window on the path in some cases (You may not need this hack if the distance between the windows is close enough with the parameter mouseStop).

Another Issue

How To Install via Install Script

  • This command downloads the install script and then executes it :

  • Remove AutoRaise from System Preference > Security & Privacy > Accessibility > Privacy at first.




How To Install Manually

  • This is what above install script does in case you prefer installing manually.

  • Remove AutoRaise from System Preference > Security & Privacy > Accessibility > Privacy at first.


Create the source directory

("myUser" is to be your own username)

mkdir -p /Users/myUser/src/brisbanewebdeveloper/AutoRaise
cd /Users/myUser/src/brisbanewebdeveloper/AutoRaise

Download the custom version

git clone git@github.com:brisbanewebdeveloper/AutoRaise.git .
git checkout 77-make-it-work-with-bartender-custom

OR

git checkout latest

Build the customised program

make clean && make CXXFLAGS=-DALTERNATIVE_TASK_SWITCHER

Overwrite the one installed via Homebrew

(Using "ditto" because "cp" command can get error)

chmod 555 AutoRaise
sudo ditto AutoRaise /opt/homebrew/opt/autoraise/bin/

Remove the files downloaded

rm -fr /Users/myUser/src/brisbanewebdeveloper

Restart with the custom program

brew services restart autoraise

Enter fullscreen mode Exit fullscreen mode




How To Uninstall

Just reinstall the program:



brew reinstall autoraise

Enter fullscreen mode Exit fullscreen mode




Reference

Top comments (2)

Collapse
 
sbmpost profile image
Stefan Post

After I sent the Pull Request with this amendment, I was told to try mouseStop=true, and that kind of works, but its not perfect so that I am using both the feature and my amendment at the moment.

I figured this might help:
github.com/sbmpost/AutoRaise/tree/...

Collapse
 
brisbanewebdeveloper profile image
Brisbane Web Developer

Thank you for your time again!

I have left my feedback at GitHub.