Ubuntu 自訂應用程式捷徑

一般來說,在 Ubuntu 裡安裝軟體時,完成後我們可以在應用程式列表之類的地方看到,點一下該軟體的圖示就可以開啟。不過即使用了一陣子,還是有一些 windows 上軟體是很難被取代的,至少對我來說  foobar2000 與 mp3tag 就是難以替代。倒也不是說 foobar2000 的音質多好還是怎樣的,只是它類似 itunes 的音樂管理方式實在太好用,而對於音樂檔的 tag 編輯,Linux 中是有個 easytag,用了一陣子還是覺得沒有 mp3tag 來得方便穩定。所幸這兩個軟體相容於 Linux Wine 的環境,用 Wine 來跑幾乎是沒有什麼問題,非常的順暢。

即然這些軟體是用 Wine 來跑,表示它們的安裝並不是使用 Ubuntu 的 deb 或是其它的常規方法,通常是使用 Wine 去執行它們的 exe 安裝檔來安裝,因此我們不會在已安裝軟體列表中看到它們,每次要執行的時候,都得在它們的執行檔上點右鍵,再選擇使用 wine 來執行。

這麼常用到的軟體,如果每次都要這樣開實在是非常的麻煩,其實我們可以使用自訂捷徑的方式,將這些非常規的軟體放入 app 列表中,如此一來就會像我們平常在開 native 的程式一樣簡單許多。

首先,在網路上找該軟體的 PNG icon,例如我想要做 foobar2000 與 mp3tag 的捷徑,就去網站上找這兩個軟體的圖示,外型可以隨自己的喜好,但最好是 PNG 檔,下載後請固定放在一個地方,本例的存放位置為 ~/.icons

~/.local/share/applications 目錄底下新增一個捷徑檔,本例為 foobar2000

sudo vim ~/.local/share/applications/foobar2000.desktop
# 在 /usr/share/applications 或 ~/Desktop 建立似乎也可以

捷徑檔的內容如下(請依自己的需求修改):

[Desktop Entry]
Encoding=UTF-8
Name=foobar2000
Exec=wine /media/Linux/Application/foobar2000_v1.3.15/foobar2000.exe
Icon=~/.icons/Foobar.png
Type=Application
Categories=Audio;
  • Name:軟體名稱,這個名稱會是之後在軟體列表裡所看到的名字
  • Exec:軟體的執行方式,上面的例子表示,使用 wine 來執行 foobar 的執行檔
  • Icon:軟體的圖示,後面接圖示的路徑即可
  • Type:該物件屬於 Application
  • Categories:該程式的分類,這個分類似乎是有一個固定規範的,不是隨便亂取就可以,app 列表可能會依照這個來歸類這個軟體

存檔離開後,就可以在 App 列表中找到我們自訂的軟體捷徑了

使用快速開啟 app 的程式如:albert 之類的也可以看得到自訂的捷徑


有關 Categories 的類型,可以參考下面網址,不過就我自己的經驗,使用 Main Categories 就夠了,不用細分到 Additional Categories

https://specifications.freedesktop.org/menu-spec/latest/apa.html

Main Categories

By including one of the Main Categories in an application's desktop entry file, the application will be ensured that it will show up in a section of the application menu dedicated to this category. If multiple Main Categories are included in a single desktop entry file, the entry may appear more than once in the menu.

Category-based menus based on the Main Categories listed in this specification do not provide a complete ontology for all available applications. Category-based menu implementations SHOULD therefore provide a "catch-all" submenu for applications that cannot be appropriately placed elsewhere.

The table below lists all Main Categories.

Main CategoryDescriptionNotes
AudioVideoApplication for presenting, creating, or processing multimedia (audio/video) 
AudioAn audio applicationDesktop entry must include AudioVideo as well
VideoA video applicationDesktop entry must include AudioVideo as well
DevelopmentAn application for development 
EducationEducational software 
GameA game 
GraphicsApplication for viewing, creating, or processing graphics 
NetworkNetwork application such as a web browser 
OfficeAn office type application 
ScienceScientific software 
SettingsSettings applicationsEntries may appear in a separate menu or as part of a "Control Center"
SystemSystem application, "System Tools" such as say a log viewer or network monitor 
UtilitySmall utility application, "Accessories" 

Additional Categories

The Related Categories column lists one or more categories that are suggested to be used in conjunction with the Additional Category. If the Related Categories column is blank, the Additional Category can be used with any Main Category.

The table below describes Additional Categories.

