dotfiles/waybar/launch.sh
2023-10-22 16:37:59 +02:00

26 lines
723 B
Bash
Executable File

#!/bin/sh
# Quit all running waybar instances
killall waybar
# Default theme: /THEMEFOLDER;/VARIATION
themestyle="/ml4w;/ml4w/light"
# Get current theme information from .cache/waybar.themestyle
if [ -f ~/.cache/waybar.themestyle ]; then
themestyle=$(cat ~/.cache/waybar.themestyle)
else
touch ~/.cache/waybar.themestyle
echo "$themestyle" > ~/.cache/waybar.themestyle
fi
IFS=';' read -ra arrThemes <<< "$themestyle"
echo ${arrThemes[0]}
if [ ! -f ~/dotfiles/waybar/themes${arrThemes[1]}/style.css ]; then
themestyle="/ml4w;/ml4w/light"
fi
# Loading the configuration and style file based
waybar -c ~/dotfiles/waybar/themes${arrThemes[0]}/config -s ~/dotfiles/waybar/themes${arrThemes[1]}/style.css &