dotfiles

<-- duh.
Log | Files | Refs | LICENSE

commit 58c53e4ea7db37ef28a3b4f1bcede4c82f4f2e16
parent 8f0af389dc9dacb94a8802b577b820c737f9a10a
Author: hhvn <dev@hhvn.uk>
Date:   Wed, 21 Jul 2021 14:06:07 +0100

.s/b/{mkcd,monitors.sh,fehffile,hb,0x0,ix,rand-sig,vimbhist,whatdoido,wifioff,xman,wfnintrpaste,wpa2-brute-force,torrentdone,toxclip,srssbnbc,reminder}: remove old unused scripts

Diffstat:
D.scripts/bin/0x0 | 3---
D.scripts/bin/fehffile | 20--------------------
D.scripts/bin/hb | 5-----
D.scripts/bin/ix | 3---
D.scripts/bin/mkcd | 6------
D.scripts/bin/monitors.sh | 2--
D.scripts/bin/rand-sig | 7-------
D.scripts/bin/reminder | 8--------
D.scripts/bin/srssbnbc | 157-------------------------------------------------------------------------------
D.scripts/bin/torrentdone | 4----
D.scripts/bin/toxclip | 4----
D.scripts/bin/vimbhist | 3---
D.scripts/bin/wfnintrpaste | 4----
D.scripts/bin/whatdoido | 9---------
D.scripts/bin/wifioff | 38--------------------------------------
D.scripts/bin/wpa2-brute-force | 6------
D.scripts/bin/xman | 4----
17 files changed, 0 insertions(+), 283 deletions(-)

