{"id":326,"date":"1997-09-09T01:36:29","date_gmt":"1997-09-09T09:36:29","guid":{"rendered":"http:\/\/www.birdhouse.org\/betips\/?p=326"},"modified":"1997-09-09T01:36:29","modified_gmt":"1997-09-09T09:36:29","slug":"running-console-apps-from-the-desktop","status":"publish","type":"post","link":"https:\/\/www.betips.net\/?p=326","title":{"rendered":"Running console apps from the Desktop"},"content":{"rendered":"<p>If you want to be able to run console-based applications or scripts by double-clicking icons on the Desktop or in the Tracker, there are several ways to go about it. If you&#8217;re just running a script, the easiest way is to make sure you&#8217;ve got the magic cookie as the script&#8217;s first line, e.g.:<\/p>\n<pre>#!\/bin\/sh<\/pre>\n<p>And then make the script executable with, e.g.:<\/p>\n<pre>chmod 755 scriptname<\/pre>\n<p>If you want to get a little fancier, and make sure the program&#8217;s name appears in the title tab of the Terminal windows, you&#8217;ll need to invoke them from a secondary script. That script will launch a Terminal session and pass the desired app or script to it as an argument. Create a file on the Desktop with these contents:<\/p>\n<pre>\nTerminal -t \"Window Title Here\" \/bin\/sh --login -i -c your_app_here <\/pre>\n<p>This starts Terminal with the title of your choice (-t), starts the BASH shell in interactive mode, and passes the command after -c to the shell. Now just make your shell script executable (<code>chmod a+x yourshellscript<\/code>) from the Terminal.<br \/>\nFor example, let&#8217;s say you want to run a <a href=\"\/software\/\">keepalive<\/a> script to keep your Internet connection awake, and you don&#8217;t want to have to launch a Terminal and type the keepalive command by hand each time. Just create an executable text file on the Desktop, containing:<\/p>\n<pre>\nTerminal -t \"Connection Keeper\" \/bin\/sh --login -i -c keepalive <\/pre>\n<p>As long as the keepalive script is already in your path, you&#8217;re all set.<br \/>\nNote that a program like <a href=\"http:\/\/www.bebits.com\/app\/843\">xicon<\/a> will do the same thing AND will give you the ability to drag\/drop files onto your script icons for passing to the script.<br \/>\n<i>rabba@maine.rr.com contributed to this tip.<\/i><\/p>\n","protected":false},"excerpt":{"rendered":"<p>If you want to be able to run console-based applications or scripts by double-clicking icons on the Desktop or in the Tracker, there are several ways to go about it. If you&#8217;re just running a script, the easiest way is to make sure you&#8217;ve got the magic cookie as the script&#8217;s first line, e.g.: #!\/bin\/sh [&hellip;]<\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[11],"class_list":["post-326","post","type-post","status-publish","format-standard","hentry","tag-terminal"],"_links":{"self":[{"href":"https:\/\/www.betips.net\/index.php?rest_route=\/wp\/v2\/posts\/326","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.betips.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.betips.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.betips.net\/index.php?rest_route=\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/www.betips.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=326"}],"version-history":[{"count":0,"href":"https:\/\/www.betips.net\/index.php?rest_route=\/wp\/v2\/posts\/326\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.betips.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=326"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.betips.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=326"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.betips.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=326"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}