From 89477f7365163644f176e1ea3b4ba843f78606bb Mon Sep 17 00:00:00 2001 From: aclist <92275929+aclist@users.noreply.github.com> Date: Sat, 7 Feb 2026 20:05:52 +0900 Subject: [PATCH] chore: add venv.rst file --- docs/source/venv.rst | 43 +++++++++++++++++++++++++++++++++++++++++++ scripts/untracked.py | 7 +++++-- 2 files changed, 48 insertions(+), 2 deletions(-) create mode 100644 docs/source/venv.rst diff --git a/docs/source/venv.rst b/docs/source/venv.rst new file mode 100644 index 0000000..d23b798 --- /dev/null +++ b/docs/source/venv.rst @@ -0,0 +1,43 @@ +After satisfying the dependencies above, create a virtual environment (venv) and install PyGObject: + +If you have ``uv`` as your Python version manager, invoke the following: + +.. code:: console + + uv venv --python 3.13 $HOME/.virtualenvs/dzgui + source $HOME/.virtualenvs/dzgui/bin/activate + uv pip install PyGObject + +If you installed the ``python3.13`` package directly instead of ``uv``, use the below: + +.. code:: console + + python3.13 -m venv $HOME/.virtualenvs/dzgui + source $HOME/.virtualenvs/dzgui/bin/activate + pip install PyGObject + +You can now proceed to the :ref:`Installscript`. +After installation, refer to the additional remarks below. + +.. important:: + Since PyGObject is localized to a venv, it is advisable to create a wrapper script to ensure + the venv is activated on subsequent invocations of DZGUI. + +.. code:: console + + #!/usr/bin/env bash + source $HOME/.virtualenvs/dzgui/bin/activate + + +Make sure to update the placeholder path on the last line. For example, if you ran the +installscript from your home directory, the wrapper script would look like: + +.. code:: console + + #!/usr/bin/env bash + source $HOME/.virtualenvs/dzgui/bin/activate + $HOME/dzgui.sh + +Save this wrapper script in a location of your choice, e.g., ``mywrapper.sh`` and set the +executable bit: ``chmod +x mywrapper.sh`` This script will be your entrypoint for +future invocations of DZGUI, so you should launch it, not ``dzgui.sh`` diff --git a/scripts/untracked.py b/scripts/untracked.py index 89bef95..c116931 100644 --- a/scripts/untracked.py +++ b/scripts/untracked.py @@ -12,5 +12,8 @@ with open(".gitignore", "r") as f: untracked = [os.path.basename(line.rstrip()) for line in result.stdout] for file in untracked: if not any(file in item for item in ignored): - print(f"File '{file}' is untracked") - sys.exit(1) + res = input(f"File '{file}' is untracked. Proceed anyway? [Y/n] ") + if res.lower() in ("", "y"): + sys.exit(0) + else: + sys.exit(1)