diff --git a/.scripts/bin/0x0 b/.scripts/bin/0x0 @@ -1,3 +0,0 @@ -#!/bin/sh - -curl -n -F "file=@/dev/stdin" https://0x0.st < /dev/stdin | tee /dev/stderr | tr -d '\n' | xclip diff --git a/.scripts/bin/fehffile b/.scripts/bin/fehffile @@ -1,20 +0,0 @@ -#!/bin/sh -# -# fehffile -# Created by Hayden Hamilton -# -# hayden@haydenvh.com -# Copyright (c) 2020 Hayden Hamilton -backend="xwallpaper" - -[ "$backend" = "xwallpaper" ] && { - files=$(tr " " "\n" < $1 | 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 -} || { - files=$(tr " " "\n" < $1 | sed "s~^~--bg-fill ~g" | tr "\n" " ") - feh $files -} diff --git a/.scripts/bin/hb b/.scripts/bin/hb @@ -1,5 +0,0 @@ -#!/bin/sh - -cp /dev/stdin ~/net/paste/$1 -echo "gopher://haydenvh.com/p/paste/$1" | tee /dev/stderr | xclip - diff --git a/.scripts/bin/ix b/.scripts/bin/ix @@ -1,3 +0,0 @@ -#!/bin/sh - -curl -n -F "f:1=<-" http://ix.io < /dev/stdin | tee /dev/stderr | xclip diff --git a/.scripts/bin/mkcd b/.scripts/bin/mkcd @@ -1,6 +0,0 @@ -#!/bin/sh - -[ -z $1 ] || [ ! -z $2 ] && echo "usage: mkcd <dir>" && exit 1 - -mkdir "$1" -cd "$1" diff --git a/.scripts/bin/monitors.sh b/.scripts/bin/monitors.sh @@ -1,2 +0,0 @@ -#!/bin/sh -xrandr --output LVDS1 --primary --mode 1280x800 --pos 0x280 --rotate normal --output DP1 --off --output DP2 --off --output DP3 --off --output HDMI1 --off --output HDMI2 --off --output VGA1 --mode 1920x1080 --pos 1280x0 --rotate normal --output VIRTUAL1 --off diff --git a/.scripts/bin/rand-sig b/.scripts/bin/rand-sig @@ -1,7 +0,0 @@ -#!/bin/sh - -( - awk -v "user=$(whoami)" -F":" '$1 == user {print $5}' < /etc/passwd - sed '/^#/d' < $HOME/.config/neomutt/signatures | shuf | head -n 1 | tr '\t' '\n' | fold -sw 80 | sed 's/^/>/' -) > /tmp/signature -echo /tmp/signature diff --git a/.scripts/bin/reminder b/.scripts/bin/reminder @@ -1,8 +0,0 @@ -#!/bin/sh - -[ -z $1 ] && echo "usage: reminder <name of reminder> <time>" && exit - -file=$(mktemp) -echo "$1" > $file -shift -echo "export DISPLAY=\"$DISPLAY\"; st -e sh -c \"cat $file /dev/stdin; rm $file\"" | at "$@" diff --git a/.scripts/bin/srssbnbc b/.scripts/bin/srssbnbc @@ -1,157 +0,0 @@ -#!/bin/sh -# -# SRSSBNBC - simple RSSBNB client -# Created by Hayden Hamilton -# -# hayden@haydenvh.com -# Copyright (c) 2020 Hayden Hamilton -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -# SOFTWARE. -# -# This work is free. You can redistribute it and/or modify it under the -# terms of the Do What The Fuck You Want To Public License, Version 2, -# as published by Sam Hocevar. See http://www.wtfpl.net/ for more details. - - -cache=${XDG_CACHE_HOME:=$HOME/.cache} -config=${XDG_CONFIG_HOME:=$HOME/.config} - -[ "$1" = "-n" ] && grep -rnw $cache/srssbnbc/ -e 'Read[[:space:]]*:[[:space:]]*unread' | wc -l && exit -[ "$1" = "-h" ] && { - echo "usage: [-h] [-n] - --n count number of unread entries --h display this usage - -files: - $config/srssbnbc/feeds one rssbnbc url on each line - $config/srssbnbc/rss first column is a url, second is a name for the feed - columns are seperated with tab chars '\t'" && exit 1 -} - -parseconfig(){ - mkdir -p $config/srssbnbc - [ ! -f $config/srssbnbc/feeds ] && { - printf "No feed file!\nSyntax: url^1\n url^2\n ...\n url^N\n" - exit 1 - } - while IFS= read -r line - do - f=$(mktemp) - curl -qs $line > $f - parsefile $f "$(echo "$line" | base32)" "$line" - rm $f - done < $config/srssbnbc/feeds -} - -parserssconfig(){ - [ ! -f $config/srssbnbc/rss ] && return - - while IFS= read -r line - do - f=$(mktemp) - curl ${line%% *} > $f - sfeed < $f | sed 's/:/\&#58;/g;s/,/\&#44;/g' | awk ' - BEGIN { - FS="\t" - } - - //{print ":sub,"$2","$3","$4":"}' | sed 's~\\t~\t~g;s~\\n~\n~g;s~\\\\~\\~g' | awk '{a[i++]=$0} END {for (j=i-1; j>=0;) print a[j--] }'> $f - parsefile $f "$(echo "${line##* }" | base32 | head -n 1)" "${line%% *}" - printf "Read : Null\nTitle : %s\nLink :\n\n" "${line##* }" > $cache/srssbnbc/$(echo "${line##* }" | base32 | head -n 1)/main.txt - rm $f - done < $config/srssbnbc/rss -} - -parsefile(){ - # usage $1=file, $2=id, $3=name - mkdir -p $cache/srssbnbc/$2 -p - sed 's/\\:/\&#58;/g;s/\\,/\&#44;/g' < $1 | tr '\t\n:' '\f\t\n' | sed '/^[[:space:]]*$/d' | awk -v "cachedir=$cache/srssbnbc/$2" ' - BEGIN { - FS="," - count="0" - } - - $1 == "main" { - if (seenmain=="yes") - exit 2 - seenmain="yes" - printf("Read : Null\nTitle : %s\nLink : %s\n\n%s\n\n", $2, $3, $4) > cachedir"/main.txt" - } - - $1 != "main" { - count++ - vcount=sprintf("%06d", count) - if (system("test -f " cachedir"/"vcount".txt") != "0") - printf("Read : unread\nTitle : %s\nLink : %s\n\n%s\n", $2, $3, $4) > cachedir"/"vcount".txt" - } - ' - - [ "$?" = "2" ] && echo "Two 'main' items... quiting in feed $3" >/dev/stderr && return -} - -_ui(){ - count=0 - dirs=$(ls $cache/srssbnbc/ | nl) - IFS=' -' - while true - do - clear - - for d in $dirs - do - dir=$(echo "$d" | awk '{$1="";print $0}' | sed 's/[[:space:]]//g') - num=$(echo "$d" | awk '{print $1}') - name=$(grep 'Title[[:space:]]*:' < $cache/srssbnbc/$dir/main.txt | awk '{$1="";$2="";print $0}' | sed 's/^[[:space:]]*/ /') - unread=$(grep -rnw $cache/srssbnbc/$dir -e 'Read[[:space:]]*:[[:space:]]*unread' | wc -l) - [ $unread -gt 0 ] && echo "$num $name $(tput bold)*$unread UNREAD ENTRIES*$(tput sgr0)" || echo "$num $name" - done | sed 's/&#58;/:/g;s/&#44;/,/g' - - printf '\n\nSelect a feed: ' - read feed < /dev/tty - cd $cache/srssbnbc/$(echo "$dirs" | grep "^[[:space:]]*$feed[[:space:]]" | awk '{$1="";print $0}' | sed 's/[[:space:]]//g') - - while true - do - clear - - temp=$(mktemp) - files=$(ls | nl | sed '/main\.txt/d') - for f in $files - do - file=$(echo "$f" | awk '{$1="";print $0}' | sed 's/[[:space:]]//g') - num=$(echo "$f" | awk '{print $1}') - name=$(grep 'Title[[:space:]]*:' < $file | awk '{$1="";$2="";print $0}' | sed 's/^[[:space:]]*/ /') - grep 'Read[[:space:]]*:[[:space:]]*unread' < $file >/dev/null && echo "$num $name $(tput bold)*UNREAD*$(tput sgr0)" || echo "$num $name" - done > $temp - tail -n 20 < $temp | cat main.txt /dev/stdin | sed 's/&#58;/:/g;s/&#44;/,/g' - printf "\n\nSelect an item, 'list' - list all entries, 'q' - go back, 'a' - mark all as read: " - read choice < /dev/tty - [ "$choice" = "list" ] && less $temp && printf "\n\nSelect an item: " && read choice < /dev/tty - [ "$choice" = "q" ] && break - [ "$choice" = "a" ] && { - for f in $(find -type f); do out=$(sed '/^Read[[:space:]]*:[[:space:]]*unread/d' < $f); echo "$out" > $f; done - continue - } - fchoice=$(echo "$files" | grep "^[[:space:]]*$choice[[:space:]]*" | awk '{$1="";print $0}' | sed 's/[[:space:]]//g') - [ -f $fchoice ] && { - tr '\f\t' '\t\n' < $fchoice | sed 's/&#58;/:/g;s/&#44;/,/g' | less - out=$(sed '/^Read[[:space:]]*:[[:space:]]*unread/d' < $fchoice) - echo "$out" > $fchoice - } || echo 'entry does not exist' - rm $temp - done - done -} - - -parseconfig -parserssconfig -_ui diff --git a/.scripts/bin/torrentdone b/.scripts/bin/torrentdone @@ -1,4 +0,0 @@ -#!/bin/sh - -printf '\a' -herbe "Torrent finished" diff --git a/.scripts/bin/toxclip b/.scripts/bin/toxclip @@ -1,4 +0,0 @@ -#!/bin/sh -# put arg into xclip - -echo "$1" | xclip diff --git a/.scripts/bin/vimbhist b/.scripts/bin/vimbhist @@ -1,3 +0,0 @@ -#!/bin/sh - -tail -n 100 < ~/.config/vimb/history | dmenu -i | awk '{print $1}' | xclip diff --git a/.scripts/bin/wfnintrpaste b/.scripts/bin/wfnintrpaste @@ -1,4 +0,0 @@ -#!/bin/sh - -curl -F'file=@-' http://wfnintr.ne:1337 - diff --git a/.scripts/bin/whatdoido b/.scripts/bin/whatdoido @@ -1,9 +0,0 @@ -#!/bin/sh - -file "$1" -d=$(mktemp -d) -cp "$1" $d -cd $d -printf "What do I do with this? " -$SHELL -rm -rf $d diff --git a/.scripts/bin/wifioff b/.scripts/bin/wifioff @@ -1,38 +0,0 @@ -#!/bin/sh -# -# wifioff.sh -# Created by Hayden Hamilton -# -# hayden@haydenvh.com -# Copyright (c) 2020 Hayden Hamilton -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -# SOFTWARE. -# -# This work is free. You can redistribute it and/or modify it under the -# terms of the Do What The Fuck You Want To Public License, Version 2, -# as published by Sam Hocevar. See http://www.wtfpl.net/ for more details. -# -# depends: autowifi.sh's dependacies, and the env left from it - -[ $(id | sed -E 's~uid=([0-9]*).*~\1~') -eq 0 ] && super="" || { - command -v doas >/dev/null && super=doas || super=sudo -} - -# guess the wireless interface -[ -z $1 ] && { - interface=$(ip a | grep -o '^[0-9]*: w[^:]*:' | sed -E 's/[0-9]*: ([^:]*):/\1/') - echo "$interface" | grep '[[:alnum:]]' >/dev/null || { - echo "Couldn't guess the interface, please provide one as argument 1" - exit 1 - } -} || interface="$1" - -$super ifconfig $interface down -$super pkill wpa_supplicant -$super pkill dhclient diff --git a/.scripts/bin/wpa2-brute-force b/.scripts/bin/wpa2-brute-force @@ -1,6 +0,0 @@ -#!/bin/sh - -# this is what most factory default ISP-issued wifi APs' passphrases look like -# there are 2821109907456 different combinations.. so - -cat /dev/urandom | tr -dc 'A-Z0-9' | fold -w 8 diff --git a/.scripts/bin/xman b/.scripts/bin/xman @@ -1,4 +0,0 @@ -#!/bin/sh - -export MANPAGER=zathura -man -T pdf $1