Add theme-set/switching logic, and minor nvim, tmux, obsidian changes

This commit is contained in:
2025-10-30 00:03:39 -05:00
parent f8bb7bbf03
commit 833d222e22
54 changed files with 711 additions and 159 deletions

View File

@@ -0,0 +1,26 @@
#!/bin/zsh
set_wallpaper_linux() {
echo "TODO: theme_update_wallpaper_linux not yet implemented"
}
set_wallpaper_macos() {
# after back and forth with gpt and failing approaches, landing on this swift snippet
swift <(cat << NESTED_SWIFT_BLOCK
import AppKit
let url = URL(fileURLWithPath: "$1")
try NSWorkspace.shared.setDesktopImageURL(url, for: NSScreen.main!, options: [:])
NESTED_SWIFT_BLOCK
)
}
# TODO: decide if and how to make this work for cycling through wallpapers per theme
wallpaper_dir=$DIR_THEME_SETTINGS/.current-theme/wallpaper
image_paths=($(find $wallpaper_dir -type f | sort)) 2> /dev/null
target_wallpaper=${image_paths[@]:0:1}
[[ -z $target_wallpaper ]] && exit 0
[[ "$OSTYPE" = *"darwin"* ]] && set_wallpaper_macos $target_wallpaper ||
set_wallpaper_linux $target_wallpaper