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:

  1. [Desktop Entry]
  2. Name=My script
  3. Comment=Test hello world script
  4. Exec=/home/user/yourscript.sh
  5. Icon=/home/user/youricon.gif
  6. Terminal=false
  7. 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:

    1. #!/bin/bash
    2. 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"):

    1. 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:

    1. [Desktop Entry]
    2. Name=Run LOIC
    3. Comment=Run LOIC
    4. Exec=/home/logan/run_loic.sh
    5. Icon=
    6. Terminal=false
    7. 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. MySQL出现无法删除行记录

    今天mysql在删除一张InnoDB类型的表时,出现错误Error No. 1451 MYSQL: Cannot delete or update a parent row: a foreign ke ...

  2. hdu 5762 Teacher Bo 曼哈顿路径

    Teacher Bo Time Limit: 4000/2000 MS (Java/Others)    Memory Limit: 131072/131072 K (Java/Others)Tota ...

  3. CodeForces 433C Ryouko's Memory Note-暴力

                                             Ryouko's Memory Note Time Limit:1000MS     Memory Limit:262 ...

  4. BZOJ3836 : [Poi2014]Tourism

    对于一个连通块,取一个点进行dfs,得到一棵dfs搜索树,则这棵树的深度不超过10,且所有额外边都是前向边. 对于每个点x,设S为三进制状态,S第i位表示根到x路径上深度为i的点的状态: 0:选了 1 ...

  5. Flexbox——快速布局神器

    Flexbox通常能让我们更好的操作他的子元素布局,例如: 如果元素容器没有足够的空间,我们无需计算每个元素的宽度,就可以设置他们在同一行: 可以快速让他们布局在一列: 可以方便让他们对齐容器的左.右 ...

  6. java中特殊的String类型

    Java中String是一个特殊的包装类数据有两种创建形式: String s = "abc"; String s = new String("abc"); 第 ...

  7. 【wikioi】1002 搭桥(dfs+最小生成树)

    http://wikioi.com/problem/1002/ 今天开始又开始刷水了哈T_T.照着hzwer神犇的刷题记录刷!!! 题解: 一开始我也不会,但是我想到了直接爆搜T_T. 好吧,题解. ...

  8. Json 数组拼接

    var str1 = {"name": "apple", "sex": "21"};                 / ...

  9. Java导出Highcharts生成的图表为图片源码

    本文转载自:http://blog.csdn.net/dengsilinming/article/details/7352054 需要的jar包: 需要的js文件:(可以通过http://www.hi ...

  10. <html:option获取文本值

    <p class="w120">变更后IP:</p> <div class="comBobox w200 f_l"> < ...