Ubuntu:手动创建快捷方式

作者: Josaber | 来源:发表于2016-12-19 22:02 被阅读328次

    如果是系统自带的程序或是通过安装得到的程序
    默认的图标放在/usr/share/applications/下面,可以将对应的图标放到需要的目录下即可

    如果是从网上下载解压安装的,可以进行手动的创建快捷方式
    下面以eclipse为例:

    • 创建快捷方式文件(为了方便搜索,在默认快捷方式目录下创建)
      sudo gedit /usr/share/applications/eclipse.desktop
    • 复制以下内容到文件
    [Desktop Entry]
    Name=eclipse
    Type=Application
    Exec=/opt/eclipse/eclipse
    Terminal=false
    Icon=/opt/eclipse/icon.xpm
    Comment=Integrated Development Environment
    NoDisplay=false
    Categories=Development;IDE;
    Name[en]=eclipse
    

    每个键值对的具体含义就不解释了,很容易理解

    • 保存文件
    • 将文件拷贝到需要的位置上

    当然我们也可以填写更多的选项:

    Categories=Development;
    Comment[zh_CN]=
    Comment=
    Exec=
    GenericName[zh_CN]=IDE
    GenericName=IDE
    Icon=
    MimeType=
    Name[zh_CN]=eclipse
    Name=eclipse
    Path=
    StartupNotify=true
    Terminal=false
    Type=Application
    X-DBUS-ServiceName=
    X-DBUS-StartupType=
    X-KDE-SubstituteUID=false
    X-KDE-Username=
    

    相关文章

      网友评论

        本文标题:Ubuntu:手动创建快捷方式

        本文链接:https://www.haomeiwen.com/subject/krtxvttx.html