From 867b81750193aeb4255e5e09ac6edb5f8e6765f4 Mon Sep 17 00:00:00 2001 From: coolneng Date: Tue, 10 May 2022 23:41:35 +0200 Subject: [PATCH] Move args check below functions in switch-theme --- scripts/.local/share/scripts/switch-theme | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/scripts/.local/share/scripts/switch-theme b/scripts/.local/share/scripts/switch-theme index d28ecd0..87cb12d 100755 --- a/scripts/.local/share/scripts/switch-theme +++ b/scripts/.local/share/scripts/switch-theme @@ -1,13 +1,5 @@ #!/bin/sh -if [ $# -lt 1 ]; then - echo "Usage: switch_theme " - 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 " + 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