[BUG]: Keybindings don't work #182

Closed
opened 2026-01-05 14:48:47 +01:00 by adam · 10 comments
Owner

Originally created by @nothingnesses on GitHub (Feb 26, 2023).

Describe the bug
Pressing the keybindings set in "~/.config/whkdrc" don't do anything.

To Reproduce
Steps to reproduce the behavior:

  1. Follow Quickstart instructions. Shell outputs:
Start-Process komorebi.exe -ArgumentList '--await-confoguration' -WindowStyle hidden
Waiting for komorebi.exe to start...Started!
  1. Open some windows, e.g. Notepad. Notice that tiling works.
  2. Try one of the keybindings, e.g., alt+l to try to set focus to Notepad window to the right. Notice nothing happens.

Expected behavior
Keybindings work, e.g., focus shifts to another window with alt+l.

Operating System

OS Name:                   Microsoft Windows 11 Home
OS Version:                10.0.22000 N/A Build 22000
Originally created by @nothingnesses on GitHub (Feb 26, 2023). **Describe the bug** Pressing the keybindings set in "~/.config/whkdrc" don't do anything. **To Reproduce** Steps to reproduce the behavior: 1. Follow [Quickstart instructions](https://github.com/LGUG2Z/komorebi#quickstart). Shell outputs: ``` Start-Process komorebi.exe -ArgumentList '--await-confoguration' -WindowStyle hidden Waiting for komorebi.exe to start...Started! ``` 1. Open some windows, e.g. Notepad. Notice that tiling works. 3. Try one of the keybindings, e.g., `alt+l` to try to set focus to Notepad window to the right. Notice nothing happens. **Expected behavior** Keybindings work, e.g., focus shifts to another window with `alt+l`. **Operating System** ``` OS Name: Microsoft Windows 11 Home OS Version: 10.0.22000 N/A Build 22000 ```
adam added the bug label 2026-01-05 14:48:47 +01:00
adam closed this issue 2026-01-05 14:48:47 +01:00
Author
Owner

@ArnaudKunzi commented on GitHub (Feb 27, 2023):

I encounter the same issue on

OS Name:                   Microsoft Windows 10 Enterprise
OS Version:                22H2 Build 19045.2604
@ArnaudKunzi commented on GitHub (Feb 27, 2023): I encounter the same issue on ``` OS Name: Microsoft Windows 10 Enterprise OS Version: 22H2 Build 19045.2604 ```
Author
Owner

@LGUG2Z commented on GitHub (Feb 27, 2023):

Please share your whkrdc configuration files and the output from running whkd directly on the command line so that we can get a clearer idea of what is happening.

@LGUG2Z commented on GitHub (Feb 27, 2023): Please share your `whkrdc` configuration files and the output from running `whkd` directly on the command line so that we can get a clearer idea of what is happening.
Author
Owner

@nothingnesses commented on GitHub (Feb 27, 2023):

PS C:\Users\jesse> cat ~/.config/whkdrc
.shell pwsh

# reload swhkd configuration
# alt + o                 : taskkill /f /im swhkd.exe && start /b swhkd # if shell is cmd
alt + o                 : taskkill /f /im swhkd.exe && Start-Process swhkd -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
# alt + f                 : if ($wshell.AppActivate('Firefox') -eq $False) { start firefox }
# alt + b                 : if ($wshell.AppActivate('Chrome') -eq $False) { start chrome }

# focus windows
alt + h                 : komorebic focus left
alt + j                 : komorebic focus down
alt + k                 : komorebic focus up
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
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
alt + left              : komorebic stack left
alt + down              : komorebic stack down
alt + up                : komorebic stack up
alt + right             : komorebic stack right
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
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
alt + t                 : komorebic toggle-float
alt + shift + f         : komorebic toggle-monocle

# window manager options
alt + shift + r         : komorebic retile
alt + p                 : komorebic toggle-pause
alt + 0                 : komorebic toggle-focus-follows-mouse

# layouts
alt + x                 : komorebic flip-layout horizontal
alt + y                 : komorebic flip-layout vertical

# workspaces
alt + 1                 : komorebic focus-workspace 0
alt + 2                 : komorebic focus-workspace 1
alt + 3                 : komorebic focus-workspace 2

