Browse Source

Add new mac scripts

clean-shoes
ViViDboarder 2 weeks ago
parent
commit
22d70c6a98
  1. 6
      assets/default/mac-bin/dnd_mode_activate
  2. 6
      assets/default/mac-bin/dnd_mode_deactivate
  3. 3
      assets/default/mac-bin/is_dark_mode
  4. 9
      assets/default/mac-bin/is_dnd_mode

6
assets/default/mac-bin/dnd_mode_activate

@ -0,0 +1,6 @@
#! /bin/bash
defaults -currentHost write ~/Library/Preferences/ByHost/com.apple.notificationcenterui doNotDisturb -bool true
defaults -currentHost write ~/Library/Preferences/ByHost/com.apple.notificationcenterui doNotDisturbDate -date "$(date)"
killall NotificationCenter

6
assets/default/mac-bin/dnd_mode_deactivate

@ -0,0 +1,6 @@
#! /bin/bash
defaults -currentHost write ~/Library/Preferences/ByHost/com.apple.notificationcenterui doNotDisturb -bool false
defaults -currentHost delete ~/Library/Preferences/ByHost/com.apple.notificationcenterui doNotDisturbDate
killall NotificationCenter

3
assets/default/mac-bin/is_dark_mode

@ -0,0 +1,3 @@
#! /bin/bash
defaults read -g AppleInterfaceStyle &>/dev/null

9
assets/default/mac-bin/is_dnd_mode

@ -0,0 +1,9 @@
#! /bin/bash
# if plutil -extract doNotDisturbDate xml1 -o - ~/Library/Preferences/ByHost/com.apple.notificationcenterui.*.plist &> /dev/null; then
if [ "$(defaults -currentHost read ~/Library/Preferences/ByHost/com.apple.notificationcenterui doNotDisturb)" == "1" ]; then
echo "Yes"
else
echo "No"
exit 1
fi
Loading…
Cancel
Save