diff --git a/files/.local/bin/bar.sh b/files/.local/bin/bar.sh index 086d6ae..e5e1799 100755 --- a/files/.local/bin/bar.sh +++ b/files/.local/bin/bar.sh @@ -10,24 +10,12 @@ fg="#a39ef1" # foreground colour hi="#00aaaa" # highlight colour ul=2 # underline thickness sep="┃" # separator text -font="-xos4-terminus-medium-r-normal--12-240-72-72-c-120-iso10646-1" fifo="/tmp/bar.fifo" - -# adjust font size based on resolution DPI -px=$(xrandr | grep ' connected' | tail -n1 | grep -o '[0-9]\+x[0-9]\+' | cut -d'x' -f2) -mm=$(xrandr | grep ' connected' | tail -n1 | grep -o '[0-9]\+mm' | tail -n1 | sed 's/mm//') -dpi=$(( (px / mm) * 25 )) -if (( dpi >= 140 )); then - font="-xos4-terminus-medium-r-normal--20-240-72-72-c-120-iso10646-1" -elif (( dpi >= 120 )); then - font="-xos4-terminus-medium-r-normal--16-240-72-72-c-120-iso10646-1" -elif (( dpi >= 100 )); then - font="-xos4-terminus-medium-r-normal--12-240-72-72-c-120-iso10646-1" -fi +font="Iosevka:size=11" clock() { - date +"T %a %H:%M $sep" + date +"T %a %H:%M " # sync up the clock to the minute mark min=$(date +"%M") @@ -36,7 +24,7 @@ clock() done while :; do - date +"T %a %H:%M $sep" + date +"T %a %H:%M " sleep 60 done } @@ -45,7 +33,7 @@ battery() { while :; do perc="$(cat /sys/class/power_supply/BAT0/capacity)" - printf 'B Bat: %s%%%s\n' " ${perc}" + echo "B bat: ${perc}%" sleep 60 done } @@ -53,7 +41,7 @@ battery() volume() { vol="$(amixer sget Master | awk -F"[][]" '/(Mono|Left):/ { print $2 }')" - printf 'V vol: %s%%\n' "$vol" + echo "V vol: ${vol}" } workspaces() @@ -73,7 +61,6 @@ workspaces() if $focused; then # clicking the layout symbol will cycle the layout lyt="%{A:dkcmd set layout cycle:}${layouts[$layout]}%{A}" - WIN="${title:0:50}" f="$hi" fi # clicking on a workspace name will view it @@ -82,13 +69,13 @@ workspaces() # turn the dk JSON output into lines that can be `eval`ed one by one, # filling out the following fields: name, focused, active, layout, title done < <(dkcmd -p <<< "$1" | sed '/.*\[\|]/d; /[{}],\?/d; s/^\s*\|,$//g; /"monitor":\|"number":\|"id":/d; s/"\(.*\)": /\1=/; s/\$(/\\\$(/g; s/`/\\`/g') - WS="$WS $sep $lyt" + WS="$WS $lyt" } parsefifo() { # globals to simplify the workspaces call - declare -g WS WIN + declare -g WS local time vol bat net @@ -100,7 +87,7 @@ parsefifo() N*) net="${line#?}" ;; '{'*) workspaces "$line" ;; esac - printf "%s\n" "%{l}$sep ${WS}%{c}${WIN}%{r}${net}${bat}${vol}${time}" + echo "%{l} ${WS}%{c}${time}%{r}${bat}${vol} " done } diff --git a/files/.local/bin/journal b/files/.local/bin/journal index 47d1985..2b91f6b 100755 --- a/files/.local/bin/journal +++ b/files/.local/bin/journal @@ -7,5 +7,5 @@ d="$(date -I)" grep "$d" "$JOURNAL" || printf "%s\n" "$d" > "$tmp" nvi "$tmp" -(printf "\n"; cat "$tmp" | tee -a "$JOURNAL") && rm "$tmp" tail "$JOURNAL" +(printf "\n"; cat "$tmp" | tee -a "$JOURNAL") && rm "$tmp" diff --git a/files/.zprofile b/files/.zprofile index b82d7cf..951c9a5 100644 --- a/files/.zprofile +++ b/files/.zprofile @@ -1,5 +1,5 @@ export ENV="$HOME/.shrc" -export PATH="$HOME/.local/bin/":"$PATH" +export PATH="$HOME/.local/bin":"$PATH" export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig/:/usr/lib/pkgconfig export XKB_DEFAULT_LAYOUT=de export XBPS_DISTDIR="$HOME/void-packages" diff --git a/pkgs.txt b/pkgs.txt index 4fae8ab..4538a5b 100644 --- a/pkgs.txt +++ b/pkgs.txt @@ -13,6 +13,7 @@ fzy gcc grub-x86_64-efi keyd +lemonbar-xft libdrm-devel libinput-devel libxkbcommon-devel