From 03454613ae2a538ecddf64734e983699443d8be0 Mon Sep 17 00:00:00 2001 From: June McEnroe Date: Fri, 15 Sep 2017 11:30:20 -0400 Subject: Rename zsh scripts .zsh --- import.sh | 23 ----------------------- import.zsh | 21 +++++++++++++++++++++ install.sh | 28 ++++++++++++++-------------- link.sh | 39 --------------------------------------- link.zsh | 37 +++++++++++++++++++++++++++++++++++++ prune.sh | 10 ---------- prune.zsh | 9 +++++++++ 7 files changed, 81 insertions(+), 86 deletions(-) delete mode 100755 import.sh create mode 100755 import.zsh delete mode 100755 link.sh create mode 100755 link.zsh delete mode 100755 prune.sh create mode 100755 prune.zsh diff --git a/import.sh b/import.sh deleted file mode 100755 index d7c3b072..00000000 --- a/import.sh +++ /dev/null @@ -1,23 +0,0 @@ -#!/usr/bin/env zsh - -# Import a file from ~ and replace it with a symlink. - -set -o errexit -o nounset -o pipefail - -error() { - echo "$1" - exit 1 -} - -[ -z "$1" ] && error 'no path' - -source_path="$HOME/$1" -dest_path="$PWD/home/$1" - -[ -f "$dest_path" ] && error "$dest_path already exists" -[ -f "$source_path" ] || error "$source_path does not exist" - -mkdir -p "$(dirname "$dest_path")" -mv "$source_path" "$dest_path" -ln -s "$dest_path" "$source_path" -echo "link '$1'" >> link.sh diff --git a/import.zsh b/import.zsh new file mode 100755 index 00000000..6b69865a --- /dev/null +++ b/import.zsh @@ -0,0 +1,21 @@ +#!/usr/bin/env zsh +set -o errexit -o nounset -o pipefail + +# Import file from ~ and replace it with a symlink. + +fail() { + echo "$1" + exit 1 +} + +[ -z "$1" ] && fail 'no path' + +source_path="$HOME/$1" +dest_path="$PWD/home/$1" + +[ -f "$dest_path" ] && fail "$dest_path exists" + +mkdir -p "$(dirname "$dest_path")" +mv "$source_path" "$dest_path" +ln -s "$dest_path" "$source_path" +echo "link '$1'" >> link.zsh diff --git a/install.sh b/install.sh index 0684b053..2e159f5a 100755 --- a/install.sh +++ b/install.sh @@ -3,26 +3,26 @@ set -eu common='gdb git gnupg htop sl the_silver_searcher tree' +homebrew=https://raw.githubusercontent.com/Homebrew/install/master/install macos() { - homebrew=https://raw.githubusercontent.com/Homebrew/install/master/install - xcode-select --install || true - [ ! -f /usr/local/bin/brew ] && ruby -e "`curl -fsSL $homebrew`" - brew install $common - brew install ddate neovim/neovim/neovim openssh + xcode-select --install || true + [ ! -f /usr/local/bin/brew ] && ruby -e "`curl -fsSL $homebrew`" + brew install $common + brew install ddate neovim/neovim/neovim openssh } freebsd() { - pkg install $common - pkg install curl ddate neovim sudo zsh + pkg install $common + pkg install curl ddate neovim sudo zsh } arch() { - pacman -Sy - pacman -S --needed base-devel - pacman -S --needed $common - pacman -S --needed neovim openssh zsh + pacman -Sy + pacman -S --needed base-devel + pacman -S --needed $common + pacman -S --needed neovim openssh zsh } -[ "$(uname)" = 'Darwin' ] && macos && exit -[ -f /usr/local/sbin/pkg ] && freebsd && exit -[ -f /usr/bin/pacman ] && arch && exit +[ "$(uname)" = 'Darwin' ] && macos +[ -f /usr/local/sbin/pkg ] && freebsd +[ -f /usr/bin/pacman ] && arch diff --git a/link.sh b/link.sh deleted file mode 100755 index 4afde60c..00000000 --- a/link.sh +++ /dev/null @@ -1,39 +0,0 @@ -#!/usr/bin/env zsh - -# Create symlines in ~ for files in home. - -set -o errexit -o nounset -o pipefail - -error() { - echo "$1" - exit 1 -} - -link() { - local source_path="$PWD/home/$1" - local dest_path="$HOME/$1" - - [ -h "$dest_path" ] && return - [ -e "$dest_path" ] && error "$dest_path exists" - - mkdir -p "$(dirname "$dest_path")" - ln -s "$source_path" "$dest_path" - echo "$1" -} - -link '.bin/sup' -link '.bin/tup' -link '.bin/up' -link '.config/git/config' -link '.config/git/ignore' -link '.config/htop/htoprc' -link '.config/nvim/colors/trivial.vim' -link '.config/nvim/init.vim' -link '.config/nvim/syntax/nasm.vim' -link '.gdbinit' -link '.gnupg/gpg-agent.conf' -link '.hushlogin' -link '.inputrc' -link '.psqlrc' -link '.ssh/config' -link '.zshrc' diff --git a/link.zsh b/link.zsh new file mode 100755 index 00000000..13bb175b --- /dev/null +++ b/link.zsh @@ -0,0 +1,37 @@ +#!/usr/bin/env zsh +set -o errexit -o nounset -o pipefail + +# Create symbolic links in ~. + +fail() { + echo "$1" + exit 1 +} + +link() { + local source_path="$PWD/home/$1" + local dest_path="$HOME/$1" + + [ -L "$dest_path" ] && return + + mkdir -p "$(dirname "$dest_path")" + ln -s "$source_path" "$dest_path" + echo "$1" +} + +link '.bin/sup' +link '.bin/tup' +link '.bin/up' +link '.config/git/config' +link '.config/git/ignore' +link '.config/htop/htoprc' +link '.config/nvim/colors/trivial.vim' +link '.config/nvim/init.vim' +link '.config/nvim/syntax/nasm.vim' +link '.gdbinit' +link '.gnupg/gpg-agent.conf' +link '.hushlogin' +link '.inputrc' +link '.psqlrc' +link '.ssh/config' +link '.zshrc' diff --git a/prune.sh b/prune.sh deleted file mode 100755 index 09ed8d35..00000000 --- a/prune.sh +++ /dev/null @@ -1,10 +0,0 @@ -#!/usr/bin/env zsh - -# Remove symbolic links in ~ to files that no longer exist. - -set -o errexit -o nounset -o pipefail - -find -L ~ -type l -lname "$PWD/*" | while read link; do - rm "$link" - echo "$link" -done diff --git a/prune.zsh b/prune.zsh new file mode 100755 index 00000000..26dd27cc --- /dev/null +++ b/prune.zsh @@ -0,0 +1,9 @@ +#!/usr/bin/env zsh +set -o errexit -o nounset -o pipefail + +# Remove broken symbolic links in ~. + +find -L ~ -type l -lname "$PWD/*" | while read link; do + rm "$link" + echo "$link" +done -- cgit 1.4.1 c85b03f9c2a9b05ad721bb35348cccf5eb8&follow=1'>Fix adding /usr/games to PATHJune McEnroe I forgot that my own function only takes one parameter oops. 2021-02-09Show battery level while charging, time while dischargingJune McEnroe Also fix initial sleep calculation when seconds has a leading zero, and limit the length of time left for when it initially says "unknown". 2021-02-09Install sctJune McEnroe My eyes are so much happier with sct 4500 oh my god. 2021-02-09Show minutes left instead of battery percentageJune McEnroe 2021-02-09Set antialiasing and unhinting globallyJune McEnroe 2021-02-09Open youtube and twitch with mpvJune McEnroe 2021-02-09Add volume control bindings to cwmJune McEnroe sndioctl is nice and easy. 2021-02-09Use w3m to open other URLsJune McEnroe 2021-02-09Disable mouse mode in xtermJune McEnroe I do not ever want to use this feature. 2021-02-09Add pbcopy, pbpaste, open dispatch scriptsJune McEnroe 2021-02-09Use flags for pbd client behaviourJune McEnroe 2021-02-08Add macOS-like copy and paste to xtermJune McEnroe 2021-02-08Only update clock script every minuteJune McEnroe 2021-02-08Use 4M- for window resizing in cwmJune McEnroe 2021-02-08Tweak trackpad scaling, mouse accelerationJune McEnroe This feels more comfortable. 2021-02-08Use xsel in up and add it do install.shJune McEnroe 2021-02-07Swap root window coloursJune McEnroe 2021-02-07Add -X flag to install X stuff on OpenBSDJune McEnroe 2021-02-07Adjust brightness by smaller incrementsJune McEnroe 2021-02-07Fix cwm window cycling, move big by defaultJune McEnroe 2021-02-07Use class names for Foreground, Background, BorderColorJune McEnroe I'm not really sure what difference this makes, but it seems like the right thing to do to be generic? 2021-02-07Add simple battery status and clock to xsessionJune McEnroe I love how simple this is. 2021-02-07Set cursor theme and sizeJune McEnroe 2021-02-07Use scrot for up -s if no screencaptureJune McEnroe Still missing putting the URL in an X selection. 2021-02-07Enable mouse acceleration in XJune McEnroe 2021-02-07Set colours for Xt and cwmJune McEnroe And increase XTerm internalBorder. 2021-02-07Set urgency on bell in xtermJune McEnroe 2021-02-07Add bindings for brightness controlJune McEnroe Weirdly the Fn key doesn't change how the F row registers... I wonder if I can do something about that. 2021-02-07Set X key repeat rateJune McEnroe 2021-02-07Bump font size to 12June McEnroe 11 is what I use on macOS, but I feel like my eyes are working harder here. 2021-02-07Fully configure and rebind cwmJune McEnroe This is sort of a mix of trying to emulate macOS somewhat for my muscle memory and just rebinding some of the cwm defaults to use 4- rather than M-. 2021-02-07Add BintiJune McEnroe 2021-02-07Finish configuring xtermJune McEnroe 2021-02-06Enable tapping, reverse scroll, set scaling in wsconsctlJune McEnroe 2021-02-06Set root window to black on purple snowJune McEnroe 2021-02-06Add xmodmap configurationJune McEnroe 2021-02-06Add initial OpenBSD X configurationJune McEnroe cwm still needs a lot more rebinding, and I need to actually look at its other options. xterm definitely still needs some configuration, but I at least managed to get it to use a decent looking font. Very happy that OpenBSD includes Luxi Mono, which is what my usual font, Go Mono, is based on anyway. Still missing is xmodmap and such. 2021-02-06Add xterm output to schemeJune McEnroe