diff --git a/dwm/.dwm/autostart.sh b/dwm/.dwm/autostart.sh index 2242894..c2ebc10 100755 --- a/dwm/.dwm/autostart.sh +++ b/dwm/.dwm/autostart.sh @@ -1,6 +1,6 @@ #!/bin/sh -# Start dwmblocks as statusbar -dwmblocks & +# Start statusbar script +statusbar & # Start dunst as notificationserver dunst & diff --git a/localbin/.local/bin/dwmscript/dwmbattery b/localbin/.local/bin/dwmscript/dwmbattery deleted file mode 100755 index b0591b0..0000000 --- a/localbin/.local/bin/dwmscript/dwmbattery +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/bash - -icon="" -#battery="$(acpi | awk -F '[, :]' '{ print $6 " ~" $8":"$9 }')" # with time remaning -battery="$(acpi | awk -F '[, :]' '{ print $6 }')" # without time - -printf " %s %s \\n" "$icon" "$battery" diff --git a/localbin/.local/bin/dwmscript/dwmcpu b/localbin/.local/bin/dwmscript/dwmcpu deleted file mode 100755 index 03c50eb..0000000 --- a/localbin/.local/bin/dwmscript/dwmcpu +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/bash - -read cpu a b c previdle rest < /proc/stat -prevtotal=$((a+b+c+previdle)) -sleep 0.5 -read cpu a b c idle rest < /proc/stat -total=$((a+b+c+idle)) -cpu=$((100*( (total-prevtotal) - (idle-previdle) ) / (total-prevtotal) )) -icon="" -printf " %s %s \\n" "$icon" "$cpu%" - diff --git a/localbin/.local/bin/dwmscript/dwmdisk b/localbin/.local/bin/dwmscript/dwmdisk deleted file mode 100755 index 11ae2eb..0000000 --- a/localbin/.local/bin/dwmscript/dwmdisk +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/bash - -icon="" -hdd1="$(df / | awk '/^\// { print $5 }')" -hdd2="$(df /home | awk '/^\// { print $5 }')" - -printf " %s / %s | %s /home %s \\n" "$icon" "$hdd1" "$icon" "$hdd2" - diff --git a/localbin/.local/bin/dwmscript/dwmmemory b/localbin/.local/bin/dwmscript/dwmmemory deleted file mode 100755 index f59f1b9..0000000 --- a/localbin/.local/bin/dwmscript/dwmmemory +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/bash - -icon="" -mem="$(free -h | awk '/^Mem/ { print $3"/"$2 }' | sed s/i//g)" - -printf " %s %s \\n" "$icon" "$mem" - diff --git a/localbin/.local/bin/dwmscript/dwmnetspeed b/localbin/.local/bin/dwmscript/dwmnetspeed deleted file mode 100755 index f3eaa65..0000000 --- a/localbin/.local/bin/dwmscript/dwmnetspeed +++ /dev/null @@ -1,18 +0,0 @@ -#!/bin/bash -icon="龍" -iface="enp4s0" -up="" -down="" - -R1="$(cat /sys/class/net/$iface/statistics/rx_bytes)" -T1="$(cat /sys/class/net/$iface/statistics/tx_bytes)" -sleep 1 -R2="$(cat /sys/class/net/$iface/statistics/rx_bytes)" -T2="$(cat /sys/class/net/$iface/statistics/tx_bytes)" -TBPS="$(expr $T2 - $T1)" -RBPS="$(expr $R2 - $R1)" -TKBPS="$(expr $TBPS / 1024)" -RKBPS="$(expr $RBPS / 1024)" - -printf " %s %s %skB/s %s %skB/s \\n" "$icon" "$up" "$TKBPS" "$down" "$RKBPS" -#echo "tx $iface: $TKBPS kB/s rx $iface: $RKBPS kB/s" diff --git a/localbin/.local/bin/dwmscript/dwmnetwork b/localbin/.local/bin/dwmscript/dwmnetwork deleted file mode 100755 index 3dc8eaf..0000000 --- a/localbin/.local/bin/dwmscript/dwmnetwork +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/bash - -icon="" -iface="enp4s0" - -IPADDR="$(ip a show dev $iface | awk '/inet / { print $2 } ')" - -printf " %s %s [%s] \n" "$icon" "$iface" "$IPADDR" -#echo "tx $iface: $TKBPS kB/s rx $iface: $RKBPS kB/s" diff --git a/localbin/.local/bin/dwmscript/makescreenshot b/localbin/.local/bin/makescreenshot similarity index 100% rename from localbin/.local/bin/dwmscript/makescreenshot rename to localbin/.local/bin/makescreenshot diff --git a/localbin/.local/bin/statusbar b/localbin/.local/bin/statusbar new file mode 100755 index 0000000..6dfc251 --- /dev/null +++ b/localbin/.local/bin/statusbar @@ -0,0 +1,75 @@ +#!/bin/bash + +interval=0 + +datetime() { + icon="" + time="$(date "+%a, %d %b %H:%M")" + printf "^b#408977^^c#eeeeee^ %s ^d^ %s" "$icon" "$time" +} + +battery() { + icon="" + battery="$(acpi | awk -F '[, :]' '{ print $6 }')" # without time + printf "^b#408977^^c#eeeeee^ %s ^d^ %s" "$icon" "$battery" +} + +cpu() { + icon="" + read cpu a b c previdle rest < /proc/stat + prevtotal=$((a+b+c+previdle)) + sleep 0.5 + read cpu a b c idle rest < /proc/stat + total=$((a+b+c+idle)) + cpu=$((100*( (total-prevtotal) - (idle-previdle) ) / (total-prevtotal) )) + printf "^b#408977^^c#eeeeee^ %s ^d^ %s" "$icon" "$cpu%" +} + +memory() { + icon="" + mem="$(free -h | awk '/^Mem/ { print $3"/"$2 }' | sed s/i//g)" + printf "^b#408977^^c#eeeeee^ %s ^d^ %s" "$icon" "$mem" +} + +disk() { + icon="" + root="$(df / | awk '/^\// { print $5 }')" + home="$(df /home | awk '/^\// { print $5 }')" + printf "^b#408977^^c#eeeeee^ %s ^d^ / %s | /home %s" "$icon" "$root" "$home" +} + +networkspeed() { + icon="龍" + iface="enp4s0" + up="" + down="" + R1="$(cat /sys/class/net/$iface/statistics/rx_bytes)" + T1="$(cat /sys/class/net/$iface/statistics/tx_bytes)" + sleep 1 + R2="$(cat /sys/class/net/$iface/statistics/rx_bytes)" + T2="$(cat /sys/class/net/$iface/statistics/tx_bytes)" + TBPS="$(expr $T2 - $T1)" + RBPS="$(expr $R2 - $R1)" + TKBPS="$(expr $TBPS / 1024)" + RKBPS="$(expr $RBPS / 1024)" + printf "^b#408977^^c#eeeeee^ %s ^d^ %s %skB/s %s %skB/s" "$icon" "$up" "$TKBPS" "$down" "$RKBPS" +} + +networkinfo() { + icon="" + iface="enp4s0" + IPADDR="$(ip a show dev $iface | awk '/inet / { print $2 } ')" + printf "^b#408977^^c#eeeeee^ %s ^d^ %s [%s]" "$icon" "$iface" "$IPADDR" +} + +song() { + icon="" + song=$(playerctl --player=spotify,mpd metadata title) + artist=$(playerctl --player=spotify,mpd metadata artist) + printf "^b#408977^^c#eeeeee^ %s ^d^ %s - %s" "$icon" "$artist" "$song" +} + +while true; do + xsetroot -name " $(cpu) $(memory) $(networkspeed) $(networkinfo) $(disk) $(song) $(datetime)" + sleep 5 +done \ No newline at end of file diff --git a/zsh/.zshrc b/zsh/.zshrc index 54ab727..5bf7405 100644 --- a/zsh/.zshrc +++ b/zsh/.zshrc @@ -2,7 +2,6 @@ if [[ $UID -ge 1000 && -d $HOME/.local/bin && -z $(echo $PATH | grep -o $HOME/.local/bin) ]] then export PATH="$HOME/.local/bin:${PATH}" - export PATH="$HOME/.local/bin/dwmscript:${PATH}" fi # start x -> starts dwm within .xinitrc