summaryrefslogtreecommitdiff
path: root/.scripts
diff options
context:
space:
mode:
Diffstat (limited to '.scripts')
-rwxr-xr-x.scripts/batinfo33
-rwxr-xr-x.scripts/checkupdates15
-rwxr-xr-x.scripts/cpuinfo30
-rwxr-xr-x.scripts/meminfo13
-rwxr-xr-x.scripts/netinfo34
5 files changed, 0 insertions, 125 deletions
diff --git a/.scripts/batinfo b/.scripts/batinfo
deleted file mode 100755
index 1719181..0000000
--- a/.scripts/batinfo
+++ /dev/null
@@ -1,33 +0,0 @@
-#!/usr/bin/env sh
-
-set -e
-
-status="$(acpi -abi)" # get battery and adapter info
-
-case $BLOCK_BUTTON in
- 1) notify-send -t $((15 * 1000)) --urgency=low "Battery status" "$status" ;;
- 4) brightnessctl -q s 10%+ ;;
- 5) brightnessctl -q s 10%- ;;
-esac
-
-power=$(echo "${status}" | awk '/Battery [0-9]+: [A-Z]/{s+=$4;c++}; END{printf "%.1f%%", s/c}')
-
-icon='?'
-if [[ -z $(echo $status | sed -n '/on-line/p') ]]; then
- case "${power%.*}" in
- 100 | 9[0-9]) icon='\uf578' ;;
- 8[0-9]) icon='\uf581';;
- 7[0-9]) icon='\uf580';;
- 6[0-9]) icon='\uf57f';;
- 5[0-9]) icon='\uf57e';;
- 4[0-9]) icon='\uf57d';;
- 3[0-9]) icon='\uf57c';;
- 2[0-9]) icon='\uf57b';;
- 1[0-9]) icon='\uf57a';;
- [0-9]) icon='\uf579';;
- esac
-else
- icon='\uf583'
-fi
-
-echo -e "$icon $power"
diff --git a/.scripts/checkupdates b/.scripts/checkupdates
deleted file mode 100755
index 5a95974..0000000
--- a/.scripts/checkupdates
+++ /dev/null
@@ -1,15 +0,0 @@
-#!/usr/bin/env sh
-set -e
-
-updates=$(pacman -Qu | sed '/\[ignored\]$/d')
-
-case $BLOCK_BUTTON in
- 1) ;& # fallthrough
- 3) if [ -n "${updates}" ]; then
- notify-send -t $((1000 * 20)) "Available updates" "$updates"
- else
- notify-send "Available updates" "No available updates"
- fi;;
-esac
-
-[ -n "$updates" ] && echo $(echo "${updates}" | wc -l) || exit 0
diff --git a/.scripts/cpuinfo b/.scripts/cpuinfo
deleted file mode 100755
index f46121b..0000000
--- a/.scripts/cpuinfo
+++ /dev/null
@@ -1,30 +0,0 @@
-#!/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'
-
-# Thermals
-awk '{s+=$1}END{printf "%.1f°]", s / (1000*NR)}' /sys/class/thermal/thermal_zone*/temp
diff --git a/.scripts/meminfo b/.scripts/meminfo
deleted file mode 100755
index 2b31b97..0000000
--- a/.scripts/meminfo
+++ /dev/null
@@ -1,13 +0,0 @@
-#!/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
deleted file mode 100755
index ceb79f7..0000000
--- a/.scripts/netinfo
+++ /dev/null
@@ -1,34 +0,0 @@
-#!/usr/bin/env sh
-
-netstatus="$(awk '{
- n = split(FILENAME, a, "/")
- printf("%-15s %s\n", a[n-1], $1)
- }' /sys/class/net/[ew]*/operstate | sort -k 2)"
-
-function add_connected_address() {
- TMPIFS=$IFS
- IFS='
-'
- for line in $netstatus; do
- device=$(echo $line | awk '{print $1}')
- address=$(ip addr show $device | sed -En 's/inet ([0-9\.]+).*/\1/p')
- # Append Wifi AP if connected
- [ -n "$address" ] && address=$address" ("$(iwgetid -r)")"
- echo $line $address
- done
- IFS=$TMPIFS
-}
-
-case $BLOCK_BUTTON in
- 1) notify-send --urgency=low "Internet connection" "$(add_connected_address)" ;;
-esac
-
-#echo "$(echo -e "$netstatus" | sed -En '/up$/p')"
-#echo ======
-
-if [ -z "$(echo -e "${netstatus}" | sed -En '/up$/p' | tr -d '\n')" ]; then
- echo -n ''
-else
- echo -n "${netstatus}" | sed -En 's/^(w[^ ]+).*up//p;s/^(e[^ ]+).*up//p'
-fi
-