Additional CategoryDescriptionRelated Categories
BuildingA tool to build applicationsDevelopment
DebuggerA tool to debug applicationsDevelopment
IDEIDE applicationDevelopment
GUIDesignerA GUI designer applicationDevelopment
ProfilingA profiling toolDevelopment
RevisionControlApplications like cvs or subversionDevelopment
TranslationA translation toolDevelopment
CalendarCalendar applicationOffice
ContactManagementE.g. an address bookOffice
DatabaseApplication to manage a databaseOffice or Development or AudioVideo
DictionaryA dictionaryOffice or TextTools
ChartChart applicationOffice
EmailEmail applicationOffice or Network
FinanceApplication to manage your financeOffice
FlowChartA flowchart applicationOffice
PDATool to manage your PDAOffice
ProjectManagementProject management applicationOffice or Development
PresentationPresentation softwareOffice
SpreadsheetA spreadsheetOffice
WordProcessorA word processorOffice
2DGraphics2D based graphical applicationGraphics
VectorGraphicsApplication for viewing, creating, or processing vector graphicsGraphics;2DGraphics
RasterGraphicsApplication for viewing, creating, or processing raster (bitmap) graphicsGraphics;2DGraphics
3DGraphicsApplication for viewing, creating, or processing 3-D graphicsGraphics
ScanningTool to scan a file/textGraphics
OCROptical character recognition applicationGraphics;Scanning
PhotographyCamera tools, etc.Graphics or Office
PublishingDesktop Publishing applications and Color Management toolsGraphics or Office
ViewerTool to view e.g. a graphic or pdf fileGraphics or Office
TextToolsA text tool utilityUtility
DesktopSettingsConfiguration tool for the GUISettings
HardwareSettingsA tool to manage hardware components, like sound cards, video cards or printersSettings
PrintingA tool to manage printersHardwareSettings;Settings
PackageManagerA package manager applicationSettings
DialupA dial-up programNetwork
InstantMessagingAn instant messaging clientNetwork
ChatA chat clientNetwork
IRCClientAn IRC clientNetwork
FeedRSS, podcast and other subscription based contentsNetwork
FileTransferTools like FTP or P2P programsNetwork
HamRadioHAM radio softwareNetwork or Audio
NewsA news reader or a news tickerNetwork
P2PA P2P programNetwork
RemoteAccessA tool to remotely manage your PCNetwork
TelephonyTelephony via PCNetwork
TelephonyToolsTelephony tools, to dial a number, manage PBX, ...Utility
VideoConferenceVideo Conference softwareNetwork
WebBrowserA web browserNetwork
WebDevelopmentA tool for web developersNetwork or Development
MidiAn app related to MIDIAudioVideo;Audio
MixerJust a mixerAudioVideo;Audio
SequencerA sequencerAudioVideo;Audio
TunerA tunerAudioVideo;Audio
TVA TV applicationAudioVideo;Video
AudioVideoEditingApplication to edit audio/video filesAudio or Video or AudioVideo
PlayerApplication to play audio/video filesAudio or Video or AudioVideo
RecorderApplication to record audio/video filesAudio or Video or AudioVideo
DiscBurningApplication to burn a discAudioVideo
ActionGameAn action gameGame
AdventureGameAdventure style gameGame
ArcadeGameArcade style gameGame
BoardGameA board gameGame
BlocksGameFalling blocks gameGame
CardGameA card gameGame
KidsGameA game for kidsGame
LogicGameLogic games like puzzles, etcGame
RolePlayingA role playing gameGame
ShooterA shooter gameGame
SimulationA simulation gameGame
SportsGameA sports gameGame
StrategyGameA strategy gameGame
ArtSoftware to teach artsEducation or Science
Construction Education or Science
MusicMusical softwareAudioVideo or Education
LanguagesSoftware to learn foreign languagesEducation or Science
ArtificialIntelligenceArtificial Intelligence softwareEducation or Science
AstronomyAstronomy softwareEducation or Science
BiologyBiology softwareEducation or Science
ChemistryChemistry softwareEducation or Science
ComputerScienceComputerSience softwareEducation or Science
DataVisualizationData visualization softwareEducation or Science
EconomyEconomy softwareEducation or Science
ElectricityElectricity softwareEducation or Science
GeographyGeography softwareEducation or Science
GeologyGeology softwareEducation or Science
GeoscienceGeoscience software, GISEducation or Science
HistoryHistory softwareEducation or Science
HumanitiesSoftware for philosophy, psychology and other humanitiesEducation or Science
ImageProcessingImage Processing softwareEducation or Science
LiteratureLiterature softwareEducation or Science
MapsSofware for viewing maps, navigation, mapping, GPSEducation or Science or Utility
MathMath softwareEducation or Science
NumericalAnalysisNumerical analysis softwareEducation;Math or Science;Math
MedicalSoftwareMedical softwareEducation or Science
PhysicsPhysics softwareEducation or Science
RoboticsRobotics softwareEducation or Science
SpiritualityReligious and spiritual software, theologyEducation or Science or Utility
SportsSports softwareEducation or Science
ParallelComputingParallel computing softwareEducation;ComputerScience or Science;ComputerScience
AmusementA simple amusement 
ArchivingA tool to archive/backup dataUtility
CompressionA tool to manage compressed data/archivesUtility;Archiving
ElectronicsElectronics software, e.g. a circuit designer 
EmulatorEmulator of another platform, such as a DOS emulatorSystem or Game
EngineeringEngineering software, e.g. CAD programs 
FileToolsA file tool utilityUtility or System
FileManagerA file managerSystem;FileTools
TerminalEmulatorA terminal emulator applicationSystem
FilesystemA file system toolSystem
MonitorMonitor application/applet that monitors some resource or activitySystem or Network
SecurityA security toolSettings or System
AccessibilityAccessibilitySettings or Utility
CalculatorA calculatorUtility
ClockA clock application/appletUtility
TextEditorA text editorUtility
DocumentationHelp or documentation 
AdultApplication handles adult or explicit material 
CoreImportant application, core to the desktop such as a file manager or a help browser 
KDEApplication based on KDE librariesQT
GNOMEApplication based on GNOME librariesGTK
XFCEApplication based on XFCE librariesGTK
GTKApplication based on GTK+ libraries 
QtApplication based on Qt libraries 
MotifApplication based on Motif libraries 
JavaApplication based on Java GUI libraries, such as AWT or Swing 
ConsoleOnlyApplication that only works inside a terminal (text-based or command line application) 
acidjazz Written by: