foxygit / dotfiles Log in
commit a537a338b1d7812e4ce754227d65cd384f34aa80
Author:     MrJensK <jens.se@icloud.com>
AuthorDate: Tue Jul 28 20:15:39 2026 +0200
Commit:     MrJensK <jens.se@icloud.com>
CommitDate: Tue Jul 28 20:15:39 2026 +0200

    Purge stale apt rustc/cargo and install rustup; sync latest sxbarc config

    install.sh now removes Debian's apt-packaged rustc/cargo (often outdated)
    before building bluetui, installing rustup instead so cargo build uses a
    current toolchain. Also updated config/sxbarc to match the live config
    (Nerd Font, enabled volume/cpu modules, prefix/width/colour settings).

    Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
---
 config/sxbarc | 33 ++++++++++++++++++++++++++++-----
 install.sh    | 31 +++++++++++++++++++++++--------
 2 files changed, 51 insertions(+), 13 deletions(-)

diff --git a/config/sxbarc b/config/sxbarc
index f3d8c61..ed1aedb 100644
--- a/config/sxbarc
+++ b/config/sxbarc
@@ -17,16 +17,39 @@ border_width        : 1
 background_colour   : #000000
 foreground_colour   : #7abccd
 border_colour       : #ffffff
-font                : fixed
+font                : JetBrainsMono Nerd Font:size=10

 # Built-in modules
 # module : name : enabled : refresh_interval_seconds
 # Available: clock, date, battery, volume, cpu
-module : clock   : true  : 1
-module : date    : true  : 60
+module : clock   : true : 1
+module : date    : true : 60
 module : battery : true : 30
-module : volume  : false  : 5
-module : cpu     : false : 3
+module : volume  : true : 5
+module : cpu     : true : 3
+
+# Prefix/icon shown before a module's output (needs a Nerd Font, see `font` above)
+# prefix : module_name : "icon "
+prefix : clock   : " "
+prefix : date    : " "
+prefix_cmd : battery : "~/.config/sxbar/scripts/battery_icon.sh"
+prefix_cmd : volume  : "~/.config/sxbar/scripts/volume_icon.sh"
+prefix     : cpu     : " "
+
+# Reserve a fixed pixel width per module so the rest of the bar doesn't
+# shift when a value's digit count changes (e.g. cpu: 9% -> 16%).
+# width : module_name : min_pixels
+# 48px covers icon + " " + up to "100%" in JetBrainsMono Nerd Font:size=10.
+width : battery : 48
+width : volume  : 48
+width : cpu     : 48
+
+
+colour : clock   : #50fa7b
+colour : volume  : #ff79c6
+colour : battery : #ffb86c
+colour : date    : #8be9fd
+

 # Custom script modules (like polybar exec)
 # Command must be quoted. Output is displayed in the bar.
diff --git a/install.sh b/install.sh
old mode 100644
new mode 100755
index 0e9117c..515e067
--- a/install.sh
+++ b/install.sh
@@ -25,9 +25,9 @@ sudo apt-get install -y \
     alsa-utils \
     patch \
     wget \
+    curl \
     unzip \
     fontconfig \
-    cargo

 mkdir -p "$BUILD_DIR"
 cd "$BUILD_DIR"
@@ -56,22 +56,23 @@ sudo make install
 cd "$BUILD_DIR"

 echo "==> Kopierar konfigfiler..."
-mkdir -p "$HOME/.config/kitty"
+mkdir -p "$HOME/.config/kitty" "$HOME/.config/sxbar"

 copy_config() {
     local src="$SCRIPT_DIR/config/$1"
-    local dst="$HOME/.config/$1"
+    local dst="$HOME/.config/$2"
+    mkdir -p "$(dirname "$dst")"
     if [ -f "$dst" ]; then
         cp "$dst" "$dst.bak"
-        echo "    $1 -> backup sparad: ~/.config/$1.bak"
+        echo "    $2 -> backup sparad: ~/.config/$2.bak"
     fi
     cp "$src" "$dst"
-    echo "    $1 -> ~/.config/$1"
+    echo "    $2 -> ~/.config/$2"
 }

-copy_config sxwmrc
-copy_config sxbarc
-copy_config kitty/kitty.conf
+copy_config sxwmrc sxwmrc
+copy_config sxbarc sxbar/sxbarc
+copy_config kitty/kitty.conf kitty/kitty.conf

 echo ""
 echo "==> Konfigurering av ~/.xinitrc"
@@ -106,6 +107,20 @@ else
     echo "  exec sxwm"
 fi

+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
+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"