From 93436d05f6da15e34f5f03d57c8a84e7f2b9f70a Mon Sep 17 00:00:00 2001 From: David Keane Date: Mon, 14 Jul 2025 05:07:37 +0100 Subject: [PATCH 1/2] Fix: Add cross-platform path detection for macOS compatibility - Replace hardcoded Linux paths with cross-platform detection - Add support for macOS (/Users/) and Windows (C:\Users\) paths - Maintain backward compatibility with existing Linux installations - Fixes issue where SkeletonKey fails to run on macOS systems This resolves path errors when running SkeletonKey on macOS where the user directory structure differs from Linux systems. --- mods/bits.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/mods/bits.py b/mods/bits.py index e919981..9a4dbbe 100644 --- a/mods/bits.py +++ b/mods/bits.py @@ -7,7 +7,16 @@ # Variables username = getpass.getuser() # Get username header = Fore.RED + f'{username}' + Fore.WHITE + '@' + Fore.RED + 'SkeletonKey $ ' + Fore.RESET # header for user input -local_path = f'/home/{username}/.SkeletonKey' if username != 'root' else '/root/.SkeletonKey' # local path to skelkey + +# Cross-platform path detection +if os.name == 'posix': # Unix-like systems (Linux, macOS) + if sys.platform == 'darwin': # macOS + local_path = f'/Users/{username}/.SkeletonKey' if username != 'root' else '/var/root/.SkeletonKey' + else: # Linux and other Unix systems + local_path = f'/home/{username}/.SkeletonKey' if username != 'root' else '/root/.SkeletonKey' +else: # Windows + local_path = f'C:\\Users\\{username}\\.SkeletonKey' + cipher = f'{local_path}/ciphers/' # local path to ciphers # Colors From 3f8a9be98c6025d3d9399e59fa1b9e79dd7b1909 Mon Sep 17 00:00:00 2001 From: David Keane Date: Mon, 14 Jul 2025 05:07:49 +0100 Subject: [PATCH 2/2] Add virtual environment wrapper script - Add key.sh wrapper script for virtual environment support - Automatically activates Python virtual environment before running SkeletonKey - Provides error checking for missing directories and virtual environments - Useful for systems with externally managed Python environments (modern macOS/Linux) This wrapper ensures SkeletonKey dependencies are properly isolated and loaded. --- key.sh | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100755 key.sh diff --git a/key.sh b/key.sh new file mode 100755 index 0000000..9e111db --- /dev/null +++ b/key.sh @@ -0,0 +1,23 @@ +#!/bin/bash + +# SkeletonKey wrapper script +# This script activates the virtual environment and runs SkeletonKey + +SKELETON_DIR="$HOME/.SkeletonKey" + +# Check if SkeletonKey directory exists +if [ ! -d "$SKELETON_DIR" ]; then + echo "Error: SkeletonKey not found at $SKELETON_DIR" + exit 1 +fi + +# Check if virtual environment exists +if [ ! -d "$SKELETON_DIR/venv" ]; then + echo "Error: Virtual environment not found. Please reinstall SkeletonKey." + exit 1 +fi + +# Activate virtual environment and run SkeletonKey +cd "$SKELETON_DIR" +source venv/bin/activate +python main.py "$@"