From e4a9719f4f3d4ae2b93f76b56c604f0293b7eff2 Mon Sep 17 00:00:00 2001 From: LGUG2Z Date: Sun, 30 Apr 2023 12:19:44 -0700 Subject: [PATCH] feat(ahk): add sample v2 configuration file --- komorebi-core/src/config_generation.rs | 7 +- komorebi.sample.ahk | 93 ++++++++++++++++++++++++++ komorebi.sample.ps1 | 15 ++--- whkdrc.sample | 25 ++++--- 4 files changed, 113 insertions(+), 27 deletions(-) create mode 100644 komorebi.sample.ahk diff --git a/komorebi-core/src/config_generation.rs b/komorebi-core/src/config_generation.rs index 641d82c9..5279dc80 100644 --- a/komorebi-core/src/config_generation.rs +++ b/komorebi-core/src/config_generation.rs @@ -184,12 +184,7 @@ impl ApplicationConfigurationGenerator { cfgen.sort_by(|a, b| a.name.cmp(&b.name)); - let mut lines = vec![ - String::from("; Generated by komorebic.exe"), - String::from("; To use this file, add the line below to the top of your komorebi.ahk configuration file"), - String::from("; #Include %A_ScriptDir%\\komorebi.generated.ahk"), - String::new() - ]; + let mut lines = vec![String::from("; Generated by komorebic.exe"), String::new()]; let mut float_rules = vec![]; diff --git a/komorebi.sample.ahk b/komorebi.sample.ahk new file mode 100644 index 00000000..ef4e9506 --- /dev/null +++ b/komorebi.sample.ahk @@ -0,0 +1,93 @@ +#SingleInstance Force + +; Load library +#Include komorebic.lib.ahk +; Load configuration +#Include komorebi.generated.ahk + +; Send the ALT key whenever changing focus to force focus changes +AltFocusHack("enable") +; Default to cloaking windows when switching workspaces +WindowHidingBehaviour("cloak") +; Set cross-monitor move behaviour to insert instead of swap +CrossMonitorMoveBehaviour("Insert") +; Enable hot reloading of changes to this file +WatchConfiguration("enable") + +; Create named workspaces I-V on monitor 0 +EnsureNamedWorkspaces(0, "I II III IV V") +; You can do the same thing for secondary monitors too +; EnsureNamedWorkspaces(1, "A B C D E F") + +; Assign layouts to workspaces, possible values: bsp, columns, rows, vertical-stack, horizontal-stack, ultrawide-vertical-stack +NamedWorkspaceLayout("I", "bsp") + +; Set the gaps around the edge of the screen for a workspace +NamedWorkspacePadding("I", 20) +; Set the gaps between the containers for a workspace +NamedWorkspaceContainerPadding("I", 20) + +; You can assign specific apps to named workspaces +; NamedWorkspaceRule("exe", "Firefox.exe", "III") + +; Configure the invisible border dimensions +InvisibleBorders(7, 0, 14, 7) + +; Uncomment the next lines if you want a visual border around the active window +; ActiveWindowBorderColour(66, 165, 245, "single") +; ActiveWindowBorderColour(256, 165, 66, "stack") +; ActiveWindowBorderColour(255, 51, 153, "monocle") + +CompleteConfiguration() + +; Focus windows +!h::Focus("left") +!j::Focus("down") +!k::Focus("up") +!l::Focus("right") +!+[::CycleFocus("previous") +!+]::CycleFocus("next") + +; Move windows +!+h::Move("left") +!+j::Move("down") +!+k::Move("up") +!+l::Move("right") +!+Enter::Promote() + +; Stack windows +!Left::Stack("left") +!Right::Stack("right") +!Up::Stack("up") +!Down::Stack("down") +!;::Unstack() +![::CycleStack("previous") +!]::CycleStack("next") + +; Resize +!=::ResizeAxis("horizontal", "increase") +!-::ResizeAxis("horizontal", "decrease") +!+=::ResizeAxis("vertical", "increase") +!+-::ResizeAxis("vertical", "decrease") + +; Manipulate windows +!t::ToggleFloat() +!+f::ToggleMonocle() + +; Window manager options +!+r::Retile() +!p::TogglePause() + +; Layouts +!x::FlipLayout("horizontal") +!y::FlipLayout("vertical") + +; Workspaces +!1::FocusWorkspace(0) +!2::FocusWorkspace(1) +!3::FocusWorkspace(2) + +; Move windows across workspaces +!+1::MoveToWorkspace(0) +!+2::MoveToWorkspace(1) +!+3::MoveToWorkspace(2) diff --git a/komorebi.sample.ps1 b/komorebi.sample.ps1 index bfc2fbe2..7e8388bb 100644 --- a/komorebi.sample.ps1 +++ b/komorebi.sample.ps1 @@ -7,28 +7,27 @@ if (!(Get-Process whkd -ErrorAction SilentlyContinue)) # Send the ALT key whenever changing focus to force focus changes komorebic alt-focus-hack enable -# Default to minimizing windows when switching workspaces +# Default to cloaking windows when switching workspaces komorebic window-hiding-behaviour cloak # 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 -# create named workspaces I-V on monitor 0 +# Create named workspaces I-V on monitor 0 komorebic ensure-named-workspaces 0 I II III IV V -# you can do the same thing for secondary monitors too +# You can do the same thing for secondary monitors too # komorebic ensure-named-workspaces 1 A B C D E F -# assign layouts to workspaces, possible values: bsp, columns, rows, vertical-stack, horizontal-stack, ultrawide-vertical-stack +# Assign layouts to workspaces, possible values: bsp, columns, rows, vertical-stack, horizontal-stack, ultrawide-vertical-stack komorebic named-workspace-layout I bsp -# set the gaps around the edge of the screen for a workspace +# Set the gaps around the edge of the screen for a workspace komorebic named-workspace-padding I 20 - -# set the gaps between the containers for a workspace +# Set the gaps between the containers for a workspace komorebic named-workspace-container-padding I 20 -# you can assign specific apps to named workspaces +# You can assign specific apps to named workspaces # komorebic named-workspace-rule exe "Firefox.exe" III # Configure the invisible border dimensions diff --git a/whkdrc.sample b/whkdrc.sample index fd3aff8e..810cf249 100644 --- a/whkdrc.sample +++ b/whkdrc.sample @@ -1,16 +1,16 @@ .shell powershell -# reload swhkd configuration +# Reload whkd configuration # alt + o : taskkill /f /im whkd.exe && start /b whkd # if shell is cmd alt + o : taskkill /f /im whkd.exe && Start-Process whkd -WindowStyle hidden # if shell is pwsh / powershell alt + shift + o : komorebic reload-configuration -# app shortcuts - these require shell to be pwsh / powershell -# the apps will be focused if open, or launched if not open +# App shortcuts - these require shell to be pwsh / powershell +# The apps will be focused if open, or launched if not open # alt + f : if ($wshell.AppActivate('Firefox') -eq $False) { start firefox } # alt + b : if ($wshell.AppActivate('Chrome') -eq $False) { start chrome } -# focus windows +# Focus windows alt + h : komorebic focus left alt + j : komorebic focus down alt + k : komorebic focus up @@ -18,14 +18,14 @@ alt + l : komorebic focus right alt + shift + oem_4 : komorebic cycle-focus previous # oem_4 is [ alt + shift + oem_6 : komorebic cycle-focus next # oem_6 is ] -# move windows +# Move windows alt + shift + h : komorebic move left alt + shift + j : komorebic move down alt + shift + k : komorebic move up alt + shift + l : komorebic move right alt + shift + return : komorebic promote -# stack windows +# Stack windows alt + left : komorebic stack left alt + down : komorebic stack down alt + up : komorebic stack up @@ -34,31 +34,30 @@ alt + oem_1 : komorebic unstack # oem_1 is ; alt + oem_4 : komorebic cycle-stack previous # oem_4 is [ alt + oem_6 : komorebic cycle-stack next # oem_6 is ] -# resize +# Resize alt + oem_plus : komorebic resize-axis horizontal increase alt + oem_minus : komorebic resize-axis horizontal decrease alt + shift + oem_plus : komorebic resize-axis vertical increase alt + shift + oem_minus : komorebic resize-axis vertical decrease -# manipulate windows +# Manipulate windows alt + t : komorebic toggle-float alt + shift + f : komorebic toggle-monocle -# window manager options +# Window manager options alt + shift + r : komorebic retile alt + p : komorebic toggle-pause -alt + 0 : komorebic toggle-focus-follows-mouse -# layouts +# Layouts alt + x : komorebic flip-layout horizontal alt + y : komorebic flip-layout vertical -# workspaces +# Workspaces alt + 1 : komorebic focus-workspace 0 alt + 2 : komorebic focus-workspace 1 alt + 3 : komorebic focus-workspace 2 -# move windows across workspaces +# Move windows across workspaces alt + shift + 1 : komorebic move-to-workspace 0 alt + shift + 2 : komorebic move-to-workspace 1 alt + shift + 3 : komorebic move-to-workspace 2