aboutsummaryrefslogtreecommitdiff
path: root/stuff/scripts/system/stbar
diff options
context:
space:
mode:
authoriceyrazor <iceyfoxservers@gmail.com>2024-11-24 04:50:59 -0600
committericeyrazor <iceyfoxservers@gmail.com>2024-11-24 04:50:59 -0600
commit0b274c969e824b4bcf328e3272b8894143f3a683 (patch)
tree3b4860beb1c10f68a06d84453ac55b52f327b641 /stuff/scripts/system/stbar
reinit 3. git reset --hard was not right. thanks ai
Diffstat (limited to 'stuff/scripts/system/stbar')
-rw-r--r--stuff/scripts/system/stbar/config.txt2
-rwxr-xr-xstuff/scripts/system/stbar/killbar.sh10
-rwxr-xr-xstuff/scripts/system/stbar/stbar-awesome.sh81
-rwxr-xr-xstuff/scripts/system/stbar/stbar.sh84
-rwxr-xr-xstuff/scripts/system/stbar/weth_str.txt0
5 files changed, 177 insertions, 0 deletions
diff --git a/stuff/scripts/system/stbar/config.txt b/stuff/scripts/system/stbar/config.txt
new file mode 100644
index 0000000..3137407
--- /dev/null
+++ b/stuff/scripts/system/stbar/config.txt
@@ -0,0 +1,2 @@
+full_stat:false
+wifi_device:wlo1
diff --git a/stuff/scripts/system/stbar/killbar.sh b/stuff/scripts/system/stbar/killbar.sh
new file mode 100755
index 0000000..7e76af2
--- /dev/null
+++ b/stuff/scripts/system/stbar/killbar.sh
@@ -0,0 +1,10 @@
+pids=$(ps -AO pid | awk '/stbar.sh|newsboat-fetch.sh/ {print $1}')
+# pids=$(pstree -pla | grep stbar | sed 's,|,,g' | sed 's/ //g' | sed 's/^ //g' | sed 's/ .*//' | sed 's/[^0-9]*//g')
+# pids2=$(ps -AO pid | grep "sh ./newsboat-fetch.sh" | sed 's/S.*//g' | sed 's/^ *//g')
+
+
+echo $pids
+$(sleep 3 && xsetroot -name "") & disown
+
+sudo kill -KILL $pids
+doas kill -KILL $pids
diff --git a/stuff/scripts/system/stbar/stbar-awesome.sh b/stuff/scripts/system/stbar/stbar-awesome.sh
new file mode 100755
index 0000000..84c1894
--- /dev/null
+++ b/stuff/scripts/system/stbar/stbar-awesome.sh
@@ -0,0 +1,81 @@
+#!/bin/bash
+delim='|'
+
+curr_dir="$(cd "$(dirname "$0")" && pwd)"
+#wifi_device=$(cat $curr_dir/config.txt | grep wifi_device | sed 's/wifi_device://')
+wifi_device="wlp4s0"
+# curr_dir/check_weth.sh "$cur_dir" &
+
+
+
+status(){
+
+echo " "
+
+#wifi up or no
+sed "s/down/\:\(/;s/up/\:\)/" /sys/class/net/$wifi_device/operstate
+
+echo "$delim"
+
+if [ "$(ls /sys/class/power_supply/BAT0/)" ]; then
+ bat_power=$(cat /sys/class/power_supply/BAT0/capacity)
+
+ echo $bat_is_flash
+ if (( $bat_power < 15 )); then
+ bat_power=$bat_power%!!!!!!!!!!!
+ else
+ bat_power=$bat_power%
+ fi
+
+ echo $bat_power
+
+ echo "$delim"
+fi
+
+#rss
+
+echo RSS:$(newsboat -x print-unread|sed "s/\s.*//; s/Error:/IA/")
+
+echo "$delim"
+
+if [ "$(cat $curr_dir/config.txt | grep full_stat)" == "full_stat:true" ]; then
+ #cpu
+ echo CPU:$(ps axch -o cmd:15,%cpu --sort=-%cpu | sed "1q")%
+
+ echo "$delim"
+
+ #mem
+ echo Mem:$(free -mlw | grep Mem: | sed "s/Mem\:\W*[0-9]*\W*//; s/ .*//")
+ echo $(ps axch -o cmd:15,%mem --sort=-%mem | sed "1q")%
+
+else
+ #cpu
+ echo CPU:$(ps axch -o cmd:15,%cpu --sort=-%cpu | sed "1q" | sed 's/.* //')%
+
+ #mem
+ echo Mem:$(free -mlw | grep Mem: | sed "s/Mem\:\W*[0-9]*\W*//; s/ .*//")
+
+fi
+echo "$delim"
+
+#space
+#echo \/$(df -h | grep /dev/nvme0n1p3 | sed "s/\/dev\/nvme0n1p3 *[0-9]*.[0-9]*. *[0-9]*.[0-9]*. *//" | sed "s/ .*//")
+
+#echo \~$(df -h | grep /dev/nvme0n1p4 | sed "s/\/dev\/nvme0n1p4 *[0-9]*.[0-9]*. *[0-9]*.[0-9]*. *//" | sed "s/ .*//")
+echo $(df -h -x=used /dev/mapper/system-root | sed '1d' | awk '{print $4}')
+
+echo "$delim"
+
+#weather
+
+if [ "$(cat $curr_dir/weth_str.txt)" != "" ]; then
+ printf "$(cat $curr_dir/weth_str.txt)"
+ echo "$delim"
+fi
+
+}
+
+#while :; do
+ echo "$(status | tr '\n' ' '0)"
+# sleep 1s
+#end
diff --git a/stuff/scripts/system/stbar/stbar.sh b/stuff/scripts/system/stbar/stbar.sh
new file mode 100755
index 0000000..6ca704d
--- /dev/null
+++ b/stuff/scripts/system/stbar/stbar.sh
@@ -0,0 +1,84 @@
+#!/bin/bash
+delim='|'
+
+curr_dir="$(cd "$(dirname "$0")" && pwd)"
+wifi_device=$(cat $curr_dir/config.txt | grep wifi_device | sed 's/wifi_device://')
+# curr_dir/check_weth.sh "$cur_dir" &
+
+
+
+status(){
+
+echo " "
+
+#wifi up or no
+sed "s/down/\:\(/;s/up/\:\)/" /sys/class/net/$wifi_device/operstate
+
+echo "$delim"
+
+#bat
+bat_power=$(cat /sys/class/power_supply/BAT0/capacity)
+
+echo $bat_is_flash
+if (( $bat_power < 15 )); then
+ bat_power=$bat_power%!!!!!!!!!!!
+else
+ bat_power=$bat_power%
+fi
+
+echo $bat_power
+
+echo "$delim"
+
+#rss
+
+echo RSS:$(newsboat -x print-unread|sed "s/\s.*//; s/Error:/IA/")
+
+echo "$delim"
+
+if [ "$(cat $curr_dir/config.txt | grep full_stat)" == "full_stat:true" ]; then
+ #cpu
+ echo CPU:$(ps axch -o cmd:15,%cpu --sort=-%cpu | sed "1q")%
+
+ echo "$delim"
+
+ #mem
+ echo Mem:$(free -mlw | grep Mem: | sed "s/Mem\:\W*[0-9]*\W*//; s/ .*//")
+ echo $(ps axch -o cmd:15,%mem --sort=-%mem | sed "1q")%
+
+else
+ #cpu
+ echo CPU:$(ps axch -o cmd:15,%cpu --sort=-%cpu | sed "1q" | sed 's/.* //')%
+
+ #mem
+ echo Mem:$(free -mlw | grep Mem: | sed "s/Mem\:\W*[0-9]*\W*//; s/ .*//")
+
+fi
+echo "$delim"
+
+#space
+echo \/$(df -h | grep /dev/nvme0n1p3 | sed "s/\/dev\/nvme0n1p3 *[0-9]*.[0-9]*. *[0-9]*.[0-9]*. *//" | sed "s/ .*//")
+
+echo \~$(df -h | grep /dev/nvme0n1p4 | sed "s/\/dev\/nvme0n1p4 *[0-9]*.[0-9]*. *[0-9]*.[0-9]*. *//" | sed "s/ .*//")
+
+echo "$delim"
+
+#weather
+
+if [ "$(cat $curr_dir/weth_str.txt)" != "" ]; then
+ printf "$(cat $curr_dir/weth_str.txt)"
+ echo "$delim"
+fi
+
+
+#date
+date '+%a %m/%d/%Y %I:%M%p'
+
+}
+
+
+while :; do
+ xsetroot -name "$(status | tr '\n' ' '0)"
+ sleep 1s
+done
+
diff --git a/stuff/scripts/system/stbar/weth_str.txt b/stuff/scripts/system/stbar/weth_str.txt
new file mode 100755
index 0000000..e69de29
--- /dev/null
+++ b/stuff/scripts/system/stbar/weth_str.txt