# 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
PS C:\Users\jesse> whkd
Error:
   0: ←[91mprogram not found←[0m

Location:
   ←[35msrc\main.rs←[0m:←[35m97←[0m

Backtrace omitted. Run with RUST_BACKTRACE=1 environment variable to display it.
Run with RUST_BACKTRACE=full to include source snippets.
PS C:\Users\jesse>
@nothingnesses commented on GitHub (Feb 27, 2023): ``` PS C:\Users\jesse> cat ~/.config/whkdrc .shell pwsh # reload swhkd configuration # alt + o : taskkill /f /im swhkd.exe && start /b swhkd # if shell is cmd alt + o : taskkill /f /im swhkd.exe && Start-Process swhkd -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 # alt + f : if ($wshell.AppActivate('Firefox') -eq $False) { start firefox } # alt + b : if ($wshell.AppActivate('Chrome') -eq $False) { start chrome } # focus windows alt + h : komorebic focus left alt + j : komorebic focus down alt + k : komorebic focus up 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 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 alt + left : komorebic stack left alt + down : komorebic stack down alt + up : komorebic stack up alt + right : komorebic stack right 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 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 alt + t : komorebic toggle-float alt + shift + f : komorebic toggle-monocle # window manager options alt + shift + r : komorebic retile alt + p : komorebic toggle-pause alt + 0 : komorebic toggle-focus-follows-mouse # layouts alt + x : komorebic flip-layout horizontal alt + y : komorebic flip-layout vertical # workspaces alt + 1 : komorebic focus-workspace 0 alt + 2 : komorebic focus-workspace 1 alt + 3 : komorebic focus-workspace 2 # 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 PS C:\Users\jesse> whkd Error: 0: ←[91mprogram not found←[0m Location: ←[35msrc\main.rs←[0m:←[35m97←[0m Backtrace omitted. Run with RUST_BACKTRACE=1 environment variable to display it. Run with RUST_BACKTRACE=full to include source snippets. PS C:\Users\jesse> ```
Author
Owner

@LGUG2Z commented on GitHub (Feb 27, 2023):

It seems that you don't have pwsh on your system (this is the latest version that must be downloaded manually). Try setting your shell to either powershell or cmd- these are both bundled with every Windows install.

@LGUG2Z commented on GitHub (Feb 27, 2023): It seems that you don't have `pwsh` on your system (this is the latest version that must be downloaded manually). Try setting your shell to either `powershell` or `cmd`- these are both bundled with every Windows install.
Author
Owner

@nothingnesses commented on GitHub (Feb 27, 2023):

Ayup, scoop install pwsh seems to have done the trick, thanks! Perhaps that should be in the documentation? In any case, I'm happy to close the issue, unless @ArnaudKunzi is still encountering it?

@nothingnesses commented on GitHub (Feb 27, 2023): Ayup, `scoop install pwsh` seems to have done the trick, thanks! Perhaps that should be in the documentation? In any case, I'm happy to close the issue, unless @ArnaudKunzi is still encountering it?
Author
Owner

@LGUG2Z commented on GitHub (Feb 27, 2023):

I think I'll just update the example config to use .shell powershell to avoid the issue altogether 😅

@LGUG2Z commented on GitHub (Feb 27, 2023): I think I'll just update the example config to use `.shell powershell` to avoid the issue altogether :sweat_smile:
Author
Owner

@nothingnesses commented on GitHub (Feb 27, 2023):

@LGUG2Z Unrelated question, but how do I add more workspaces to komorebi? So far, only alt+1, alt+2 and alt+3 work.

I tried adding the following to whkdrc

alt + 4                 : komorebic focus-workspace 3

then stopping and starting komorebi, but alt+4 doesn't seem to change workspaces.

@nothingnesses commented on GitHub (Feb 27, 2023): @LGUG2Z Unrelated question, but how do I add more workspaces to komorebi? So far, only `alt+1`, `alt+2` and `alt+3` work. I tried adding the following to whkdrc ``` alt + 4 : komorebic focus-workspace 3 ``` then stopping and starting komorebi, but `alt+4` doesn't seem to change workspaces.
Author
Owner

@LGUG2Z commented on GitHub (Feb 27, 2023):

The best way to go about this is probably to define all the workspaces for a monitor like this: https://github.com/LGUG2Z/komorebi/blob/master/komorebi.sample.ps1#L18

Then your keybinds for switching to workspaces can refer to the workspace names, eg, from my own config:

# komorebi.ps1

komorebic ensure-named-workspaces 0 personal work music
# whkdrc

alt + 1                 : komorebic focus-named-workspace personal
alt + 2                 : komorebic focus-named-workspace work
alt + 3                 : komorebic focus-named-workspace music
@LGUG2Z commented on GitHub (Feb 27, 2023): The best way to go about this is probably to define all the workspaces for a monitor like this: https://github.com/LGUG2Z/komorebi/blob/master/komorebi.sample.ps1#L18 Then your keybinds for switching to workspaces can refer to the workspace names, eg, from my own config: ```powershell # komorebi.ps1 komorebic ensure-named-workspaces 0 personal work music ``` ```powershell # whkdrc alt + 1 : komorebic focus-named-workspace personal alt + 2 : komorebic focus-named-workspace work alt + 3 : komorebic focus-named-workspace music ```
Author
Owner

@nothingnesses commented on GitHub (Mar 1, 2023):

Thanks. That's what I tried to do before, but it doesn't seem to work. Here's my configuration:

komorebi.ps1

if (!(Get-Process whkd -ErrorAction SilentlyContinue))
{
    Start-Process whkd -WindowStyle hidden
}

. $PSScriptRoot\komorebi.generated.ps1

# Send the ALT key whenever changing focus to force focus changes
komorebic alt-focus-hack enable
# Default to minimizing 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
komorebic ensure-named-workspaces 0 A B C D E F G H I J
# 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
komorebic named-workspace-layout A bsp
komorebic named-workspace-layout B bsp
komorebic named-workspace-layout C bsp
komorebic named-workspace-layout D bsp
komorebic named-workspace-layout E bsp
komorebic named-workspace-layout F bsp
komorebic named-workspace-layout G bsp
komorebic named-workspace-layout H bsp
komorebic named-workspace-layout I bsp
komorebic named-workspace-layout J bsp

# set the gaps around the edge of the screen for a workspace
komorebic named-workspace-padding A 0
komorebic named-workspace-padding B 0
komorebic named-workspace-padding C 0
komorebic named-workspace-padding D 0
komorebic named-workspace-padding E 0
komorebic named-workspace-padding F 0
komorebic named-workspace-padding G 0
komorebic named-workspace-padding H 0
komorebic named-workspace-padding I 0
komorebic named-workspace-padding J 0

# set the gaps between the containers for a workspace
komorebic named-workspace-container-padding A 0
komorebic named-workspace-container-padding B 0
komorebic named-workspace-container-padding C 0
komorebic named-workspace-container-padding D 0
komorebic named-workspace-container-padding E 0
komorebic named-workspace-container-padding F 0
komorebic named-workspace-container-padding G 0
komorebic named-workspace-container-padding H 0
komorebic named-workspace-container-padding I 0
komorebic named-workspace-container-padding J 0

# you can assign specific apps to named workspaces
# komorebic named-workspace-rule exe "Firefox.exe" III

# Configure the invisible border dimensions
komorebic invisible-borders 7 0 14 7

# 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

whkdrc

.shell powershell

# reload swhkd configuration
# alt + o                 : taskkill /f /im swhkd.exe && start /b swhkd # if shell is cmd
alt + o                 : taskkill /f /im swhkd.exe && Start-Process swhkd -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
# alt + f                 : if ($wshell.AppActivate('Firefox') -eq $False) { start firefox }
# alt + b                 : if ($wshell.AppActivate('Chrome') -eq $False) { start chrome }

# focus windows
alt + h                 : komorebic focus left
alt + j                 : komorebic focus down
alt + k                 : komorebic focus up
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
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
alt + left              : komorebic stack left
alt + down              : komorebic stack down
alt + up                : komorebic stack up
alt + right             : komorebic stack right
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
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
alt + t                 : komorebic toggle-float
alt + shift + f         : komorebic toggle-monocle

# window manager options
alt + shift + r         : komorebic retile
alt + p                 : komorebic toggle-pause
alt + m                 : komorebic toggle-focus-follows-mouse

# layouts
alt + x                 : komorebic flip-layout horizontal
alt + y                 : komorebic flip-layout vertical

# workspaces
alt + 1                 : komorebic focus-workspace A
alt + 2                 : komorebic focus-workspace B
alt + 3                 : komorebic focus-workspace C
alt + 4                 : komorebic focus-workspace D
alt + 5                 : komorebic focus-workspace E
alt + 6                 : komorebic focus-workspace F
alt + 7                 : komorebic focus-workspace G
alt + 8                 : komorebic focus-workspace H
alt + 9                 : komorebic focus-workspace I
alt + 0                 : komorebic focus-workspace J

# move windows across workspaces
alt + shift + 1         : komorebic move-to-workspace A
alt + shift + 2         : komorebic move-to-workspace B
alt + shift + 3         : komorebic move-to-workspace C
alt + shift + 4         : komorebic move-to-workspace D
alt + shift + 5         : komorebic move-to-workspace E
alt + shift + 6         : komorebic move-to-workspace F
alt + shift + 7         : komorebic move-to-workspace G
alt + shift + 8         : komorebic move-to-workspace H
alt + shift + 9         : komorebic move-to-workspace I
alt + shift + 0         : komorebic move-to-workspace J

Please could you let me know if I'm doing something silly?

@nothingnesses commented on GitHub (Mar 1, 2023): Thanks. That's what I tried to do before, but it doesn't seem to work. Here's my configuration: komorebi.ps1 ```ps1 if (!(Get-Process whkd -ErrorAction SilentlyContinue)) { Start-Process whkd -WindowStyle hidden } . $PSScriptRoot\komorebi.generated.ps1 # Send the ALT key whenever changing focus to force focus changes komorebic alt-focus-hack enable # Default to minimizing 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 komorebic ensure-named-workspaces 0 A B C D E F G H I J # 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 komorebic named-workspace-layout A bsp komorebic named-workspace-layout B bsp komorebic named-workspace-layout C bsp komorebic named-workspace-layout D bsp komorebic named-workspace-layout E bsp komorebic named-workspace-layout F bsp komorebic named-workspace-layout G bsp komorebic named-workspace-layout H bsp komorebic named-workspace-layout I bsp komorebic named-workspace-layout J bsp # set the gaps around the edge of the screen for a workspace komorebic named-workspace-padding A 0 komorebic named-workspace-padding B 0 komorebic named-workspace-padding C 0 komorebic named-workspace-padding D 0 komorebic named-workspace-padding E 0 komorebic named-workspace-padding F 0 komorebic named-workspace-padding G 0 komorebic named-workspace-padding H 0 komorebic named-workspace-padding I 0 komorebic named-workspace-padding J 0 # set the gaps between the containers for a workspace komorebic named-workspace-container-padding A 0 komorebic named-workspace-container-padding B 0 komorebic named-workspace-container-padding C 0 komorebic named-workspace-container-padding D 0 komorebic named-workspace-container-padding E 0 komorebic named-workspace-container-padding F 0 komorebic named-workspace-container-padding G 0 komorebic named-workspace-container-padding H 0 komorebic named-workspace-container-padding I 0 komorebic named-workspace-container-padding J 0 # you can assign specific apps to named workspaces # komorebic named-workspace-rule exe "Firefox.exe" III # Configure the invisible border dimensions komorebic invisible-borders 7 0 14 7 # 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 ``` whkdrc ```ps1 .shell powershell # reload swhkd configuration # alt + o : taskkill /f /im swhkd.exe && start /b swhkd # if shell is cmd alt + o : taskkill /f /im swhkd.exe && Start-Process swhkd -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 # alt + f : if ($wshell.AppActivate('Firefox') -eq $False) { start firefox } # alt + b : if ($wshell.AppActivate('Chrome') -eq $False) { start chrome } # focus windows alt + h : komorebic focus left alt + j : komorebic focus down alt + k : komorebic focus up 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 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 alt + left : komorebic stack left alt + down : komorebic stack down alt + up : komorebic stack up alt + right : komorebic stack right 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 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 alt + t : komorebic toggle-float alt + shift + f : komorebic toggle-monocle # window manager options alt + shift + r : komorebic retile alt + p : komorebic toggle-pause alt + m : komorebic toggle-focus-follows-mouse # layouts alt + x : komorebic flip-layout horizontal alt + y : komorebic flip-layout vertical # workspaces alt + 1 : komorebic focus-workspace A alt + 2 : komorebic focus-workspace B alt + 3 : komorebic focus-workspace C alt + 4 : komorebic focus-workspace D alt + 5 : komorebic focus-workspace E alt + 6 : komorebic focus-workspace F alt + 7 : komorebic focus-workspace G alt + 8 : komorebic focus-workspace H alt + 9 : komorebic focus-workspace I alt + 0 : komorebic focus-workspace J # move windows across workspaces alt + shift + 1 : komorebic move-to-workspace A alt + shift + 2 : komorebic move-to-workspace B alt + shift + 3 : komorebic move-to-workspace C alt + shift + 4 : komorebic move-to-workspace D alt + shift + 5 : komorebic move-to-workspace E alt + shift + 6 : komorebic move-to-workspace F alt + shift + 7 : komorebic move-to-workspace G alt + shift + 8 : komorebic move-to-workspace H alt + shift + 9 : komorebic move-to-workspace I alt + shift + 0 : komorebic move-to-workspace J ``` Please could you let me know if I'm doing something silly?
Author
Owner

@LGUG2Z commented on GitHub (Mar 1, 2023):

Try focused-named-workspace instead; the focus-workspace command takes a zero-indexed integer that refers only to the list of workspaces on the currently focused monitor, while focus-named-workspace takes a string that can refer to the name of any workspace on any monitor.

@LGUG2Z commented on GitHub (Mar 1, 2023): Try `focused-named-workspace` instead; the `focus-workspace` command takes a zero-indexed integer that refers only to the list of workspaces on the currently focused monitor, while `focus-named-workspace` takes a string that can refer to the name of any workspace on any monitor.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/komorebi#182