refactor(komorebic): update clap, add cli docs

The latest clap beta introduced a lot of breaking changes for komorebic,
so I decided it was a good time to refactor a little and add
documentation to all of the cli commands.

The primary change for komorebic is that subcommands now only take
structs as arguments, so every enum must be wrapped in a struct. Some
macros have been introduced to ease this.

Using on|off alongside enable|disable for BooleanState arguments has
been deprecated, going forward only enable|disable will be supported.

The commands to introduce float rules have been refactored to make use
of ApplicationTarget, and a single command 'float-rule' has been
introduced in the cli.

Finally I took some time to standardise the sample AHK config a little,
primarily making sure that command prompt windows are never shown for
any of the configuration commands.

BREAKING CHANGE: float-exe, float-class, and float-title have been
deprecated in favour of float-rule in komorebic. workspace-tiling now
only accepts enable|disable as valid inputs to the final arg,
deprecating the previously also valid on|off.

re #8
This commit is contained in:
LGUG2Z
2021-08-16 10:25:01 -07:00
parent 7ede5a2dbc
commit 9c55545600
12 changed files with 342 additions and 254 deletions
+51 -52
View File
@@ -1,50 +1,49 @@
#SingleInstance Force
; Enable hot reloading of changes to this file
Run, komorebic.exe watch-configuration enable
Run, komorebic.exe watch-configuration enable, , Hide
; Enable focus follows mouse
Run, komorebic.exe focus-follows-mouse enable
Run, komorebic.exe focus-follows-mouse enable, , Hide
; Ensure there are 3 workspaces created on monitor 0
Run, komorebic.exe ensure-workspaces 0 5
Run, komorebic.exe ensure-workspaces 0 5, , Hide
; Give the workspaces some optional names
Run, komorebic.exe workspace-name 0 0 bsp
Run, komorebic.exe workspace-name 0 1 columns
Run, komorebic.exe workspace-name 0 2 thicc
Run, komorebic.exe workspace-name 0 3 matrix
Run, komorebic.exe workspace-name 0 4 floaty
Run, komorebic.exe workspace-name 0 0 bsp, , Hide
Run, komorebic.exe workspace-name 0 1 columns, , Hide
Run, komorebic.exe workspace-name 0 2 thicc, , Hide
Run, komorebic.exe workspace-name 0 3 matrix, , Hide
Run, komorebic.exe workspace-name 0 4 floaty, , Hide
; Set the padding of the different workspaces
Run, komorebic.exe workspace-padding 0 1 30
Run, komorebic.exe container-padding 0 1 30
Run, komorebic.exe workspace-padding 0 2 200
Run, komorebic.exe workspace-padding 0 3 0
Run, komorebic.exe container-padding 0 3 0
Run, komorebic.exe workspace-padding 0 1 30, , Hide
Run, komorebic.exe container-padding 0 1 30, , Hide
Run, komorebic.exe workspace-padding 0 2 200, , Hide
Run, komorebic.exe workspace-padding 0 3 0, , Hide
Run, komorebic.exe container-padding 0 3 0, , Hide
; Set the layouts of different workspaces
Run, komorebic.exe workspace-layout 0 1 columns
Run, komorebic.exe workspace-layout 0 1 columns, , Hide
; Set the floaty layout to not tile any windows
Run, komorebic.exe workspace-tiling 0 4 off
Run, komorebic.exe workspace-tiling 0 4 disable, , Hide
; Always float IntelliJ popups, matching on class
Run, komorebic.exe float-class SunAwtDialog, , Hide
Run, komorebic.exe float-rule class SunAwtDialog, , Hide
; Always float Control Panel, matching on title
Run, komorebic.exe float-title "Control Panel", , Hide
Run, komorebic.exe float-rule title "Control Panel", , Hide
; Always float Task Manager, matching on class
Run, komorebic.exe float-class TaskManagerWindow, , Hide
Run, komorebic.exe float-rule class TaskManagerWindow, , Hide
; Always float Wally, matching on executable name
Run, komorebic.exe float-exe Wally.exe, , Hide
Run, komorebic.exe float-exe wincompose.exe, , Hide
Run, komorebic.exe float-rule exe Wally.exe, , Hide
Run, komorebic.exe float-rule exe wincompose.exe, , Hide
; Always float Calculator app, matching on window title
Run, komorebic.exe float-title Calculator, , Hide
Run, komorebic.exe float-exe 1Password.exe, , Hide
Run, komorebic.exe float-rule title Calculator, , Hide
Run, komorebic.exe float-rule exe 1Password.exe, , Hide
; Identify applications that close to the tray
Run, komorebic.exe identify-tray-application exe Discord.exe, , Hide
Run, komorebic.exe identify-tray-application exe Telegram.exe, , Hide
; Change the focused window, Alt + Vim direction keys
!h::
@@ -65,36 +64,36 @@ return
; Move the focused window in a given direction, Alt + Shift + Vim direction keys
!+h::
Run, komorebic.exe move left, Hide
Run, komorebic.exe move left, , Hide
return
!+j::
Run, komorebic.exe move down, Hide
Run, komorebic.exe move down, , Hide
return
!+k::
Run, komorebic.exe move up, Hide
Run, komorebic.exe move up, , Hide
return
!+l::
Run, komorebic.exe move right, Hide
Run, komorebic.exe move right, , Hide
return
; Stack the focused window in a given direction, Alt + Shift + direction keys
!+Left::
Run, komorebic.exe stack left, Hide
Run, komorebic.exe stack left, , Hide
return
!+Down::
Run, komorebic.exe stack down, Hide
Run, komorebic.exe stack down, , Hide
return
!+Up::
Run, komorebic.exe stack up, Hide
Run, komorebic.exe stack up, , Hide
return
!+Right::
Run, komorebic.exe stack right, Hide
Run, komorebic.exe stack right, , Hide
return
!]::
@@ -107,102 +106,102 @@ return
; Unstack the focused window, Alt + Shift + D
!+d::
Run, komorebic.exe unstack, Hide
Run, komorebic.exe unstack, , Hide
return
; Promote the focused window to the top of the tree, Alt + Shift + Enter
!+Enter::
Run, komorebic.exe promote, Hide
Run, komorebic.exe promote, , Hide
return
; Switch to an equal-width, max-height column layout on the main workspace, Alt + Shift + C
!+c::
Run, komorebic.exe workspace-layout 0 0 columns, Hide
Run, komorebic.exe workspace-layout 0 0 columns, , Hide
return
; Switch to the default bsp tiling layout on the main workspace, Alt + Shift + T
!+t::
Run, komorebic.exe workspace-layout 0 0 bsp, Hide
Run, komorebic.exe workspace-layout 0 0 bsp, , Hide
return
; Toggle the Monocle layout for the focused window, Alt + Shift + F
!+f::
Run, komorebic.exe toggle-monocle, Hide
Run, komorebic.exe toggle-monocle, , Hide
return
; Flip horizontally, Alt + X
!x::
Run, komorebic.exe flip-layout horizontal, Hide
Run, komorebic.exe flip-layout horizontal, , Hide
return
; Flip vertically, Alt + Y
!y::
Run, komorebic.exe flip-layout vertical, Hide
Run, komorebic.exe flip-layout vertical, , Hide
return
; Force a retile if things get janky, Alt + Shift + R
!+r::
Run, komorebic.exe retile, Hide
Run, komorebic.exe retile, , Hide
return
; Float the focused window, Alt + T
!t::
Run, komorebic.exe toggle-float, Hide
Run, komorebic.exe toggle-float, , Hide
return
; Reload ~/komorebi.ahk, Alt + O
!o::
Run, komorebic.exe reload-configuration, Hide
Run, komorebic.exe reload-configuration, , Hide
return
; Pause responding to any window events or komorebic commands, Alt + P
!p::
Run, komorebic.exe toggle-pause, Hide
Run, komorebic.exe toggle-pause, , Hide
return
; Switch to workspace
!1::
Send !
Run, komorebic.exe focus-workspace 0, Hide
Run, komorebic.exe focus-workspace 0, , Hide
return
!2::
Send !
Run, komorebic.exe focus-workspace 1, Hide
Run, komorebic.exe focus-workspace 1, , Hide
return
!3::
Send !
Run, komorebic.exe focus-workspace 2, Hide
Run, komorebic.exe focus-workspace 2, , Hide
return
!4::
Send !
Run, komorebic.exe focus-workspace 3, Hide
Run, komorebic.exe focus-workspace 3, , Hide
return
!5::
Send !
Run, komorebic.exe focus-workspace 4, Hide
Run, komorebic.exe focus-workspace 4, , Hide
return
; Move window to workspace
!+1::
Run, komorebic.exe move-to-workspace 0, Hide
Run, komorebic.exe move-to-workspace 0, , Hide
return
!+2::
Run, komorebic.exe move-to-workspace 1, Hide
Run, komorebic.exe move-to-workspace 1, , Hide
return
!+3::
Run, komorebic.exe move-to-workspace 2, Hide
Run, komorebic.exe move-to-workspace 2, , Hide
return
!+4::
Run, komorebic.exe move-to-workspace 3, Hide
Run, komorebic.exe move-to-workspace 3, , Hide
return
!+5::
Run, komorebic.exe move-to-workspace 4, Hide
Run, komorebic.exe move-to-workspace 4, , Hide
return