DWL: Support for somebar

This commit is contained in:
Mahesh Asolkar 2022-02-12 16:09:24 -08:00
parent cc578dd0e8
commit 59a0f3c075
3 changed files with 29 additions and 21 deletions

View File

@ -24,9 +24,13 @@ done
echo "DWL ready!" >> $DWL_LOG_FILE echo "DWL ready!" >> $DWL_LOG_FILE
echo "Entourage: " $DWL_TAGS_FILE >> $DWL_LOG_FILE echo "Entourage: " $DWL_TAGS_FILE >> $DWL_LOG_FILE
DISPLAYS=$(wlr-randr | perl -ne 'print "$1 " if /^([\w-]+)/') if [ -e /usr/local/bin/somebar ]; then
DISP_NUM=$(expr 0) /usr/local/bin/somebar &
for DISP in $DISPLAYS; do (sleep 2 && conky -c ~/.conkyrc > $XDG_RUNTIME_DIR/somebar-0) &
else
DISPLAYS=$(wlr-randr | perl -ne 'print "$1 " if /^([\w-]+)/')
DISP_NUM=$(expr 0)
for DISP in $DISPLAYS; do
DISP_NUM=$(expr $DISP_NUM + 1) DISP_NUM=$(expr $DISP_NUM + 1)
TF=${DWL_TAGS_FILE}.${DISP} TF=${DWL_TAGS_FILE}.${DISP}
# ---------------------------------------------------------- # ----------------------------------------------------------
@ -44,7 +48,8 @@ for DISP in $DISPLAYS; do
# Bottom bar for displaying context information # Bottom bar for displaying context information
# ---------------------------------------------------------- # ----------------------------------------------------------
(conky -c ~/.conkyrc) | dtao -xs ${DISP_NUM} -ta r -tw 100 -expand l -h 22 -fn 'Iosevka:style=Regular:size=12' & (conky -c ~/.conkyrc) | dtao -xs ${DISP_NUM} -ta r -tw 100 -expand l -h 22 -fn 'Iosevka:style=Regular:size=12' &
done done
fi
# ---------------------------------------------------------- # ----------------------------------------------------------
# Background # Background

View File

@ -63,6 +63,8 @@ while (<>) {
my $line = $_; my $line = $_;
chomp $line; chomp $line;
print STDOUT "$_";
if (exists $ENV{'DWL_LOG_VERBOSE'}) { if (exists $ENV{'DWL_LOG_VERBOSE'}) {
print_log("DWLTAGS [VV] : $line"); print_log("DWLTAGS [VV] : $line");
} }

View File

@ -37,6 +37,7 @@ conky.config = {
} }
conky.text = [[ conky.text = [[
${if_existing /usr/local/bin/somebar}status${endif} \
💻 ${cpu}% | \ 💻 ${cpu}% | \
💾 ${memperc}% | \ 💾 ${memperc}% | \
${if_existing /sys/class/net/enp3s0/operstate up}🌐 ${addr enp3s0}${else}\ ${if_existing /sys/class/net/enp3s0/operstate up}🌐 ${addr enp3s0}${else}\