From 2163397ff1ca87d3e48037f1cf2192c9f2bf67d9 Mon Sep 17 00:00:00 2001 From: The_miro Date: Tue, 14 Jul 2026 16:42:17 +0200 Subject: [PATCH] Add Debian/Fedora dependency install scripts, rename Arch one Splits install-deps.sh into per-distro scripts (install_deps_arch.sh, install_deps_debian.sh, install_deps_fedora.sh) since package names and managers differ; ascii-image-converter is built via go install on Debian/Fedora since it's AUR-only on Arch. --- install-deps.sh => install_deps_arch.sh | 0 install_deps_debian.sh | 17 +++++++++++++++++ install_deps_fedora.sh | 16 ++++++++++++++++ readme.md | 19 +++++++++++-------- 4 files changed, 44 insertions(+), 8 deletions(-) rename install-deps.sh => install_deps_arch.sh (100%) create mode 100755 install_deps_debian.sh create mode 100755 install_deps_fedora.sh diff --git a/install-deps.sh b/install_deps_arch.sh similarity index 100% rename from install-deps.sh rename to install_deps_arch.sh diff --git a/install_deps_debian.sh b/install_deps_debian.sh new file mode 100755 index 0000000..a236214 --- /dev/null +++ b/install_deps_debian.sh @@ -0,0 +1,17 @@ +#!/bin/bash +sudo apt update +sudo apt install -y fswebcam v4l-utils python3-opencv golang-go + +# ascii-image-converter isn't packaged for apt; build it with go instead +go install github.com/TheZoraiz/ascii-image-converter@latest +sudo install -Dm755 "$(go env GOPATH)/bin/ascii-image-converter" /usr/local/bin/ascii-image-converter + +# lp group membership grants write access to /dev/lp0 for txt2printr.sh +if ! groups "$USER" | grep -qw lp; then + sudo usermod -aG lp "$USER" + echo "Added $USER to the lp group - log out and back in for this to take effect" +fi + +# parport/parport_pc expose the parallel port as /dev/lp0 via the lp driver +sudo modprobe parport parport_pc lp +echo -e "parport\nparport_pc\nlp" | sudo tee /etc/modules-load.d/parport.conf > /dev/null diff --git a/install_deps_fedora.sh b/install_deps_fedora.sh new file mode 100755 index 0000000..088e232 --- /dev/null +++ b/install_deps_fedora.sh @@ -0,0 +1,16 @@ +#!/bin/bash +sudo dnf install -y fswebcam v4l-utils python3-opencv golang + +# ascii-image-converter isn't packaged for dnf; build it with go instead +go install github.com/TheZoraiz/ascii-image-converter@latest +sudo install -Dm755 "$(go env GOPATH)/bin/ascii-image-converter" /usr/local/bin/ascii-image-converter + +# lp group membership grants write access to /dev/lp0 for txt2printr.sh +if ! groups "$USER" | grep -qw lp; then + sudo usermod -aG lp "$USER" + echo "Added $USER to the lp group - log out and back in for this to take effect" +fi + +# parport/parport_pc expose the parallel port as /dev/lp0 via the lp driver +sudo modprobe parport parport_pc lp +echo -e "parport\nparport_pc\nlp" | sudo tee /etc/modules-load.d/parport.conf > /dev/null diff --git a/readme.md b/readme.md index 4b82974..48ec1a9 100644 --- a/readme.md +++ b/readme.md @@ -18,23 +18,26 @@ Both read the same `webcam.conf` / `ascii.conf` / `keybinds.conf` / ## Requirements -- Arch Linux (or another `pacman`/AUR-based distro) is assumed by - `install-deps.sh` - `fswebcam`, `ascii-image-converter`, `v4l-utils` - `python-opencv` (for `photobooth.py`) - A V4L2-compatible webcam - Optionally, a parallel-port printer wired up via `parport`/`parport_pc`/`lp` kernel modules, for hardcopy prints -Install everything with: +Install everything with the script for your distro: ```sh -./install-deps.sh +./install_deps_arch.sh # Arch Linux / other pacman+AUR distros +./install_deps_debian.sh # Debian, Ubuntu, and other apt-based distros +./install_deps_fedora.sh # Fedora and other dnf-based distros ``` -This installs [`yay`](https://aur.archlinux.org/packages/yay) if needed, -installs the required packages, adds your user to the `lp` group (needed to -write to `/dev/lp0`), and loads the parallel-port kernel modules. +`install_deps_arch.sh` installs [`yay`](https://aur.archlinux.org/packages/yay) +if needed and pulls `ascii-image-converter` from the AUR. The Debian/Fedora +scripts build `ascii-image-converter` with `go install` instead, since it +isn't packaged for `apt`/`dnf`. All three install the required packages, add +your user to the `lp` group (needed to write to `/dev/lp0`), and load the +parallel-port kernel modules. ## Usage @@ -101,5 +104,5 @@ for a couple of previously-tested printers. ## Other scripts -- `yay-installer.sh` — installs the `yay` AUR helper (used by `install-deps.sh`) +- `yay-installer.sh` — installs the `yay` AUR helper (used by `install_deps_arch.sh`) script (LUKS2/btrfs/FIDO2), unrelated to the photobooth itself, was origin