You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Thanks for making this. I'm using AnyBar to show the status of some of my Hammerspoon functions [Lua for mac automation], but I'm having trouble identifying when AnyBar is open or closed. I end up launching duplicate processes or not having a process open. How does everyone else deal with those issues?
But in trying to write my question I think I found a couple of ways to solve this:
# A port known to be open returns a line of text
$ sudo nmap -sU -p 1740 $(ipconfig getifaddr en0)| grep open
1740/udp *open*|filtered encore
# While a closed port returns no text
$ sudo nmap -sU -p 9999 $(ipconfig getifaddr en0)| grep open
But this method can be prone to false positives. Alternatively, I launch a set number of AnyBar icons, so I can make sure they are open by counting the number of lines returned from the process list (the [ ] idea was from stackoverflow):
$ ps aux | grep -i '[a]nybar'
kyleking 9728 0.0 0.1 2579936 13844 ?? S 10:54AM 0:00.15 /opt/homebrew-cask/Caskroom/anybar/0.1.3/AnyBar.app/Contents/MacOS/AnyBar
kyleking 9726 0.0 0.1 2579936 14020 ?? S 10:54AM 0:00.16 /opt/homebrew-cask/Caskroom/anybar/0.1.3/AnyBar.app/Contents/MacOS/AnyBar
kyleking 9567 0.0 0.1 2579936 14220 ?? S 10:51AM 0:00.33 /opt/homebrew-cask/Caskroom/anybar/0.1.3/AnyBar.app/Contents/MacOS/AnyBar
Then to quit the app from a shell prompt, I'm just using:
sudo kill$(ps aux | grep -i '[a]nybar'| awk '{print $2}')
Is there a way to build something like this in Applescript or built-in to AnyBar?
The text was updated successfully, but these errors were encountered:
I think this is a problem that cannot be addressed by Anybar internally, because, well, it might be not running at all when you need to test it. Hence, this should be solved by external tools. ps approach seems ok to me. Do you have any particular issues with it?
Thanks for making this. I'm using AnyBar to show the status of some of my Hammerspoon functions [Lua for mac automation], but I'm having trouble identifying when AnyBar is open or closed. I end up launching duplicate processes or not having a process open. How does everyone else deal with those issues?
But in trying to write my question I think I found a couple of ways to solve this:
But this method can be prone to false positives. Alternatively, I launch a set number of AnyBar icons, so I can make sure they are open by counting the number of lines returned from the process list (the [ ] idea was from stackoverflow):
Then to quit the app from a shell prompt, I'm just using:
Is there a way to build something like this in Applescript or built-in to AnyBar?
The text was updated successfully, but these errors were encountered: