Browse Source

Add get_height to lemonbar

master
Riyyi 5 years ago
parent
commit
8799a7ca1e
  1. 2
      .scripts/panel/brightness.sh
  2. 24
      .scripts/panel/lemonbar.sh
  3. 2
      .scripts/panel/volume.sh

2
.scripts/panel/brightness.sh

@ -19,6 +19,6 @@ fi
INPUT="%{$R}%{$U}%{$D}"
END="%{A}%{A}%{A}"
PIPE="$("$(dirname "$0")"/lemonbar.sh getpipe)"
PIPE="$("$(dirname "$0")"/lemonbar.sh get_pipe)"
printf "%s\n" "brightness$INPUT$ICON $PERCENTAGE%$END" > "$PIPE" &

24
.scripts/panel/lemonbar.sh

@ -2,6 +2,7 @@
PIPE="/tmp/lemonbar_pipe"
PANEL="lemonbar_panel"
PANEL_HEIGHT=38
title() {
# Grab focused window's ID
@ -34,7 +35,7 @@ clock() {
bar() {
lemonbar \
-a 20 -g x38 -n "$PANEL" \
-a 20 -g x$PANEL_HEIGHT -n "$PANEL" \
-f "DejaVu Sans-8" -o 0 \
-f "FontAwesome5Free Solid-8" -o -3 \
-f "FontAwesome5Free Regular-8" -o -3 \
@ -107,17 +108,24 @@ start() {
;;
esac
printf "%s\n" "%{l}$workspaces%{c}$title%{r}$volume $brightness $wifi $iface $battery $clock "
done < "$PIPE" | bar | sh
done < "$PIPE" | bar | sh &
wait
}
getpipe() {
get_height() {
printf "%s" "$PANEL_HEIGHT"
}
get_pipe() {
printf "%s" "$PIPE"
}
if type "$1" 2> /dev/null | grep -q "function"; then
"$@"
else
start
fi
case "$1" in
start | get_height | get_pipe)
"$1"
;;
"")
start
;;
esac

2
.scripts/panel/volume.sh

@ -30,6 +30,6 @@ fi
INPUT="%{$L}%{$S}%{$R}%{$U}%{$D}"
END="%{A}%{A}%{A}%{A}%{A}"
PIPE="$("$(dirname "$0")"/lemonbar.sh getpipe)"
PIPE="$("$(dirname "$0")"/lemonbar.sh get_pipe)"
printf "%s\n" "volume%{F$COLOR}$INPUT$SYMBOL $VOLUME%$END%{F-}" > "$PIPE" &

Loading…
Cancel
Save