Skip to content

Commit

Permalink
fixed screen sleep time
Browse files Browse the repository at this point in the history
  • Loading branch information
alexkv committed May 31, 2019
1 parent c396c3d commit bd89f1f
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 0 deletions.
10 changes: 10 additions & 0 deletions debian/local/disablescreenblank.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/usr/bin/env bash

screen=${1:-0}

# wait 20s for the display manager service to start and attach to screen
sleep 20

/usr/bin/xset -display :$screen s off # deactivate screen saver
/usr/bin/xset -display :$screen -dpms # disable DPMS
/usr/bin/xset -display :$screen s noblank # disable screen blanking
1 change: 1 addition & 0 deletions debian/octoprint-tft.install
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
debian/local/octoprint-tft-environment etc
debian/local/insserv.conf.d etc
debian/local/disablescreenblank.sh etc
1 change: 1 addition & 0 deletions debian/octoprint-tft.postinst
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ if [ "$1" = configure ] && [ -d /etc/systemd/system/ ]; then
echo "Display manager service is masked" >&2
elif [ -e "$SERVICE" ]; then
ln -sf "$SERVICE" "$DEFAULT_SERVICE"
chmod +x /etc/disablescreenblank.sh
else
echo "WARNING: $SERVICE is the selected default display manager but does not exist" >&2
rm -f "$DEFAULT_SERVICE"
Expand Down
1 change: 1 addition & 0 deletions debian/octoprint-tft.service
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ After=systemd-user-sessions.service [email protected] plymouth-quit.service
[Service]
EnvironmentFile=/etc/octoprint-tft-environment
ExecStart=/usr/bin/xinit /usr/bin/OctoPrint-TFT -- :0 -nolisten tcp -nocursor
ExecStartPost=/etc/disablescreenblank.sh 0
StandardOutput=journal
Restart=always
RestartSec=1s
Expand Down

0 comments on commit bd89f1f

Please sign in to comment.