Skip to content

Commit

Permalink
add deployment examples
Browse files Browse the repository at this point in the history
  • Loading branch information
andreasgerstmayr committed May 22, 2024
1 parent 27cd9c1 commit 08e8a2a
Show file tree
Hide file tree
Showing 5 changed files with 77 additions and 5 deletions.
11 changes: 6 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# ambience

ambience shows your favorite pictures from [Immich](https://immich.app/) in a slideshow on your TV.
Portrait pictures are arranged side-by-side, and date and location (if available) will be shown.
ambience shows selected pictures from [Immich](https://immich.app/) in a slideshow on your TV.
Portrait pictures are arranged side-by-side, and date and location (if available) of the pictures will be displayed.

[![Screenshot](deploy/example.png)](deploy/example.png)

Expand All @@ -21,23 +21,24 @@ Portrait pictures are arranged side-by-side, and date and location (if available
| Left arrow | Show previous slide and pause slideshow |
| Right arrow | Show next slide and pause slideshow |
| Space<br>Play/Pause Media Key | Play / Pause |
| S<br>Stop Media Key | Pause |
| P | Play |
| S<br>Stop Media Key | Pause |

## Deployment

ambience is a Node.js web application, packaged in a container.
You can point a browser on your TV directly to ambience, or attach a Raspberry PI or Mini PC to your TV and open ambience in fullscreen (e.g. Chrome Kiosk mode).
You can point the browser on your TV directly to ambience, or attach a Raspberry PI or Mini PC to your TV and open ambience in fullscreen (e.g. Chrome Kiosk mode).
The [deploy](deploy/) folder contains examples using a Raspberry PI, incl. support for HDMI-CEC to control the slideshow with a TV remote.

## Development

Start development server:
To start the development server, use the following commands:

```
export IMMICH_HOST=https://immich.local
export IMMICH_API_KEY=...
export IMMICH_ALBUMS=...
npm install
npm run dev -- --open
```
12 changes: 12 additions & 0 deletions deploy/cec.service
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
[Unit]
Description=Kiosk CEC
Requires=dev-cec0.device
After=dev-cec0.device

[Service]
User=pi
Group=pi
ExecStart=/home/pi/cec.sh

[Install]
WantedBy=default.target
33 changes: 33 additions & 0 deletions deploy/cec.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
#!/bin/sh

export DISPLAY=:0

echo as | cec-client | while IFS= read -r line
do
case "$line" in
*"key pressed: left"*"current"*)
echo Left
xdotool key Left
;;

*"key pressed: right"*"current"*)
echo Right
xdotool key Right
;;

*"key pressed: select"*"current"*)
echo Select
xdotool key space
;;

*"key pressed: play"*"current"*)
echo Play
xdotool key P
;;

*"key pressed: pause"*"current"*)
echo Pause
xdotool key S
;;
esac
done
11 changes: 11 additions & 0 deletions deploy/kiosk.service
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[Unit]
Description=Chromium Kiosk
Requires=network-online.target
After=network-online.target
After=systemd-user-sessions.service plymouth-quit-wait.service

[Service]
ExecStart=/usr/bin/xinit /home/pi/kiosk.sh

[Install]
WantedBy=default.target
15 changes: 15 additions & 0 deletions deploy/kiosk.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/bin/sh

# disable DPMS and prevent screen from blanking
/usr/bin/xset s off -dpms

# hide cursor after 1s
/usr/bin/unclutter -idle 1 -root &

# start chromium as 'pi' user
/usr/bin/sudo -H -u pi -- /usr/bin/chromium-browser \
--kiosk \
--start-fullscreen \
--start-maximized \
--window-size=1920,1080 \
htts://ambience.local

0 comments on commit 08e8a2a

Please sign in to comment.