get_macos_appearance <- function() {
system("defaults read -g AppleInterfaceStyle 2>/dev/null || echo 'Light'")
}
macos_toggle_dark_mode <- function() {
system(
'osascript -e \'tell application "System Events" to tell appearance preferences to set dark mode to not dark mode\''
)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.