diff --git a/bin/actions/hello.py b/bin/actions/hello.py index c2a65fd..4664723 100755 --- a/bin/actions/hello.py +++ b/bin/actions/hello.py @@ -12,8 +12,7 @@ from helpers.functions import printfe, logo, _rainbow_color, COLORS def get_last_ssh_login(): """Get information about the last SSH login""" try: - # Using lastlog2 to get the last login information - result = subprocess.run(['lastlog2', '-u', os.environ.get("USER", "")], + result = subprocess.run(['lastlog', '-u', os.environ.get("USER", "")], capture_output=True, text=True) if result.returncode == 0: lines = result.stdout.strip().split('\n') diff --git a/bin/helpers/functions.py b/bin/helpers/functions.py index f6a0af3..f00b97f 100644 --- a/bin/helpers/functions.py +++ b/bin/helpers/functions.py @@ -80,6 +80,7 @@ def logo(continue_after=False): sys.exit(0) except Exception as e: printfe("red", f"Error displaying logo: {e}") + def run_command(command, shell=False): """Run a shell command and return the result""" try: @@ -93,7 +94,6 @@ def run_command(command, shell=False): return False, e.stderr.strip() except FileNotFoundError: return False, f"Command '{command[0]}' not found" - return False, e.stderr.strip() def ensure_dependencies(): """Check and install required dependencies for the dotfiles system""" diff --git a/config/ansible/tasks/global/global.yml b/config/ansible/tasks/global/global.yml index b6b8d3e..bd340c6 100644 --- a/config/ansible/tasks/global/global.yml +++ b/config/ansible/tasks/global/global.yml @@ -39,7 +39,6 @@ - python3 - python3-pip - python3-venv - - lastlog2 # Used for displaying last login information state: present become: true diff --git a/config/home-manager/packages/common/packages.nix b/config/home-manager/packages/common/packages.nix index 92cffe1..e5946bd 100644 --- a/config/home-manager/packages/common/packages.nix +++ b/config/home-manager/packages/common/packages.nix @@ -32,6 +32,9 @@ pipx devbox + # OS independent and secure pty/tty and utmp/wtmp/lastlog + libptytty + # Development SDKs/Toolkits gcc pkg-config