Add config files to waybar themes
This commit is contained in:
parent
e7c3802003
commit
e30643d4bb
2
waybar/themes/default/config.sh
Normal file
2
waybar/themes/default/config.sh
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
#!/bin/bash
|
||||||
|
theme_name="Default"
|
2
waybar/themes/ml4w-bottom/dark/config.sh
Normal file
2
waybar/themes/ml4w-bottom/dark/config.sh
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
#!/bin/bash
|
||||||
|
theme_name="ML4W Dark Bottom"
|
2
waybar/themes/ml4w-bottom/light/config.sh
Normal file
2
waybar/themes/ml4w-bottom/light/config.sh
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
#!/bin/bash
|
||||||
|
theme_name="ML4W Light Bottom"
|
2
waybar/themes/ml4w-bottom/mixed/config.sh
Normal file
2
waybar/themes/ml4w-bottom/mixed/config.sh
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
#!/bin/bash
|
||||||
|
theme_name="ML4W Mixed Bottom"
|
2
waybar/themes/ml4w/dark/config.sh
Normal file
2
waybar/themes/ml4w/dark/config.sh
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
#!/bin/bash
|
||||||
|
theme_name="ML4W Dark"
|
2
waybar/themes/ml4w/light/config.sh
Normal file
2
waybar/themes/ml4w/light/config.sh
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
#!/bin/bash
|
||||||
|
theme_name="ML4W Light"
|
2
waybar/themes/ml4w/mixed/config.sh
Normal file
2
waybar/themes/ml4w/mixed/config.sh
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
#!/bin/bash
|
||||||
|
theme_name="ML4W Mixed"
|
|
@ -1,22 +1,48 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
options=$(find ~/dotfiles/waybar/themes/ -maxdepth 2 -type d)
|
# _____ _ _ _ _
|
||||||
|
# |_ _| |__ ___ _ __ ___ ___ _____ _(_) |_ ___| |__ ___ _ __
|
||||||
|
# | | | '_ \ / _ \ '_ ` _ \ / _ \/ __\ \ /\ / / | __/ __| '_ \ / _ \ '__|
|
||||||
|
# | | | | | | __/ | | | | | __/\__ \\ V V /| | || (__| | | | __/ |
|
||||||
|
# |_| |_| |_|\___|_| |_| |_|\___||___/ \_/\_/ |_|\__\___|_| |_|\___|_|
|
||||||
|
#
|
||||||
|
# by Stephan Raabe (2023)
|
||||||
|
# -----------------------------------------------------
|
||||||
|
|
||||||
|
themes_path="$HOME/dotfiles/waybar/themes"
|
||||||
listThemes=""
|
listThemes=""
|
||||||
|
listNames=""
|
||||||
|
|
||||||
|
# -----------------------------------------------------
|
||||||
|
# Read theme folder
|
||||||
|
# -----------------------------------------------------
|
||||||
|
options=$(find $themes_path -maxdepth 2 -type d)
|
||||||
for value in $options
|
for value in $options
|
||||||
do
|
do
|
||||||
if [ ! $value == "$HOME/dotfiles/waybar/themes/" ]; then
|
if [ ! $value == "$themes_path" ]; then
|
||||||
if [ $(find $value -maxdepth 1 -type d | wc -l) = 1 ]; then
|
if [ $(find $value -maxdepth 1 -type d | wc -l) = 1 ]; then
|
||||||
result=$(echo $value | sed "s#$HOME/dotfiles/waybar/themes/#/#g")
|
result=$(echo $value | sed "s#$HOME/dotfiles/waybar/themes/#/#g")
|
||||||
IFS='/' read -ra arrThemes <<< "$result"
|
IFS='/' read -ra arrThemes <<< "$result"
|
||||||
echo $arrThemes
|
listThemes[${#listThemes[@]}]="/${arrThemes[1]};$result"
|
||||||
listThemes+="/${arrThemes[1]};$result\n"
|
if [ -f $themes_path$result/config.sh ]; then
|
||||||
|
source $themes_path$result/config.sh
|
||||||
|
listNames+="$theme_name\n"
|
||||||
|
else
|
||||||
|
listNames+="/${arrThemes[1]};$result\n"
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
listThemes=${listThemes::-2}
|
# -----------------------------------------------------
|
||||||
|
# Show rofi dialog
|
||||||
|
# -----------------------------------------------------
|
||||||
|
listNames=${listNames::-2}
|
||||||
|
choice=$(echo -e "$listNames" | rofi -dmenu -config ~/dotfiles/rofi/config-wallpaper.rasi -no-show-icons -width 30 -p "Themes" -format i)
|
||||||
|
|
||||||
choice=$(echo -e "$listThemes" | rofi -dmenu -config ~/dotfiles/rofi/config-wallpaper.rasi -no-show-icons -width 30 -p "Themes")
|
# -----------------------------------------------------
|
||||||
|
# Set new theme by writing the theme information to ~/.cache
|
||||||
|
# -----------------------------------------------------
|
||||||
if [ "$choice" ]; then
|
if [ "$choice" ]; then
|
||||||
echo "$choice" > ~/.cache/.themestyle.sh
|
echo "${listThemes[$choice+1]}" > ~/.cache/.themestyle.sh
|
||||||
~/dotfiles/waybar/launch.sh
|
~/dotfiles/waybar/launch.sh
|
||||||
fi
|
fi
|
||||||
|
|
Loading…
Reference in New Issue
Block a user