1 --- title: swiftbar_scripts.html
2 --- description: Assorted SwiftBar scripts and utilities I've built.
5 This page holds the SwiftBar[1] scripts I've made, including some utilities to
8 => https://swiftbar.app/ [1] SwiftBar
10 ### Xbar Compatibility
12 The scripts aren't built with xbar[2] in mind, so some things will be broken:
14 - It uses SF Symbols, so instead of icons you'll see things like :circle:. These should be easily replaceable with other characters.
15 - Some attributes that are present in swiftbar (eg. tooltip=) will break xbar.
16 They should be safe to remove.
18 => https://xbarapp.com/ [2] Xbar
22 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.
26 You must have jq and curl installed.
30 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)
34 This script includes focus checks (See focus checks column at the end of this page on how to use them.)
36 => ./swiftbar/sourcehut-builds.1m.sh ⧇ ./swiftbar/sourcehut-builds.1m.sh
40 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.
44 You must have jq and curl installed.
48 You can control the URL of the monitorcito instance by adjusting VAR_MONITORCITO_URL
52 This script includes focus checks (See focus checks column at the end of this page on how to use them.)
54 => https://git.sr.ht/~rbdr/monitorcito [3] Monitorcito
55 => ./swiftbar/monitorcito.1m.sh ⧇ ./swiftbar/monitorcito.1m.sh
59 This is a utility that allows other scripts to conditionally run or halt based on which focus mode is enabled.
63 You must have jq installed .
67 To enable the focus checks, you need to pass 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:
70 VAR_RUN_ON_FOCUS="Personal|Do Not Disturb"
73 And this will halt the script only if the focus is Work
76 VAR_HALT_ON_FOCUS="Work"
79 If neither variable is set, then all checks will be disabled.
81 The script will only appear or disappear when it's next refreshed. If you want this faster, trigger a full refresh of your plugins.
85 Download and copy focus.utils.sh to your SwiftBar directory on the same directory as the scripts that use this functionality.
89 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.
93 If you want to include this functionality in your script, check the script comments for instructions on how to use it in your scripts.
95 => ./swiftbar/focus.utils.sh ⧇ ./swiftbar/focus.utils.sh