{"id":23,"date":"2013-10-28T09:45:00","date_gmt":"2013-10-27T23:45:00","guid":{"rendered":"https:\/\/www.serenux.com\/?p=23"},"modified":"2021-01-11T09:48:11","modified_gmt":"2021-01-10T23:48:11","slug":"howto-launch-and-terminate-an-impress-powerpoint-presentation-from-a-terminal","status":"publish","type":"post","link":"https:\/\/www.serenux.com\/index.php\/2013\/10\/28\/howto-launch-and-terminate-an-impress-powerpoint-presentation-from-a-terminal\/","title":{"rendered":"HowTo: Launch and terminate an Impress (PowerPoint) presentation from a Terminal"},"content":{"rendered":"\n<p>The scenario is simple: You have a kiosk or display machine showing information, eg: a self-updating webpage. On a schedule you want to launch an Impress or PowerPoint presentation on the display which will loop. You want that loop to only run for a few minutes before terminating and going back to what was originally being displayed.<\/p>\n\n\n\n<p>How do you do this?<\/p>\n\n\n\n<p><br><strong>Procedure:<\/strong><\/p>\n\n\n\n<ol class=\"wp-block-list\"><li>First of all you need a presentation file. If the original is from PowerPoint, load it into Impress and re-save it as an ODP file.<br><\/li><li>Make sure that your presentation has been cleared of all \u201cOn Click\u201d events, ie: All slides should advance automatically after X seconds. Any animated components within a slide should be updated to occur after the last action.<br><\/li><li>Make sure your presentation is set to automatically loop at the end (Slideshow Menu->SlideShow Settings->Type set to Auto with zero seconds).<br><\/li><li>Save your changes.<br><\/li><li>Copy your presentation over to your kiosk machine.<br><\/li><li>Using SSH or a local terminal, bring up the crontab into your favourite text editor (default is Nano with Ubuntu) with:<br><br><code>$ crontab -e<\/code><br><\/li><li>Now, assuming your presentation is at \/home\/kiosk\/Documents\/MyPreso.odp, add\u00a0 the following lines:<br><br><code>00 10 * * * DISPLAY=:0 \/usr\/lib\/libreoffice\/program\/simpress -show \/home\/dashboard\/Documents\/MyPreso.odp --norestore<br>15 10 * * * \/usr\/bin\/killall soffice.bin<\/code><br><br>What the above lines will do is launch Impress to open your MyPreso presentation in Show Mode at 10:00am on the dot on the first display (screen zero). The \u201c\u2013norestore\u201d parameter prevents LibreOffice from asking if you want to recover any files which will occur if you terminate LibreOffice instead of closing the app as normal (we can\u2019t because it\u2019s a kiosk, remember?). Then, at 10:15am, the LibreOffice task will be terminated, thus ending the looping presentation.<br><\/li><li>Now save your changes and exit the text editor. if using Nano, you\u2019d press CTRL+X, then \u201cY\u201d and then Enter<br><\/li><li>Now test your schedule.<\/li><\/ol>\n\n\n\n<p><strong>That\u2019s cool. Now can we configure it to have a different presentation to run each day?<\/strong><\/p>\n\n\n\n<p>This is quite easy to do.<\/p>\n\n\n\n<ol class=\"wp-block-list\"><li>First generate all the different presentations you will need to run on each day of the week. Name them accordingly. In this example we are naming them MyMondayPreo.odp, MyTuesdayPreso.odp, and so forth.<br><\/li><li>Now modify the crontab to look like the following:<br><br><code>00 10 * * 1 DISPLAY=:0 \/usr\/lib\/libreoffice\/program\/simpress -show \/home\/dashboard\/Documents\/MyMondayPreso.odp --norestore # Monday <br>00 10 * * 2 DISPLAY=:0 \/usr\/lib\/libreoffice\/program\/simpress -show \/home\/dashboard\/Documents\/MyTuesdayPreso.odp --norestore # Tuesday<br>00 10 * * 3 DISPLAY=:0 \/usr\/lib\/libreoffice\/program\/simpress -show \/home\/dashboard\/Documents\/MyWednesdayPreso.odp --norestore # Wednesday<br>00 10 * * 4 DISPLAY=:0 \/usr\/lib\/libreoffice\/program\/simpress -show \/home\/dashboard\/Documents\/MyThusdayPreso.odp --norestore # Thursday<br>00 10 * * 5 DISPLAY=:0 \/usr\/lib\/libreoffice\/program\/simpress -show \/home\/dashboard\/Documents\/MyFridayPreso.odp --norestore # Friday<br>15 10 * * * \/usr\/bin\/killall soffice.bin<\/code><br><br>You will notice that each line has one of the asterisks replaced with a number 1 through 5. This tells cron only to run that schedule on the day specified. In this case, the 1 represents Monday, the 2 is Tuesday, the 3 is Wednesday and so forth. Saturday is 6 and Sunday is both 1 or 7.<br><br>You may be wondering why we only have one killall command instead of five? We don\u2019t need five as the command to kill LibreOffice is the same each time, so it doesn\u2019t need a day designation \u2013 it will run every day at 10:15am.<br><\/li><li>Save your changes and test.<\/li><\/ol>\n\n\n\n<p>Now you can schedule your presentations to appear and disappear as required without manually interrupting the normal display on that kiosk. Naturally these instructions can be adapted for other uses.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>The scenario is simple: You have a kiosk or display machine showing information, eg: a self-updating webpage. On a schedule you want to launch an Impress or PowerPoint presentation on the display which will loop. You want that loop to only run for a few minutes before terminating and going back to what was originally [&hellip;]<\/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":[],"class_list":["post-23","post","type-post","status-publish","format-standard","hentry","category-tutorials"],"_links":{"self":[{"href":"https:\/\/www.serenux.com\/index.php\/wp-json\/wp\/v2\/posts\/23","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.serenux.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.serenux.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.serenux.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.serenux.com\/index.php\/wp-json\/wp\/v2\/comments?post=23"}],"version-history":[{"count":1,"href":"https:\/\/www.serenux.com\/index.php\/wp-json\/wp\/v2\/posts\/23\/revisions"}],"predecessor-version":[{"id":24,"href":"https:\/\/www.serenux.com\/index.php\/wp-json\/wp\/v2\/posts\/23\/revisions\/24"}],"wp:attachment":[{"href":"https:\/\/www.serenux.com\/index.php\/wp-json\/wp\/v2\/media?parent=23"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.serenux.com\/index.php\/wp-json\/wp\/v2\/categories?post=23"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.serenux.com\/index.php\/wp-json\/wp\/v2\/tags?post=23"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}