1
0
Fork 0
mirror of https://github.com/roles-ansible/ansible_role_i3wm.git synced 2024-08-16 10:09:53 +02:00

Prepare i3blocks

This commit is contained in:
L3D 2020-10-14 13:18:02 +02:00 committed by L3D
parent a7d7fc088e
commit 467d0062ad
No known key found for this signature in database
GPG key ID: 5215C3441797AB2B
2 changed files with 53 additions and 0 deletions

28
files/i3blocks/config Normal file
View file

@ -0,0 +1,28 @@
command=~/.config/i3blocks/$BLOCK_NAME
separator_block_width=15
markup=pango
[weather]
command=curl -Ss 'https://wttr.in?0&T&Q' | cut -c 16- | head -2 | xargs echo
interval=3600
color=#A4C2F4
[volume]
interval=30
signal=10
[ip]
command=hostname -i | awk '{ print " IPv4: " $1 }'
interval=120
label=🖥️
color=#91E78B
[clock]
label=🕒
command=date --iso-8601=seconds
interval=1
[ddate]
label=🚀
command=ddate +'%{%A, %d %B%}, %Y %N%tCelebrate %H'
interval=120

25
files/i3blocks/volume Normal file
View file

@ -0,0 +1,25 @@
#!/usr/bin/env sh
case $BLOCK_BUTTON in
1) setsid "$TERMINAL" -e pulsemixer & ;;
2) pulsemixer --toggle-mute ;;
4) pulsemixer --change-volume +5 ;;
5) pulsemixer --change-volume -5 ;;
3) pgrep -x dunst >/dev/null && notify-send "📢 Volume module" "\- Shows volume 🔊, 🔇 if muted.
- Middle click to mute.
- Scroll to change."
esac
[ "$(pulsemixer --get-mute)" = "1" ] && printf "🔇\\n" && exit
vol=$(pulsemixer --get-volume | awk '{print $1}')
if [ "$vol" -gt "70" ]; then
icon="🔊"
elif [ "$vol" -lt "30" ]; then
icon="🔈"
else
icon="🔉"
fi
printf "%s %s%%\\n" "$icon" "$vol"