## SwiftBar Scripts This page holds the SwiftBar[1] / xbar scripts I've made. Since I use the first one, I'm not sure whether they work with xbar[2], but should probably be OK. => https://swiftbar.app/ [1] SwiftBar => https://xbarapp.com/ [2] Xbar ## Sourcehut Builds View the status of your last few builds in sourcehut. You can open the URL by clicking on the menu items. The count of failed, pending and successful runs of the last 15m are shown next to the icon. To use the plugin you'll need to set your sourcehut token in the VAR_SOURCEHUT_API_TOKEN variable (See the 'ADD YOUR TOKEN HERE' string). You can also control how many builds to show by changing the VAR_BUILD_COUNT variable (defaults to 5) This script includes focus checks (See focus checks column at the end of this page on how to use them.) => ./swiftbar/sourcehut-builds.1m.sh ⧇ source ## Monitorcito Bar View your monitorcito[3] tracked services at a glance. ○ is shown if everything is OK, and ╳ if at least one service is failing. Clicking on an item refreshes the status. This script includes focus checks (See focus checks column at the end of this page on how to use them.) => https://git.sr.ht/~rbdr/monitorcito [3] Monitorcito => ./swiftbar/monitorcito.1m.sh ⧇ source ## Focus Checks ### Usage You can ask a script to only continue if it matches a focus mode, or to halt if it encounters it. You can do this by passing pipe separated strings to VAR_RUN_ON_FOCUS or VAR_HALT_ON_FOCUS. For example, this will only run the script if "Personal" or "Do Not Disturb" are active: ``` VAR_RUN_ON_FOCUS="Personal|Do Not Disturb" ``` And this will halt the script only if the focus is Work ``` VAR_HALT_ON_FOCUS="Work" ``` If neither variable is set, then all checks will be disabled. ### Setup Download and copy focus.utils.sh to your SwiftBar directory on the same directory as the scripts that use this functionality. ### Permissions For the script to correctly get focus data, it requires full disk access. You can do this by going to System Settings > Privacy & Security > Full Disk Access, and adding SwiftBar to the list. ### For Developers If you want to include this functionality in your script, check the script comments for instructions on how to use it in your scripts. => ./swiftbar/focus.utils.sh ⧇ source