Updated to current

This commit is contained in:
edwark43
2025-02-07 15:18:20 -05:00
parent c79881b41c
commit 4e391f7e4b
26 changed files with 192 additions and 126 deletions

View File

@@ -1,25 +1,33 @@
#!/usr/bin/env bash
# Simple CLI for shell-color-scripts
DIR_COLORSCRIPTS="$HOME/.local/share/asciiart"
fmt_help=" %-20s\t%-54s\n"
list_colorscripts="$(/usr/bin/ls "${DIR_COLORSCRIPTS}" | cut -d ' ' -f 1 | nl)"
length_colorscripts="$(/usr/bin/ls "${DIR_COLORSCRIPTS}" | wc -l)"
function _help() {
echo "Description: A collection of terminal color scripts."
echo ""
echo "Usage: colorscript [OPTION] [SCRIPT NAME/INDEX]"
printf "${fmt_help}" \
"-h, --help, help" "Print this help." \
"-l, --list, list" "List all installed color scripts." \
"-r, --random, random" "Run a random color script." \
"-e, --exec, exec" "Run a specified color script by SCRIPT NAME or INDEX."
}
function _list() {
echo "There are "$(ls "${DIR_COLORSCRIPTS}" | wc -l)" installed color scripts:"
echo "${list_colorscripts}"
}
function _random() {
declare -i random_index=$RANDOM%$length_colorscripts
declare -i random_index=$((RANDOM % length_colorscripts + 1))
[[ $random_index -eq 0 ]] && random_index=1
random_colorscript="$(echo "${list_colorscripts}" | sed -n ${random_index}p \
| tr -d ' ' | tr '\t' ' ' | cut -d ' ' -f 2)"
# echo "${random_colorscript}"
exec "${DIR_COLORSCRIPTS}/${random_colorscript}"
}
@@ -67,6 +75,9 @@ case "$#" in
-h | --help | help)
_help
;;
-l | --list | list)
_list
;;
-r | --random | random)
_random
;;

View File

@@ -19,9 +19,12 @@ case "$class" in
outcome "state=floating sticky=on center=on"
;;
mpv)
outcome "state=pseudo_tiled focus=on rectangle=849x477+0+0 center=on"
outcome "state=floating focus=on rectangle=849x477+0+0 center=on"
;;
virt-manager)
outcome "state=floating center=on"
;;
ranger)
outcome "state=floating rectangle=900x700+0+0 center=on"
;;
esac

View File

@@ -4,9 +4,9 @@ case $1 in
polybar-msg cmd hide | bspc config top_padding 2 | bspc config bottom_padding 2
exit;;
-u | --unhide | unhide)
polybar-msg cmd show | bspc config top_padding 48 | bspc config bottom_padding 48
polybar-msg cmd show | bspc config top_padding 76 | bspc config bottom_padding 76
exit;;
*)
echo "Invalid option"
exit;;
esac
esac

View File

@@ -1,5 +1,4 @@
#!/usr/bin/env bash
# I don't remember if I made this script or not.
#colors
#bold="(tput bold)"
@@ -90,10 +89,15 @@ distro() {
}
# Get root partition space used
storage() {
root_storage() {
df -h --output=used,size / | awk 'NR == 2 { print $1" / "$2 }'
}
home_storage() {
if mountpoint -q "/home"; then
df -h --output=used,size /home | awk 'NR == 2 { print $1" / "$2 }'
fi
}
# Get Memory usage
mem() {
free --mega | awk 'NR == 2 { print $3" / "$2" MB" }'
@@ -142,6 +146,7 @@ echo -e " ${c0} ┃ ${c9}(${c0}${c8}\_;/${c0}${c9})${c0} ┃ ${c1
echo -e " ┃ ${c0}┃ ${c2}init${c3} $(get_init)"
echo -e " ┃ I ${c1}${c0} Arch ┃ ${c7}de/wm${c3} $(get_de_wm)"
echo -e " ┃ ┃ ${c5}up${c3} $(get_uptime)"
echo -e " ┃ ┃ ${c1}disk${c3} $(storage)"
echo -e " ┃ ┃ ${c1}root${c3} $(root_storage)"
echo -e " ┃ ┃ ${c1}home${c3} $(home_storage)"
echo -e " ┗━━━━━━━━━━━━━━━━━━━━━━┛ ${c1}━━━${c2}━━━${c3}━━━${c4}━━━${c5}━━━${c6}━━━${c7}━━━"
echo -e " "
echo -e " "

40
misc/bin/nodeselector Executable file
View File

@@ -0,0 +1,40 @@
#!/bin/bash
clear
get_term_size() {
IFS='[;' read -sp $'\e7\e[9999;9999H\e[6n\e8' -d R -rs _ lines
}
listNodes() {
for nodeList in $(bspc query -N -n .window | grep -v "$(bspc query -N -n)"); do
echo $(xtitle -t 90 ${nodeList})
done
}
getNodes() {
count=0
for nodeCount in $(bspc query -N -n .window | grep -v "$(bspc query -N -n)"); do
count=$((count+1))
export node${count}=$nodeCount
done
selectedNode="node$y"
}
getCursorPos() {
echo -en "\E[6n" && read -sdR CURPOS && CURPOS=${CURPOS#*[} && y=$(printf ";"$CURPOS | cut -d';' -f2)
}
listNodes
printf '\e[H'
while [[ true ]]; do
read -rsn1 input
getCursorPos
getNodes
if [[ "$input" = "j" && $y -lt $count ]]; then
printf '\e[B'
elif [[ "$input" = "k" ]]; then
printf '\e[A'
elif [[ "$input" = "l" ]]; then
bspc node --focus ${!selectedNode}
clear
break
elif [[ "$input" = "q" ]]; then
clear
break
fi
done

View File

@@ -21,7 +21,7 @@ case "$1" in
alacritty --hold --class updating,alacritty -o window.dimensions.lines=22 window.dimensions.columns=47 -e updates --print-updates
;;
--ranger)
alacritty --class alacritty -e ranger
alacritty --class ranger,alacritty -e ranger
;;
--nvim)
alacritty -e nvim
@@ -32,9 +32,15 @@ case "$1" in
--fetch)
alacritty --hold --class floaterm,alacritty -o window.dimensions.lines=21 window.dimensions.columns=90 -e neofetch
;;
--browser)
brave
--nodeselector)
alacritty --class floaterm,alacritty -o window.dimensions.lines=21 window.dimensions.columns=90 -e nodeselector
;;
--browser)
cachy-browser
;;
--osmc)
prismlauncher -l b1.7.3
;;
*)
echo "Not a Valid Option"
;;

View File

@@ -39,4 +39,4 @@ case $1 in
take_screenshot -i "$(xdotool getactivewindow)";;
*)
take_screenshot;;
esac
esac