From 8e03d0f7d03c9cc51e168fa44c72360b07b8b379 Mon Sep 17 00:00:00 2001 From: q3aql Date: Mon, 4 Aug 2025 07:57:14 +0200 Subject: [PATCH] .config/nwg-wrapper/scripts --- .config/nwg-wrapper/scripts/checkUpdates.sh | 19 ++++++------------- .config/nwg-wrapper/scripts/cpu_info.sh | 12 ++++++------ .config/nwg-wrapper/scripts/current_date.sh | 2 +- .config/nwg-wrapper/scripts/disk_info.sh | 3 +-- .config/nwg-wrapper/scripts/get_volume.sh | 2 +- .config/nwg-wrapper/scripts/kernel_version.sh | 2 +- .config/nwg-wrapper/scripts/mem_info.sh | 6 ++++-- .config/nwg-wrapper/scripts/mem_info_old.sh | 4 ---- 8 files changed, 20 insertions(+), 30 deletions(-) delete mode 100755 .config/nwg-wrapper/scripts/mem_info_old.sh diff --git a/.config/nwg-wrapper/scripts/checkUpdates.sh b/.config/nwg-wrapper/scripts/checkUpdates.sh index eb792f0..057a6a5 100755 --- a/.config/nwg-wrapper/scripts/checkUpdates.sh +++ b/.config/nwg-wrapper/scripts/checkUpdates.sh @@ -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 diff --git a/.config/nwg-wrapper/scripts/cpu_info.sh b/.config/nwg-wrapper/scripts/cpu_info.sh index 84f7499..56c72b7 100755 --- a/.config/nwg-wrapper/scripts/cpu_info.sh +++ b/.config/nwg-wrapper/scripts/cpu_info.sh @@ -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 diff --git a/.config/nwg-wrapper/scripts/current_date.sh b/.config/nwg-wrapper/scripts/current_date.sh index 7925dd5..224de78 100755 --- a/.config/nwg-wrapper/scripts/current_date.sh +++ b/.config/nwg-wrapper/scripts/current_date.sh @@ -1,4 +1,4 @@ #!/bin/bash current_date=$(date "+%d/%m/%Y %H:%M") -echo "${current_date} " +echo " ${current_date} " diff --git a/.config/nwg-wrapper/scripts/disk_info.sh b/.config/nwg-wrapper/scripts/disk_info.sh index 18d3c4e..da3f2b2 100755 --- a/.config/nwg-wrapper/scripts/disk_info.sh +++ b/.config/nwg-wrapper/scripts/disk_info.sh @@ -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) }' diff --git a/.config/nwg-wrapper/scripts/get_volume.sh b/.config/nwg-wrapper/scripts/get_volume.sh index b661db0..a501178 100755 --- a/.config/nwg-wrapper/scripts/get_volume.sh +++ b/.config/nwg-wrapper/scripts/get_volume.sh @@ -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}% " diff --git a/.config/nwg-wrapper/scripts/kernel_version.sh b/.config/nwg-wrapper/scripts/kernel_version.sh index 605c986..8483f29 100755 --- a/.config/nwg-wrapper/scripts/kernel_version.sh +++ b/.config/nwg-wrapper/scripts/kernel_version.sh @@ -30,5 +30,5 @@ kernelVersion=${kernelVersion}${kernelVersionTempDot} #kernelVersion=${kernelVersion}-${archCommand} kernelVersion=${kernelVersion} #echo "Kernel: Linux ${kernelVersion} " -echo "Linux ${kernelVersion} " +echo " ${kernelVersion} " diff --git a/.config/nwg-wrapper/scripts/mem_info.sh b/.config/nwg-wrapper/scripts/mem_info.sh index ff29bc7..ac8c2ad 100755 --- a/.config/nwg-wrapper/scripts/mem_info.sh +++ b/.config/nwg-wrapper/scripts/mem_info.sh @@ -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 " " diff --git a/.config/nwg-wrapper/scripts/mem_info_old.sh b/.config/nwg-wrapper/scripts/mem_info_old.sh deleted file mode 100755 index 3e741a8..0000000 --- a/.config/nwg-wrapper/scripts/mem_info_old.sh +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/bash - -mem_info=$(free -h | awk '/Mem:/ { printf(" %5s/%s \n", $3, $2) }') -echo ${mem_info}