A simple Linux CLI tool to install portable applications into /opt
and automatically create a .desktop launcher.
Supports:
- Extracted application folders (tar.gz / zip releases)
- Standalone
.AppImagefiles
After installation, the original source is automatically cleaned up when located in common download/temp directories.
*All from chatjippity - will probably break your installs (probably) *
-
Installs applications into
/opt/{program} -
Creates a per-user launcher in:
~/.local/share/applications -
Supports extracted folder installs
-
Supports
.AppImageinstalls -
Automatic safe cleanup of source files
-
Optional
StartupWMClass -
Optional custom icon support
-
Safe replacement with
--force
Many Linux applications are distributed as:
- Portable tarballs
- Zip archives
- AppImages
The manual workflow usually looks like:
- Extract archive (if needed)
- Move to
/opt - Make executable
- Create
.desktopfile - Clean up download
install-opt automates that process in one command.
Make the script executable:
chmod +x install-optinstall-opt \
--name <Name> \
--src <extracted-folder> \
--exec <relative-path-to-executable> \
--icon <relative-path-to-icon> \
--categories <desktop-categories> \
--comment <description> \
--wmclass <startupWMclass> \
--force
| Argument | Default | Description |
|---|---|---|
--icon |
(none) | Relative path to an icon file (png/svg) inside the directory. |
--categories |
Utility; |
Desktop entry categories (e.g. Development;IDE;). |
--comment |
Installed app |
Description shown in application menu. |
--terminal |
false |
Whether the app should launch inside a terminal. |
--wmclass |
(none) | StartupWMClass value for proper dock/taskbar grouping. |
--force |
disabled | Replace existing installation in /opt/{program} if it exists. |
Use this mode for standalone .AppImage files.
Syntax
install-opt \
--name <program> \
--src <file.AppImage> \
--appimage \
[options]
Example
install-opt \
--name obsidian \
--src ~/Downloads/Obsidian-1.5.3.AppImage \
--categories "Office;Utility;" \
--comment "Obsidian Markdown Editor" \
--forceThe AppImage will be installed as:
/opt/{program}/{program}.AppImage