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. 安装完最小化 RHEL/CentOS 7 后需要做的 30 件事情(五)

    25. 安装 Linux Malware Detect (LMD) Linux Malware Detect (LMD) 是 GNU GPLv2 协议下发布的开源 Linux 恶意程序扫描器,它是特别 ...

  2. Oracle表空间管理

    oracle表空间相关常用命令小结: 1.ALTER DATABASE SET DEFAULT BIGFILE TABLESPACE;              //修改表空间数据文件类型 2.ALT ...

  3. oracle创建临时表没有权限

    执行下面: grant create any table to 用户名称

  4. [Unity3D]脚本中Start()和Awake()的区别

    Unity3D初学者经常把Awake和Start混淆. 简单说明一下,Awake在MonoBehavior创建后就立刻调用,Start将在MonoBehavior创建后在该帧Update之前,在该Mo ...

  5. android 全屏视频播放(SurfaceView + MediaPlayer)

    介绍个第三方: JieCaoVideoPlayer 实现Android的全屏视频播放,支持完全自定义UI.手势修改进度和音量.hls.rtsp,设置http头信息,也能在ListView.ViewPa ...

  6. Android解析XML(PULL方式)

    PULL 的工作原理: XML pull提供了开始元素和结束元素.当某个元素开始时,可以调用parser.nextText从XML文档中提取所有字符数据.当解析到一个文档结束时,自动生成EndDocu ...

  7. NOIp 2006 作业调度方案 Label:坑 模拟(tyvj你不给我ac,我就把名字献给附中oj)

    福建师大附中链接:http://218.5.5.242:9018/JudgeOnline/problem.php?id=1211 [问题描述] 我们现在要利用m台机器加工n个工件,每个工件都有m道工序 ...

  8. javascript第四弹——变量、作用域、内存

    一.变量 定义 变量是松散型的 变量是保存特定值的一个名字 变量包含两种数据类型的值:基本数据类型的值和引用数据类型的值 基本数据类型值 基本数据类型值是一个简单的数据段,在内存中占用固定的空间,保存 ...

  9. 在iOS开发中使用FMDB

    在iOS开发中使用FMDB 前言 SQLite (http://www.sqlite.org/docs.html) 是一个轻量级的关系数据库.iOS SDK 很早就支持了 SQLite,在使用时,只需 ...

  10. XSS的高级利用部分总结 -蠕虫

    XSS的高级利用部分总结 -蠕虫,HTTP-only,AJAX本地文件操作,镜象网页本帖最后由 racle 于 2009-5-30 09:19 编辑 XSS的高级利用总结 -蠕虫,HTTPONLY,A ...