From aafdd1e8ea8d2003ce3e934ba97582659bd9611e Mon Sep 17 00:00:00 2001 From: Nikita Bobko Date: Mon, 9 Dec 2024 23:26:39 +0100 Subject: [PATCH] Minor --- README.md | 12 ++++++------ Sources/AppBundle/GlobalObserver.swift | 2 +- Sources/AppBundle/tree/MacApp.swift | 2 +- Sources/AppBundle/tree/TreeNode.swift | 2 +- Sources/AppBundle/tree/Window.swift | 1 + Sources/Cli/cliUtil.swift | 6 ------ Sources/Cli/main.swift | 4 ++-- docs/aerospace-focus-monitor.adoc | 2 +- docs/aerospace-move-node-to-monitor.adoc | 2 +- docs/aerospace-resize.adoc | 2 +- grammar/commands-bnf-grammar.txt | 4 +++- 11 files changed, 18 insertions(+), 21 deletions(-) diff --git a/README.md b/README.md index f85f1e4f..fb3b0d03 100644 --- a/README.md +++ b/README.md @@ -62,22 +62,22 @@ There you can ask your questions, show off your setup, bring other topic, or jus There are 6 channels: - [#all](https://github.com/nikitabobko/AeroSpace/discussions). - [RSS](https://github.com/nikitabobko/AeroSpace/discussions.atom). + [RSS](https://github.com/nikitabobko/AeroSpace/discussions.atom?discussions_q=sort%3Adate_created). Feed with all discussions. - [#announcements](https://github.com/nikitabobko/AeroSpace/discussions/categories/announcements). - [RSS](https://github.com/nikitabobko/AeroSpace/discussions/categories/announcements.atom). + [RSS](https://github.com/nikitabobko/AeroSpace/discussions/categories/announcements.atom?discussions_q=category%3Aannouncements+sort%3Adate_created). Only maintainers can post here. Highly moderated traffic. - [#announcements-releases](https://github.com/nikitabobko/AeroSpace/discussions/categories/announcements-releases). - [RSS](https://github.com/nikitabobko/AeroSpace/discussions/categories/announcements-releases.atom). + [RSS](https://github.com/nikitabobko/AeroSpace/discussions/categories/announcements-releases.atom?discussions_q=category%3Aannouncements-releases+sort%3Adate_created). Announcements about non-patch releases. Only maintainers can post here. - [#feature-ideas](https://github.com/nikitabobko/AeroSpace/discussions/categories/feature-ideas). - [RSS](https://github.com/nikitabobko/AeroSpace/discussions/categories/feature-ideas.atom). + [RSS](https://github.com/nikitabobko/AeroSpace/discussions/categories/feature-ideas.atom?discussions_q=category%3Afeature-ideas+sort%3Adate_created). - [#general](https://github.com/nikitabobko/AeroSpace/discussions/categories/general). - [RSS](https://github.com/nikitabobko/AeroSpace/discussions/categories/general.atom). + [RSS](https://github.com/nikitabobko/AeroSpace/discussions/categories/general.atom?discussions_q=sort%3Adate_created+category%3Ageneral). - [#questions-and-answers](https://github.com/nikitabobko/AeroSpace/discussions/categories/questions-and-answers). - [RSS](https://github.com/nikitabobko/AeroSpace/discussions/categories/questions-and-answers.atom). + [RSS](https://github.com/nikitabobko/AeroSpace/discussions/categories/questions-and-answers.atom?discussions_q=category%3Aquestions-and-answers+sort%3Adate_created). Everyone is welcome to ask questions. Everyone is encouraged to answer other people's questions. diff --git a/Sources/AppBundle/GlobalObserver.swift b/Sources/AppBundle/GlobalObserver.swift index e9988c26..e9e5cdcf 100644 --- a/Sources/AppBundle/GlobalObserver.swift +++ b/Sources/AppBundle/GlobalObserver.swift @@ -52,7 +52,7 @@ class GlobalObserver { _ = refreshSession(.globalObserverLeftMouseUp, screenIsDefinitelyUnlocked: true) { clickedMonitor.activeWorkspace.focusWorkspace() } - // Detect close button clicks for unfocused windows + // Detect close button clicks for unfocused windows. Yes, kAXUIElementDestroyedNotification is that unreliable case _ where focus.windowOrNil?.getRect()?.contains(mouseLocation) == false: // todo replace getRect with preflushRect when it later becomes available refreshAndLayout(.globalObserverLeftMouseUp, screenIsDefinitelyUnlocked: true) default: diff --git a/Sources/AppBundle/tree/MacApp.swift b/Sources/AppBundle/tree/MacApp.swift index 936413eb..2ed9b331 100644 --- a/Sources/AppBundle/tree/MacApp.swift +++ b/Sources/AppBundle/tree/MacApp.swift @@ -67,7 +67,7 @@ final class MacApp: AbstractApp { return true } - override func getFocusedWindow(startup: Bool) -> Window? { + override func getFocusedWindow(startup: Bool) -> Window? { // todo unused? getFocusedAxWindow()?.lets { MacWindow.get(app: self, axWindow: $0, startup: startup) } } diff --git a/Sources/AppBundle/tree/TreeNode.swift b/Sources/AppBundle/tree/TreeNode.swift index f08caae8..0004fec9 100644 --- a/Sources/AppBundle/tree/TreeNode.swift +++ b/Sources/AppBundle/tree/TreeNode.swift @@ -119,7 +119,7 @@ class TreeNode: Equatable { unboundStacktrace = getStringStacktrace() return bindingData } else { - error("\(self) is already unbound. The stacktrace where it was unbound:\n\(unboundStacktrace ?? "")") + error("\(self) is already unbound. The stacktrace where it was unbound:\n\(unboundStacktrace ?? "nil")") } } diff --git a/Sources/AppBundle/tree/Window.swift b/Sources/AppBundle/tree/Window.swift index 11b3852b..144b6402 100644 --- a/Sources/AppBundle/tree/Window.swift +++ b/Sources/AppBundle/tree/Window.swift @@ -61,6 +61,7 @@ extension Window { func setFrame(_ topLeft: CGPoint?, _ size: CGSize?) -> Bool { // Set size and then the position. The order is important https://github.com/nikitabobko/AeroSpace/issues/143 + // https://github.com/nikitabobko/AeroSpace/issues/335 var result: Bool = true if let size { result = setSize(size) && result } if let topLeft { result = setTopLeftCorner(topLeft) && result } diff --git a/Sources/Cli/cliUtil.swift b/Sources/Cli/cliUtil.swift index 603b9aec..06e0d57a 100644 --- a/Sources/Cli/cliUtil.swift +++ b/Sources/Cli/cliUtil.swift @@ -2,12 +2,6 @@ import Common import Darwin import Foundation -#if DEBUG - let appId: String = "bobko.aerospace.debug" -#else - let appId: String = "bobko.aerospace" -#endif - let cliClientVersionAndHash: String = "\(aeroSpaceAppVersion) \(gitHash)" func hasStdin() -> Bool { diff --git a/Sources/Cli/main.swift b/Sources/Cli/main.swift index c23f53c5..7810d78a 100644 --- a/Sources/Cli/main.swift +++ b/Sources/Cli/main.swift @@ -58,8 +58,8 @@ func run(_ args: [String], stdin: String) -> ServerAnswer { Result { try socket.read(into: &answer) }.getOrThrow() return Result { try JSONDecoder().decode(ServerAnswer.self, from: answer) }.getOrThrow() } -let socketFile = "/tmp/\(appId)-\(unixUserName).sock" -let socketFileCompat = "/tmp/\(appId).sock" // Compatibility. Drop after a few versions +let socketFile = "/tmp/\(aeroSpaceAppId)-\(unixUserName).sock" +let socketFileCompat = "/tmp/\(aeroSpaceAppId).sock" // Compatibility. Drop after a few versions if let e: Error = Result(catching: { try socket.connect(to: socketFile) }) .flatMapError({ _ in Result(catching: { try socket.connect(to: socketFileCompat) }) }) diff --git a/docs/aerospace-focus-monitor.adoc b/docs/aerospace-focus-monitor.adoc index 5c2969de..6af16f8d 100644 --- a/docs/aerospace-focus-monitor.adoc +++ b/docs/aerospace-focus-monitor.adoc @@ -36,7 +36,7 @@ Focus monitor in direction relative to the focused monitor (next|prev):: Focus next|prev monitor in order they appear in tray icon -:: +...:: Find the first monitor pattern in the list that doesn't describe the current monitor and focus it. Monitor pattern is the same as in `workspace-to-monitor-force-assignment` config option diff --git a/docs/aerospace-move-node-to-monitor.adoc b/docs/aerospace-move-node-to-monitor.adoc index d644b398..6880f0a8 100644 --- a/docs/aerospace-move-node-to-monitor.adoc +++ b/docs/aerospace-move-node-to-monitor.adoc @@ -44,7 +44,7 @@ Move window to monitor in direction relative to the focused monitor (next|prev):: Move window to next|prev monitor in order they appear in tray icon -:: +...:: Find the first monitor pattern in the list that doesn't describe the current monitor and move the window to the appropriate monitor. Monitor pattern is the same as in `workspace-to-monitor-force-assignment` config option diff --git a/docs/aerospace-resize.adoc b/docs/aerospace-resize.adoc index 4f1078ee..4d134eae 100644 --- a/docs/aerospace-resize.adoc +++ b/docs/aerospace-resize.adoc @@ -27,7 +27,7 @@ The dimension to resize is chosen by the first argument it changes height if the parent has vertical orientation * `smart-opposite` does resizes the opposite axis of smart -Second argument controls how much the size is changes +Second argument controls how much the size changes * If the `` is prefixed with `+` then the dimension is increased * If the `` is prefixed with `-` then the dimension is decreased diff --git a/grammar/commands-bnf-grammar.txt b/grammar/commands-bnf-grammar.txt index 4114b4c2..b0173735 100644 --- a/grammar/commands-bnf-grammar.txt +++ b/grammar/commands-bnf-grammar.txt @@ -5,7 +5,9 @@ aerospace --version; aerospace --help; aerospace -h; - ::= balance-sizes + ::= + + balance-sizes [--workspace ] | close [--quit-if-last-window|--window-id ]... -- 2.51.2