Added mconnect to polybar

main
Guus van Meerveld 2 years ago
parent 119f19563a
commit 23b7f24638
Signed by: Guusvanmeerveld
GPG Key ID: 2BA7D7912771966E

@ -59,8 +59,8 @@ module-margin-right = 2
module-margin-left = 2 module-margin-left = 2
modules-left = bspwm modules-left = bspwm
modules-center = spotify modules-center = title
modules-right = temperature memory cpu battery wlan eth date modules-right = phone-battery temperature memory cpu battery wlan eth date
wm-restack = bspwm wm-restack = bspwm

@ -18,12 +18,18 @@ ramp-capacity-2 = 
ramp-capacity-3 =  ramp-capacity-3 = 
ramp-capacity-4 =  ramp-capacity-4 = 
[module/title]
type = internal/xwindow
[module/temperature] [module/temperature]
type = internal/temperature type = internal/temperature
; $ for i in /sys/class/thermal/thermal_zone*; do echo "$i: $(<$i/type)"; done ; for i in /sys/class/thermal/thermal_zone*; do echo "$i: $(<$i/type)"; done
thermal-zone = 0 thermal-zone = /sys/class/thermal/thermal_zone0
hwmon-path = /sys/devices/pci0000:00/0000:00:01.1/0000:10:00.0/hwmon/hwmon2/temp1_input
; for i in /sys/class/hwmon/hwmon*/temp*_input; do echo "$(<$(dirname $i)/name): $(cat ${i%_*}_label 2>/dev/null || echo $(basename ${i%_*})) $(readlink -f $i)"; done
format = <label> format = <label>
label = %temperature-c% label = %temperature-c%
@ -53,6 +59,15 @@ format-connected = <label-connected>
label-disconnected =  label-disconnected = 
[module/phone-battery]
type = custom/script
exec = echo "$(mconnectctl show-battery /org/mconnect/device/0 | head -1 | awk '{print $2}')%"
exec-if = ~/.config/polybar/phone-is-connected.sh
interval = 300
[module/date] [module/date]
type = internal/date type = internal/date
interval = 5 interval = 5

@ -0,0 +1,7 @@
#!/bin/bash
connected="$(mconnectctl show-device /org/mconnect/device/0 | sed -n 9,9p | awk '{print $2}')"
if [[ $connected == "false" ]]; then
exit 1
fi

@ -3,6 +3,8 @@
- kitty - kitty
- zsh - zsh
- mconnect-git
# Theming # Theming
- equilux-theme - equilux-theme
- mcmojave-cursors-git - mcmojave-cursors-git

@ -2,4 +2,4 @@
url="$(curl -I http://captive.apple.com | grep -Fi "Location" | awk '{print $2}')" url="$(curl -I http://captive.apple.com | grep -Fi "Location" | awk '{print $2}')"
xdg-open "${url}" & echo "${url}"