feat(config): add pwsh cfgen + ps1 file watcher

This commit adds a command to generate application-specific
configuration in the format of a PowerShell ps1 file, as well as the
ability to automatically launch a komorebi.ps1 configuration file on
startup.

If a komorebi.ps1 file is found and launched at startup, the
watch-configuration command will watch and hot reload this file when any
changes are made.

A sample komorebi.ps1 file has been added to the root of the repository,
along with a sample whkdrc file, showing how the two can be used
together to replace AHK.

re #339
This commit is contained in:
LGUG2Z
2023-01-20 17:02:43 -08:00
committed by جاد
parent b89e5eafd2
commit afde7a3fb5
9 changed files with 696 additions and 31 deletions

31
komorebi.sample.ps1 Normal file
View File

@@ -0,0 +1,31 @@
if (!(Get-Process whkd -ErrorAction SilentlyContinue))
{
Start-Process whkd -WindowStyle hidden
}
. $PSScriptRoot\komorebi.generated.ps1
# Default to minimizing windows when switching workspaces
komorebic window-hiding-behaviour minimize
# Set cross-monitor move behaviour to insert instead of swap
komorebic cross-monitor-move-behaviour insert
# Enable hot reloading of changes to this file
komorebic watch-configuration enable
# Configure the invisible border dimensions
komorebic invisible-borders 7 0 14 7
# Ensure there is 1 workspace created on monitor 0
komorebic ensure-workspaces 0 1
# Configure the 1st workspace on the 1st monitor
komorebic workspace-name 0 0 "I"
komorebic workspace-layout 0 0 bsp
komorebic container-padding 0 0 bsp
# Uncomment the next lines if you want a visual border around the active window
# komorebic active-window-border-colour 66 165 245 --window-kind single
# komorebic active-window-border-colour 256 165 66 --window-kind stack
# komorebic active-window-border enable
komorebic complete-configuration