个人工具
登录
查看“UbuntuHelp:HowToAddaLauncher”的源代码 - Ubuntu中文
UbuntuHelp
讨论
查看源代码
历史
搜索
导航
首页
最近更改
随机页面
页面分类
帮助
编辑
编辑指南
沙盒
新闻动态
字词处理
工具
链入页面
相关更改
特殊页面
页面信息
查看“UbuntuHelp:HowToAddaLauncher”的源代码
来自Ubuntu中文
←
UbuntuHelp:HowToAddaLauncher
跳转至:
导航
,
搜索
因为以下原因,你没有权限编辑本页:
您所请求的操作仅限于该用户组的用户使用:
用户
您可以查看与复制此页面的源代码。
{{From|https://help.ubuntu.com/community/HowToAddaLauncher}} {{Languages|UbuntuHelp:HowToAddaLauncher}} Adding a panel or desktop launcher to Ubuntu is fairly easy. Windows users will think of these as "shortcuts"; in Gnome they're called launchers. == The Easy Way == *** First of all, see Desktop User Guide / Working With Panels / Launchers / To Add A Launcher to a Panel page in help for more complex and less straightforward info. *** Right-click unused space in any panel. *** Choose Add To Panel... *** Choose Custom Application Launcher *** Fill in Name, Generic Name and Comment at your will *** Important field is Command - fill in a command you want to be called by a launcher *** Choose from /usr/share/icons/crystalsvg/16x16/apps/ or elsewhere or make yourself using GIMP or any other graphic editor an icon. *** Your launcher should just work now. == The Hard Way == *** What if this just does not work? *** Some programs - for example some run under Wine - needs some additional commands before they can be started or some Java programs need to be started from within the directory they have their files in. Unfortunately launchers do not get bash environment so you cannot just put them in Command field *** Insted, you need to make a bash script. Do not worry, it is simple *** Just create a file somewhere in you $PATH, for example <pre><nowiki> sudo nano /usr/local/bin/sampleprogram </nowiki></pre> *** Fill it something like this: <pre><nowiki> #!/bin/bash <your command> <your command> <your command> </nowiki></pre> *** Press Control+X to save your file & exit Nano. *** Make the file executable: <pre><nowiki> sudo chmod +x /usr/local/bin/sampleprogram </nowiki></pre> *** fill Command with /usr/local/bin/sampleprogram (or just sample program, but be sure to update tour database before that, i.e. <pre><nowiki> sudo updatedb </nowiki></pre> and it should just work now. === Examples of bash scripts === <pre><nowiki> #/bin/bash WINEDLLOVERRIDES=\"ole32,usp10,msvcrt=n\" wine $HOME/.wine/drive_c/Program\ Files/Google/Google\ Earth/GoogleEarth.exe </nowiki></pre> <pre><nowiki> #!/bin/bash cd $HOME/Movietheque/ $HOME/Movietheque/Movietheque.run </nowiki></pre> ---- [[category:CategoryDocumentation]] [[category:CategoryCleanup]] [[category:UbuntuHelp]]
该页面使用的模板:
模板:From
(
查看源代码
)
模板:Languages
(
查看源代码
)(受保护)
模板:Languages/Lang
(
查看源代码
)(受保护)
返回至
UbuntuHelp:HowToAddaLauncher
。