Skip to content
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

Not working on macOS 14.0 #139

Closed
jie17 opened this issue Sep 29, 2023 · 6 comments
Closed

Not working on macOS 14.0 #139

jie17 opened this issue Sep 29, 2023 · 6 comments

Comments

@jie17
Copy link

jie17 commented Sep 29, 2023

I'm not sure if the specs of lsappinfo has changed or not.
However, in macOS 14.0, lsappinfo front returns something like ASN:0x0-14b14b:.
To get the bundle id, the command should be lsappinfo info -only bundleId 0x14b14b | cut -d '"' -f4.
lsappinfo info -only bundleID (lsappinfo front) | cut -d '"' -f4 is not working.

@franciscolourenco
Copy link
Owner

In macOS 13, lsappinfo front returns something like ASN:0x0-14b14b: as well.
What might have changed is what lsappinfo info -only bundleID (lsappinfo front) returns.
@jie17 could you try that and share? Thanks!

@franciscolourenco
Copy link
Owner

franciscolourenco commented Sep 29, 2023

@jie17 I've just tested done on macOS 14.0 and both done and the command seem to be working properly. Any ideas?

image

@kidonng
Copy link
Contributor

kidonng commented Sep 30, 2023

I'm having the same issue on macOS 14.0 (23A344).

What might have changed is what lsappinfo info -only bundleID (lsappinfo front) returns.

This gives empty result on my machine. In fact lsappinfo info <ASN> doesn't work at all (lsappinfo info <name> still works though).

EDIT: after reading the discussion again I found this works:

diff --git a/conf.d/done.fish b/conf.d/done.fish
index 7a6cc23..d455fad 100644
--- a/conf.d/done.fish
+++ b/conf.d/done.fish
@@ -78,7 +78,7 @@ end
 
 function __done_get_focused_window_id
     if type -q lsappinfo
-        lsappinfo info -only bundleID (lsappinfo front) | cut -d '"' -f4
+        lsappinfo info -only bundleID (lsappinfo front | string replace ASN:0x0- 0x) | cut -d '"' -f4
     else if test -n "$SWAYSOCK"
         and type -q jq
         swaymsg --type get_tree | jq '.. | objects | select(.focused == true) | .id'

@franciscolourenco
Copy link
Owner

@kidonng your proposal works in macOS 13, so we could possibly go with that. I wonder if all apps start with the 0x0 prefix though. Could you try the following two variants and let me know if any of them work?
I would test them myself, but in my VM, the original command is working correctly.

lsappinfo info -only bundleID -long (lsappinfo front) | cut -d '"' -f4
lsappinfo info -only bundleID -app (lsappinfo front) | cut -d '"' -f4

Thanks!

@jie17
Copy link
Author

jie17 commented Oct 2, 2023

lsappinfo info -only bundleID -long (lsappinfo front) | cut -d '"' -f4

lsappinfo info -only bundleID -app (lsappinfo front) | cut -d '"' -f4

Both commands return nothing in my environment.

Also, by callinglsappinfo processList, I found that all apps start with 0x0:0x, and then followed by 5 or 6 hex digits.

@franciscolourenco
Copy link
Owner

Fixed in v1.17.1

huafu pushed a commit to huafu/done that referenced this issue Oct 22, 2023
This version was tested in macOS 13 and 14.

Fixes franciscolourenco#139
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants