]> git.r.bdr.sh - rbdr/r.bdr.sh/blame - swiftbar_scripts.gmi
Add the path
[rbdr/r.bdr.sh] / swiftbar_scripts.gmi
CommitLineData
aecb2ec8
RBR
1--- title: swiftbar_scripts.html
2--- description: Assorted SwiftBar scripts and utilities I've built.
a141dd00
RBR
3## SwiftBar Scripts
4
5This page holds the SwiftBar[1] / xbar scripts I've made. Since I use the first
6one, I'm not sure whether they work with xbar[2], but should probably be OK.
7
8=> https://swiftbar.app/ [1] SwiftBar
9=> https://xbarapp.com/ [2] Xbar
10
c3ab1ed4 11## Sourcehut Builds
a141dd00 12
4356e493 13View 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.
a141dd00 14
74c706a6
RBR
15### Dependencies
16
17You must have jq and curl installed.
18
19### Usage
20
4356e493 21To 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)
a141dd00 22
74c706a6
RBR
23### Focus Checks
24
9fb7fa10
RBR
25This script includes focus checks (See focus checks column at the end of this page on how to use them.)
26
3c99b126 27=> ./swiftbar/sourcehut-builds.1m.sh ⧇ ./swiftbar/sourcehut-builds.1m.sh
5564aa18
RBR
28
29## Monitorcito Bar
30
4356e493 31View 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.
5564aa18 32
74c706a6
RBR
33### Dependencies
34
35You must have jq and curl installed.
36
37### Usage
38
39You can control the URL of the monitorcito instance by adjusting VAR_MONITORCITO_URL
40
41### Focus Checks
42
9fb7fa10
RBR
43This script includes focus checks (See focus checks column at the end of this page on how to use them.)
44
c2d8b058 45=> https://git.sr.ht/~rbdr/monitorcito [3] Monitorcito
3c99b126 46=> ./swiftbar/monitorcito.1m.sh ⧇ ./swiftbar/monitorcito.1m.sh
9fb7fa10
RBR
47
48## Focus Checks
49
74c706a6
RBR
50This is a utility that allows other scripts to conditionally run or halt based on which focus mode is enabled.
51
52### Dependencies
53
54You must have jq installed .
55
9fb7fa10
RBR
56### Usage
57
74c706a6 58To 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:
9fb7fa10
RBR
59
60```
61VAR_RUN_ON_FOCUS="Personal|Do Not Disturb"
62```
63
64And this will halt the script only if the focus is Work
65
66```
67VAR_HALT_ON_FOCUS="Work"
68```
69
70If neither variable is set, then all checks will be disabled.
71
7de2480b 72The script will only appear or disappear when it's next refreshed. If you want this faster, trigger a full refresh of your plugins.
aa2e4e1b 73
9fb7fa10
RBR
74### Setup
75
76Download and copy focus.utils.sh to your SwiftBar directory on the same directory as the scripts that use this functionality.
77
78### Permissions
79
ddcea706 80For 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.
9fb7fa10
RBR
81
82### For Developers
83
ddcea706 84If you want to include this functionality in your script, check the script comments for instructions on how to use it in your scripts.
9fb7fa10 85
3c99b126 86=> ./swiftbar/focus.utils.sh ⧇ ./swiftbar/focus.utils.sh