-
-
Notifications
You must be signed in to change notification settings - Fork 101
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature: workspace next|prev --all
#264
Comments
(1) As long as your provide time measurements, that prove that You can measure time in the following way: diff --git a/Sources/AppBundle/config/HotkeyBinding.swift b/Sources/AppBundle/config/HotkeyBinding.swift
index 18aa3274..e0b73b73 100644
--- a/Sources/AppBundle/config/HotkeyBinding.swift
+++ b/Sources/AppBundle/config/HotkeyBinding.swift
@@ -26,6 +26,7 @@ func activateMode(_ targetMode: String?) {
let targetBindings = targetMode.flatMap { config.modes[$0] }?.bindings ?? [:]
for binding in targetBindings.values where !hotkeys.keys.contains(binding.binding) {
hotkeys[binding.binding] = HotKey(key: binding.key, modifiers: binding.modifiers, keyDownHandler: {
+ print("--- \(binding.binding) pressed. The current active app is \(getNativeFocusedWindow(startup: false)?.app.name). Time: \(Date().timeIntervalSince1970)")
if let activeMode {
refreshSession(forceFocus: true) {
_ = config.modes[activeMode]?.bindings[binding.binding]?.commands.run(.focused)
diff --git a/Sources/AppBundle/refresh.swift b/Sources/AppBundle/refresh.swift
index f8f3d489..8c1b9d7e 100644
--- a/Sources/AppBundle/refresh.swift
+++ b/Sources/AppBundle/refresh.swift
@@ -5,6 +5,8 @@ import Common
/// The function is called as a feedback response on every user input.
/// The function is idempotent.
func refreshSession<T>(startup: Bool = false, forceFocus: Bool = false, body: () -> T) -> T {
+ // Once the focused app changes, you can track it in the log
+ print("--- Process event. Focused app: \(getNativeFocusedWindow(startup: false)?.app.name). Time: \(Date().timeIntervalSince1970)")
check(Thread.current.isMainThread)
gc()
(2) (3) Please don't forget to update the (4) Please don't forget to report an error (stderr + exit-code) if both stdin is not empty and (5) Out of curiosity, why do you prefer to cycle workspace on all monitors? When Sidenotes (feel free to ignore them) Sidenote 1. I understand that AeroSpace could be faster #104, but it still makes me sad that the currently provided solution The whole point of stdin consumption in Sidenote 2. Maybe it's worth to implement common shell separators |
You can compare |
After thinking more about it, I lean more towards supporting shell-like combinators (sidenote 2) It's needed anyway to reduce flickering in this case https://nikitabobko.github.io/AeroSpace/goodness#use-trackpad-gestures-to-switch-workspaces Copying flags from I will create the tracking issue for the shell-like combinators later and post here as a comment. |
@nikitabobko
Thanks for providing example diff! So, I tried various options (with only one monitor, but I'm pretty sure that native filtering would not add such impact):
And then manually checked the logs for time delta between keydown and first focused app chage event. That yielded following results on my M1 MBA:
Which is a bit weird, considering that alt-q should be a bit slower. Maybe the test was not clean enough (spaces had different number of windows), but the slow-down is substantial.
Force of habit, I guess. I've had an i3 setup a long time ago, with
I guess, it's not that noticeable, but I'm pretty picky :) I'll be happy to contribute to any performance-related improvements, do you maybe have a good first issue in mind?
Yeah, that makes sense. |
|
Hi! First of all, kudos for creating such awesome tool! I tried to use yabai in the past, but couldn't bear native worspace switching speed (even with reduced animations), compared to i3. AeroSpace's virtual workspaces work extremely fast in comparison.
Use-case
I'd like to bind alt-tab/alt-shift-tab to cycle through all workspaces, regardless of monitor. This can be solved like that:
However, this adds significant delay: ~30-50ms for listing workspaces, and 50+ ms for spawning bash and piping/calling
aerospace workspace
.Having static list of workspaces,
aerospace list-workspaces --all
can be replaced withseq 1 9
or even staticecho $'1\n2\n...'
, however this does not eliminate overhead of spawning subprocesses and callingaerospace
CLI, which becomes noticeable, because I navigate workspaces in that way quite a lot.Proposal
Argument
--all
could be added toworkspace (next|prev)
syntax to implement this kind of behaviour (similar tolist-(windows|workspaces)
)I'd be happy to submit a PR if you're okay with such feature.
The text was updated successfully, but these errors were encountered: