upd: add migration for btop themes

This commit is contained in:
Luca Pattocchio
2025-05-14 17:40:18 +02:00
parent 9253b94262
commit 6daa512ef9

13
migrations/1747237126.sh Normal file
View File

@@ -0,0 +1,13 @@
cp ~/.local/share/omakub/configs/alacritty/btop.toml ~/.config/alacritty/btop.toml
THEME_NAMES=("Tokyo Night" "Catppuccin" "Nord" "Everforest" "Gruvbox" "Kanagawa" "Rose Pine")
THEME=$(gum choose "${THEME_NAMES[@]}" ">> Skip" --header "Choose your current theme" --height 10 | tr '[:upper:]' '[:lower:]' | sed 's/ /-/g')
if [ -n "$THEME" ] && [ "$THEME" != ">>-skip" ]; then
if [ -f "$OMAKUB_PATH/themes/$THEME/btop.theme" ]; then
cp $OMAKUB_PATH/themes/$THEME/btop.theme ~/.config/btop/themes/$THEME.theme
sed -i "s/color_theme = \".*\"/color_theme = \"$THEME\"/g" ~/.config/btop/btop.conf
else
sed -i "s/color_theme = \".*\"/color_theme = \"Default\"/g" ~/.config/btop/btop.conf
fi
fi