[BUG]: komorebi-bar clicking on workspace icon not working when some hidden #594

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

Originally created by @jpmiller25 on GitHub (Apr 1, 2025).

Summary

I use komorebi-bar with workspaces hidden when they have no windows. ("hide_empty_workspaces": true,)
When I click on a higher-number workspace but a lower-number workspace is hidden, it always switches to the hidden workspace with no windows on it.

For example: there are windows on workspaces 1, 2, 3, and 5. Click on 5, workspace 4 opens with no windows. Click 5 again, workspace 5 opens.

For example: there are windows on workspaces 1, and 5. Click on 5, workspace 2 opens. Click 5 again, workspace 3 opens. Any further clicking on 5 will only stay on workspace 3, it will not change to 4 or 5.

bar config is below.

Version Information

OS Name: Microsoft Windows 10 Business
OS Version: 10.0.19045 N/A Build 19045
komorebi 0.1.35 installed with scoop

komorebic 0.1.35
tag:v0.1.35
commit_hash:992bc2ab
build_time:2025-03-22 17:41:57 +00:00
build_env:rustc 1.85.1 (4eb161250 2025-03-15),stable-x86_64-pc-windows-msvc

Komorebi Configuration

{
  "$schema": "https://raw.githubusercontent.com/LGUG2Z/komorebi/v0.1.32/schema.bar.json",
  "monitor": {
    "index": 0,
    "work_area_offset": {
      "left": 0,
      "top": 25,
      "right": 0,
      "bottom": 20
    }
  },
  "height": 30,
  "padding": {
    "top": 10,
    "bottom": 10,
    "left": 10,
    "right": 10
  },
  "font_family": "JetBrains Mono",
  "font_size": 12,
  "transparency_alpha": 75,
  "left_widgets": [
    {
      "Komorebi": {
        "workspaces": {
          "enable": true,
          "hide_empty_workspaces": true,
          "display": "Text"
        },
        "layout": {
          "enable": true,
          "display": "Icon"
        }
      }
    }
  ],
  "center_widgets":[
    {
      "Komorebi": {
        "focused_window": {
          "enable": true,
          "display": "IconAndTextOnSelected"
        }
      }
    }
  ],
  "right_widgets": [
    {
      "Media": {
        "enable": false
      }
    },
    {
      "Cpu": {
        "enable": false,
        "data_refresh_interval": 5,
        "label_prefix": "Icon"
      }
    },
    {
      "Memory": {
        "enable": false,
        "data_refresh_interval": 5,
        "label_prefix": "Icon"
      }
    },
    {
      "Storage": {
        "enable": false,
        "data_refresh_interval": 1800,
        "label_prefix": "Icon"
      }
    },
    {
      "Network": {
        "enable": false,
        "show_total_data_transmitted": true,
        "show_network_activity": true
      }
    },
    {
      "Date": {
        "enable": true,
        "format": {
          "Custom": "%a, %B %d, %Y"
        }
      }
    },
    {
      "Time": {
        "enable": true,
        "format": "TwelveHourWithoutSeconds"
      }
    },
    {
      "Battery": {
        "enable": true
      }
    }
  ]
}

Hotkey Configuration

#SingleInstance Force
#Warn
; ; 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
#Left::
#h::Focus("left")
#Down::
#j::Focus("down")
#Up::
#k::Focus("up")
#Right::
#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")
#Tab::CycleStack("next")

; Resize
#=::ResizeAxis("horizontal", "increase")
#-::ResizeAxis("horizontal", "decrease")
#+=::ResizeAxis("vertical", "increase")
#+-::ResizeAxis("vertical", "decrease")

; Manipulate windows
#+f::ToggleFloat()
#m::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)
#4::FocusWorkspace(3)
#5::FocusWorkspace(4)

; Cycle Workspaces
#[::CycleWorkspace("previous")
#]::CycleWorkspace("next")

; Move windows across workspaces
#+1::MoveToWorkspace(0)
#+2::MoveToWorkspace(1)
#+3::MoveToWorkspace(2)
#+4::MoveToWorkspace(3)
#+5::MoveToWorkspace(4)
#+[::CycleMoveToWorkspace("previous")
#+]::CycleMoveToWorkspace("next")

; Change Layout
#+.::CycleLayout("next")
#+,::CycleLayout("previous")

; Manage Windows
#y::Manage
#+y::Unmanage

