Add theme-set/switching logic, and minor nvim, tmux, obsidian changes
This commit is contained in:
32
theme_config.sh
Executable file
32
theme_config.sh
Executable file
@@ -0,0 +1,32 @@
|
||||
#!/bin/zsh
|
||||
|
||||
sym_link() {
|
||||
[[ ! -e "$1" ]] && echo "skipping link, target does not exist: $1" && return
|
||||
[[ -h "$2" ]] && rm $2
|
||||
[[ -f "$2" || -d "$2" ]] && rm -rf $2
|
||||
ln -s $1 $2
|
||||
}
|
||||
|
||||
echo "---- configuring themes ----------------"
|
||||
source src_files/.config/zsh/.zshenv
|
||||
|
||||
# merge in the theme-files from Omarchy which i want to use
|
||||
omarchy_themes=(`find src_files/imports/themes-omarchy -mindepth 1 -maxdepth 1 -type d`)
|
||||
for dir in $omarchy_themes; do
|
||||
target_theme_dir="$DIR_THEME_SETTINGS/$(basename $dir)"
|
||||
[[ ! -d "$target_theme_dir/wallpaper" ]] && mkdir -p "$target_theme_dir/wallpaper"
|
||||
dir_theme_files=(`find $dir -mindepth 1 -maxdepth 1 -type f`)
|
||||
for f in $dir_theme_files; do cp -RPp $f $target_theme_dir/; done
|
||||
[[ -d "$dir/backgrounds" ]] && cp -RPp $dir/backgrounds/* $target_theme_dir/wallpaper/
|
||||
done
|
||||
|
||||
# set links for theme-switching and set default theme
|
||||
default_theme="tokyodark"
|
||||
sym_link $DIR_THEME_SETTINGS/$default_theme $DIR_THEME_SETTINGS/.current-theme
|
||||
sym_link $DIR_THEME_SETTINGS/.current-theme/kitty.conf $XDG_CONFIG_HOME/kitty/theme.conf
|
||||
sym_link $DIR_THEME_SETTINGS/.current-theme/tmux.conf $XDG_CONFIG_HOME/tmux/theme.conf
|
||||
sym_link $DIR_THEME_SETTINGS/.current-theme/neovim.lua $XDG_CONFIG_HOME/nvim/current-theme
|
||||
sym_link $DIR_THEME_SETTINGS/.current-theme/btop.theme $XDG_CONFIG_HOME/btop/themes/theme.theme
|
||||
# TODO: finish theme work, set needed links per theme-set script
|
||||
$DIR_SCRIPTS/theme-set $default_theme
|
||||
|
||||
Reference in New Issue
Block a user