{"id":568,"date":"2019-05-30T12:29:28","date_gmt":"2019-05-30T11:29:28","guid":{"rendered":"https:\/\/notiz.comanet.xyz\/?p=568"},"modified":"2019-05-30T12:31:23","modified_gmt":"2019-05-30T11:31:23","slug":"linux-raspberry-pi-desktop-shortcuts","status":"publish","type":"post","link":"https:\/\/notiz.comanet.xyz\/?p=568","title":{"rendered":"Linux &#8211; Raspberry Pi &#8211; Desktop Shortcuts"},"content":{"rendered":"<h4>Adding A New Desktop Shortcut<\/h4>\n<p>Create a new text file called yourname.desktop in the \/home\/pi\/Desktop\/ directory, e.g. \/home\/pi\/Desktop\/yourname.desktop<\/p>\n<p>It should contain the following:<\/p>\n<pre><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>&nbsp;<\/p>\n<p>Name \u2013 The name you want displayed<\/p>\n<p>Comment \u2013 Your comment<\/p>\n<p>Icon \u2013 A file to use for the icon. \u00a0Your own or have a look in the \/usr\/share\/pixmaps\/ directory for something suitable.<\/p>\n<p>Exec \u2013 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 \u2013command &#8220;less \/root\/README.TXT&#8221;<\/p>\n<h4>Executing A Command In LX Terminal<\/h4>\n<p>The following will open LX terminal, wait\u00a0for 5 seconds and then it will close:<\/p>\n<pre><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 \"Tile to display\" -e sleep 5\r\nType=Application\r\nEncoding=UTF-8\r\nTerminal=false\r\nCategories=None;\r\n<\/code><\/pre>\n<p>LX Terminal will auto close once the command is complete. \u00a0You can&#8217;t give more than 1 command in the -e launch options (you can&#8217;t give it &#8220;-e dosomething ; sleep 5&#8221; for instance as a way to make it hold showing the result after dosomething.<\/p>\n<h4>Stopping The LX Terminal Auto Closing Or Doing Multiple Things<\/h4>\n<p>The simple way to get round the Lxterminal only being able to take one command is to have it run a bash script.<\/p>\n<h5>The .desktop file<\/h5>\n<pre><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 \"Sending Crack The Code MAIN Leader Board To Internet\" --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>The .sh script<\/h5>\n<pre><code>\r\n#!\/bin\/bash\r\n\r\necho \"Starting upload of database\"\r\nread dummy\r\necho \"next\"\r\nmysqldump -h localhost -u user1 -p123456789 mydatabase tbl_universities | mysql -h mydomain.com -u user1 -p123456789 mydatabase\r\necho \"Complete. Press return to exit\"\r\nread dummy\r\n<\/code><\/pre>\n<p>Remember to set the files permissions so it is executable (right click &gt; properties in the file manager)<\/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 \u2013 The name you want displayed Comment \u2013 Your comment Icon \u2013 A file to&#8230;<\/p>\n","protected":false},"author":1,"featured_media":570,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3,6],"tags":[],"class_list":["post-568","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-how-to-s","category-linux"],"_links":{"self":[{"href":"https:\/\/notiz.comanet.xyz\/index.php?rest_route=\/wp\/v2\/posts\/568","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/notiz.comanet.xyz\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/notiz.comanet.xyz\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/notiz.comanet.xyz\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/notiz.comanet.xyz\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=568"}],"version-history":[{"count":1,"href":"https:\/\/notiz.comanet.xyz\/index.php?rest_route=\/wp\/v2\/posts\/568\/revisions"}],"predecessor-version":[{"id":569,"href":"https:\/\/notiz.comanet.xyz\/index.php?rest_route=\/wp\/v2\/posts\/568\/revisions\/569"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/notiz.comanet.xyz\/index.php?rest_route=\/wp\/v2\/media\/570"}],"wp:attachment":[{"href":"https:\/\/notiz.comanet.xyz\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=568"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/notiz.comanet.xyz\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=568"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/notiz.comanet.xyz\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=568"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}