; Applications
#b::Run("chrome.exe")
#+0::RunWait "komorebic start --bar"
#ENTER::Run("wt.exe")
#+ENTER::Run('wt.exe --profile "Windows PowerShell (Admin)"')
#o::Run("outlook.exe")
#e::
{
Run("C:\Users\jmiller\python\estimate-00.2\Scripts\pythonw.exe C:\Users\jmiller\python\estimate-00.2\src\estimate.pyw")
Sleep 1000
; WinActivate("ahk_class TkTopLevel")
; If WinExist(, "ahk_class TkTopLevel")
; {
; WinActivate
; }
; Else
; {
; ; MsgBox "Window Not Found"
; }
}
#f::Run('explorer.exe /n,"C:\Users\jmiller\OneDrive - The MLN Company\Documents\S-Josh Local"')
#c::Close()
;#c::PostMessage 0x0112, 0xF060,,, "A" ; 0x0112 = WM_SYSCOMMAND, 0xF060 = SC_CLOSE

toggleKomorebi() {
ProcessName := "komorebi.exe"

if ProcessExist(ProcessName) {
    ; If running, kill the process
    Run("komorebic-no-console.exe stop --bar")
} else {
    ; If not running, start the process
    Run("komorebic-no-console.exe start --config C:\Users\jmiller\.config\komorebi\komorebi.json --bar")
}

}

#t::toggleKomorebi() ; Win + T
; ; #+t::Run("komorebic-no-console.exe stop --bar && komorebic-no-console.exe start --config C:\Users\jmiller.config\komorebi\komorebi.json --bar")

RunAsAdmin(Command) {
try {
Run('*RunAs cmd /c "' Command '"', , 'Hide') ; Run command as admin without elevating entire script
} catch as e {
MsgBox("Failed to run command as admin: " e.message, "Error", 16)
}
}

toggleZeroTier() {
ZeroTierDaemon := "C:\ProgramData\ZeroTier\One\zerotier-one_x64.exe"
ZeroTierApp := "C:\Program Files (x86)\ZeroTier\One\zerotier_desktop_ui.exe"
RunAsAdmin('sc start ZeroTierOneService') ; Start the ZeroTier service with admin privileges
}

; #z::toggleZeroTier()

Output of komorebic check

KOMOREBI_CONFIG_HOME detected: C:\Users\jmiller.config\komorebi

Looking for configuration files in C:\Users\jmiller.config\komorebi

Found komorebi.json; this file can be passed to the start command with the --config flag

Found C:\Users\jmiller.config\whkdrc; key bindings will be loaded from here when whkd is started, and you can start it automatically using the --whkd flag

