feat: new pc conf

This commit is contained in:
AngeD 2023-03-09 17:51:39 +01:00
parent 99847eda69
commit ded281b797
17 changed files with 51 additions and 114 deletions

Binary file not shown.

View file

@ -1,36 +0,0 @@
#!/bin/bash
set -e
function get_value() {
local to="$1"
local from="$2"
curl "$API$from$to" 2> /dev/null | jq -r .price
}
if [ -t 1 ]; then
NORMAL='\e[0m'
BOLD='\e[1m'
fi
API='https://api.binance.com/api/v3/avgPrice?symbol='
DELIM='='
TO=EUR
# COIN=VALUE
WALLET="${XDG_CONFIG_HOME-"$HOME"/.config}/crypto/wallet"
TOTAL=0
while read -r line; do
COIN="$(echo "$line" | cut -d "$DELIM" -f 1)"
QTY="$(echo "$line" | cut -d "$DELIM" -f 2)"
MARKET="$(get_value "$TO" "$COIN")"
VALUE="$(echo "$MARKET * $QTY" | bc)"
TOTAL="$(echo "$TOTAL + $VALUE" | bc)"
printf "${BOLD}${COIN}${NORMAL}=%.2f€ " "$VALUE"
done < "$WALLET"
printf "${BOLD}TOT${NORMAL}=%.2f€\n" "$TOTAL"

View file

@ -3,7 +3,7 @@
function usage() {
cat << EOF
Usage: $0 [-hcCviIna]
Prune Docker resources.
Prune $RUNTIME resources.
If no option provided, defaults to -Cvn
Options:
-h Show this help and exits
@ -30,7 +30,9 @@ function add_opt() {
echo "$RESULT"
}
if ! [ -w '/var/run/docker.sock' ] && [ "$EUID" != 0 ]; then
RUNTIME="$(basename "$(command -v podman || command -v docker)")"
if ! $RUNTIME container ls > /dev/null 2>&1 && [ "$EUID" != 0 ]; then
exec sudo -- "$0" "$@"
fi
@ -95,15 +97,15 @@ VALUES=(
CON='container'
PRUNE='prune -f'
COMMANDS=(
"docker system $PRUNE $IMG_OPT --volumes"
"docker system $PRUNE $IMG_OPT"
"docker volume $PRUNE"
"docker image $PRUNE $IMG_OPT"
"docker network $PRUNE"
"$RUNTIME system $PRUNE $IMG_OPT --volumes"
"$RUNTIME system $PRUNE $IMG_OPT"
"$RUNTIME volume $PRUNE"
"$RUNTIME image $PRUNE $IMG_OPT"
"$RUNTIME network $PRUNE"
)
if [ "$((CLEAN & "$c"))" == "$c" ]; then
docker "$CON" ls -aq | xargs docker "$CON" rm "$CON_OPT" 2> /dev/null
$RUNTIME "$CON" ls -aq | xargs "$RUNTIME" "$CON" rm "$CON_OPT" 2> /dev/null
fi
for idx in "${!VALUES[@]}"; do

Binary file not shown.

View file

@ -1,3 +0,0 @@
#!/bin/bash
$HOME/Applications/Moonlight-4.3.1-x86_64.AppImage

View file

@ -17,8 +17,8 @@ update_memory() {
}
update_bat() {
bat="$(grep -q Charging /sys/class/power_supply/BAT1/status && printf '' || printf '')"
bat="$bat $(cat /sys/class/power_supply/BAT1/capacity)%"
bat="$(grep -q Charging /sys/class/power_supply/BAT0/status && printf '' || printf '')"
bat="$bat $(cat /sys/class/power_supply/BAT0/capacity)%"
}
update_vol() {

View file

@ -1,4 +0,0 @@
#!/bin/bash
systemctl is-active libvirtd | grep -q inactive && pkexec systemctl start libvirtd
/usr/bin/virt-manager