Move args check below functions in switch-theme

This commit is contained in:
coolneng 2022-05-10 23:41:35 +02:00
parent 7e53079246
commit 867b817501
Signed by: coolneng
GPG Key ID: 9893DA236405AF57
1 changed files with 8 additions and 8 deletions

View File

@ -1,13 +1,5 @@
#!/bin/sh
if [ $# -lt 1 ]; then
echo "Usage: switch_theme <mode>"
echo "mode: dark|light"
exit 1
fi
mode=$1
capitalize() {
printf '%s' "$1" | head -c 1 | tr "[:lower:]" "[:upper:]"
printf '%s' "$1" | tail -c '+2'
@ -33,6 +25,14 @@ recolor_zathura() {
done <"$temp_file"
}
if [ $# -lt 1 ]; then
echo "Usage: switch_theme <mode>"
echo "mode: dark|light"
exit 1
fi
mode=$1
if [ "$mode" = "light" ]; then
emacsclient --eval "(load-theme 'doom-nord-light 'no-confirm)"
change_theme dark light