From 7935d87e7d4263da93e4a1c1ad2d39ccd7c491fc Mon Sep 17 00:00:00 2001 From: TheK4n Date: Tue, 9 May 2023 22:13:04 +0300 Subject: [PATCH] style(install-script) --- home/user/.local/bin/slm | 28 ++++++++++++++-------------- install | 4 ++-- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/home/user/.local/bin/slm b/home/user/.local/bin/slm index 43d73c3..e0274da 100755 --- a/home/user/.local/bin/slm +++ b/home/user/.local/bin/slm @@ -32,31 +32,31 @@ cmd_edit() { chmod u+x "$LAYOUTS_DIR/$1.sh" } -cmd_load() { - if [ -z "$1" ]; then - "$LAYOUTS_DIR/default.sh" - return 0 - fi - - "$LAYOUTS_DIR/$1.sh" -} - cmd_wallpaper() { local wallpapers="$HOME/.wallpaper" feh --no-fehbg --bg-scale "$wallpapers/$(ls "$wallpapers" | shuf -n 1)" } +cmd_load() { + if [ -z "$1" ]; then + "$LAYOUTS_DIR/default.sh" + else + "$LAYOUTS_DIR/$1.sh" + fi + cmd_wallpaper +} + cmd_help () { echo "slm (ls|add|load|wallpaper)" >&2 } case "$1" in - ls) shift; cmd_list "$@" ;; - add|edit) shift; cmd_edit "$@" ;; - load) shift; cmd_load "$@" ;; - wallpaper) shift; cmd_wallpaper "$@" ;; - *) shift; cmd_help "$@" ;; + ls) shift; cmd_list "$@" ;; + add|edit) shift; cmd_edit "$@" ;; + load) shift; cmd_load "$@" ;; + wallpaper) shift; cmd_wallpaper "$@" ;; + *) shift; cmd_help "$@" ;; esac exit 0 diff --git a/install b/install index 7180d1c..7e11745 100755 --- a/install +++ b/install @@ -225,7 +225,7 @@ cmd_install() { termux) shift; cmd_termux "$@" ;; arch) shift; cmd_arch "$@" ;; psql) shift; cmd_psql "$@" ;; - docker) shift; cmd_docker "$@" ;; + docker) shift; cmd_docker "$@" ;; *) shift; cmd_no_target "$@" ;; esac done @@ -243,7 +243,7 @@ case "$1" in install) shift; cmd_install "$@" ;; unlink) shift; cmd_unlink "$@" ;; help) shift; cmd_help "$@" ;; - *) shift; cmd_help "$@" ;; + *) shift; cmd_help "$@" ;; esac exit 0