thermal_zone=0
fan_path='/proc/acpi/ibm/fan'
- interval_in_datetime=1
- interval_in_brightness=1
- interval_in_weather=$(( 30 * 60)) # 30 minutes
- interval_in_mpd_state=1
- interval_in_mpd_song=1
- interval_in_volume=1
- interval_in_bluetooth=5
- interval_in_net_wifi=5
- interval_in_net_io=1
- interval_in_disk_space=5
- interval_in_disk_io=1
- interval_in_loadavg=1
- interval_in_temp=1
- interval_in_fan=1
- interval_in_mem=1
- interval_in_energy=1
- interval_out_bar=1
+ interval_inp_datetime=1
+ interval_inp_brightness=1
+ interval_inp_weather=$(( 30 * 60)) # 30 minutes
+ interval_inp_mpd_state=1
+ interval_inp_mpd_song=1
+ interval_inp_volume=1
+ interval_inp_bluetooth=5
+ interval_inp_net_wifi=5
+ interval_inp_net_io=1
+ interval_inp_disk_space=5
+ interval_inp_disk_io=1
+ interval_inp_loadavg=1
+ interval_inp_temp=1
+ interval_inp_fan=1
+ interval_inp_mem=1
+ interval_inp_energy=1
+ interval_outp_bar=1
# User-overrides
long_options=''
long_options+=',disk_io_device:'
long_options+=',thermal_zone:'
long_options+=',fan_path:'
- long_options+=',interval_in_datetime:'
- long_options+=',interval_in_brightness:'
- long_options+=',interval_in_weather:'
- long_options+=',interval_in_mpd_state:'
- long_options+=',interval_in_mpd_song:'
- long_options+=',interval_in_volume:'
- long_options+=',interval_in_bluetooth:'
- long_options+=',interval_in_net_wifi:'
- long_options+=',interval_in_net_io:'
- long_options+=',interval_in_disk_space:'
- long_options+=',interval_in_disk_io:'
- long_options+=',interval_in_loadavg:'
- long_options+=',interval_in_temp:'
- long_options+=',interval_in_fan:'
- long_options+=',interval_in_mem:'
- long_options+=',interval_in_energy:'
- long_options+=',interval_out_bar:'
+ long_options+=',interval_inp_datetime:'
+ long_options+=',interval_inp_brightness:'
+ long_options+=',interval_inp_weather:'
+ long_options+=',interval_inp_mpd_state:'
+ long_options+=',interval_inp_mpd_song:'
+ long_options+=',interval_inp_volume:'
+ long_options+=',interval_inp_bluetooth:'
+ long_options+=',interval_inp_net_wifi:'
+ long_options+=',interval_inp_net_io:'
+ long_options+=',interval_inp_disk_space:'
+ long_options+=',interval_inp_disk_io:'
+ long_options+=',interval_inp_loadavg:'
+ long_options+=',interval_inp_temp:'
+ long_options+=',interval_inp_fan:'
+ long_options+=',interval_inp_mem:'
+ long_options+=',interval_inp_energy:'
+ long_options+=',interval_outp_bar:'
OPTS=$(
getopt \
-o 'd' \
fan_path="$2"
shift 2
;;
- --interval_in_datetime)
- interval_in_datetime="$2"
+ --interval_inp_datetime)
+ interval_inp_datetime="$2"
shift 2
;;
- --interval_in_brightness)
- interval_in_brightness="$2"
+ --interval_inp_brightness)
+ interval_inp_brightness="$2"
shift 2
;;
- --interval_in_weather)
- interval_in_weather="$2"
+ --interval_inp_weather)
+ interval_inp_weather="$2"
shift 2
;;
- --interval_in_mpd_state)
- interval_in_mpd_state="$2"
+ --interval_inp_mpd_state)
+ interval_inp_mpd_state="$2"
shift 2
;;
- --interval_in_mpd_song)
- interval_in_mpd_song="$2"
+ --interval_inp_mpd_song)
+ interval_inp_mpd_song="$2"
shift 2
;;
- --interval_in_volume)
- interval_in_volume="$2"
+ --interval_inp_volume)
+ interval_inp_volume="$2"
shift 2
;;
- --interval_in_bluetooth)
- interval_in_bluetooth="$2"
+ --interval_inp_bluetooth)
+ interval_inp_bluetooth="$2"
shift 2
;;
- --interval_in_net_wifi)
- interval_in_net_wifi="$2"
+ --interval_inp_net_wifi)
+ interval_inp_net_wifi="$2"
shift 2
;;
- --interval_in_net_io)
- interval_in_net_io="$2"
+ --interval_inp_net_io)
+ interval_inp_net_io="$2"
shift 2
;;
- --interval_in_disk_space)
- interval_in_disk_space="$2"
+ --interval_inp_disk_space)
+ interval_inp_disk_space="$2"
shift 2
;;
- --interval_in_disk_io)
- interval_in_disk_io="$2"
+ --interval_inp_disk_io)
+ interval_inp_disk_io="$2"
shift 2
;;
- --interval_in_loadavg)
- interval_in_loadavg="$2"
+ --interval_inp_loadavg)
+ interval_inp_loadavg="$2"
shift 2
;;
- --interval_in_temp)
- interval_in_temp="$2"
+ --interval_inp_temp)
+ interval_inp_temp="$2"
shift 2
;;
- --interval_in_fan)
- interval_in_fan="$2"
+ --interval_inp_fan)
+ interval_inp_fan="$2"
shift 2
;;
- --interval_in_mem)
- interval_in_mem="$2"
+ --interval_inp_mem)
+ interval_inp_mem="$2"
shift 2
;;
- --interval_in_energy)
- interval_in_energy="$2"
+ --interval_inp_energy)
+ interval_inp_energy="$2"
shift 2
;;
- --interval_out_bar)
- interval_out_bar="$2"
+ --interval_outp_bar)
+ interval_outp_bar="$2"
shift 2
;;
--)
cmd_produce_fan="produce_fan $fan_path"
# TODO: Redirect each worker's stderr to a dedicated log file
- spawn produce_datetime "$pipe" 'in:DATE_TIME' $interval_in_datetime
- spawn "$cmd_produce_screen_brightness" "$pipe" 'in:SCREEN_BRIGHTNESS' $interval_in_brightness
- spawn "$cmd_produce_weather" "$pipe" 'in:WEATHER' $interval_in_weather
- spawn produce_mpd_state "$pipe" 'in:MPD_STATE' $interval_in_mpd_state
- spawn produce_mpd_song "$pipe" 'in:MPD_SONG' $interval_in_mpd_song
- spawn produce_volume "$pipe" 'in:VOLUME' $interval_in_volume
- spawn produce_bluetooth_power "$pipe" 'in:BLUETOOTH_POWER' $interval_in_bluetooth
- spawn produce_net_wifi_status "$pipe" 'in:NET_WIFI_STATUS' $interval_in_net_wifi
- spawn produce_net_addr_io "$pipe" 'in:NET_ADDR_IO' $interval_in_net_io
- spawn "$cmd_produce_disk_space" "$pipe" 'in:DISK_SPACE' $interval_in_disk_space
- spawn "$cmd_produce_disk_io" "$pipe" 'in:DISK_IO' $interval_in_disk_io
- spawn produce_loadavg "$pipe" 'in:LOAD_AVG' $interval_in_loadavg
- spawn "$cmd_produce_temperature" "$pipe" 'in:TEMPERATURE' $interval_in_temp
- spawn "$cmd_produce_fan" "$pipe" 'in:FAN' $interval_in_fan
- spawn produce_memory "$pipe" 'in:MEMORY' $interval_in_mem
- spawn produce_energy "$pipe" 'in:ENERGY' $interval_in_energy
- spawn produce_bar_req "$pipe" 'out:BAR' $interval_out_bar
+ spawn produce_datetime "$pipe" 'in:DATE_TIME' $interval_inp_datetime
+ spawn "$cmd_produce_screen_brightness" "$pipe" 'in:SCREEN_BRIGHTNESS' $interval_inp_brightness
+ spawn "$cmd_produce_weather" "$pipe" 'in:WEATHER' $interval_inp_weather
+ spawn produce_mpd_state "$pipe" 'in:MPD_STATE' $interval_inp_mpd_state
+ spawn produce_mpd_song "$pipe" 'in:MPD_SONG' $interval_inp_mpd_song
+ spawn produce_volume "$pipe" 'in:VOLUME' $interval_inp_volume
+ spawn produce_bluetooth_power "$pipe" 'in:BLUETOOTH_POWER' $interval_inp_bluetooth
+ spawn produce_net_wifi_status "$pipe" 'in:NET_WIFI_STATUS' $interval_inp_net_wifi
+ spawn produce_net_addr_io "$pipe" 'in:NET_ADDR_IO' $interval_inp_net_io
+ spawn "$cmd_produce_disk_space" "$pipe" 'in:DISK_SPACE' $interval_inp_disk_space
+ spawn "$cmd_produce_disk_io" "$pipe" 'in:DISK_IO' $interval_inp_disk_io
+ spawn produce_loadavg "$pipe" 'in:LOAD_AVG' $interval_inp_loadavg
+ spawn "$cmd_produce_temperature" "$pipe" 'in:TEMPERATURE' $interval_inp_temp
+ spawn "$cmd_produce_fan" "$pipe" 'in:FAN' $interval_inp_fan
+ spawn produce_memory "$pipe" 'in:MEMORY' $interval_inp_mem
+ spawn produce_energy "$pipe" 'in:ENERGY' $interval_inp_energy
+ spawn produce_bar_req "$pipe" 'out:BAR' $interval_outp_bar
consume \
"$pipe" \