Hyprland-dotfiles/waybar/themeswitcher.sh

23 lines
741 B
Bash
Raw Normal View History

2023-10-09 09:50:47 -04:00
#!/bin/bash
2023-10-09 13:54:14 -04:00
options=$(find ~/dotfiles/waybar/themes/ -maxdepth 2 -type d)
2023-10-09 09:50:47 -04:00
listThemes=""
for value in $options
do
2023-10-09 13:54:14 -04:00
if [ ! $value == "$HOME/dotfiles/waybar/themes/" ]; then
2023-10-09 09:50:47 -04:00
if [ $(find $value -maxdepth 1 -type d | wc -l) = 1 ]; then
2023-10-09 13:54:14 -04:00
result=$(echo $value | sed "s#$HOME/dotfiles/waybar/themes/#/#g")
2023-10-09 11:27:03 -04:00
IFS='/' read -ra arrThemes <<< "$result"
echo $arrThemes
listThemes+="/${arrThemes[1]};$result\n"
2023-10-09 09:50:47 -04:00
fi
fi
done
2023-10-09 11:27:03 -04:00
2023-10-09 09:50:47 -04:00
listThemes=${listThemes::-2}
2023-10-09 11:27:03 -04:00
2023-10-09 09:50:47 -04:00
choice=$(echo -e "$listThemes" | rofi -dmenu -config ~/dotfiles/rofi/config-wallpaper.rasi -no-show-icons -width 30 -p "Themes")
2023-10-09 11:27:03 -04:00
if [ "$choice" ]; then
echo "$choice" > ~/.cache/.themestyle.sh
~/dotfiles/waybar/launch.sh
2023-10-09 13:54:14 -04:00
fi