scripts

custom scripts and utils
git clone git://git.pyratebeard.net/scripts.git
Log | Files | Refs | README

commit 314841ffa1b0ba2643b72daef43a2c17d176fc01
parent 6740170c54773362946057070c415401a9a4ad80
Author: pyratebeard <root@pyratebeard.net>
Date:   Fri,  8 Dec 2023 12:08:49 +0000

moved scripts from dotfiles

Diffstat:
Abin/.local/bin/ahoy | 252+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Abin/.local/bin/bgchange | 10++++++++++
Abin/.local/bin/boat_sync | 5+++++
Abin/.local/bin/capture | 5+++++
Abin/.local/bin/checkip | 15+++++++++++++++
Abin/.local/bin/colorcodes.sh | 6++++++
Abin/.local/bin/connect | 66++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Abin/.local/bin/disconnect | 16++++++++++++++++
Abin/.local/bin/fontpreview.sh | 12++++++++++++
Abin/.local/bin/hashwall | 82+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Abin/.local/bin/hsetroot | 0
Abin/.local/bin/htmldump | 21+++++++++++++++++++++
Abin/.local/bin/lock | 11+++++++++++
Abin/.local/bin/mario | 39+++++++++++++++++++++++++++++++++++++++
Abin/.local/bin/mdpdf | 41+++++++++++++++++++++++++++++++++++++++++
Abin/.local/bin/newstuir | 5+++++
Abin/.local/bin/pbin | 33+++++++++++++++++++++++++++++++++
Abin/.local/bin/ptt | 19+++++++++++++++++++
Abin/.local/bin/shortner | 2++
Abin/.local/bin/switchkb | 21+++++++++++++++++++++
Abin/.local/bin/syscat | 105+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Abin/.local/bin/sysinfo | 127+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Abin/.local/bin/todo | 37+++++++++++++++++++++++++++++++++++++
Abin/.local/bin/todosync | 13+++++++++++++
Abin/.local/bin/tvshuf | 14++++++++++++++
Abin/.local/bin/wacom | 6++++++
Abin/.local/bin/wat | 15+++++++++++++++
Abin/.local/bin/weather | 13+++++++++++++
Abin/.local/bin/webimg | 46++++++++++++++++++++++++++++++++++++++++++++++
Abin/.local/bin/windowcast | 13+++++++++++++
Abin/.local/bin/winmag | 11+++++++++++
Afun/.local/bin/blocks | 3+++
Afun/.local/bin/blocks1 | 3+++
Afun/.local/bin/bombs | 32++++++++++++++++++++++++++++++++
Afun/.local/bin/colorbars | 38++++++++++++++++++++++++++++++++++++++
Afun/.local/bin/colorbars-sm | 35+++++++++++++++++++++++++++++++++++
Afun/.local/bin/colorer | 22++++++++++++++++++++++
Afun/.local/bin/colorscheme | 27+++++++++++++++++++++++++++
Afun/.local/bin/emote | 125+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Afun/.local/bin/food | 337+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Afun/.local/bin/ghosts | 31+++++++++++++++++++++++++++++++
Afun/.local/bin/hexcodes | 43+++++++++++++++++++++++++++++++++++++++++++
Afun/.local/bin/lines | 3+++
Afun/.local/bin/linez | 3+++
Afun/.local/bin/panes | 23+++++++++++++++++++++++
Afun/.local/bin/pipes | 123+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Afun/.local/bin/pipesx | 194+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Afun/.local/bin/shellz | 50++++++++++++++++++++++++++++++++++++++++++++++++++
Afun/.local/bin/skull | 59+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Afun/.local/bin/skulls | 40++++++++++++++++++++++++++++++++++++++++
Afun/.local/bin/skully | 44++++++++++++++++++++++++++++++++++++++++++++
Afun/.local/bin/skullz | 42++++++++++++++++++++++++++++++++++++++++++
52 files changed, 2338 insertions(+), 0 deletions(-)

