{"id":94,"date":"2016-10-19T23:29:11","date_gmt":"2016-10-19T16:29:11","guid":{"rendered":"http:\/\/prosindo.com\/blog\/?p=94"},"modified":"2016-10-19T23:29:11","modified_gmt":"2016-10-19T16:29:11","slug":"turning-onoff-monitor-raspberry-pi-scripts","status":"publish","type":"post","link":"https:\/\/prosindo.com\/blog\/2016\/10\/19\/turning-onoff-monitor-raspberry-pi-scripts\/","title":{"rendered":"Turning On\/Off Monitor Raspberry Pi Scripts"},"content":{"rendered":"<p>You can use these scripts to turn on\/off monitor of raspberry pi<\/p>\n<p>screen_off.sh:<br \/>\n<code>#!\/bin\/sh<\/code><br \/>\n<code> tvservice --off &gt; \/dev\/null<\/code><\/p>\n<p>screen_on.sh:<br \/>\n<code> #!\/bin\/sh<\/code><br \/>\n<code> export DISPLAY=:0<\/code><br \/>\n<code> tvservice -p<\/code><br \/>\n<code> fbset -depth 8; fbset -depth 16; xrefresh<\/code><\/p>\n<p>Another option (this is failed when tested because apt-get doesnt found cec-util package):<\/p>\n<p><code>apt-get install cec-util<\/code><\/p>\n<p># Screen on, change to the active input of the Pi<\/p>\n<p><code>echo \"on 0\" | cec-client -s &gt; \/dev\/null<br \/>\n<\/code><code>sleep 5<\/code><br \/>\n<code> echo \"as\" | cec-client -s &gt; \/dev\/null<\/code><\/p>\n<p>#Screen off<br \/>\n<code> echo \"standby 0\" | cec-client -s<\/code><\/p>\n<p>Source:<br \/>\n&#8211; https:\/\/www.danpurdy.co.uk\/web-development\/raspberry-pi-kiosk-screen-tutorial\/<\/p>\n","protected":false},"excerpt":{"rendered":"<p>You can use these scripts to turn on\/off monitor of raspberry pi screen_off.sh: #!\/bin\/sh tvservice &#8211;off &gt; \/dev\/null screen_on.sh: #!\/bin\/sh export DISPLAY=:0 tvservice -p fbset -depth 8; fbset -depth 16; xrefresh Another option (this is failed when tested because apt-get doesnt found cec-util package): apt-get install cec-util # Screen on, change to the active input &hellip; <a href=\"https:\/\/prosindo.com\/blog\/2016\/10\/19\/turning-onoff-monitor-raspberry-pi-scripts\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Turning On\/Off Monitor Raspberry Pi Scripts&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[16,20,25,28],"class_list":["post-94","post","type-post","status-publish","format-standard","hentry","category-uncategorized","tag-monitor","tag-raspberry-pi","tag-script","tag-tvservice"],"_links":{"self":[{"href":"https:\/\/prosindo.com\/blog\/wp-json\/wp\/v2\/posts\/94","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/prosindo.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/prosindo.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/prosindo.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/prosindo.com\/blog\/wp-json\/wp\/v2\/comments?post=94"}],"version-history":[{"count":0,"href":"https:\/\/prosindo.com\/blog\/wp-json\/wp\/v2\/posts\/94\/revisions"}],"wp:attachment":[{"href":"https:\/\/prosindo.com\/blog\/wp-json\/wp\/v2\/media?parent=94"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/prosindo.com\/blog\/wp-json\/wp\/v2\/categories?post=94"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/prosindo.com\/blog\/wp-json\/wp\/v2\/tags?post=94"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}