Update all dotfiles
This commit is contained in:
58
configs/dotfiles/hyprland/desktop/.config/waybar/launch.sh
Normal file
58
configs/dotfiles/hyprland/desktop/.config/waybar/launch.sh
Normal file
@ -0,0 +1,58 @@
|
||||
#!/bin/bash
|
||||
# ____ _ _ __ __ _
|
||||
# / ___|| |_ __ _ _ __| |_ \ \ / /_ _ _ _| |__ __ _ _ __
|
||||
# \___ \| __/ _` | '__| __| \ \ /\ / / _` | | | | '_ \ / _` | '__|
|
||||
# ___) | || (_| | | | |_ \ V V / (_| | |_| | |_) | (_| | |
|
||||
# |____/ \__\__,_|_| \__| \_/\_/ \__,_|\__, |_.__/ \__,_|_|
|
||||
# |___/
|
||||
# by Stephan Raabe (2023)
|
||||
# -----------------------------------------------------
|
||||
|
||||
# -----------------------------------------------------
|
||||
# Quit all running waybar instances
|
||||
# -----------------------------------------------------
|
||||
killall waybar
|
||||
pkill waybar
|
||||
sleep 0.5
|
||||
|
||||
# -----------------------------------------------------
|
||||
# Default theme: /THEMEFOLDER;/VARIATION
|
||||
# -----------------------------------------------------
|
||||
themestyle="/ml4w;/ml4w/light"
|
||||
|
||||
# -----------------------------------------------------
|
||||
# Get current theme information from ~/.config/ml4w/settings/waybar-theme.sh
|
||||
# -----------------------------------------------------
|
||||
if [ -f ~/.config/ml4w/settings/waybar-theme.sh ]; then
|
||||
themestyle=$(cat ~/.config/ml4w/settings/waybar-theme.sh)
|
||||
else
|
||||
touch ~/.config/ml4w/settings/waybar-theme.sh
|
||||
echo "$themestyle" > ~/.config/ml4w/settings/waybar-theme.sh
|
||||
fi
|
||||
|
||||
IFS=';' read -ra arrThemes <<< "$themestyle"
|
||||
echo ":: Theme: ${arrThemes[0]}"
|
||||
|
||||
if [ ! -f ~/.config/waybar/themes${arrThemes[1]}/style.css ]; then
|
||||
themestyle="/ml4w;/ml4w/light"
|
||||
fi
|
||||
|
||||
# -----------------------------------------------------
|
||||
# Loading the configuration
|
||||
# -----------------------------------------------------
|
||||
config_file="config"
|
||||
style_file="style.css"
|
||||
|
||||
# Standard files can be overwritten with an existing config-custom or style-custom.css
|
||||
if [ -f ~/.config/waybar/themes${arrThemes[0]}/config-custom ] ;then
|
||||
config_file="config-custom"
|
||||
fi
|
||||
if [ -f ~/.config/waybar/themes${arrThemes[1]}/style-custom.css ] ;then
|
||||
style_file="style-custom.css"
|
||||
fi
|
||||
|
||||
# Check if waybar-disabled file exists
|
||||
if [ ! -f $HOME/.cache/waybar-disabled ] ;then
|
||||
waybar -c ~/.config/waybar/themes${arrThemes[0]}/$config_file -s ~/.config/waybar/themes${arrThemes[1]}/$style_file &
|
||||
fi
|
||||
|
Reference in New Issue
Block a user