72 lines
1.4 KiB
Bash
Executable File
72 lines
1.4 KiB
Bash
Executable File
#!/bin/bash
|
|
|
|
# CONFIG
|
|
ignore_background_color="#04000a"
|
|
highlight="#08000a"
|
|
default_theme="tokyo-night"
|
|
|
|
# END CONFIG
|
|
cd "$(dirname "$0")"
|
|
|
|
ignore_file=0
|
|
list_files=0
|
|
ignore_background=0
|
|
run_pywal=0
|
|
|
|
while getopts "h?lpb" opt; do
|
|
case "$opt" in
|
|
h)
|
|
printf -- "-l list themes
|
|
-p run pywall
|
|
-b ignore background and use one defined in script"
|
|
exit 0
|
|
;;
|
|
l) list_files=1
|
|
;;
|
|
b) ignore_background=1
|
|
;;
|
|
p) run_pywal=1
|
|
ignore_file=1
|
|
;;
|
|
esac
|
|
done
|
|
|
|
shift $((OPTIND-1))
|
|
[ "${1:-}" = "--" ] && shift
|
|
|
|
theme_file=$1
|
|
|
|
if [ $list_files == 1 ]; then
|
|
ls $1 ./themes/
|
|
exit 0
|
|
fi
|
|
|
|
if [ "$theme_file" == "" ]; then
|
|
theme_file="$default_theme"
|
|
fi
|
|
|
|
if [ $ignore_file == 0 ]; then
|
|
source ./themes/$theme_file.sh || exit 1
|
|
fi
|
|
|
|
|
|
if [ $run_pywal == 1 ]; then
|
|
if [ $(pgrep hyprpaper) ]; then
|
|
wallpaper=$(hyprctl hyprpaper listactive | grep HDMI | sed 's/HDMI-A-1 = //')
|
|
wal -seti "$wallpaper"
|
|
. "$HOME/.cache/wal/colors.sh"
|
|
[ $ignore_background == 1 ] && background="$ignore_background_color"
|
|
else
|
|
echo NO AVAILABLE WALLPAPER ENGINE
|
|
echo please define wallpaper
|
|
exit 1
|
|
fi
|
|
fi
|
|
|
|
[ $ignore_background == 1 ] && background="$ignore_background_color"
|
|
|
|
runs_dir="$(find ./targets -mindepth 1 -maxdepth 1 -type f -executable)"
|
|
for s in $runs_dir; do
|
|
source "$s"
|
|
done
|