fresh init

This commit is contained in:
sankalp committed 2023-05-25 01:18:06 +05:45
1 parent 4246c542ac
commit 13b961f148
26 files changed
+2306

No files matched your search

+180
View File
@@ -0,0 +1,180 @@
#!/bin/bash
c=3 b=4
for j in c b; do
for i in {0..7}; do
printf -v $j$i "%b" "\e[${!j}${i}m"
done
done
user=$(whoami)
host=$(uname -a | awk '{print $2}')
memory=$(free -h)
os=$(source /etc/os-release && echo $PRETTY_NAME)
kernel=$(uname -sr)
wm="$(xprop -id $(xprop -root -notype | awk '$1=="_NET_SUPPORTING_WM_CHECK:"{print $5}') -notype -f _NET_WM_NAME 8t | grep "WM_NAME" | cut -f2 -d \")"
mem=$(free -m | sed -n 's/^Mem:\s\+[0-9]\+\s\+\([0-9]\+\)\s.\+/\1/p')
pkgs="$(pacman -Q | wc -l)"
shell=$(echo "$SHELL" | awk -F/ '{for ( i=1; i <= NF; i++) sub(".", substr(toupper($i),1,1) , $i); print $NF}')
colors=$(for i in {0..7}; do echo -en "\e[${1}$((30 + $i))m  "; done)
license="GNU-GPL3"
get_mem(){
while IFS=":" read -r a b; do
case $a in
"MemTotal") ((mem_used+=${b/kB})); mem_total="${b/kB}" ;;
"Shmem") ((mem_used+=${b/kB})) ;;
"MemFree" | "Buffers" | "Cached" | "SReclaimable")
mem_used="$((mem_used-=${b/kB}))"
;;
esac
done < /proc/meminfo
mem_used="$((mem_used / 1024))"
mem_total="$((mem_total / 1024))"
}
get_mem
get_uptime() {
# Uptime works by retrieving the data in total seconds and then
# converting that data into days, hours and minutes using simple
# math.
IFS=. read -r s _ </proc/uptime
# Convert the uptime from seconds into days, hours and minutes.
d=$((s / 60 / 60 / 24))
h=$((s / 60 / 60 % 24))
m=$((s / 60 % 60))
# Only append days, hours and minutes if they're non-zero.
case "$d" in [!0]*) uptime="${uptime}${d}d " ;; esac
case "$h" in [!0]*) uptime="${uptime}${h}h " ;; esac
case "$m" in [!0]*) uptime="${uptime}${m}m " ;; esac
echo ${uptime:-0m}
}
get_gpu(){
# Read GPUs into array.
gpu_cmd="$(lspci -mm | awk -F '\"|\" \"|\\(' \
'/"Display|"3D|"VGA/ {a[$0] = $1 " " $3 " " $4}
END {for(i in a) {if(!seen[a[i]]++) print a[i]}}')"
IFS=$'\n' read -d "" -ra gpus <<< "$gpu_cmd"
# Remove duplicate Intel Graphics outputs.
# This fixes cases where the outputs are both
# Intel but not entirely identical.
#
# Checking the first two array elements should
# be safe since there won't be 2 intel outputs if
# there's a dedicated GPU in play.
[[ "${gpus[0]}" == *Intel* && "${gpus[1]}" == *Intel* ]] && unset -v "gpus[0]"
for gpu in "${gpus[@]}"; do
# GPU shorthand tests.
[[ "$gpu_type" == "dedicated" && "$gpu" == *Intel* ]] || \
[[ "$gpu_type" == "integrated" && ! "$gpu" == *Intel* ]] && \
{ unset -v gpu; continue; }
case $gpu in
*"Advanced"*)
brand="${gpu/*AMD*ATI*/AMD ATI}"
brand="${brand:-${gpu/*AMD*/AMD}}"
brand="${brand:-${gpu/*ATI*/ATi}}"
gpu="${gpu/\[AMD\/ATI\] }"
gpu="${gpu/\[AMD\] }"
gpu="${gpu/OEM }"
gpu="${gpu/Advanced Micro Devices, Inc.}"
gpu="${gpu/*\[}"
gpu="${gpu/\]*}"
gpu="$brand $gpu"
;;
*"NVIDIA"*)
gpu="${gpu/*\[}"
gpu="${gpu/\]*}"
gpu="$gpu"
;;
*"MCST"*)
gpu="${gpu/*MCST*MGA2*/MCST MGA2}"
;;
*"VirtualBox"*)
gpu="VirtualBox Graphics Adapter"
;;
*) continue ;;
esac
if [[ "$gpu_brand" == "off" ]]; then
gpu="${gpu/AMD }"
gpu="${gpu/NVIDIA }"
gpu="${gpu/Intel }"
fi
echo "${subtitle:+${subtitle}${gpu_name}}" "$gpu"
done
}
get_cpu() {
# Get CPU name.
cpu_file="/proc/cpuinfo"
case $kernel_machine in
"frv" | "hppa" | "m68k" | "openrisc" | "or"* | "powerpc" | "ppc"* | "sparc"*)
cpu="$(awk -F':' '/^cpu\t|^CPU/ {printf $2; exit}' "$cpu_file")"
;;
"s390"*)
cpu="$(awk -F'=' '/machine/ {print $4; exit}' "$cpu_file")"
;;
"ia64" | "m32r")
cpu="$(awk -F':' '/model/ {print $2; exit}' "$cpu_file")"
[[ -z "$cpu" ]] && cpu="$(awk -F':' '/family/ {printf $2; exit}' "$cpu_file")"
;;
*)
cpu="$(awk -F '\\s*: | @' \
'/model name|Hardware|Processor|^cpu model|chip type|^cpu type/ {
cpu=$2; if ($1 == "Hardware") exit } END { print cpu }' "$cpu_file")"
;;
esac
echo $cpu
}
init() {
init=$(readlink /sbin/init)
init=${init##*/}
init=${init%%-*}
export init
}
init
cat <<EOF
${c5} ┏━━━━━━━━━━━━━━━━━┳━━━━━━━━━━┓
${c5} ┃  Systen Fetch ┃ ${c2} ${c0} ${c3} ${c0}${c1}  ${c5} ┃  ${c2}$user${c5}@${c2}$host
${c5} ┣━━━━━━━━━━━━━━━━━┻━━━━━━━━━━┫
${c5} ┃ ┃ ${c5} ${c4}OS ${c5}- ${c4} $os
${c5} ┃ ${c1} ) ) ${c5} ┃ ${c5} ${c4}Kernel ${c5}- ${c4} $kernel
${c5} ┃ ${c1} ( ( ${c5} ┃ ${c5}缾 ${c4}WM ${c5}- ${c4} $wm
${c5} ┃ ${c2} ........ ${c5} ┃ ${c5} ${c4}Shell ${c5}- ${c4} $shell
${c5} ┃ ${c2} | |] ${c5} ┃ ${c5}碌 ${c4}Init ${c5}- ${c4} $init
${c5} ┃ ${c2} \ / ${c5} ┃ ${c5} ${c4}pkgs ${c5}- ${c4} $pkgs
${c5} ┃ ${c2} '____' ${c5} ┃ ${c5} ${c4}uptime ${c5}- ${c4} $(get_uptime)
${c5} ┃ ┃ ${c5} ${c4}CPU ${c5}- ${c4} $(get_cpu)
${c5} ┃  ${c4} Developed by :${c2} 00xjack ${c5} ┃ ${c5}󰢮 ${c4}GPU ${c5}- ${c4}$(get_gpu)
${c5} ┃  ${c2} GitHub : S4NKALP ${c5} ┃ ${c5} ${c4}memory ${c5}- ${c4} $mem_used $(echo / ) $mem_total
${c5} ┃ ${c1} ${c5} ┃
${c5} ┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛ ${c0}  ${c1}  ${c2}  ${c3}  ${c4} 󰮯 ${c5}  ${c6}  ${c7} 
EOF
# ${c5} ${c4} $(echo LICENSE) ${c5}- ${c4} $license
+661
View File
@@ -0,0 +1,661 @@
#!/usr/bin/env bash
# I'm a bonsai-making machine!
#################################################
##
# author: John Allbritten
# license: GPLv3
# repo: https://gitlab.com/jallbrit/bonsai.sh
#
# this script is constantly being updated, so
# check repo for most up-to-date version.
##
#################################################
# ------ vars ------
# CLI options
live=0
infinite=0
nfetch=0
termSize=1
termColors=0
leafStrs='&'
baseType=1
message=""
multiplier=5
lifeStart=28
timeStep=0.03
timeWait=4
flag_m=0
flag_h=0
# non-CLI options
messageWidth=20
verbose=0
seed="$RANDOM"
# ensure locale is correct
LC_ALL="en_US.UTF-8"
# ensure Bash version >= 4.0
if ((BASH_VERSINFO[0] < 4)); then
printf '%s\n' "Error: bonsai.sh requires Bash v4.0 or higher. You have version $BASH_VERSION."
fi
# ensure MacOS compatibility with GNU getopt
if [[ "$OSTYPE" == 'darwin'* ]]; then
GGETOPT=/usr/local/Cellar/gnu-getopt/*/bin/getopt # should find gnu-getopt
if [ ! -x $GGETOPT ]; then # file is not executable
printf '%s\n' 'Error: Running on MacOS requires an executable gnu getopt.'
exit 2
fi
shopt -s expand_aliases
alias getopt='$GGETOPT' # replace getopt with gnu getopt
fi
# ------ parse options ------
OPTS="hlt:w:ig:c:Tm:b:M:L:s:vn" # the colon means it requires a value
LONGOPTS="help,live,time:,wait:,infinite,geometry:,leaf:,termcolors,message:,base:,multiplier:,life:,seed:,verbose,neofetch"
parsed=$(getopt --options=$OPTS --longoptions=$LONGOPTS -- "$@")
eval set -- "${parsed[@]}"
while true; do
case "$1" in
-h|--help)
flag_h=1
shift
;;
-l|--live)
live=1
shift
;;
-t|--time)
timeStep="$2"
shift 2
;;
-w|--wait)
timeWait="$2"
shift 2
;;
-g|--geometry)
termSize=0
geometry="$2"
shift 2
;;
-c|--leaf)
leafStrs="$2"
shift 2
;;
-T|--termcolors)
termColors=1
shift
;;
-m|--message)
flag_m=1
message="$2"
shift 2
;;
-b|--base)
baseType="$2"
shift 2
;;
-i|--infinite)
infinite=1
shift 1
;;
-M|--multiplier)
multiplier="$2"
shift 2
;;
-L|--life)
lifeStart="$2"
shift 2
;;
-s|--seed)
RANDOM="$2"
shift 2
;;
-v|--verbose)
verbose=1
shift 1
;;
-n|--neofetch)
nfetch=1
shift 1
;;
--) # end of arguments
shift
break
;;
*)
printf '%s\n' "error while parsing CLI options"
flag_h=1
;;
esac
done
# ------ check input ------
# ensure integer values
if ! [ "$lifeStart" -eq "$lifeStart" 2> /dev/null ]; then
printf '%s\n' "--life ($lifeStart) invalid: must be an integer"; exit 1
elif ! [ "$multiplier" -eq "$multiplier" 2> /dev/null ]; then
printf '%s\n' "--multiplier ($multiplier) invalid: must be an integer"; exit 1
elif ! [ "$baseType" -eq "$baseType" 2> /dev/null ]; then
printf '%s\n' "--base ($baseType) invalid: must be an integer"; exit 1
# ensure ranges
elif [ "$baseType" -lt 0 ]; then
printf '%s\n' "--base ($baseType) invalid: out of range"; exit 1
elif [ "$lifeStart" -lt 1 ] || [ "$lifeStart" -gt 200 ]; then
printf '%s\n' "--life ($lifeStart) invalid: out of range"; exit 1
elif [ "$multiplier" -lt 0 ] || [ "$multiplier" -gt 20 ]; then
printf '%s\n' "--multiplier ($multiplier) invalid: out of range"; exit 1
elif [ "$seed" -lt 0 ] || [ "$seed" -gt 32767 ]; then
printf '%s\n' "--seed ($seed) invalid: out of range"; exit 1
# ensure floats are less than 0
elif [ "$(printf '%s\n' "$timeStep < 0" | bc -l)" -eq 1 ]; then
printf '%s\n' "--timestep ($timeStep) invalid: out of range"; exit 1
elif [ "$(printf '%s\n' "$timeWait < 0" | bc -l)" -eq 1 ]; then
printf '%s\n' "--wait ($timeWait) invalid: out of range"; exit 1
fi
HELP="\
Usage: bonsai [OPTIONS]
bonsai.sh is a beautifully random bonsai tree generator.
optional args:
-l, --live live mode
-t, --time TIME in live mode, minimum time in secs between
steps of growth [default: 0.03]
-i, --infinite infinite mode
-w, --wait TIME in infinite mode, time in secs between
tree generation [default: 4]
-n, --neofetch neofetch mode
-m, --message STR attach message next to the tree
-T, --termcolors use terminal colors
-g, --geometry X,Y set custom geometry
-b, --base INT ascii-art plant base to use, 0 is none
-c, --leaf STR1,STR2,STR3... list of strings randomly chosen for leaves
-M, --multiplier INT branch multiplier; higher -> more
branching (0-20) [default: 5]
-L, --life INT life; higher -> more growth (0-200) [default: 28]
-s, --seed INT seed random number generator (0-32767)
-v, --verbose print information each step of generation
-h, --help show help"
if ((flag_h)); then
printf '%s\n' "$HELP"
exit 0
fi
shopt -s checkwinsize # allows variables $COLUMNS/$LINES to be used
trap 'quit' SIGINT # respond to CTRL+C
trap 'setGeometry' WINCH # respond to window resize
IFS=$'\n' # delimit by newline
((! nfetch)) && tabs 4
# define colors
if ((termColors)); then
LightBrown='\e[1;33m'
DarkBrown='\e[0;33m'
BrownGreen='\e[1;32m'
Green='\e[0;32m'
Gray='\e[1;30m'
elif ((nfetch)); then
LightBrown='${c1}'
DarkBrown='${c2}'
BrownGreen='${c3}'
Green='${c4}'
Gray='${c5}'
else
LightBrown='\e[38;5;172m'
DarkBrown='\e[38;5;130m'
BrownGreen='\e[38;5;142m'
Green='\e[38;5;106m'
Gray='\e[38;5;243m'
fi
R='\e[0m'
# create ascii base in lines
case "$baseType" in
1)
width=15
art="\
${Gray}:${Green}___________${DarkBrown}./~~\\.${Green}___________${Gray}:
\\ /
\\________________________/
(_) (_)"
;;
2)
width=7
art="\
${Gray}(${Green}---${DarkBrown}./~~\\.${Green}---${Gray})
( )
(________)"
;;
3)
width=15
art="\
${Gray}╓${Green}───────────${DarkBrown}╭╱⎨⏆╲╮${Green}───────────${Gray}╖
║ ║
╟────────────────────────────╢
╟────────────────────────────╢
╚════════════════════════════╝"
;;
*) art="" ;;
esac
# get base height
baseHeight=0
for line in $art; do
baseHeight=$(( baseHeight + 1 ))
done
# create leafArray
declare -A leafArray
leafArrayLen=0
# parse each string in comma-separated $leafStrs
for str in ${leafStrs//,/$'\n'}; do
leafArray[$leafArrayLen,0]=${#str} # first item in sub-array is length
# for character in string, add to the sub-array
for (( i=0; i < ${#str}; i++ )); do
leafArray[$leafArrayLen,$((i+1))]="${str:$i:1}"
done
leafArrayLen=$((leafArrayLen+1))
done
setGeometry() {
if ((nfetch)) && ((termSize)); then
geometry="$(tput cols),$(tput lines)" # geometry must use tput in this mode
elif ((termSize)); then
geometry="$COLUMNS,$LINES" # these vars automatically update
fi
cols="$(printf '%s' "$geometry" | cut -d ',' -f1)" # width; X
rows="$(printf '%s' "$geometry" | cut -d ',' -f2)" # height; Y
rows=$((rows - baseHeight)) # so we don't grow a tree on top of the base
}
init() {
IFS=$'\n' # delimit strings by newline
# message processing
if ((flag_m)); then
declare -Ag gridMessage
cols=$((cols - messageWidth - 8 )) # make room for the message to go on the right side
message="$(printf '%s\n' "$message" | fold -sw $messageWidth)" # wordwrap message, delimiting by spaces
# get number of lines in the message
messageLineCount=0
for line in $message; do
messageLineCount=$((messageLineCount + 1))
done
messageOffset=$((rows - messageLineCount - 7))
# put lines of message into a grid
index=$messageOffset
for line in $message; do
gridMessage[$index]="$line"
index=$((index + 1))
done
fi
# add spaces before base so that it's in the middle of the terminal
base=""
iter=1
for line in $art; do
filler=""
for (( i=0; i <= (cols / 2 - width); i++)); do
filler+=" "
done
base+="${filler}${line}"
[ $iter -ne $baseHeight ] && base+='\n'
iter=$((iter+1))
done
unset IFS # reset delimiter
# declare vars
branches=0
shoots=0
branchesMax=$((multiplier * 110))
shootsMax=$multiplier
# fill grid full of spaces
declare -Ag grid
for (( row=0; row <= rows; row++ )); do
listChanged[$row]=0
for (( col=0; col < cols; col++ )); do
grid[$row,$col]=' '
done
done
if ((! nfetch)); then
stty -echo # don't echo stdin
printf '%b' '\e[?25l\e[?7l\e[2J' # hide cursor, disable line wrapping, clear screen and move to 0,0
fi
# setup temp file for caching times of each growth
mkdir -p /tmp/bonsai.sh
tmpFile="$(mktemp -p /tmp/bonsai.sh bonsai.sh.XXXXXXXX)"
}
grow() {
local x=$((cols / 2)) # start halfway across the screen
local y="$rows" # start just above the base
branch "$x" "$y" trunk "$lifeStart"
}
branch() {
# declarations
local x=$1
local y=$2
local type=$3
local life=$4
local dx=0
local dy=0
local chars=()
branches=$((branches + 1))
# as long as we're alive...
while [ "$life" -gt 0 ]; do
life=$((life - 1)) # ensure life ends
# set dy based on type
case $type in
shoot*) # trend horizontal/downward growth
case "$((RANDOM % 10))" in
[0-1]) dy=-1 ;;
[2-7]) dy=0 ;;
[8-9]) dy=1 ;;
esac
;;
dying) # discourage vertical growth
case "$((RANDOM % 10))" in
[0-1]) dy=-1 ;;
[2-8]) dy=0 ;;
[9-10]) dy=1 ;;
esac
;;
*) # grow up/not at all
dy=0
[ "$life" -ne "$lifeStart" ] && [ $((RANDOM % 10)) -gt 2 ] && dy=-1
;;
esac
# if we're about to hit the ground, cut it off
[ "$dy" -gt 0 ] && [ "$y" -gt $(( rows - 1 )) ] && dy=0
[ "$type" = "trunk" ] && [ "$life" -lt 4 ] && dy=0
# set dx based on type
case $type in
shootLeft) # tend left: dx=[-2,1]
case $(( RANDOM % 10 )) in
[0-1]) dx=-2 ;;
[2-5]) dx=-1 ;;
[6-8]) dx=0 ;;
[9]) dx=1 ;;
esac ;;
shootRight) # tend right: dx=[-1,2]
case $(( RANDOM % 10 )) in
[0-1]) dx=2 ;;
[2-5]) dx=1 ;;
[6-8]) dx=0 ;;
[9]) dx=-1 ;;
esac ;;
dying) # tend left/right: dx=[-3,3]
dx=$(( (RANDOM % 7) - 3)) ;;
*) # tend equal: dx=[-1,1]
dx=$(( (RANDOM % 3) - 1)) ;;
esac
# re-branch upon conditions
if [ $branches -lt $branchesMax ]; then
# branch is dead
if [ $life -lt 3 ]; then
branch "$x" "$y" dead "$life"
# branch is dying and needs to branch into leaves
elif [ "$type" = trunk ] && [ "$life" -lt $((multiplier + 2)) ]; then
branch "$x" "$y" dying "$life"
elif [[ $type = "shoot"* ]] && [ "$life" -lt $((multiplier + 2)) ]; then
branch "$x" "$y" dying "$life"
# re-branch if: not close to the base AND (pass a chance test OR be a trunk, not have too many shoots already, and not be about to die)
elif [[ $type = trunk && $life -lt $((lifeStart - 8)) \
&& ( $(( RANDOM % (16 - multiplier) )) -eq 0 \
|| ($type = trunk && $(( life % 5 )) -eq 0 && $life -gt 5) ) ]]; then
# if a trunk is splitting and not about to die, chance to create another trunk
if [ $((RANDOM % 3)) -eq 0 ] && [ $life -gt 7 ]; then
branch "$x" "$y" trunk "$life"
elif [ "$shoots" -lt "$shootsMax" ]; then
# give the shoot some life
tmpLife=$(( life + multiplier - 2 ))
[ $tmpLife -lt 0 ] && tmpLife=0
# first shoot is randomly directed
if [ $shoots -eq 0 ]; then
tmpType="shootLeft"
[ $((RANDOM % 2)) -eq 0 ] && tmpType="shootRight"
# secondary shoots alternate from the first
else
case "$tmpType" in
shootLeft) # last shoot was left, shoot right
tmpType="shootRight" ;;
shootRight) # last shoot was right, shoot left
tmpType="shootLeft" ;;
esac
fi
branch "$x" "$y" "$tmpType" "$tmpLife"
shoots=$((shoots + 1))
fi
fi
else # we're past max branches but want to branch
chars=('<->')
fi
# implement dx,dy
x=$((x + dx))
y=$((y + dy))
# choose color
case $type in
trunk|shoot*)
color=$DarkBrown
[ $(( RANDOM % 4 )) -eq 0 ] && color=$LightBrown
;;
dying) color=$BrownGreen ;;
dead) color=$Green ;;
esac
# choose branch character
case $type in
trunk)
if [ $dx -lt 0 ]; then
chars=('\\')
elif [ $dx -eq 0 ]; then
chars=('/' '|')
elif [ $dx -gt 0 ]; then
chars=('/')
fi
[ $dy -eq 0 ] && chars=('/' '~') # not growing
#[ $dy -lt 0 ] && chars=('/' '~') # growing
;;
# shoots tend to look horizontal
shootLeft)
case $dx in
[-3,-1]) chars=('\\' '|') ;;
[0]) chars=('/' '|') ;;
[1,3]) chars=('/') ;;
esac
#[ $dy -lt 0 ] && chars=('/' '~') # growing up
[ $dy -gt 0 ] && chars=('/') # growing down
[ $dy -eq 0 ] && chars=('\\' '_') # not growing
;;
shootRight)
case $dx in
[-3,-1]) chars=('\\' '|') ;;
[0]) chars=('/' '|') ;;
[1,3]) chars=('/') ;;
esac
#[ $dy -lt 0 ] && chars=('') # growing up
[ $dy -gt 0 ] && chars=('\\') # growing down
[ $dy -eq 0 ] && chars=('_' '/') # not growing
;;
esac
# randomly choose leaf character
if [ $life -lt 4 ]; then
chars=()
randIndex=$((RANDOM % leafArrayLen))
# add each char in our randomly chosen list to our chars
for (( i=0; i < ${leafArray[$randIndex,0]}; i++)); do
chars+=("${leafArray[$randIndex,$((i+1))]}")
done
fi
# [ $life -eq 0 ] && chars=('&' '&') # eh, maybe
((verbose)) && printf '%b\n' "$life:\\t$x, $y: $char"
# add this/these character(s) to our grid
index=0
for char in "${chars[@]}"; do
newX=$((x+index))
grid[$y,$newX]="${color}${char}"
# ensure we keep track of last column
[ ${y:-0} -gt 0 ] && [ -n "${listChanged[$y]}" ] && [ ${newX:-0} -gt ${listChanged[$y]} ] && listChanged[$y]=$newX
index=$((index+1))
done
# print what we have so far
if ((live)); then
( time -p display ) 2>"$tmpFile"
elapsed="$(head "$tmpFile" -n 1 | awk '{print $2}' )"
# if this step took less than $stepTime, sleep until $stepTime is met
timeLeft="$(printf '%s\n' "$timeStep - $elapsed" | bc -l)"
[ "$(printf '%s\n' "($timeLeft) > 0" | bc -l)" -eq 1 ] && sleep "$timeLeft"
fi
done
}
display() {
# parse grid for output
output=""
for (( row=0; row < rows; row++)); do
lineArray=()
# only parse to the last known column with a char in it
for (( col=0; col <= listChanged[row]; col++ )); do
((live)) && printf '%b' '\e[0;0H' # move cursor to 00
# grab the character from our grid
lineArray["$col"]="${grid[$row,$col]}"
done
line="${lineArray[*]}" # combine array elements into a string
if ((flag_m)) || ((nfetch)); then
line="${line%${line##*[^[:space:]]}}" # remove trailing whitespace and reset color
fi
# add our message unless line is blank
((flag_m)) && [ ! "$line" = "" ] && line+=' \t'"${R}${gridMessage[$row]}"
IFS=''
output+="$line\\n"
done
output+="$base" # add the ascii-art base we generated earlier
printf '%b' "$output"
}
quit() {
if ((! nfetch)); then
stty echo # echo stdin
printf '%b\n' '\e[?25h\e[?7h'"${R}" # show cursor, enable line wrapping, reset colors
tabs 8
else
printf '\n' # reset formatting, put cursor on next line
fi
exit 0
}
bonsai() {
setGeometry
init
grow
display
}
main() {
bonsai
while ((infinite)); do
sleep "$timeWait"
bonsai
done
}
main
quit
+38
View File
@@ -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
+35
View File
@@ -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 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 2); 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
+13
View File
@@ -0,0 +1,13 @@
#!/bin/bash
xdef="$HOME/.Xdefaults"
colors=( $( sed -re '/^!/d; /^$/d; /^#/d; s/(\*color)([0-9]):/\10\2:/g;' $xdef | grep 'color[01][0-9]:' | sort | sed 's/^.*: *//g' ) )
echo -e "\e[1;37m
Black Red Green Yellow Blue Magenta Cyan White
──────────────────────────────────────────────────────────────────────\e[0m"
for i in {0..7}; do echo -en "\e[$((30+$i))m ${colors[i]} \e[0m"; done
echo
for i in {8..15}; do echo -en "\e[1;$((22+$i))m ${colors[i]} \e[0m"; done
echo -e "\n"
+27
View File
@@ -0,0 +1,27 @@
#!/bin/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='niX' # 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
+46
View File
@@ -0,0 +1,46 @@
#!/bin/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} █-----${bld}█ ${rst}${f2} █-----${bld}█${rst} ${f3} █-----${bld}█${rst} ${f4} █-----${bld}█${rst} ${f5} █-----${bld}█${rst} ${f6} █-----${bld}█${rst}
${f1} █---${bld}█${rst} ${f2} █---${bld}█${rst} ${f3} █---${bld}█${rst} ${f4} █---${bld}█${rst} ${f5} █---${bld}█${rst} ${f6} █---${bld}█${rst}
${f1} █-${bld}█${rst} ${f2} █-${bld}█${rst} ${f3} █-${bld}█${rst} ${f4} █-${bld}█${rst} ${f5} █-${bld}█${rst} ${f6} █-${bld}█${rst}
${f1} █${rst} ${f2} █${rst} ${f3} █${rst} ${f4} █${rst} ${f5} █${rst} ${f6} █${rst}
${f1}${bld} █-${rst}${f1}█${rst} ${f2}${bld} █_${rst}${f2}█${rst} ${f3}${bld} █-${rst}${f3}█${rst} ${f4}${bld} █-${rst}${f4}█${rst} ${f5}${bld} █-${rst}${f5}█${rst} ${f6}${bld} █-${rst}${f6}█${rst}
${f1}${bld} █---${rst}${f1}█${rst} ${f2}${bld} █---${rst}${f2}█${rst} ${f3}${bld} █---${rst}${f3}█${rst} ${f4}${bld} █---${rst}${f4}█${rst} ${f5}${bld} █---${rst}${f5}█${rst} ${f6}${bld} █---${rst}${f6}█${rst}
${f1}${bld} █-----${rst}${f1}█${rst} ${f2}${bld} █-----${rst}${f2}█${rst} ${f3}${bld} █-----${rst}${f3}█${rst} ${f4}${bld} █-----${rst}${f4}█${rst} ${f5}${bld} █-----${rst}${f5}█${rst} ${f6}${bld} █-----${rst}${f6}█${rst}
${f1}${bld} █---${rst}${f1}█${rst} ${f2}${bld} █---${rst}${f2}█${rst} ${f3}${bld} █---${rst}${f3}█${rst} ${f4}${bld} █---${rst}${f4}█${rst} ${f5}${bld} █---${rst}${f5}█${rst} ${f6}${bld} █---${rst}${f6}█${rst}
${f1}${bld} █-${rst}${f1}█${rst} ${f2}${bld} █-${rst}${f2}█${rst} ${f3}${bld} █-${rst}${f3}█${rst} ${f4}${bld} █-${rst}${f4}█${rst} ${f5}${bld} █-${rst}${f5}█${rst} ${f6}${bld} █-${rst}${f6}█${rst}
${f1}${bld} █${rst} ${f2}${bld} █${rst} ${f3}${bld}█${rst} ${f4}${bld} █${rst} ${f5}${bld} █${rst} ${f6}${bld} █${rst}
${f1} █-${bld}█${rst} ${f2} █-${bld}█${rst} ${f3} █-${bld}█${rst} ${f4} █-${bld}█${rst} ${f5} █-${bld}█${rst} ${f6} █-${bld}█${rst}
${f1} █---${bld}█${rst} ${f2} █---${bld}█${rst} ${f3} █---${bld}█${rst} ${f4} █---${bld}█${rst} ${f5} █---${bld}█${rst} ${f6} █---${bld}█${rst}
${f1} █-----${bld}█ ${rst}${f2} █-----${bld}█${rst} ${f3} █-----${bld}█${rst} ${f4} █-----${bld}█${rst} ${f5} █-----${bld}█${rst} ${f6} █-----${bld}█${rst}
${f1} █---${bld}█${rst} ${f2} █---${bld}█${rst} ${f3} █---${bld}█${rst} ${f4} █---${bld}█${rst} ${f5} █---${bld}█${rst} ${f6} █---${bld}█${rst}
${f1} █-${bld}█${rst} ${f2} █-${bld}█${rst} ${f3} █-${bld}█${rst} ${f4} █-${bld}█${rst} ${f5} █-${bld}█${rst} ${f6} █-${bld}█${rst}
${f1} █${rst} ${f2}█${rst} ${f3} █${rst} ${f4} █${rst} ${f5} █${rst} ${f6} █${rst}
${f1}${bld} █-${rst}${f1}█${rst} ${f2}${bld} █_${rst}${f2}█${rst} ${f3}${bld} █-${rst}${f3}█${rst} ${f4}${bld} █-${rst}${f4}█${rst} ${f5}${bld} █-${rst}${f5}█${rst} ${f6}${bld} █-${rst}${f6}█${rst}
${f1}${bld} █---${rst}${f1}█${rst} ${f2}${bld} █---${rst}${f2}█${rst} ${f3}${bld} █---${rst}${f3}█${rst} ${f4}${bld} █---${rst}${f4}█${rst} ${f5}${bld} █---${rst}${f5}█${rst} ${f6}${bld} █---${rst}${f6}█${rst}
${f1}${bld} █-----${rst}${f1}█${rst} ${f2}${bld} █-----${rst}${f2}█${rst} ${f3}${bld} █-----${rst}${f3}█${rst} ${f4}${bld} █-----${rst}${f4}█${rst} ${f5}${bld} █-----${rst}${f5}█${rst} ${f6}${bld} █-----${rst}${f6}█${rst}
${f1}${bld} █---${rst}${f1}█${rst} ${f2}${bld} █---${rst}${f2}█${rst} ${f3}${bld} █---${rst}${f3}█${rst} ${f4}${bld} █---${rst}${f4}█${rst} ${f5}${bld} █---${rst}${f5}█${rst} ${f6}${bld} █---${rst}${f6}█${rst}
${f1}${bld} █-${rst}${f1}█${rst} ${f2}${bld} █-${rst}${f2}█${rst} ${f3}${bld} █-${rst}${f3}█${rst} ${f4}${bld} █-${rst}${f4}█${rst} ${f5}${bld} █-${rst}${f5}█${rst} ${f6}${bld} █-${rst}${f6}█${rst}
${f1}${bld} █${rst} ${f2}${bld} █${rst} ${f3}${bld} █${rst} ${f4}${bld} █${rst} ${f5}${bld} █${rst} ${f6}${bld} █${rst}
${f1} █-${bld}█${rst} ${f2} █-${bld}█${rst} ${f3} █-${bld}█${rst} ${f4} █-${bld}█${rst} ${f5} █-${bld}█${rst} ${f6} █-${bld}█${rst}
${f1} █---${bld}█${rst} ${f2} █---${bld}█${rst} ${f3} █---${bld}█${rst} ${f4} █---${bld}█${rst} ${f5} █---${bld}█${rst} ${f6} █---${bld}█${rst}
${f1} █-----${bld}█ ${rst}${f2} █-----${bld}█${rst} ${f3} █-----${bld}█${rst} ${f4} █-----${bld}█${rst} ${f5} █-----${bld}█${rst} ${f6} █-----${bld}█${rst}
EOF
+31
View File
@@ -0,0 +1,31 @@
#!/bin/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
+114
View File
@@ -0,0 +1,114 @@
#!/bin/sh
#
# metroid: a metroid ascii banner generator
# MMXVI xero (http://xero.nu)
usage() {
printf "usage: `basename $0` \n\
[-m --mini mini] \n\
[-s --super super] \n\
[-t --text text] \n\
[-n --normal normal] \n\
[-h --help help]\n"
}
text() {
printf "\n .___.\n / @ \ \n \ @ @ /\n {'^'}\n\n"
}
mini() {
cat << METROID
▄▄ ▀▀▀▀▀▀▀▀▀▀▀ ▄▄
▄ ▀▀▀▀          ▀▀▀ ▄
▄ ▀▀  ▀▀             ▀▀ ▄
 ▀▀  ▀                  ▀▀ 
▄ ▀▀ ▀ ▀                ▀▀▀▀▀ ▄
▄     ▀                         ▄
              ▀▀▀▀▀    ▀▀▀       
                            ▀▀▀  ▄
  ▀        ▀▀▀▀▀▀▀▀▀▀▀▀▀  ▀  ▀     
   ▀▀▀         ▀   ▀      ▀▀       
  ▀▀▀▀    ▀▀   ▀   ▀   ▀▀    ▀▀▀▀  
    ▀▀▀▀ ▀▀▀▀▀▀     ▀▀▀▀▀▀ ▀▀▀▀    
▀▀▀▀  ▀▀▀▀  ▀▀▀     ▀▀▀  ▀▀▀▀  ▀▀▀▀
▀▀             ▀▀▀             ▀▀
 ▀▀      ▀  ▀   ▀  ▀      ▀▀ 
▀ ▀        ▀▀▀▀▀        ▀ ▀
▀▀▀ ▀ ▀   ▀ ▀ ▀▀▀
METROID
}
super() {
cat << METROID
▄▄▄▀▀▀▀▀▀▀▀▄▄▄
▄▄▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▄▄
▄▀▀▀▀▀▀▀▀▀      ▀▀▀▀▀▀▀▀▀▄
▀▀▀▀ ▀▀▀▀    ▀▀    ▀▀▀▀ ▀▀▀▀
▀▀▀▀▀  ▀▀▀▀▀ ▀  ▀ ▀▀▀▀▀  ▀▀▀▀▀
 ▀ ▀▀▀▀▀ ▀▀▀ ▀▀▀▀▀▀ ▀▀▀ ▀▀▀▀▀ ▀ 
▀▀▀▀▀▀  ▀▀▀▀ ▀▀▀▀▀▀ ▀▀▀▀  ▀▀▀▀▀▀
▀  ▀▀▀▀▀▀▀▀▀▀ ▀▀▀▀ ▀▀▀▀▀▀▀▀▀▀  ▀
▀▀▀ ▀▀▀▀▀▀▀▀▀▀▀  ▀▀▀▀▀▀▀▀▀▀▀ ▀▀▀
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
 ▀▀▀▀ ▀▀▀▀ ▀▀▀▀ ▀▀▀▀ ▀▀▀▀ 
▀▀▀▀▀▀  ▀▀▀ ▀▀▀  ▀▀▀▀▀▀
▀▀▀  ▀▀   ▀▀  ▀▀▀
▀▀▀▀ ▀▀▀▀
▀ ▀ ▀ ▀
METROID
}
normal() {
cat << METROID
 ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀ 
 ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀ 
 ▀▀▀▀▀▀                ▀▀▀▀▀▀ 
 ▀▀▀▀    ▀▀                  ▀▀▀▀ 
 ▀▀▀▀  ▀▀  ▀▀▀▀▀▀▀▀▀▀            ▀▀▀▀ 
     ▀▀      ▀▀▀▀▀▀▀▀▀▀          ▀▀▀▀▀▀ 
 ▀▀▀▀▀▀  ▀▀                      ▀▀▀▀     
       ▀▀          ▀▀▀▀▀▀              ▀▀▀▀ 
 ▀▀▀▀  ▀▀          ▀▀▀▀▀▀▀▀                   
                   ▀▀    ▀▀      ▀▀▀▀         
                   ▀▀    ▀▀            ▀▀▀▀▀▀▀▀ 
 ▀▀▀▀    ▀▀▀▀  ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀  ▀▀▀▀▀▀     
     ▀▀▀▀▀▀▀▀▀▀▀▀  ▀▀▀▀▀▀▀▀▀▀▀▀  ▀▀▀▀  ▀▀         
     ▀▀▀▀            ▀▀    ▀▀                     
   ▀▀▀▀▀▀    ▀▀▀▀    ▀▀    ▀▀    ▀▀▀▀    ▀▀▀▀▀▀   
   ▀▀▀▀▀▀▀▀▀▀  ▀▀▀▀▀▀▀▀    ▀▀▀▀▀▀▀▀  ▀▀▀▀▀▀▀▀▀▀   
     ▀▀▀▀▀▀  ▀▀▀▀▀▀▀▀        ▀▀▀▀▀▀▀▀  ▀▀▀▀▀▀     
 ▀▀▀▀    ▀▀▀▀▀▀  ▀▀▀▀        ▀▀▀▀  ▀▀▀▀▀▀    ▀▀▀▀ 
 ▀▀▀▀        ▀▀▀▀  ▀▀▀▀▀▀▀▀  ▀▀▀▀        ▀▀▀▀ 
     ▀▀ ▀▀ ▀▀  ▀▀        ▀▀  ▀▀ ▀▀ ▀▀     
 ▀▀▀▀       ▀▀  ▀▀    ▀▀  ▀▀       ▀▀▀▀ 
 ▀▀▀▀     ▀▀   ▀▀▀▀   ▀▀     ▀▀▀▀ 
 ▀▀   ▀▀▀▀   ▀▀▀▀   ▀▀ 
 ▀▀   ▀▀ 
METROID
}
case "$1" in
*-m|--mini|mini*)
mini
;;
*-s|--super|super*)
super
;;
*-n|--normal|normal)
normal
;;
*-t|--text|text)
text
;;
*)
text
usage
;;
esac
+37
View File
@@ -0,0 +1,37 @@
#!/bin/bash
#
# ANSI color scheme script featuring PACMAN
# by pfh
#
# Initializing procedure by lolilolicon
#
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
$rst
$f3 ▄███████▄ $f1 ▄██████▄ $f2 ▄██████▄ $f4 ▄██████▄ $f5 ▄██████▄ $f6 ▄██████▄
$f3▄█████████▀▀ $f1▄$f7█▀█$f1██$f7█▀█$f1██▄ $f2▄█$f7███$f2██$f7███$f2█▄ $f4▄█$f7███$f4██$f7███$f4█▄ $f5▄█$f7███$f5██$f7███$f5█▄ $f6▄██$f7█▀█$f6██$f7█▀█$f6▄
$f3███████▀ $f7▄▄ ▄▄ ▄▄ $f1█$f7▄▄█$f1██$f7▄▄█$f1███ $f2██$f7█ █$f2██$f7█ █$f2██ $f4██$f7█ █$f4██$f7█ █$f4██ $f5██$f7█ █$f5██$f7█ █$f5██ $f6███$f7█▄▄$f6██$f7█▄▄$f6█
$f3███████▄ $f7▀▀ ▀▀ ▀▀ $f1████████████ $f2████████████ $f4████████████ $f5████████████ $f6████████████
$f3▀█████████▄▄ $f1██▀██▀▀██▀██ $f2██▀██▀▀██▀██ $f4██▀██▀▀██▀██ $f5██▀██▀▀██▀██ $f6██▀██▀▀██▀██
$f3 ▀███████▀ $f1▀ ▀ ▀ ▀ $f2▀ ▀ ▀ ▀ $f4▀ ▀ ▀ ▀ $f5▀ ▀ ▀ ▀ $f6▀ ▀ ▀ ▀
$bld
$f3 ▄███████▄ $f1 ▄██████▄ $f2 ▄██████▄ $f4 ▄██████▄ $f5 ▄██████▄ $f6 ▄██████▄
$f3▄█████████▀▀ $f1▄$f7█▀█$f1██$f7█▀█$f1██▄ $f2▄█$f7█ █$f2██$f7█ █$f2█▄ $f4▄█$f7█ █$f4██$f7█ █$f4█▄ $f5▄█$f7█ █$f5██$f7█ █$f5█▄ $f6▄██$f7█▀█$f6██$f7█▀█$f6▄
$f3███████▀ $f7▄▄ ▄▄ ▄▄ $f1█$f7▄▄█$f1██$f7▄▄█$f1███ $f2██$f7███$f2██$f7███$f2██ $f4██$f7███$f4██$f7███$f4██ $f5██$f7███$f5██$f7███$f5██ $f6███$f7█▄▄$f6██$f7█▄▄$f6█
$f3███████▄ $f7▀▀ ▀▀ ▀▀ $f1████████████ $f2████████████ $f4████████████ $f5████████████ $f6████████████
$f3▀█████████▄▄ $f1██▀██▀▀██▀██ $f2██▀██▀▀██▀██ $f4██▀██▀▀██▀██ $f5██▀██▀▀██▀██ $f6██▀██▀▀██▀██
$f3 ▀███████▀ $f1▀ ▀ ▀ ▀ $f2▀ ▀ ▀ ▀ $f4▀ ▀ ▀ ▀ $f5▀ ▀ ▀ ▀ $f6▀ ▀ ▀ ▀
$rst
EOF
+142
View File
@@ -0,0 +1,142 @@
#!/usr/bin/env bash
# pipes.sh: Animated pipes terminal screensaver.
# Copyleft (ↄ) 2015 - Acidhub <acidhub@craft.net.br>
# 2015 - Pipeseroni - http://github.com/pipeseroni
# 2014 - Yu-Jie Lin <livibetter@gmail.com>
# ???? - Mathew Simpson
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
VERSION=1.2
M=32768
p=3
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=(
"┃┏ ┓┛━┓ ┗┃┛┗ ┏━" # -t 0 "default"
"│╭ ╮╯─╮ ╰│╯╰ ╭─" # -t 1 "round"
"│┌ ┐┘─┐ └│┘└ ┌─" # -t 2 "weak"
"║╔ ╗╝═╗ ╚║╝╚ ╔═" # -t 3 "double"
"|+ ++-+ +|++ +-" # -t 4 "add/sub"
"|/ \/-\ \|/\ /-" # -t 5 "It' something"
".. .... .... .." # -t 6 "dots"
".o oo.o o.oo o." # -t 7 "dot-O"
"-\ /\|/ /-\/ \|" # -t 8 "railway"
"▓≡▓≡≡▓≡ ≡▓≡≡▓≡▓" # -t 9 "blocks"
)
v=()
RNDSTART=0
BOLD=1
NOCOLOR=0
OPTIND=1
while getopts "p:t:f:s:r:RBChv" arg; do
case $arg in
p) ((p=(OPTARG>0)?OPTARG:p));;
t)
if [[ "$OPTARG" = c???????????????? ]]; then
V+=(${#sets[@]})
sets+=("${OPTARG:1}")
else
((OPTARG>=0 && OPTARG<${#sets[@]})) && V+=($OPTARG)
fi
;;
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;;
B) BOLD=0;;
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=3)."
echo -e " -t [0-$((${#sets[@]} - 1))]\ttype of pipes, can be used more than once (D=0)."
echo -e " -t c[16 chars]\tcustom type of pipes."
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 " -B \t\tno bold effect."
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)
cleanup() {
# clear up standard input
read -t 0.001 && cat </dev/stdin>/dev/null
# terminal has no smcup and rmcup capabilities
((FORCE_RESET)) && reset && exit 0
tput rmcup
tput cnorm
stty echo
((NOCOLOR)) && echo -ne '\e[0m'
exit 0
}
trap cleanup HUP TERM
trap 'break 2' INT
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 || FORCE_RESET=1
tput civis
tput clear
# any key press exits the loop and this script
while REPLY=; read -t 0.0$((1000/f)) -n 1; [[ -z $REPLY ]] ; 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]}
echo -ne "\e[${BOLD}m"
[[ $NOCOLOR == 0 ]] && echo -ne "\e[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
+207
View File
@@ -0,0 +1,207 @@
#!/bin/bash
# Animated pipes.sh terminal screensaver at an angle.
# Copyright (c) 2013-2015 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/pipeseroni/pipesX.sh
VERSION=1.1.0
W=$(tput cols) H=$(tput lines)
# maximal random value + 1
M=32768
SETS=('╱╲' '/\' '..' 'oo' '\/')
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)
-t c[2chs] custom type of pipes.
-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)
if [[ "$OPTARG" = c?? ]]; then
T+=(${#SETS[@]})
SETS+=("${OPTARG:1}")
else
T+=($(((OPTARG >= 0 && OPTARG < ${#SETS[@]}) ? OPTARG : T)))
fi
;;
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() {
# clear up standard input
read -t 0.001 && cat </dev/stdin>/dev/null
# terminal has no smcup and rmcup capabilities
((FORCE_RESET)) && reset && exit 0
tput rmcup
tput cnorm
stty echo
((NOCOLOR)) && echo -ne '\e[0m'
exit 0
}
trap do_exit HUP TERM
trap 'break 2' INT
# No echo stdin and hide the cursor
stty -echo
tput smcup || FORCE_RESET=1
tput civis
tput clear
# 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 REPLY=; read -t $I -n 1; [[ -z $REPLY ]] ; 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
((R)) && ((r += N, r >= R)) && r=0 && clear
done
do_exit
+100
View File
@@ -0,0 +1,100 @@
#!/bin/bash
RAINS=("|" "│" "┃" "┆" "┇" "┊" "┋" "╽" "╿")
COLORS=("\e[37m" "\e[37;1m")
# More from 256 color mode
for i in {244..255}; do
COLORS=("${COLORS[@]}" "\e[38;5;${i}m")
done
NRAINS=${#RAINS[@]}
NCOLORS=${#COLORS[@]}
NUM_RAIN_METADATA=5
sigwinch() {
TERM_WIDTH=$(tput cols)
TERM_HEIGHT=$(tput lines)
STEP_DURATION=0.025
((MAX_RAINS = TERM_WIDTH * TERM_HEIGHT / 4))
((MAX_RAIN_LENGTH = TERM_HEIGHT < 10 ? 1 : TERM_HEIGHT / 10))
# In percentage
((NEW_RAIN_ODD = TERM_HEIGHT > 50 ? 100 : TERM_HEIGHT * 2))
((NEW_RAIN_ODD = NEW_RAIN_ODD * 75 / 100))
((FALLING_ODD = TERM_HEIGHT > 25 ? 100 : TERM_HEIGHT * 4))
((FALLING_ODD = FALLING_ODD * 90 / 100))
}
do_exit() {
echo -ne "\e[${TERM_HEIGHT};1H\e[0K"
# Show cursor and echo stdin
echo -ne "\e[?25h"
stty echo
exit 0
}
do_render() {
# Clean screen first
for ((idx = 0; idx < num_rains * NUM_RAIN_METADATA; idx += NUM_RAIN_METADATA)); do
X=${rains[idx]}
Y=${rains[idx + 1]}
LENGTH=${rains[idx + 4]}
for ((y = Y; y < Y + LENGTH; y++)); do
(( y < 1 || y > TERM_HEIGHT )) && continue
echo -ne "\e[${y};${X}H "
done
done
for ((idx = 0; idx < num_rains * NUM_RAIN_METADATA; idx += NUM_RAIN_METADATA)); do
if ((100 * RANDOM / 32768 < FALLING_ODD)); then
# Falling
if ((++rains[idx + 1] > TERM_HEIGHT)); then
# Out of screen, bye sweet <3
rains=("${rains[@]:0:idx}"
"${rains[@]:idx+NUM_RAIN_METADATA:num_rains*NUM_RAIN_METADATA}")
((num_rains--))
continue
fi
fi
X=${rains[idx]}
Y=${rains[idx + 1]}
RAIN=${rains[idx + 2]}
COLOR=${rains[idx + 3]}
LENGTH=${rains[idx + 4]}
for ((y = Y; y < Y + LENGTH; y++)); do
(( y < 1 || y > TERM_HEIGHT )) && continue
echo -ne "\e[${y};${X}H${COLOR}${RAIN}"
done
done
}
trap do_exit TERM INT
trap sigwinch WINCH
# No echo stdin and hide the cursor
stty -echo
echo -ne "\e[?25l"
echo -ne "\e[2J"
rains=()
sigwinch
while :; do
read -n 1 -t $STEP_DURATION ch
case "$ch" in
q|Q)
do_exit
;;
esac
if ((num_rains < MAX_RAINS)) && ((100 * RANDOM / 32768 < NEW_RAIN_ODD)); then
# Need new |, 1-based
RAIN="${RAINS[NRAINS * RANDOM / 32768]}"
COLOR="${COLORS[NCOLORS * RANDOM / 32768]}"
LENGTH=$((MAX_RAIN_LENGTH * RANDOM / 32768 + 1))
X=$((TERM_WIDTH * RANDOM / 32768 + 1))
Y=$((1 - LENGTH))
rains=("${rains[@]}" "$X" "$Y" "$RAIN" "$COLOR" "$LENGTH")
((num_rains++))
fi
# Let rain fall!
do_render
done
+35
View File
@@ -0,0 +1,35 @@
#!/bin/sh
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
${reset}${blackf}| | | | |${reset}
${redf}█ █${reset} ${blackf}|${reset} ${greenf}█ █${reset} ${blackf}|${reset} ${yellowf}█ █${reset} ${blackf}|${reset} ${bluef}█ █${reset} ${blackf}|${reset} ${purplef}█ █${reset} ${blackf}|${reset} ${cyanf}█ █${reset}
${redf}███████${reset} ${blackf}|${reset} ${greenf}███████${reset} ${blackf}|${reset} ${yellowf}███████${reset} ${blackf}|${reset} ${bluef}███████${reset} ${blackf}|${reset} ${purplef}███████${reset} ${blackf}|${reset} ${cyanf}███████${reset}
${redf}███${boldon}${redb}██${reset}${redf}█${boldon}${redb}██${reset}${redf}███${reset} ${blackf}|${reset} ${greenf}███${boldon}${greenb}██${reset}${greenf}█${boldon}${greenb}██${reset}${greenf}███${reset} ${blackf}|${reset} ${yellowf}███${boldon}${yellowb}██${reset}${yellowf}█${boldon}${yellowb}██${reset}${yellowf}███${reset} ${blackf}|${reset} ${bluef}███${boldon}${blueb}██${reset}${bluef}█${boldon}${blueb}██${reset}${bluef}███${reset} ${blackf}|${reset} ${purplef}███${boldon}${purpleb}██${reset}${purplef}█${boldon}${purpleb}██${reset}${purplef}███${reset} ${blackf}|${reset} ${cyanf}███${boldon}${cyanb}██${reset}${cyanf}█${boldon}${cyanb}██${reset}${cyanf}███${reset}
${redf}████${boldon}${redb}█${reset}${redf}████${reset} ${blackf}|${reset} ${greenf}████${boldon}${greenb}█${reset}${greenf}████${reset} ${blackf}|${reset} ${yellowf}████${boldon}${yellowb}█${reset}${yellowf}████${reset} ${blackf}|${reset} ${bluef}████${boldon}${blueb}█${reset}${bluef}████${reset} ${blackf}|${reset} ${purplef}████${boldon}${purpleb}█${reset}${purplef}████${reset} ${blackf}|${reset} ${cyanf}████${boldon}${cyanb}█${reset}${cyanf}████${reset}
${redf}█ █ ${boldon}█${reset} ${redf}█ █${reset} ${blackf}|${reset} ${greenf}█ █ ${boldon}█${reset} ${greenf}█ █${reset} ${blackf}|${reset} ${yellowf}█ █ ${boldon}█${reset} ${yellowf}█ █${reset} ${blackf}|${reset} ${bluef}█ █ ${boldon}█${reset} ${bluef}█ █${reset} ${blackf}|${reset} ${purplef}█ █ ${boldon}█${reset} ${purplef}█ █${reset} ${blackf}|${reset} ${cyanf}█ █ ${boldon}█${reset} ${cyanf}█ █${reset}
${redf}█ █${reset} ${blackf}|${reset} ${greenf}█ █${reset} ${blackf}|${reset} ${yellowf}█ █${reset} ${blackf}|${reset} ${bluef}█ █${reset} ${blackf}|${reset} ${purplef}█ █${reset} ${blackf}|${reset} ${cyanf}█ █${reset}
${blackf}| | | | |${reset}
EOF
+40
View File
@@ -0,0 +1,40 @@
#!/bin/sh
# File: fonttest.textart
# Description: Fonts testing
# Author: NNB
# └─ https://github.com/NNBnh
# URL: https://github.com/NNBnh/nnbs-text-art/blob/main/other/fonttest.textart
# License: GPLv3
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
# Values
TEXT="${1:-abcd efg hijk lmno pqrs tuv wxyz\nABCD EFG HIJK LMNO PQRS TUV WXYZ\n 1234567890 ,./\\;'[]-=\`\n !@#\$%%^&*() <>?|:\"\{\}_+~}"
STYLES="${2:-normal bold italic}"
# Start
for style in $STYLES; do
case "$style" in
'normal') print="$print${print:+\n}\033[0m$TEXT\033[0m" ;;
'bold') print="$print${print:+\n}\033[1m$TEXT\033[0m" ;;
'italic') print="$print${print:+\n}\033[3m$TEXT\033[0m" ;;
esac
done
echo -e "\n$print\n"
exit 0
+26
View File
@@ -0,0 +1,26 @@
#!/bin/sh
#original artwork by http://www.sanderfocus.nl/#/portfolio/tech-heroes
#converted to shell by #nixers @ irc.unix.chat
cat << 'eof'
,_ ,_==▄▂
, ▂▃▄▄▅▅▅▂▅¾. / /
▄▆<´ "»▓▓▓%\ / / / /
,▅7" ´>▓▓▓% / / > / >/%
▐¶▓ ,»▓▓¾´ /> %/%// / /
▓▃▅▅▅▃,,▄▅▅▅Æ\// ///>// />/ /
V║«¼.;→ ║<«.,`=// />//%/% / /
//╠<´ -²,)(▓~"-╝/¾/ %/>/ />
/ / / ▐% -./▄▃▄▅▐, /7//;//% / /
/ ////`▌▐ %zWv xX▓▇▌//&;% / /
/ / / %//%/¾½´▌▃▄▄▄▄▃▃▐¶\/& /
</ /</%//`▓!%▓%╣[38;5;255;╣WY<Y)y&/`\
/ / %/%//</%//\i7; ╠N>)VY>7; \_ UNIX IS VERY SIMPLE IT JUST NEEDS A
/ /</ //<///<_/%\▓ V%W%£)XY _/%‾\_, GENIUS TO UNDERSTAND ITS SIMPLICITY
/ / //%/_,=--^/%/%%\¾%¶%%} /%%%%%%;\,
%/< /_/ %%%%%;X%%\%%;, _/%%%;, \
/ / %%%%%%;, \%%l%%;// _/%;, dmr
/ %%%;, <;\-=-/ /
;, l
eof
+32
View File
@@ -0,0 +1,32 @@
#!/usr/bin/sh
NAME="o0xjack"
APPNAME=609
# Set timezone to Asia/Kathmandu
timedatectl set-timezone Asia/Kathmandu
while true ; do
datey=$(date +"%I %p")
if [[ "$datey" == "12 AM" || "$datey" == "1 AM" || "$datey" == "2 AM" ]] ; then
dunstify -i /usr/share/icons/Papirus-Dark/48x48/emotes/face-devilish.svg "Demons are watching you..." -u low -a $APPNAME
elif [[ "$datey" == "03 AM" || "$datey" == "04 AM" || "$datey" == "05 AM" || "$datey" == "06 AM" || "$datey" == "07 AM" || "$datey" == "08 AM" ]] ; then
dunstify -i /usr/share/icons/Papirus-Dark/48x48/emotes/emote-love.svg "Good Morning" "$NAME!" -u low -a $APPNAME
elif [[ "$datey" == "09 AM" || "$datey" == "10 AM" || "$datey" == "11 AM" ]] ; then
dunstify -i /usr/share/icons/Papirus-Dark/48x48/emotes/emote-love.svg "Good Morning" "$NAME!" -u low -a $APPNAME
elif [[ "$datey" == "12 PM" || "$datey" == "01 PM" || "$datey" == "02 PM" || "$datey" == "03 PM" || "$datey" == "04 PM" || "$datey" == "05 PM" ]] ; then
dunstify -i /usr/share/icons/Papirus-Dark/48x48/emotes/emote-love.svg "Good Afternoon" "$NAME!" -u low -a $APPNAME
elif [[ "$datey" == "06 PM" || "$datey" == "07 PM" ]] ; then
dunstify -i /usr/share/icons/Papirus-Dark/48x48/emotes/emote-love.svg "Good Evening" "$NAME!" -u low -a $APPNAME
elif [[ "$datey" == "11 PM" || "$datey" == "12 AM" ]] ; then
dunstify -i /usr/share/icons/Papirus-Dark/48x48/emotes/face-devilish.svg "Demons are watching you..." -u low -a $APPNAME
elif [[ "$datey" == "10PM" ]]; then
dunstify -i /usr/share/icons/Papirus-Dark/48x48/emotes/emote-love.svg "Good Night" "$NAME!" -u low -a $APPNAME
elif [[ "$datey" == "08 PM" || "$datey" == "09 PM" ]]; then
dunstify -i /usr/share/icons/Papirus-Dark/48x48/emotes/emote-love.svg "Nighty" "$NAME!" -u low -a $APPNAME
fi
sleep 3600
done
+167
View File
@@ -0,0 +1,167 @@
#!/usr/bin/env bash
# sysinfo: A sort of custom script
# Thanks to u/x_ero for his sysinfo script
# Also thanks to mysterious person for their fetch script; allowing for center padding
# color escapes
BLK="\e[30m"
RED="\e[31m"
GRN="\e[32m"
YLW="\e[33m"
BLU="\e[34m"
PUR="\e[35m"
CYN="\e[36m"
WHT="\e[37m"
GRY="\e[90;1m"
RST="\e[0m"
BLD="\033[1m"
PBLK=$(printf "%b" "\x1b[38;2;58;58;58m")
PRED=$(printf "%b" "\e[31m")
PGRN=$(printf "%b" "\e[32m")
PYLW=$(printf "%b" "\e[33m")
PBLU=$(printf "%b" "\e[34m")
PPUR=$(printf "%b" "\e[35m")
PCYN=$(printf "%b" "\e[36m")
PWHT=$(printf "%b" "\e[37m")
PGRY=$(printf "%b" "\e[90;1m")
PRST=$(printf "%b" "\e[0m")
PBLD=$(printf "%b" "\033[1m")
# vars
#FULL=▓
#EMPTY=░
FULL=━
EMPTY=━
#FULL=─
#FULL=┅
#EMPTY=┄
name=$USER
host=$(uname -n)
distro=$(uname -o | awk -F '"' '/PRETTY_NAME/ { print $2 }' /etc/os-release)
wm="$(xprop -id $(xprop -root -notype | awk '$1=="_NET_SUPPORTING_WM_CHECK:"{print $5}') -notype -f _NET_WM_NAME 8t | grep "WM_NAME" | cut -f2 -d \")"
get_pkg_count() {
package_managers=('xbps-install' 'apk' 'apt' 'pacman' 'nix' 'dnf' 'rpm' 'emerge')
for package_manager in ${package_managers[@]}; do
if command -v $package_manager 2>/dev/null>&2; then
case "$package_manager" in
xbps-install ) xbps-query -l | wc -l ;;
apk ) apk search | wc -l ;;
apt ) apt list --installed 2>/dev/null | wc -l ;;
pacman ) pacman -Q | wc -l ;;
nix ) nix-env -qa --installed '*' | wc -l ;;
dnf ) dnf list installed | wc -l ;;
rpm ) rpm -qa | wc -l ;;
emerge ) qlist -I | wc -l ;;
esac
# if a package manager is found return from the function
return
fi
done
echo 'Unknown'
}
storage=$(df -h / | awk '/^\//{print $3}')
term=$(ps -o sid= -p "$$" | xargs ps -o ppid= -p | xargs ps -o comm= -p)
uptm=$(uptime -p | sed -e 's/hour/hr/' -e 's/hours/hrs/' -e 's/minutes/mins/' -e 's/minute/min/' -e 's/up //')
#uptm=$(uptime -p)
#Cleanup first
clear
# find the center of the screen
COL=$(tput cols)
ROW=$(tput lines)
# ((PADY = ROW / 2 - 10 - 22 / 2))
# ((PADX = COL / 2 - 34 / 2))
PADY=2
PADX=2
for ((i = 0; i < PADX; ++i)); do
PADC="$PADC "
done
for ((i = 0; i < PADY; ++i)); do
PADR="$PADR\n"
done
# vertical padding
printf "%b" "$PADR"
printf "\n"
PADXX=$((PADX - 3))
for ((i = 0; i < PADXX; ++i)); do
PADCC="$PADCC "
done
# Ascii art arms
cat <<EOF
$PADCC$PBLD $PBLU.
$PADCC $PBLU/ $PPUR\\
$PADCC $PBLU/ $PPUR\\
$PADCC $PBLU/^. $PPUR\\
$PADCC $PBLU/ .$PWHT-$PPUR. \\
$PADCC $PBLU/ ( $PPUR) _\\
$PADCC $PBLU/ _.~ $PPUR~._^\\
$PADCC $PBLU/.^ $PPUR^.\\
EOF
BAR=" ▓▒░"
OUTT="$BLK$BAR$RED$BAR$GRN$BAR$YLW$BAR$BLU$BAR$PUR$BAR$CYN$BAR$WHT$BAR$RST"
printf "%s%b" "$PADC" "$OUTT"
printf "\n\n"
# greetings
printf "%s%b" "$PADC" " i'm $RED$BLD$name$RST\n"
printf "%s%b" "$PADC" " i use $GRN$BLD$host$RST btw\n"
printf "%s%b" "$PADC" " up $CYN$BLD$uptm$RST\n\n"
# environment
printf "%s%b" "$PADC" "$RED distro $GRY⏹ $RST$distro\n"
printf "%s%b" "$PADC" "$BLU kernel $GRY⏹ $RST$(uname -r)\n"
printf "%s%b" "$PADC" "$PUR packages $GRY⏹ $RST$(get_pkg_count)\n"
printf "%s%b" "$PADC" "$GRN shell $GRY⏹ $RST${SHELL##*/}\n"
printf "%s%b" "$PADC" "$YLW term $GRY⏹ $RST$term\n"
printf "%s%b" "$PADC" "$CYN wm $GRY⏹ $RST${wm}\n"
printf "%s%b" "$PADC" "$BLU disk $GRY⏹ $RST$storage used\n"
printf " $RST\n"
# progress bar
draw() {
perc=$1
size=$2
inc=$((perc * size / 100))
out=
color="$3"
for v in $(seq 0 $((size - 1))); do
test "$v" -le "$inc" &&
out="${out}\e[1;${color}m${FULL}" ||
out="${out}\e[0;37m${GRY}${EMPTY}"
done
printf $out
}
# cpu
cpu=$(grep 'cpu ' /proc/stat | awk '{usage=($2+$4)*100/($2+$4+$5)} END {print usage}')
c_lvl=$(printf "%.0f" $cpu)
printf "%b" "$PADC"
printf " $PUR%-4s $WHT%-5s %-25s \n" " cpu" "$c_lvl%" $(draw $c_lvl 15 35)
# ram
ram=$(free | awk '/Mem:/ {print int($3/$2 * 100.0)}')
printf "%b" "$RST$PADC"
printf " $PUR%-4s $WHT%-5s %-25s \n" " ram" "$ram%" $(draw $ram 15 35)
# hide the cursor and wait for user input
tput civis
read -n 1
# give the cursor back
tput cnorm
@@ -0,0 +1,14 @@
[Desktop Entry]
Name=Neovim
GenericName=Text Editor
Comment=Edit text files
TryExec=nvim
Exec=alacritty -e nvim
Terminal=false
Type=Application
Keywords=Text;editor;
Icon=nvim
Categories=Utility;TextEditor;
StartupNotify=true
MimeType=text/english;text/plain;text/x-makefile;text/x-c++hdr;text/x-c++src;text/x-chdr;text/x-csrc;text/x-java;text/x-moc;text/x-pascal;text/x-tcl;text/x-tex;application/x-shellscript;text/x-c;text/x-c++;
Path=
@@ -0,0 +1,12 @@
[Desktop Entry]
Type=Application
Name=ranger
Comment=Launches the ranger file manager
Icon=utilities-terminal
Terminal=false
Exec=alacritty -e ranger
Categories=ConsoleOnly;System;FileTools;FileManager
MimeType=inode/directory;
Keywords=File;Manager;Browser;Explorer;Launcher;Vi;Vim;Python
Path=
StartupNotify=false
+8
View File
@@ -0,0 +1,8 @@
[Desktop Entry]
Type=Application
Name=SysFetch
Icon=~/.local/share/applications/zombie.svg
Terminal=false
Exec=OpenApps --fetch
#Exec=termite --hold -e zfetch
+76
View File
@@ -0,0 +1,76 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="260px" height="260px" viewBox="0 0 260 260" enable-background="new 0 0 260 260" xml:space="preserve"> <image id="image0" width="260" height="260" x="0" y="0"
href="data:image/png;base64,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
Y2M6bW9kZWwAc1JHQltgSUMAAAAASUVORK5CYII=" />
</svg>

