style(install-script)

This commit is contained in:
TheK4n 2023-05-09 22:13:04 +03:00
parent 6f7fde1eba
commit 7935d87e7d
2 changed files with 16 additions and 16 deletions

View File

@ -32,31 +32,31 @@ cmd_edit() {
chmod u+x "$LAYOUTS_DIR/$1.sh" 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() { cmd_wallpaper() {
local wallpapers="$HOME/.wallpaper" local wallpapers="$HOME/.wallpaper"
feh --no-fehbg --bg-scale "$wallpapers/$(ls "$wallpapers" | shuf -n 1)" 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 () { cmd_help () {
echo "slm (ls|add|load|wallpaper)" >&2 echo "slm (ls|add|load|wallpaper)" >&2
} }
case "$1" in case "$1" in
ls) shift; cmd_list "$@" ;; ls) shift; cmd_list "$@" ;;
add|edit) shift; cmd_edit "$@" ;; add|edit) shift; cmd_edit "$@" ;;
load) shift; cmd_load "$@" ;; load) shift; cmd_load "$@" ;;
wallpaper) shift; cmd_wallpaper "$@" ;; wallpaper) shift; cmd_wallpaper "$@" ;;
*) shift; cmd_help "$@" ;; *) shift; cmd_help "$@" ;;
esac esac
exit 0 exit 0

View File

@ -225,7 +225,7 @@ cmd_install() {
termux) shift; cmd_termux "$@" ;; termux) shift; cmd_termux "$@" ;;
arch) shift; cmd_arch "$@" ;; arch) shift; cmd_arch "$@" ;;
psql) shift; cmd_psql "$@" ;; psql) shift; cmd_psql "$@" ;;
docker) shift; cmd_docker "$@" ;; docker) shift; cmd_docker "$@" ;;
*) shift; cmd_no_target "$@" ;; *) shift; cmd_no_target "$@" ;;
esac esac
done done
@ -243,7 +243,7 @@ case "$1" in
install) shift; cmd_install "$@" ;; install) shift; cmd_install "$@" ;;
unlink) shift; cmd_unlink "$@" ;; unlink) shift; cmd_unlink "$@" ;;
help) shift; cmd_help "$@" ;; help) shift; cmd_help "$@" ;;
*) shift; cmd_help "$@" ;; *) shift; cmd_help "$@" ;;
esac esac
exit 0 exit 0