forked from raycast/script-commands
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdnd-off.sh
executable file
·38 lines (28 loc) · 999 Bytes
/
dnd-off.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#!/bin/bash
# Dependency: do-not-disturb-cli (https://github.com/sindresorhus/do-not-disturb-cli)
# Install via npm: `npm install --global do-not-disturb-cli`
## Contributions welcome for a reliable, dependency-free version.
# @raycast.title Turn Off Do Not Disturb
# @raycast.author Caleb Stauffer
# @raycast.authorURL https://github.com/crstauf
# @raycast.description Turn off "do not disturb" mode. Does [not work on Big Sur](https://github.com/sindresorhus/do-not-disturb-cli/issues/2).
# @raycast.icon 😴
# @raycast.mode silent
# @raycast.packageName System
# @raycast.schemaVersion 1
if ! command -v do-not-disturb &> /dev/null; then
echo "do-not-disturb-cli is required (https://github.com/sindresorhus/do-not-disturb-cli).";
exit 1;
fi
status=$(do-not-disturb status)
if [[ $status = "off" ]]; then
echo "DND already off"
exit 0
fi
do-not-disturb off
status=$(do-not-disturb status)
if [[ $status = "off" ]]; then
echo "Turned DND off"
else
echo "Unable to turn DND off"
fi