Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ matrix_patterns
build
dist
.env
config-local.yaml
config-local*.yaml
__pycache__/
.vscode/
17 changes: 16 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,9 @@ The `build_and_install.sh` script will automatically detect your Linux distribut
* Turn on animation and define command arguments for apps
* Specified via a yaml config file
* Keyboard shortcut `ALT` + `I` identifies apps running in each quadrant by displaying abbreviated name
* Keyboard shortcut `ALT` + `N` forces the display of the nexzt widget, without waiting for the time slice to complete
* Keyboard shortcut `ALT` + `F` freezes app switching, cuasing the current widget to be displayed indefinitely
* Keyboard shortcut `ALT` + `U` unfreezes app switching
* Plugin framework supports simplified development of addiitonal LED Panel applications
* Automatic detection of left and right LED panels
* Automatic detection of keyboard device (for keyboard shortcut use)
Expand Down Expand Up @@ -221,7 +224,7 @@ sudo python3 -m led_mon.led_system_monitor

## Keyboard Input Access (Optional)

For the Alt+I keyboard shortcut feature to work, the application needs read access to keyboard input devices:
For the keyboard shortcut features to work, the application needs read access to keyboard input devices:

```bash
# Add user to input group (be aware of security implications)
Expand Down Expand Up @@ -270,6 +273,9 @@ systemctl --user start|stop|restart|status fwledmonitor

## Keyboard Shortcut
* Alt+I: displays app names in each quadrant while keys are pressed
* Alt+N: displays the next widget without waiting for the time slice to complete
* Alt+F: freezes app switching, causing the current widget to be displayed indefinitely
* Alt+U: unfreezes app switching
* Disable key listener with `--no-key-listener` program arg
* To use the key listener, the app must have read permission on the keyboard device (e.g `/dev/input/event<n>`). T use the key listener, you need to add your user account to the `input` group and ensure there is a group read permission on the keyboard device. **NB:** Consider the implications of this. Any program running as a user in the `input` group will be able to capture your keystrokes.

Expand Down Expand Up @@ -314,8 +320,17 @@ Set arguments (`app -> ags`) for the `weather` app in the desired quadrant
`forecast_hour: n`
- Override the key used to display the app ID. This means if forecast is true, use weather_forecast, otherwise use weather_current

- Specify measures to show. If more than one is provided, the app will cycle through them indefinitely

`measures: [temp_condition, wind_chill, wind]`
- Specify the number of seconds to display each measure.

`measures-duration: 20`

`id_key_override: [forecast, weather_forecast, weather_current]`

If `forecast` is true, the `Forecast Days` and `Forecast Hours` settings will be shown at the bottom left and right edges of the LED device. The `Forecast Days` value will be indicated by 1 to 5 pixels stacked from the bottom on the left edge. The `Forecast Hours` will be indicated by one to 8 pixels stacked from the bottom on the right edge, each representing the three-hour periods from 0 to 21. A hash mark will be drawn in the adjacent column at the fourth pixel, if lit, for ease of reading.

### Snapshot (built-in app, not a plugin):
Configure the following arguments in the config file (`app -> args`)
- Name of the JSON file with a pattern to display
Expand Down
75 changes: 42 additions & 33 deletions led_mon/config.yaml
Original file line number Diff line number Diff line change
@@ -1,71 +1,80 @@
# See config-README.md for help on using this config file.
# To customize the settings, copy them to config-local.yaml. That file if present,
# will be used in place of this one
# To customize the settings, copy them to config-local.yaml.
# That file, if present, will be used in place of this one.

duration: 10

quadrants:
top-left:
- app:
name: time
duration: 60
scope: panel
args:
fmt_24_hour: false
# use tz identifer as listed in the IANA database. See https://en.wikipedia.org/wiki/List_of_tz_database_time_zones
timezone:
- app:
name: equalizer
duration: 30
duration: 60
scope: panel
dispose-fn: equalizer_dispose
persistent-draw: true
args:
external-filter: false
# left|right|<name of quadrant>
side: left
border: false
- app:
name: time
duration: 30
scope: panel
args:
fmt_24_hour: false
timezone:
- app:
name: cpu
duration: 30
duration: 60
animate: false
- app:
name: snap
duration: 30
duration: 60
animate: true
scope: panel
args:
file: zigzag.json
path: snapshot_files
panel: left
top-right:
- app:
name: equalizer
duration: 30
scope: panel
dispose-fn: equalizer_dispose
persistent-draw: true
args:
external-filter: false
side: right
border: false
- app:
name: weather
duration: 30
duration: 60
scope: panel
args:
# imperial|metric|standard (default metric)
units: imperial
# Include one or more of [temp_condition, wind_chill, wind]
measures: [temp_condition, wind_chill, wind]
measures-duration: 60
forecast: false
# 1-5
forecast_day: 1
# 0|3|6|9|12|15|18|21 (default 12)
forecast_hour: 12
# [arg-name, id-if-arg-true, id-if-arg-false]
id_key_override: [forecast, weather_forecast, weather_current]
- app:
name: equalizer
duration: 60
scope: panel
dispose-fn: equalizer_dispose
persistent-draw: true
args:
external-filter: false
side: right
border: false
- app:
name: temp
duration: 30
duration: 60
animate: false
scope: quadrant
- app:
name: snap
animate: true
duration: 30
duration: 60
scope: panel
args:
file: every-third-row.json
Expand All @@ -74,34 +83,34 @@ quadrants:
bottom-right:
- app:
name: noop1
duration: 30
duration: 60
display: false
- app:
name: noop2
display: false
duration: 30
duration: 60
- app:
name: fan
duration: 30
duration: 60
animate: false
- app:
name: noop3
display: false
duration: 30
duration: 60
bottom-left:
- app:
name: noop1
duration: 30
duration: 60
display: false
- app:
name: noop2
duration: 30
duration: 60
display: false
- app:
name: mem-bat
duration: 30
duration: 60
animate: false
- app:
name: noop3
duration: 30
duration: 60
display: false
2 changes: 1 addition & 1 deletion led_mon/drawing.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ def draw_snapshot(grid, fill_value, **kwargs):
print(f"File {file} not found")
warned.add(file)

def draw_chars(grid: np.ndarray, chars: list[str], fill_value: int, y: int):
def draw_chars_list(grid: np.ndarray, chars: list[str], fill_value: int, y: int):
char_map = {**numerals, **symbols, **icons}
grid = grid.T
for char in chars:
Expand Down
4 changes: 2 additions & 2 deletions led_mon/equalizer_files/visualize.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ def draw_source_change_cue(source):
else:
cmd_2 = None
with device_lock:
if not shared_state.key_press_active:
if not shared_state.id_key_press_active:
for _ in range(3):
subprocess.call(cmd_1, stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL)
if cmd_2:
Expand Down Expand Up @@ -247,7 +247,7 @@ def update_leds():
] + [str(l) for l in levels]
# print(f"{device_name} {levels}")
with device_lock:
if not shared_state.key_press_active:
if not shared_state.id_key_press_active:
if sum(levels) == 0 and time.time() - base_time > ZERO_FRAME_NOTIFY_DELAY_SEC:
self.draw_id(device_name)
elif sum(levels) > 0:
Expand Down
Loading