ITADN

[BUG]: workspaces lost on dock/undock

#1640Openrwijtvliet 创建于 2026-01-19
bug
R
rwijtvlietcommented
### Summary When I put my laptop in a docking station, or remove it from one, (some of) the workspaces seem to get lost or unaccessible. The hotkey for focusing them, or moving a window to them, does nothing. If this is hard to fix: an acceptable workaround would be if restarting komorebi would detect the active displays and recreate or move the workspaces to them. This too does not currently work. Let me know if you need any debugging output! ### Version Information OS Name: Microsoft Windows 11 Enterprise OS Version: 10.0.26200 N/A Build 26200 komorebic 0.1.37 tag:v0.1.37 commit_hash:00384ce3 build_time:2025-05-17 19:16:53 +00:00 build_env:rustc 1.87.0 (17067e9ac 2025-05-09),stable-x86_64-pc-windows-msvc ### Komorebi Configuration ```json { "$schema": "https://raw.githubusercontent.com/LGUG2Z/komorebi/v0.1.28/schema.json", "app_specific_configuration_path": "$Env:USERPROFILE/.dotfiles/windowmanager/windows/komorebi-application-specific-configuration/applications.json", "window_hiding_behaviour": "Cloak", "cross_monitor_move_behaviour": "Insert", "default_workspace_padding": 4, "default_container_padding": 7, "border": true, "border_width": 8, "border_offset": -1, "border_colours": { "single": "#f2c545", "stack": "#00a542", "monocle": "#ff3399", "unfocused": "#808080" }, "global_work_area_offset": { "top": 0, "right": 0, "bottom": 0, "left": 0 }, "stackbar": { "height": 40, "mode": "OnStack", "tabs": { "width": 300, "focused_text": "#00a542", "unfocused_text": "#b3b3b3", "background": "#141414" } }, "mouse_follows_focus": false, "ignore_rules": [ { "kind": "Exe", "id": "Zebar.exe", "matching_strategy": "Equals" } ], "monitors": [ { "workspaces": [ { "name": "1file", "layout": "BSP", "initial_workspace_rules": [ { "kind": "exe", "id": "explorer.exe" } ] }, { "name": "2www", "layout": "BSP", "initial_workspace_rules": [] }, { "name": "3office", "layout": "BSP" }, { "name": "4term", "layout": "BSP", "initial_workspace_rules": [] }, { "name": "5code", "layout": "BSP", "initial_workspace_rules": [] }, { "name": "6xtra", "layout": "BSP" }, { "name": "7chat", "layout": "BSP" }, { "name": "8email", "layout": "BSP", "initial_workspace_rules": [ { "kind": "exe", "id": "OUTLOOK.EXE" } ] }, { "name": "9media", "layout": "BSP", "initial_workspace_rules": [{ "kind": "exe", "id": "ONENOTE.EXE" }] } ] } ] } ``` ### Hotkey Configuration ```shell #Requires AutoHotkey v2.0 #SingleInstance Force Komorebic(cmd) { RunWait(format("komorebic.exe {}", cmd), , "Hide") } ; hotkey = win + alt = #! ; additional hotkey = win + alt + shift = #!+ ; ######### ; # Focus # ; ######### ; ; # window ; # hotkey + htns #!h::Komorebic("focus left") #!t::Komorebic("focus up") #!n::Komorebic("focus down") #!s::Komorebic("focus right") ; ; # workspace ; # hotkey + 1..9 #!1::Komorebic("focus-named-workspace 1file") #!2::Komorebic("focus-named-workspace 2www") #!3::Komorebic("focus-named-workspace 3office") #!4::Komorebic("focus-named-workspace 4term") #!5::Komorebic("focus-named-workspace 5code") #!6::Komorebic("focus-named-workspace 6xtra") #!7::Komorebic("focus-named-workspace 7chat") #!8::Komorebic("focus-named-workspace 8email") #!9::Komorebic("focus-named-workspace 9media") ; ; # monitor ; # hotkey + gcrl #!g::Komorebic("focus-monitor left") #!c::Komorebic("focus-monitor up") #!r::Komorebic("focus-monitor down") #!l::Komorebic("focus-monitor right") ; ; # focus child window/container ; # --> n/a ; # focus parent container ; # --> n/a ; ; # toggle focus between tiling / floating ; # hotkey + shift + b ; ######## ; # Move # ; ######## ; ; # window/container inside workspace ; # hotkey + shift + htns #!+h::Komorebic("move left") #!+t::Komorebic("move up") #!+n::Komorebic("move down") #!+s::Komorebic("move right") ; ; # window/container to workspace ; # hotkey + shift + 1..9 #!+1::Komorebic("move-to-named-workspace 1file") #!+2::Komorebic("move-to-named-workspace 2www") #!+3::Komorebic("move-to-named-workspace 3office") #!+4::Komorebic("move-to-named-workspace 4term") #!+5::Komorebic("move-to-named-workspace 5code") #!+6::Komorebic("move-to-named-workspace 6xtra") #!+7::Komorebic("move-to-named-workspace 7chat") #!+8::Komorebic("move-to-named-workspace 8email") #!+9::Komorebic("move-to-named-workspace 9media") ; ; # workspace to monitor ; # hotkey + shift + gl #!+g::Komorebic("cycle-move-workspace-to-monitor previous") #!+l::Komorebic("cycle-move-workspace-to-monitor next") ; ; ######### ; # Close # ; ######### ; ; # hotkey + w #!w::Komorebic("close") ; ; ######## ; # Size # ; ######## ; ; # width ; # hotkey + left/right, hotkey + [] #!Right:: #!]::Komorebic("resize-axis horizontal increase") #!Left:: #![::Komorebic("resize-axis horizontal decrease") ; # height ; # hotkey + up/down, hotkey + {} #!Up:: #!+]::Komorebic("resize-axis vertical increase") #!Down:: #!+[::Komorebic("resize-axis vertical decrease") ; # balance ; # hotkey + = ; ; ########## ; # Layout # ; ########## ; ; # toggle float/tiling ; # hotkey + b #!b::Komorebic("toggle-float") ; ; # toggle maximize ; # hotkey + m #!m::Komorebic("toggle-maximize") ; ; # where to position next window ; # hotkey + v ; ; ################## ; # Window manager # ; ################## ; ; # restart ; # hotkey + f3 #!F3::{ MsgBox("Restarting komorebi") Komorebic("stop") Komorebic("start") Reload } ; # exit ; # hotkey + f4 #!F4::{ Komorebic("stop") MsgBox("Komorebi stopped") } ; ; ######## ; # Apps # ; ######## ; ; # cycle apps ; # TODO: do ; # launch apps ; # TODO: do ; ; # terminal ; # hotkey + (shift +) enter #!Enter::Run("wezterm start -- wsl",, "Hide") #!+Enter::Run("wezterm start", , "Hide") ; -- 'C:\Program Files\Git\git-bash.exe'") ; ; # screenshot ; # . to clipboard ; # hotkey + y #!y::Send '#+s' ; # . to editor ; # TODO: ; ; # various other apps under new namespace ; # hotkey + p ; ; ################################### ; # Non-window-management shortcuts # ; ################################### ; ; # lock the machine ; # hotkey + f5 #!F5::DllCall("LockWorkStation") ; ; # change keyboard layout (must be keys that are same on all layouts) ; # hotkey + f1 for dvorak, hotkey + f2 for us #!F1::Send '!+1' #!F2::Send '!+2' #!F11::RunWait('"C:\Program Files\Git\usr\bin\bash.exe" -c "source /c/users/cgd55/.shell_secrets && vpn off"', , "Hide") #!F12::RunWait('"C:\Program Files\Git\usr\bin\bash.exe" -c "source /c/users/cgd55/.shell_secrets && vpn on"', , "Hide") ; ############################# ; # Debugging: show modifiers # ; ############################# Run(A_ScriptDir "\modifiers_in_tray.ahk") ``` ### Output of komorebic check ```shell KOMOREBI_CONFIG_HOME detected: C:\Users\cgd55\.dotfiles\windowmanager\windows Looking for configuration files in C:\Users\cgd55\.dotfiles\windowmanager\windows Found komorebi.json; this file can be passed to the start command with the --config flag No ~/.config/whkdrc found; you may not be able to control komorebi with your keyboard An updated version of komorebi is available! https://github.com/LGUG2Z/komorebi/releases/v0.1.39 ```
0 条评论