sunhat/bin/omakub-theme

24 lines
918 B
Plaintext
Raw Normal View History

2024-05-27 18:46:33 -05:00
#!/bin/bash
set -e
# Pick a preconfigured theme
2024-06-03 14:58:45 -05:00
THEME=$(gum choose "Tokyo Night" "Gruvbox" "Catppuccin" | tr '[:upper:]' '[:lower:]' | sed 's/ /-/g')
2024-06-03 15:26:40 -05:00
# Install theme in Gnome, Terminal, and both default editors
2024-06-03 14:58:45 -05:00
source $OMAKUB_PATH/themes/gnome/$THEME.sh
cp $OMAKUB_PATH/themes/alacritty/$THEME.toml ~/.config/alacritty/theme.toml
2024-06-03 15:26:40 -05:00
cp $OMAKUB_PATH/themes/neovim/$THEME.lua ~/.config/nvim/lua/plugins/theme.lua
sed -i "s/theme \".*\"/theme \"$THEME\"/g" ~/.config/zellij/config.kdl
# Translate to specific VSC theme name
if [ "$THEME" == "gruvbox" ]; then
VSC_THEME="Gruvbox Dark Medium"
elif [ "$THEME" == "catppuccin" ]; then
2024-06-03 15:49:31 -05:00
VSC_THEME="Catppuccin Macchiato"
2024-06-03 15:49:44 -05:00
elif [ "$THEME" == "tokyo-night" ]; then
VSC_THEME="Tokyo Night"
2024-06-03 15:26:40 -05:00
fi
sed -i "s/\"workbench.colorTheme\": \".*\"/\"workbench.colorTheme\": \"$VSC_THEME\"/g" ~/.config/Code/User/settings.json
2024-06-03 14:58:45 -05:00
2024-06-03 15:26:40 -05:00
echo "Restart your terminal and editor if theme hasn't changed"