commit fcaad27af6eebb2e6537a0e680d98c67314894a8
parent 7dad9e05050504f68e3eaba5db079cfcde025d02
Author: hhvn <dev@hhvn.uk>
Date: Sat, 8 Jan 2022 15:58:19 +0000
./.scripts: remove old stuff
Diffstat:
24 files changed, 0 insertions(+), 454 deletions(-)
diff --git a/.scripts/addtorrent b/.scripts/addtorrent
@@ -1,7 +0,0 @@
-#!/bin/sh
-
-[ "$1" = "xclip" ] && set -- "$(xclip -o)"
-
-pgrep transmission || transmission-daemon -g ~/.config/transmission
-transmission-remote -a "$@"
-herbe "Torrent added"
diff --git a/.scripts/asciiclip b/.scripts/asciiclip
@@ -1,22 +0,0 @@
-#!/bin/sh
-
-chars="‾ (overline)
-░ (block)
-▒ (block)
-▓ (block)
-█ (block)
-┌ (box)
-┐ (box)
-┼ (box)
-┘ (box)
-┤ (box)
-├ (box)
-└ (box)"
-
-#NOTE: a char being in this file, does not mean you should use it! Avoid the box
-#drawing chars, as your art becomes TOO bland if they are everywhere.
-
-chars=$(echo "$chars" | nl | tee /dev/stderr)
-printf 'Select a number: '
-read num < /dev/tty
-echo "$chars" | grep "^[[:space:]]*$num[[:space:]]" | awk '{print $2}' | tr -d '[[:space:]]' | xclip
diff --git a/.scripts/centre b/.scripts/centre
@@ -1,24 +0,0 @@
-#!/bin/sh
-
-raw=$(sed 's/[[:space:]]*$//' < /dev/stdin)
-raww=$(echo "$raw" | ul | sed "s,\x1B\[[0-9;]*[a-zA-Z],,g" | wc -L)
-rawh=$(echo "$raw" | ul | sed "s,\x1B\[[0-9;]*[a-zA-Z],,g" | wc -l)
-
-w=$(tput cols)
-h=$(tput lines)
-
-blankw=$(((w-raww)/2))
-blankh=$(((h-rawh)/2))
-
-padw=$(for void in $(seq $blankw); do printf " "; done)
-
-display=$(echo "$raw" | sed "s/^/$padw/")
-
-clear
-(
- [ $raww -gt $w ] && echo "$display" || {
- for void in $(seq $blankh); do printf "\n"; done
- echo "$display"
- for void in $(seq $blankh); do printf "\n"; done
- };
-) | less
diff --git a/.scripts/chradio b/.scripts/chradio
@@ -1,15 +0,0 @@
-#!/bin/sh
-
-station=$(echo "http://relay4.slayradio.org:8000/
-http://bitreich.org:3232/live
-https://hls.absoluteradio.co.uk/absoluteclassicrock.aac/playlist.m3u8
-https://hls.absoluteradio.co.uk/absolute60s.aac/playlist.m3u8
-https://hls.absoluteradio.co.uk/absolute70s.aac/playlist.m3u8
-https://hls.absoluteradio.co.uk/absolute80s.aac/playlist.m3u8
-https://hls.absoluteradio.co.uk/absolute90s.aac/playlist.m3u8
-https://hls.absoluteradio.co.uk/absolute00s.aac/playlist.m3u8
-https://hls.absoluteradio.co.uk/absolute10s.aac/playlist.m3u8
-https://hls.absoluteradio.co.uk/absoluteradio.aac/playlist.m3u8
-https://hls.absoluteradio.co.uk/absoluteradio.aac/playlist.m3u8" | dmenu -i)
-
-mpv --input-ipc-server=/tmp/mpv-socket3 $station
diff --git a/.scripts/chrtmp b/.scripts/chrtmp
@@ -1,5 +0,0 @@
-#!/bin/sh
-
-station=$(echo "rtmp://flatearth.nop.ninja/live/saturday-night" | dmenu -i)
-
-mpv --input-ipc-server=/tmp/mpv-socket3 $station
diff --git a/.scripts/dimg b/.scripts/dimg
@@ -1,29 +0,0 @@
-#!/bin/sh
-#
-# dimg
-# Created by Hayden Hamilton
-#
-# hayden@haydenvh.com
-# Copyright (c) 2020 Hayden Hamilton
-
-${XDG_CACHE_HOME:=$HOME/.cache}
-cache=$XDG_CACHE_HOME
-
-printf '' > /tmp/dimg
-[ ! -z $1 ] && dir="$1" || dir="$HOME/general/images/wallpapers/"
-
-setwall(){
- monitors=$(xrandr --listmonitors | awk '/Monitors/{print $2}')
- for i in $(seq $monitors)
- do
- files="$files $(find $dir -type f | shuf | dmenu -i)"
- done
-
- echo "$files" | sed 's/^[[:space:]]*//g;s/[[:space:]]*$//g' > $cache/rfeh/prev
- fehffile $cache/rfeh/prev
-}
-
-case $(printf 'wallpaper\nview' | dmenu -i -p 'Select option:') in
- view) sxiv $(find $dir -type f | shuf | dmenu -i -p "Select image:") ;;
- wallpaper) setwall ;;
-esac
diff --git a/.scripts/fileoccur b/.scripts/fileoccur
@@ -1,3 +0,0 @@
-#!/bin/sh
-
-grep "$@" -R . 2>&1 | grep -Ev '\.git|^grep' | grep -o '[^:]*:' | sed 's/:$//' | uniq
diff --git a/.scripts/filesed b/.scripts/filesed
@@ -1,11 +0,0 @@
-#!/bin/sh
-
-[ -z $1 ] && echo "usage: <sed exp> <file> ..."
-
-sedexp="$1"
-shift
-
-for file in $@
-do
- mv "$file" "$(echo "$file" | sed "$sedexp")"
-done
diff --git a/.scripts/githubraw b/.scripts/githubraw
@@ -1,5 +0,0 @@
-#!/bin/sh
-
-[ -z $1 ] && echo "usage: $(basename $0) <url>" && exit 1
-
-echo "$1" | sed 's/github.com/raw.githubusercontent.com/;s~/blob/~/~'
diff --git a/.scripts/googlegopher b/.scripts/googlegopher
@@ -1,5 +0,0 @@
-#!/bin/sh
-#
-# see gopher://haydenvh.com/1/alcl/write/other/00060-new.thinkpad.new.phone.oh.and.also.thanks.google.-.120920.gph
-
-w3m "https://www.google.com/search?q=site:haydenvh.com$(echo " $1" | xxd -p | tr -d '\n' | sed 's/../%&/g')"
diff --git a/.scripts/hmpv b/.scripts/hmpv
@@ -1,95 +0,0 @@
-#!/bin/sh
-#
-# hmpv
-# Created by Hayden Hamilton
-#
-# hayden@haydenvh.com
-# Copyright (c) 2019-2020 Hayden Hamilton.
-
-action=$1
-socket=$2
-pause() {
- echo '{ "command": ["set_property", "pause", true] }' | socat - $socket > /dev/null
-}
-unpause() {
- echo '{ "command": ["set_property", "pause", false] }' | socat - $socket > /dev/null
-}
-getstate() {
- stateraw=$(echo '{ "command": ["get_property", "pause"] }' | socat - $socket 2>/dev/null | tr '{":0,}' ' ' | awk '// {print $2}')
- if [ "$stateraw" = "true" ]
- then
- state="paused"
- elif [ "$stateraw" = "false" ]
- then
- state="playing"
- else
- echo "No state returned..."
- exit 1
- fi
-}
-toggle() {
- getstate
- if [ "$state" = "playing" ]
- then
- pause
- elif [ "$state" = "paused" ]
- then
- unpause
- else
- echo "State is undeciferable..."
- exit 1
- fi
-}
-seek() {
- if [ "$action" = "forward" ]
- then
- echo '{ "command": ["seek", "10"] }' | socat - $socket > /dev/null
- elif [ "$action" = "back" ]
- then
- echo '{ "command": ["seek", "-10"] }' | socat - $socket > /dev/null
- elif [ "$action" = "next" ]
- then
- echo '{ "command": ["playlist-next"] }' | socat - $socket > /dev/null
- elif [ "$action" = "prev" ]
- then
- echo '{ "command": ["playlist-prev"] }' | socat - $socket > /dev/null
- fi
-}
-convertsecs() {
- h=$((${1}/3600))
- m=$(((${1}%3600)/60))
- s=$((${1}%60))
- printf "%02d:%02d:%02d\n" $h $m $s
-}
-gettime() {
- convertsecs $(echo '{ "command": ["get_property", "playback-time"] }' | socat - $socket | tr '{":,}' ' ' | awk '// {print $2}' | sed 's/\./ /g' | awk '// {print $1}')
-}
-quit() {
- echo '{ "command": ["quit"] }' | socat - $socket > /dev/null
- rm /tmp/blocks/mpv
- rm /tmp/dwmblocks/mpv
- rm /tmp/blocks/mpv
- rm /tmp/dwmblocks/mpv
-}
-
-if [ "$action" = "toggle" ]
-then
- toggle
-elif [ "$action" = "quit" ]
-then
- quit
-elif [ "$action" = "pause" ]
-then
- pause
-elif [ "$action" = "unpause" ]
-then
- unpause
-elif [ "$action" = "state" ]
-then
- getstate; echo "$state"
-elif [ "$action" = "time" ]
-then
- gettime
-else
- seek
-fi
diff --git a/.scripts/kshrcremote b/.scripts/kshrcremote
@@ -1,30 +0,0 @@
-#!/bin/sh
-
-[ -z $1 ] && echo "usage: kshrcremote <[user@]hostname> [other users]" && exit 1
-host=$1
-shift
-
-for i in 8 9 10 11 12 13 14 15
-do
- tput setab $i
- printf ' '
- tput sgr0
- tput setaf $i
- printf '%03d' $i
- tput sgr0
- tput setab $i
- printf ' '
- tput sgr0
- echo
-done
-printf "Colour? "
-read c </dev/tty
-
-rm /tmp/kshrc
-cat $HOME/.config/ksh/* | sed -E "s/setaf 5/setaf $c/g;"'s/setaf ([0-9]*)/setaf \1 \1 \1/g' > /tmp/kshrc
-scp /tmp/kshrc $host:.profile
-for u in $@
-do
- ssh -o "ControlMaster=auto" -o "ControlPath=/tmp/kshrcremote.%h.%p.%r.sock" -o "ControlPersist=1m" $host sh -c 'sudo cp $HOME/.profile '"/home/$u/.profile"' && doas cp $HOME/.profile'"/home/$u/.profile"
-done
-ssh $host
diff --git a/.scripts/maemo-launch b/.scripts/maemo-launch
@@ -1,10 +0,0 @@
-#!/bin/sh
-
-export ML=maemo-launch
-[ -f $HOME/.scripts/maemo/"$1" ] && {
- a1="$1"
- shift
- $HOME/.scripts/maemo/"$a1" $@
-} || {
- $@
-}
diff --git a/.scripts/mustfix b/.scripts/mustfix
@@ -1,7 +0,0 @@
-#!/bin/sh
-
-locate -b .mustfix | while IFS= read -r f
-do
- printf "$f: "
- cat "$f"
-done
diff --git a/.scripts/newtab b/.scripts/newtab
@@ -1,4 +0,0 @@
-#!/bin/sh
-
-read txid < /tmp/txid
-nohup st -w $txid -e cgo haydenh.null > /dev/null &
diff --git a/.scripts/number b/.scripts/number
@@ -1,5 +0,0 @@
-#!/bin/sh
-
-[ -z $1 ] && echo "usage: number <number> <file>" && exit
-
-mv "$2" "$1.-.$2"
diff --git a/.scripts/nwatched b/.scripts/nwatched
@@ -1,27 +0,0 @@
-#!/bin/sh
-#
-# nwatched - a script for finding unwatched files in a fs hierarchy
-#
-# Create a dir, inside it a subdir for each video
-#
-# eg:
-# videos/film1
-# videos/film2
-# videos/film3
-#
-# nwatched will output all 3 dirs
-#
-# Now, if you watch 'film2', create the file videos/film2/WATCHED, nwatched
-# will instead only output:
-#
-# videos/film1
-# videos/film3
-#
-# Useful? :)
-
-[ -z $1 ] 2>/dev/null && echo "usage: nwatched /path/to/dir" && exit 1
-
-watched=$(find "$1" | grep 'WATCHED$' | sed 's~/WATCHED$~~')
-all=$(find "$1" -type d)
-
-printf "$watched\n$all\n" | sort | uniq -c | awk '$1 != 2 {$1=""; print}'
diff --git a/.scripts/qmap b/.scripts/qmap
@@ -1,3 +0,0 @@
-#!/bin/sh
-
-sudo nmap -A -T4 -Pn -sS $@ | less
diff --git a/.scripts/radio b/.scripts/radio
@@ -1,4 +0,0 @@
-#!/bin/sh
-
-mpv $1 --input-ipc-server=/tmp/mpv-socket3
-
diff --git a/.scripts/rwall b/.scripts/rwall
@@ -1,59 +0,0 @@
-#!/bin/sh
-#
-# rwall
-# Created by Hayden Hamilton
-#
-# hayden@haydenvh.com
-# Copyright (c) 2020 Hayden Hamilton
-
-for arg in "$@"
-do
- case $arg in
- --left) monitors="$monitors left" ;;
- --right) monitors="$monitors right" ;;
- --all) monitors="" ;;
- --prev|--back) doprev=1 ;;
- *) dir="$arg" ;;
- esac
-done
-
-setwall(){
- files=$(echo "$1" | sed 's/^[[:space:]]*//' | tr " " "\n" | sed "s~^~--output OUTPUT --zoom ~g" | tr "\n" " ")
- for OUTPUT in $(xrandr --listactivemonitors | awk '$4 {print $4}')
- do
- files=$(echo "$files" | sed "s/OUTPUT/$OUTPUT/")
- done
- xwallpaper $files
-}
-
-randomizer(){
- found=$(find $dir -type f \( -name "*.png" -o -name "*.jpg" \))
- fnum=$(echo "$found" | wc -l)
- sran=$(od -vAn -N2 -tu2 < /dev/urandom)
- nran=$((1+$sran%$fnum))
- echo "$found" | awk "NR==$nran {print"' $0}'
-}
-
-randomizerM(){
- for void in $(seq $(xrandr --listactivemonitors | awk '/Monitors/ {print $2}'))
- do
- output="$output $(randomizer)"
- done
- echo "$output"
-}
-
-[ "$doprev" = "1" ] && {
- [ "$monitors" = "" ] && files=$(tail -2 < ~/.cache/rfeh/prev | head -1) && head -n -1 < ~/.cache/rfeh/prev | tee ~/.cache/rfeh/prev > /dev/null
- [ "$(echo "$monitors" | grep "left")" != "" ] && files="$(tail -2 < ~/.cache/rfeh/left | head -1) $(tail -1 < ~/.cache/rfeh/right)" && head -n -1 < ~/.cache/rfeh/left | tee ~/.cache/rfeh/left > /dev/null
- [ "$(echo "$monitors" | grep "right")" != "" ] && files="$(tail -1 < ~/.cache/rfeh/left) $(tail -2 < ~/.cache/rfeh/right | head -1)" && head -n -1 < ~/.cache/rfeh/right | tee ~/.cache/rfeh/right > /dev/null
- echo "$files"
- setwall "$files"
-} || {
- [ "$monitors" = "" ] && files=$(randomizerM)
- [ "$(echo "$monitors" | grep "left")" != "" ] && files="$(randomizer) $(tail -1 < ~/.cache/rfeh/right)"
- [ "$(echo "$monitors" | grep "right")" != "" ] && files="$(tail -1 < ~/.cache/rfeh/left) $(randomizer)"
- echo "$files" | awk '{print $1}' >> ~/.cache/rfeh/left
- echo "$files" | awk '{print $2}' >> ~/.cache/rfeh/right
- echo "$files" >> ~/.cache/rfeh/prev
- setwall "$files"
-};
diff --git a/.scripts/shmenu b/.scripts/shmenu
@@ -1,62 +0,0 @@
-#!/bin/sh
-
-[ -z $1 ] && echo "usage: shmenu <prompt>
-
-stdin is given to the user to search through
-stdout contains the selection
-stderr contains the user interface
-
-Use ctrl+h or ctrl+l to navigate between options." && exit
-
-cleanup(){
- tput cnorm
- stty icanon
- clear > /dev/stderr
- echo "$files" | grep -i "$query" | tail -n $selected | head -n 1
- exit
-}
-
-trap cleanup 2
-
-files=$(cat /dev/stdin)
-tput civis
-stty -icanon </dev/tty >/dev/stderr
-
-selected=1
-IFS=''
-while true
-do
- query=".*$(echo "$prev" | sed 's/./&\.\*/g')" # fuzzyfy
- output=$(echo "$files" | grep -i "$query")
- [ "$output" != "$oldoutput" ] && {
- clear > /dev/stderr
- echo "$output" | sed 's/^/ /g' > /dev/stderr
- printf "$(tput setaf 10)$1>$(tput sgr0) $prev" > /dev/stderr
- }
- [ $(echo "$output" | wc -l) -gt $(tput lines) ] && {
- len=$(($(tput lines)-1-$selected))
- } || {
- len=$(($(echo "$output" | wc -l)-$selected))
- }
- tput sc >/dev/stderr
- tput cup $(($len-1)) 0 >/dev/stderr
- printf ' ' >/dev/stderr
- tput cup $(($len)) 0 >/dev/stderr
- tput setaf 7 >/dev/stderr
- printf -- '>-' >/dev/stderr
- tput sgr0 >/dev/stderr
- tput cup $(($len+1)) 0 >/dev/stderr
- printf ' '
- tput rc >/dev/stderr
- tput cnorm
- key=$(dd bs=1 count=1 </dev/tty 2>/dev/null)
- tput civis
- oldoutput="$output"
- [ "$key" = "$(echo)" ] && cleanup
- echo "$key" | grep "">/dev/null && selected=$(($selected+1)) && continue
- echo "$key" | grep "">/dev/null && { [ ! $selected -eq 1 ] && selected=$(($selected-1)); } && continue
- newkey=$(echo "$key" | grep '[[:print:]]')
- [ "$newkey" = "" ] && prev=$(echo "$prev" | sed 's/.$//') || prev="${prev}${newkey}"
-done
-
-cleanup
diff --git a/.scripts/sshdatesync b/.scripts/sshdatesync
@@ -1,7 +0,0 @@
-#!/bin/sh
-
-[ "$2" = "out" ] && {
- ssh "$1" "${3:-doas}" sh -c 'date --set "'"$(date)"'"'
-} || {
- doas date --set "$(ssh "$1" date)"
-}
diff --git a/.scripts/swamp b/.scripts/swamp
@@ -1,4 +0,0 @@
-#!/bin/sh
-
-cp /dev/stdin /tmp/swamp
-scp /tmp/swamp "hhvn@dataswamp.org:/home/hhvn/public_gph/$1"
diff --git a/.scripts/voidupdate b/.scripts/voidupdate
@@ -1,11 +0,0 @@
-#!/bin/sh
-
-doas xbps-install -Syu xbps
-doas xbps-install -yu
-doas xbps-remove -Ooy
-doas rm -rf ~/.cache/vimb ~/.mozilla ~/.local/share/webkitgtk ~/.viminfo ~/.wget-hsts ~/.lesshst ~/.sh_history ~/.python_history ~/.*history ~/.*hst* ~/.dbus ~/.w3m ~/.config/vimb/cookies.db
-doas vkpurge rm all
-(
- getascii voidlinux
- printf "\n\nUpdate finished."
-) | xargs -d "\n" herbe