# Executing shell script from desktop

**URL:** <https://community.unix.com/t/executing-shell-script-from-desktop/335174>\
**Category:** Shell Programming and Scripting\
**Created:** [October 8, 2013, 4:12am UTC](https://community.unix.com/t/executing-shell-script-from-desktop/335174 "2013-10-08T04:12:14Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![mirwasim](https://community.unix.com/letter_avatar/mirwasim/32/6_449c533f586939b6e5f246632a46421f.png) [@mirwasim](https://community.unix.com/u/mirwasim)\
**Post date:** [October 8, 2013, 4:12am UTC](https://community.unix.com/t/executing-shell-script-from-desktop/335174/1 "2013-10-08T04:12:14Z")

</div>

Hello All,

Is there a way that I can have wrapper place in my desktop and when I run it, it connect with my server and do the action.

If this can happen, Can I know how to get started

Thanks

---

<div class="post-metadata">

**Author:** ![sea](https://community.unix.com/user_avatar/community.unix.com/sea/32/2946_2.png) [@sea](https://community.unix.com/u/sea)\
**Post date:** [October 8, 2013, 4:57am UTC](https://community.unix.com/t/executing-shell-script-from-desktop/335174/2 "2013-10-08T04:57:09Z")

</div>

You could place:

- the script itself
- a symlink to the script
- a script that sources the script
- a desktopfile which executes the script

A desktopfile could look like:

```nohighlight
[Desktop Entry]
Type=Application
Name=Script-Tools
Comment=A collection of bash scripts to accomplish diffrent tasks.\n* Change plymouth\n* Change grub2 theme\n* Toggle Repo's (En-/Disable)\nand more...
Exec=/usr/bin/st
Icon=/usr/share/script-tools/Script-Core/Templates/SSTLogocombined.svg
Terminal=true

```

If it is more about the script, then it might differ from the tools required to access/connect to the server.  
If you have provided the info in ~/.netrc ( `machine URL login USER password PW` where the capitals are your values) it could looks like this:

```nohighlight
ftp my.domain.com<EOF
lcd /path/to/local
cd /path/remote
prompt
mput *
bye
EOF

```

This would upload all files in /path/to/local to /path/remote without asking to upload/overwrite to your ftp server.

Hope this helps

---

<div class="post-metadata">

**Author:** ![mirwasim](https://community.unix.com/letter_avatar/mirwasim/32/6_449c533f586939b6e5f246632a46421f.png) [@mirwasim](https://community.unix.com/u/mirwasim)\
**Post date:** [October 8, 2013, 5:14am UTC](https://community.unix.com/t/executing-shell-script-from-desktop/335174/3 "2013-10-08T05:14:46Z")

</div>

> [@sea](#):
>
> You could place:
> 
> - the script itself
> - a symlink to the script
> - a script that sources the script
> - a desktopfile which executes the script
> 
> A desktopfile could look like:
> 
> ```plaintext
> [Desktop Entry]
> Type=Application
> Name=Script-Tools
> Comment=A collection of bash scripts to accomplish diffrent tasks.\n* Change plymouth\n* Change grub2 theme\n* Toggle Repo's (En-/Disable)\nand more...
> Exec=/usr/bin/st
> Icon=/usr/share/script-tools/Script-Core/Templates/SSTLogocombined.svg
> Terminal=true
> 
> ```
> 
> If it is more about the script, then it might differ from the tools required to access/connect to the server.  
> If you have provided the info in ~/.netrc ( `machine URL login USER password PW` where the capitals are your values) it could looks like this:
> 
> ```plaintext
> ftp my.domain.com<EOF
> lcd /path/to/local
> cd /path/remote
> prompt
> mput *
> bye
> EOF
> 
> ```
> 
> This would upload all files in /path/to/local to /path/remote without asking to upload/overwrite to your ftp server.
> 
> Hope this helps

Do I need any extension to the script to execute from desktop, and if you can show me a sample script, it will be of great help.

---

<div class="post-metadata">

**Author:** ![sea](https://community.unix.com/user_avatar/community.unix.com/sea/32/2946_2.png) [@sea](https://community.unix.com/u/sea)\
**Post date:** [October 8, 2013, 5:21am UTC](https://community.unix.com/t/executing-shell-script-from-desktop/335174/4 "2013-10-08T05:21:29Z")

</div>

For 'visual' reckonize or forum compatiblity, you could use .sh for any sh or bash script. Use csh, ksh, tcsh or zsh accordingly.

All it requires is the execution flag.  
Either by right-click-properties - tab: permission - Execute: owner/everyone?

Or by:

```nohighlight
chmod +x filename

```

Hope this helps
