swift-sh
SwiftBar
Our great sponsors
swift-sh | SwiftBar | |
---|---|---|
4 | 18 | |
1,771 | 2,672 | |
- | 4.5% | |
2.9 | 6.9 | |
2 months ago | 30 days ago | |
Swift | Swift | |
The Unlicense | MIT License |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
swift-sh
- Ask HN: Share a shell script you like
-
Using Swift for Scripting
Yes, swift CLI will compile and run your swift file.
But many people also want to use libraries. For Python, they use the system libraries or work within an environment with installed libraries (i.e., the library-install process happens at environment-configuration time).
In Swift, the easiest way to consume libraries is using packages, but that requires a Package.swift declaring the project scope for the script file (which must comply with top-level and main-entrypoint code requirements).
The easiest way to do that when scripting is a swift tool that manages the process of gathering your library dependencies, auto-generating a project, building the tool, and caching it all so there's no overhead the next time.
The best available tool now is https://github.com/mxcl/swift-sh. It reads dependency information off import comments.
It can also generate the project for you, if/when you want to build in XCode (e.g., move into a more complex application, perhaps requiring sandbox declarations).
Working scripts are not always updated, so any script-build tool has to maintain backwards compatibility, but the swift package manager has changed a lot in recent versions. swift-sh seems to err on the side of backwards compatibility, and does not support e.g., the most recent dependency versioning styles.
Swift-forum discussions about better support for scripting haven't resulted in any official tooling.
- On Env Shebangs
-
Did anyone tried to run swift on raspberry pi before? I managed to install swift on my raspberry pi and print hello wold. Butbwhen i tried to do the same after 10 seconds it didnt work. Any idea why it didn’t print? DispatchQueue.main.asyncAfter(deadline: .now() + 10) { print(“Hello world”) }
Note that this has nothing to do with the Raspberry Pi. You'll have the same issue running on the command-line. If you wish to test your programs on your computer where you have more tools and horse-power, I find swift-sh gives a good command-line experience and is a great alternative to Playgrounds especially for small tests.
SwiftBar
- Show HN: SwiftBar 2.0 Powerful macOS menu bar customization tool
-
Monitoring menu bar icons (terminal, plist, etc)?
I don't know if this supports your use case, but look into SwiftBar. https://github.com/swiftbar/SwiftBar
- Mac app to display JSON data in menu bar?
-
Bug Fixes or Alternatives?
I’m in a similar boat. Only one external monitor on an M1 Studio. Every time I restart, GeekTool cannot find the monitor, so I have to manually move all 10 of my geeklets to the main monitor. I looked into moving them via script, but was unsuccessful because the monitor id was inexplicably not identical on geektool’s side between launches (I gather this is a known issue from the developer). Sadly, I have been unable to find an app that sufficiently replicates GeekTools functionality. That being said, I have moved some of my scripts to SwiftBar where they are accessible via the menu bar instead of displayed on the desktop. Works fine for simple text stuff, but not my more graphical calendar. I’m saving this post though, because I still want a true fix/replacement for GeekTool.
- What are the not-so-obvious tools that you don't want to miss?
- A curated directory of 700 Mac menu bar apps
-
Apps that should be paid, but are not (Part 3)
https://github.com/swiftbar/SwiftBar - Powerful macOS menu bar customization tool
-
Quick check of gateway metrics - MacOS only
As many of you, I obsess over the current metrics of my TMHI modem. Opening the app to check it is too cumbersome. On MacOS there is a cool free utility that allows simple scripts to run in the menu called SwiftBar (get it here: https://github.com/swiftbar/SwiftBar )
-
Looking for an app that sits in the menu bar. When I click it, it pops up a window with my custom text and in my custom styling. Does this exist?
Maybe swiftbar?
-
Is there a way to turn the menu bar into one long scrolling stock ticker?
I am sure you could create a stock ticker with SwiftBar https://swiftbar.app. SwiftBar has plugins which write to the menubar using shell scripts. And there are already some stock ticker plugins - I am sure you could modify one of them to meet your needs.
What are some alternatives?
resholve - a shell resolver? :) (find and resolve shell script dependencies)
bitbar - Put the output from any script or program into your macOS Menu Bar (the BitBar reboot)
stderred - stderr in red
DevUtils-app - All-in-one Toolbox for Developers. Native macOS app.
spellbook - 🪄 Shell and Powershell scripts registry
xbar - An tiny XCB information bar.
Alamofire - Elegant HTTP Networking in Swift
tldr - 📚 Collaborative cheatsheets for console commands
fuz - Fuzzy search text / notes in the terminal, for any collection of text files
finicky - A macOS app for customizing which browser to start
dotfiles
awesome-appwrite - Carefully curated list of awesome Appwrite resources 💪