http://askubuntu.com/questions/465531/how-to-make-a-shell-file-execute-by-double-click

To run your script by double clicking on its icon, you will need to create a .desktop file for it:

[Desktop Entry]
Name=My script
Comment=Test hello world script
Exec=/home/user/yourscript.sh
Icon=/home/user/youricon.gif
Terminal=false
Type=Application

Save the above as a file on your Desktop with a .desktop extension. Change /home/user/yourscript.sh and /home/user/youricon.gif to the paths of your script and whichever icon you want it ot have respectively and then you'll be able to launch by double clicking it.


Specifically, for your situation, you need to do:

  1. Create a script that runs mono LOIC.exe. To do so, create a new text file with these contents:

    #!/bin/bash
    mono /home/logan/.loic/LOIC.exe

    Save this as /home/locan/run_loic.sh and then run this command to make it executable (or right click => properties and choose "Allow executing file as program"):

    chmod +x /home/logan/.loic/LOIC.exe
  2. Create a .desktop file that launches that script. Create a new text file on your Desktop called run_loic.desktop with these contents:

    [Desktop Entry]
    Name=Run LOIC
    Comment=Run LOIC
    Exec=/home/logan/run_loic.sh
    Icon=
    Terminal=false
    Type=Application

http://forum.ubuntu.org.cn/viewtopic.php?p=1861292

Thread: Opening .sh files with double click?

 
  • Thread Tools
  1. August 28th, 2014#1

    5 Cups of Ubuntu

     
    Join Date
    Aug 2014
    Beans
    20

    Opening .sh files with double click?

    I just install PyCharm on ubuntu 14 and by default when i double click it opens the .sh file with gedit. How could I make it to just run the program when i double click?

  2. August 28th, 2014#2

    Caffeine Fueled

     
    Join Date
    Mar 2006
    Location
    Williams Lake
    Beans
    Hidden!
    Distro
    Ubuntu Development Release

    Re: Opening .sh files with double click?

    To run executable files from Nautilus (Files) go to the Edit menu and select Preferences->Behaviour, and under Executable Text Files select Ask each time

  3. August 28th, 2014#3

    Tall Cafè Ubuntu

     
    Join Date
    May 2009
    Location
    Fareham, UK
    Beans
    Hidden!
    Distro
    Xubuntu 14.04 Trusty Tahr

    Re: Opening .sh files with double click?

    Of course this only works if your script IS executable, check in the files properties.

    Catch me on Freenode - imark
 

Ubuntu 14.04 在桌面上双击运行shell 脚本文件的更多相关文章

  1. Ubuntu 14.04 64位上安装wps office软件(转http://m.blog.csdn.net/blog/yhc13429826359/24179933)

    废话少说,只给出方法供各位参考!wps for Linux版本已经有两三年没有大的动作,当然其他平台,比如windows,Android,ios上的wps效果还是很赞的说. 下面是我成功安装的步骤: ...

  2. Ubuntu 14.04 (32位)上搭建Hadoop 2.5.1单机和伪分布式环境

    引言 一直用的Ubuntu 32位系统(准备下次用Fedora,Ubuntu越来越不适合学习了),今天准备学习一下Hadoop,结果下载Apache官网上发布的最新的封装好的2.5.1版,配置完了根本 ...

  3. 在阿里云Ubuntu 14.04 Linux服务器上安装docker

    参考 How To Install and Use Docker: Getting Started 这篇最靠谱的文档在阿里云 Ubuntu  14.04 服务器上成功安装 docker . ---- ...

  4. Ubuntu 14.04 64位上安装wps office软件

    版权声明:本文为博主原创文章,未经博主同意不得转载. https://blog.csdn.net/tao_627/article/details/24179933 废话少说,仅仅给出方法供各位參考! ...

  5. Go在Ubuntu 14.04 64位上的安装过程

    1. 从 https://golang.org/dl/  或  https://studygolang.com/dl 下载最新的发布版本go1.10即go1.10.linux-amd64.tar.gz ...

  6. 【Shell脚本】运行shell脚本文件的几种方法与区别

    Shell脚本不同的运行方式会对当前Shell设置或者运行结果有所不同. 假设现在有一个脚本名为display_shell_script_args.sh,其内容如下: #!/home/pyf/bin/ ...

  7. [Ubuntu] 14.04 关闭桌面

    一直在用Ubuntu的桌面来做调试环境,最近发现桌面会有崩溃的时候,占用资源也比较大,所以想把桌面关闭,只用command界面. 我的系统是Ubuntu14.04 Ctrl+Alt+F1 可以转到命令 ...

  8. Ubuntu 14.04 安装桌面

    1.Ctrl+alt+T启动终端或者Ctrl+alt+F1登录字符界面,执行以下命令重新安装Ubuntu unity(Ubuntu基本桌面): sudo apt-get install ubuntu- ...

  9. Ubuntu 14.04 下安装redis后运行redis-cli 报出redis Connection refused错误【已解决】

    在运行redis-cli运行后爆出错误,看了网上的都没有用例如:改ip,注释bind 127.0.0.1,或者是先运行./redis-server redis.conf,都没有用 只需要: 找到red ...

随机推荐

  1. Swift版iOS游戏框架Sprite Kit基础教程下册

    Swift版iOS游戏框架Sprite Kit基础教程下册 试读下载地址:http://pan.baidu.com/s/1qWBdV0C 介绍:本教程是国内唯一的Swift版的Spritekit教程. ...

  2. Linux下设置memcached访问IP

    在虚拟机上装了memcached,本地访问可以,但从其它机器连这台机器的memcached应用总是报连接失败.防火墙的端口都是打开的.Google了才知道原来需要修改memcached的配置文件,将默 ...

  3. 转 BHO API HOOK Wininet基于IE编程的一些资料

      BHO原理:推荐vc base中的文章: 如何使用BHO定制你的Internet Explorer浏览器 API HOOK的基本原理:推荐C++ builder 研究中的文章: API Hook基 ...

  4. 模拟 POJ 1573 Robot Motion

    题目地址:http://poj.org/problem?id=1573 /* 题意:给定地图和起始位置,robot(上下左右)一步一步去走,问走出地图的步数 如果是死循环,输出走进死循环之前的步数和死 ...

  5. HDU3037 Saving Beans(Lucas定理+乘法逆元)

    题目大概问小于等于m个的物品放到n个地方有几种方法. 即解这个n元一次方程的非负整数解的个数$x_1+x_2+x_3+\dots+x_n=y$,其中0<=y<=m. 这个方程的非负整数解个 ...

  6. LightOJ1086 Jogging Trails(欧拉回路+中国邮递员问题+SPFA)

    题目求从某点出发回到该点经过所有边至少一次的最短行程. 这个问题我在<图论算法理论.实现及应用>中看过,是一个经典的问题——中国邮递员问题(CPP, chinese postman pro ...

  7. COJ986 WZJ的数据结构(负十四)

    WZJ的数据结构(负十四) 难度级别:D: 运行时间限制:6000ms: 运行空间限制:262144KB: 代码长度限制:2000000B 试题描述 请你设计一个数据结构,完成以下功能: 给定一个大小 ...

  8. 命令行编译运行Java

    首先要安装JDK,然后设置环境变量Path,添加C:\Program Files (x86)\Java\jdk1.8.0_66\bin 然后建立一个名为j.java的文件,里面加入如下代码: publ ...

  9. Pointcut is not well-formed: expecting 'identifier' at character position 0

    异常如下: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'userDa ...

  10. json格式转换成Map的应用

    jsp 1.引用json.js(将json格式转换成字符串) 2. var name = document.getElementById("name").value; var re ...