mirror of
https://github.com/m-housh/dotfiles.git
synced 2026-02-14 14:12:41 +00:00
feat: Removes pkg subcommands from kanatactl in favor of using package manager.
This commit is contained in:
21
env/.local/scripts/kanatactl
vendored
21
env/.local/scripts/kanatactl
vendored
@@ -17,8 +17,7 @@ KBD=${KBD:-""} # Keyboard config to use, either "voyager" or "macbook"
|
||||
usage() {
|
||||
cat <<EOF
|
||||
|
||||
Manages kanata qmk keyboard program, which needs to be built locally. Currently the linux builds
|
||||
are only for x86. Also manages the kanata systemd service.
|
||||
Manages kanata qmk keyboard program, which needs to be built locally. Also manages the kanata systemd service.
|
||||
|
||||
USAGE:
|
||||
|
||||
@@ -30,8 +29,6 @@ FLAGS:
|
||||
COMMANDS:
|
||||
config: Commands for the kanata keyboard configuration file(s).
|
||||
service: Commands for the kanata systemd service.
|
||||
pkg: Commands for the kanata package.
|
||||
bootstrap: Bootstrap a new machine, performs installation, enables, and starts kanata systemd service.
|
||||
logs: View the log file.
|
||||
|
||||
Run "$THIS <command> --help" for more information about a command.
|
||||
@@ -44,16 +41,6 @@ log() {
|
||||
logging log --source "$THIS_FILE" "$@"
|
||||
}
|
||||
|
||||
# Bootstrap a new machine, by building and installing the kanata executable,
|
||||
# installing the systemd service files, and enable / start the service.
|
||||
bootstrap() {
|
||||
log "Bootstrapping new system..."
|
||||
$THIS_FILE pkg install
|
||||
$THIS_FILE service install
|
||||
$THIS_FILE service enable
|
||||
$THIS_FILE service start
|
||||
}
|
||||
|
||||
################################################################################
|
||||
# MAIN
|
||||
################################################################################
|
||||
@@ -65,8 +52,6 @@ setup-logging "$LOG_FILE" "$LOG_LABEL"
|
||||
while [[ $# -gt 0 ]]; do
|
||||
if [[ $1 == "-h" ]] || [[ $1 == "--help" ]]; then
|
||||
usage && exit 0
|
||||
elif [[ $1 == "bootstrap" ]]; then
|
||||
bootstrap && exit 0
|
||||
elif [[ $1 == "config" ]]; then
|
||||
shift
|
||||
THIS="$THIS config" $SCRIPTS/utils/kanatactl/config "$@"
|
||||
@@ -75,10 +60,6 @@ while [[ $# -gt 0 ]]; do
|
||||
shift
|
||||
THIS="$THIS service" $SCRIPTS/utils/kanatactl/service "$@"
|
||||
exit $?
|
||||
elif [[ $1 == "pkg" ]]; then
|
||||
shift
|
||||
THIS="$THIS pkg" $SCRIPTS/utils/kanatactl/pkg "$@"
|
||||
exit $?
|
||||
elif [[ $1 == "logs" ]]; then
|
||||
bat ${LOG_DIR:-/tmp/logs}/$LOG_FILE && exit 0
|
||||
elif [[ $1 == "update" ]]; then
|
||||
|
||||
Reference in New Issue
Block a user