From 4926542faa6f613b06ee26f11109877c47b8a3be Mon Sep 17 00:00:00 2001 From: ryan Date: Tue, 24 Jun 2025 20:18:39 -0400 Subject: [PATCH] host: add default tmux config --- Containerfile | 2 ++ src/host/rootfs/etc/inittab | 4 ++-- src/host/rootfs/etc/tmux.conf | 36 +++++++++++++++++++++++++++++++++++ 3 files changed, 40 insertions(+), 2 deletions(-) create mode 100644 src/host/rootfs/etc/tmux.conf diff --git a/Containerfile b/Containerfile index 78dda97..6042b5d 100644 --- a/Containerfile +++ b/Containerfile @@ -71,6 +71,7 @@ FROM stagex/user-usbmuxd@sha256:90f687d2368328b76141badc382a21873a5b44d4ddccf851 FROM stagex/user-socat@sha256:990a70ae13462d8ba0a925fe959dd83070cbecdb3f91ff145caca5232171f3b8 AS user-socat FROM stagex/user-dhcpcd@sha256:60bd86d9e2fcb6341c1efaeda5d786b63ff92e9d0c729cd8f634a20ff54ee71e AS user-dhcpcd FROM stagex/user-guestctl@sha256:95ad9e34a003c7d1d01f5d427b5f79d2430f6e6634debde8e54f9a6f08749704 AS user-guestctl +FROM stagex/user-tmux@sha256:57b63a27169a333edb073f1c6646a37ec6a9eee02ffdbc494a52bd6d670fc576 AS user-tmux FROM scratch AS base ARG VERSION development @@ -247,6 +248,7 @@ COPY --from=user-libzbar . initramfs COPY --from=user-keyfork . initramfs COPY --from=user-icepick . initramfs COPY --from=user-guestctl . initramfs +COPY --from=user-tmux . initramfs COPY src/host/rootfs/ initramfs COPY <<-EOF initramfs/etc/environment export VERSION="$VERSION" diff --git a/src/host/rootfs/etc/inittab b/src/host/rootfs/etc/inittab index 56b8725..a0e2999 100644 --- a/src/host/rootfs/etc/inittab +++ b/src/host/rootfs/etc/inittab @@ -21,9 +21,9 @@ null::sysinit:/bin/ln -sf /proc/self/fd/2 /dev/stderr # now run any rc scripts ::sysinit:/etc/init.d/rcS -# Put shells on the serial terminal and console +# Put a shell on serial and tmux on the console console::respawn:-/bin/bash -ttyS0::respawn:-/bin/bash +ttyS0::respawn:-/bin/bash /bin/tmux # Stuff to do for the 3-finger salute ::ctrlaltdel:/sbin/reboot diff --git a/src/host/rootfs/etc/tmux.conf b/src/host/rootfs/etc/tmux.conf new file mode 100644 index 0000000..a6581c9 --- /dev/null +++ b/src/host/rootfs/etc/tmux.conf @@ -0,0 +1,36 @@ +# Zero-based indexing is sure great in programming languages, +# but not so much in terminal multiplexers where that zero is +# all the way on the other side of the keyboard. +set-option -g base-index 1 + +set-option -g status on +set-option -g status-interval 1 + +# We should not have more than one session, but it's still possible. +# Therefore... +set-option -g status-left "[#S] " + +# Just so we can use `-ag` properly later +set-option -g status-right "" + +# The current power battery level +set-option -ag " [#(cat /sys/class/power_supply/BAT0/capacity)%%]" + +# Current date and time, in case it's relevant, and has drifted +set-option -ag status-right " [%Y-%m-%d %H:%M:%S]" + +# because cyan on black is cool, and pops out +set-option -g status-style "bg=color0 fg=color6" +set-option -g status-position bottom + +# we don't have much screen space, let's limit what's displayed +set-window-option -g window-status-bell-style "bold" +set-window-option -g window-status-current-format "#I:#W" +set-window-option -g window-status-format "#I:#W" + +# our "focused" window and pane is the brighter one +set-window-option -g window-status-style "fg=color6" +set-window-option -g window-status-current-style "fg=color14" +set-option -g pane-border-style "fg=color6" +set-option -g pane-active-border-style "fg=color14" +set-option -g message-style "fg=color6 bg=color0"