diff --git a/fish/functions/theme.fish b/fish/functions/theme.fish index e41c5b4..879c6e5 100644 --- a/fish/functions/theme.fish +++ b/fish/functions/theme.fish @@ -1,8 +1,14 @@ function theme if test (count $argv) -eq 1 if test "$argv[1]" = "dark" + if command -q osascript + command osascript -e 'tell application "System Events" to set dark mode of appearance preferences to true' + end fish_config theme choose "Catppuccin Frappe" else if test "$argv[1]" = "light" + if command -q osascript + command osascript -e 'tell application "System Events" to set dark mode of appearance preferences to false' + end fish_config theme choose "Catppuccin Latte" else echo "Error: Invalid theme. Use 'dark' or 'light'." >&2