{"id":1327,"date":"2021-04-15T15:40:56","date_gmt":"2021-04-15T15:40:56","guid":{"rendered":"\/blog\/?p=1327"},"modified":"2021-04-15T15:40:56","modified_gmt":"2021-04-15T15:40:56","slug":"set-kodi-to-autostart-in-the-vga-port-in-elementaryos","status":"publish","type":"post","link":"\/blog\/index.php\/set-kodi-to-autostart-in-the-vga-port-in-elementaryos\/","title":{"rendered":"Set Kodi to autostart in the VGA port in ElementaryOS"},"content":{"rendered":"\n<p>Create file \/lib\/systemd\/system\/kodi.service with contents<\/p>\n\n\n\n<p><code>[Unit]<br>Description = Kodi Media Center<br>After = remote-fs.target network-online.target<br>Wants = network-online.target<br>[Service]<br>User = root<br>Group = root<br>Type = simple<br>ExecStart = \/scripts\/kodi.sh<br>Restart = on-abort<br>RestartSec = 5<br>[Install]<br>WantedBy = multi-user.target<\/code><\/p>\n\n\n\n<p>Run:<code> systemctl daemon-reload<\/code><\/p>\n\n\n\n<p>create \/scripts\/kodi.sh<\/p>\n\n\n\n<p><code>#!\/bin\/sh<br>xinit \/scripts\/kodi.bash<br>exit $?<\/code><\/p>\n\n\n\n<p>create \/scripts\/kodi.bash<\/p>\n\n\n\n<p><code>#!\/bin\/sh<br>(while true;do<br>xrandr --output LVDS-1 --off --output VGA-1 --auto > \/var\/log\/xrandr.log 2>&amp;1<br>sleep 2<br>done) &amp;<br>\/usr\/bin\/kodi-standalone<br>exit $?<\/code><\/p>\n\n\n\n<p>Setup the system to start on multiuser level: <code>systemctl set-default multi-user.target<\/code><\/p>\n\n\n\n<p>To go back to the default login level: <code>systemctl set-default graphical.target<\/code><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Create file \/lib\/systemd\/system\/kodi.service with contents [Unit]Description = Kodi Media CenterAfter = remote-fs.target network-online.targetWants = network-online.target[Service]User = rootGroup = rootType = simpleExecStart = \/scripts\/kodi.shRestart = on-abortRestartSec = 5[Install]WantedBy = multi-user.target Run: systemctl daemon-reload create \/scripts\/kodi.sh #!\/bin\/shxinit \/scripts\/kodi.bashexit $? create \/scripts\/kodi.bash #!\/bin\/sh(while true;doxrandr &#8211;output LVDS-1 &#8211;off &#8211;output VGA-1 &#8211;auto > \/var\/log\/xrandr.log 2>&amp;1sleep 2done) &amp;\/usr\/bin\/kodi-standaloneexit $? Setup the [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-1327","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"\/blog\/index.php\/wp-json\/wp\/v2\/posts\/1327","targetHints":{"allow":["GET"]}}],"collection":[{"href":"\/blog\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"\/blog\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"\/blog\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"\/blog\/index.php\/wp-json\/wp\/v2\/comments?post=1327"}],"version-history":[{"count":1,"href":"\/blog\/index.php\/wp-json\/wp\/v2\/posts\/1327\/revisions"}],"predecessor-version":[{"id":1328,"href":"\/blog\/index.php\/wp-json\/wp\/v2\/posts\/1327\/revisions\/1328"}],"wp:attachment":[{"href":"\/blog\/index.php\/wp-json\/wp\/v2\/media?parent=1327"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"\/blog\/index.php\/wp-json\/wp\/v2\/categories?post=1327"},{"taxonomy":"post_tag","embeddable":true,"href":"\/blog\/index.php\/wp-json\/wp\/v2\/tags?post=1327"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}