commit 684bc534fc30c213100408b35df391b7a92e60fb
Author: MrJensK <jens.se@icloud.com>
AuthorDate: Wed Aug 12 20:26:18 2026 +0200
Commit: MrJensK <jens.se@icloud.com>
CommitDate: Wed Aug 12 20:26:18 2026 +0200
Fråga innan installation av Rust/bluetui och X-autostart
Gör Rust/bluetui-installationen och tillägget av startx-autostart i
~/.bash_profile valbara via j/n-prompt, i linje med övriga optionella
installationssteg i skriptet.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
---
install.sh | 69 ++++++++++++++++++++++++++++++++++++++------------------------
1 file changed, 42 insertions(+), 27 deletions(-)
diff --git a/install.sh b/install.sh
index 6fafccc..acf724b 100755
--- a/install.sh
+++ b/install.sh
@@ -39,6 +39,7 @@ sudo apt-get install -y \
xdotool \
x11-utils \
pipx \
+ feh \
mkdir -p "$BUILD_DIR"
cd "$BUILD_DIR"
@@ -229,27 +230,34 @@ echo "==> Stänger av PC-speaker beep..."
echo "blacklist pcspkr" | sudo tee /etc/modprobe.d/nobeep.conf > /dev/null
sudo rmmod pcspkr 2>/dev/null || true
-echo "==> Tar bort ev. gammal rustc/cargo från apt (Debian har ofta för gammal version)..."
-RUST_APT_PKGS=$(dpkg-query -W -f='${Package}\n' 'rustc' 'cargo' 'libstd-rust-dev' 'rust-llvm' 'libstd-rust-*' 2>/dev/null || true)
-if [ -n "$RUST_APT_PKGS" ]; then
- sudo apt-get purge -y $RUST_APT_PKGS
- sudo apt-get autoremove --purge -y
-fi
+echo ""
+read -p "Installera Rust (rustup) och bygga/installera bluetui (bluetooth-hantering)? (j/n) " -n 1 -r
+echo
+if [[ $REPLY =~ ^[Jj]$ ]]; then
+ echo "==> Tar bort ev. gammal rustc/cargo från apt (Debian har ofta för gammal version)..."
+ RUST_APT_PKGS=$(dpkg-query -W -f='${Package}\n' 'rustc' 'cargo' 'libstd-rust-dev' 'rust-llvm' 'libstd-rust-*' 2>/dev/null || true)
+ if [ -n "$RUST_APT_PKGS" ]; then
+ sudo apt-get purge -y $RUST_APT_PKGS
+ sudo apt-get autoremove --purge -y
+ fi
-echo "==> Installerar rustup..."
-if ! command -v rustup >/dev/null 2>&1 && [ ! -x "$HOME/.cargo/bin/rustup" ]; then
- curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
+ echo "==> Installerar rustup..."
+ if ! command -v rustup >/dev/null 2>&1 && [ ! -x "$HOME/.cargo/bin/rustup" ]; then
+ curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
+ fi
+ # shellcheck disable=SC1091
+ source "$HOME/.cargo/env"
+
+ echo "==> Bygger och installerar bluetui..."
+ rm -rf "$BUILD_DIR/bluetui"
+ git clone --depth=1 https://github.com/pythops/bluetui "$BUILD_DIR/bluetui"
+ cd "$BUILD_DIR/bluetui"
+ cargo build --release
+ sudo cp target/release/bluetui /usr/local/bin/
+ cd "$BUILD_DIR"
+else
+ echo " Hoppar över Rust och bluetui"
fi
-# shellcheck disable=SC1091
-source "$HOME/.cargo/env"
-
-echo "==> Bygger och installerar bluetui..."
-rm -rf "$BUILD_DIR/bluetui"
-git clone --depth=1 https://github.com/pythops/bluetui "$BUILD_DIR/bluetui"
-cd "$BUILD_DIR/bluetui"
-cargo build --release
-sudo cp target/release/bluetui /usr/local/bin/
-cd "$BUILD_DIR"
echo "==> Installerar JetBrainsMono Nerd Font..."
FONT_DIR="$HOME/.local/share/fonts/JetBrainsMono"
@@ -261,15 +269,22 @@ rm /tmp/JetBrainsMono.zip
fc-cache -f
echo " JetBrainsMono Nerd Font installerad"
-echo "==> Konfigurerar autostart av X på TTY1..."
-BASH_PROFILE="$HOME/.bash_profile"
-AUTOSTART='if [ -z "$DISPLAY" ] && [ "$(tty)" = "/dev/tty1" ]; then exec startx; fi'
-if grep -qF 'exec startx' "$BASH_PROFILE" 2>/dev/null; then
- echo " ~/.bash_profile redan konfigurerad, hoppar över"
+echo ""
+read -p "Lägga till automatisk start av X (sxwm) vid inloggning på TTY1? (j/n) " -n 1 -r
+echo
+if [[ $REPLY =~ ^[Jj]$ ]]; then
+ echo "==> Konfigurerar autostart av X på TTY1..."
+ BASH_PROFILE="$HOME/.bash_profile"
+ AUTOSTART='if [ -z "$DISPLAY" ] && [ "$(tty)" = "/dev/tty1" ]; then exec startx; fi'
+ if grep -qF 'exec startx' "$BASH_PROFILE" 2>/dev/null; then
+ echo " ~/.bash_profile redan konfigurerad, hoppar över"
+ else
+ echo "" >> "$BASH_PROFILE"
+ echo "$AUTOSTART" >> "$BASH_PROFILE"
+ echo " ~/.bash_profile uppdaterad"
+ fi
else
- echo "" >> "$BASH_PROFILE"
- echo "$AUTOSTART" >> "$BASH_PROFILE"
- echo " ~/.bash_profile uppdaterad"
+ echo " Hoppar över autostart av X"
fi
echo "==> Aktiverar PipeWire..."