--- /dev/null
+#! /bin/sh
+
+set -e
+
+bin_dir="$(dirname $(realpath $0))"
+
+. "$bin_dir/khatus_x4_lib_common_sensor.sh"
+
+sensor() {
+ upower --show-info /org/freedesktop/UPower/devices/DisplayDevice | awk '
+ /percentage:/ {print "battery_percentage", int($2)}
+ /state:/ {print "battery_state" , $2}
+ '
+}
+
+run_as_poller
./bin/khatus_x4_sensor_datetime -d -i 1
./bin/khatus_x4_sensor_bluetooth -d -i 1
./bin/khatus_x4_sensor_mpd -d -i 1
- ./bin/khatus_x4_sensor_energy -d -i 1
+ ./bin/khatus_x4_sensor_energy -d
+ ./bin/khatus_x4_sensor_energy_poller -d -i 1
./bin/khatus_x4_sensor_memory -d -i 1
./bin/khatus_x4_sensor_loadavg -d -i 1
./bin/khatus_x4_sensor_temp -d -i 1 -- -z 0
while :
do
battery_state="$(sensor_read_one ${dir}/khatus_x4_sensor_energy/out/battery_state)"
+ battery_state_poll="$(sensor_read_one ${dir}/khatus_x4_sensor_energy_poller/out/battery_state)"
battery_percentage="$(sensor_read_one ${dir}/khatus_x4_sensor_energy/out/battery_percentage)"
+ battery_percentage_poll="$(sensor_read_one ${dir}/khatus_x4_sensor_energy_poller/out/battery_percentage)"
bluetooth_controllers="$(sensor_read_one ${dir}/khatus_x4_sensor_bluetooth/out/count_powered_controllers)"
bluetooth_devices="$(sensor_read_one ${dir}/khatus_x4_sensor_bluetooth/out/count_connected_devices)"
datetime="$(sensor_read_one ${dir}/khatus_x4_sensor_datetime/out/datetime)"
vol_right="$(sensor_read_one ${dir}/khatus_x4_sensor_volume/out/vol_right)"
vol_state="$(sensor_read_one ${dir}/khatus_x4_sensor_volume/out/state)"
vol_mute="$(sensor_read_one ${dir}/khatus_x4_sensor_volume/out/mute)"
- echo "E[${battery_state} ${battery_percentage}] M:${mem}% L:${load} T:${temp}°C D:${disk}% [${mpd}] [$bluetooth_controllers $bluetooth_devices] V:${vol_state}:${vol_left}:${vol_right}:${vol_mute} ${datetime}"
+ echo "E[${battery_state} ${battery_percentage} | ${battery_state} ${battery_percentage_poll}] M:${mem}% L:${load} T:${temp}°C D:${disk}% [${mpd}] [$bluetooth_controllers $bluetooth_devices] V:${vol_state}:${vol_left}:${vol_right}:${vol_mute} ${datetime}"
sleep 1
done
}