various changes

This commit is contained in:
2020-07-17 15:05:59 +02:00
parent f60abea7c7
commit 0c574196f3
16 changed files with 63 additions and 37 deletions

View File

@ -7,6 +7,6 @@ case $BLOCK_BUTTON in
- % is of single core." ;;
esac
temp=$(sensors | awk '/Package id 0/ {print "🌡 "$4}' | sed 's/\.[0-9]//; s/+//')
temp=$(sensors | awk '/Package id 0/ {print "🌡"$4}' | sed 's/\.[0-9]//; s/+//')
[ -n "$temp" ] && echo $temp > /tmp/cpu_temp
cat /tmp/cpu_temp

View File

@ -1,2 +1,2 @@
#!/bin/bash
echo ☀ $(bc <<< "scale=0; $(cat /sys/class/backlight/intel_backlight/brightness) /9.37")%
echo ☀$(bc <<< "scale=0; $(cat /sys/class/backlight/intel_backlight/brightness) /9.37")%

View File

@ -1,3 +1,3 @@
#!/bin/bash
num=$(find ~/.local/share/mail/*/INBOX/new -type f | wc -l)
[ $num != 0 ] && echo "📬 "$num
[ $num != 0 ] && echo "📬"$num

View File

@ -4,6 +4,6 @@ if [ $( mpc status | grep '\[paused\]' | wc -l ) -eq 1 ]; then
fi
if [ $( mpc status | grep '\[playing\]' | wc -l ) -eq 1 ]; then
#echo $(mpc status | sed "/^volume:/d" | tac | sed -e "s/\\[paused\\].*//g;s/\\[playing\\].*//g" | tr -d '\n' | sed -e "s/$/ /g")
echo $(mpc status | sed "/^volume:/d" | tac | sed -e "s/\\[paused\\].*//g;s/\\[playing\\].*//g" | tr -d '\n' | sed -e "s/$/ /g")
exit
fi

View File

@ -27,8 +27,14 @@ lasttime=${XDG_CACHE_HOME:-$HOME/.cache}/nettraf_time
rx=$(update /sys/class/net/[ew]*/statistics/rx_bytes)
tx=$(update /sys/class/net/[ew]*/statistics/tx_bytes)
timedifference=$(( "$(date +'%s')" - "$previoustime" ))
rx_avg=$(( "$rx" / "$timedifference" ))
tx_avg=$(( "$tx" / "$timedifference" ))
if [ -n "$timedifference" ]; then
rx_avg=$(( "$rx" / "$timedifference" ))
tx_avg=$(( "$rx" / "$timedifference" ))
else
rx_avg=rx_bytes
tx_avg=tx_bytes
fi
#only print if any traffic at all
if [ "$rx_avg" -gt 0 ] || [ "$tx_avg" -gt 0 ]

View File

@ -1,3 +1,4 @@
#!/bin/bash
newsboat -x reload
num=$( cat /tmp/newsupdate 2>/dev/null || echo "$(newsboat -x print-unread | awk '{ print $1}' | sed s/^0$//g)$(cat ~/.config/newsboat/.update 2>/dev/null)")
[ "$num" = "" ] || echo 📰$num

View File

@ -1,18 +1,9 @@
#!/bin/sh
# i3blocks module for pacman upgrades.
# Displays number of upgradeable packages.
# For this to work, have a `pacman -Sy` command run in the background as a
# cronjob every so often as root. This script will then read those packages.
# When clicked, it will run an upgrade via pacman.
case $BLOCK_BUTTON in
1) $TERMINAL -e popupgrade ;;
2) notify-send "$(/usr/bin/pacman -Qu)" ;;
3) pgrep -x dunst >/dev/null && notify-send "Upgrade module" "📦: number of upgradable packages
- Left click to upgrade packages
- Middle click to show upgradable packages" ;;
esac
pacman -Qu | grep -v "\[ignored\]" | wc -l | sed -e "s/^0$//g"
no="$( pacman -Qu | grep -Fcv "[ignored]" )"
echo "$no" | sed "s/^/📦/;s/^📦0$//g"

View File

@ -2,7 +2,7 @@
printf "Beginning upgrade.\\n"
yay -Syu
yay -Qyu
pkill -RTMIN+8 i3blocks
printf "\\nUpgrade complete.\\nPress <Enter> to exit window.\\n\\n"

View File

@ -45,4 +45,4 @@ else
icon="🔉"
fi
printf "%s %s%%\\n" "$icon" "$vol"
printf "%s%s%%\\n" "$icon" "$vol"