Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9b4ff41145 | ||
|
|
1e13a6d4cd | ||
|
|
9d039b4e2c | ||
| 543383186a |
@@ -6,7 +6,7 @@ on:
|
|||||||
- '*'
|
- '*'
|
||||||
|
|
||||||
env:
|
env:
|
||||||
APP_NAME: slideshowApp
|
APP_NAME: slideshowapp
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
@@ -92,7 +92,7 @@ jobs:
|
|||||||
ARCH=${{ matrix.arch }}
|
ARCH=${{ matrix.arch }}
|
||||||
if [ "$ARCH" == "arm" ]; then ARCH="armhf"; fi
|
if [ "$ARCH" == "arm" ]; then ARCH="armhf"; fi
|
||||||
|
|
||||||
PKG_NAME="${APP_NAME}"
|
PKG_NAME="slideshowapp"
|
||||||
BUILD_DIR="${PKG_NAME}_${VERSION}_${ARCH}"
|
BUILD_DIR="${PKG_NAME}_${VERSION}_${ARCH}"
|
||||||
|
|
||||||
# 2. Create Directory Structure
|
# 2. Create Directory Structure
|
||||||
@@ -120,7 +120,7 @@ jobs:
|
|||||||
[Desktop Entry]
|
[Desktop Entry]
|
||||||
Type=Application
|
Type=Application
|
||||||
Name=Slideshow App
|
Name=Slideshow App
|
||||||
Exec=sh -c 'i=0; while [ $i -lt 30 ]; do if [ "$(ls -A /media/$USER 2>/dev/null)" ] && ping -c 1 -W 1 8.8.8.8 >/dev/null 2>&1; then break; fi; i=$((i+1)); sleep 1; done; cd /usr/share/$PKG_NAME && /usr/bin/$PKG_NAME'
|
Exec=sh -c 'i=0; while [ $i -lt 30 ]; do if [ "$(ls -A /media/$USER 2>/dev/null)" ] && ping -c 1 -W 1 8.8.8.8 >/dev/null 2>&1; then break; fi; i=$((i+1)); sleep 1; done; cd /usr/share/slideshowapp && /usr/bin/slideshowapp'
|
||||||
Terminal=false
|
Terminal=false
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
@@ -151,17 +151,17 @@ jobs:
|
|||||||
|
|
||||||
USER_HOME=$(getent passwd "$REAL_USER" | cut -d: -f6)
|
USER_HOME=$(getent passwd "$REAL_USER" | cut -d: -f6)
|
||||||
|
|
||||||
echo "Setting permissions for /usr/share/$PKG_NAME..."
|
echo "Setting permissions for /usr/share/slideshowapp..."
|
||||||
chown -R "$REAL_USER:$REAL_USER" /usr/share/$PKG_NAME
|
chown -R "$REAL_USER:$REAL_USER" /usr/share/slideshowapp
|
||||||
chmod -R 755 /usr/share/$PKG_NAME
|
chmod -R 755 /usr/share/slideshowapp
|
||||||
|
|
||||||
echo "Post-install: Target user is $REAL_USER"
|
echo "Post-install: Target user is $REAL_USER"
|
||||||
echo "Post-install: Target home is $USER_HOME"
|
echo "Post-install: Target home is $USER_HOME"
|
||||||
|
|
||||||
# 2. Setup .env from template
|
# 2. Setup .env from template
|
||||||
if [ ! -f "/usr/share/$PKG_NAME/.env" ]; then
|
if [ ! -f "/usr/share/slideshowapp/.env" ]; then
|
||||||
echo "Creating .env from template..."
|
echo "Creating .env from template..."
|
||||||
cp /usr/share/$PKG_NAME/env.template /usr/share/$PKG_NAME/.env || true
|
cp /usr/share/slideshowapp/env.template /usr/share/slideshowapp/.env || true
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# 3. Setup Autostart
|
# 3. Setup Autostart
|
||||||
@@ -171,11 +171,11 @@ jobs:
|
|||||||
if [ -d "$USER_HOME" ]; then
|
if [ -d "$USER_HOME" ]; then
|
||||||
echo "Creating autostart directory at $AUTOSTART_DIR"
|
echo "Creating autostart directory at $AUTOSTART_DIR"
|
||||||
mkdir -p "$AUTOSTART_DIR"
|
mkdir -p "$AUTOSTART_DIR"
|
||||||
cp /usr/share/$PKG_NAME/setup/$PKG_NAME.desktop "$AUTOSTART_DIR/"
|
cp /usr/share/slideshowapp/setup/slideshowapp.desktop "$AUTOSTART_DIR/"
|
||||||
|
|
||||||
# Critical: Change ownership of the folder and the file
|
# Critical: Change ownership of the folder and the file
|
||||||
chown -R "$REAL_USER:$REAL_USER" "$USER_HOME/.config"
|
chown -R "$REAL_USER:$REAL_USER" "$USER_HOME/.config"
|
||||||
chmod 644 "$AUTOSTART_DIR/$PKG_NAME.desktop"
|
chmod 644 "$AUTOSTART_DIR/slideshowapp.desktop"
|
||||||
else
|
else
|
||||||
echo "ERROR: Home directory $USER_HOME not found. Autostart not configured."
|
echo "ERROR: Home directory $USER_HOME not found. Autostart not configured."
|
||||||
fi
|
fi
|
||||||
|
|||||||
1
.gitignore
vendored
1
.gitignore
vendored
@@ -1,5 +1,6 @@
|
|||||||
images/
|
images/
|
||||||
slideshowApp
|
slideshowApp
|
||||||
|
slideshowapp
|
||||||
schedule.json
|
schedule.json
|
||||||
*.log
|
*.log
|
||||||
*.exe
|
*.exe
|
||||||
@@ -66,7 +66,7 @@ func GetInterval() string {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if interval, ok := settings["default_interval"]; ok {
|
if interval, ok := settings["default_interval"]; ok {
|
||||||
return interval.(string)
|
return fmt.Sprintf("%v", interval)
|
||||||
}
|
}
|
||||||
return "10"
|
return "10"
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user