forked from ogra1/picviewer-kiosk
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsnapcraft.yaml
109 lines (100 loc) · 3.15 KB
/
snapcraft.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
name: omabox
version: git
summary: Internet-connected digital picture frames for Ubuntu Core on a RPi.
description: |
A Raspberry Pi with a screen that loops over a local directory with pictures and periodically refreshes these from a Backblaze B2 bucket. New pictures in the bucket will, after a while, automatically show up on the picture frame.
Install Ubuntu Core on a Raspberry Pi and create a Backblaze B2 bucket with some pictures. Create a new B2 App Key pair with read-only access to the bucket. Install the mir-kiosk snap, needed to run graphical applications. The omaBOX snap is next. Configure the B2 bucket and App Key pair.
snap install mir-kiosk
snap install omabox
snap set omabox b2-application-key-id=123abc b2-application-key=abc123 b2-bucket=abc
Pictures are show for 10 seconds each, this can be changed via the snap config.
snap set omabox imv-duration=30
More settings at https://github.com/cimm/omabox
base: core18
grade: stable
confinement: strict
license: MIT
architectures:
- build-on: amd64
- build-on: armhf
- build-on: arm64
- build-on: s390x
- build-on: ppc64el
apps:
imv:
command: snap/command-chain/desktop-launch $SNAP/bin/imv-wrapper.py
daemon: simple
restart-condition: always
extensions: [ gnome-3-28 ]
plugs: [ network-bind, opengl, wayland ]
download:
command: usr/bin/python3 $SNAP/bin/download.py
daemon: oneshot # runs as root
timer: '00:00-24:00/12' # every 2 hours
plugs: [ network ]
upload:
command: usr/bin/python3 $SNAP/bin/upload.py
daemon: oneshot
timer: '00:00-24:00/6' # every 4 hours
plugs: [ network ]
brightness:
command: usr/bin/python3 $SNAP/bin/brightness.py
daemon: oneshot
timer: '00:00-24:00/48' # every half hour
plugs: [ display-control ]
# connect manually via `snap connect omabox:display-control`
reconnect:
command: $SNAP/bin/reconnect.sh
daemon: oneshot
timer: '04:00'
plugs: [ network-setup-control ]
# connect manually via `snap connect omabox:network-setup-control`
hooks:
configure:
plugs: [ network ]
parts:
imv:
source: https://github.com/eXeC64/imv.git
source-depth: 1
source-tag: v4.1.0
plugin: make
override-build: |
# force wayland-only build
sed -i 's/^WINDOWS=all/WINDOWS=wayland/g' config.mk
# force single threaded build to make xsltproc not fail
make -j1
make install DESTDIR=$SNAPCRAFT_PART_INSTALL
build-packages:
- asciidoc
- libfreeimage-dev
- libglu1-mesa-dev
- libcmocka-dev
- librsvg2-dev
- libwayland-dev
- xsltproc
stage-packages:
- libfreeimage3
- libgomp1
- libilmbase12
- libjxr0
- libopenexr22
- libopenjp2-7
- libraw16
- libwebpmux3
b2:
plugin: python
python-packages: [ b2 ]
scripts:
source: scripts/
plugin: dump
organize:
brightness.py: bin/brightness.py
download.py: bin/download.py
imv-wrapper.py: bin/imv-wrapper.py
upload.py: bin/upload.py
reconnect.sh: bin/reconnect.sh
upload:
source: upload/dist
plugin: dump
organize:
index.html: upload/index.html