summaryrefslogtreecommitdiff
path: root/.scripts
diff options
context:
space:
mode:
author0scar <qgt268@alumni.ku.dk>2020-12-29 10:28:00 +0000
committer0scar <qgt268@alumni.ku.dk>2020-12-29 10:28:00 +0000
commitbcea7bd164355687638cca6f30b19cd318d08762 (patch)
tree22b8c06827ee43b2b88c55e7464a9a4a448f4023 /.scripts
parentafa225e8322c2a53ef755d2f2d02241c36d5111f (diff)
Update info urgency + memory notification
Diffstat (limited to '.scripts')
-rwxr-xr-x.scripts/batinfo2
-rwxr-xr-x.scripts/cpuinfo22
-rwxr-xr-x.scripts/meminfo10
-rwxr-xr-x.scripts/netinfo2
4 files changed, 34 insertions, 2 deletions
diff --git a/.scripts/batinfo b/.scripts/batinfo
index 87676ac..1719181 100755
--- a/.scripts/batinfo
+++ b/.scripts/batinfo
@@ -5,7 +5,7 @@ set -e
status="$(acpi -abi)" # get battery and adapter info
case $BLOCK_BUTTON in
- 3) notify-send "Battery status" "$status" ;;
+ 1) notify-send -t $((15 * 1000)) --urgency=low "Battery status" "$status" ;;
4) brightnessctl -q s 10%+ ;;
5) brightnessctl -q s 10%- ;;
esac
diff --git a/.scripts/cpuinfo b/.scripts/cpuinfo
index 8db8456..f46121b 100755
--- a/.scripts/cpuinfo
+++ b/.scripts/cpuinfo
@@ -1,6 +1,28 @@
#!/usr/bin/env sh
set -e
+case $BLOCK_BUTTON in
+ 1) notify-send --urgency=low \
+ "Process status" \
+ "$(ps -eo pid,pcpu,size,comm \
+ | sort -rnk 3 \
+ | awk '{printf "% 8s% 8s% 8s ", $1, $2, $3;
+ $1="";$2="";$3="";
+ print $0; c++}
+ c>10 {exit}')"
+ ;;
+ 3) notify-send --urgency=low \
+ "Process status" \
+ "$(ps -eo pid,pcpu,size,cmd \
+ | sort -rnk 3 \
+ | cut -b -45 \
+ | awk '{printf "% 8s% 8s% 8s ", $1, $2, $3;
+ $1="";$2="";$3="";
+ print $0; c++}
+ c>10 {exit}')"
+ ;;
+esac
+
# Load
sed -Ee 's/^([0-9]+\.[0-9]+) .*/[\1  /g' /proc/loadavg | tr -d '\n'
diff --git a/.scripts/meminfo b/.scripts/meminfo
index 3df9b73..2b31b97 100755
--- a/.scripts/meminfo
+++ b/.scripts/meminfo
@@ -1,3 +1,13 @@
#!/usr/bin/env sh
set -e
+
+case $BLOCK_BUTTON in
+ 1) notify-send --urgency=low \
+ "Memory status" \
+ "$(free -h | \
+ awk '/total/ {printf "%15s%10s%10s\n", $1, $2, $3}
+ /Mem|Swap/{printf "%-5s%10s%10s%10s\n", $1, $2, $3, $4}')"
+ ;;
+esac
+
free -h | awk '/Mem/{print "[" $3 " RAM " $2 "]" }'
diff --git a/.scripts/netinfo b/.scripts/netinfo
index 48789da..ceb79f7 100755
--- a/.scripts/netinfo
+++ b/.scripts/netinfo
@@ -20,7 +20,7 @@ function add_connected_address() {
}
case $BLOCK_BUTTON in
- 3) notify-send "Internet connection" "$(add_connected_address)" ;;
+ 1) notify-send --urgency=low "Internet connection" "$(add_connected_address)" ;;
esac
#echo "$(echo -e "$netstatus" | sed -En '/up$/p')"