Update polybar config for use with Linux

This commit is contained in:
coolneng 2019-08-25 03:38:58 +02:00
parent 8cb021608c
commit 51303d5dac
4 changed files with 34 additions and 89 deletions

View File

@ -1,26 +0,0 @@
#!/usr/bin/env bash
color8="#88C0D0"
icon(){
printf "%s\\n" "%{F${color8}}${1}%{F}"
}
icon2() {
printf "%s\\n" "%{F${color11:-#F0F0F0}}${1}%{F}"
}
status=$(acpiconf -i 0 | grep State | cut -c 10-)
capacity=$(acpiconf -i 0 | grep % | cut -f2 | cut -c -4 | sed s/%//)
if [ "$status" == "charging" ]; then
printf "%s\\n" "$(icon "") ${capacity}%"
elif [ "$status" == "high" ]; then
printf "%s\\n" "$(icon "") ${capacity}%"
elif (("$capacity" <= "20")); then
printf "%s\\n" "$(icon2 "") ${capacity}%"
elif (("$capacity" <= "60")); then
printf "%s\\n" "$(icon "") ${capacity}%"
elif (("$capacity" <= "100")); then
printf "%s\\n" "$(icon "") ${capacity}%"
fi

View File

@ -24,7 +24,7 @@ font-1 = Siji:size=10;0
modules-left = workspaces modules-left = workspaces
modules-center = date modules-center = date
modules-right = mpd wifi vol bat modules-right = mpd network alsa battery
[module/title] [module/title]
type = internal/xwindow type = internal/xwindow
@ -40,7 +40,7 @@ format-foreground = ${colors.foreground-alt}
[module/mpd] [module/mpd]
type = internal/mpd type = internal/mpd
host = /home/coolneng/.mpd/socket host = /home/coolneng/.config/mpd/socket
format-online = <icon-play> <icon-pause> <label-song> format-online = <icon-play> <icon-pause> <label-song>
format-offline = <label-offline> format-offline = <label-offline>
@ -55,30 +55,10 @@ interval = 2
[module/date] [module/date]
type = internal/date type = internal/date
; Seconds to sleep between updates
interval = 1.0 interval = 1.0
; See "man date" for details on how to format the date string
; NOTE: if you want to use syntax tags here you need to use %%{...}
date = %a %d %b date = %a %d %b
; Optional time format
time = %H:%M time = %H:%M
; if `date-alt` or `time-alt` is defined, clicking
; the module will toggle between formats
;date-alt = %A, %d %B %Y
;time-alt = %H:%M:%S
; Available tags:
; <label> (default)
format = <label> format = <label>
; Available tokens:
; %date%
; %time%
; Default: %date%
label = %date% %time% label = %date% %time%
format-foreground = ${colors.foreground-alt} format-foreground = ${colors.foreground-alt}
@ -104,17 +84,37 @@ label-empty = %name%
label-empty-padding = 1 label-empty-padding = 1
label-empty-foreground = ${colors.foreground-alt} label-empty-foreground = ${colors.foreground-alt}
[module/vol] [module/network]
type = custom/script type = internal/network
exec = ~/.config/polybar/volume.sh interface = wlp2s0
interval = 2 label-connected = %essid%
format-connected = <ramp-signal> <label-connected>
format-disconnected = <label-disconnected>
ramp-signal-0 = 
ramp-signal-1 = 
ramp-signal-2 = 
ramp-signal-foreground = ${colors.icon}
[module/bat] [module/alsa]
type = custom/script type = internal/alsa
exec = ~/.config/polybar/battery.sh format-volume = <ramp-volume> <label-volume>
interval = 2 label-muted =  muted
label-muted-foreground = ${colors.icon}
ramp-volume = ${colors.icon}
ramp-volume-0 = 
ramp-volume-1 = 
ramp-volume-2 = 
ramp-volume-foreground = ${colors.icon}
[module/wifi] [module/battery]
type = custom/script type = internal/battery
exec = ~/.config/polybar/wifi.sh battery = BAT0
interval = 2 adapter = ADP0
format-discharging = <ramp-capacity> <label-discharging>
format-charging = <animation-charging> <label-charging>
ramp-capacity-0 = 
ramp-capacity-1 = 
ramp-capacity-2 = 
animation-charging-0 = 
animation-charging-foreground = ${colors.icon}
ramp-capacity-foreground = ${colors.icon}

View File

@ -1,18 +0,0 @@
#!/usr/bin/env bash
color8="#88C0D0"
icon(){
printf "%s\\n" "%{F${color8}}${1}%{F}"
}
volume="$(mixer vol | cut -c 36- | cut -c -3)"
case "$volume" in
0|[0-9]) vol_icon=" " ;;
1?|2?|3?) vol_icon="" ;;
4?|5?|6?) vol_icon="" ;;
*) vol_icon="" ;;
esac
printf "%s\\n" "$(icon "$vol_icon") ${volume}%"

View File

@ -1,11 +0,0 @@
#!/usr/bin/env bash
color8="#88C0D0"
icon(){
printf "%s\\n" "%{F${color8}}${1}%{F}"
}
wifi="$(echo -e "$(wpa_cli status | grep ssid | awk 'NR==2{print $1}' | cut -c 6-)")"
wifi_icon=""
printf "%s\\n" "$(icon "$wifi_icon") ${wifi}"