commit 95264c468977c3e56c448b801f74b05375fad90c
parent f6b2b102c1b97118190e889ab69840fe308b2b47
Author: Hayden Hamilton <hayden@haydenvh.com>
Date: Fri, 21 Feb 2020 18:00:42 +0000
start of zsh
Diffstat:
3 files changed, 112 insertions(+), 2 deletions(-)
diff --git a/.profile b/.profile
@@ -19,8 +19,9 @@ export work="$HOME/work"
export WORK="$HOME/work"
export SUDO_ASKPASS="$HOME/.scripts/bin/dmenu/daskpass"
export PASS="$HOME/general/security/pass"
-export SHELL="/usr/bin/fish"
-bash ~/.ls_colors
+export SHELL="/usr/bin/zsh"
+export ZDOTDIR="$HOME/.config/zsh"
+. ~/.ls_colors
[ "$hostname" != "" ] && {
echo > /dev/null
} || [ "$HOSTNAME" != "" ] && {
diff --git a/.scripts/bin/display/bspwmstart b/.scripts/bin/display/bspwmstart
@@ -0,0 +1,2 @@
+#!/bin/bash
+
diff --git a/.scripts/bin/misc/iiclient b/.scripts/bin/misc/iiclient
@@ -0,0 +1,107 @@
+#!/bin/bash
+
+[ "$1" != "" ] && cd $1
+
+draw(){
+ lines=$(tput lines)
+ clear
+ printf "\e[0H\n\n"
+ cat /dev/stdin
+ printf "\e[0H"
+ tput setab 0
+ printf " [$(date)] [Acts: $ACTS] "
+ tput sgr0
+ tput cup $lines 0
+}
+
+redraw(){
+ tput sc
+ printf "\e[0H"
+ tput setab 0
+ printf " [$(date)] [Acts: $ACTS] \n\n"
+ tput rc
+}
+
+dirlist(){
+ tree $(find -type d -maxdepth 1| sed '/^.$/d') | sed 's/^[0-9]* directories.*//g' | draw
+ dosleep="1"
+}
+
+getchannels(){
+ CHANS=$(find -maxdepth 2 -mindepth 2 -type d | nl /dev/stdin)
+ echo "$CHANS" | draw
+ dosleep="1"
+}
+
+update(){
+ CHANS=$(find -name "*out" | nl /dev/stdin)
+ echo "$CHANS" > ./chanlist
+ redraw
+ goto "$CURRENTCHANNEL"
+}
+
+send(){
+ sendchannel=$(echo "$CURRENTCHANNEL" | sed 's/out$/in/g')
+ echo "$@" > $sendchannel
+}
+
+help(){
+
+printf '
+CHANNEL always refers to either the number displayed in getchannels, or the name of the channel starting with #
+
+COMMANDS:
+
+&server LINK TO SERVER - this is required to send commands to the server (for freenode: irc.freenode.net/in)
+&help - this message
+&dirlist - list directory structure
+&getchannels - list channels
+&goto CHANNEL - go to CHANNEL
+&read CHANNEL - read entire channel history
+&exit - exit
+' | draw
+dosleep="1"
+
+}
+
+returnchannel(){
+ read raw < /dev/stdin
+ grep "$raw" < ./chanlist >/dev/null 2>&1 &&{
+ echo "$(grep "$raw" < ./chanlist | sed 's/^[[:space:]]*[0-9]*[[:space:]]*//g' | sed 1q)"
+ } ||{
+ echo "Cannot find channel" | draw
+ };
+}
+
+goto(){
+ channel=$(echo "$1" | returnchannel)
+ export CURRENTCHANNEL="$channel"
+ cat $channel | draw
+}
+
+server(){
+ export CURRENTSERVER="$1 $2 $3"
+}
+
+sendcommand(){
+ echo "/$1" > $CURRENTSERVER
+}
+
+getchannels
+
+while true
+do
+ read input < /dev/tty
+ input2=$(echo "$input" | sed 's/^\///g')
+ input3=$(echo "$input" | sed 's/^\&//g')
+ if [ "$input" = "$input2" ] && [ "$input2" = "$input3" ]; then
+ send $input
+ elif [ "$input" != "$input2" ]; then
+ sendcommand "$input2"
+ else
+ $input3
+ fi
+ [ "$dosleep" != "" ] && sleep 4
+ update
+ dosleep=""
+done