After

Width:  |  Height:  |  Size: 5.9 KiB

+5
View File
@@ -0,0 +1,5 @@
#!/usr/bin/env bash
pcs() { for i in {0..7}; do echo -en "\e[${1}$((30+$i))m \u2588\u2588 \e[0m"; done; }
pcsbright() { for i in {0..7}; do echo -en "\e[${1}$((90+$i))m \u2588\u2588 \e[0m"; done; }
printf "\n%s\n%s\n\n" "$(pcs)" "$(pcsbright '1;')"
+39
View File
@@ -0,0 +1,39 @@
#!/bin/sh
# Author: lantlos
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
${boldon}${blackf} ██████${reset}
${boldon}${blackf}██${reset}██${reset}${bluef}██${reset}${boldon}${blackf}██${reset}${bluef}██${reset}
${boldon}${blackf}██${reset}██${bluef}██${reset}${boldon}${blackf}██${reset}${bluef}██${reset}
${boldon}${blackf}██████${reset}${purplef}██████${reset}
${boldon}${blackf}████${reset}████${boldon}${blackf}██${reset}
${boldon}${blackf}████${reset}████████${boldon}${blackf}██${reset}
${boldon}${blackf}████${reset}████████${boldon}${blackf}██${reset}
${boldon}${blackf}████${reset}████████${boldon}${blackf}██${reset}
${boldon}${blackf}████${reset}████${boldon}${blackf}██${reset}
${boldon}${blackf}███${reset}${purplef}███ ████${reset}
EOF
+25
View File
@@ -0,0 +1,25 @@
#!/bin/sh
#original artwork by http://www.sanderfocus.nl/#/portfolio/tech-heroes
#converted to shell by #nixers @ irc.unix.chat
cat << 'eof'
,_ ,_==▄▂
, ▂▃▄▄▅▅▅▂▅¾. / /
▄▆<´ "»▓▓▓%\ / / / /
,▅7" ´>▓▓▓% / / > / >/%
▐¶▓ ,»▓▓¾´ /> %/%// / /
▓▃▅▅▅▃,,▄▅▅▅Æ\// ///>// />/ /
V║«¼.;→ ║<«.,`=// />//%/% / /
//╠<´ -²,)(▓~"-╝/¾/ %/>/ />
/ / / ▐% -./▄▃▄▅▐, /7//;//% / /
/ ////`▌▐ %zWv xX▓▇▌//&;% / /
/ / / %//%/¾½´▌▃▄▄▄▄▃▃▐¶\/& /
</ /</%//`▓!%▓%╣[38;5;255;╣WY<Y)y&/`\
/ / %/%//</%//\i7; ╠N>)VY>7; \_ UNIX IS VERY SIMPLE IT JUST NEEDS A
/ /</ //<///<_/%\▓ V%W%£)XY _/%‾\_, GENIUS TO UNDERSTAND ITS SIMPLICITY
/ / //%/_,=--^/%/%%\¾%¶%%} /%%%%%%;\,
%/< /_/ %%%%%;X%%\%%;, _/%%%;, \
/ / %%%%%%;, \%%l%%;// _/%;, dmr
/ %%%;, <;\-=-/ /
;, l
eof
+196
View File
@@ -0,0 +1,196 @@
#!/usr/bin/env bash
# z0mbi3
# https://github.com/gh0stzk/dotfiles
# z0mbi3.zk@protonmail.com
# This script is a modified version of https://github.com/Mangeshrex/rxfetch
esc=""
rst="${esc}[0m"
c1=""; c2=""; c3=""; c4=""
c5=""; c6=""; c7=""; c8=""
c9=""; c10=""; c11=""; c12=""
c13=""; c14=""; c15=""; c16=""
c17=""; c18=""; c19=""; c20=""
c21=""; c22=""; c23=""; c24=""
c25=""; c26=""; c27=""; c28=""
c29=""; c30=""; c31=""; c32=""
c33=""; c34=""; c35=""; c36=""
c37=""; c38=""; c39=""; c40=""
c41=""; c42=""; c43=""; c44=""
c45=""; c46=""; c47=""; c48=""
c49=""; c50=""; c51=""; c52=""
c53=""; c54=""; c55=""; c56=""
c57=""; c58=""; c59=""; c60=""
c61=""; c62=""; c63=""; c64=""
c65=""; c66=""; c67=""; c68=""
c69=""; c70=""; c71=""; c72=""
c73=""; c74=""; c75=""; c76=""
c77=""; c78=""; c79=""; c80=""
c81=""; c82=""; c83=""; c84=""
c85=""; c86=""; c87=""; c88=""
c89=""; c90=""; c91=""; c92=""
c93=""; c94=""; c95=""; c96=""
c97=""; c98=""; c99=""; c100=""
c101=""; c102=""; c103=""; c104=""
c105=""; c106=""; c107=""; c108=""
c109=""; c110=""; c111=""; c112=""
c113=""; c114=""; c115=""; c116=""
c117=""; c118=""; c119=""; c120=""
c121=""; c122=""; c123=""; c124=""
c125=""; c126=""; c127=""; c128=""
c129=""; c130=""; c131=""; c132=""
c133=""; c134=""; c135=""; c136=""
c137=""; c138=""; c139=""; c140=""
c141=""; c142=""; c143=""; c144=""
c145=""; c146=""; c147=""; c148=""
c149=""; c150=""; c151=""; c152=""
c153=""; c154=""; c155=""; c156=""
c157=""; c158=""; c159=""; c160=""
c161=""; c162=""; c163=""; c164=""
c165=""; c166=""; c167=""; c168=""
c169=""; c170=""; c171=""; c172=""
c173=""; c174=""; c175=""; c176=""
c177=""; c178=""; c179=""; c180=""
c181=""; c182=""; c183=""; c184=""
c185=""; c186=""; c187=""; c188=""
c189=""; c190=""; c191=""; c192=""
c193=""; c194=""; c195=""; c196=""
c197=""; c198=""; c199=""; c200=""
c201=""; c202=""; c203=""; c204=""
c205=""; c206=""; c207=""; c208=""
c209=""; c210=""; c211=""; c212=""
c213=""; c214=""; c215=""; c216=""
c217=""; c218=""; c219=""; c220=""
c221=""; c222=""
#colors
CBK=$(tput setaf 0)
CRE=$(tput setaf 1)
CGR=$(tput setaf 2)
CYE=$(tput setaf 3)
CBL=$(tput setaf 4)
CMA=$(tput setaf 5)
CCY=$(tput setaf 6)
CWH=$(tput setaf 7)
CBD=$(tput bold)
CNC=$(tput sgr0)
get_init() {
if pidof -q systemd; then
echo 'systemd'
elif [ -f '/sbin/openrc' ]; then
echo 'openrc'
elif [ -f '/sbin/dinit' ]; then
echo 'dinit'
else
cut -d ' ' -f 1 /proc/1/comm
fi
}
get_uptime() {
uptime -p | sed 's/up//'
}
get_pkg_count() {
package_managers=('xbps-install' 'apk' 'port' 'apt' 'pacman' 'nix' 'dnf' 'rpm' 'emerge' 'eopkg')
for package_manager in "${package_managers[@]}"; do
if command -v "$package_manager" 2>/dev/null >&2; then
case "$package_manager" in
xbps-install) xbps-query -l | wc -l ;;
apk) apk search | wc -l ;;
apt) if [ "$kernel" != "Darwin" ]; then
echo $(($(apt list --installed 2>/dev/null | wc -l) - 1))
else
echo 0
fi
;;
pacman) pacman -Q | wc -l ;;
nix) nix-env -qa --installed '*' | wc -l ;;
dnf) dnf list installed | wc -l ;;
rpm) rpm -qa | wc -l ;;
emerge) qlist -I | wc -l ;;
port) port installed 2>/dev/null | wc -l | awk 'NR==1{print $1}' ;;
eopkg) eopkg li | wc -l ;;
esac
# if a package manager is found return from the function
return
fi
done
echo 0
}
# Get package information formatted
get_package_info() {
pkg_count=$(get_pkg_count)
if [ "$pkg_count" -ne 0 ]; then
echo -n "$pkg_count"
else
echo "Unknown"
fi
}
distro() {
awk -F '"' '/PRETTY_NAME/ { print $2 }' /etc/os-release
}
storage() {
df -h --output=used / | awk 'NR == 2 { print $1 }'
}
# Get Memory usage
get_mem () {
free --mega | awk 'NR == 2 { print $3" MB" }'
}
# Get DE/WM
# Reference: https://github.com/unixporn/robbb/blob/master/fetcher.sh
get_de_wm() {
wm="${XDG_CURRENT_DESKTOP#*:}"
[ "$wm" ] || wm="$DESKTOP_SESSION"
# for most WMs
[ ! "$wm" ] && [ "$DISPLAY" ] && command -v xprop >/dev/null && {
id=$(xprop -root -notype _NET_SUPPORTING_WM_CHECK 2>/dev/null)
id=${id##* }
wm=$(xprop -id "$id" -notype -len 100 -f _NET_WM_NAME 8t 2>/dev/null | grep '^_NET_WM_NAME' | cut -d\" -f 2)
}
# for non-EWMH WMs
[ ! "$wm" ] || [ "$wm" = "LG3D" ] && {
wms=('sway' 'kiwmi' 'wayfire' 'sowm' 'catwm' 'fvwm' 'dwm' '2bwm' 'monsterwm' 'tinywm' 'xmonad')
for current_wm in "${wms[@]}"; do
if pgrep -x "$current_wm" 2>/dev/null >&2; then
wm="${current_wm}";
break
fi
done
}
echo "${wm:-unknown}"
}
cat << EOF
${CBD}${c1}█${c2}█
${c3}█${c4}█${c5}█${c4}█${c6}█${c7}█${c8}█${c9}█${c10}█${c11}█${c12}█
${c13}█${c14}█ ${c15}█${c16}█${c17}█${c18}█${c19}█${c19}█${c20}█${c21}█${c22}█${c19}█${c19}█${c23}█${c24}█${c36}█${c25}█${c26}█${c27}█
${c28}█${c29}█${c30}█${c31}█${c32}█${c33}█${c34}█${c34}█${c34}█${c34}█${c34}█${c34}█${c34}█${c35}█${c37}█${c38}█${c39}█${c40}█${c41}█${c42}█${c43}█
${c5}█${c44}█${c45}█${c46}█${c47}█${c48}█${c49}█${c50}█${c51}█${c52}█${c53}█${c53}█${c53}█${c53}█${c53}█${c53}█${c54}█${c55}█${c56}█${c57}█${c58}█${c59}█${c60}█ ${CMA}os${CWH} $(distro)
${c61}█${c62}█${c38}█${c63}█${c64}█${c34}█${c65}█${c66}█${c67}█${c68}█${c69}█${c70}█${c70}█${c70}█${c71}█${c72}█${c73}█${c74}█${c75}█${c76}█${c77}█${c78}█${c79}█ ${CGR}ker${CWH} $(uname -r)
${c61}█${c62}█${c40}█${c80}█${c81}█${c82}█${c83}█${c84}█${c85}█${c84}█${c86}█${c87}█${c88}█${c88}█${c89}█${c90}█${c85}█${c85}█${c91}█${c92}█${c93}█${c78}█${c41}█${c94}█${c95}█ ${CCY}pkgs${CWH} $(get_package_info)
${c96}█${c97}█${c81}█${c98}█${c99}█${c100}█${c101}█${c102}█${c103}█${c104}█${c105}█${c106}█${c107}█${c108}█${c109}█${c110}█${c111}█${c112}█${c113}█${c114}█${c115}█ ${CBL}sh${CWH} ${SHELL##*/} ${CYE}󰮯 ${CYE} ${CGR}󰊠 ${CGR} ${CBL}󰊠 ${CBL} ${CRE}󰊠 ${CRE} ${CCY}󰊠 ${CCY} ${CMA}󰊠 ${CMA}
${c116}█${c117}█${c99}█${c118}█${c119}█${c120}█${c121}█${c122}█${c123}█${c124}█${c125}█${c126}█${c127}█${c128}█${c111}█${c112}█${c129}█ ${CYE}ram${CWH} $(get_mem)
${c116}█${c70}█${c130}█${c131}█${c131}█${c132}█${c133}█${c134}█${c135}█${c135}█${c136}█${c137}█${c138}█${c131}█${c139}█${c140}█${c141}█ ${CRE}de/wm${CWH} $(get_de_wm)
${c142}█${c143}█${c144}█${c145}█${c146}█${c147}█${c148}█${c149}█${c150}█${c151}█${c152}█${c71}█${c159}█ ${CMA}init${CWH} $(get_init)
${c153}█${c154}█${c155}█${c156}█${c157}█${c158}█${c160}█${c135}█${c135}█${c161}█${c162}█${c163}█${c164}█${c165}█${c166}█${c167}█${c168}█ ${CBL}disk${CWH} $(storage) Used
${c169}█${c170}█${c171}█${c172}█${c173}█${c174}█${c175}█${c176}█${c177}█${c157}█${c178}█${c179}█${c180}█${c181}█${c181}█${c135}█${c135}█${c182}█${c183}█${c184}█${c185}█ ${CYE}up${CWH} $(get_uptime)
${c186}█${c187}█${c187}█${c188}█${c135}█${c135}█${c189}█${c190}█${c191}█${c192}█${c193}█${c194}█${c195}█${c196}█${c197}█${c198}█${c199}█${c135}█${c135}█${c200}█${c201}█${c202}█${c202}█${c203}█${c204}█
${c205}█${c206}█${c207}█${c207}█${c207}█${c202}█${c208}█${c209}█${c210}█${c135}█${c211}█${c212}█${c213}█${c214}█${c215}█${c216}█${c217}█${c135}█${c135}█${c135}█${c135}█${c218}█${c219}█${c220}█${c220}█${c207}█${c221}█${c222}█${c168}█${rst}
EOF