Hyprland-dotfiles/waybar/launch.sh

55 lines
2.0 KiB
Bash
Raw Normal View History

2023-12-03 11:50:14 -05:00
#!/bin/bash
2023-08-28 07:33:53 -04:00
# ____ _ _ __ __ _
# / ___|| |_ __ _ _ __| |_ \ \ / /_ _ _ _| |__ __ _ _ __
# \___ \| __/ _` | '__| __| \ \ /\ / / _` | | | | '_ \ / _` | '__|
# ___) | || (_| | | | |_ \ V V / (_| | |_| | |_) | (_| | |
# |____/ \__\__,_|_| \__| \_/\_/ \__,_|\__, |_.__/ \__,_|_|
# |___/
# by Stephan Raabe (2023)
# -----------------------------------------------------
# -----------------------------------------------------
2023-10-18 10:15:52 -04:00
# Quit all running waybar instances
2023-08-28 07:33:53 -04:00
# -----------------------------------------------------
killall waybar
2024-01-11 10:03:36 -05:00
pkill waybar
2023-11-10 16:12:15 -05:00
sleep 0.2
2024-01-11 10:03:36 -05:00
2023-10-09 09:50:47 -04:00
# -----------------------------------------------------
2023-10-18 10:15:52 -04:00
# Default theme: /THEMEFOLDER;/VARIATION
2023-10-09 09:50:47 -04:00
# -----------------------------------------------------
2023-10-09 11:27:03 -04:00
themestyle="/ml4w;/ml4w/light"
2023-10-18 10:15:52 -04:00
# -----------------------------------------------------
# Get current theme information from .cache/.themestyle.sh
# -----------------------------------------------------
2023-10-09 09:50:47 -04:00
if [ -f ~/.cache/.themestyle.sh ]; then
themestyle=$(cat ~/.cache/.themestyle.sh)
else
touch ~/.cache/.themestyle.sh
echo "$themestyle" > ~/.cache/.themestyle.sh
fi
2023-10-09 11:27:03 -04:00
IFS=';' read -ra arrThemes <<< "$themestyle"
2024-01-11 10:03:36 -05:00
echo "Theme: ${arrThemes[0]}"
2023-10-09 11:27:03 -04:00
2023-10-09 13:54:14 -04:00
if [ ! -f ~/dotfiles/waybar/themes${arrThemes[1]}/style.css ]; then
2023-10-09 11:27:03 -04:00
themestyle="/ml4w;/ml4w/light"
2023-10-09 09:50:47 -04:00
fi
2023-08-28 07:33:53 -04:00
# -----------------------------------------------------
2023-11-10 16:12:15 -05:00
# Loading the configuration
2023-08-28 07:33:53 -04:00
# -----------------------------------------------------
config_file="config"
style_file="style.css"
# Standard files can be overwritten with an existing config-custom or style-custom.css
if [ -f ~/dotfiles/waybar/themes${arrThemes[0]}/config-custom ] ;then
config_file="config-custom"
fi
if [ -f ~/dotfiles/waybar/themes${arrThemes[1]}/style-custom.css ] ;then
style_file="style-custom.css"
fi
2023-12-18 15:57:32 -05:00
waybar -c ~/dotfiles/waybar/themes${arrThemes[0]}/$config_file -s ~/dotfiles/waybar/themes${arrThemes[1]}/$style_file &