Skip to content

Commit

Permalink
add browser based file manager
Browse files Browse the repository at this point in the history
  • Loading branch information
ogra1 committed Nov 16, 2020
1 parent 8e8aafd commit 1187c74
Show file tree
Hide file tree
Showing 2 changed files with 57 additions and 8 deletions.
58 changes: 50 additions & 8 deletions snap/snapcraft.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,22 @@ summary: A kiosk image viewer intended for use with mir-kiosk
description: |
Image viewer for mir-kiosk based on imv
Put Pictures into /var/snap/picviewer-kiosk/common/,
restart the snap with "snap restart picviewer-kiosk" and the
Pictures will run as a slideshow at a 10 second rotation
frequency.
To manage pictures shown by the Image Viewer, open
http://<IP of your kiosk device>:8080/ and upload some
picture files to the directory, a slideshow will automatically
start on the Image Viewer screen.
Support for over 30 different image file formats including
Imv has support for over 30 different image file formats including
- Photoshop PSD files
- Animated GIFS
- Various RAW formats
Configurable key bindings and behaviour
To find out more about imv go to
https://github.com/eXeC64/imv
To find out more about the FileManager tool used, go to
https://github.com/serverwentdown/file-manager
To find out more about the snap package of imv go to
https://github.com/ogra1/picviewer-kiosk
Expand All @@ -26,8 +28,8 @@ grade: stable
confinement: strict

apps:
picviewer-kiosk:
command: snap/command-chain/desktop-launch $SNAP/usr/bin/imv -b checks -f -t 10 $SNAP_COMMON/
imv:
command: snap/command-chain/desktop-launch $SNAP/usr/bin/imv -f -t 10 -r $SNAP_DATA/
daemon: simple
restart-condition: always
extensions: [ gnome-3-28 ]
Expand All @@ -36,6 +38,15 @@ apps:
- network-bind
- opengl
- wayland
file-browser:
command: bin/node $SNAP/index.js
daemon: simple
plugs:
- network
- network-bind
watcher:
command: watcher.sh
daemon: simple

parts:
imv:
Expand Down Expand Up @@ -71,3 +82,34 @@ parts:
- libopenjp2-7
- libraw16
- libwebpmux3
filebrowser:
source: https://github.com/serverwentdown/file-manager.git
source-depth: 1
plugin: nodejs
nodejs-version: 10.21.0
nodejs-package-manager: npm
build-environment:
- PATH: "$PATH:$SNAPCRAFT_PART_SRC/../npm/bin"
- PATH: "$PATH:$SNAPCRAFT_PART_BUILD/node_modules/.bin"
- NPM_CONFIG_UNSAFE_PERM: "true"
override-build: |
# workaround for build.snapcraft.io builds
# https://bugs.launchpad.net/bugs/1886861
if [ -n "$http_proxy" ]; then
export ELECTRON_GET_USE_PROXY=1
export GLOBAL_AGENT_HTTP_PROXY="${http_proxy}"
export GLOBAL_AGENT_HTTPS_PROXY="${http_proxy}"
fi
npm install
cp -av index.js $SNAPCRAFT_PART_INSTALL/
cp -av node_modules $SNAPCRAFT_PART_INSTALL/
cp -av views $SNAPCRAFT_PART_INSTALL/
cp -av assets $SNAPCRAFT_PART_INSTALL/
cp -av $SNAPCRAFT_PART_SRC/../npm/bin $SNAPCRAFT_PART_INSTALL/
cp -av $SNAPCRAFT_PART_SRC/../npm/lib/node_modules/* $SNAPCRAFT_PART_INSTALL/node_modules/
watcher:
plugin: dump
source: watcher
stage-packages:
- inotify-tools
7 changes: 7 additions & 0 deletions watcher/watcher.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#! /bin/sh

inotifywait -m $SNAP_DATA -e create -e moved_to |
while read dir action file; do
echo "The file '$file' appeared in directory '$dir' via '$action'"
snapctl restart "$SNAP_NAME".imv
done

0 comments on commit 1187c74

Please sign in to comment.