.config/nwg-wrapper/scripts

This commit is contained in:
q3aql 2025-08-04 07:57:14 +02:00
parent 31933d9315
commit 8e03d0f7d0
8 changed files with 20 additions and 30 deletions

View File

@ -1,22 +1,15 @@
#!/bin/bash
# Check updates on Arch Linux
# Note: Create cron on /etc/cron.d/checkupdates with the following lines:
# 0 * * * * root /usr/bin/pacman -Sy
# 30 * * * * root /usr/bin/pacman -Sy
if [ -f /usr/bin/pacman ] ; then
num_packages=$(pacman -Qu | wc -l)
echo "${num_packages}"
echo "${num_packages} "
# Check updates on Ubuntu/Debian/Devuan
# Note: Create cron on /etc/cron.d/checkupdates with the following lines:
# 0 * * * * root /usr/bin/aptitude update
# 30 * * * * root /usr/bin/aptitude update
elif [ -f /usr/bin/aptitude ] ; then
num_packages=$(aptitude search "~U" | wc -l)
echo "${num_packages}"
elif [ -f /usr/bin/apt ] ; then
num_packages=$(apt list --upgradable 2>/dev/null | grep -c ^)
num_packages=$(expr ${num_packages} - 1)
echo "${num_packages} "
# Disable for other distros
else
echo "0"
echo " 0 "
fi

View File

@ -4,17 +4,17 @@ check_sensor=$(sensors | grep "Tdie:" 2> /dev/null)
if [ -z "${check_sensor}" ] ; then
check_sensor=$(sensors | grep "Tctl:" 2> /dev/null)
if [ -z "${check_sensor}" ] ; then
CPU_USAGE=$(~/.config/nwg-wrapper/scripts/cpu_load.sh -p)
echo "$CPU_USAGE" | awk '{printf("%6s \n"), $1, $2}' | tr -s " "
CPU_USAGE=$(~/.config/sway/scripts/cpu_load.sh -p)
echo "$CPU_USAGE" | awk '{ printf("%6s \n"), $1, $2 }'
else
TEMP=$(sensors | grep 'Package id 0:\|Tctl' | grep ':[ ]*+[0-9]*.[0-9]*°C' -o | grep '+[0-9]*.[0-9]*°C' -o)
#CPU_USAGE=$(mpstat 1 1 | awk '/Average:/ {printf("%s\n", $(NF-9))}')
CPU_USAGE=$(~/.config/nwg-wrapper/scripts/cpu_load.sh -p)
echo "$CPU_USAGE $TEMP" | awk '{printf("%6s @ %s \n"), $1, $2}' | tr -s " "
CPU_USAGE=$(~/.config/sway/scripts/cpu_load.sh -p)
echo "$CPU_USAGE $TEMP" | awk '{ printf("%6s @ %s \n"), $1, $2 }'
fi
else
TEMP=$(sensors | grep 'Package id 0:\|Tdie' | grep ':[ ]*+[0-9]*.[0-9]*°C' -o | grep '+[0-9]*.[0-9]*°C' -o)
#CPU_USAGE=$(mpstat 1 1 | awk '/Average:/ {printf("%s\n", $(NF-9))}')
CPU_USAGE=$(~/.config/nwg-wrapper/scripts/cpu_load.sh -p)
echo "$CPU_USAGE $TEMP" | awk '{printf("%6s @ %s \n"), $1, $2}' | tr -s " "
CPU_USAGE=$(~/.config/sway/scripts/cpu_load.sh -p)
echo "$CPU_USAGE $TEMP" | awk '{ printf("%6s @ %s \n"), $1, $2 }'
fi

View File

@ -1,4 +1,4 @@
#!/bin/bash
current_date=$(date "+%d/%m/%Y %H:%M")
echo "${current_date} "
echo "${current_date} "

View File

@ -1,4 +1,3 @@
#!/bin/bash
disk_info=$(df -h / | awk '/\//{ printf("%4s/%s \n", $4, $2) }')
echo ${disk_info}
df -h / | awk '/\//{ printf(" %4s / %s \n", $4, $2) }'

View File

@ -1,4 +1,4 @@
#!/bin/bash
get_volume=$(amixer | grep "%" | head -1 | cut -d "%" -f 1 | cut -d "[" -f 2)
echo "${get_volume}% "
echo "${get_volume}% "

View File

@ -30,5 +30,5 @@ kernelVersion=${kernelVersion}${kernelVersionTempDot}
#kernelVersion=${kernelVersion}-${archCommand}
kernelVersion=${kernelVersion}
#echo "Kernel: Linux ${kernelVersion} "
echo "Linux ${kernelVersion} "
echo " ${kernelVersion} "

View File

@ -1,6 +1,6 @@
#!/bin/bash
# Configuration variables
# Configuration variable
python_bin="/usr/bin/python3"
memfile="/proc/meminfo"
size="G" # Change to M for MiB
@ -40,6 +40,8 @@ else
showMemActive="${memActiveG}Gi"
fi
echo -n " "
memshowactive=$(echo ${showMemActive})
memshowtotal=$(echo ${showMemTotal})
echo ${memshowactive}/${memshowtotal}
echo -n ${memshowactive}/${memshowtotal}
echo " "

View File

@ -1,4 +0,0 @@
#!/bin/bash
mem_info=$(free -h | awk '/Mem:/ { printf(" %5s/%s \n", $3, $2) }')
echo ${mem_info}