summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Ulmer <thomasmulmer02@gmail.com>2026-06-19 11:12:47 -0700
committerThomas Ulmer <thomasmulmer02@gmail.com>2026-06-19 11:12:47 -0700
commit98120e50c940354ac70c21a1f0ad89b8ef3568ae (patch)
treeecb379883cc5039b62bb81a892eb243f46881fdf
parent2bc6652ba8e4802f0601d90d593e9a377e9581b7 (diff)
simplify/portify the setup scripts
-rw-r--r--ensureddirs.csv2
-rw-r--r--install.awk64
-rwxr-xr-xscripts/misc/lk.sh4
-rwxr-xr-xsetup.sh38
-rw-r--r--symlinks.csv20
5 files changed, 32 insertions, 96 deletions
diff --git a/ensureddirs.csv b/ensureddirs.csv
deleted file mode 100644
index 1f249b9..0000000
--- a/ensureddirs.csv
+++ /dev/null
@@ -1,2 +0,0 @@
-.config
-.local/bin
diff --git a/install.awk b/install.awk
deleted file mode 100644
index 78c9f94..0000000
--- a/install.awk
+++ /dev/null
@@ -1,64 +0,0 @@
-function path_join(a, b, x, y) {
- x = a
- y = b
-
- sub(/\/+$/, "", x) # remove trailing / from a
- sub(/^\/+/, "", y) # remove leading / from b
-
- if (x == "")
- return y
- if (y == "")
- return x
-
- return x "/" y
-}
-
-BEGIN { FS = "," } ;
-ARGIND == 1 {
- # requested dirs
- dir=path_join(ENVIRON["HOME"], $1)
- cmd="mkdir -p " dir
- print cmd
- system(cmd)
-
- next
-}
-
-ARGIND == 2 {
- # block for locations
- src=path_join(ENVIRON["PWD"], $1)
- dst=path_join(ENVIRON["HOME"], $2)
- testcmd="test -e " dst
- linkcmd="ln -sf " src " " dst
- diffcmd="diff -ursN " dst " " src
-
- if (system(testcmd) == 0) {
- system("ls -lda " dst)
- printf "Exists, overwrite? y/N/d" # no newline
- getline resp < "/dev/tty"
- while (1) {
- if (resp == "d" || resp == "D") {
- # dst is exists src is new, order is right
- print "Showing diff to apply (empty is none)"
- system(diffcmd)
- printf "Exists, overwrite? y/N/d" # no newline
- getline resp < "/dev/tty"
- continue
- } else if (resp == "y" || resp == "Y") {
- print linkcmd
- system(linkcmd)
- break
- } else if (resp == "n" || resp == "N" || resp == "") {
- print "Skipped"
- break
- }
- print "Exists, overwrite? y/N/d"
- getline resp < "/dev/tty"
- }
- } else {
- print linkcmd
- system(echo linkcmd)
- }
-}
-
-
diff --git a/scripts/misc/lk.sh b/scripts/misc/lk.sh
index 5f760c6..c68cc51 100755
--- a/scripts/misc/lk.sh
+++ b/scripts/misc/lk.sh
@@ -1,11 +1,11 @@
-#!/bin/bash
+#!/bin/sh
# This is helper that should replace a number of common commands
#
# It is intended to be named `lk`, short for "look"
longView=${PAGER:-$(which less || which more || echo "cat")}
-dirView="ls --color=always -Alh"
+dirView="ls -Alh"
if [ $# -lt 1 ]; then
# take stdin instead
diff --git a/setup.sh b/setup.sh
index f9d4e24..48cc435 100755
--- a/setup.sh
+++ b/setup.sh
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/bin/sh
set -e
@@ -10,17 +10,39 @@ fi
git submodule update --init --recursive
confirm () {
- [[ "$(read -e -p "$1 [y/N]> "; echo $REPLY)" == [Yy]* ]]
+ read -e -p "$1 [y/N]> "
+ echo $REPLY | grep -qi "y"
}
if confirm "Check and install symlinks?"; then
- awk -f install.awk ensureddirs.csv symlinks.csv
-fi
-if confirm "Build Emacs?"; then
- cd emacs-source
- ./setup.sh
- cd ..
+ here="/home/tmu/dotfiles/"
+ there="/home/tmu/"
+ mkdir -p ${there}.config
+ mkdir -p ${there}.local/bin
+
+ ln -s ${here}config/emacs ${there}.emacs.d
+ ln -s ${here}config/bash_profile ${there}.bash_profile
+ ln -s ${here}config/bashrc ${there}.bashrc
+ ln -s ${here}config/bash_aliases ${there}.bash_aliases
+ ln -s ${here}config/tcshrc ${there}.tcshrc
+ ln -s ${here}config/xinitrc ${there}.xinitrc
+ ln -s ${here}config/tmux.conf ${there}.tmux.conf
+ ln -s ${here}config/xserverrc ${there}.xserverrc
+ ln -s ${here}config/Xdefaults ${there}.Xdefaults
+ ln -s ${here}config/alacritty ${there}.config/alacritty
+ ln -s ${here}config/qutebrowser ${there}.config/qutebrowser
+ ln -s ${here}config/fbterm/fbtermrc ${there}.config/fbtermrc
+ ln -s ${here}config/fbterm/fbterm-emacs.sh ${there}.local/bin/fbterm-emacs.sh
+
+ ln -s ${here}scripts/brightness/brightnessup ${there}.local/bin/brightnessup
+ ln -s ${here}scripts/brightness/brightnessdown ${there}.local/bin/brightnessdown
+ ln -s ${here}scripts/brightness/brightnessmax ${there}.local/bin/brightnessmax
+ ln -s ${here}scripts/volume/volumeup ${there}.local/bin/volumeup
+ ln -s ${here}scripts/volume/volumedown ${there}.local/bin/volumedown
+ ln -s ${here}scripts/volume/volumemute ${there}.local/bin/volumemute
+ ln -s ${here}scripts/misc/lk.sh ${there}.local/bin/lk
+ ln -s ${here}scripts/misc/battery.sh ${there}.local/bin/tmubattery
fi
echo "All set up, remember to source ~/.bash_profile and symlink tmubrowse and tmuterm."
diff --git a/symlinks.csv b/symlinks.csv
deleted file mode 100644
index 1a8ae11..0000000
--- a/symlinks.csv
+++ /dev/null
@@ -1,20 +0,0 @@
-config/emacs,.emacs.d
-config/bash_profile,.bash_profile
-config/bashrc,.bashrc
-config/bash_aliases,.bash_aliases
-config/tcshrc,.tcshrc
-config/xinitrc,.xinitrc
-config/tmux.conf,.tmux.conf
-config/xserverrc,.xserverrc
-config/Xdefaults,.Xdefaults
-config/alacritty,.config/alacritty
-config/qutebrowser,.config/qutebrowser
-config/fbterm/fbtermrc,.config/fbtermrc
-config/fbterm/fbterm-emacs.sh,.local/bin/fbterm-emacs.sh
-scripts/brightness/brightnessup,.local/bin/brightnessup
-scripts/brightness/brightnessdown,.local/bin/brightnessdown
-scripts/brightness/brightnessmax,.local/bin/brightnessmax
-scripts/volume/volumeup,.local/bin/volumeup
-scripts/volume/volumedown,.local/bin/volumedown
-scripts/volume/volumemute,.local/bin/volumemute
-scripts/misc/lk.sh,.local/bin/lk