franciscolourenco / done

A fish-shell package to automatically receive notifications when long processes finish.
MIT License
766 stars 70 forks source link

Not working on macOS 14.0 #139

Closed jie17 closed 9 months ago

jie17 commented 9 months ago

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 commented 9 months ago

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 commented 9 months ago

@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 commented 9 months ago

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 commented 9 months ago

@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 commented 9 months ago

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 commented 9 months ago

Fixed in v1.17.1