{"id":1355,"date":"2013-10-08T20:05:23","date_gmt":"2013-10-08T20:05:23","guid":{"rendered":"https:\/\/raspberry-projects.com\/pi\/?p=1355"},"modified":"2014-09-26T15:05:13","modified_gmt":"2014-09-26T15:05:13","slug":"desktop-shortcuts","status":"publish","type":"post","link":"https:\/\/raspberry-projects.com\/pi\/pi-operating-systems\/raspbian\/gui\/desktop-shortcuts","title":{"rendered":"Desktop Shortcuts"},"content":{"rendered":"<h4>\nAdding A New Desktop Shortcut<br \/>\n<\/h4>\n<p>\nCreate a new text file called yourname.desktop in the \/home\/pi\/Desktop\/ directory, e.g. \/home\/pi\/Desktop\/yourname.desktop\n<\/p>\n<p>\nIt should contain the following:\n<\/p>\n<pre>\r\n<code>\r\n[Desktop Entry]\r\nName=My Name\r\nComment=My application which does this\r\nIcon=\/usr\/share\/pixmaps\/openbox.xpm\r\nExec=\/usr\/bin\/leafpad\r\nType=Application\r\nEncoding=UTF-8\r\nTerminal=false\r\nCategories=None;\r\n<\/code><\/pre>\n<p>\n&nbsp;\n<\/p>\n<p>\nName &#8211; The name you want displayed\n<\/p>\n<p>\nComment &#8211; Your comment\n<\/p>\n<p>\nIcon &#8211; A file to use for the icon. &nbsp;Your own or have a look in the \/usr\/share\/pixmaps\/ directory for something suitable.\n<\/p>\n<p>\nExec &#8211; The executable (can include sudo if your executable uses the IO). Can be the name of an executable program, or more complex, e.g. Exec=lxterminal &#8211;command &quot;less \/root\/README.TXT&quot;\n<\/p>\n<h4>\nExecuting A Command In LX Terminal<br \/>\n<\/h4>\n<p>\nThe following will open LX terminal, wait&nbsp;for 5 seconds and then it will close:\n<\/p>\n<pre>\r\n<code>\r\n\r\n[Desktop Entry]\r\nName=Name to be shown on desktop\r\nComment=My comment\r\nIcon=\/usr\/share\/pixmaps\/openbox.xpm\r\nExec=lxterminal -t &quot;Tile to display&quot; -e sleep 5\r\nType=Application\r\nEncoding=UTF-8\r\nTerminal=false\r\nCategories=None;\r\n<\/code><\/pre>\n<p>\nLX Terminal will auto close once the command is complete. &nbsp;You can&#39;t give more than 1 command in the -e launch options (you can&#39;t give it &quot;-e dosomething ; sleep 5&quot; for instance as a way to make it hold showing the result after dosomething.&nbsp;\n<\/p>\n<h4>\nStopping The LX Terminal Auto Closing Or Doing Multiple Things<br \/>\n<\/h4>\n<p>\nThe simple way to get round the Lxterminal only being able to take one command is to have it run a bash script.\n<\/p>\n<h5>\nThe .desktop file<br \/>\n<\/h5>\n<pre>\r\n<code>\r\n[Desktop Entry]\r\nName=Name to be shown on desktop\r\nComment=My comment\r\nIcon=\/usr\/share\/pixmaps\/openbox.xpm\r\nExec=lxterminal -t &quot;Sending Crack The Code MAIN Leader Board To Internet&quot; --working-directory=\/home\/pi\/projects\/scripts\/ -e .\/myscript.sh \r\nType=Application\r\nEncoding=UTF-8\r\nTerminal=false\r\nCategories=None;\r\n<\/code><\/pre>\n<h5>\nThe .sh script<br \/>\n<\/h5>\n<pre>\r\n<code>\r\n#!\/bin\/bash\r\n\r\necho &quot;Starting upload of database&quot;\r\nread dummy\r\necho &quot;next&quot;\r\nmysqldump -h localhost -u user1 -p123456789 mydatabase tbl_universities | mysql -h mydomain.com -u user1 -p123456789 mydatabase\r\necho &quot;Complete. Press return to exit&quot;\r\nread dummy\r\n<\/code><\/pre>\n<p>\nRemember to set the files permissions so it is executable (right click &gt; properties in the file manager)\n<\/p>\n<p>\n&nbsp;\n<\/p>\n<p>\n&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Adding A New Desktop Shortcut Create a new text file called yourname.desktop in the \/home\/pi\/Desktop\/ directory, e.g. \/home\/pi\/Desktop\/yourname.desktop It should contain the following: [Desktop Entry] Name=My Name Comment=My application which does this Icon=\/usr\/share\/pixmaps\/openbox.xpm Exec=\/usr\/bin\/leafpad Type=Application Encoding=UTF-8 Terminal=false Categories=None; &nbsp; Name &#8211; The name you want displayed Comment &#8211; Your comment Icon &#8211; A file to [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[33],"tags":[],"class_list":["post-1355","post","type-post","status-publish","format-standard","hentry","category-gui"],"_links":{"self":[{"href":"https:\/\/raspberry-projects.com\/pi\/wp-json\/wp\/v2\/posts\/1355","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/raspberry-projects.com\/pi\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/raspberry-projects.com\/pi\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/raspberry-projects.com\/pi\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/raspberry-projects.com\/pi\/wp-json\/wp\/v2\/comments?post=1355"}],"version-history":[{"count":8,"href":"https:\/\/raspberry-projects.com\/pi\/wp-json\/wp\/v2\/posts\/1355\/revisions"}],"predecessor-version":[{"id":1710,"href":"https:\/\/raspberry-projects.com\/pi\/wp-json\/wp\/v2\/posts\/1355\/revisions\/1710"}],"wp:attachment":[{"href":"https:\/\/raspberry-projects.com\/pi\/wp-json\/wp\/v2\/media?parent=1355"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/raspberry-projects.com\/pi\/wp-json\/wp\/v2\/categories?post=1355"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/raspberry-projects.com\/pi\/wp-json\/wp\/v2\/tags?post=1355"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}