From 467d0062ad8d53648b5d873a8c1ecf2d5b3136bb Mon Sep 17 00:00:00 2001 From: L3D Date: Wed, 14 Oct 2020 13:18:02 +0200 Subject: [PATCH] Prepare i3blocks --- files/i3blocks/config | 28 ++++++++++++++++++++++++++++ files/i3blocks/volume | 25 +++++++++++++++++++++++++ 2 files changed, 53 insertions(+) create mode 100644 files/i3blocks/config create mode 100644 files/i3blocks/volume diff --git a/files/i3blocks/config b/files/i3blocks/config new file mode 100644 index 0000000..a3b5ceb --- /dev/null +++ b/files/i3blocks/config @@ -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 diff --git a/files/i3blocks/volume b/files/i3blocks/volume new file mode 100644 index 0000000..e66f0d9 --- /dev/null +++ b/files/i3blocks/volume @@ -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"