djcev.com

//

Git Repos / dotfiles / commit 63025bf

Commit: 63025bf02cdbe94995a8717525e472bd72693c82
Parent: f04c62321c03c978b159c6e024834b9406ceb97d
Author: Cameron Vanderzanden, 2021-12-13 15:27
Committer: Cameron Vanderzanden, 2021-12-13 15:27

Commit Message

Invalid argument catch in background.sh, misc

Added a check for invalid arguments and a simple error message to
the background.sh redshift hook script. Missed a lib_print reference
in fixcolors.sh, corrected to cev_print.

Change List

?File Add Del
M config/redshift/hooks/background.sh +10 -4
M fixcolors.sh +1 -1

Diff config/redshift/hooks/background.sh

diff --git a/config/redshift/hooks/background.sh b/config/redshift/hooks/background.sh
index 14a8b77..a89d1a7 100755
--- a/config/redshift/hooks/background.sh
+++ b/config/redshift/hooks/background.sh
@@ -140,11 +140,11 @@ check_set() {
fi
}

-clear_character_dir() {
+clear_character_images() {
if [ -d "$tmpdir" ]; then
if [ "$verbose" ]; then
print_self
- printf "clearing character dir %s\n" "$tmpdir"
+ printf "clearing character images %s\n" "$tmpdir"
fi
for i in 1 2 3; do
if [ -f "${tmpdir}/s$i.png" ]; then
@@ -168,10 +168,11 @@ done

case $1 in
clear)
- clear_character_dir
+ clear_character_images
[ "$verbose" ] && print_self && printf "clearing temp files\n"
rm ${verbose} ${gamef} ${charf} ${scenef}
rmdir ${verbose} ${tmpdir}
+ exit 0
;;
period-changed)
check_set
@@ -180,13 +181,18 @@ case $1 in
[Nn]ight) period="night" ;;
[Tt]ransition) period="interval" ;;
esac
- clear_character_dir
+ clear_character_images
$HOME/bin/back.sh ${verbose} $walldir/${game}_${scene}_$period.???
[ "$verbose" ] && print_self && printf "copying character files\n"
for i in 1 2 3; do
cp ${verbose} "$chardir"/${game}_${char}_${period}_s$i.png \
"$tmpdir"/s$i.png
done
+ exit 0
+ ;;
+ *)
+ print_help && print_self && printf 'invalid argument(s): %s\n' "$*"
+ exit 1
;;
esac

Return to the top of this page or return to the overview of this repo.

Diff fixcolors.sh

diff --git a/fixcolors.sh b/fixcolors.sh
index 3e93aac..1f595e8 100755
--- a/fixcolors.sh
+++ b/fixcolors.sh
@@ -20,7 +20,7 @@
## -X Hexadecimal output without the prefixed #. (xxxxxx form).
##

-[ -x $HOME/bin/lib_print.sh ] && . $HOME/bin/lib_print.sh
+[ -x $HOME/bin/cev_print.sh ] && . $HOME/bin/cev_print.sh

self="${0##*'/'}"
colordef="./colordef_gruvbox.sh"

Return to the top of this page or return to the overview of this repo.