add mcrcon aliases

This commit is contained in:
riley 2021-11-10 23:41:18 -05:00
parent 54c863c4a7
commit 42edb52b80
2 changed files with 19 additions and 3 deletions

View File

@ -721,9 +721,9 @@ window:
#
# If the same trigger is assigned to multiple actions, all of them are executed
# in the order they were defined in.
#key_bindings:
#- { key: Paste, action: Paste }
#- { key: Copy, action: Copy }
key_bindings:
- { key: Paste, action: Paste }
- { key: Copy, action: Copy }
#- { key: L, mods: Control, action: ClearLogNotice }
#- { key: L, mods: Control, mode: ~Vi|~Search, chars: "\x0c" }
#- { key: PageUp, mods: Shift, mode: ~Alt, action: ScrollPageUp, }

View File

@ -75,6 +75,20 @@ def _alias():
else:
print(alias + " =", " ".join(aliases[alias]))
def _mcrcon(args: list):
if p"~/.mcrcon".exists():
source "~/.mcrcon"
else:
raise FileNotFoundError("~/.mcrcon")
$(mcrcon @(" ".join(args)))
def _mcterm():
if p"~/.mcrcon".exists():
source "~/.mcrcon"
else:
raise FileNotFoundError("~/.mcrcon")
mcrcon -t
# aliases
aliases.update({
'bwg': _bwc,
@ -83,6 +97,8 @@ aliases.update({
'config': '/usr/bin/git --git-dir=$HOME/.cfg/ --work-tree=$HOME',
'debug': _debug,
'ls': 'ls -alhs --color=auto',
'mc': _mcrcon,
'mct': _mcterm,
':q': 'exit',
'owo': 'echo uwu',
'ensure-tmux': _ensure_tmux,