From b7c96907b528e9dadeb2fff2c7bf656ca69ac545 Mon Sep 17 00:00:00 2001 From: Elizabeth Hunt Date: Mon, 27 May 2024 13:57:39 -0700 Subject: [PATCH] add discord and spicetify hooks --- scripts/theme/hooks/background.sh | 5 ++--- scripts/theme/hooks/discord.sh | 10 ++++++++++ scripts/theme/hooks/spicetify.sh | 14 ++++++++++++++ 3 files changed, 26 insertions(+), 3 deletions(-) create mode 100755 scripts/theme/hooks/discord.sh create mode 100755 scripts/theme/hooks/spicetify.sh diff --git a/scripts/theme/hooks/background.sh b/scripts/theme/hooks/background.sh index 1a55c34..67eda21 100755 --- a/scripts/theme/hooks/background.sh +++ b/scripts/theme/hooks/background.sh @@ -3,10 +3,9 @@ NEW_THEME=$2 function wallpaper() { - osascript -e "tell application \"Finder\" to set desktop picture to POSIX file \"$1\"" + /usr/libexec/PlistBuddy -c "set AllSpacesAndDisplays:Desktop:Content:Choices:0:Files:0:relative file:///$1" ~/Library/Application\ Support/com.apple.wallpaper/Store/Index.plist && \ + killall WallpaperAgent } wp=$(find $HOME/Wallpapers/$NEW_THEME/* | shuf -n1) wallpaper $wp - -echo $wp diff --git a/scripts/theme/hooks/discord.sh b/scripts/theme/hooks/discord.sh new file mode 100755 index 0000000..a975f95 --- /dev/null +++ b/scripts/theme/hooks/discord.sh @@ -0,0 +1,10 @@ +#!/bin/bash + +OLD_THEME=$1 +NEW_THEME=$2 + +if [ $NEW_THEME = "dark" ]; then + echo '@import url("https://catppuccin.github.io/discord/dist/catppuccin-mocha.theme.css");' > "$HOME/Library/Application Support/BetterDiscord/data/stable/custom.css" +else + echo '@import url("https://catppuccin.github.io/discord/dist/catppuccin-latte.theme.css");' > "$HOME/Library/Application Support/BetterDiscord/data/stable/custom.css" +fi diff --git a/scripts/theme/hooks/spicetify.sh b/scripts/theme/hooks/spicetify.sh new file mode 100755 index 0000000..bdc00f9 --- /dev/null +++ b/scripts/theme/hooks/spicetify.sh @@ -0,0 +1,14 @@ +#!/bin/bash +# + +NEW_THEME=$2 + +# spicetify config current_theme Ziro + +if [ $NEW_THEME = "dark" ]; then + spicetify config color_scheme purple-dark +else + spicetify config color_scheme purple-light +fi + +spicetify apply