Skip to content

Commit

Permalink
Update Readme
Browse files Browse the repository at this point in the history
  • Loading branch information
lhaeger committed Mar 13, 2021
1 parent c73fd6f commit 20ed46f
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 50 deletions.
4 changes: 4 additions & 0 deletions AutoRaise-Bridging-Header.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
//
// Use this file to import your target's public headers that you would like to expose to Swift.
//

4 changes: 4 additions & 0 deletions AutoRaise.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
C557DD451B988ED300E59BC9 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = C557DD441B988ED300E59BC9 /* Images.xcassets */; };
C557DD481B988ED300E59BC9 /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = C557DD461B988ED300E59BC9 /* MainMenu.xib */; };
C58DC14525FCEBBB00084C22 /* AutoRaise in Resources */ = {isa = PBXBuildFile; fileRef = C58DC14425FCEBBB00084C22 /* AutoRaise */; };
C58DC14D25FCF1C100084C22 /* README.md in Resources */ = {isa = PBXBuildFile; fileRef = C58DC14C25FCF1C100084C22 /* README.md */; };
/* End PBXBuildFile section */

/* Begin PBXFileReference section */
Expand All @@ -22,6 +23,7 @@
C557DD471B988ED300E59BC9 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/MainMenu.xib; sourceTree = "<group>"; };
C570C3762586877A00CC080F /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
C58DC14425FCEBBB00084C22 /* AutoRaise */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.executable"; path = AutoRaise; sourceTree = "<group>"; };
C58DC14C25FCF1C100084C22 /* README.md */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = net.daringfireball.markdown; path = README.md; sourceTree = "<group>"; };
/* End PBXFileReference section */

/* Begin PBXFrameworksBuildPhase section */
Expand All @@ -38,6 +40,7 @@
C557DD341B988ED300E59BC9 = {
isa = PBXGroup;
children = (
C58DC14C25FCF1C100084C22 /* README.md */,
C58DC14425FCEBBB00084C22 /* AutoRaise */,
C501B69425875F32005B3964 /* LICENSE.md */,
C557DD3F1B988ED300E59BC9 /* Launcher */,
Expand Down Expand Up @@ -136,6 +139,7 @@
files = (
C501B69525875F32005B3964 /* LICENSE.md in Resources */,
C557DD451B988ED300E59BC9 /* Images.xcassets in Resources */,
C58DC14D25FCF1C100084C22 /* README.md in Resources */,
C58DC14525FCEBBB00084C22 /* AutoRaise in Resources */,
C557DD481B988ED300E59BC9 /* MainMenu.xib in Resources */,
);
Expand Down
6 changes: 3 additions & 3 deletions Launcher/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
*
* AutoRaise Launcher
*
* Copyright (c) 2020 Stefan Post, Lothar Haeger
* Copyright (c) 2021 Lothar Haeger
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
Expand Down Expand Up @@ -49,11 +49,11 @@ class AppDelegate: NSObject, NSApplicationDelegate {
let buildNumber: String = Bundle.main.object(forInfoDictionaryKey: "CFBundleVersion") as! String

let appAbout = "AutoRaise & Launcher\n" +
"Version 1.5.0, 2021-03-13\n\n" +
"Version 1.5.1, 2021-03-13\n\n" +
"©2021 Stefan Post, Lothar Haeger\n" +
"Icons made by https://www.flaticon.com/authors/fr"

let homePageUrl = "https://github.com/lhaeger/AutoRaise/tree/Launcher"
let homePageUrl = "https://github.com/lhaeger/AutoRaise"

let prefs = UserDefaults.standard

Expand Down
Binary file added Launcher/Prefs.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
55 changes: 8 additions & 47 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,54 +1,15 @@
When you hover a window it will be raised to the front (with a delay of your choosing) and gets the focus. There is
also an option to warp the mouse to the center of the activated window, using the cmd-tab key combination for example.
To use this tool, copy the AutoRaise binary to your /Applications/ folder making sure it is executable (chmod 700
AutoRaise). Then double click it from within Finder. To quickly toggle it on/off you can use the applescript below
and paste it into an automator service workflow. Then bind the created service to a keyboard shortcut via System
Preferences|Keyboard|Shortcuts.
AutoRaise & Launcher

**Update**: It is now also possible to create an app bundle (for further instructions see at the bottom of this page).
If you prefer to use the app bundle version, replace "/Applications/AutoRaise" with "/Applications/AutoRaise.app"
and update the applescript accordingly.
This project consists of two components: AutoRaise and Launcher.

Applescript usage:
AutoRaise is written and maintained by Stefan Post at https://github.com/sbmpost/AutoRaise. From the readme:

on run {input, parameters}
tell application "Finder"
if exists of application process "AutoRaise" then
quit application "/Applications/AutoRaise"
display notification "AutoRaise Stopped"
else
launch application "/Applications/AutoRaise"
display notification "AutoRaise Started"
end if
end tell
return input
end run
"When AutoRaise is running and you hover the mouse cursor over a window it will be raised to the front (with a delay of your choosing) and gets the focus. There is also an option to warp the mouse to the center of the activated window, using the cmd-tab key combination for example."

Command line usage:
See also: https://stackoverflow.com/questions/98310/focus-follows-mouse-plus-auto-raise-on-mac-os-x

./AutoRaise -delay 2 -warpX 0.5 -warpY 0.5
While AutoRaise is concerned with GUI window and mouse behaviour, as a command line application it lacks a GUI itself.

*Note1*: If no delay has been specified on the command line, AutoRaise will look for an AutoRaise.delay file in the
**home** folder. It will also check for the existence of an AutoRaise.warp file. This is particularly useful for the
applescript usage as described above because 'launch application' does not support command line arguments. The delay
should be specified in units of 20ms. For example to specify a delay of 20ms run this command once in a terminal:
Here is where Launcher into play: it's a menubar application that allows to conveniently control and configure AutoRaise. A mouse click on it's menubar icon will start/stop AutoRaise, preferences can be configured from it's context menu and will be saved between sessions.

echo 1 > ~/AutoRaise.delay

To enable warp, run this command:

echo "0.5 0.5" > ~/AutoRaise.warp

*Note2*: If you are not comfortable running the provided binary, then you can compile it yourself using this command:

g++ -O2 -Wall -fobjc-arc -o AutoRaise AutoRaise.mm -framework AppKit

*Note3*: To create the AutoRaise.app bundle, in a bash terminal type:

./create-app-bundle.sh

Beware that AutoRaise.app runs on the background and can only be stopped again via "Activity Monitor" (or the applescript
above). Also command line arguments are ignored which means the app bundle version relies totally on the AutoRaise.delay
and AutoRaise.warp files in your home folder.

See also https://stackoverflow.com/questions/98310/focus-follows-mouse-plus-auto-raise-on-mac-os-x
![AutoRaise Preferences](/Launcher/Prefs.png?raw=true)

0 comments on commit 20ed46f

Please sign in to comment.