feat(ahk): add sample v2 configuration file

This commit is contained in:
LGUG2Z
2023-04-30 12:19:44 -07:00
committed by جاد
parent e044a5a16f
commit e4a9719f4f
4 changed files with 113 additions and 27 deletions
+1 -6
View File
@@ -184,12 +184,7 @@ impl ApplicationConfigurationGenerator {
cfgen.sort_by(|a, b| a.name.cmp(&b.name)); cfgen.sort_by(|a, b| a.name.cmp(&b.name));
let mut lines = vec![ let mut lines = vec![String::from("; Generated by komorebic.exe"), String::new()];
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 float_rules = vec![]; let mut float_rules = vec![];
+93
View File
@@ -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)
+7 -8
View File
@@ -7,28 +7,27 @@ if (!(Get-Process whkd -ErrorAction SilentlyContinue))
# Send the ALT key whenever changing focus to force focus changes # Send the ALT key whenever changing focus to force focus changes
komorebic alt-focus-hack enable komorebic alt-focus-hack enable
# Default to minimizing windows when switching workspaces # Default to cloaking windows when switching workspaces
komorebic window-hiding-behaviour cloak komorebic window-hiding-behaviour cloak
# Set cross-monitor move behaviour to insert instead of swap # Set cross-monitor move behaviour to insert instead of swap
komorebic cross-monitor-move-behaviour insert komorebic cross-monitor-move-behaviour insert
# Enable hot reloading of changes to this file # Enable hot reloading of changes to this file
komorebic watch-configuration enable 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 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 # 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 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 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 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 # komorebic named-workspace-rule exe "Firefox.exe" III
# Configure the invisible border dimensions # Configure the invisible border dimensions
+12 -13
View File
@@ -1,16 +1,16 @@
.shell powershell .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 /b whkd # if shell is cmd
alt + o : taskkill /f /im whkd.exe && Start-Process whkd -WindowStyle hidden # if shell is pwsh / powershell alt + o : taskkill /f /im whkd.exe && Start-Process whkd -WindowStyle hidden # if shell is pwsh / powershell
alt + shift + o : komorebic reload-configuration alt + shift + o : komorebic reload-configuration
# app shortcuts - these require shell to be pwsh / powershell # App shortcuts - these require shell to be pwsh / powershell
# the apps will be focused if open, or launched if not open # The apps will be focused if open, or launched if not open
# alt + f : if ($wshell.AppActivate('Firefox') -eq $False) { start firefox } # alt + f : if ($wshell.AppActivate('Firefox') -eq $False) { start firefox }
# alt + b : if ($wshell.AppActivate('Chrome') -eq $False) { start chrome } # alt + b : if ($wshell.AppActivate('Chrome') -eq $False) { start chrome }
# focus windows # Focus windows
alt + h : komorebic focus left alt + h : komorebic focus left
alt + j : komorebic focus down alt + j : komorebic focus down
alt + k : komorebic focus up 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_4 : komorebic cycle-focus previous # oem_4 is [
alt + shift + oem_6 : komorebic cycle-focus next # oem_6 is ] alt + shift + oem_6 : komorebic cycle-focus next # oem_6 is ]
# move windows # Move windows
alt + shift + h : komorebic move left alt + shift + h : komorebic move left
alt + shift + j : komorebic move down alt + shift + j : komorebic move down
alt + shift + k : komorebic move up alt + shift + k : komorebic move up
alt + shift + l : komorebic move right alt + shift + l : komorebic move right
alt + shift + return : komorebic promote alt + shift + return : komorebic promote
# stack windows # Stack windows
alt + left : komorebic stack left alt + left : komorebic stack left
alt + down : komorebic stack down alt + down : komorebic stack down
alt + up : komorebic stack up 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_4 : komorebic cycle-stack previous # oem_4 is [
alt + oem_6 : komorebic cycle-stack next # oem_6 is ] alt + oem_6 : komorebic cycle-stack next # oem_6 is ]
# resize # Resize
alt + oem_plus : komorebic resize-axis horizontal increase alt + oem_plus : komorebic resize-axis horizontal increase
alt + oem_minus : komorebic resize-axis horizontal decrease alt + oem_minus : komorebic resize-axis horizontal decrease
alt + shift + oem_plus : komorebic resize-axis vertical increase alt + shift + oem_plus : komorebic resize-axis vertical increase
alt + shift + oem_minus : komorebic resize-axis vertical decrease alt + shift + oem_minus : komorebic resize-axis vertical decrease
# manipulate windows # Manipulate windows
alt + t : komorebic toggle-float alt + t : komorebic toggle-float
alt + shift + f : komorebic toggle-monocle alt + shift + f : komorebic toggle-monocle
# window manager options # Window manager options
alt + shift + r : komorebic retile alt + shift + r : komorebic retile
alt + p : komorebic toggle-pause alt + p : komorebic toggle-pause
alt + 0 : komorebic toggle-focus-follows-mouse
# layouts # Layouts
alt + x : komorebic flip-layout horizontal alt + x : komorebic flip-layout horizontal
alt + y : komorebic flip-layout vertical alt + y : komorebic flip-layout vertical
# workspaces # Workspaces
alt + 1 : komorebic focus-workspace 0 alt + 1 : komorebic focus-workspace 0
alt + 2 : komorebic focus-workspace 1 alt + 2 : komorebic focus-workspace 1
alt + 3 : komorebic focus-workspace 2 alt + 3 : komorebic focus-workspace 2
# move windows across workspaces # Move windows across workspaces
alt + shift + 1 : komorebic move-to-workspace 0 alt + shift + 1 : komorebic move-to-workspace 0
alt + shift + 2 : komorebic move-to-workspace 1 alt + shift + 2 : komorebic move-to-workspace 1
alt + shift + 3 : komorebic move-to-workspace 2 alt + shift + 3 : komorebic move-to-workspace 2