{"id":85,"date":"2018-10-21T22:41:33","date_gmt":"2018-10-21T20:41:33","guid":{"rendered":"https:\/\/leeryanrs.com\/?p=85"},"modified":"2018-10-21T22:41:33","modified_gmt":"2018-10-21T20:41:33","slug":"bash-script-loops","status":"publish","type":"post","link":"https:\/\/leeryanrs.com\/?p=85","title":{"rendered":"Bash script loops"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">I&#8217;ve recently had to do some a project where I needed to launch a specific application on login of user account in an Ubuntu environment and where if it was closed, it would re-open again countless times. This is accomplished with the below &#8211;\u00a0<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">sudo install -b -m 755 \/dev\/stdin \/opt\/autolaunch.sh &lt;&lt; EOF<br>!\/bin\/bash<br>xset -dpms<br>xset s off<br><br>while true; do<br>***APPLICATION COMMAND GOES HERE***<br>done<br>EOF<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">The above installs the script to launch at startup from the location \/opt\/autolaunch.sh. The first two commands are disabling power saving and the screensaver. The last part is the while loop.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I&#8217;ve recently had to do some a project where I needed to launch a specific application on login of user account in an Ubuntu environment and where if it was closed, it would re-open again countless times. This is accomplished with the below &#8211;\u00a0 sudo install -b -m 755 \/dev\/stdin \/opt\/autolaunch.sh &lt;&lt; EOF!\/bin\/bashxset -dpmsxset s [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4,9,13,17],"tags":[26,43,50],"class_list":["post-85","post","type-post","status-publish","format-standard","hentry","category-bash","category-linux","category-script","category-ubuntu","tag-bash","tag-script","tag-ubuntu"],"_links":{"self":[{"href":"https:\/\/leeryanrs.com\/index.php?rest_route=\/wp\/v2\/posts\/85","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/leeryanrs.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/leeryanrs.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/leeryanrs.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/leeryanrs.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=85"}],"version-history":[{"count":0,"href":"https:\/\/leeryanrs.com\/index.php?rest_route=\/wp\/v2\/posts\/85\/revisions"}],"wp:attachment":[{"href":"https:\/\/leeryanrs.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=85"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/leeryanrs.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=85"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/leeryanrs.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=85"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}