Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function enable_darkmode() {
- set_darkmode "$1" "no"
- }
- function disable_darkmode() {
- set_darkmode "$1" "yes"
- }
- function set_darkmode() {
- app="$1"
- identifier="$(osascript -e "id of app \"${app}\"")"
- if [[ "${identifier}" == "" ]]; then
- echo "Unknown app: ${app}" >&2
- exit 1
- fi
- osascript -e "tell application \"${app}\" to quit"
- defaults write "${identifier}" NSRequiresAquaSystemAppearance -bool "$2"
- osascript -e "tell application \"${app}\" to activate"
- }
Add Comment
Please, Sign In to add comment