From 135c589c3fdd1abecf2410a9dd191011688be88a Mon Sep 17 00:00:00 2001 From: daemon Date: Mon, 16 Mar 2026 07:26:17 -0500 Subject: [PATCH] add install.sh --- install.sh | 60 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100755 install.sh diff --git a/install.sh b/install.sh new file mode 100755 index 0000000..0399f15 --- /dev/null +++ b/install.sh @@ -0,0 +1,60 @@ +#!/bin/sh +# install.sh - deploy openbsd-dots to $HOME +# run from the repo root + +set -e + +DOTS="$(cd "$(dirname "$0")" && pwd)" + +die() { echo "error: $1" >&2; exit 1; } +confirm() { + printf "%s [y/N] " "$1" + read ans + case "$ans" in y|Y) return 0 ;; *) return 1 ;; esac +} + +backup() { + [ -f "$1" ] && cp "$1" "$1.bak" && echo "backed up $1 -> $1.bak" +} + +echo "openbsd-dots installer" +echo "this will overwrite existing dotfiles (backups made)" +confirm "continue?" || exit 0 + +# shell +backup "$HOME/.profile" +backup "$HOME/.shrc" +cp "$DOTS/profile" "$HOME/.profile" +cp "$DOTS/shrc" "$HOME/.shrc" +echo "installed .profile .shrc" + +# vim +backup "$HOME/.vimrc" +cp "$DOTS/vimrc" "$HOME/.vimrc" +echo "installed .vimrc" + +# suckless configs - copy to src dirs if they exist +for tool in dwm st dmenu; do + dir="" + case "$tool" in + dwm) dir="$HOME/src/dwm" ;; + st) dir="$HOME/src/st" ;; + dmenu) dir="$HOME/src/dmenu" ;; + esac + src="$DOTS/${tool}-config.h" + if [ -d "$dir" ]; then + backup "$dir/config.h" + cp "$src" "$dir/config.h" + echo "installed $tool config.h -> $dir/config.h" + else + echo "skip $tool: $dir not found (clone sources first)" + fi +done + +echo "" +echo "done. notes:" +echo " - rebuild dwm/st/dmenu from src after install" +echo " - super+v opens st (no rexima on OpenBSD) -- use sndioctl manually" +echo " - volume keys use sndioctl output.level=+/-0.05" +echo " - X starts from /dev/ttyC0 (wscons tty1)" +echo " - install scientifica font: pkg_add scientifica"