Add Waybar Theme switcher

This commit is contained in:
Stephan Raabe
2023-10-09 15:50:47 +02:00
parent e272300293
commit f2cbab620f
7 changed files with 138 additions and 65 deletions

View File

@@ -13,12 +13,26 @@
# -----------------------------------------------------
killall waybar
# -----------------------------------------------------
# Get current theme information
# -----------------------------------------------------
themestyle="/default/light"
if [ -f ~/.cache/.themestyle.sh ]; then
themestyle=$(cat ~/.cache/.themestyle.sh)
else
touch ~/.cache/.themestyle.sh
echo "$themestyle" > ~/.cache/.themestyle.sh
fi
if [ ! -f ~/dotfiles/waybar/styles$themestyle/style.css ]; then
themestyle="/default/light"
fi
# -----------------------------------------------------
# Loading the configuration based on the username
# -----------------------------------------------------
if [[ $USER = "raabe" ]]
then
waybar -c ~/dotfiles/waybar/myconfig & -s ~/dotfiles/waybar/style.css
waybar -c ~/dotfiles/waybar/myconfig -s ~/dotfiles/waybar/styles$themestyle/style.css &
else
waybar &
waybar -s ~/dotfiles/waybar/styles$themestyle/style.css &
fi