diff --git a/.sops.yaml b/.sops.yaml new file mode 100644 index 0000000..ad6e130 --- /dev/null +++ b/.sops.yaml @@ -0,0 +1,11 @@ +keys: + - &t14 age14e2d2y8e2avzfrsyxg9dudxd36svm24t7skw6e969n0c42znlp3shffdtg + - &racknerd age19qx3e78c9f2l7ceccgjf7ksvc873ungjely3nyxyjts2xsz0ldjq6shksm + - &ocx age1xwcz9qtaezjy4kl6xttea0u00j7j2n8xkd297vjz9xrnqx9fksjsg3nhu3 +creation_rules: + - path_regex: secrets/[^/]+\.yaml$ + key_groups: + - age: + - *t14 + - *racknerd + - *ocx diff --git a/bin/bar.sh b/bin/bar.sh deleted file mode 100755 index 2a7dc9b..0000000 --- a/bin/bar.sh +++ /dev/null @@ -1,91 +0,0 @@ -#!/bin/bash -trap \ - "{ pkill -P $$ ; exit 255; }" \ - SIGINT SIGTERM ERR EXIT - -bat() { - battery=$(cat /sys/class/power_supply/BAT0/capacity) - time=$(cat /tmp/.battime) - drain=$(cat /sys/class/power_supply/BAT0/power_now) - if [[ $(cat /sys/class/power_supply/BAT0/status) == "Charging" ]]; then - echo "$battery%+" - else - echo "$time, $battery%$charge, $(echo "scale=1; $drain / 1000000" | bc)mW" - fi -} - -time_date() { - FORMAT="%a %m.%d.%y %T" - DATE=`date "+${FORMAT}"` - echo "${DATE}" -} - -mem() { - echo "scale=2; $(free -m | sed -n 2p | awk '{print $3 + $5}') / 1000" | bc -} - -vol() { - MUTED=$(amixer get Master | grep off) - amixer get Master | grep -m1 -Po "\d{1,3}%" - [[ $MUTED != '' ]] && echo " M"; - -} - -temp_update() { - TEMP=$(cat /sys/class/thermal/thermal_zone0/temp) - echo $((TEMP / 1000)) -} - -cpu_update() { - read prevtotal previdle < /tmp/.cpulast - read cpu a b c idle rest < /proc/stat - total=$((a+b+c+idle)) - [[ $prevtotal == 0 ]] && prevtotal=1 - cpu=$((100*( (total-prevtotal) - (idle-previdle) ) / (total-prevtotal) )) - echo $total $idle > /tmp/.cpulast - echo "$cpu%" -} - -calc(){ awk "BEGIN { print "$*" }"; } -mhz_update() { - mhz=$(cat /proc/cpuinfo | grep 'cpu MHz' | awk '{print $4}' | head -n1 | cut -d "." -f 1) - echo "$(calc $mhz/1000 | awk '{ printf "%1.2f\n", $0 }') GHz" -} - -update_3() { - while true; do - cpu_update > /tmp/.cpu - temp_update > /tmp/.temp - mhz_update > /tmp/.mhz - sleep 3 - done -} -update_30() { - while :; do - awk 'NR==3 {printf("%.0ddB",$4) > "/tmp/.wifi"}' /proc/net/wireless - acpi | awk '{print $5}' > /tmp/.battime - if ping -W 1 -c 1 8.8.8.8 > /dev/null; then - echo "@" > /tmp/.online - else - echo "?" > /tmp/.online - fi - sleep 30 - done -} - -update_300() { - while :; do - curl -s wttr.in/madison?format=%t | head -c 7 > /tmp/.wttr - sleep 300 - done -} - -SLEEP_SEC=1 -PAD=" | " -update_300 & -update_30 & -update_3 & -while true; do - xsetroot -name "$(mem)G$PAD$(cat /tmp/.cpu)$PAD$(cat /tmp/.mhz)$PAD$(cat /tmp/.temp)°C$PAD$(cat /tmp/.wifi), $(cat /tmp/.online)$PAD$(vol)$PAD$(bat)$PAD$(cat /tmp/.wttr), $(time_date)" - sleep $SLEEP_SEC -done diff --git a/bin/colors.sh b/bin/colors.sh deleted file mode 100755 index 0e323ed..0000000 --- a/bin/colors.sh +++ /dev/null @@ -1,26 +0,0 @@ -#!/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='gYw' # 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/bin/ufetch b/bin/ufetch deleted file mode 100755 index bfdd23f..0000000 --- a/bin/ufetch +++ /dev/null @@ -1,71 +0,0 @@ -#!/bin/sh - -## INFO -host="$(cat /etc/hostname)" -os='Debian 11' -kernel="$(uname -sr)" -uptime="69 days, 4 hours, 20 minutes" -packages="$(apt list --installed 2>/dev/null | wc -l)" -shell="$(basename "$SHELL")" - -## UI DETECTION -if [ -n "${DE}" ]; then - ui="${DE}" - uitype='DE' -elif [ -n "${WM}" ]; then - ui="${WM}" - uitype='WM' -elif [ -n "${XDG_CURRENT_DESKTOP}" ]; then - ui="${XDG_CURRENT_DESKTOP}" - uitype='DE' -elif [ -n "${DESKTOP_SESSION}" ]; then - ui="${DESKTOP_SESSION}" - uitype='DE' -elif [ -f "${HOME}/.xinitrc" ]; then - ui="$(tail -n 1 "${HOME}/.xinitrc" | cut -d ' ' -f 2)" - uitype='WM' -elif [ -f "${HOME}/.xsession" ]; then - ui="$(tail -n 1 "${HOME}/.xsession" | cut -d ' ' -f 2)" - uitype='WM' -else - ui='unknown' - uitype='UI' -fi - -##hardcode because our .xinitrc doesn't end like exec wm -ui="dwm" - -## DEFINE COLORS -# probably don't change these -if [ -x "$(command -v tput)" ]; then - bold="$(tput bold)" - black="$(tput setaf 0)" - red="$(tput setaf 1)" - green="$(tput setaf 2)" - yellow="$(tput setaf 3)" - blue="$(tput setaf 4)" - magenta="$(tput setaf 5)" - cyan="$(tput setaf 6)" - white="$(tput setaf 7)" - reset="$(tput sgr0)" -fi - -# you can change these -lc="${reset}${bold}${white}" # labels -nc="${reset}${bold}${white}" # user and hostname -ic="${reset}" # info -c0="${reset}${white}" # first color - -## OUTPUT -clear -cat <