Skip to content

Commit

Permalink
linux: improve systemd service and startup script
Browse files Browse the repository at this point in the history
  • Loading branch information
mcallegari committed Apr 1, 2024
1 parent 650cb6d commit 8337821
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
9 changes: 8 additions & 1 deletion platforms/linux/qlcplus-start.sh
Expand Up @@ -17,7 +17,14 @@
# See the License for the specific language governing permissions and
# limitations under the License.

QLCPLUS_OPTS="-platform eglfs --nowm --web --web-auth --operate --overscan"
# detect HDMI plug state
QTPLATFORM="eglfs"
kmsprint -m | grep connected > /dev/null
if [ $? -eq 1 ]; then
QTPLATFORM="offscreen"
fi

QLCPLUS_OPTS="-platform $QTPLATFORM --nowm --web --web-auth --operate --overscan"

if [ ! -f $HOME/.qlcplus/eglfs.json ]; then
mkdir -p $HOME/.qlcplus
Expand Down
4 changes: 2 additions & 2 deletions platforms/linux/qlcplus.service
@@ -1,12 +1,12 @@
[Unit]
Description=Q Light Controller Plus
Documentation=man:qlcplus(1)
After=network.target
After=basic.target

[Service]
Type=simple
User=pi
Restart=always
Restart=on-failure
RestartSec=3
ExecStart=/usr/sbin/qlcplus-start.sh

Expand Down

0 comments on commit 8337821

Please sign in to comment.