add: shortcut handler for kitty

This commit is contained in:
Jamie Albert
2025-11-13 20:54:37 +00:00
parent ee0be951e3
commit 812d192552
4 changed files with 108 additions and 25 deletions

View File

@@ -3,8 +3,8 @@
# @file_name: dao.sh
# @description: main script handle for dao
# @date: 2025-11-12
# @version: 0.0.1
# @usage: ./dao.sh {update|transfer|pwgen|mount|firewall} [args]
# @version: 0.1.0
# @usage: ./dao.sh {kitty|mount|pwgen|update} [args]
#
# @author: Jamie Albert
# @author_contact: <mailto:jamie.albert@flatmail.me
@@ -40,36 +40,33 @@ exit 0
}
[[ "${1:-}" == "-h" || "${1:-}" == "--help" ]] && show_help
declare -g COMMAND=${1:-}
shift || true
# ---
# shellcheck disable=1091
# ---
setup() {
main() {
. /usr/local/share/dao/libs/libs_dao.sh
. /usr/local/share/dao/config/dao.conf
}
declare -g COMMAND=$1
shift
main() {
setup
case "${COMMAND}" in
update)
"${DAO_SCRIPTS_DIR}/on_demand/update.sh" "$@"
;;
transfer)
"${DAO_SCRIPTS_DIR}/on_demand/transfer.sh" "$@"
;;
pwgen)
"${DAO_SCRIPTS_DIR}/on_demand/pwgen.sh" "$@"
kitty)
"${DAO_SCRIPTS_DIR}/patches/kitty_handler.sh" "$@"
;;
mount)
"${DAO_SCRIPTS_DIR}/reboot/mount.sh" "$@"
;;
pwgen)
"${DAO_SCRIPTS_DIR}/on_demand/pwgen.sh" "$@"
;;
update)
"${DAO_SCRIPTS_DIR}/on_demand/update.sh" "$@"
;;
"")
dao::error 1 "No command provided. Use -h for help." >&2
;;
*)
echo "Usage: dao {update|transfer|pwgen|mount|firewall} [args]"
exit 1
dao::error 1 "Unknown command: ${COMMAND}" >&2
;;
esac
}