dotfiles

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

commit 8a683fb5ed0c07bd306e168b4f18aebe7a59f25c
parent 2d8f6ab523e8287a99112e7f844b6ee450ed3e09
Author: hhvn <hayden@haydenvh.com>
Date:   Mon, 26 Oct 2020 13:21:42 +0000

moving scripts around

Diffstat:
M.config/neomutt/neomuttrc | 3++-
M.config/zsh/.zshrc | 1+
D.scripts/bin/README | 5-----
R.scripts/bin/dmenu/addrbook -> .scripts/bin/addrbook | 0
R.scripts/bin/misc/alcl -> .scripts/bin/alcl | 0
R.scripts/bin/misc/asciiclip -> .scripts/bin/asciiclip | 0
R.scripts/bin/misc/asplit -> .scripts/bin/asplit | 0
A.scripts/bin/autowifi | 56++++++++++++++++++++++++++++++++++++++++++++++++++++++++
R.scripts/bin/misc/backronym -> .scripts/bin/backronym | 0
A.scripts/bin/bandcampdl | 24++++++++++++++++++++++++
R.scripts/bin/misc/bandcampsrch -> .scripts/bin/bandcampsrch | 0
R.scripts/bin/misc/centre -> .scripts/bin/centre | 0
R.scripts/bin/dmenu/chradio -> .scripts/bin/chradio | 0
R.scripts/bin/dmenu/chrtmp -> .scripts/bin/chrtmp | 0
R.scripts/bin/display/colour-wall -> .scripts/bin/colour-wall | 0
R.scripts/bin/misc/convf -> .scripts/bin/convf | 0
R.scripts/bin/genman/crefresh -> .scripts/bin/crefresh | 0
R.scripts/bin/misc/crypto -> .scripts/bin/crypto | 0
R.scripts/bin/misc/currency -> .scripts/bin/currency | 0
R.scripts/bin/genman/cvrestart -> .scripts/bin/cvrestart | 0
R.scripts/bin/dmenu/dbrowse -> .scripts/bin/dbrowse | 0
R.scripts/bin/dmenu/dfm -> .scripts/bin/dfm | 0
R.scripts/bin/dmenu/dgrep -> .scripts/bin/dgrep | 0
R.scripts/bin/misc/dict -> .scripts/bin/dict | 0
R.scripts/bin/dmenu/dimg -> .scripts/bin/dimg | 0
R.scripts/bin/dmenu/dinput -> .scripts/bin/dinput | 0
D.scripts/bin/display/hlock.png | 0
R.scripts/bin/dmenu/dmon -> .scripts/bin/dmon | 0
R.scripts/bin/dmenu/dmpv -> .scripts/bin/dmpv | 0
R.scripts/bin/dmenu/dmpvurl -> .scripts/bin/dmpvurl | 0
R.scripts/bin/misc/dotadd -> .scripts/bin/dotadd | 0
R.scripts/bin/dmenu/dpass -> .scripts/bin/dpass | 0
R.scripts/bin/misc/dupfind -> .scripts/bin/dupfind | 0
R.scripts/bin/misc/extracthls -> .scripts/bin/extracthls | 0
R.scripts/bin/display/fehffile -> .scripts/bin/fehffile | 0
R.scripts/bin/misc/fetchmail -> .scripts/bin/fetchmail | 0
R.scripts/bin/genman/ffflaunch -> .scripts/bin/ffflaunch | 0
R.scripts/bin/misc/filesed -> .scripts/bin/filesed | 0
R.scripts/bin/misc/finger -> .scripts/bin/finger | 0
R.scripts/bin/misc/getascii -> .scripts/bin/getascii | 0
R.scripts/bin/dns/getdns -> .scripts/bin/getdns | 0
R.scripts/bin/misc/googlegopher -> .scripts/bin/googlegopher | 0
R.scripts/bin/misc/gophcheck -> .scripts/bin/gophcheck | 0
R.scripts/bin/misc/gopherdl -> .scripts/bin/gopherdl | 0
R.scripts/bin/misc/hgpg -> .scripts/bin/hgpg | 0
R.scripts/bin/dns/hl-dns -> .scripts/bin/hl-dns | 0
R.scripts/bin/display/hlock -> .scripts/bin/hlock | 0
R.scripts/bin/misc/hlpaste -> .scripts/bin/hlpaste | 0
R.scripts/bin/misc/hmpv -> .scripts/bin/hmpv | 0
R.scripts/bin/genman/hvol -> .scripts/bin/hvol | 0
R.scripts/bin/display/infowall -> .scripts/bin/infowall | 0
R.scripts/bin/misc/maemo-launch -> .scripts/bin/maemo-launch | 0
R.scripts/bin/misc/mailaddheader -> .scripts/bin/mailaddheader | 0
R.scripts/bin/misc/mailarch -> .scripts/bin/mailarch | 0
R.scripts/bin/dmenu/mailselect -> .scripts/bin/mailselect | 0
R.scripts/bin/misc/manualpatch -> .scripts/bin/manualpatch | 0
D.scripts/bin/misc/autowifi | 58----------------------------------------------------------
D.scripts/bin/misc/bandcampdl | 24------------------------
D.scripts/bin/misc/wifioff | 53-----------------------------------------------------
R.scripts/bin/misc/mkalias -> .scripts/bin/mkalias | 0
R.scripts/bin/misc/mkmaildir -> .scripts/bin/mkmaildir | 0
R.scripts/bin/display/monitors.sh -> .scripts/bin/monitors.sh | 0
R.scripts/bin/genman/mpvlisten -> .scripts/bin/mpvlisten | 0
R.scripts/bin/misc/mpvms -> .scripts/bin/mpvms | 0
R.scripts/bin/misc/mpvout2asplit -> .scripts/bin/mpvout2asplit | 0
R.scripts/bin/misc/mpvrcp -> .scripts/bin/mpvrcp | 0
R.scripts/bin/misc/musictag -> .scripts/bin/musictag | 0
R.scripts/bin/misc/musictaginteractive -> .scripts/bin/musictaginteractive | 0
A.scripts/bin/mustfix | 7+++++++
R.scripts/bin/misc/mvmailbackup -> .scripts/bin/mvmailbackup | 0
R.scripts/bin/misc/netdownload -> .scripts/bin/netdownload | 0
R.scripts/bin/misc/netimg -> .scripts/bin/netimg | 0
R.scripts/bin/misc/netread -> .scripts/bin/netread | 0
R.scripts/bin/misc/netvid -> .scripts/bin/netvid | 0
R.scripts/bin/misc/number -> .scripts/bin/number | 0
R.scripts/bin/misc/open -> .scripts/bin/open | 0
R.scripts/bin/misc/patchmultibranch -> .scripts/bin/patchmultibranch | 0
R.scripts/bin/display/pexelgrab -> .scripts/bin/pexelgrab | 0
R.scripts/bin/misc/pipes -> .scripts/bin/pipes | 0
R.scripts/bin/misc/pman -> .scripts/bin/pman | 0
R.scripts/bin/misc/popupcgo -> .scripts/bin/popupcgo | 0
R.scripts/bin/misc/popupcurl -> .scripts/bin/popupcurl | 0
R.scripts/bin/misc/popupcurl2 -> .scripts/bin/popupcurl2 | 0
R.scripts/bin/misc/popupmpv -> .scripts/bin/popupmpv | 0
R.scripts/bin/misc/qmv -> .scripts/bin/qmv | 0
R.scripts/bin/misc/queuevid -> .scripts/bin/queuevid | 0
R.scripts/bin/misc/quik -> .scripts/bin/quik | 0
R.scripts/bin/misc/rand-sig -> .scripts/bin/rand-sig | 0
R.scripts/bin/misc/reminder -> .scripts/bin/reminder | 0
R.scripts/bin/misc/rfclookup -> .scripts/bin/rfclookup | 0
R.scripts/bin/display/rfeh -> .scripts/bin/rfeh | 0
R.scripts/bin/misc/rmpv -> .scripts/bin/rmpv | 0
R.scripts/bin/display/rwall -> .scripts/bin/rwall | 0
R.scripts/bin/misc/screenoff -> .scripts/bin/screenoff | 0
R.scripts/bin/misc/servicename -> .scripts/bin/servicename | 0
R.scripts/bin/display/shmenu -> .scripts/bin/shmenu | 0
R.scripts/bin/genman/slock_mod -> .scripts/bin/slock_mod | 0
R.scripts/bin/misc/slopvid -> .scripts/bin/slopvid | 0
R.scripts/bin/misc/srssbnbc -> .scripts/bin/srssbnbc | 0
R.scripts/bin/misc/srxsrch -> .scripts/bin/srxsrch | 0
R.scripts/bin/misc/sshtar -> .scripts/bin/sshtar | 0
R.scripts/bin/misc/stupidhash -> .scripts/bin/stupidhash | 0
R.scripts/bin/misc/surf-cssdisable -> .scripts/bin/surf-cssdisable | 0
R.scripts/bin/misc/surf-cssenable -> .scripts/bin/surf-cssenable | 0
R.scripts/bin/misc/swamp -> .scripts/bin/swamp | 0
R.scripts/bin/misc/sxhkdrestart -> .scripts/bin/sxhkdrestart | 0
R.scripts/bin/misc/terminalimg -> .scripts/bin/terminalimg | 0
R.scripts/bin/misc/textdisplay -> .scripts/bin/textdisplay | 0
R.scripts/bin/misc/thesaurus -> .scripts/bin/thesaurus | 0
R.scripts/bin/misc/topen -> .scripts/bin/topen | 0
R.scripts/bin/misc/torlist -> .scripts/bin/torlist | 0
R.scripts/bin/misc/toxclip -> .scripts/bin/toxclip | 0
R.scripts/bin/misc/trimfiles -> .scripts/bin/trimfiles | 0
R.scripts/bin/misc/tsclean -> .scripts/bin/tsclean | 0
R.scripts/bin/misc/uniqfind -> .scripts/bin/uniqfind | 0
R.scripts/bin/dns/updatehosts -> .scripts/bin/updatehosts | 0
R.scripts/bin/misc/urlencode -> .scripts/bin/urlencode | 0
R.scripts/bin/misc/urlhand -> .scripts/bin/urlhand | 0
R.scripts/bin/misc/urlhand2 -> .scripts/bin/urlhand2 | 0
R.scripts/bin/misc/vimbhist -> .scripts/bin/vimbhist | 0
R.scripts/bin/misc/voidupdate -> .scripts/bin/voidupdate | 0
R.scripts/bin/display/wallblur -> .scripts/bin/wallblur | 0
R.scripts/bin/genman/wallvar -> .scripts/bin/wallvar | 0
R.scripts/bin/display/wbcachemake -> .scripts/bin/wbcachemake | 0
R.scripts/bin/misc/whatdoido -> .scripts/bin/whatdoido | 0
A.scripts/bin/wifioff | 38++++++++++++++++++++++++++++++++++++++
R.scripts/bin/misc/wpa2-brute-force -> .scripts/bin/wpa2-brute-force | 0
R.scripts/bin/misc/ytsrch2 -> .scripts/bin/ytsrch2 | 0
D.scripts/custom/xstuff | 9---------
D.scripts/tools/backupdel | 77-----------------------------------------------------------------------------
M.zprofile | 4+---
131 files changed, 129 insertions(+), 230 deletions(-)

