diff --git a/waybar/README.md b/waybar/README.md index dcb9d5a..5e5eef3 100644 --- a/waybar/README.md +++ b/waybar/README.md @@ -9,14 +9,18 @@ Waybar Wiki: https://github.com/Alexays/Waybar/wiki ## Create your own theme Please check the configurations of the folders in ~/dotfiles/waybar/themes/ -Create a folder for your theme and add your configuration. A good starting point is to copy the default folder with the default waybar theme. -The main theme folder holds the core config file and stylesheet. -Create subfolders to save variations like in the folder ml4w. -You can include stylesheets from other themes to standardize your themes like in the theme ml4w-bottom. +Create a folder for your theme and add your configuration. +A good starting point is to copy the default folder with the default waybar theme. + +The main theme folder includes the core config file and stylesheet. +Waybar configuration: https://github.com/Alexays/Waybar/wiki/Configuration + +Create subfolders to save variations like in the folder ml4w. You can include stylesheets from other themes to standardize your themes like in the theme ml4w-bottom. ## Stylesheet -The style.css saves the Stylesheet of the theme. +The style.css includes the style file of the theme. +Waybar Styling: https://github.com/Alexays/Waybar/wiki/Styling ## Define theme name diff --git a/waybar/launch.sh b/waybar/launch.sh index d4c5a5a..5fd6bd2 100755 --- a/waybar/launch.sh +++ b/waybar/launch.sh @@ -9,14 +9,18 @@ # ----------------------------------------------------- # ----------------------------------------------------- -# Quit running waybar instances +# Quit all running waybar instances # ----------------------------------------------------- killall waybar # ----------------------------------------------------- -# Get current theme information +# Default theme: /THEMEFOLDER;/VARIATION # ----------------------------------------------------- themestyle="/ml4w;/ml4w/light" + +# ----------------------------------------------------- +# Get current theme information from .cache/.themestyle.sh +# ----------------------------------------------------- if [ -f ~/.cache/.themestyle.sh ]; then themestyle=$(cat ~/.cache/.themestyle.sh) else @@ -32,7 +36,7 @@ if [ ! -f ~/dotfiles/waybar/themes${arrThemes[1]}/style.css ]; then fi # ----------------------------------------------------- -# Loading the configuration based on the username +# Loading the configuration and style file based on the username # ----------------------------------------------------- if [[ $USER = "raabe" ]] then diff --git a/waybar/themeswitcher.sh b/waybar/themeswitcher.sh index 9bfb190..26410e7 100755 --- a/waybar/themeswitcher.sh +++ b/waybar/themeswitcher.sh @@ -8,7 +8,14 @@ # by Stephan Raabe (2023) # ----------------------------------------------------- +# ----------------------------------------------------- +# Default theme folder +# ----------------------------------------------------- themes_path="$HOME/dotfiles/waybar/themes" + +# ----------------------------------------------------- +# Initialize arrays +# ----------------------------------------------------- listThemes="" listNames="" @@ -40,7 +47,7 @@ listNames=${listNames::-2} choice=$(echo -e "$listNames" | rofi -dmenu -config ~/dotfiles/rofi/config-wallpaper.rasi -no-show-icons -width 30 -p "Themes" -format i) # ----------------------------------------------------- -# Set new theme by writing the theme information to ~/.cache +# Set new theme by writing the theme information to ~/.cache/.themestyle.sh # ----------------------------------------------------- if [ "$choice" ]; then echo "${listThemes[$choice+1]}" > ~/.cache/.themestyle.sh