mirror of
https://github.com/LGUG2Z/komorebi.git
synced 2026-01-11 14:40:25 +01:00
[BUG]: komorebi-bar clicking on workspace icon not working when some hidden #594
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
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
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"
}
#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
@LGUG2Z commented on GitHub (Apr 1, 2025):
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.exein your $PATH that is getting called? You can check withkomorebi-bar.exe --version@jpmiller25 commented on GitHub (Apr 1, 2025):
> komorebi-bar --version komorebi-bar 0.1.35Issue 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!
@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):
There is an option to show app icons on the workspace, so you would know if something is on it
Or use the
AllIconsAndTextoption to also show your workspace namesusing a color could be interesting, but this is what you have for now :)
@LGUG2Z commented on GitHub (Apr 1, 2025):
I found the commit where I fixed this months ago:
36e3eaad36Did a regression sneak past somewhere or was my fix not really a fix? 🤔
@LGUG2Z commented on GitHub (Apr 1, 2025):
Fixed on master now @jpmiller25, thanks for the PR @CtByte!
@jpmiller25 commented on GitHub (Apr 1, 2025):
Awesome thank you!