From 42edb52b80699200c535aa70cf2e21da2264edb4 Mon Sep 17 00:00:00 2001 From: riley Date: Wed, 10 Nov 2021 23:41:18 -0500 Subject: [PATCH] add mcrcon aliases --- .config/alacritty/alacritty.yml | 6 +++--- .xonshrc | 16 ++++++++++++++++ 2 files changed, 19 insertions(+), 3 deletions(-) diff --git a/.config/alacritty/alacritty.yml b/.config/alacritty/alacritty.yml index e7a1cbc..a75cfaa 100644 --- a/.config/alacritty/alacritty.yml +++ b/.config/alacritty/alacritty.yml @@ -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, } diff --git a/.xonshrc b/.xonshrc index 714070e..36775ab 100644 --- a/.xonshrc +++ b/.xonshrc @@ -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,