aboutsummaryrefslogtreecommitdiff
path: root/set-theme
diff options
context:
space:
mode:
Diffstat (limited to 'set-theme')
-rwxr-xr-xset-theme27
1 files changed, 14 insertions, 13 deletions
diff --git a/set-theme b/set-theme
index 282d6b1..516ee88 100755
--- a/set-theme
+++ b/set-theme
@@ -1,12 +1,12 @@
-#!/bin/bash
+#!/bin/sh
# CONFIG
ignore_background_color="#04000a"
highlight="#08000a"
-default_theme="catppuccin"
+default_theme="tokyo-night"
# END CONFIG
-cd "$(dirname "$0")"
+cd "$(dirname "$0")" || exit
ignore_file=0
list_files=0
@@ -14,7 +14,7 @@ ignore_background=0
run_pywal=0
set_wallpaper=0
-while getopts "h?lpbw" opt; do
+while getopts "hlpbw" opt; do
case "$opt" in
h)
printf -- "-l list themes
@@ -33,6 +33,7 @@ WALLPAPER var can be specified for a wallpaper (WALLPAPER=\"somepath\" set-theme
;;
w) set_wallpaper=1
;;
+ *) break;;
esac
done
@@ -41,17 +42,17 @@ shift $((OPTIND-1))
theme_file=$1
-if [ $list_files == 1 ]; then
- ls $1 ./themes/
+if [ $list_files = 1 ]; then
+ ls "$1" ./themes/
exit 0
fi
-if [ "$theme_file" == "" ]; then
+if [ "$theme_file" = "" ]; then
theme_file="$default_theme"
fi
-if [ $ignore_file == 0 ]; then
- source ./themes/$theme_file.sh || exit 1
+if [ $ignore_file = 0 ]; then
+ . "themes/$theme_file.sh" || exit 1
fi
if [ "$WALLPAPER" ]; then
@@ -59,7 +60,7 @@ if [ "$WALLPAPER" ]; then
fi
-if [ $run_pywal == 1 ]; then
+if [ $run_pywal = 1 ]; then
# if your wallpaper engine your using can get the current active wallpaper. add it here
if [ $(pgrep hyprpaper) ]; then
wallpaper=$(hyprctl hyprpaper listactive | grep HDMI | sed 's/HDMI-A-1 = //')
@@ -79,13 +80,13 @@ if [ $run_pywal == 1 ]; then
fi
fi
-[ $ignore_background == 1 ] && background="$ignore_background_color"
+[ $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"
+ . "$s"
done
-if [ $set_wallpaper == 1 ] && [ "$wallpaper" ]; then
+if [ "$wallpaper" ] && [ $set_wallpaper = 1 ]; then
setwll -ua "$wallpaper"
fi