This commit is contained in:
David Tomaschik
2026-04-21 15:59:38 -07:00
parent fec16225e4
commit db2c02bd2d
27 changed files with 150 additions and 55 deletions

35
bin/linux/setup/apt_proxy.sh Executable file
View File

@@ -0,0 +1,35 @@
#!/bin/bash
set -o errexit
set -o nounset
if test -f /etc/apt/apt.conf.d/90-proxy ; then
echo "Looks already setup."
exit 0
fi
cat >/etc/apt/proxy-detect <<'EOF'
#!/bin/bash
PROXY=192.168.60.10:3142
if ! test -x /bin/nc ; then
echo DIRECT
exit 0
fi
if nc -w 2 -z ${PROXY/:/ } ; then
echo ${PROXY}
exit 0
fi
echo DIRECT
EOF
chmod 755 /etc/apt/proxy-detect
cat >/etc/apt/apt.conf.d/90-proxy <<'EOF'
Acquire::http::Proxy-Auto-Detect "/etc/apt/proxy-detect";
EOF
echo "Setup APT Proxying."

5
bin/linux/setup/i3.sh Executable file
View File

@@ -0,0 +1,5 @@
#!/bin/bash
apt-get install -y \
i3 i3lock xss-lock rxvt-unicode-256color fonts-inconsolata scrot \
xautolock xbacklight i3status dex libnotify-bin

View File

@@ -0,0 +1,18 @@
#!/bin/bash
set -ue
cat >/usr/local/bin/x-resize <<"EOF"
#!/bin/sh
PATH=/usr/bin:/bin:/usr/local/bin
desktopuser=$(/bin/ps -ef | /bin/grep -oP '^\w+ (?=.*vdagent( |$))') || exit 0
export DISPLAY=:0
export XAUTHORITY=$(eval echo "~$desktopuser")/.Xauthority
/usr/bin/xrandr --output $(/usr/bin/xrandr | awk '/ connected/{print $1; exit; }') --auto
EOF
chmod 755 /usr/local/bin/x-resize
cat >/etc/udev/rules.d/50-resize.rules <<"EOF"
ACTION=="change",KERNEL=="card0", SUBSYSTEM=="drm", RUN+="/usr/local/bin/x-resize"
EOF
chmod 644 /etc/udev/rules.d/50-resize.rules