diff --git a/.config/neomutt/neomuttrc b/.config/neomutt/neomuttrc @@ -1,4 +1,5 @@ -source users/hayden@haydenvh.com #user +source users/hhvn@dataswamp.org #user +#source users/hayden@haydenvh.com #user #source users/backtrack@airmail.cc #user #source users/irc@hlirc.net #user diff --git a/.config/zsh/.zshrc b/.config/zsh/.zshrc @@ -1,4 +1,5 @@ # Make alias' +PATH="$PATH:$HOME/.scripts/bin" mkalias # Prompt diff --git a/.scripts/bin/README b/.scripts/bin/README @@ -1,5 +0,0 @@ -Hey, thanks for downloading my path scripts. However, there are some things you may want to consider before picking and choosing some scripts. - -To install the scripts, copy them to your PATH. If you are not sure how to setup a path, download my .profile from my dotfiles, and place it in your home directory. Now, place the scripts in .scripts/bin/ - -Some of the scripts will simply be wrappers on each other, please make sure that scripts such as dmpv have access to dfm. diff --git a/.scripts/bin/dmenu/addrbook b/.scripts/bin/addrbook diff --git a/.scripts/bin/misc/alcl b/.scripts/bin/alcl diff --git a/.scripts/bin/misc/asciiclip b/.scripts/bin/asciiclip diff --git a/.scripts/bin/misc/asplit b/.scripts/bin/asplit diff --git a/.scripts/bin/autowifi b/.scripts/bin/autowifi @@ -0,0 +1,56 @@ +#!/bin/sh +# +# autowifi.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: inetutils-ifconfig, wireless_tools, wpa_supplicant, dhclient + +[ $(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/' | head -n 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 up + +ssid=$($super iwlist $interface scan 2>&1 | grep SSID | sed -E 's/.*:"([^"]*)"/\1/' | dmenu -i) +pass=$(printf '' | dmenu -i -p "Passphrase:") + +wpa_passphrase "$ssid" "$pass" > /tmp/"$ssid".wpa.conf +$super wpa_supplicant -B -i $interface -c /tmp/"$ssid".wpa.conf +$super dhclient + +sleep 2 +tput setaf 10 +echo "...testing..." +sleep 7 +tput sgr0 +ping -I $interface -c 5 example.com 2>&1 | tee /dev/stderr | grep '5 received,' >/dev/null && { + tput setaf 10 + echo "Yup" +} || { + tput setaf 10 + echo "Something broke.. :(" +} diff --git a/.scripts/bin/misc/backronym b/.scripts/bin/backronym diff --git a/.scripts/bin/bandcampdl b/.scripts/bin/bandcampdl @@ -0,0 +1,24 @@ +#!/bin/sh +# +# bandcampdl.sh <url to album> [media player] +# +# Looks like youtube-dl won't be getting worked on for a while +# Fuck the RIAA +# +# bandcamp seems to use mp3 exclusively.. but if that's not the case.. :) + +url="$1" +[ ! -z $2 ] && out="xargs $2" || out="dl" + +dl(){ + mkdir -p "$(basename "$url")" + num=0 + while IFS= read -r input + do + num=$(($num+1)) + curl "$input" > "$(basename "$url")/$(printf "%02d" "$num").mp3" + done +} + +# this is criminally easy. +curl "$url" | grep -o 'https://[^}]*/mp3-128/[^}]*' | sed 's~\&amp;~\&~g;s~\&quot;~~' | $out diff --git a/.scripts/bin/misc/bandcampsrch b/.scripts/bin/bandcampsrch diff --git a/.scripts/bin/misc/centre b/.scripts/bin/centre diff --git a/.scripts/bin/dmenu/chradio b/.scripts/bin/chradio diff --git a/.scripts/bin/dmenu/chrtmp b/.scripts/bin/chrtmp diff --git a/.scripts/bin/display/colour-wall b/.scripts/bin/colour-wall diff --git a/.scripts/bin/misc/convf b/.scripts/bin/convf diff --git a/.scripts/bin/genman/crefresh b/.scripts/bin/crefresh diff --git a/.scripts/bin/misc/crypto b/.scripts/bin/crypto diff --git a/.scripts/bin/misc/currency b/.scripts/bin/currency diff --git a/.scripts/bin/genman/cvrestart b/.scripts/bin/cvrestart diff --git a/.scripts/bin/dmenu/dbrowse b/.scripts/bin/dbrowse diff --git a/.scripts/bin/dmenu/dfm b/.scripts/bin/dfm diff --git a/.scripts/bin/dmenu/dgrep b/.scripts/bin/dgrep diff --git a/.scripts/bin/misc/dict b/.scripts/bin/dict diff --git a/.scripts/bin/dmenu/dimg b/.scripts/bin/dimg diff --git a/.scripts/bin/dmenu/dinput b/.scripts/bin/dinput diff --git a/.scripts/bin/display/hlock.png b/.scripts/bin/display/hlock.png Binary files differ. diff --git a/.scripts/bin/dmenu/dmon b/.scripts/bin/dmon diff --git a/.scripts/bin/dmenu/dmpv b/.scripts/bin/dmpv diff --git a/.scripts/bin/dmenu/dmpvurl b/.scripts/bin/dmpvurl diff --git a/.scripts/bin/misc/dotadd b/.scripts/bin/dotadd diff --git a/.scripts/bin/dmenu/dpass b/.scripts/bin/dpass diff --git a/.scripts/bin/misc/dupfind b/.scripts/bin/dupfind diff --git a/.scripts/bin/misc/extracthls b/.scripts/bin/extracthls diff --git a/.scripts/bin/display/fehffile b/.scripts/bin/fehffile diff --git a/.scripts/bin/misc/fetchmail b/.scripts/bin/fetchmail diff --git a/.scripts/bin/genman/ffflaunch b/.scripts/bin/ffflaunch diff --git a/.scripts/bin/misc/filesed b/.scripts/bin/filesed diff --git a/.scripts/bin/misc/finger b/.scripts/bin/finger diff --git a/.scripts/bin/misc/getascii b/.scripts/bin/getascii diff --git a/.scripts/bin/dns/getdns b/.scripts/bin/getdns diff --git a/.scripts/bin/misc/googlegopher b/.scripts/bin/googlegopher diff --git a/.scripts/bin/misc/gophcheck b/.scripts/bin/gophcheck diff --git a/.scripts/bin/misc/gopherdl b/.scripts/bin/gopherdl diff --git a/.scripts/bin/misc/hgpg b/.scripts/bin/hgpg diff --git a/.scripts/bin/dns/hl-dns b/.scripts/bin/hl-dns diff --git a/.scripts/bin/display/hlock b/.scripts/bin/hlock diff --git a/.scripts/bin/misc/hlpaste b/.scripts/bin/hlpaste diff --git a/.scripts/bin/misc/hmpv b/.scripts/bin/hmpv diff --git a/.scripts/bin/genman/hvol b/.scripts/bin/hvol diff --git a/.scripts/bin/display/infowall b/.scripts/bin/infowall diff --git a/.scripts/bin/misc/maemo-launch b/.scripts/bin/maemo-launch diff --git a/.scripts/bin/misc/mailaddheader b/.scripts/bin/mailaddheader diff --git a/.scripts/bin/misc/mailarch b/.scripts/bin/mailarch diff --git a/.scripts/bin/dmenu/mailselect b/.scripts/bin/mailselect diff --git a/.scripts/bin/misc/manualpatch b/.scripts/bin/manualpatch diff --git a/.scripts/bin/misc/autowifi b/.scripts/bin/misc/autowifi @@ -1,58 +0,0 @@ -#!/bin/sh -# -# autowifi.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: inetutils-ifconfig, wireless_tools, wpa_supplicant, dhclient - -[ $(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/' | head -n 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 up - -ssid=$($super iwlist $interface scan 2>&1 | grep SSID | sed -E 's/.*:"([^"]*)"/\1/' | dmenu -i) -pass=$(printf '' | dmenu -i -p "Passphrase:") - -wpa_passphrase "$ssid" "$pass" > /tmp/"$ssid".wpa.conf -$super wpa_supplicant -B -i $interface -c /tmp/"$ssid".wpa.conf -$super dhclient - -sleep 2 -tput setaf 10 -echo "...testing..." -sleep 7 -tput sgr0 -ping -I $interface -c 5 example.com 2>&1 | tee /dev/stderr | grep '5 received,' >/dev/null && { - tput setaf 10 - echo "Yup" -} || { - tput setaf 10 - echo "Something broke.. :(" -} - -rm .ssh/session* diff --git a/.scripts/bin/misc/bandcampdl b/.scripts/bin/misc/bandcampdl @@ -1,24 +0,0 @@ -#!/bin/sh -# -# bandcampdl.sh <url to album> [media player] -# -# Looks like youtube-dl won't be getting worked on for a while -# Fuck the RIAA -# -# bandcamp seems to use mp3 exclusively.. but if that's not the case.. :) - -url="$1" -[ ! -z $2 ] && out="xargs $2" || out="dl" - -dl(){ - mkdir -p "$(basename "$url")" - num=0 - while IFS= read -r input - do - num=$(($num+1)) - curl "$input" > "$(basename "$url")/$num.mp3" - done -} - -# this is criminally easy. -curl "$url" | grep -o 'https://[^}]*/mp3-128/[^}]*' | sed 's~\&amp;~\&~g;s~\&quot;~~' | $out diff --git a/.scripts/bin/misc/wifioff b/.scripts/bin/misc/wifioff @@ -1,53 +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 - -sleep 2 -tput setaf 10 -echo "...testing..." -sleep 7 -tput sgr0 -ping -c 5 example.com 2>&1 | tee /dev/stderr | grep '5 received,' >/dev/null && { - tput setaf 10 - echo "Yup" -} || { - tput setaf 10 - echo "Something broke.. :(" -} - -rm .ssh/session* diff --git a/.scripts/bin/misc/mkalias b/.scripts/bin/mkalias diff --git a/.scripts/bin/misc/mkmaildir b/.scripts/bin/mkmaildir diff --git a/.scripts/bin/display/monitors.sh b/.scripts/bin/monitors.sh diff --git a/.scripts/bin/genman/mpvlisten b/.scripts/bin/mpvlisten diff --git a/.scripts/bin/misc/mpvms b/.scripts/bin/mpvms diff --git a/.scripts/bin/misc/mpvout2asplit b/.scripts/bin/mpvout2asplit diff --git a/.scripts/bin/misc/mpvrcp b/.scripts/bin/mpvrcp diff --git a/.scripts/bin/misc/musictag b/.scripts/bin/musictag diff --git a/.scripts/bin/misc/musictaginteractive b/.scripts/bin/musictaginteractive diff --git a/.scripts/bin/mustfix b/.scripts/bin/mustfix @@ -0,0 +1,7 @@ +#!/bin/sh + +locate -b .mustfix | while IFS= read -r f +do + printf "$f: " + cat "$f" +done diff --git a/.scripts/bin/misc/mvmailbackup b/.scripts/bin/mvmailbackup diff --git a/.scripts/bin/misc/netdownload b/.scripts/bin/netdownload diff --git a/.scripts/bin/misc/netimg b/.scripts/bin/netimg diff --git a/.scripts/bin/misc/netread b/.scripts/bin/netread diff --git a/.scripts/bin/misc/netvid b/.scripts/bin/netvid diff --git a/.scripts/bin/misc/number b/.scripts/bin/number diff --git a/.scripts/bin/misc/open b/.scripts/bin/open diff --git a/.scripts/bin/misc/patchmultibranch b/.scripts/bin/patchmultibranch diff --git a/.scripts/bin/display/pexelgrab b/.scripts/bin/pexelgrab diff --git a/.scripts/bin/misc/pipes b/.scripts/bin/pipes diff --git a/.scripts/bin/misc/pman b/.scripts/bin/pman diff --git a/.scripts/bin/misc/popupcgo b/.scripts/bin/popupcgo diff --git a/.scripts/bin/misc/popupcurl b/.scripts/bin/popupcurl diff --git a/.scripts/bin/misc/popupcurl2 b/.scripts/bin/popupcurl2 diff --git a/.scripts/bin/misc/popupmpv b/.scripts/bin/popupmpv diff --git a/.scripts/bin/misc/qmv b/.scripts/bin/qmv diff --git a/.scripts/bin/misc/queuevid b/.scripts/bin/queuevid diff --git a/.scripts/bin/misc/quik b/.scripts/bin/quik diff --git a/.scripts/bin/misc/rand-sig b/.scripts/bin/rand-sig diff --git a/.scripts/bin/misc/reminder b/.scripts/bin/reminder diff --git a/.scripts/bin/misc/rfclookup b/.scripts/bin/rfclookup diff --git a/.scripts/bin/display/rfeh b/.scripts/bin/rfeh diff --git a/.scripts/bin/misc/rmpv b/.scripts/bin/rmpv diff --git a/.scripts/bin/display/rwall b/.scripts/bin/rwall diff --git a/.scripts/bin/misc/screenoff b/.scripts/bin/screenoff diff --git a/.scripts/bin/misc/servicename b/.scripts/bin/servicename diff --git a/.scripts/bin/display/shmenu b/.scripts/bin/shmenu diff --git a/.scripts/bin/genman/slock_mod b/.scripts/bin/slock_mod diff --git a/.scripts/bin/misc/slopvid b/.scripts/bin/slopvid diff --git a/.scripts/bin/misc/srssbnbc b/.scripts/bin/srssbnbc diff --git a/.scripts/bin/misc/srxsrch b/.scripts/bin/srxsrch diff --git a/.scripts/bin/misc/sshtar b/.scripts/bin/sshtar diff --git a/.scripts/bin/misc/stupidhash b/.scripts/bin/stupidhash diff --git a/.scripts/bin/misc/surf-cssdisable b/.scripts/bin/surf-cssdisable diff --git a/.scripts/bin/misc/surf-cssenable b/.scripts/bin/surf-cssenable diff --git a/.scripts/bin/misc/swamp b/.scripts/bin/swamp diff --git a/.scripts/bin/misc/sxhkdrestart b/.scripts/bin/sxhkdrestart diff --git a/.scripts/bin/misc/terminalimg b/.scripts/bin/terminalimg diff --git a/.scripts/bin/misc/textdisplay b/.scripts/bin/textdisplay diff --git a/.scripts/bin/misc/thesaurus b/.scripts/bin/thesaurus diff --git a/.scripts/bin/misc/topen b/.scripts/bin/topen diff --git a/.scripts/bin/misc/torlist b/.scripts/bin/torlist diff --git a/.scripts/bin/misc/toxclip b/.scripts/bin/toxclip diff --git a/.scripts/bin/misc/trimfiles b/.scripts/bin/trimfiles diff --git a/.scripts/bin/misc/tsclean b/.scripts/bin/tsclean diff --git a/.scripts/bin/misc/uniqfind b/.scripts/bin/uniqfind diff --git a/.scripts/bin/dns/updatehosts b/.scripts/bin/updatehosts diff --git a/.scripts/bin/misc/urlencode b/.scripts/bin/urlencode diff --git a/.scripts/bin/misc/urlhand b/.scripts/bin/urlhand diff --git a/.scripts/bin/misc/urlhand2 b/.scripts/bin/urlhand2 diff --git a/.scripts/bin/misc/vimbhist b/.scripts/bin/vimbhist diff --git a/.scripts/bin/misc/voidupdate b/.scripts/bin/voidupdate diff --git a/.scripts/bin/display/wallblur b/.scripts/bin/wallblur diff --git a/.scripts/bin/genman/wallvar b/.scripts/bin/wallvar diff --git a/.scripts/bin/display/wbcachemake b/.scripts/bin/wbcachemake diff --git a/.scripts/bin/misc/whatdoido b/.scripts/bin/whatdoido diff --git a/.scripts/bin/wifioff b/.scripts/bin/wifioff @@ -0,0 +1,38 @@ +#!/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/misc/wpa2-brute-force b/.scripts/bin/wpa2-brute-force diff --git a/.scripts/bin/misc/ytsrch2 b/.scripts/bin/ytsrch2 diff --git a/.scripts/custom/xstuff b/.scripts/custom/xstuff @@ -1,9 +0,0 @@ -#!/bin/sh - -sudo mount.nfs4 192.168.1.20:/srv/storage general/ -sh $HOME/.scripts/custom/dock -nohup redshift & -nohup wallblur & -xsetroot -cursor_name sailboat -rm nohup.out -ssh root@haydenvh.com diff --git a/.scripts/tools/backupdel b/.scripts/tools/backupdel @@ -1,77 +0,0 @@ -#!/bin/sh - -backups=$(find /mnt/backups/ -type f | sort) -dir="$1" - -limit(){ - limit="$1" - [ -z $number ] && echo "No limit supplied!" && exit 1 - - tailn=$(echo "$backups" | wc -l) - tailn=$(($tailn-$limit)) - - for bkp in $(echo "$backups" | tail -"$number") - do - rm $dir/$bkp || { - echo "File does not exist!"; return 1 - } - done -} - -last(){ - number="$1" - [ -z $number ] && number="1" - - for bkp in $(echo "$backups" | tail -"$number") - do - rm $dir/$bkp || { - echo "File does not exist!"; return 1 - } - done -} - -specific(){ - rm $dir/$bkp || { - echo "File does not exist!"; return 1 - } -} - -all(){ - for bkp in $(echo "$backups" | head -n -1) - do - rm $dir/$bkp || { - echo "File does not exist!"; return 1 - } - done -} - -allall(){ - rm -rf $dir/* -} - -list(){ - echo "$backups" -} - -usage(){ - echo \ -"backupdel /path/to/dir [type of deletion] [arg to deletion / specific (grepped) backup] - -limit Keep only a certain amount of backups, deleting backups from oldest to - newest, until the amount of backups is equal to the number supplied. -last Delete the last [arg supplied or 1] backup(s) -all Delete all except from the current -allall Delete ALL including current -list List all backups -* Delete the specific (grepped) backup" -} - -case arg in "$2" - *help|*usage) usage ;; - limit) limit "$3" || usage ;; - last) last "$3" || usage ;; - all) all ;; - allall) allall ;; - list) list ;; - *) specific "$2" || usage ;; -esac diff --git a/.zprofile b/.zprofile @@ -6,9 +6,7 @@ # Copyright (c) 2019 Hayden Hamilton. LICENSE:MIT # -export SCRIPTS="$HOME/.scripts/bin" -scripts=$(ls -d $SCRIPTS/*/ | tr '\n' ':') -export PATH="$PATH:$scripts" +export PATH="$PATH:$HOME/.scripts/bin" export EDITOR="nvim" export PAGER="less" export TERMINAL="st"