Copy examples/example1.toml
-> config.toml
and edit to your desired configuration.
# install requirements
pip3 install -r requirements.txt
# set graphics mode for the current screen's tty (usually tty1)
sudo python3 gfxmode.py /dev/tty1 graphics
# run the dashboard
python3 -m fb_dashboard
Config file, may need to customize the widget to the one you want to display. the widget
is also eval()'ed like the x, y, w, and h variables, so you can dynamically specify the width and height of the image.
[widgets.cloudwatch]
x = 0
y = 0
w = 'w'
h = 'h'
type = 'CloudWatchMetricImage'
widget = '{"metrics": [[ "AWS/CloudFront", "Requests", "Region", "Global", "DistributionId", "YOUR_DISTRIBUTION_ID_HERE" ]],"view": "timeSeries","stacked": false,"stat": "Sum","period": 900, "width": w, "height": h,"start": "-PT72H", "end": "P0D", "timezone": "-0400"}'
For usage examples, see the examples/
folder for some starter templates.
-
all:
x
- x position on screeny
- y position on screenw
- width of the widgeth
- height of the widgetrefresh_interval
- minimum time (in seconds), between widget refreshes
-
CloudWatchMetricImage
widget
- a JSON string from CloudWatch's metric image export functionaws_profile
- (optional) AWS profile nameaws_region
- (optional) AWS region nameinvert_image
- (optional) invert metric image, to obtain dark mode
-
Image
path
- local path, http://, or https:// link to the imageauth_type
- (optional)basic
(default), ordigest
. Only used if username and password are set.username
- (optional) auth usernamepassword
- (optional) auth passwordinvert_image
- (optional) invert image
-
Clock
clock_format
- (optional) clock format string, e.g.%H:%M:%S
or%I:%M %p
date_format
- (optional) date format string, e.g.%Y-%m-%d
or%A, %B %d, %Y
timezone
- (optional) e.g. America/New_Yorkbg_color
- bg color, in hex orrgb()
format.fg_color
- bg color, in hex orrgb()
format.
-
StockMarketCandlestick
- stock market data from Yahoo financesymbol
- required, the symbol. e.g.AAPL
.plot_style
- (optional) a mplfinance theme name, default nightcloudsup_color
- (optional) up candlestick color, default#00FF00
down_color
- (optional) down candlestick color, default#FF0000
time_period
- (optional) time period to show. default1mo
- allowed values: '1d', '5d', '1mo', '3mo', '6mo', '1y', '2y', '5y', '10y', 'ytd', 'max'
interval
= (optional) time interval for each candlestick. default:1d
- allowed values: 1m, 2m, 5m, 15m, 30m, 60m, 90m, 1h, 1d, 5d, 1wk, 1mo, 3mo
-
SatelliteMap
- satellite tracks via Celestrakbg_color
- (optional) rgb/hex color, default#000000
map_color
- (optional) rgb/hex color for map outline, default#404040
map_fill_color
- (optional) rgb/hex color for map fill, default#171717
map_stroke_width
- (optional) integer stroke width in pixels, default 2track_color
- (optional) rgb/hex color for tracks, default#00bf00
, default2
track_width
- (optional) integer track width, in pixelssatellite_color
- (optional) rgb/hex color for satellite marker pins, default#00ff00
pin_radius
- (optional) integer size of pins. Is eval expression, can usew
/h
vars for computed widget size. Default4
-
Metric
- a large metric that can pull from JSON APIs, and has a configurable subtitle labelurl
- the url to load from.bg_color
- bg color, in hex orrgb()
format.fg_color
- bg color, in hex orrgb()
format.label
- subtitle labelmode
- supported:json
json_path
- required - a dot notation keypath within the JSON loaded from to locate the number to display
-
Weather
- a weather widget, currently integrated with the National Weather Service APIlatitude
- a latitude for a location in the USAlongitude
- a longitude for a location in the usa
-
Text
(experimental)text
- text to displaysize
- font sizebg_color
- bg color, in hex orrgb()
format.fg_color
- bg color, in hex orrgb()
format.
On raspberry pi, /etc/rc.local
is a pretty easy place to run scripts at boot. Add this line before exit 0
:
You will likely need to change the username, path to the cloned repo, and any virtual env you might be using. This will run the graphics mode script as root, then run the main script as the normal user.
python3 /home/rich/aws-dash/gfxmode.py /dev/tty1 1
# if using a virtualenv
sudo -u rich bash -c 'cd /home/rich/fb-dashboard && source env/bin/activate && python3 -m fb_dashboard'
If not using a virtual environment you replace the last line above with this:
# if not using a virtualenv
sudo -u rich bash -c 'python3 cd /home/rich/fb-dashboard && python3 -m fb_dashboard'
# writes to `framebuffer.png` in current dir
python3 -m fb_dashboard --no-framebuffer
This isn't designed to be used with untrusted data. The config file eval()'s several sections to allow for dynamic configuration. This is by design, so I do not recommend running this as root with untrusted images. Ensure you have the latest versions of the dependencies so they have the latest security patches.
This project uses black for formatting.