dotfiles

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

commit 98ac3a3d275a6b6df4eaf7344d74353579060b4b
parent 283ba5cc7e90050b2304914e5765996690ea997f
Author: Hayden Hamilton <hayden@haydenvh.com>
Date:   Mon, 17 Feb 2020 00:20:46 +0000

vim

Diffstat:
M.gitaddlist | 51+--------------------------------------------------
A.scripts/bash/web.func.sh | 40++++++++++++++++++++++++++++++++++++++++
A.scripts/bin/README | 5+++++
A.scripts/bin/display/bspwmstart | 2++
A.scripts/bin/display/cmon | 19+++++++++++++++++++
A.scripts/bin/misc/iiclient | 107+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
A.scripts/i3blocks/title | 18++++++++++++++++++
A.scripts/input/keyboard | 10++++++++++
A.scripts/input/ttymaps.kmap | 2++
A.scripts/random/gnulinux.sh | 3+++
10 files changed, 207 insertions(+), 50 deletions(-)

diff --git a/.gitaddlist b/.gitaddlist @@ -10,56 +10,7 @@ git add ./.bashrc git add ./.profile git add ./.vim git add ./.config/vim/ -git add ./.scripts/bin/misc/rmpv -git add ./.scripts/bin/misc/hmpv -git add ./.scripts/bin/misc/pipes -git add ./.scripts/bin/misc/terminalimg -git add ./.scripts/bin/misc/urlhand -git add ./.scripts/bin/misc/slock_mod -git add ./.scripts/bin/display/wallblur -git add ./.scripts/bin/display/fehffile -git add ./.scripts/bin/i3/scratcher -git add ./.scripts/bin/i3/makegrid -git add ./.scripts/bin/misc/trimfiles -git add ./.scripts/bin/dmenu/dircgetpass -git add ./.scripts/bin/display/hlock.png -git add ./.scripts/bin/display/hlock -git add ./.scripts/bin/display/monitors.sh -git add ./.scripts/bin/display/rfeh -git add ./.scripts/bin/i3/moveentire -git add ./.scripts/bin/i3/mpvlisten -git add ./.scripts/bin/i3/moveone -git add ./.scripts/bin/i3/hvol -git add ./.scripts/bin/i3/locker -git add ./.scripts/bin/i3/wallvar -git add ./.scripts/bin/i3/lockerexit -git add ./.scripts/bin/i3/crefresh -git add ./.scripts/bin/i3/ffflaunch -git add ./.scripts/bin/dmenu/dmount -git add ./.scripts/bin/dmenu/dumount -git add ./.scripts/bin/dmenu/dmpv -git add ./.scripts/bin/dmenu/daskpass -git add ./.scripts/bin/dmenu/dpass -git add ./.scripts/bin/dmenu/dfm -git add ./.scripts/bin/dmenu/dbrowse -git add ./.scripts/bin/dmenu/dmpvurl -git add ./.scripts/bin/dmenu/userinput -git add .scripts/i3blocks/convtodwm -git add .scripts/i3blocks/news -git add .scripts/i3blocks/weather2 -git add .scripts/i3blocks/bat -git add .scripts/i3blocks/time2 -git add .scripts/i3blocks/net -git add .scripts/i3blocks/mem -git add .scripts/i3blocks/vol -git add .scripts/i3blocks/time -git add .scripts/i3blocks/host -git add .scripts/i3blocks/cal -git add .scripts/i3blocks/mpv -git add .scripts/i3blocks/disk2 -git add .scripts/i3blocks/weather -git add .scripts/i3blocks/cpu -git add .scripts/i3blocks/disk +git add ./.scripts/ git add ./.xprofile git add ./.vimrc git add ./.ls_colors diff --git a/.scripts/bash/web.func.sh b/.scripts/bash/web.func.sh @@ -0,0 +1,40 @@ +#!/bin/bash + +hostfile() { + if [ "$(echo "$1" | sed 's/ /qqq/g' | awk '/qqq/')" == "" ] + then + name=$(curl -F "file=@$newfile" http://0x0.st) + echo "Your file has been hosted at $name" + else + newfile=$(echo $1 | tr ' ' '.') + mv "$1" $newfile + name=$(curl -F "file=@$newfile" http://0x0.st) + echo "Your file has been hosted at $name" + mv $newfile "$1" &&>/dev/null 2>/dev/null 1>/dev/null + fi +} +rickroll(){ + curl -s -L https://raw.githubusercontent.com/keroseren/rickrollrc/master/roll.sh | bash +} +weather(){ + curl wttr.in/$1 +} +iploc(){ + curl ifconfig.co/$1 +} +getnews(){ + if [ "$1" != "" ] + then + arg=$(echo "$1" | sed 's/ /+/g') + fi + curl getnews.tech/$arg +} +cheatsh(){ + curl cheat.sh/$1 +} +dict(){ + curl "dict://dict.org/d:$1" +} +parrot(){ + curl parrot.live/$1 +} diff --git a/.scripts/bin/README b/.scripts/bin/README @@ -0,0 +1,5 @@ +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 simple be wrappers on each other, please make sure that scripts such as dmpv have access to dfm. diff --git a/.scripts/bin/display/bspwmstart b/.scripts/bin/display/bspwmstart @@ -0,0 +1,2 @@ +#!/bin/bash + diff --git a/.scripts/bin/display/cmon b/.scripts/bin/display/cmon @@ -0,0 +1,19 @@ +#!/bin/bash + +choice=$(xrandr --listmonitors | tail -n +2 | dmenu -i -p "Choose primary monitor:" | awk '//{print $4}') +cmd="xrandr --output $choice --primary" +while true +do + bchoice="$choice" + choice=$(printf "DONE\nRight\nLeft\nAbove\nBelow" | dmenu -i -p "Add monitor to:") + case $choice in + Right) direction="right-of" ;; + Left) direction="left-of" ;; + Above) direction="above" ;; + Below) direction="below" ;; + DONE) $cmd; exit 0 ;; + esac + choice2=$(xrandr --listmonitors | tail -n +2 | dmenu -i -p "Select monitor:" | awk '//{printf $4}') + cmd="$cmd --output $choice2 --$direction $bchoice" + setup=$(($setup+1)) +done 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 diff --git a/.scripts/i3blocks/title b/.scripts/i3blocks/title @@ -0,0 +1,18 @@ +#!/bin/bash +# +# i3blocks/title +# Created by Hayden Hamilton +# +# haydenvh.com +# Copyright (c) 2019 Hayden Hamilton. + +id=$(xprop -root _NET_ACTIVE_WINDOW | awk '// {print $5}') +out1=$(xprop -id $id | awk '/WM_CLASS/ {print $3}' | sed 's/"//g' | sed 's/,//g') +out2=$(xprop -id $id | awk '/_NET_WM_NAME/{ $1=""; $2=""; print}' | sed 's/"//g' | sed "s/^[ \t]*//") +if [ "$BLOCK_BUTTON" == "1" ] +then + dunstify "Current window title" "$out2" +fi +echo "[$out1 - $(echo "$out2" | cut -zc-25)]" +echo +echo \#4a6b1b diff --git a/.scripts/input/keyboard b/.scripts/input/keyboard @@ -0,0 +1,10 @@ +#!/bin/bash +# +# input/keyboard +# Created by Hayden Hamilton +# +# haydenvh.com +# Copyright (c) 2019 Hayden Hamilton. + +setxkbmap -layout us +setxkbmap -option caps:escape diff --git a/.scripts/input/ttymaps.kmap b/.scripts/input/ttymaps.kmap @@ -0,0 +1,2 @@ +keycode 1 = Caps_Lock +keycode 58 = Escape diff --git a/.scripts/random/gnulinux.sh b/.scripts/random/gnulinux.sh @@ -0,0 +1,3 @@ +echo "I'd just like to interject for moment. What you're refering to as Linux, is in fact, GNU/Linux, or as I've recently taken to calling it, GNU plus Linux. Linux is not an operating system unto itself, but rather another free component of a fully functioning GNU system made useful by the GNU corelibs, shell utilities and vital system components comprising a full OS as defined by POSIX. +> Many computer users run a modified version of the GNU system every day, without realizing it. Through a peculiar turn of events, the version of GNU which is widely used today is often called Linux, and many of its users are not aware that it is basically the GNU system, developed by the GNU Project. +> There really is a Linux, and these people are using it, but it is just a part of the system they use. Linux is the kernel: the program in the system that allocates the machine's resources to the other programs that you run. The kernel is an essential part of an operating system, but useless by itself; it can only function in the context of a complete operating system. Linux is normally used in combination with the GNU operating system: the whole system is basically GNU with Linux added, or GNU/Linux. All the so-called Linux distributions are really distributions of GNU/Linux!" | cowsay