aboutsummaryrefslogtreecommitdiff
path: root/i3blocks
diff options
context:
space:
mode:
authorInigoGutierrez <inigogf.95@gmail.com>2018-12-24 21:06:34 +0100
committerInigoGutierrez <inigogf.95@gmail.com>2018-12-24 21:06:34 +0100
commit4027bc1a53023317819b2ee5584664d3a5264b17 (patch)
treeca5eb2ff71c6d2c42e7c155a56c3832e06d9b6ad /i3blocks
parente7c90508e77a061850833276f6eb3f00b4973c54 (diff)
downloadscripts-4027bc1a53023317819b2ee5584664d3a5264b17.tar.gz
scripts-4027bc1a53023317819b2ee5584664d3a5264b17.zip
Created i3cpu.sh and i3mem.sh
Diffstat (limited to 'i3blocks')
-rwxr-xr-xi3blocks/i3cpu.sh24
-rwxr-xr-xi3blocks/i3mem.sh8
2 files changed, 32 insertions, 0 deletions
diff --git a/i3blocks/i3cpu.sh b/i3blocks/i3cpu.sh
new file mode 100755
index 0000000..a68130e
--- /dev/null
+++ b/i3blocks/i3cpu.sh
@@ -0,0 +1,24 @@
+#!/bin/sh
+
+case $BLOCK_BUTTON in
+ 1) notify-send -t 5000 "Highest CPU processes:
+$(ps axch -o cmd:18,%cpu --sort=-%cpu | sed 10q)" ;;
+esac
+
+temp=$(sensors | awk '/temp1:/ {print $2}' | sed 's/+//' | sed 's/\..*//')
+warn=""
+
+if [ "$temp" -lt 25 ]; then
+ color="#696eff"
+elif [ "$temp" -lt 45 ]; then
+ color="#1fffaf"
+elif [ "$temp" -lt 65 ]; then
+ color="#b8bb26"
+ warn=❗
+else
+ color="#d1375d"
+ warn=❗❗
+fi
+
+printf "<span color='%s'>%s%s</span>" "$color" "$temp" "$warn"
+echo ""
diff --git a/i3blocks/i3mem.sh b/i3blocks/i3mem.sh
new file mode 100755
index 0000000..31f12c5
--- /dev/null
+++ b/i3blocks/i3mem.sh
@@ -0,0 +1,8 @@
+#!/bin/sh
+
+case $BLOCK_BUTTON in
+ 1) notify-send -t 5000 "Highest RAM processes:
+$(ps axch -o cmd:18,%mem --sort=-%mem | sed 10q)" ;;
+esac
+
+free -h | awk '/^Mem/ {print $3 "/" $2}'