特殊:Badtitle/NS100:HowToAddaLauncher:修订间差异
小无编辑摘要 |
小无编辑摘要 |
||
第43行: | 第43行: | ||
#/bin/bash | #/bin/bash | ||
WINEDLLOVERRIDES=\"ole32,usp10,msvcrt=n\" | WINEDLLOVERRIDES=\"ole32,usp10,msvcrt=n\" | ||
wine $HOME/.wine/drive_c/Program\ Files/Google/Google\ Earth/ | wine $HOME/.wine/drive_c/Program\ Files/Google/Google\ Earth/GoogleEarth.exe | ||
</nowiki></pre> | </nowiki></pre> | ||
<pre><nowiki> | <pre><nowiki> |
2007年12月5日 (三) 12:09的版本
文章出处: |
{{#if: | {{{2}}} | https://help.ubuntu.com/community/HowToAddaLauncher }} |
点击翻译: |
English {{#ifexist: {{#if: UbuntuHelp:HowToAddaLauncher | UbuntuHelp:HowToAddaLauncher | {{#if: | :}}HowToAddaLauncher}}/af | • {{#if: UbuntuHelp:HowToAddaLauncher|Afrikaans| [[::HowToAddaLauncher/af|Afrikaans]]}}|}} {{#ifexist: {{#if: UbuntuHelp:HowToAddaLauncher | UbuntuHelp:HowToAddaLauncher | {{#if: | :}}HowToAddaLauncher}}/ar | • {{#if: UbuntuHelp:HowToAddaLauncher|العربية| [[::HowToAddaLauncher/ar|العربية]]}}|}} {{#ifexist: {{#if: UbuntuHelp:HowToAddaLauncher | UbuntuHelp:HowToAddaLauncher | {{#if: | :}}HowToAddaLauncher}}/az | • {{#if: UbuntuHelp:HowToAddaLauncher|azərbaycanca| [[::HowToAddaLauncher/az|azərbaycanca]]}}|}} {{#ifexist: {{#if: UbuntuHelp:HowToAddaLauncher | UbuntuHelp:HowToAddaLauncher | {{#if: | :}}HowToAddaLauncher}}/bcc | • {{#if: UbuntuHelp:HowToAddaLauncher|جهلسری بلوچی| [[::HowToAddaLauncher/bcc|جهلسری بلوچی]]}}|}} {{#ifexist: {{#if: UbuntuHelp:HowToAddaLauncher | UbuntuHelp:HowToAddaLauncher | {{#if: | :}}HowToAddaLauncher}}/bg | • {{#if: UbuntuHelp:HowToAddaLauncher|български| [[::HowToAddaLauncher/bg|български]]}}|}} {{#ifexist: {{#if: UbuntuHelp:HowToAddaLauncher | UbuntuHelp:HowToAddaLauncher | {{#if: | :}}HowToAddaLauncher}}/br | • {{#if: UbuntuHelp:HowToAddaLauncher|brezhoneg| [[::HowToAddaLauncher/br|brezhoneg]]}}|}} {{#ifexist: {{#if: UbuntuHelp:HowToAddaLauncher | UbuntuHelp:HowToAddaLauncher | {{#if: | :}}HowToAddaLauncher}}/ca | • {{#if: UbuntuHelp:HowToAddaLauncher|català| [[::HowToAddaLauncher/ca|català]]}}|}} {{#ifexist: {{#if: UbuntuHelp:HowToAddaLauncher | UbuntuHelp:HowToAddaLauncher | {{#if: | :}}HowToAddaLauncher}}/cs | • {{#if: UbuntuHelp:HowToAddaLauncher|čeština| [[::HowToAddaLauncher/cs|čeština]]}}|}} {{#ifexist: {{#if: UbuntuHelp:HowToAddaLauncher | UbuntuHelp:HowToAddaLauncher | {{#if: | :}}HowToAddaLauncher}}/de | • {{#if: UbuntuHelp:HowToAddaLauncher|Deutsch| [[::HowToAddaLauncher/de|Deutsch]]}}|}} {{#ifexist: {{#if: UbuntuHelp:HowToAddaLauncher | UbuntuHelp:HowToAddaLauncher | {{#if: | :}}HowToAddaLauncher}}/el | • {{#if: UbuntuHelp:HowToAddaLauncher|Ελληνικά| [[::HowToAddaLauncher/el|Ελληνικά]]}}|}} {{#ifexist: {{#if: UbuntuHelp:HowToAddaLauncher | UbuntuHelp:HowToAddaLauncher | {{#if: | :}}HowToAddaLauncher}}/es | • {{#if: UbuntuHelp:HowToAddaLauncher|español| [[::HowToAddaLauncher/es|español]]}}|}} {{#ifexist: {{#if: UbuntuHelp:HowToAddaLauncher | UbuntuHelp:HowToAddaLauncher | {{#if: | :}}HowToAddaLauncher}}/fa | • {{#if: UbuntuHelp:HowToAddaLauncher|فارسی| [[::HowToAddaLauncher/fa|فارسی]]}}|}} {{#ifexist: {{#if: UbuntuHelp:HowToAddaLauncher | UbuntuHelp:HowToAddaLauncher | {{#if: | :}}HowToAddaLauncher}}/fi | • {{#if: UbuntuHelp:HowToAddaLauncher|suomi| [[::HowToAddaLauncher/fi|suomi]]}}|}} {{#ifexist: {{#if: UbuntuHelp:HowToAddaLauncher | UbuntuHelp:HowToAddaLauncher | {{#if: | :}}HowToAddaLauncher}}/fr | • {{#if: UbuntuHelp:HowToAddaLauncher|français| [[::HowToAddaLauncher/fr|français]]}}|}} {{#ifexist: {{#if: UbuntuHelp:HowToAddaLauncher | UbuntuHelp:HowToAddaLauncher | {{#if: | :}}HowToAddaLauncher}}/gu | • {{#if: UbuntuHelp:HowToAddaLauncher|ગુજરાતી| [[::HowToAddaLauncher/gu|ગુજરાતી]]}}|}} {{#ifexist: {{#if: UbuntuHelp:HowToAddaLauncher | UbuntuHelp:HowToAddaLauncher | {{#if: | :}}HowToAddaLauncher}}/he | • {{#if: UbuntuHelp:HowToAddaLauncher|עברית| [[::HowToAddaLauncher/he|עברית]]}}|}} {{#ifexist: {{#if: UbuntuHelp:HowToAddaLauncher | UbuntuHelp:HowToAddaLauncher | {{#if: | :}}HowToAddaLauncher}}/hu | • {{#if: UbuntuHelp:HowToAddaLauncher|magyar| [[::HowToAddaLauncher/hu|magyar]]}}|}} {{#ifexist: {{#if: UbuntuHelp:HowToAddaLauncher | UbuntuHelp:HowToAddaLauncher | {{#if: | :}}HowToAddaLauncher}}/id | • {{#if: UbuntuHelp:HowToAddaLauncher|Bahasa Indonesia| [[::HowToAddaLauncher/id|Bahasa Indonesia]]}}|}} {{#ifexist: {{#if: UbuntuHelp:HowToAddaLauncher | UbuntuHelp:HowToAddaLauncher | {{#if: | :}}HowToAddaLauncher}}/it | • {{#if: UbuntuHelp:HowToAddaLauncher|italiano| [[::HowToAddaLauncher/it|italiano]]}}|}} {{#ifexist: {{#if: UbuntuHelp:HowToAddaLauncher | UbuntuHelp:HowToAddaLauncher | {{#if: | :}}HowToAddaLauncher}}/ja | • {{#if: UbuntuHelp:HowToAddaLauncher|日本語| [[::HowToAddaLauncher/ja|日本語]]}}|}} {{#ifexist: {{#if: UbuntuHelp:HowToAddaLauncher | UbuntuHelp:HowToAddaLauncher | {{#if: | :}}HowToAddaLauncher}}/ko | • {{#if: UbuntuHelp:HowToAddaLauncher|한국어| [[::HowToAddaLauncher/ko|한국어]]}}|}} {{#ifexist: {{#if: UbuntuHelp:HowToAddaLauncher | UbuntuHelp:HowToAddaLauncher | {{#if: | :}}HowToAddaLauncher}}/ksh | • {{#if: UbuntuHelp:HowToAddaLauncher|Ripoarisch| [[::HowToAddaLauncher/ksh|Ripoarisch]]}}|}} {{#ifexist: {{#if: UbuntuHelp:HowToAddaLauncher | UbuntuHelp:HowToAddaLauncher | {{#if: | :}}HowToAddaLauncher}}/mr | • {{#if: UbuntuHelp:HowToAddaLauncher|मराठी| [[::HowToAddaLauncher/mr|मराठी]]}}|}} {{#ifexist: {{#if: UbuntuHelp:HowToAddaLauncher | UbuntuHelp:HowToAddaLauncher | {{#if: | :}}HowToAddaLauncher}}/ms | • {{#if: UbuntuHelp:HowToAddaLauncher|Bahasa Melayu| [[::HowToAddaLauncher/ms|Bahasa Melayu]]}}|}} {{#ifexist: {{#if: UbuntuHelp:HowToAddaLauncher | UbuntuHelp:HowToAddaLauncher | {{#if: | :}}HowToAddaLauncher}}/nl | • {{#if: UbuntuHelp:HowToAddaLauncher|Nederlands| [[::HowToAddaLauncher/nl|Nederlands]]}}|}} {{#ifexist: {{#if: UbuntuHelp:HowToAddaLauncher | UbuntuHelp:HowToAddaLauncher | {{#if: | :}}HowToAddaLauncher}}/no | • {{#if: UbuntuHelp:HowToAddaLauncher|norsk| [[::HowToAddaLauncher/no|norsk]]}}|}} {{#ifexist: {{#if: UbuntuHelp:HowToAddaLauncher | UbuntuHelp:HowToAddaLauncher | {{#if: | :}}HowToAddaLauncher}}/oc | • {{#if: UbuntuHelp:HowToAddaLauncher|occitan| [[::HowToAddaLauncher/oc|occitan]]}}|}} {{#ifexist: {{#if: UbuntuHelp:HowToAddaLauncher | UbuntuHelp:HowToAddaLauncher | {{#if: | :}}HowToAddaLauncher}}/pl | • {{#if: UbuntuHelp:HowToAddaLauncher|polski| [[::HowToAddaLauncher/pl|polski]]}}|}} {{#ifexist: {{#if: UbuntuHelp:HowToAddaLauncher | UbuntuHelp:HowToAddaLauncher | {{#if: | :}}HowToAddaLauncher}}/pt | • {{#if: UbuntuHelp:HowToAddaLauncher|português| [[::HowToAddaLauncher/pt|português]]}}|}} {{#ifexist: {{#if: UbuntuHelp:HowToAddaLauncher | UbuntuHelp:HowToAddaLauncher | {{#if: | :}}HowToAddaLauncher}}/ro | • {{#if: UbuntuHelp:HowToAddaLauncher|română| [[::HowToAddaLauncher/ro|română]]}}|}} {{#ifexist: {{#if: UbuntuHelp:HowToAddaLauncher | UbuntuHelp:HowToAddaLauncher | {{#if: | :}}HowToAddaLauncher}}/ru | • {{#if: UbuntuHelp:HowToAddaLauncher|русский| [[::HowToAddaLauncher/ru|русский]]}}|}} {{#ifexist: {{#if: UbuntuHelp:HowToAddaLauncher | UbuntuHelp:HowToAddaLauncher | {{#if: | :}}HowToAddaLauncher}}/si | • {{#if: UbuntuHelp:HowToAddaLauncher|සිංහල| [[::HowToAddaLauncher/si|සිංහල]]}}|}} {{#ifexist: {{#if: UbuntuHelp:HowToAddaLauncher | UbuntuHelp:HowToAddaLauncher | {{#if: | :}}HowToAddaLauncher}}/sq | • {{#if: UbuntuHelp:HowToAddaLauncher|shqip| [[::HowToAddaLauncher/sq|shqip]]}}|}} {{#ifexist: {{#if: UbuntuHelp:HowToAddaLauncher | UbuntuHelp:HowToAddaLauncher | {{#if: | :}}HowToAddaLauncher}}/sr | • {{#if: UbuntuHelp:HowToAddaLauncher|српски / srpski| [[::HowToAddaLauncher/sr|српски / srpski]]}}|}} {{#ifexist: {{#if: UbuntuHelp:HowToAddaLauncher | UbuntuHelp:HowToAddaLauncher | {{#if: | :}}HowToAddaLauncher}}/sv | • {{#if: UbuntuHelp:HowToAddaLauncher|svenska| [[::HowToAddaLauncher/sv|svenska]]}}|}} {{#ifexist: {{#if: UbuntuHelp:HowToAddaLauncher | UbuntuHelp:HowToAddaLauncher | {{#if: | :}}HowToAddaLauncher}}/th | • {{#if: UbuntuHelp:HowToAddaLauncher|ไทย| [[::HowToAddaLauncher/th|ไทย]]}}|}} {{#ifexist: {{#if: UbuntuHelp:HowToAddaLauncher | UbuntuHelp:HowToAddaLauncher | {{#if: | :}}HowToAddaLauncher}}/tr | • {{#if: UbuntuHelp:HowToAddaLauncher|Türkçe| [[::HowToAddaLauncher/tr|Türkçe]]}}|}} {{#ifexist: {{#if: UbuntuHelp:HowToAddaLauncher | UbuntuHelp:HowToAddaLauncher | {{#if: | :}}HowToAddaLauncher}}/vi | • {{#if: UbuntuHelp:HowToAddaLauncher|Tiếng Việt| [[::HowToAddaLauncher/vi|Tiếng Việt]]}}|}} {{#ifexist: {{#if: UbuntuHelp:HowToAddaLauncher | UbuntuHelp:HowToAddaLauncher | {{#if: | :}}HowToAddaLauncher}}/yue | • {{#if: UbuntuHelp:HowToAddaLauncher|粵語| [[::HowToAddaLauncher/yue|粵語]]}}|}} {{#ifexist: {{#if: UbuntuHelp:HowToAddaLauncher | UbuntuHelp:HowToAddaLauncher | {{#if: | :}}HowToAddaLauncher}}/zh | • {{#if: UbuntuHelp:HowToAddaLauncher|中文| [[::HowToAddaLauncher/zh|中文]]}}|}} {{#ifexist: {{#if: UbuntuHelp:HowToAddaLauncher | UbuntuHelp:HowToAddaLauncher | {{#if: | :}}HowToAddaLauncher}}/zh-hans | • {{#if: UbuntuHelp:HowToAddaLauncher|中文(简体)| [[::HowToAddaLauncher/zh-hans|中文(简体)]]}}|}} {{#ifexist: {{#if: UbuntuHelp:HowToAddaLauncher | UbuntuHelp:HowToAddaLauncher | {{#if: | :}}HowToAddaLauncher}}/zh-hant | • {{#if: UbuntuHelp:HowToAddaLauncher|中文(繁體)| [[::HowToAddaLauncher/zh-hant|中文(繁體)]]}}|}} |
{{#ifeq:UbuntuHelp:HowToAddaLauncher|:HowToAddaLauncher|请不要直接编辑翻译本页,本页将定期与来源同步。}} |
{{#ifexist: :HowToAddaLauncher/zh | | {{#ifexist: HowToAddaLauncher/zh | | {{#ifeq: {{#titleparts:HowToAddaLauncher|1|-1|}} | zh | | }} }} }} {{#ifeq: {{#titleparts:HowToAddaLauncher|1|-1|}} | zh | | }}
Launchers are similar to "shortcuts" in Windows or "aliases" in the Mac OS. Adding a launcher in Ubuntu is easy.
The Easy Way
- Right-click unused space in any panel (the toolbars at the top and/or bottom of the screen)
- Choose Add To Panel...
- Choose Custom Application Launcher
- Fill in Name, Command, and Comment
- Name is you want to call the link, such as "Firefox" or "Gaim"
- Command is what you would type in the terminal to launch the program. You can also click the "Browse" button to find the program on your computer.
- Comment is for a short explanation of the program. This and the Name will appear when you hover your mouse over the launcher.
- Click the No Icon button to select an icon for your launcher. You may find icons in /usr/share/icons/crystalsvg/16x16/apps/ or elsewhere. You could also make them yourself using GIMP or any other graphic editor.
- Click OK
- Your launcher should now appear on the panel
You may also find directions on adding launchers in Ubuntu's built-in help. From the System menu select "Help and Support" then "Customising Your Desktop > Cutomising Panels > Launchers."
The Hard Way
What if this does not work? Some programs need additional commands before they can be started. Java programs need to be started from within the directory in which their files exist. Others must be run within Wine. Unfortunately launchers do have access to the Bash environment so you cannot just include the needed commands. Instead, you need to make a Bash script (don't worry, it's simple).
- Create a new text file somewhere on your computer. Open a terminal window and type
sudo nano /usr/local/bin/sampleprogram
- Fill the new file with this:
#!/bin/bash <your command> <your command> <your command>
- Press Control+X to save your file & exit Nano.
- Make the file executable by typing the following in the terminal:
sudo chmod +x /usr/local/bin/sampleprogram
- In the Create Launcher window, fill Command with /usr/local/bin/sampleprogram (or just sampleprogram, but be sure to update your database before that by typing the following in the terminal:
sudo updatedb
Examples of Bash scripts
Here are a few other examples of Bash scripts:
#/bin/bash WINEDLLOVERRIDES=\"ole32,usp10,msvcrt=n\" wine $HOME/.wine/drive_c/Program\ Files/Google/Google\ Earth/GoogleEarth.exe
#!/bin/bash cd $HOME/Movietheque/ $HOME/Movietheque/Movietheque.run