Originally created by @jpmiller25 on GitHub (Apr 1, 2025). ### Summary I use komorebi-bar with workspaces hidden when they have no windows. ("hide_empty_workspaces": true,) When I click on a higher-number workspace but a lower-number workspace is hidden, it always switches to the hidden workspace with no windows on it. For example: there are windows on workspaces 1, 2, 3, and 5. Click on 5, workspace 4 opens with no windows. Click 5 again, workspace 5 opens. For example: there are windows on workspaces 1, and 5. Click on 5, workspace 2 opens. Click 5 again, workspace 3 opens. Any further clicking on 5 will only stay on workspace 3, it will not change to 4 or 5. bar config is below. ### Version Information OS Name: Microsoft Windows 10 Business OS Version: 10.0.19045 N/A Build 19045 komorebi 0.1.35 installed with scoop komorebic 0.1.35 tag:v0.1.35 commit_hash:992bc2ab build_time:2025-03-22 17:41:57 +00:00 build_env:rustc 1.85.1 (4eb161250 2025-03-15),stable-x86_64-pc-windows-msvc ### Komorebi Configuration ```json { "$schema": "https://raw.githubusercontent.com/LGUG2Z/komorebi/v0.1.32/schema.bar.json", "monitor": { "index": 0, "work_area_offset": { "left": 0, "top": 25, "right": 0, "bottom": 20 } }, "height": 30, "padding": { "top": 10, "bottom": 10, "left": 10, "right": 10 }, "font_family": "JetBrains Mono", "font_size": 12, "transparency_alpha": 75, "left_widgets": [ { "Komorebi": { "workspaces": { "enable": true, "hide_empty_workspaces": true, "display": "Text" }, "layout": { "enable": true, "display": "Icon" } } } ], "center_widgets":[ { "Komorebi": { "focused_window": { "enable": true, "display": "IconAndTextOnSelected" } } } ], "right_widgets": [ { "Media": { "enable": false } }, { "Cpu": { "enable": false, "data_refresh_interval": 5, "label_prefix": "Icon" } }, { "Memory": { "enable": false, "data_refresh_interval": 5, "label_prefix": "Icon" } }, { "Storage": { "enable": false, "data_refresh_interval": 1800, "label_prefix": "Icon" } }, { "Network": { "enable": false, "show_total_data_transmitted": true, "show_network_activity": true } }, { "Date": { "enable": true, "format": { "Custom": "%a, %B %d, %Y" } } }, { "Time": { "enable": true, "format": "TwelveHourWithoutSeconds" } }, { "Battery": { "enable": true } } ] } ``` ### Hotkey Configuration #SingleInstance Force #Warn ; ; 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 #Left:: #h::Focus("left") #Down:: #j::Focus("down") #Up:: #k::Focus("up") #Right:: #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") #Tab::CycleStack("next") ; Resize #=::ResizeAxis("horizontal", "increase") #-::ResizeAxis("horizontal", "decrease") #+=::ResizeAxis("vertical", "increase") #+-::ResizeAxis("vertical", "decrease") ; Manipulate windows #+f::ToggleFloat() #m::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) #4::FocusWorkspace(3) #5::FocusWorkspace(4) ; Cycle Workspaces #[::CycleWorkspace("previous") #]::CycleWorkspace("next") ; Move windows across workspaces #+1::MoveToWorkspace(0) #+2::MoveToWorkspace(1) #+3::MoveToWorkspace(2) #+4::MoveToWorkspace(3) #+5::MoveToWorkspace(4) #+[::CycleMoveToWorkspace("previous") #+]::CycleMoveToWorkspace("next") ; Change Layout #+.::CycleLayout("next") #+,::CycleLayout("previous") ; Manage Windows #y::Manage #+y::Unmanage ; Applications #b::Run("chrome.exe") #+0::RunWait "komorebic start --bar" #ENTER::Run("wt.exe") #+ENTER::Run('wt.exe --profile "Windows PowerShell (Admin)"') #o::Run("outlook.exe") #e:: { Run("C:\Users\jmiller\python\estimate-00.2\Scripts\pythonw.exe C:\Users\jmiller\python\estimate-00.2\src\estimate.pyw") Sleep 1000 ; WinActivate("ahk_class TkTopLevel") ; If WinExist(, "ahk_class TkTopLevel") ; { ; WinActivate ; } ; Else ; { ; ; MsgBox "Window Not Found" ; } } #f::Run('explorer.exe /n,"C:\Users\jmiller\OneDrive - The MLN Company\Documents\S-Josh Local"') #c::Close() ;#c::PostMessage 0x0112, 0xF060,,, "A" ; 0x0112 = WM_SYSCOMMAND, 0xF060 = SC_CLOSE toggleKomorebi() { ProcessName := "komorebi.exe" if ProcessExist(ProcessName) { ; If running, kill the process Run("komorebic-no-console.exe stop --bar") } else { ; If not running, start the process Run("komorebic-no-console.exe start --config C:\Users\jmiller\.config\komorebi\komorebi.json --bar") } } #t::toggleKomorebi() ; Win + T ; ; #+t::Run("komorebic-no-console.exe stop --bar && komorebic-no-console.exe start --config C:\Users\jmiller\.config\komorebi\komorebi.json --bar") RunAsAdmin(Command) { try { Run('*RunAs cmd /c "' Command '"', , 'Hide') ; Run command as admin without elevating entire script } catch as e { MsgBox("Failed to run command as admin: " e.message, "Error", 16) } } toggleZeroTier() { ZeroTierDaemon := "C:\ProgramData\ZeroTier\One\zerotier-one_x64.exe" ZeroTierApp := "C:\Program Files (x86)\ZeroTier\One\zerotier_desktop_ui.exe" RunAsAdmin('sc start ZeroTierOneService') ; Start the ZeroTier service with admin privileges } ; #z::toggleZeroTier() ### Output of komorebic check KOMOREBI_CONFIG_HOME detected: C:\Users\jmiller\.config\komorebi Looking for configuration files in C:\Users\jmiller\.config\komorebi Found komorebi.json; this file can be passed to the start command with the --config flag Found C:\Users\jmiller\.config\whkdrc; key bindings will be loaded from here when whkd is started, and you can start it automatically using the --whkd flag
adam added the bugkomorebi-bar labels 2026-01-05 14:51:48 +01:00
adam closed this issue 2026-01-05 14:51:48 +01:00
Author
Owner

@LGUG2Z commented on GitHub (Apr 1, 2025):

For example: there are windows on workspaces 1, 2, 3, and 5. Click on 5, workspace 4 opens with no windows. Click 5 again, workspace 5 opens.

I just tried reproducing with this setup but I couldn't 🤔

There was a similar bug to what you're describing some versions ago - is it possible that you may have an older version of komorebi-bar.exe in your $PATH that is getting called? You can check with komorebi-bar.exe --version

