commit 3a93416bdd576ac1269bcf7e33074a1223ee13e5
parent 87d5fa0a57cdcdd9c2515f20b430f87184a2b05e
Author: Matsuda Kenji <ftvda283@gmail.com>
Date: Wed, 12 Aug 2020 08:42:33 +0900
changed calendar to lunar
Diffstat:
5 files changed, 26 insertions(+), 9 deletions(-)
diff --git a/.config/i3/config b/.config/i3/config
@@ -19,7 +19,7 @@ exec --no-startup-id nm-applet
exec --no-startup-id fcitx-autostart
# Use pactl to adjust volume in PulseAudio.
-set $refresh_volume pkill -SIGRTMIN+10 i3blocks
+set $refresh_volume pkill -SIGRTMIN+1 i3blocks
bindsym XF86AudioRaiseVolume exec --no-startup-id pactl set-sink-volume @DEFAULT_SINK@ +10% && $refresh_volume
bindsym XF86AudioLowerVolume exec --no-startup-id pactl set-sink-volume @DEFAULT_SINK@ -10% && $refresh_volume
bindsym XF86AudioMute exec --no-startup-id pactl set-sink-mute @DEFAULT_SINK@ toggle && $refresh_volume
diff --git a/.config/i3blocks/battery.sh b/.config/i3blocks/battery.sh
@@ -6,11 +6,11 @@ if [ $online = 1 ]; then
state=
elif [ $capacity -gt 95 ]; then
state=
-elif [ $capacity -gt 75 ]; then
+elif [ $capacity -gt 63 ]; then
state=
-elif [ $capacity -gt 50 ]; then
+elif [ $capacity -gt 38 ]; then
state=
-elif [ $capacity -gt 25 ]; then
+elif [ $capacity -gt 10 ]; then
state=
else
state=
diff --git a/.config/i3blocks/config b/.config/i3blocks/config
@@ -6,7 +6,7 @@ markup=none
label=
command=$PWD/volume.sh
interval=once
-signal=10
+signal=1
[brightness]
label=☀
diff --git a/.config/i3blocks/lunar_cal.sh b/.config/i3blocks/lunar_cal.sh
@@ -1,6 +1,23 @@
#!/bin/sh
month_names=(睦月 如月 弥生 卯月 皐月 水無月 文月 葉月 長月 神無月 霜月 師走)
-month_num=`date '+%m'`
-month=${month_names[`expr $month_num - 1`]}
-echo "$month `date '+%d日 %H%M'`"
+solar_cal=`date "+%Y,%-m,%d"`
+lunar_cal=`grep ^$solar_cal lunar/calendar_j.csv | cut -d, -f10-`
+
+kanji_nums=(壱 弐 参 肆 伍 陸 漆 捌 玖)
+
+year=`cut -d, -f1 <<<$lunar_cal`
+reiwa=${kanji_nums[$((year-2019))]}
+leap=`cut -d, -f2 <<<$lunar_cal`
+month=`cut -d, -f3 <<<$lunar_cal`
+date=`cut -d, -f4 <<<$lunar_cal`
+[ $date -lt 10 ] && date=${kanji_nums[$date-1]} \
+ || date="${kanji_nums[${date:0:1}-1]}${kanji_nums[${date:1:1}-1]}"
+six_labels=`cut -d, -f5 <<<$lunar_cal`
+zodiac=`cut -d, -f6 <<<$lunar_cal`
+sekki24=`cut -d, -f7 <<<$lunar_cal`
+zassetsu1=`cut -d, -f8 <<<$lunar_cal`
+zassetsu2=`cut -d, -f9 <<<$lunar_cal`
+festivals=`cut -d, -f10 <<<$lunar_cal`
+
+echo "令和$reiwa年$leap${month_names[$month]}$date日 $six_labels $zodiac$sekki24$zassetsu1$zassetsu2$festivals"
diff --git a/.config/i3blocks/wifi.sh b/.config/i3blocks/wifi.sh
@@ -9,7 +9,7 @@ if [ ! "$(cat /sys/class/net/$INTERFACE/operstate)" = 'up' ]; then
exit
fi
-ssid=`nmcli dev | grep connected | awk '{print $4}'`
+ssid=`nmcli dev | grep wifi | grep connected | awk '{print $4}'`
quality=`nmcli dev wifi | grep $ssid | awk '{print $8}'`
echo " $ssid: $quality%"