From 48d5d5842a405b05c100d088d356ca13ad5bc2cf Mon Sep 17 00:00:00 2001 From: Martin Rys Date: Sat, 21 Sep 2024 21:35:23 +0200 Subject: [PATCH] Add instructions on how to run from a venv and requirements.txt, also how to run daemon in debug mode from run.sh --- .gitignore | 1 + README.md | 8 +++++++- requirements.txt | 5 +++++ requirements_dev.txt | 2 ++ run.sh | 2 ++ 5 files changed, 17 insertions(+), 1 deletion(-) create mode 100644 requirements.txt create mode 100644 requirements_dev.txt diff --git a/.gitignore b/.gitignore index 7c455c65..2789450f 100644 --- a/.gitignore +++ b/.gitignore @@ -7,6 +7,7 @@ test.* test[0-9].* build/ +venv/ .atomignore commit* profiles diff --git a/README.md b/README.md index 150aa47d..54cbf6a1 100644 --- a/README.md +++ b/README.md @@ -63,4 +63,10 @@ Windows: ## Running with non distro-specific package - Download and extract [latest release](https://github.com/C0rn3j/sc-controller/releases/latest) - - Navigate to extracted directory and execute `./run.sh` + - Navigate to extracted directory: `cd sc-controller` + - If you do not wish to use system dependencies, you can setup a venv and install them there: + - Create the venv: `python -m venv venv` + - Activate it, you will need to do this before each launch: `source venv/bin/activate` + - Install dependencies: `pip install -r requirements.txt` + - Execute `./run.sh` + - If you are debuggin an issue, running `./run.sh daemon` first will launch the daemon in debug mode, allowing you to launch sc-controller in another terminal with `./run.sh` diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 00000000..6fec3c1c --- /dev/null +++ b/requirements.txt @@ -0,0 +1,5 @@ +evdev +ioctl-opt +libusb1 +setuptools +PyGObject diff --git a/requirements_dev.txt b/requirements_dev.txt new file mode 100644 index 00000000..d4331e14 --- /dev/null +++ b/requirements_dev.txt @@ -0,0 +1,2 @@ +# Dev package to see types +pygobject-stubs --config-settings=config=Gtk3 diff --git a/run.sh b/run.sh index bb93ed38..ed169b76 100755 --- a/run.sh +++ b/run.sh @@ -118,6 +118,8 @@ export SCC_SHARED="$(pwd)" # Start either the daemon in debug mode if first parameter is 'debug', or the regular sc-controller app if [[ ${1-} == 'daemon' ]]; then + # Kill any existing daemons before spawning our own + pkill -f scc-daemon || true python3 'scripts/scc-daemon' debug else python3 'scripts/sc-controller' $@