@LGUG2Z commented on GitHub (Apr 1, 2025): > For example: there are windows on workspaces 1, 2, 3, and 5. Click on 5, workspace 4 opens with no windows. Click 5 again, workspace 5 opens. I just tried reproducing with this setup but I couldn't 🤔 There was a similar bug to what you're describing some versions ago - is it possible that you may have an older version of `komorebi-bar.exe` in your $PATH that is getting called? You can check with `komorebi-bar.exe --version`
Author
Owner

@jpmiller25 commented on GitHub (Apr 1, 2025):

> komorebi-bar --version komorebi-bar 0.1.35

Issue is definitely happening. Is there a way for me to capture the socket requests while I click on the buttons?
Did I mention this only happens when hide_empty_workspaces is true and there are hidden workspaces lower than the one I'm clicking on. If all workspaces are shown it has no issue going directly to the clicked on workspace.

Side question but related, if I could set up some color indication that a workspace had a window, I think my preference would be to always show all workspaces 1-5. Is that currently possible?

Thanks!

@jpmiller25 commented on GitHub (Apr 1, 2025): `> komorebi-bar --version komorebi-bar 0.1.35` Issue is definitely happening. Is there a way for me to capture the socket requests while I click on the buttons? Did I mention this only happens when hide_empty_workspaces is true and there are hidden workspaces lower than the one I'm clicking on. If all workspaces are shown it has no issue going directly to the clicked on workspace. Side question but related, if I could set up some color indication that a workspace had a window, I think my preference would be to always show all workspaces 1-5. Is that currently possible? Thanks!
Author
Owner

@CtByte commented on GitHub (Apr 1, 2025):

it happens to me as well and I am on the latest

https://github.com/user-attachments/assets/1ada0fd1-e57e-4278-8381-95889fac3db6

My first guess is that it's because we use the vec index, not the workspace index when clicking

@CtByte commented on GitHub (Apr 1, 2025): it happens to me as well and I am on the latest https://github.com/user-attachments/assets/1ada0fd1-e57e-4278-8381-95889fac3db6 My first guess is that it's because we use the vec index, not the workspace index when [clicking](https://github.com/LGUG2Z/komorebi/blob/2a30f09bbdf80d5399dafd662513a8eb2e518c69/komorebi-bar/src/widgets/komorebi.rs#L270)
Author
Owner

@CtByte commented on GitHub (Apr 1, 2025):

Side question but related, if I could set up some color indication that a workspace had a window, I think my preference would be to always show all workspaces 1-5. Is that currently possible?

There is an option to show app icons on the workspace, so you would know if something is on it

Image

        "workspaces": {
          "enable": true,
          "hide_empty_workspaces": false,
          "display": "AllIcons"
        },

Or use the AllIconsAndText option to also show your workspace names

Image

using a color could be interesting, but this is what you have for now :)

@CtByte commented on GitHub (Apr 1, 2025): > Side question but related, if I could set up some color indication that a workspace had a window, I think my preference would be to always show all workspaces 1-5. Is that currently possible? There is an option to show app icons on the workspace, so you would know if something is on it ![Image](https://github.com/user-attachments/assets/5cb24dcb-4d48-4f24-a41c-c2004eeb519a) ```json "workspaces": { "enable": true, "hide_empty_workspaces": false, "display": "AllIcons" }, ``` Or use the `AllIconsAndText` option to also show your workspace names ![Image](https://github.com/user-attachments/assets/82dac5da-15e6-49a9-8fbd-29635585235b) using a color could be interesting, but this is what you have for now :)
Author
Owner

@LGUG2Z commented on GitHub (Apr 1, 2025):

I found the commit where I fixed this months ago: 36e3eaad36

Did a regression sneak past somewhere or was my fix not really a fix? 🤔

@LGUG2Z commented on GitHub (Apr 1, 2025): I found the commit where I fixed this months ago: https://github.com/LGUG2Z/komorebi/commit/36e3eaad36336101321ecafbffdf089795028c1e Did a regression sneak past somewhere or was my fix not really a fix? 🤔
Author
Owner

@LGUG2Z commented on GitHub (Apr 1, 2025):

Fixed on master now @jpmiller25, thanks for the PR @CtByte!

@LGUG2Z commented on GitHub (Apr 1, 2025): Fixed on master now @jpmiller25, thanks for the PR @CtByte!
Author
Owner

@jpmiller25 commented on GitHub (Apr 1, 2025):

Awesome thank you!

@jpmiller25 commented on GitHub (Apr 1, 2025): Awesome thank you!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/komorebi#594