diff --git a/bin/.local/bin/ahoy b/bin/.local/bin/ahoy @@ -0,0 +1,252 @@ +#!/usr/bin/env bash +# ██ +# ░██ ██ ██ +# ██████ ░██ ██████ ░░██ ██ +# ░░░░░░██ ░██████ ██░░░░██ ░░███ +# ███████ ░██░░░██░██ ░██ ░██ +# ██░░░░██ ░██ ░██░██ ░██ ██ +# ░░████████░██ ░██░░██████ ██ +# ░░░░░░░░ ░░ ░░ ░░░░░░ ░░ +# +# author ▓▒ pyratebeard +# code ▓▒ https://git.pyratebeard.net/ +# +# TODO +# * add rkhunter check +# * add clamav check +# * server details + +basename="${0##*/}" + +# colours +black="\e[30m" +red="\e[31m" +green="\e[32m" +yellow="\e[33m" +blue="\e[34m" +magenta="\e[35m" +cyan="\e[36m" +white="\e[37m" +light_black="\e[1;30m" +light_red="\e[1;31m" +light_green="\e[1;32m" +light_yellow="\e[1;33m" +light_blue="\e[1;34m" +light_magenta="\e[1;35m" +light_cyan="\e[1;36m" +light_white="\e[1;37m" +lighter_black="\e[38;5;241m" +reset="\e[0m" + +display_tasks=0 + +usage() { + echo "Usage: ${basename} [-b] [-h] [-m] [-t] [-r] [-s <hostname>] [-w] + + -b: backups + -h: help (this page) + -m: mail + -t: tasking + -r: rss + -s: show <hostname> details, use 'all' to show all + -w: weather +" +} + +heading() { + header="$(echo ${1} | sed -e 's/\(.\)/\1 /g')" + echo -e "${lighter_black}├┄ ${light_white}${header}${reset}" +} + +tasking() { + heading ${FUNCNAME[0]} + total_tasks=$(cat $HOME/.todo | wc -l) + + echo -e "${lighter_black}│${reset}you have ${light_green}${total_tasks}${reset} task(s)" +} + +# check nightly backups +backups() { + heading ${FUNCNAME[0]} + local backup_success=0 + local remote_backup_success=0 + local borg_backup_success=0 + local failed="" + local remote_failed="" + local borg_failed="" + _repos=$(find /home/pyratebeard/lib/dedup/* -maxdepth 1 -type d -prune -printf '%f\n') + for r in ${_repos} ; do + _latest=$(find /home/pyratebeard/lib/dedup/${r}/archive -type f \ + -exec stat -c '%X %n' {} \; | \ + sort -nr | \ + awk -F\/ 'NR==1 {print $NF}') + if [[ "${_latest}" -lt $(date --date="yesterday" +%Y%m%d) ]] ; then + backup_success=$(( backup_success + 1 )) + failed+="${r} " + fi +# _remote_latest=$(rclone ls backblaze:securededup/$r/archive | \ +# tail -n1 | \ +# awk '{print $NF}') +# if [[ "${_remote_latest}" -lt $(date --date="yesterday" +%Y%m%d) ]] ; then +# remote_backup_success=$(( remote_backup_success + 1 )) +# remote_failed+="${r} " +# fi + done + [[ ${backup_success} -gt 0 ]] \ + && echo -e "${lighter_black}│${reset}frak! local dedup of ${failed}${red}failed${reset}" \ + || echo -e "${lighter_black}│${reset}schway! local dedup ${light_green}successful${reset}" + +# [[ ${remote_backup_success} -gt 0 ]] \ +# && echo -e "${lighter_black}│${reset}frak! dedup sync of ${failed}${red}failed${reset}" \ +# || echo -e "${lighter_black}│${reset}schway! dedup sync ${light_green}successful${reset}" + +# for b in $(find /media/backup/borg-* -maxdepth 1 -type d -prune -printf '%f\n') ; do +# cut_b=${b##*-} +# _latest=$(BORG_PASSPHRASE=$(pass borg/${cut_b}) borg list /media/backup/${b} | tail -n 1 | awk '{print $1}') +# #echo ${cut_b} - ${_latest} - $(date --date="yesterday" +%Y%m%d) +# if [[ "${_latest}" -lt $(date --date="yesterday" +%Y%m%d) ]] ; then +# borg_backup_success=$(( borg_backup_success + 1 )) +# borg_failed+="${cut_b} " +# echo -e "${lighter_black}│${reset}frak! borg of ${cut_b} is ${red}over a day old${reset}" +# else +# echo -e "${lighter_black}│${reset}schway! borg of ${cut_b} is ${light_green}up to date${reset}" +# fi +# done +# [[ ${borg_backup_success} -gt 0 ]] \ +# && echo -e "${lighter_black}│${reset}borg of ${borg_failed[@]}is ${red}over a day old${reset}" \ +# || echo -e "${lighter_black}│${reset}schway! borg ${light_green}successful${reset}" +} + +# weather in current location +weather() { + heading ${FUNCNAME[0]} + if [ -f /tmp/weather ] && [[ $(cat /tmp/weather) != "" ]] ; then + wttr=$(cat /tmp/weather | awk -F\: '{print $2}' | cut -c 2-) + echo -e "${lighter_black}│${reset}${wttr}" + else + $HOME/bin/weather + wttr=$(cat /tmp/weather | awk -F\: '{print $2}' | cut -c 2-) + echo -e "${lighter_black}│${reset}${wttr}" + fi +} + +# you've got mail +mail() { + heading ${FUNCNAME[0]} + local -r mail_dir="$HOME/var/mbox" + + local -r pyratebeard_mail=$(find "${mail_dir}"/pyratebeard/INBOX/new/ -type f | wc -l) + local -r unread_mail=$(find "${mail_dir}"/pyratebeard/INBOX/cur/ -type f ! -name "*S" | wc -l) + echo -e "${lighter_black}│${reset}you have ${light_green}${pyratebeard_mail}${reset} new mail(s)" + echo -e "${lighter_black}│${reset}you have ${light_green}${unread_mail}${reset} unread mail(s)" +} + +# not currently used but keeping for future reference +getnews() { + local -r api_key=$(pass websites/newsapi/key) + curl 'https://newsapi.org/v2/top-headlines' -s -G \ + -d sources="$1" \ + -d pageSize=5 \ + -d apiKey="${api_key}" | jq -r 'def default: "\u001b[0m"; def grey: "\u001b[1;30m"; .articles[] | .title, grey + .url, "" + default' | tr -d '\t' +} + +rss() { + heading ${FUNCNAME[0]} + if [ -f ~/.newsboat/cache.db.lock ] ; then + echo -e "${lighter_black}│${reset}${light_black}waiting for newsboat refresh...${reset}" + sleep 10 + fi + local unread_count + unread_count=$(sqlite3 ~/.newsboat/cache.db "select count(unread) from rss_item where unread = 1;") + local queued_pods + queued_pods=$(wc -l ~/.newsboat/queue | awk '{print $1}') + echo -e "${lighter_black}│${reset}there are ${light_green}${unread_count}${reset} unread items" + echo -e "${lighter_black}│${reset}you have ${light_green}${queued_pods}${reset} queued podcasts" +} + +servers() { + echo -e "${cyan} + ┐─┐┬─┐┬─┐┐ ┬┬─┐┬─┐┐─┐ + └─┐├─ │┬┘│┌┘├─ │┬┘└─┐ + ──┘┴─┘┆└┘└┘ ┴─┘┆└┘──┘ +${reset}" + local server="$1" + if [ "${server}" == "all" ] ; then + for node in blacksun grimoire pyratetube mordhaus ; do + heading "${node}" + uptime=$(ssh -q "${node}" "uptime -p | cut -b4- | sed 's/\(,\|ear\|eek\(s\)\|ay\(s\)\|our\(s\)\|inute\(s\)\)//g'") + echo -e "uptime is ${uptime}" + echo + done + else + heading "${server}" + uptime=$(ssh -q "${server}" "uptime -p | cut -b4- | sed 's/\(,\|ear\|eek(s)\|ay(s)\|our(s)\|inute(s)\)//g'") + + echo -e "uptime is ${uptime}" + echo + fi +} + +main() { +# echo -e "${blue}│${magenta} ┳━┓┳ ┳┏━┓┓ ┳ +#${blue}│${magenta} ┃━┫┃━┫┃ ┃┗┏┛ +#${blue}│${magenta} ┛ ┇┇ ┻┛━┛ ┇ +#${blue}└──┄┄────┄┄───┐${yellow} +# $(whoami) ${blue}│ +#┌──┄┄────┄┄───┘${reset}" +#${lighter_black}┊ ${light_blue}██ ▄ █ ████▄ ▀▄ ▄ ▄ +#${lighter_black}┊ ${light_blue}█ █ █ █ █ █ █ █ █ +#${lighter_black}│ ${light_blue}▓▄▄█ ▓▓▀▀█ ▓ █ ▀█ █ +#${lighter_black}┊ ${light_blue}▓ ▒ ▓ ▓ ▀▓▓▒▒ ▓ ▒ +#${lighter_black}│ ${light_blue} ▒ ▒ ▄▀ +#${lighter_black}├───${light_blue}▒${lighter_black}────${light_blue}▀${lighter_black}┄┄ ${light_yellow}$(whoami)${light_blue} ▀ +#${lighter_black}│ ${light_blue} ▀${reset}" + echo -e " +${lighter_black}┊ ${light_blue} ██ █ █ ██ █ █ ${reset}${light_black} ▄█████▄ +${lighter_black}┊ ${light_blue} █ █ █ █ █ █ █ █ ${reset}${light_black} ▄███████▄ +${lighter_black}│ ${light_blue} ▓ █ ▓ █ ▓ █ ▓ █ ${reset}${light_black} ░██ ░█ ░██ +${lighter_black}┊ ${light_blue} ▓▓▓ ▓▓▓ ▓ ▓ ▓ ${reset}${light_black} ░░███████ +${lighter_black}│ ${light_blue} ▒ ▒ ▒ ▒ ▒▒▒ ▒ ${reset}${light_black} ░░█░█░█ +${lighter_black}├────${light_blue}▒${lighter_black}─${light_blue}▒${lighter_black}┄ ${light_yellow}$(whoami) ${reset}${light_black}░ ░ ░ +${lighter_black}│ ${light_blue}▒ ▒${reset}" +# ┳━┓┳ ┳┏━┓┓ ┳ +# ┃━┫┃━┫┃ ┃┗┏┛ +# ┛ ┇┇ ┻┛━┛ ┇ +# ┳━┓┳ ┳┏━┓o +# ┃━┫┃━┫┃ ┃┃ +# ┛ ┇┇ ┻┛━┛┇ +# かいぞく +# ░█▀█░█░█░█▀█░█░█░ +# ░█▀█░█▀█░█░█░░█░░ +# ░▀░▀░▀░▀░▀▀▀░░▀░░ +# + #echo -e " greetings, ${white}\033[7m $(whoami) ${reset}\n" + + tasking + echo -e "${lighter_black}│${reset}" + backups + echo -e "${lighter_black}│${reset}" + weather + echo -e "${lighter_black}│${reset}" + mail + echo -e "${lighter_black}│${reset}" + rss + echo -e "${lighter_black}└──┄┄────┄┄${reset}" +} + +if [ $# -eq 0 ] ; then + main +else + while getopts ":bhmtrws:" opt ; do + case ${opt} in + b) backups ;; + h) usage ;; + m) mail ;; + t) display_tasks=1 ; tasking ;; + r) rss ;; + w) weather ;; + s) servers "${OPTARG}" ;; + *) usage ;; + esac + done +fi diff --git a/bin/.local/bin/bgchange b/bin/.local/bin/bgchange @@ -0,0 +1,10 @@ +#!/usr/bin/env bash + +export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1000/bus +colours=("202f2c" "362124" "363145") + +num=${#colours[@]} +random=$(( ( RANDOM % $num ) )) +new_colour=${colours[$random]} + +xsetroot -solid "#${new_colour}" diff --git a/bin/.local/bin/boat_sync b/bin/.local/bin/boat_sync @@ -0,0 +1,5 @@ +#!/usr/bin/env bash + +export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1000/bus +/usr/bin/newsboat -x reload +sleep 10 diff --git a/bin/.local/bin/capture b/bin/.local/bin/capture @@ -0,0 +1,5 @@ +#!/usr/bin/env bash + +[ -z $1 ] && filename="capture" || filename=$1 + +/usr/bin/scrot -s $HOME/tmp/$(date +%Y%m%d)-${filename}.png diff --git a/bin/.local/bin/checkip b/bin/.local/bin/checkip @@ -0,0 +1,15 @@ +#!/usr/bin/zsh + +ipCmd=$(dig +short myip.opendns.com @resolver1.opendns.com) +ipFile="$HOME/tmp/current_ip" +pager="https://pager.pyratebeard.net/vpn" + +if [ ! -f $ipFile ] ; then + echo "$ipCmd" > $ipFile +fi + +if [[ $ipCmd != $(cat $ipFile) ]] && [[ $ipCmd != "" ]] ; then + curl -d "ip changed to ${ipCmd}" ${pager} + echo "$ipCmd" > $ipFile +fi +echo "$ipCmd" diff --git a/bin/.local/bin/colorcodes.sh b/bin/.local/bin/colorcodes.sh @@ -0,0 +1,6 @@ +for i in {0..255} ; do + printf "\x1b[48;5;%sm%3d\e[0m " "$i" "$i" + if (( i == 15 )) || (( i > 15 )) && (( (i-15) % 6 == 0 )); then + printf "\n"; + fi +done diff --git a/bin/.local/bin/connect b/bin/.local/bin/connect @@ -0,0 +1,66 @@ +#!/usr/bin/env zsh + +# vars +WIFI_DEV=$(iw dev | awk '$1=="Interface"{print $2}') +CONNECTION_FILE_PATH="$HOME/lib/documents/wifi/" +CONNECTION_FILE="${CONNECTION_FILE_PATH}${1}" +CONNECTION=$(echo ${CONNECTION_FILE} | awk -F\/ '{print $NF}') +VPN_KEY_PATH="$HOME/lib/key" +VPN_KEY="${VPN_KEY_PATH}/$(hostname -s).ovpn" + +if [ ! $1 ] ; then + echo "specify a connection file" + exit 1 +elif [ ! -f ${CONNECTION_FILE} ] ; then + echo "${CONNECTION_FILE} does not exist" + exit 1 +fi + +# disconnect +echo "disconnecting any running connection" +$HOME/bin/disconnect + +# bring dev up +if $(ip link show up | grep ${WIFI_DEV} >/dev/null) ; then + echo "${WIFI_DEV} is already up" +else + echo "bringing ${WIFI_DEV} up" + sudo ip link set ${WIFI_DEV} up >/dev/null +fi + +# connect using specified config +if [ -f ${CONNECTION_FILE} ] ; then + echo "connecting to ${CONNECTION}" + sudo wpa_supplicant -B -q -i ${WIFI_DEV} -c ${CONNECTION_FILE} >/dev/null 2>&1 +fi + +# get an ip +echo "starting dhcpcd" +sudo dhcpcd -b -4 ${WIFI_DEV} >/dev/null 2>&1 + +function use_vpn() { + echo "not at home, starting vpn" + sleep 20 + sudo openvpn --config ${VPN_KEY} --daemon >/dev/null 2>&1 + sudo systemd-tty-ask-password-agent + echo "waiting for vpn..." + sleep 60 + echo "nameserver 208.67.222.222 + nameserver 208.67.220.220" | sudo resolvconf -a ${WIFI_DEV}.inet + sudo ip route add 192.168.0.0/24 via 10.8.0.13 dev tun0 + while : + ping -q -c1 fortkickass >/dev/null + if [ $? -eq 0 ] ; then + echo "vpn is up" + break + else + echo "still waiting..." + sleep 2 + fi +} +# when remote bring ip vpn +case "${CONNECTION}" in + home) ;; |work) ;; + *) use_vpn ;; +esac + diff --git a/bin/.local/bin/disconnect b/bin/.local/bin/disconnect @@ -0,0 +1,16 @@ +#!/usr/bin/env bash + +WIFI_DEV=$(iw dev | awk '$1=="Interface"{print $2}') + +killit() { + if $(pidof ${1} >/dev/null) ; then + echo "killing $1" + sudo kill -9 $(pidof ${1}) + fi +} + +sudo umount -a --types nfs,nfs4 +sudo ip link set ${WIFI_DEV} down +killit wpa_supplicant +killit dhcpcd +killit openvpn diff --git a/bin/.local/bin/fontpreview.sh b/bin/.local/bin/fontpreview.sh @@ -0,0 +1,12 @@ +#!/bin/sh + +echo " + + 0 1 2 3 4 5 6 7 8 9 + A B C D E F G H I J K L M N O P Q R S T U V W X Y Z + a b c d e f g h i j k l m n o p q r s t u v w x y z + ! @ # \$ % ^ & * ( ) _ + = - + , . / ; ' [ ] + < > ? : \" { } + +" diff --git a/bin/.local/bin/hashwall b/bin/.local/bin/hashwall @@ -0,0 +1,82 @@ +#!/bin/sh +# +# ██ ██ ██ ██ +# ░██ ░██ ░██ ░██ +# ░██ ██████ ██████░██ ███ ██ ██████ ░██ ░██ +# ░██████ ░░░░░░██ ██░░░░ ░██████ ░░██ █ ░██ ░░░░░░██ ░██ ░██ +# ░██░░░██ ███████ ░░█████ ░██░░░██ ░██ ███░██ ███████ ░██ ░██ +# ░██ ░██ ██░░░░██ ░░░░░██░██ ░██ ░████░████ ██░░░░██ ░██ ░██ +# ░██ ░██░░████████ ██████ ░██ ░██ ███░ ░░░██░░████████ ███ ███ +# ░░ ░░ ░░░░░░░░ ░░░░░░ ░░ ░░ ░░░ ░░░ ░░░░░░░░ ░░░ ░░░ +# +# ▓▓▓▓▓▓▓▓▓▓ +# ░▓ author ▓ xero <x@xero.nu> +# ░▓ code ▓ http://code.xero.nu/dotfiles +# ░▓ mirror ▓ http://git.io/.files +# ░▓▓▓▓▓▓▓▓▓▓ +# ░░░░░░░░░░ +# +#█▓▒░ requires: imagemagick + hsetroot + +usage() { + echo "usage: `basename $0` [-bfsr] + -b background color (#222222) + -f foreground color (#3e3e3e) + -s step (2) + -r resolution (24)" + exit 1 +} + +#args +res=24 +step=4 +bg="#222222" +fg="#3e3e3e" + +# evaluate +while [ $# -gt 0 ] +do + case "$1" in + -b) + bg="$2" + shift + ;; + -f) + fg="$2" + shift + ;; + -s) + step="$2" + shift + ;; + -r) + res="$2" + shift + ;; + --) + shift + break + ;; + -*) + usage + ;; + *) + break + ;; + esac + shift +done + +# calculate +max=$((res*2+2)) +i=0 +lines="" +while + lines="$lines line $i,-1 -1,$i" + i="$((i+step))" + [ "$i" -lt "$max" ] +do :; done + +# generate +convert -size ${res}x${res} xc:${bg} -stroke ${fg} -draw "${lines}" /tmp/wall.png +hsetroot -tile /tmp/wall.png diff --git a/bin/.local/bin/hsetroot b/bin/.local/bin/hsetroot Binary files differ. diff --git a/bin/.local/bin/htmldump b/bin/.local/bin/htmldump @@ -0,0 +1,21 @@ +#!/bin/sh + +usage() { + echo "usage: $(basename $0) [-c charset] file" >&2 +} + +while getopts 'c:h' OPT; do + case $OPT in + c) charset=$OPTARG ;; + h) usage; exit 0 ;; + *) usage; exit 1 ;; + esac +done + +shift $((OPTIND -1)) + +[ -z "$charset" ] && charset="$(file -i $1 | sed 's/.* charset=//')" +iconv -f $charset -t utf-8 $1 \ + | webdump -al \ + | sed 'y/ / /;s/^\s*$//' \ + | cat -s diff --git a/bin/.local/bin/lock b/bin/.local/bin/lock @@ -0,0 +1,11 @@ +#pkill ssh-agent ; pkill gpg-agent +#i3lock -u -c \#1e1b1c +#i3lock -u -c \#240e14 +#i3lock -u -c \#200f12 +echo 'power off' | bluetoothctl +i3lock -u -c \#1a0b0e +#i3lock -u -i /home/pyratebeard/dchs3.png -c \#2b2f2e +echo 'power on' | bluetoothctl +#sleep 5 +#[[ $(echo 'show' | bluetoothctl | awk 'Powered/ {print $NF}') == 'yes' ]] && \ +# echo 'connect 34:DF:2A:5F:04:2C' | bluetoothctl diff --git a/bin/.local/bin/mario b/bin/.local/bin/mario @@ -0,0 +1,39 @@ +#!/bin/sh +# ┏┏┓┳━┓┳━┓o┏━┓ +# ┃┃┃┃━┫┃┳┛┃┃ ┃ +# ┛ ┇┛ ┇┇┗┛┇┛━┛ +# p l u m b e r + +url="$1" +filetype=$(curl -Ls "${url}" | file - | awk '{print $2}') + +iso_type() { + _iso=$(curl -Ls "${url}" | file - | awk '{print $4}') + case ${_iso} in + MP4) /usr/bin/mpv "${url}" ;; + *) /usr/bin/notify-send -u 'normal' "mario: unknown iso type ${_iso}" ;; + esac +} + +vimify() { + timestamp=$(date +%s) + curl -L -o /tmp/mario-${timestamp} "${1}" + LANG=en_US.UTF-8 urxvt -cd /home/pyratebeard -hold -e vim /tmp/mario-${timestamp} + rm -f /tmp/mario-${timestamp} +} + +plumbit() { + case ${filetype} in + JPEG|PNG|GIF) /home/pyratebeard/bin/webimg "${url}" ;; + Audio|WebM) /usr/bin/mpv "${url}" ;; + POSIX) LANG=en_US.UTF-8 urxvt -hold -e curl -s ${url} ;; + ISO) iso_type ;; + HTML|XML|JavaScript) firefox "${url}" ;; + Unicode|Bourne-Again|ASCII|C|Python) vimify "${url}" ;; + PDF) curl -L -o /tmp/mario.pdf "${url}" ; zathura /tmp/mario.pdf ; rm -f /tmp/mario.pdf ;; + *) /usr/bin/notify-send -u 'normal' "mario: unknown filetype ${filetype}" ;; + esac +} + +vidreg="(youtu|watch?v=)" +(([[ "${url}" =~ $vidreg ]] && mpv "${url}") || ([[ "${url}" == *"gallery"* ]] && firefox "${url}")) || plumbit diff --git a/bin/.local/bin/mdpdf b/bin/.local/bin/mdpdf @@ -0,0 +1,41 @@ +#!/bin/sh +# ┌┌┐┬─┐┬─┐┬─┐┬─┐ +# ││││ ││─┘│ │├─ +# ┘ ┆┆─┘┆ ┆─┘┆ +# a simple(?) markdown to +# pdf creator with live view +# +# author: pyratebeard <root@pyratebeard.net> +# +# license: kopimi <https://kopimi.com> +# +# dependencies: +# - pandoc +# - wkhtmltopdf engine +# - zathura +# - vim +# usage: +# `mdpdf <filename>.md` + +[ -z "$1" ] && echo "no file" && exit 1 + +md="${1}" +pdf=$( basename "${md}" .md)".pdf" + +[ ! -f "${md}" ] && touch "${md}" + +[ ! -f "${pdf}" ] && \ + pandoc "${md}" \ + -f markdown \ + -t html5 \ + -o "${pdf}" 2>/dev/null + +zathura "${pdf}" & +zpid=$! + +vim -c "autocmd BufWritePost *.md silent! \ +!pandoc % -o %:r.pdf \ +--pdf-engine=wkhtmltopdf \ +2>/dev/null" "${md}" + +kill ${zpid} diff --git a/bin/.local/bin/newstuir b/bin/.local/bin/newstuir @@ -0,0 +1,5 @@ +#!/usr/bin/env bash + +source ~/src/warez/social_media/tuir/bin/activate +screen=TERM tuir $1 + diff --git a/bin/.local/bin/pbin b/bin/.local/bin/pbin @@ -0,0 +1,33 @@ +#!/bin/sh + +test -n "$1" || exit 1 + +url="http://localhost:8000" +argArr=( "$@" ) +sndArr=() +letter=a + +#for item in ${argArr[@]} ; do +# if [ -f ${item} ]; then +# if [[ $(file --mime-type -b ${item}) == "text"* ]] ; then +# newItem=$(echo "${letter}=<${item}") +# else +# newItem=$(echo "${letter}=@${item}") +# fi +# else +# newItem=$(echo "${letter}=${item}") +# fi +# sndArr+=(${newItem}) +# letter=$(echo "${letter}" | tr "0-9a-z" "1-9a-z_") +#done +#curl -F $(echo ${sndArr[@]}) "${url}" + +if [ -f "${1}" ]; then + if [[ $(file --mime-type -b ${1}) == "text"* ]] ; then + curl -F a=@<(cat ${1}) ${url} + else + curl -F a=@${1} ${url} + fi +else + curl -F a="${1}" ${url} +fi diff --git a/bin/.local/bin/ptt b/bin/.local/bin/ptt @@ -0,0 +1,19 @@ +#!/bin/sh + +ptt_cmd=$(amixer set Capture toggle >/dev/null) + +set_nocap() { + /usr/bin/dunstctl close + /usr/bin/notify-send -u 'normal' 'muted' + /usr/bin/amixer set Capture nocap >/dev/null +} + +set_cap() { + /usr/bin/notify-send -u 'critical' 'unmuted' + /usr/bin/amixer set Capture cap >/dev/null +} + +case $(amixer get Capture | tail -n1 | awk '{print $NF}' | tr -d '[]') in + off) set_nocap ;; + on) set_cap ;; +esac diff --git a/bin/.local/bin/shortner b/bin/.local/bin/shortner @@ -0,0 +1,2 @@ +#!/bin/sh +curl -X PUT -d "${1}" s.rum.sh diff --git a/bin/.local/bin/switchkb b/bin/.local/bin/switchkb @@ -0,0 +1,21 @@ +#!/usr/bin/zsh + +if [ "$1" = "" ] ; then + #echo "which language, gb or us?" + #exit 0 + lang="colemak" +else + lang=$1 +fi + +kill $(pidof xcape) +setxkbmap -option +if [[ "$lang" == "colemak" ]] ; then + setxkbmap -option ctrl:nocaps colemak-ctrl + xmodmap ~/.xmodmap +else + setxkbmap -option ctrl:nocaps $lang +fi +xcape -e 'Control_L=Escape' + +echo "keyboard is switched to $lang" diff --git a/bin/.local/bin/syscat b/bin/.local/bin/syscat @@ -0,0 +1,105 @@ +#!/bin/sh +# ┐─┐┐ ┬┐─┐┌─┐┬─┐┌┐┐ +# └─┐└┌┘└─┐│ │─┤ │ +# ──┘ ┆ ──┘└─┘┘ ┆ ┆ +# syscat by pyratebeard (https://git.pyratebeard.net/dotfiles/file/bin/bin/syscat.html) +# └─ forked from info.sh by z3bra (https://pub.z3bra.org/monochromatic/misc/info.sh) + +gitdir=https://git.pyratebeard.net +myblog=https://log.pyratebeard.net +homepage=https://pyratebeard.net + +c00=$'\e[0;30m' +c01=$'\e[0;31m' +c02=$'\e[0;32m' +c03=$'\e[0;33m' +c04=$'\e[0;34m' +c05=$'\e[0;35m' +c06=$'\e[0;36m' +c07=$'\e[0;37m' +c08=$'\e[1;30m' +c09=$'\e[1;31m' +c10=$'\e[1;32m' +c11=$'\e[1;33m' +c12=$'\e[1;34m' +c13=$'\e[1;35m' +c14=$'\e[1;36m' +c15=$'\e[1;37m' + +f0=$'\e[1;30m' +f1=$'\e[1;37m' +f2=$'\e[0;37m' + +host=$(hostname -s) +up=$(uptime -p | cut -b4- | tr -d ',|eeks|ay|our|inute') +kernel=`uname -r | tr '[:upper:]' '[:lower:]'` +#kernel=`uname -rmo | tr '[:upper:]' '[:lower:]'` +cpuspe="`sed -n '/model\ name/s/^.*:\ //p' /proc/cpuinfo | uniq | rev | cut -d' ' -f 3- | rev | tr '[:upper:]' '[:lower:]'` (x`nproc`)" +cpu=$(grep 'cpu ' /proc/stat | awk '{usage=($2+$4)*100/($2+$4+$5)} END {print usage}') +load=`printf "%.0f" $cpu`% +system=`sed 's/\s*[\(\\]\+.*$//' /etc/issue | tr '[:upper:]' '[:lower:]'` +ram=`free | awk '/Mem:/ {print int($3/$2 * 100.0)}'`% + +if [ -n "$DISPLAY" ]; then + wmname=`xprop -root _NET_WM_NAME|cut -d\" -f2` + #termfn=`sed -n 's/^.*\*font:\s* -\*-\([^-]*\)-.*/\1/p' ~/.Xdefaults|sed 1q` + termfn=$(grep -Ei "^urxvt\*font" ~/.Xdefaults | awk -F: '{print $3}') + fnsize=$(grep -Ei "^urxvt\*font" ~/.Xdefaults | grep -Eo '[0-9]{1,2}' | head -n1) + #systfn=`sed -n 's/^.*font.*"\(.*\)".*$/\1/p' ~/.gtkrc-2.0` + termco=$(awk -F/ '/colors/{print $NF}' ~/.Xdefaults | tr -d '"') + #termco=$(sed -n '/color/s/^.*\///p' ~/.Xdefaults | tr -d '"') +else + wmname="none" + termfn="none" + #systfn="none" +fi + +pkgnum=`pacman -Q|wc -l` +birthd=`sed -n '1s/^\[\([0-9-]*\).*$/\1/p' /var/log/pacman.log | tr - .` + +main() { +cat << EOF +${c00}▓▒ ${f0}│ ${f1}host ${f0}......... $f2$host +${c08} ▒░${f0}│ ${f1}up ${f0}........... $f2$up +${c01}▓▒ ${f0}│ +${c09} ▒░${f0}│ ${f1}os ${f0}........... $f2$system +${c02}▓▒ ${f0}│ ${f1}birth ${f0}........ $f2$birthd +${c10} ▒░${f0}│ +${c03}▓▒ ${f0}│ ${f1}wm ${f0}........... $f2$wmname +${c11} ▒░${f0}│ ${f1}shell ${f0}........ $f2$SHELL +${c04}▓▒ ${f0}│ ${f1}term ${f0}......... $f2$TERM +${c12} ▒░${f0}│ ${f1}font ${f0}......... $f2$termfn $fnsize +${c05}▓▒ ${f0}│ ${f1}colors ${f0}....... $f2$termco +${c13} ▒░${f0}│ +${c06}▓▒ ${f0}│ ${f1}kernel ${f0}....... $f2$kernel +${c14} ▒░${f0}│ ${f1}processor ${f0}.... $f2$cpuspe +${c07}▓▒ ${f0}│ ${f1}memory ${f0}....... $f2$ram +${c15} ▒░${f0}│ ${f1}homepage ${f0}..... $f2$homepage +EOF +} + +mini() { +cat << EOF +${f1}host ${f0}...... $f2$host +${f1}sys ${f0}....... $f2$system +${f1}wm ${f0}........ $f2$wmname +${f1}shell ${f0}..... $f2$SHELL +${f1}term ${f0}...... $f2$TERM +${f1}font ${f0}...... $f2$termfn $fnsize +${f1}colours ${f0}... $f2$termco +${f1}kernel ${f0}.... $f2$kernel +${f1}load ${f0}...... $f2$load +EOF +} + + +if [ $# -eq 0 ] ; then + mini +else + opt="$1" + case ${opt} in + mini) mini ;; + main) main ;; + *) mini ;; + esac +fi diff --git a/bin/.local/bin/sysinfo b/bin/.local/bin/sysinfo @@ -0,0 +1,127 @@ +#!/bin/sh +## author: pyratebeard <root@pyratebeard.net> +## original author: xero <x@xero.nu> +#\\ vars +#FULL=▓ +#EMPTY=░ +#FULL=━ +#EMPTY=┄ + +#EMPTY=━ +EMPTY=─ +FULL=┅ + +name=$USER +host=$(hostname -s) +uptime=$(uptime -p | cut -b4- | tr -d ',|eeks|ay|our|inute') +battery=/sys/class/power_supply/BAT1 +distro=$(grep -E "^ID=" /etc/os-release | awk -F= '{print $2}') +pkgs=$(pacman -Qqs | wc -l) +#upgrade=$(sudo pacman -Sy >/dev/null ; pacman -Qu | wc -l) +kernel=$(uname -r) +shell=$(echo $SHELL | awk -F/ '{print $NF}') +#term=$TERM +term="urxvt" +colors=$(grep urxvt-colors ~/.Xdefaults | awk -F\/ '{print $NF}' | tr -d '"') +font=$(grep -Ei "^urxvt\*font" ~/.Xdefaults | awk -F: '{print $3}') +font_size=$(grep -Ei "^urxvt\*font" ~/.Xdefaults | grep -Eo '[0-9]{1,2}' | head -n1) +#wm=$XDG_SESSION_DESKTOP +wm=`xprop -root _NET_WM_NAME|cut -d\" -f2` + +#\\ progress bar +draw() +{ + perc=$1 + size=$2 + inc=$(( perc * size / 100 )) + out= + if [ -z $3 ] + then + color="36" + else + color="$3" + fi + for v in `seq 0 $(( size - 1 ))`; do + test "$v" -le "$inc" \ + && out="${out}\e[0;34m${FULL}" \ + || out="${out}\e[38;5;236m${EMPTY}" + done + printf $out +} + +#\\ colors +~/bin/blocks + + +#\\ greets +printf " \e[1;37m user \e[0;33m┄┬┄ \e[1;33m$name\n" +printf " \e[1;37m host \e[0;33m┄┼┄ \e[1;34m$host\e[0m\n" +printf " \e[1;37m up \e[0;33m┄┴┄ \e[0;37m$uptime\n" +printf " \e[0m\n" + +#\\ environment +printf " \e[1;37m distro \e[0;33m┄┬┄ \e[0m$distro\n" +printf " \e[1;37m kernel \e[0;33m┄┼┄ \e[0m$kernel\n" +printf " \e[1;37m wm \e[0;33m┄┼┄ \e[0m$wm\n" +printf " \e[1;37m shell \e[0;33m┄┼┄ \e[0m$shell\n" +printf " \e[1;37m term \e[0;33m┄┼┄ \e[0m$term\n" +printf " \e[1;37m font \e[0;33m┄┼┄ \e[0m$font $font_size\n" +printf " \e[1;37m colors \e[0;33m┄┴┄ \e[0m$colors\n" +printf " \e[0m\n" +#printf " \e[1;35m upgrade \e[38;5;236m▓▒ \e[0m$upgrade\n" + +#\\ cpu +cpu=$(grep 'cpu ' /proc/stat | awk '{usage=($2+$4)*100/($2+$4+$5)} END {print usage}') +proc=$(grep ^processor /proc/cpuinfo | wc -l) +c_lvl=`printf "%.0f" $cpu` +printf " \e[1;35m%-4s \e[1;37m%-5s %-25s \n" " cpu" "$c_lvl%" " "`draw $c_lvl 15` + +#\\ ram +ram=`free | awk '/Mem:/ {print int($3/$2 * 100.0)}'` +mem=$(free -hg --si | grep ^Mem | awk '{print $2}' | tr '[:upper:]' '[:lower:]') +printf " \e[1;35m%-4s \e[1;37m%-5s %-25s \n" " ram" "$ram%" " "`draw $ram 15` + +#\\ battery +if [ -f $battery/charge_full ] ; then + b_full=$battery/charge_full + b_now=$battery/charge_now + bf=`cat $b_full` + bn=`cat $b_now` + charge=`printf $(( 100 * $bn / $bf ))` + + case 1 in + $(($charge <= 15))) + color='31' + ;; + *) + color='34' + ;; + esac + printf " \e[0;${color}m%-4s \e[1;${color}m%-5s %-25s \n" " bat" "$charge%" `draw $charge 15 $color` +fi + +#\\ volume +vol=`amixer get Master | awk '$0~/%/{print $5}' | head -n1 | tr -d '[]%'` +if amixer get Master | grep -q '\[off\]' +then + color='31' +else + color='34' +fi +printf " \e[1;35m%-4s \e[1;37m%-5s %-25s \n" " vol" "$vol%" " "`draw $vol 15 $color` + +#\\ temperature +#temp=`sensors | awk '/Core\ 0/ {gsub(/\+/,"",$3); gsub(/\..+/,"",$3) ; print $3}'` +#case 1 in +# $(($temp <= 50))) +# color='34' +# ;; +# $(($temp >= 75))) +# color='31' +# ;; +# *) +# color='36' +# ;; +#esac +#printf " \e[0;${color}m%-4s \e[1;${color}m%-5s %-25s \n\n" "temp" "$temp°c " `draw $temp 15 $color` +printf " \e[0m\n" diff --git a/bin/.local/bin/todo b/bin/.local/bin/todo @@ -0,0 +1,37 @@ +#!/usr/bin/env bash +# +# z3bra - (c) wtfpl 2014 +# Manage a todo list +# The file is just plain text, with one line per task +# This script just provide "shorter" commands to append to the file and display +# its content. For more complex tasks, use other tools like `sed`. + +#Where's the file ? +TODO=${TODO:-$HOME/.todo} + +list() { + # WHOA MUCH CLEVER!! + test -f $TODO && nl $TODO +} + +append() { + # append all arguments "as-is" to the file + echo "$*" >> ${TODO} +} + +delete() { + test -n "$1" || exit 1 + ed $TODO << EOF >/dev/null +${1}d +w +q +EOF +} + +# delete line "$2" (see delete() function) +test "$1" = '-d' && delete "$2" && exit 0 + +# append arguments to the file, or print it otherwise +test -n "$*" && append $* || list + +exit 0 diff --git a/bin/.local/bin/todosync b/bin/.local/bin/todosync @@ -0,0 +1,13 @@ +#!/bin/sh + +LOCAL_TODO="$HOME/.todo" +REMOTE_TODO="storage/documents/markor/todo.txt" +REMOTE_HOST="artoo" +DAEMON_RESTART="SVDIR=/data/data/com.termux/files/usr/var/service sv restart todod" + +exec inotifywait -e close_write -m $LOCAL_TODO|while read TODOFILE; do + echo rsyncing + rsync -e "ssh -i $HOME/.ssh/todod" $LOCAL_TODO $REMOTE_HOST:$REMOTE_TODO + ssh -i $HOME/.ssh/todod $REMOTE_HOST "${DAEMON_RESTART}" + echo finished rsync +done diff --git a/bin/.local/bin/tvshuf b/bin/.local/bin/tvshuf @@ -0,0 +1,14 @@ +#!/bin/sh + +[ $# -eq 0 ] && exit 1 + +tvdir="/media/tv" +series="${tvdir}/$1" +repeat="$2" + +grep ${tvdir} /proc/mounts >/dev/null || exit 1 +[ -d ${series} ] || exit 1 + +for num in $(seq 1 ${repeat}) ; do + mpv $(find ${series} -type f -exec file -N -i -- {} + | sed -n 's!: video/[^:]*$!!p' | shuf -n 1) +done diff --git a/bin/.local/bin/wacom b/bin/.local/bin/wacom @@ -0,0 +1,6 @@ +#!/usr/bin/env bash +monitor=$(xrandr | awk '/primary/ {print $1}') + +for dev in $(xsetwacom --list devices | awk -F"id:" '{print $2}' | awk '{print $1}') ; do + xsetwacom --set "${dev}" MapToOutput "${monitor}" +done diff --git a/bin/.local/bin/wat b/bin/.local/bin/wat @@ -0,0 +1,15 @@ +#!/bin/sh +# ┐ ┬┬─┐┌┐┐ +# ││││─┤ │ +# └┴┆┘ ┆ ┆ +# dumb wrapper around +# at(1) for use with menu + +test $1 || echo "wat <time> <level> <message>" ; exit 1 +wat_time="$1" +wat_level="$2" +wat_msg="$3" + +notify_cmd="/usr/bin/notify-send" + +echo "${notify_cmd} -u '${wat_level}' '${wat_msg}'" | at "${wat_time}" diff --git a/bin/.local/bin/weather b/bin/.local/bin/weather @@ -0,0 +1,13 @@ +#!/bin/sh + +weather() { + local -r location="$(curl -s "https://ipvigilante.com/" | jq -r '.data.city_name')" + wttr=$(curl -s "wttr.in/${location}?format=%l:+%f+%C\n" | tr '[:upper:]' '[:lower:]') + if [[ ${wttr} == "unknown location"* ]] ; then + echo -e "weather is ${light_red}unavailable${reset}" > /tmp/weather + else + echo -e "${wttr}" > /tmp/weather + fi +} + +weather diff --git a/bin/.local/bin/webimg b/bin/.local/bin/webimg @@ -0,0 +1,46 @@ +#!/bin/sh +# ┓ ┳┳━┓┳━┓o┏┏┓┏━┓ +# ┃┃┃┣━ ┃━┃┃┃┃┃┃ ┳ +# ┗┻┇┻━┛┇━┛┇┛ ┇┇━┛ +# +# requires `identify` from imagemagick + +img="/tmp/webimg" +image=$(xsel -b) + +if [ -f ${img} ] ; then + rm -f ${img} +fi + +function notify() { + msg=$1 + notify-send -u 'normal' "webimg: ${msg}" +} + +function show_img() { + if [[ ${image} = *w3mtmp* ]] ; then + img=${image} + elif [[ ${image} =~ .*gif$ ]] ; then + img="${img}.gif" + curl -s "${image}" --output ${img} + else + image="${image/http\:/https\:}" + image="${image/\/imgur/\/i\.imgur}" + curl -s "${image}" --output ${img} + fi + + if identify ${img} 2>&1 1>/dev/null ; then + if identify ${img} | grep GIF 2>&1 1>/dev/null ; then + mv "${img}" $(echo "${img}".gif) + img="${img}.gif" + fi + sxiv -ba "${img}" 2>/dev/null + else + notify "not an image file" + exit 1 + fi +} + +[ $# -eq 1 ] && image="$1" ; show_img || show_img + +rm -f ${img} diff --git a/bin/.local/bin/windowcast b/bin/.local/bin/windowcast @@ -0,0 +1,13 @@ +#!/bin/sh + +IFS=$'\n' +array=($(xwininfo | grep -E "Absolute upper-left X|Absolute upper-left Y|Width|Height" | awk -F: '{print $2}' | tr -d ' ')) + +pos_x=$(( array[0] + 10 )) +pos_y=$(( array[1] + 10 )) +width=${array[2]} +height=${array[3]} + +ffmpeg -f x11grab -framerate 25 \ + -video_size ${width}x${height} -i +${pos_x},${pos_y} \ + $HOME/lib/videos/recordings/screencasts/$(date +%Y%m%d)-window-${1}.mp4 diff --git a/bin/.local/bin/winmag b/bin/.local/bin/winmag @@ -0,0 +1,11 @@ +#!/bin/sh + +IFS=$'\n' +array=($(xwininfo | grep -E "Absolute upper-left X|Absolute upper-left Y|Width|Height" | awk -F: '{print $2}' | tr -d ' ')) + +pos_x=$(( array[0] + 10 )) +pos_y=$(( array[1] + 10 )) +width=${array[2]} +height=${array[3]} + +xzoom -source ${width}x${height}+${pos_x}+${pos_y} diff --git a/fun/.local/bin/blocks b/fun/.local/bin/blocks @@ -0,0 +1,3 @@ +#!/usr/bin/env bash +pcs() { for i in {0..7}; do echo -en "\e[${1}$((30+$i))m █▓▒\e[0m"; done; } +printf "\n%s\n%s\n\n" "$(pcs)" "$(pcs '1;')" diff --git a/fun/.local/bin/blocks1 b/fun/.local/bin/blocks1 @@ -0,0 +1,3 @@ +#!/usr/bin/env bash +pcs() { for i in {0..7}; do echo -en "\e[${1}$((30+$i))m \u2588\u2588 \e[0m"; done; } +printf "\n%s\n%s\n\n" "$(pcs)" "$(pcs '1;')" diff --git a/fun/.local/bin/bombs b/fun/.local/bin/bombs @@ -0,0 +1,32 @@ +#!/usr/bin/env bash +# +# ANSI color scheme script by pfh +# modified by pyratebeard +# +# Initializing mod by lolilolicon from Archlinux +# + +f=3 b=4 +for j in f b; do + for i in {0..7}; do + printf -v $j$i %b "\e[${!j}${i}m" + done +done +bld=$'\e[1m' +rst=$'\e[0m' +inv=$'\e[7m' +cat << EOF + +$f1 ▄ ▄▀ $f2 ▄ ▄▀ $f3 ▄ ▄▀ $f4 ▄ ▄▀ $f5 ▄ ▄▀ $f6 ▄ ▄▀ +$f1 ▄▀▀▄ $f2 ▄▀▀▄ $f3 ▄▀▀▄ $f4 ▄▀▀▄ $f5 ▄▀▀▄ $f6 ▄▀▀▄ +$f1 ▄███▄ $f2 ▄███▄ $f3 ▄███▄ $f4 ▄███▄ $f5 ▄███▄ $f6 ▄███▄ +$f1 ███████ $f2 ███████ $f3 ███████ $f4 ███████ $f5 ███████ $f6 ███████ +$f1 ▀███▀ $f2 ▀███▀ $f3 ▀███▀ $f4 ▀███▀ $f5 ▀███▀ $f6 ▀███▀ +$bld +$f1 ▄ ▄▀ $f2 ▄ ▄▀ $f3 ▄ ▄▀ $f4 ▄ ▄▀ $f5 ▄ ▄▀ $f6 ▄ ▄▀ +$f1 ▄▀▀▄ $f2 ▄▀▀▄ $f3 ▄▀▀▄ $f4 ▄▀▀▄ $f5 ▄▀▀▄ $f6 ▄▀▀▄ +$f1 ▄███▄ $f2 ▄███▄ $f3 ▄███▄ $f4 ▄███▄ $f5 ▄███▄ $f6 ▄███▄ +$f1 ███████ $f2 ███████ $f3 ███████ $f4 ███████ $f5 ███████ $f6 ███████ +$f1 ▀███▀ $f2 ▀███▀ $f3 ▀███▀ $f4 ▀███▀ $f5 ▀███▀ $f6 ▀███▀ +$rst +EOF diff --git a/fun/.local/bin/colorbars b/fun/.local/bin/colorbars @@ -0,0 +1,38 @@ +#!/bin/sh +# +# colorbars - smpte color bars in sh +# http://git.io/colorbars + +echo + +for y in $(seq 0 13); do + printf %s ' ' + for color in 7 3 6 2 5 1 4; do + tput setab ${color} + printf %s ' ' + done + tput sgr0 + echo +done + +for y in 0 1; do + printf %s ' ' + for color in 4 0 5 0 6 0 7; do + tput setab ${color} + printf %s ' ' + done + tput sgr0 + echo +done + +for y in $(seq 0 4); do + printf %s ' ' + for color in 4 4 4 4 4 7 7 7 7 7 5 5 5 5 5 0 0 0 0 0 0 0 0 0 0 0 0 0; do + tput setab ${color} + printf %s ' ' + done + tput sgr0 + echo +done + +echo diff --git a/fun/.local/bin/colorbars-sm b/fun/.local/bin/colorbars-sm @@ -0,0 +1,35 @@ +#!/bin/sh +echo + +# mini smpte color bars +for y in $(seq 0 6); do + printf %s ' ' + for color in 7 3 12 14 5 9 4; do + tput setab ${color} + printf %s ' ' + done + tput sgr0 + echo +done + +for y in 0 1; do + printf %s ' ' + for color in 2 0 5 0 6 0 7; do + tput setab ${color} + printf %s ' ' + done + tput sgr0 + echo +done + +for y in $(seq 0 2); do + printf %s ' ' + for color in 4 4 4 4 4 7 7 7 7 7 6 6 6 6 6 0 0 0 0 0 0 0 0 0 0 0 0 0; do + tput setab ${color} + printf %s ' ' + done + tput sgr0 + echo +done + +echo diff --git a/fun/.local/bin/colorer b/fun/.local/bin/colorer @@ -0,0 +1,22 @@ +#!/bin/sh +# https://github.com/rxw/bin/blob/master/colorer.sh +echo -e " + \033[0;30m▒░ \033[0;31m▒░ \033[0;32m▒░ \033[0;33m▒░ \033[0;34m▒░ \033[0;35m▒░ \033[0;36m▒░ \033[0;37m▒░ + \033[0;30m▒░ \033[0;31m▒░ \033[0;32m▒░ \033[0;33m▒░ \033[0;34m▒░ \033[0;35m▒░ \033[0;36m▒░ \033[0;37m▒░ + \033[1;30m▒░ \033[1;31m▒░ \033[1;32m▒░ \033[1;33m▒░ \033[1;34m▒░ \033[1;35m▒░ \033[1;36m▒░ \033[1;37m▒░ + \033[1;30m▒░ \033[1;31m▒░ \033[1;32m▒░ \033[1;33m▒░ \033[1;34m▒░ \033[1;35m▒░ \033[1;36m▒░ \033[1;37m▒░ + \033[0;39m" + +#echo -e "\0033[0;36m +# ██████ +# ██████ +# ▓▓▓▓▓▓ +# ▓▓▓▓▓ +# ▒▒▒▒▒ +# ▒▒▒▒ +# ▒▒▒▒ +# ▒▒▒ +# ░░ +# ░ +#\033[0;39m +#" diff --git a/fun/.local/bin/colorscheme b/fun/.local/bin/colorscheme @@ -0,0 +1,27 @@ +#!/usr/bin/env bash +# +# This file echoes a bunch of color codes to the +# terminal to demonstrate what's available. Each +# line is the color code of one forground color, +# out of 17 (default + 16 escapes), followed by a +# test use of that color on all nine background +# colors (default + 8 escapes). +# + +T='πr8' # The test text + +echo -e "\n 40m 41m 42m 43m\ + 44m 45m 46m 47m"; + +for FGs in ' m' ' 1m' ' 30m' '1;30m' ' 31m' '1;31m' ' 32m' \ + '1;32m' ' 33m' '1;33m' ' 34m' '1;34m' ' 35m' '1;35m' \ + ' 36m' '1;36m' ' 37m' '1;37m'; + do FG=${FGs// /} + echo -en " $FGs \033[$FG $T " + for BG in 40m 41m 42m 43m 44m 45m 46m 47m; + do echo -en "$EINS \033[$FG\033[$BG $T \033[0m"; + done + echo; +done +echo + diff --git a/fun/.local/bin/emote b/fun/.local/bin/emote @@ -0,0 +1,125 @@ +#!/bin/sh +# +# created from https://redd.it/2skqh9 +# in case kori REALLY registered the "emote" name... DID YOU DO THAT ? +# emoth - 2015 (c) wtfpl z3bra.org + +usage() { + echo "$(basename $0) <name>" + exit 1 +} + +case $1 in + shrug) + printf "┐('-')┌" + ;; + shrug2) + printf "┐('~'; )┌" + ;; + rage) + printf "(╯°□°)╯︵ ┻━┻" + ;; + bear) + printf "ʕ •ᴥ•ʔ" + ;; + dissaprove) + printf "(ಠ_ಠ)" + ;; + thatguy) + printf "(¬_¬)" + ;; + lenny) + printf "( ͡° ͜ʖ ͡°)" + ;; + satan) + printf "ψ(`∇´)ψ" + ;; + yuno) + printf "ლ(ಠ益ಠლ)" + ;; + whistle) + printf "♪(´ε` )" + ;; + dance) + printf "~(^3^)~" + ;; + party) + printf "└[∵]┐└[∵]┘┌[∵]┘└[∵]┐└[∵]┘┌[∵]┘" + ;; + stare) + printf "( ´_⊃`)" + ;; + kiss) + printf "( ˘ ³˘)♥" + ;; + shades) + printf "(•_•) ( •_•)>⌐■-■ (⌐■_■)" + ;; + magic) + printf "(∩`-´)⊃━☆゚.*・。゚" + ;; + magic2) + printf "▒▒▓█▇▅▂∩( ✧Д✧)∩▂▅▇█▓▒▒" + ;; + shame) + printf "(◞‸◟;)" + ;; + fu) + printf "┌∩┐(◣_◢)┌∩┐" + ;; + mad) + printf "(⇀‸↼‶)" + ;; + flex) + printf "ᕙ(⇀‸↼‶)ᕗ" + ;; + trip) + printf "。.*:・’゚:。'(((+_+)))。.*:゚・’゚゚:。’・゚" + ;; + drown) + printf "︵‿︵‿︵‿︵‿︵‿︵‿︵‿ヽ(゜□゜ )ノ︵‿︵‿︵‿︵‿︵‿" + ;; + squid) + printf "<コ:彡" + ;; + walrus) + printf "(:3 っ)っ" + ;; + fish) + printf "<º)))><" + ;; + psp) + printf "(+[__]∙:∙)" + ;; + nes) + printf "[+=••]" + ;; + sad) + printf "(╥﹏╥)" + ;; + cry) + printf "( -̥̥̥̥̥̥̥̥̥̥̥̥̥̥̥̥̥̥̥̥̥̥̥̥̥᷄◞ω◟-̥̥̥̥̥̥̥̥̥̥̥̥̥̥̥̥̥̥̥̥̥̥̥̥̥᷅ )" + ;; + lol) + printf "┐(^0^)┌" + ;; + smoke) + printf "(_̅_̅_̅_̅_̅м̅a̅я̅i̅j̅u̅a̅n̅a̅_̅_̅_̅ () ด้้้้้็็็็็้้้้้็็็็็้้้้้้้้็็็็็้้้้้็็็็็้้้้้้้้็็็็็้้้้้็็็็็้้้้้้้้็็็็็้้้้้็็็็็" + ;; + loot) + printf "[̲̅$̲̅(̲̅ ͡° ͜ʖ ͡°̲̅)̲̅$̲̅]" + ;; + infinitesadness) + printf "Ỏ̷͖͈̞̩͎̻̫̫̜͉̠̫͕̭̭̫̫̹̗̹͈̼̠̖͍͚̥͈̮̼͕̠̤̯̻̥̬̗̼̳̤̳̬̪̹͚̞̼̠͕̼̠̦͚̫͔̯̹͉͉̘͎͕̼̣̝͙̱̟̹̩̟̳̦̭͉̮̖̭̣̣̞̙̗̜̺̭̻̥͚͙̝̦̲̱͉͖͉̰̦͎̫̣̼͎͍̠̮͓̹̹͉̤̰̗̙͕͇͔̱͕̭͈̳̗̭͔̘̖̺̮̜̠͖̘͓̳͕̟̠̱̫̤͓͔̘̰̲͙͍͇̙͎̣̼̗̖͙̯͉̠̟͈͍͕̪͓̝̩̦̖̹̼̠̘̮͚̟͉̺̜͍͓̯̳̱̻͕̣̳͉̻̭̭̱͍̪̩̭̺͕̺̼̥̪͖̦̟͎̻̰_Ỏ̷͖͈̞̩͎̻̫̫̜͉̠̫͕̭̭̫̫̹̗̹͈̼̠̖͍͚̥͈̮̼͕̠̤̯̻̥̬̗̼̳̤̳̬̪̹͚̞̼̠͕̼̠̦͚̫͔̯̹͉͉̘͎͕̼̣̝͙̱̟̹̩̟̳̦̭͉̮̖̭̣̣̞̙̗̜̺̭̻̥͚͙̝̦̲̱͉͖͉̰̦͎̫̣̼͎͍̠̮͓̹̹͉̤̰̗̙͕͇͔̱͕̭͈̳̗̭͔̘̖̺̮̜̠͖̘͓̳͕̟̠̱̫̤͓͔̘̰̲͙͍͇̙͎̣̼̗̖͙̯͉̠̟͈͍͕̪͓̝̩̦̖̹̼̠̘̮͚̟͉̺̜͍͓̯̳̱̻͕̣̳͉̻̭̭̱͍̪̩̭̺͕̺̼̥̪͖̦̟͎̻̰" + ;; + shit) + printf "▄█▀ █▬█ █ ▀█▀" + ;; + iotek) + printf "⇌" + ;; + # add more as you please + *) + usage + ;; +esac diff --git a/fun/.local/bin/food b/fun/.local/bin/food @@ -0,0 +1,337 @@ +#!/bin/sh +# food: {ascii/ansi} art food in your terminal +# +# ████ ██ +# ░██░ ░██ +# ██████ ██████ ██████ ░██ +# ░░░██░ ██░░░░██ ██░░░░██ ██████ +# ░██ ░██ ░██░██ ░██ ██░░░██ +# ░██ ░██ ░██░██ ░██░██ ░██ +# ░██ ░░██████ ░░██████ ░░██████ +# ░░ ░░░░░░ ░░░░░░ ░░░░░░ +# +# ▓▓▓▓▓▓▓▓▓▓ +# ░▓ author ▓ xero <x@xero.nu> +# ░▓ code ▓ http://code.xero.nu/dotfiles +# ░▓ mirror ▓ http://git.io/.files +# ░▓▓▓▓▓▓▓▓▓▓ +# ░░░░░░░░░░ + +usage() { +printf "usage: `basename $0` \n\ + [--burger burger] curl -L git.io/burger\n\ + [--coffee coffee] curl -L git.io/coffee\n\ + [--hotcoffee hotcoffee] curl -Ls git.io/hotcoffee | sh\n\ + [--pancakes pancakes] curl -L git.io/pancakes\n\ + [--pizza pizza] curl -L git.io/pizzza\n\ + [--pizza2 pizza2] curl -L git.io/pizzza\n\ + [--poptart poptart] curl -L git.io/poptart\n\ + [--rice rice] curl -L git.io/rice\n\ + [--vburger vburger] curl -L git.io/vburger\n\ + [--waffles waffles] curl -L git.io/waffles\n\ + [--help help]\n" +} + +taco() { +cat << TACO + + ▄▄▄▄ ▄▄ ▄▄▄▄▄▄ + ▄▄▄▄▄ ▄▄▄▄▄▄▄▄▄▄▄▄  + ▄▄▄▄ ▄ ▄▄▄▄▄ ▄ ▄ ▄  ▄▄▄ + ▄▄▄▄▄ ▄▄▄▄▄ ▄ ▄ ▄ ▄▄▄ + ▀▄▄▄▄▄▄▄▄▄ ▄ ▄ ▄ ▄    + ▄▄▄ ▄ ▄▄   ▄ ▄ ▄ ▄ ▄ ▄▄  +  ▄▄▄▄▄▄  ▄ ▄ ▄ ▄▄▄▄▄   +▄▄▄▄▄▄▄▄▄   ▄▄ ▄ ▄▄▄▄ ▄▄▄▄ ▄ +  ▄▄ ▄▄▄   ▄▄ ▄▄▄▄ ▄▄▄▄ ▄▄▀▀ + ▀▄ ▄  ▄   ▄▄▄▄ ▄▄▄▄ ▄▄▀▀ +  ▄▄ ▄▄▄▄▄ ▄▄▄▄ ▄▄▀▀ + ▄▄▄▄ ▄▄▄▄▄ ▄▄▀▀ + ▀▀▀▄▄▄▄▄▄▀▀▀ +  +TACO +} + +pizza() { +cat << PIZZA + ▄▄▀▀▀▀▀▄ + ▄▄▀ ▀▀▀▀▀▀▀  + ▄▀▀   ▀▀▀▀▀▀▀▀ ▀▄ + ▄▀▀▀  ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▄ + ▄▀▀ ▀▀ ▀▀▀▀▀  ▀▀▀▀ ▀▀▀▀▀▄ +  ▀▀▀▀▀ ▀ ▀▀▀▀▀▀▀  ▀▀ ▀▀▀▀  +  ▀▀ ▀▀▀ ▀▀▀▀▀▀▀▀  ▀▀▀  ▀▀   + ▀▀▀▀   ▀▀ ▀▀▀   ▀▀▀▀▀   ▀ ▀▀▄ + ▀▀▀▀▀▀▀▀ ▀▀ ▀▀  ▀    ▀▀ ▀▀▀▀▄ + ▀▀▀▀ ▀▀▀▀▀▀▀▀▀ ▀▀▀▀▀    + ▀▀▀▀▀    ▀▀▀▀▀  ▀▀▀▀▀▀▄ +    ▀▀   ▀▀▀▀▀▀▀▀▀▀▀▄ +  ▀▀▄ ▀▀▀▀▀▀▀▀▀▀▀▀▀▀  +      ▀▀   ▀▀▀▀▀▀▀▀▀ + ▀▀     + ▄▀▀  +      + ▀▀ +PIZZA +} + +pizza2() { +cat << PIZZA + ▄▄▄▄▄▄▄▄▄▄ + ▄▄▄▄▄ ▄▄ ▄▄   + ▄▄ ▄▄ ▄▄ ▄▄▄▄ ▄  + ▄▄  ▄ ▄▄ ▄ ▄▄▄▄▄▄  +▄▄▄ ▄ ▄ ▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄ +   ▄ ▄ ▄▄▄▄ ▄ ▄▄ ▄▄   +▀▄   ▄▄▄▄▄▄▄▄ ▄▄▄ ▄ ▄ ▄  + ▀▄▄▄▄▄▄▄▄▄▄▄▄ ▄ ▄ ▄▄▄ + ▀▀▄▄▄▄ ▄ ▄ ▄▄▄ ▄▄▄▄   + ▀▄▄ ▄▄▄ ▄▄▄  ▄▄▄ + ▀▀▄▄▄▄▄▄  ▄▄ ▄ ▄ + ▀▄▄▄▄▄▄▄ ▄     + ▀▀▄▄▄▄▄▄ ▄▄▄ + ▀▄▄▄▄    + ▀▄▄▄▄▄▄ + ▀▀▄  +PIZZA +} + +pancakes() { +cat << PANCAKES + ▄▄▄▄▄▄▀▄▄▄▄▄▄▄ + ▄▄▄▄▀▀▀▀        ▀▀▀▀▀▀▄▄▄ + ▄▄ ▀ ▀   ▀  ▀▀▀▀▀▀▀     ▀  ▀▄ +▄▀▀     ▀▀   ▀▀▀▀▀▀▀   ▀▀ ▀   ▄ +       ▀      ▀▀ ▀ ▀▀▀▀▀▀▀▀▀ ▀  +▀▀ ▀▀▀▀  ▀▀    ▀▀ ▀▀▀▀   ▀▀▀▀ ▀▄ + ▀    ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀   ▀▀    +   ▀▀▀▀              ▀▀▀▀  ▀     +   ▀▀  ▀▀▀ ▀▀▀▀ ▀▀▀▀▀  ▀▀▀ ▀▀▀   + ▀  ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀  ▀  +   ▀▀▀                   ▀▀▀     +  ▀▀▀ ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀   ▀▀▀   + ▀ ▀    ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀   ▀▀▀▀ + ▀▀▀▀  ▀▀▀▀▀▀▀▀▀▀▀▀▀▀  ▀▀▀▀ + ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀ +PANCAKES +} + +poptart() { +cat << POPTART + ▄▄▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▄ +  ▀ ▀▀ ▀  ▀▀▀▀▀▀▀▀▀▀▀▀▀  ▀ ▀▀▄ + ▀   ▀▀▀      ▀▀       ▀▀▀▀▀ ▀▀▀▄ + ▀▀ ▀▀▀                  ▀▀▀▀▀  ▀▄ +  ▀      ▀▀          ▀     ▀▀▀ ▀▀   +         ▀▀                     ▀▀  + ▀▀     ▀                 ▀▀▀▀▀ ▀   + ▀▀                       ▀  ▀▀▀▀   + ▀                          ▀▀▀▀ ▀  + ▀▀  ▀▀        ▀ ▀       ▀▀ ▀▀▀▀▀▀  + ▀                       ▀▀         +             ▀       ▀          ▀▀  + ▀▀      ▀▀                    ▀▀▀  + ▀▀   ▀ ▀▀▀             ▀▀▀         +      ▀          ▀      ▀▀          + ▀▀   ▀▀▀▀      ▀▀▀                 +     ▀▀▀▀▀▀  ▀                      +  ▀ ▀▀ ▀▀▀ ▀▀▀▀▀▀▀ ▀▀   ▀▀▀▀ ▀▀▀    +  ▀   ▀▀                    ▀       +   ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀     + ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀ +POPTART +} + +waffles() { +cat << WAFFLES + ▄▄▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▄ + ▄▀▀▀▀▀▀▀▀ ▀▀▀▀▀▀▀▀   ▀▀ ▀▀▀  ▀▀▄ +▄▀▀▀▀▀▀▀▀▀▀ ▀▀▀▀▀▀▀▀▀   ▀▀▀▀▀▀▀ ▀▄ +   ▀    ▀ ▀ ▀▀      ▀   ▀    ▀▀▀   + ▀ ▀▀  ▀▀ ▀▀  ▀ ▀ ▀▀▀ ▀  ▀  ▀▀▀▀   + ▀▀▀▀▀▀ ▀▀▀ ▀   ▀▀▀▀▀▀▀▀ ▀▀▀▀▀ ▀   +  ▀▀▀   ▀   ▀   ▀▀▀     ▀▀    ▀▀   + ▀     ▀▀  ▀▀  ▀ ▀▀ ▀   ▀  ▀▀▀ ▀   + ▀ ▀    ▀    ▀ ▀▀       ▀    ▀     + ▀▀ ▀  ▀▀▀▀▀▀▀    ▀▀▀    ▀  ▀▀▀▀   +    ▀▀▀▀▀  ▀ ▀ ▀ ▀▀ ▀    ▀▀▀▀▀     + ▀ ▀▀▀▀▀▀▀ ▀▀ ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀   + ▀     ▀▀        ▀▀ ▀      ▀▀▀     +   ▀   ▀▀    ▀    ▀     ▀   ▀▀     +▀▀ ▀▀▀▀▀▀▀  ▀ ▀▀▀▀▀▀▀ ▀  ▀▀▀▀▀▀▀▀▀ + ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀ + ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀ +WAFFLES +} + +burger() { +cat << BURGER + ▄▄▄▄▀▀▀▀▀▀▄▄▄▄ + ▄▄▀▀▀▀▀ ▀  ▀▀▀▀▀▀▀▀▀▄▄ + ▄▀  ▀  ▀  ▀▀▀ ▀ ▀▀▀ ▀▀ ▀▀▄ + ▄▀▀  ▀▀   ▀▀▀▀ ▀  ▀▀ ▀▀  ▀▀▀▄ + ▄▀  ▀ ▀   ▀  ▀▀▀ ▀   ▀▀▀ ▀▀▀▀ ▄ + ▄▀▀▀▀▀▀▀▀▀  ▀  ▀   ▀▀  ▀▀▀▀▀     +  ▀▀▀▀ ▀▀ ▀▀ ▀  ▀ ▀  ▀ ▀▀▀▀ ▀▀▀ ▀ +  ▀▀▀▀ ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▄▄ +▄▀▀▀▀▀▀▀▀▀▀▀▀ ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀ ▀▀ +▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀ ▀ ▀▀▀▀▀▀▀ ▀▀▀ +  ▀▀▀▀▀▀▀▀         ▀▀▀ ▀ ▀▀▀▀▀▀▄ + ▄▀▀▀▀▀▀▀▀▀ ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀ +▀▀▀ ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀ ▀▀  +  ▀▀▀▀▀▀▀ ▀▀▀▀▀▀ ▀  ▀   ▀▀▀▀▀  +  ▀▀▀▀▀▀▀▀▀▀▀ ▀▀▀▀▀▀▀▀▀▀▀▀▀▀  +  ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀  + ▀▀▀ ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀ + ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀ +BURGER +} + +vburger() { +cat << VBURGER + ▄▄▄▄▄▄▄▄▄▄ + ▄▄▄▄▄▄ ▄▄ ▄▄▄▄ ▄▄▄▄▄ + ▄▄▄▄▄ ▄▄ ▄▄▄ ▄▄▄ ▄ ▄▄ + ▄▄▄▄  ▄▄ ▄  ▄  ▄▄▄ ▄▄ +▄▄▄ ▄ ▄ ▄▄ ▄ ▄ ▄▄▄   +   ▄▄ ▄ ▄ ▄▄▄ ▄ ▄ ▄▄▄▄ ▄▄ ▄▀ +▀▄ ▄ ▄▄▄  ▄ ▄ ▄▄▄ ▄▄ ▄▄▄▄▄▄▄▄ +▄▄▄▄▄▄ ▄▄▄▄▄▄▄▄▄ ▄▄▄▄▄▄▄▄ ▄▄▀ +▀▄ ▄▄ ▄▄▄▄▄▄▄▄▄▄▄▄▄▄  ▄▄ ▄▄  +▀▄▄▄ ▄▄ ▄▄▄▄▄▄ ▄ ▄ ▄▄▄▄▄▄▄  + ▀▄ ▄  ▄▄ ▄▄▄▄ ▄ ▄▄ ▄ ▄ ▄ ▄    +  ▄▄▄ ▄▄▄▄▄▄▄▄▄▄▄▄ ▄▄▄ ▄▄▄▄▄     +   ▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄ ▄▄▄▄▀ +   ▄▄ ▄▄▄▄▄▄▄▄▄▄▄▄▄▄ ▄ ▄▄▄▄ ▀ + ▀▄▄▄▄ ▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▀▀ + ▀▀▀▀▄▄▄▄▄▄▄▄▄▄▀▀▀ +VBURGER +} + +rice() { +cat << RICE + ▄▄▄▄▄▄ + ▄▄▄▄ ▄ ▄ ▄▄▄▄ + ▄▄▄▄▄ ▄▄ ▄ ▄ ▄▄▄▄▄▄ + ▄▄▄ ▄▄ ▄ ▄ ▄ ▄ ▄ ▄▄ ▄▄▄ +  ▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄ ▄ + ▀▄ ▄▄ ▄▄▄▄▄▄▄▄▄▄▄▄▄▄ ▄▄ ▄▀ + ▀▄  ▄▄▄▄▄▄ ▄▄▄▄▄▄  ▄▀ + ▀▄ ▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄ ▄▀ + ▀▄ ▄▄▄▄▄▄▄▄▄▄▄▄▄▄ ▄▀ + ▀▀▄▄▄ ▄ ▄▄▄▀▀ + ▀▀▀▀▀▀▀▀ +RICE +} + +coffee() { +cat << COFFEE + ▄▄▄▄▄▄▄▄▄▄ +   ▀▀▀ ▀  ▀▀▀  ▄ +  ▀▀  ▀▀▀▀      ▀▀  +   ▀▀▀▀▀    ▀▀▀▀▀▀  +      ▀▀▀▀▀▀▀▀▀        ▄ +                   ▀ ▀ ▀ +   ▀            ▀▀   ▀ +      ▀▀▀▀▀▀▀▀▀      ▀ +  ▀                     +  ▀                 ▀▀▀▀ +  ▀                ▀▀ + ▀                ▀   ▄▄ + ▀▀▀▀        ▀▀▀▀  ▀▀▀ + ▀▀▀▀▀▀▀▀▀▀▀▀▀ +COFFEE +} + +steam(){ +case "$1" in +"0") +cat << X0 + : : : : : + : : : : : + : : : : : + : : : : : +X0 +;; +"1") +cat << X0 + : : : : : + : : : : : + : : : : : + : : : : : +X0 +;; +"2") +cat << X0 + : : : : : + : : : : : + : : : : : + : : : : : +X0 +;; +"3") +cat << X0 + : : : : : + : : : : : + : : : : : + : : : : : +X0 +;; +esac +} + +hotcoffee() { + steam 1 + coffee + + x=0 + while :; do +cat << X0 + +X0 + steam $x + coffee + [ "$x" -le "2" ] && x=$((x+1)) || x=0 + sleep 0.25 + done +} + +case "$1" in + *--burger|burger) + burger + ;; + *--vburger|vburger) + vburger + ;; + *--poptart|poptart) + poptart + ;; + *--rice|rice) + rice + ;; + *--waffles|waffles) + waffles + ;; + *--pancakes|pancakes) + pancakes + ;; + *--pizza2|pizza2) + pizza2 + ;; + *--pizza|pizza) + pizza + ;; + *--taco|taco) + taco + ;; + *--coffee|coffee) + coffee + ;; + *--hotcoffee|hotcoffee) + hotcoffee + ;; + *) + taco + usage + ;; +esac diff --git a/fun/.local/bin/ghosts b/fun/.local/bin/ghosts @@ -0,0 +1,31 @@ +#!/usr/bin/env bash +# +# ANSI color scheme script by pfh +# +# Initializing mod by lolilolicon from Archlinux +# + +f=3 b=4 +for j in f b; do + for i in {0..7}; do + printf -v $j$i %b "\e[${!j}${i}m" + done +done +bld=$'\e[1m' +rst=$'\e[0m' +inv=$'\e[7m' +cat << EOF + +$f1 ▄▄▄ $f2 ▄▄▄ $f3 ▄▄▄ $f4 ▄▄▄ $f5 ▄▄▄ $f6 ▄▄▄ +$f1 ▀█▀██ ▄ $f2 ▀█▀██ ▄ $f3 ▀█▀██ ▄ $f4 ▀█▀██ ▄ $f5 ▀█▀██ ▄ $f6 ▀█▀██ ▄ +$f1 ▀▄██████▀ $f2 ▀▄██████▀ $f3 ▀▄██████▀ $f4 ▀▄██████▀ $f5 ▀▄██████▀ $f6 ▀▄██████▀ +$f1 ▀█████ $f2 ▀█████ $f3 ▀█████ $f4 ▀█████ $f5 ▀█████ $f6 ▀█████ +$f1 ▀▀▀▀▄ $f2 ▀▀▀▀▄ $f3 ▀▀▀▀▄ $f4 ▀▀▀▀▄ $f5 ▀▀▀▀▄ $f6 ▀▀▀▀▄ +$bld +$f1 ▄▄▄ $f2 ▄▄▄ $f3 ▄▄▄ $f4 ▄▄▄ $f5 ▄▄▄ $f6 ▄▄▄ +$f1 ▀█▀██ ▄ $f2 ▀█▀██ ▄ $f3 ▀█▀██ ▄ $f4 ▀█▀██ ▄ $f5 ▀█▀██ ▄ $f6 ▀█▀██ ▄ +$f1 ▀▄██████▀ $f2 ▀▄██████▀ $f3 ▀▄██████▀ $f4 ▀▄██████▀ $f5 ▀▄██████▀ $f6 ▀▄██████▀ +$f1 ▀█████ $f2 ▀█████ $f3 ▀█████ $f4 ▀█████ $f5 ▀█████ $f6 ▀█████ +$f1 ▀▀▀▀▄ $f2 ▀▀▀▀▄ $f3 ▀▀▀▀▄ $f4 ▀▀▀▀▄ $f5 ▀▀▀▀▄ $f6 ▀▀▀▀▄ +$rst +EOF diff --git a/fun/.local/bin/hexcodes b/fun/.local/bin/hexcodes @@ -0,0 +1,43 @@ +#!/bin/sh + +c00=$'\e[0;30m' +c01=$'\e[0;31m' +c02=$'\e[0;32m' +c03=$'\e[0;33m' +c04=$'\e[0;34m' +c05=$'\e[0;35m' +c06=$'\e[0;36m' +c07=$'\e[0;37m' +c08=$'\e[1;30m' +c09=$'\e[1;31m' +c10=$'\e[1;32m' +c11=$'\e[1;33m' +c12=$'\e[1;34m' +c13=$'\e[1;35m' +c14=$'\e[1;36m' +c15=$'\e[1;37m' + +f0=$'\e[1;30m' +f1=$'\e[1;37m' +f2=$'\e[0;37m' + +hexs=( $(xrdb -query | grep -P '^.*color[0-9]*:' | tr -d '\t' | cut -d: -f2) ) + +cat << EOF +${c00} ░░▓▓██ ${hexs[0]} +${c08} ░░▓▓██ ${hexs[1]} +${c01} ░░▓▓██ ${hexs[2]} +${c09} ░░▓▓██ ${hexs[3]} +${c02} ░░▓▓██ ${hexs[4]} +${c10} ░░▓▓██ ${hexs[5]} +${c03} ░░▓▓██ ${hexs[6]} +${c11} ░░▓▓██ ${hexs[7]} +${c04} ░░▓▓██ ${hexs[8]} +${c12} ░░▓▓██ ${hexs[9]} +${c05} ░░▓▓██ ${hexs[10]} +${c13} ░░▓▓██ ${hexs[11]} +${c06} ░░▓▓██ ${hexs[12]} +${c14} ░░▓▓██ ${hexs[13]} +${c07} ░░▓▓██ ${hexs[14]} +${c15} ░░▓▓██ ${hexs[15]} +EOF diff --git a/fun/.local/bin/lines b/fun/.local/bin/lines @@ -0,0 +1,3 @@ +#!/usr/bin/env bash +pcs() { for i in {0..7}; do echo -en "\e[${1}$((30+$i))m ── \e[0m"; done; } +printf "\n%s\n%s\n\n" "$(pcs)" "$(pcs '1;')" diff --git a/fun/.local/bin/linez b/fun/.local/bin/linez @@ -0,0 +1,3 @@ +#!/usr/bin/env bash +pcs() { for i in {0..7}; do echo -en "\e[${1}$((30+$i))m ┅━┅\e[0m"; done; } +printf "\n%s\n%s\n\n" "$(pcs)" "$(pcs '1;')" diff --git a/fun/.local/bin/panes b/fun/.local/bin/panes @@ -0,0 +1,23 @@ +#!/usr/bin/env bash + +# Author: GekkoP +# Source: http://linuxbbq.org/bbs/viewtopic.php?f=4&t=1656#p33189 + +f=3 b=4 +for j in f b; do + for i in {0..7}; do + printf -v $j$i %b "\e[${!j}${i}m" + done +done +d=$'\e[1m' +t=$'\e[0m' +v=$'\e[7m' + + +cat << EOF + + $f1███$d▄$t $f2███$d▄$t $f3███$d▄$t $f4███$d▄$t $f5███$d▄$t $f6███$d▄$t $f7███$d▄$t + $f1███$d█$t $f2███$d█$t $f3███$d█$t $f4███$d█$t $f5███$d█$t $f6███$d█$t $f7███$d█$t + $f1███$d█$t $f2███$d█$t $f3███$d█$t $f4███$d█$t $f5███$d█$t $f6███$d█$t $f7███$d█$t + $d$f1 ▀▀▀ $f2▀▀▀ $f3▀▀▀ $f4▀▀▀ $f5▀▀▀ $f6▀▀▀ $f7▀▀▀ +EOF diff --git a/fun/.local/bin/pipes b/fun/.local/bin/pipes @@ -0,0 +1,122 @@ +#!/usr/bin/env bash +# pipes.sh: Animated pipes terminal screensaver. +# +# This modified version is maintained at: +# +# https://github.com/livibetter/pipes.sh + +# options: +# s = straight [5-15] +# f = rate [20-100] +# t = style [0-5] +# r = ttl + +VERSION=0.1.0 + +M=32768 +p=1 +f=75 s=13 r=2000 t=0 +w=$(tput cols) h=$(tput lines) +# ab -> idx = a*4 + b +# 0: up, 1: right, 2: down, 3: left +# 00 means going up , then going up -> ┃ +# 12 means going right, then going down -> ┓ +sets=( + "┃┏ ┓┛━┓ ┗┃┛┗ ┏━" + "│╭ ╮╯─╮ ╰│╯╰ ╭─" + "│┌ ┐┘─┐ └│┘└ ┌─" + "║╔ ╗╝═╗ ╚║╝╚ ╔═" + "|+ ++-+ +|++ +-" + "|/ \/-\ \|/\ /-" +) +v=() +RNDSTART=0 +NOCOLOR=0 + +OPTIND=1 +while getopts "p:t:f:s:r:RChv" arg; do +case $arg in + p) ((p=(OPTARG>0)?OPTARG:p));; + t) ((OPTARG>=0 && OPTARG<${#sets[@]})) && V+=($OPTARG);; + f) ((f=(OPTARG>19 && OPTARG<101)?OPTARG:f));; + s) ((s=(OPTARG>4 && OPTARG<16 )?OPTARG:s));; + r) ((r=(OPTARG>=0)?OPTARG:r));; + R) RNDSTART=1;; + C) NOCOLOR=1;; + h) echo -e "Usage: $(basename $0) [OPTION]..." + echo -e "Animated pipes terminal screensaver.\n" + echo -e " -p [1-]\tnumber of pipes (D=1)." + echo -e " -t [0-$((${#sets[@]} - 1))]\ttype of pipes, can be used more than once (D=0)." + echo -e " -f [20-100]\tframerate (D=75)." + echo -e " -s [5-15]\tprobability of a straight fitting (D=13)." + echo -e " -r LIMIT\treset after x characters, 0 if no limit (D=2000)." + echo -e " -R \t\trandom starting point." + echo -e " -C \t\tno color." + echo -e " -h\t\thelp (this screen)." + echo -e " -v\t\tprint version number.\n" + exit 0;; + v) echo "$(basename -- "$0") $VERSION" + exit 0 + esac +done + +# set default values if not by options +((${#V[@]})) || V=(0) + +# Attempt to workaround for Bash versions < 4, such as 3.2 on Mac: +# https://gist.github.com/livibetter/4689307/#comment-892368 +# Untested--in conduction of using shebang `env bash`--should fall back to +# `sleep` +printf -v SLEEP "read -t0.0$((1000/f)) -n 1" +if $SLEEP &>/dev/null; (($? != 142)); then + printf -v SLEEP "sleep 0.0$((1000/f))" +fi + +cleanup() { + # clear up standard input + read -t 0 && cat </dev/stdin>/dev/null + + tput rmcup + tput cnorm + stty echo + exit 0 +} +trap cleanup SIGHUP SIGINT SIGTERM + +for (( i=1; i<=p; i++ )); do + c[i]=$((i%8)) n[i]=0 l[i]=0 + ((x[i]=RNDSTART==1?RANDOM*w/32768:w/2)) + ((y[i]=RNDSTART==1?RANDOM*h/32768:h/2)) + v[i]=${V[${#V[@]} * RANDOM / M]} +done + +stty -echo +tput smcup +tput reset +tput civis +# any key press exits the loop and this script +while $SLEEP; (($? > 128)) || [[ $SLEEP = sleep* ]] && (($? == 0)); do + for (( i=1; i<=p; i++ )); do + # New position: + ((${l[i]}%2)) && ((x[i]+=-${l[i]}+2,1)) || ((y[i]+=${l[i]}-1)) + + # Loop on edges (change color on loop): + ((${x[i]}>w||${x[i]}<0||${y[i]}>h||${y[i]}<0)) && ((c[i]=RANDOM%8, v[i]=V[${#V[@]}*RANDOM/M])) + ((x[i]=(x[i]+w)%w)) + ((y[i]=(y[i]+h)%h)) + + # New random direction: + ((n[i]=RANDOM%s-1)) + ((n[i]=(${n[i]}>1||${n[i]}==0)?${l[i]}:${l[i]}+${n[i]})) + ((n[i]=(${n[i]}<0)?3:${n[i]}%4)) + + # Print: + tput cup ${y[i]} ${x[i]} + [[ $NOCOLOR == 0 ]] && echo -ne "\033[1;3${c[i]}m" + echo -n "${sets[v[i]]:l[i]*4+n[i]:1}" + l[i]=${n[i]} + done + ((r>0 && t*p>=r)) && tput reset && tput civis && t=0 || ((t++)) +done + +cleanup +\ No newline at end of file diff --git a/fun/.local/bin/pipesx b/fun/.local/bin/pipesx @@ -0,0 +1,193 @@ +#!/usr/bin/env bash +# Animated pipes.sh terminal screensaver at an angle. +# Copyright (C) 2013, 2014 by Yu-Jie Lin +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# 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. +# +# Website: https://github.com/livibetter/pipesX.sh + +VERSION=0.1.0 + +W=$(tput cols) H=$(tput lines) +# maximal random value + 1 +M=32768 + +SETS=('╱╲' '/\') +COLORS=(31 32 33 34 35 36 37) + +# default values +N=1 +T=() +I=0.05 +P=25 +R=$((W * H / 4)) + +HELP="Usage: $(basename $0) [OPTIONS] +Animated pipes.sh terminal screensaver at an angle. + +Options: + + -n [1-] number of pipes. (Default: $N) + -t [0-$((${#SETS[@]} - 1))] types of pipes, can be used more than once. (Default: $T) + -i [float] piping interval or maze generation interval. (Default: $I) + -P [0-100] probability of a turning pipe or of \\ in maze generation. (Default: $P) + -r [LIMIT] reset after x characters, 0 if no limit. (Default: $R) + -R random starting point. + -C no color. + -X maze generation. + -h this help message. + -v print version number. +" + +while getopts "n:t:i:P:r:RCXhv" arg; do + case $arg in + n) + ((N = OPTARG > 0 ? OPTARG : N)) + ;; + t) + T+=($(((OPTARG >= 0 && OPTARG < ${#SETS[@]}) ? OPTARG : T))) + ;; + i) + I=$OPTARG + ;; + P) + ((P = (OPTARG >= 0 && OPTARG <= 100) ? OPTARG : P)) + ;; + r) + ((R = OPTARG >= 0 ? OPTARG : R)) + ;; + R) + RNDSTART=1 + ;; + C) + NOCOLOR=1 + ;; + X) + MAZE=1 + ;; + h) + echo -e "$HELP" + exit 0 + ;; + v) + echo "$(basename -- "$0") $VERSION" + exit 0 + esac +done + +# set to default values if not by options +((${#T[@]})) || T=(0) + +do_exit() { + # Show cursor and echo stdin + echo -ne "\e[?25h" + stty echo + clear + exit 0 + } +trap do_exit INT TERM + +# No echo stdin and hide the cursor +stty -echo +echo -ne "\e[?25l" + +# maze geneartion +while [[ $MAZE ]] && clear; do + [[ $NOCOLOR ]] || echo -ne "\e[1;${COLORS[${#COLORS[@]} * RANDOM / M]}m" + for ((i = 0; i < W * H; i++ )); do + echo -ne ${SETS[T]:100 * RANDOM / M < P:1} + done + read -t $I -n 1 && [[ $REPLY =~ q|Q ]] && do_exit +done + +# initialze values +for ((n = 0; n < N; n++)); do + ((X[n] = RNDSTART ? (W + 2) * RANDOM / M : W / 2)) + ((Y[n] = RNDSTART ? (H + 2) * RANDOM / M : H / 2)) + D[n]=$((4 * RANDOM / M)) + C[n]=${COLORS[${#COLORS[@]} * RANDOM / M]} + t[n]=${T[${#T[@]} * RANDOM / M]} +done + +clear +while :; do + for ((n = 0; n < N; n++, CC = 0)); do + x=${X[n]} y=${Y[n]} + d=${D[n]} c=${C[n]} + + # calculate new direction `d` + # 1 0 + # \/ 4 directions 0 to 3 + # /\ + # 2 3 + # valid directions: d: dd', d' is the new direction + # d + # 0: / 00 \ 01 03 + # / / /\ + # 1: / 10 \ 11 12 + # \ \ /\ + # 2: \/ 21 / 22 / 23 + # / \ + # 3: \/ 30 \ 32 \ 33 + # / \ + ((d = (100 * RANDOM / M) < P ? ((d + 1) + 2 * (RANDOM % 2)) % 4 : d)) + ((e = (d + 1) % 4)) + + # calculate new position + # d' x' y' + # 0: x+1 y-1 + # 1: x-1 y-1 + # 2: x-1 y+1 + # 3: x+1 y+1 + ((xn = e < 2 ? x + 1 : x - 1)) + ((yn = d < 2 ? y - 1 : y + 1)) + + # adjust position and change color? + ((d < 2 && y == 0)) && ((yn--, CC=1)) + ((e > 1 && x == 0)) && ((xn--, CC=1)) + ((d > 1 && y == H)) && ((yn++, CC=1)) + ((e < 2 && x == W)) && ((xn++, CC=1)) + ((CC)) && c=${COLORS[${#COLORS[@]} * RANDOM / M]} + ((CC)) && t[n]=${T[${#T[@]} * RANDOM / M]} + + # warp pipe + ((xn = (xn + W + 1) % (W + 1))) + ((yn = (yn + H + 1) % (H + 1))) + + # calculate position in terminal + # d' xt yt + # 0: x' y'+1 + # 1: x'+1 y'+1 + # 2: x'+1 y' + # 3: x' y' + ((xt = e < 2 ? xn : xn + 1)) + ((yt = d < 2 ? yn + 1 : yn)) + + echo -ne "\e[${yt};${xt}H" + [[ $NOCOLOR ]] || echo -ne "\e[1;${c}m" + echo -n "${SETS[t[n]]:d%2:1}" + + X[n]=$xn Y[n]=$yn + D[n]=$d C[n]=$c + done + read -t $I -n 1 && [[ $REPLY =~ q|Q ]] && do_exit + ((R)) && ((r += N, r >= R)) && r=0 && clear +done + +do_exit +\ No newline at end of file diff --git a/fun/.local/bin/shellz b/fun/.local/bin/shellz @@ -0,0 +1,50 @@ +#!/usr/bin/env bash +# ██ ██ ██ +# ░██ ░██ ░██ +# ██████░██ █████ ░██ ░██ ██████ +# ██░░░░ ░██████ ██░░░██ ░██ ░██░░░░██ +#░░█████ ░██░░░██░███████ ░██ ░██ ██ +# ░░░░░██░██ ░██░██░░░░ ░██ ░██ ██ +# ██████ ░██ ░██░░██████ ███ ███ ██████ +#░░░░░░ ░░ ░░ ░░░░░░ ░░░ ░░░ ░░░░░░ +# +# ANSI color scheme script by pyratebeard +# original `ghosts` script by pfh +# +# Initializing mod by lolilolicon from Archlinux +# + +f=3 b=4 +for j in f b; do + for i in {0..7}; do + printf -v $j$i %b "\e[${!j}${i}m" + done +done +bld=$'\e[1m' +rst=$'\e[0m' +inv=$'\e[7m' +bk=$'\e[1;30m' +cat << EOF + +$f1 ▄▄█▀▀███▀▀█▄▄ $f2 ▄▄█▀▀███▀▀█▄▄ $f3 ▄▄█▀▀███▀▀█▄▄ $f4 ▄▄█▀▀███▀▀█▄▄ $f5 ▄▄█▀▀███▀▀█▄▄ $f6 ▄▄█▀▀███▀▀█▄▄ +$f1 ▀▀█▄▄▄▀▄▄▄█▀▀ $f2 ▀▀█▄▄▄▀▄▄▄█▀▀ $f3 ▀▀█▄▄▄▀▄▄▄█▀▀ $f4 ▀▀█▄▄▄▀▄▄▄█▀▀ $f5 ▀▀█▄▄▄▀▄▄▄█▀▀ $f6 ▀▀█▄▄▄▀▄▄▄█▀▀ +$bld +$f1 ▄▄█▀▀███▀▀█▄▄ $f2 ▄▄█▀▀███▀▀█▄▄ $f3 ▄▄█▀▀███▀▀█▄▄ $f4 ▄▄█▀▀███▀▀█▄▄ $f5 ▄▄█▀▀███▀▀█▄▄ $f6 ▄▄█▀▀███▀▀█▄▄ +$f1 ▀▀█▄▄▄▀▄▄▄█▀▀ $f2 ▀▀█▄▄▄▀▄▄▄█▀▀ $f3 ▀▀█▄▄▄▀▄▄▄█▀▀ $f4 ▀▀█▄▄▄▀▄▄▄█▀▀ $f5 ▀▀█▄▄▄▀▄▄▄█▀▀ $f6 ▀▀█▄▄▄▀▄▄▄█▀▀ +$rst +EOF +#$bk ▄█████▄ $bk ▄█████▄ $bk ▄█████▄ $bk ▄█████▄ $bk ▄█████▄ $bk ▄█████▄ +#$bk ▄███████▄ $bk ▄███████▄ $bk ▄███████▄ $bk ▄███████▄ $bk ▄███████▄ $bk ▄███████▄ +#$f1 ░░░░░░░░░ $f2 ░░░░░░░░░ $f3 ░░░░░░░░░ $f4 ░░░░░░░░░ $f5 ░░░░░░░░░ $f6 ░░░░░░░░░ +#$bk ▀███████▀ $bk ▀███████▀ $bk ▀███████▀ $bk ▀███████▀ $bk ▀███████▀ $bk ▀███████▀ +#$bk ▀█████▀ $bk ▀█████▀ $bk ▀█████▀ $bk ▀█████▀ $bk ▀█████▀ $bk ▀█████▀ +#$bk ▀▀▀ $bk ▀▀▀ $bk ▀▀▀ $bk ▀▀▀ $bk ▀▀▀ $bk ▀▀▀ +#$bld +#$bk ▄█████▄ $bk ▄█████▄ $bk ▄█████▄ $bk ▄█████▄ $bk ▄█████▄ $bk ▄█████▄ +#$bk ▄███████▄ $bk ▄███████▄ $bk ▄███████▄ $bk ▄███████▄ $bk ▄███████▄ $bk ▄███████▄ +#$f1 ░░░░░░░░░ $f2 ░░░░░░░░░ $f3 ░░░░░░░░░ $f4 ░░░░░░░░░ $f5 ░░░░░░░░░ $f6 ░░░░░░░░░ +#$bk ▀███████▀ $bk ▀███████▀ $bk ▀███████▀ $bk ▀███████▀ $bk ▀███████▀ $bk ▀███████▀ +#$bk ▀█████▀ $bk ▀█████▀ $bk ▀█████▀ $bk ▀█████▀ $bk ▀█████▀ $bk ▀█████▀ +#$bk ▀▀▀ $bk ▀▀▀ $bk ▀▀▀ $bk ▀▀▀ $bk ▀▀▀ $bk ▀▀▀ +#$rst + diff --git a/fun/.local/bin/skull b/fun/.local/bin/skull @@ -0,0 +1,59 @@ +#!/usr/bin/env bash +# ██ ██ ██ ████ +# ░██ ░██ ░██ █░░░ █ +# ██████░██ ██ ██ ██ ░██ ░██ ██████░ ░█ +# ██░░░░ ░██ ██ ░██ ░██ ░██ ░██ ██░░░░ ███ +# ░░█████ ░████ ░██ ░██ ░██ ░██░░█████ █░░ +# ░░░░░██░██░██ ░██ ░██ ░██ ░██ ░░░░░██ █ +# ██████ ░██░░██░░██████ ███ ███ ██████ ░██████ +# ░░░░░░ ░░ ░░ ░░░░░░ ░░░ ░░░ ░░░░░░ ░░░░░░ +# +# ANSI color scheme script by pyratebeard +# original `ghosts` script by pfh +# +# Initializing mod by lolilolicon from Archlinux +# + +black=$'\e[30m' +red=$'\e[31m' +green=$'\e[32m' +yellow=$'\e[33m' +blue=$'\e[34m' +magenta=$'\e[35m' +cyan=$'\e[36m' +white=$'\e[37m' +reset=$'\e[0m' + +if [ $# -eq 0 ] ; then + COLOUR="${white}" +else + case $1 in + black) COLOUR="${black}" ;; + red) COLOUR="${red}" ;; + green) COLOUR="${green}" ;; + yellow) COLOUR="${yellow}" ;; + blue) COLOUR="${blue}" ;; + magenta) COLOUR="${magenta}" ;; + cyan) COLOUR="${cyan}" ;; + *) COLOUR="${white}" ;; + esac +fi + +cat << EOF +${COLOUR} + ▄█████▄ + ▄███████▄ + ░██ ░█ ░██ + ░░███████ + ░░█░█░█ + ░ ░ ░ + + + ▄▀▀▀▀▀▀▀▄ + █ █ + █ █ █ █ + █ █ + ▀█▄▄▄▄▄█▀ + ▀ ▀ ▀ +${reset} +EOF diff --git a/fun/.local/bin/skulls b/fun/.local/bin/skulls @@ -0,0 +1,40 @@ +#!/usr/bin/env bash +# ██ ██ ██ +# ░██ ░██ ░██ +# ██████░██ ██ ██ ██ ░██ ░██ ██████ +# ██░░░░ ░██ ██ ░██ ░██ ░██ ░██ ██░░░░ +# ░░█████ ░████ ░██ ░██ ░██ ░██░░█████ +# ░░░░░██░██░██ ░██ ░██ ░██ ░██ ░░░░░██ +# ██████ ░██░░██░░██████ ███ ███ ██████ +# ░░░░░░ ░░ ░░ ░░░░░░ ░░░ ░░░ ░░░░░░ +# +# ANSI color scheme script by pyratebeard +# original `ghosts` script by pfh +# +# Initializing mod by lolilolicon from Archlinux +# + +f=3 b=4 +for j in f b; do + for i in {0..7}; do + printf -v $j$i %b "\e[${!j}${i}m" + done +done +bld=$'\e[1m' +rst=$'\e[0m' +inv=$'\e[7m' +cat << EOF + +$f1 ▄█████▄ $f2 ▄█████▄ $f3 ▄█████▄ $f4 ▄█████▄ $f5 ▄█████▄ $f6 ▄█████▄ +$f1 ▄███████▄ $f2 ▄███████▄ $f3 ▄███████▄ $f4 ▄███████▄ $f5 ▄███████▄ $f6 ▄███████▄ +$f1 ██ █ ██ $f2 ██ █ ██ $f3 ██ █ ██ $f4 ██ █ ██ $f5 ██ █ ██ $f6 ██ █ ██ +$f1 ███████ $f2 ███████ $f3 ███████ $f4 ███████ $f5 ███████ $f6 ███████ +$f1 █ █ █ $f2 █ █ █ $f3 █ █ █ $f4 █ █ █ $f5 █ █ █ $f6 █ █ █ +$bld +$f1 ▄█████▄ $f2 ▄█████▄ $f3 ▄█████▄ $f4 ▄█████▄ $f5 ▄█████▄ $f6 ▄█████▄ +$f1 ▄███████▄ $f2 ▄███████▄ $f3 ▄███████▄ $f4 ▄███████▄ $f5 ▄███████▄ $f6 ▄███████▄ +$f1 ██ █ ██ $f2 ██ █ ██ $f3 ██ █ ██ $f4 ██ █ ██ $f5 ██ █ ██ $f6 ██ █ ██ +$f1 ███████ $f2 ███████ $f3 ███████ $f4 ███████ $f5 ███████ $f6 ███████ +$f1 █ █ █ $f2 █ █ █ $f3 █ █ █ $f4 █ █ █ $f5 █ █ █ $f6 █ █ █ +$rst +EOF diff --git a/fun/.local/bin/skully b/fun/.local/bin/skully @@ -0,0 +1,44 @@ +#!/usr/bin/env bash +# ██ ██ ██ +# ░██ ░██ ░██ ██ ██ +# ██████░██ ██ ██ ██ ░██ ░██ ░░██ ██ +# ██░░░░ ░██ ██ ░██ ░██ ░██ ░██ ░░███ +# ░░█████ ░████ ░██ ░██ ░██ ░██ ░██ +# ░░░░░██░██░██ ░██ ░██ ░██ ░██ ██ +# ██████ ░██░░██░░██████ ███ ███ ██ +# ░░░░░░ ░░ ░░ ░░░░░░ ░░░ ░░░ ░░ +# +# ANSI color scheme script by pyratebeard +# original `slendy` script by xero +# +initializeANSI() +{ + esc="" + + blackf="${esc}[30m"; redf="${esc}[31m"; greenf="${esc}[32m" + yellowf="${esc}[33m" bluef="${esc}[34m"; purplef="${esc}[35m" + cyanf="${esc}[36m"; whitef="${esc}[37m" + + blackb="${esc}[40m"; redb="${esc}[41m"; greenb="${esc}[42m" + yellowb="${esc}[43m" blueb="${esc}[44m"; purpleb="${esc}[45m" + cyanb="${esc}[46m"; whiteb="${esc}[47m" + + boldon="${esc}[1m"; boldoff="${esc}[22m" + italicson="${esc}[3m"; italicsoff="${esc}[23m" + ulon="${esc}[4m"; uloff="${esc}[24m" + invon="${esc}[7m"; invoff="${esc}[27m" + + reset="${esc}[0m" +} + +initializeANSI + +cat << EOF + +$redf ▄█████▄ $greenf ▄█████▄ $yellowf ▄█████▄ $bluef ▄█████▄ $purplef ▄█████▄ $cyanf ▄█████▄ +$redf ▄███████▄ $greenf ▄███████▄ $yellowf ▄███████▄ $bluef ▄███████▄ $purplef ▄███████▄ $cyanf ▄███████▄ +$redf ██${boldon}${redb}██${reset}${redf}█${boldon}${redb}██${reset}${redf}██ $greenf ██${boldon}${greenb}██${reset}${greenf}█${boldon}${greenb}██${reset}${greenf}██ $yellowf ██${boldon}${yellowb}██${reset}${yellowf}█${boldon}${yellowb}██${reset}${yellowf}██ $bluef ██${boldon}${blueb}██${reset}${bluef}█${boldon}${blueb}██${reset}${bluef}██ $purplef ██${boldon}${purpleb}██${reset}${purplef}█${boldon}${purpleb}██${reset}${purplef}██ $cyanf ██${boldon}${cyanb}██${reset}${cyanf}█${boldon}${cyanb}██${reset}${cyanf}██ +$redf ███████ $greenf ███████ $yellowf ███████ $bluef ███████ $purplef ███████ $cyanf ███████ +$redf █${boldon}${redb}█${reset}${redf}█${boldon}${redb}█${reset}${redf}█ $greenf █${boldon}${greenb}█${reset}${greenf}█${boldon}${greenb}█${reset}${greenf}█ $yellowf █${boldon}${yellowb}█${reset}${yellowf}█${boldon}${yellowb}█${reset}${yellowf}█ $bluef █${boldon}${blueb}█${reset}${bluef}█${boldon}${blueb}█${reset}${bluef}█ $purplef █${boldon}${purpleb}█${reset}${purplef}█${boldon}${purpleb}█${reset}${purplef}█ $cyanf █${boldon}${cyanb}█${reset}${cyanf}█${boldon}${cyanb}█${reset}${cyanf}█ +$reset +EOF diff --git a/fun/.local/bin/skullz b/fun/.local/bin/skullz @@ -0,0 +1,42 @@ +#!/usr/bin/env bash +# ██ ██ ██ +# ░██ ░██ ░██ +# ██████░██ ██ ██ ██ ░██ ░██ ██████ +# ██░░░░ ░██ ██ ░██ ░██ ░██ ░██░░░░██ +# ░░█████ ░████ ░██ ░██ ░██ ░██ ██ +# ░░░░░██░██░██ ░██ ░██ ░██ ░██ ██ +# ██████ ░██░░██░░██████ ███ ███ ██████ +# ░░░░░░ ░░ ░░ ░░░░░░ ░░░ ░░░ ░░░░░░ +# +# ANSI color scheme script by pyratebeard +# original `ghosts` script by pfh +# +# Initializing mod by lolilolicon from Archlinux +# + +f=3 b=4 +for j in f b; do + for i in {0..7}; do + printf -v $j$i %b "\e[${!j}${i}m" + done +done +bld=$'\e[1m' +rst=$'\e[0m' +inv=$'\e[7m' +cat << EOF + +$f1 ▄█████▄ $f2 ▄█████▄ $f3 ▄█████▄ $f4 ▄█████▄ $f5 ▄█████▄ $f6 ▄█████▄ +$f1 ▄███████▄ $f2 ▄███████▄ $f3 ▄███████▄ $f4 ▄███████▄ $f5 ▄███████▄ $f6 ▄███████▄ +$f1░██ ░█ ░██ $f2░██ ░█ ░██ $f3░██ ░█ ░██ $f4░██ ░█ ░██ $f5░██ ░█ ░██ $f6░██ ░█ ░██ +$f1░░███████ $f2░░███████ $f3░░███████ $f4░░███████ $f5░░███████ $f6░░███████ +$f1 ░░█░█░█ $f2 ░░█░█░█ $f3 ░░█░█░█ $f4 ░░█░█░█ $f5 ░░█░█░█ $f6 ░░█░█░█ +$f1 ░ ░ ░ $f2 ░ ░ ░ $f3 ░ ░ ░ $f4 ░ ░ ░ $f5 ░ ░ ░ $f6 ░ ░ ░ +$bld +$f1 ▄█████▄ $f2 ▄█████▄ $f3 ▄█████▄ $f4 ▄█████▄ $f5 ▄█████▄ $f6 ▄█████▄ +$f1 ▄███████▄ $f2 ▄███████▄ $f3 ▄███████▄ $f4 ▄███████▄ $f5 ▄███████▄ $f6 ▄███████▄ +$f1░██ ░█ ░██ $f2░██ ░█ ░██ $f3░██ ░█ ░██ $f4░██ ░█ ░██ $f5░██ ░█ ░██ $f6░██ ░█ ░██ +$f1░░███████ $f2░░███████ $f3░░███████ $f4░░███████ $f5░░███████ $f6░░███████ +$f1 ░░█░█░█ $f2 ░░█░█░█ $f3 ░░█░█░█ $f4 ░░█░█░█ $f5 ░░█░█░█ $f6 ░░█░█░█ +$f1 ░ ░ ░ $f2 ░ ░ ░ $f3 ░ ░ ░ $f4 ░ ░ ░ $f5 ░ ░ ░ $f6 ░ ░ ░ +$rst +EOF