Skip to content

Commit

Permalink
docs(readme): add section on using ahk
Browse files Browse the repository at this point in the history
  • Loading branch information
LGUG2Z committed Apr 30, 2023
1 parent e4a9719 commit 9431bac
Show file tree
Hide file tree
Showing 4 changed files with 55 additions and 15 deletions.
28 changes: 25 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,27 @@ You can watch a walkthrough video of this quickstart below on YouTube.

[![Watch the quickstart walkthrough video](https://img.youtube.com/vi/cBnLIwMtv8g/hqdefault.jpg)](https://www.youtube.com/watch?v=cBnLIwMtv8g)

#### Using Autohotkey

If you would like to use Autohotkey, please make sure you have AutoHotKey v2 installed.

Generally, users who opt for AHK will have specific needs that can only be addressed by the advanced functionality of AHK,
and so they are assumed to be able to craft their own configuration files.

If you would like to try out AHK, a simple sample configuration powered by `komorebic.lib.ahk` is provided as a starting
point.

```powershell
# save the latest generated komorebic library to ~/komorebic.lib.ahk
iwr https://raw.githubusercontent.com/LGUG2Z/komorebi/master/komorebic.lib.ahk -OutFile $Env:USERPROFILE\komorebic.lib.ahk
# save the latest generated app-specific config tweaks and fixes to ~/komorebi.generated.ahk
iwr https://raw.githubusercontent.com/LGUG2Z/komorebi/master/komorebi.generated.ahk -OutFile $Env:USERPROFILE\komorebi.generated.ahk
# save the sample komorebi configuration file to ~/komorebi.ahk
iwr https://raw.githubusercontent.com/LGUG2Z/komorebi/master/komorebi.sample.ahk -OutFile $Env:USERPROFILE\komorebi.ahk
```

### GitHub Releases

Prebuilt binaries are available on the [releases page](https://github.com/LGUG2Z/komorebi/releases) in a `zip` archive.
Expand Down Expand Up @@ -259,20 +280,21 @@ key combinations in the `whkdrc` file.
Additionally, you may run `komorebic.exe ahk-library` to generate a helper library for AutoHotKey which wraps
every `komorebic` command in a native AHK function.

The output of this command is in AHKv1 syntax. It must be manually converted to AHKv2 syntax
using [this tool](https://github.com/mmikeww/AHK-v2-script-converter) or something similar.

If you include the generated library at the top of your `~/komorebi.ahk` configuration file, you will be able to call
any of the functions that it contains.

#### Using Different AHK Executables

❗️**NOTE**: This section is only relevant for people who wish to use AutoHotKey instead of [`whkd`](https://github.com/LGUG2Z/whkd).

The generated helper library for AutoHotKey currently only supports AutoHotKey v1.1.

The preferred way to install AutoHotKey for use with `komorebi` is to install it via `scoop`:

```powershell
scoop bucket add versions
scoop install autohotkey1.1
scoop install autohotkey
```

If you install AutoHotKey using a different method, the name of the executable file may differ from the name given by
Expand Down
19 changes: 15 additions & 4 deletions komorebi.generated.ahk
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
; Generated by komorebic.exe
; To use this file, add the line below to the top of your komorebi.ahk configuration file
; #Include %A_ScriptDir%\komorebi.generated.ahk

; 1Password
RunWait('komorebic.exe float-rule exe "1Password.exe"', , "Hide")
Expand Down Expand Up @@ -135,8 +133,7 @@ RunWait('komorebic.exe identify-object-name-change-application exe "GodotManager
RunWait('komorebic.exe identify-tray-application exe "chrome.exe"', , "Hide")

; Google Drive
; If you have disabled minimize/close to tray for this application, you can delete/comment out the next line
RunWait('komorebic.exe identify-tray-application exe "GoogleDriveFS.exe"', , "Hide")
RunWait('komorebic.exe float-rule exe "GoogleDriveFS.exe"', , "Hide")

; Houdoku
RunWait('komorebic.exe identify-border-overflow-application exe "Houdoku.exe"', , "Hide")
Expand Down Expand Up @@ -240,6 +237,10 @@ RunWait('komorebic.exe float-rule class "MozillaTaskbarPreviewClass"', , "Hide")
; NVIDIA GeForce Experience
RunWait('komorebic.exe identify-border-overflow-application exe "NVIDIA GeForce Experience.exe"', , "Hide")

; NZXT CAM
; If you have disabled minimize/close to tray for this application, you can delete/comment out the next line
RunWait('komorebic.exe identify-tray-application exe "NZXT CAM.exe"', , "Hide")

; NiceHash Miner
RunWait('komorebic.exe identify-border-overflow-application exe "nhm_app.exe"', , "Hide")
RunWait('komorebic.exe manage-rule exe "nhm_app.exe"', , "Hide")
Expand Down Expand Up @@ -373,6 +374,11 @@ RunWait('komorebic.exe identify-tray-application exe "Spotify.exe"', , "Hide")
; Steam
RunWait('komorebic.exe identify-border-overflow-application class "vguiPopupWindow"', , "Hide")

; Steam Beta
RunWait('komorebic.exe identify-border-overflow-application class "SDL_app"', , "Hide")
; If you have disabled minimize/close to tray for this application, you can delete/comment out the next line
RunWait('komorebic.exe identify-tray-application class "SDL_app"', , "Hide")

; Stremio
; If you have disabled minimize/close to tray for this application, you can delete/comment out the next line
RunWait('komorebic.exe identify-tray-application exe "stremio.exe"', , "Hide")
Expand All @@ -393,6 +399,11 @@ RunWait('komorebic.exe identify-border-overflow-application exe "Telegram.exe"',
; If you have disabled minimize/close to tray for this application, you can delete/comment out the next line
RunWait('komorebic.exe identify-tray-application exe "Telegram.exe"', , "Hide")

; TickTick
RunWait('komorebic.exe identify-border-overflow-application exe "TickTick.exe"', , "Hide")
; If you have disabled minimize/close to tray for this application, you can delete/comment out the next line
RunWait('komorebic.exe identify-tray-application exe "TickTick.exe"', , "Hide")

; TouchCursor
; If you have disabled minimize/close to tray for this application, you can delete/comment out the next line
RunWait('komorebic.exe identify-tray-application exe "tcconfig.exe"', , "Hide")
Expand Down
17 changes: 15 additions & 2 deletions komorebi.generated.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -133,8 +133,7 @@ komorebic.exe identify-object-name-change-application exe "GodotManager.exe"
komorebic.exe identify-tray-application exe "chrome.exe"

# Google Drive
# If you have disabled minimize/close to tray for this application, you can delete/comment out the next line
komorebic.exe identify-tray-application exe "GoogleDriveFS.exe"
komorebic.exe float-rule exe "GoogleDriveFS.exe"

# Houdoku
komorebic.exe identify-border-overflow-application exe "Houdoku.exe"
Expand Down Expand Up @@ -238,6 +237,10 @@ komorebic.exe float-rule class "MozillaTaskbarPreviewClass"
# NVIDIA GeForce Experience
komorebic.exe identify-border-overflow-application exe "NVIDIA GeForce Experience.exe"

# NZXT CAM
# If you have disabled minimize/close to tray for this application, you can delete/comment out the next line
komorebic.exe identify-tray-application exe "NZXT CAM.exe"

# NiceHash Miner
komorebic.exe identify-border-overflow-application exe "nhm_app.exe"
komorebic.exe manage-rule exe "nhm_app.exe"
Expand Down Expand Up @@ -371,6 +374,11 @@ komorebic.exe identify-tray-application exe "Spotify.exe"
# Steam
komorebic.exe identify-border-overflow-application class "vguiPopupWindow"

# Steam Beta
komorebic.exe identify-border-overflow-application class "SDL_app"
# If you have disabled minimize/close to tray for this application, you can delete/comment out the next line
komorebic.exe identify-tray-application class "SDL_app"

# Stremio
# If you have disabled minimize/close to tray for this application, you can delete/comment out the next line
komorebic.exe identify-tray-application exe "stremio.exe"
Expand All @@ -391,6 +399,11 @@ komorebic.exe identify-border-overflow-application exe "Telegram.exe"
# If you have disabled minimize/close to tray for this application, you can delete/comment out the next line
komorebic.exe identify-tray-application exe "Telegram.exe"

# TickTick
komorebic.exe identify-border-overflow-application exe "TickTick.exe"
# If you have disabled minimize/close to tray for this application, you can delete/comment out the next line
komorebic.exe identify-tray-application exe "TickTick.exe"

# TouchCursor
# If you have disabled minimize/close to tray for this application, you can delete/comment out the next line
komorebic.exe identify-tray-application exe "tcconfig.exe"
Expand Down
6 changes: 0 additions & 6 deletions komorebic/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1808,12 +1808,6 @@ fn main() -> Result<()> {
"could not find the path to the generated configuration file"
))?
);

println!(
"\nYou can include the generated configuration at the top of your komorebi.ahk config with this line:"
);

println!("\n#Include %A_ScriptDir%\\komorebi.generated.ahk");
}
SubCommand::PwshAppSpecificConfiguration(arg) => {
let content = std::fs::read_to_string(resolve_windows_path(&arg.path)?)?;
Expand Down

0 comments on commit 9431bac

Please sign in to comment.