From d4c642c25eb79508032fef39c928da7968a5abe4 Mon Sep 17 00:00:00 2001 From: "dingfeng.wong" Date: Tue, 22 Jul 2025 22:05:16 +0800 Subject: [PATCH] a --- src/elf/better_bash.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/elf/better_bash.py b/src/elf/better_bash.py index 1e544d3..20427dc 100644 --- a/src/elf/better_bash.py +++ b/src/elf/better_bash.py @@ -56,6 +56,13 @@ def build_ps1_prompt() -> str: return f'{green}{user_host} ($({local_ip_cmd})):{work_dir}{prompt_symbol} {reset}' +def get_plain_user_host_ip() -> str: + """ + Returns a plain text command that outputs user@host (ip) format + without PS1 formatting strings - just the actual values + """ + return 'echo "$(whoami)@$(hostname) ($(hostname -I | awk \'{print $1}\'))"' + # Alias building utilities def create_bash_function(func_name: str, func_body: str) -> str: """ @@ -123,6 +130,9 @@ export PS1="{build_ps1_prompt()}" # Tail the last modified file in current directory {build_tail_last_alias()} +{create_alias_with_function('lss', '_lss_func', 'systemctl status lightspeed.service')} +{create_alias_with_function('cdm', '_cdm_func', 'cd /home/multihomingproxy/logs')} + echo "Bash customizations sourced successfully!" '''