diff options
| author | jstmax! <maxwasmailed@proton.me> | 2025-11-12 19:28:17 +0100 |
|---|---|---|
| committer | jstmax! <maxwasmailed@proton.me> | 2025-11-12 19:28:17 +0100 |
| commit | c0aeec251c93a9bec58971e1718e7969b53c94ba (patch) | |
| tree | 7a558eb85f0536f77cc682ae994b33df70574236 /cfg/i3 | |
| parent | ddb7571613fa9beadf12f14999a7634a255291ad (diff) | |
updated kurobar script and added fetch pub. ip script to i3 folder
Diffstat (limited to 'cfg/i3')
| -rwxr-xr-x | cfg/i3/fetch_public_ip.sh | 6 | ||||
| -rw-r--r-- | cfg/i3/kurobar.sh | 10 |
2 files changed, 15 insertions, 1 deletions
diff --git a/cfg/i3/fetch_public_ip.sh b/cfg/i3/fetch_public_ip.sh new file mode 100755 index 0000000..e2d2819 --- /dev/null +++ b/cfg/i3/fetch_public_ip.sh @@ -0,0 +1,6 @@ +#!/usr/bin/env bash + +while true; do + curl -s ifconfig.me > ~/.config/i3/public_ip.txt + sleep 3600 +done & diff --git a/cfg/i3/kurobar.sh b/cfg/i3/kurobar.sh index b8b18a5..7018460 100644 --- a/cfg/i3/kurobar.sh +++ b/cfg/i3/kurobar.sh @@ -19,6 +19,14 @@ while true; do # outputs just the % from brightnessctl -m bright=$(brightnessctl -m | awk -F, '{print $4}') + # --- LAN ip --- + # 192.168.x.x + localip=$(hostname -i | grep -oE '192\.168\.[0-9]+\.[0-9]+') + + # --- public IP --- + # attached to the fetchpubip service and the .config/i3/fetch_public_ip.sh script + pubip=$(cat ~/.config/i3/public_ip.txt) + # --- cpu usage --- #cpu_idle1=$(awk '/^cpu / {print $5}' /proc/stat) #cpu_total1=$(awk '/^cpu / {total=0; for(i=2;i<=NF;i++) total+=$i; print total}' /proc/stat) @@ -30,7 +38,7 @@ while true; do dt=$(date '+%Y年%m月%d日 %H時%M分%S秒') # --- print bar line --- - echo "V.$volume% | B.$bat% | $mem_used/$mem_total GB | L.$bright | $dt" + echo "vol.$volume% | bat.$bat% | bri.$bright | lan.$localip | pub.$pubip | $mem_used/$mem_total gb | $dt" sleep 0.01 done |