zeitlings Posted May 17, 2023 Posted May 17, 2023 Heads-up Display This is a demo for displaying notifications on a heads-up display in Alfred. I wrote it as part of µBib, but I figured it might be interesting as a standalone. The script takes two arguments: The text to display The width of the prompt You can find it here on Github. giovanni 1
yinan Posted May 17, 2023 Posted May 17, 2023 That's cool, Thanks for making this! I think it is very useful for running your workflows in Do Not Disturb mode when all notifications are muted. zeitlings 1
andy4222 Posted July 14, 2023 Posted July 14, 2023 @zeitlingsthanks for building this as a standalone. Is there a way to speeden it up? It takes a good 3-4 seconds before the display HUD display shows up
zeitlings Posted July 15, 2023 Author Posted July 15, 2023 @andy4222 sure, a compiled version would be faster or, better yet, a background process that doesn't deinitialize everything each time the hud is called
andy4222 Posted July 15, 2023 Posted July 15, 2023 Can I lookup the instructions somewhere to make a compiled version of it?
zeitlings Posted July 19, 2023 Author Posted July 19, 2023 @andy4222 The recommended way is to use SPM (Swift Package Manager). However, I quickly tested a minimal-effort approach that works. You can compile the script as is without changing anything about the code. Navigate to HUD.swift with your terminal (or open the Workflow in Alfred, double-click any of the two objects, then click the little folder icon in the bottom left corner to open the location, select HUD.swift and send it to Alfred’s Universal Action (opt+cmd+#). From the options, choose “Open Terminal Here”. In the terminal that opens paste and run this to create the executable at the same location. swiftc -O HUD.swift In the workflow, open the "Run Script" object and replace ./HUD.swift "$1" 250 with ./HUD "$1" 250 Voilà. andy4222 1
zeitlings Posted July 19, 2023 Author Posted July 19, 2023 Or better yet, just replace the contents of the "Run Script" object with this: [[ -f ./HUD ]] || eval $(swiftc -O ./HUD.swift) ./HUD "$1" 250 If the executable does not exist yet, it will be created and then called. andy4222 1
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now