Skip to main content

Making an AppImage discoverable in ubuntu and configuring URL handling in Firefox

OS: Ubuntu 24.04

Using software in AppImage format can lead to Ubuntu not recognizing it properly when handling links. Here’s how to configure Ubuntu to manage an AppImage application seamlessly. We'll use Obsidian as an example.

Step 1: Creating a .desktop File

To make the Obsidian AppImage discoverable by the system, create a .desktop file—a shortcut that defines how the application should be launched. Here’s the content for the file:

[Desktop Entry]
Exec=/path_to_the_appimage/Obsidian-1.6.5.AppImage --no-sandbox %U
Name=Obsidian
Terminal=false
Type=Application
MimeType=x-scheme-handler/obsidian;

Explanation of Key Entries:

  1. Exec: The command to run the AppImage, with --no-sandbox to avoid sandboxing errors.
  2. Name: The display name of the app.
  3. Terminal: Set to false to avoid opening a terminal window.
  4. Type: Identifies this as an application.
  5. MimeType: Registers obsidian:// links to be handled by this application.

After creating the .desktop file, save it to /usr/share/applications/Obsidian.desktop for system-wide access.

Step 2: Making the AppImage Executable

To ensure the application can be launched, set the AppImage to be executable with this command:

chmod +x /path_to_the_appimage/Obsidian-1.6.5.AppImage

Step 3: Updating the Desktop Database

Register the .desktop entries with the system by updating the desktop database:

update-desktop-database ~/.local/share/applications/

Step 4: Associating the App with the obsidian:// Protocol

To allow Firefox to open obsidian:// links with Obsidian, register the protocol using:

xdg-mime default Obsidian.desktop x-scheme-handler/obsidian

Confirm registration by querying the MIME type:

xdg-mime query default x-scheme-handler/obsidian

If this doesn’t work, reapply the association and ensure the .desktop file is also copied to the local applications folder:

cp /usr/share/applications/Obsidian.desktop ~/.local/share/applications/

Step 5: Configuring Firefox to Recognize the Protocol

Configure Firefox to recognize obsidian:// URLs:

  1. In Firefox, go to about:config.
  2. Search for network.protocol-handler.expose.obsidian.
  3. If the setting doesn’t exist, create it as a Boolean and set it to false.
  4. Upon clicking an obsidian:// link, Firefox prompts you to select Obsidian as the handler. Choose your .desktop file.

Summary

These steps make the Obsidian AppImage discoverable by Ubuntu, executable, and registered as a protocol handler for obsidian:// links in Firefox. Following this workflow ensures that Obsidian can be launched easily from the OS and integrated with your browser for seamless link handling.

Comments

Popular posts from this blog

A workflow to support personal learning from raw sources

 Unlocking Efficient Learning with AI-Powered Flashcards in Obsidian As learners, we're constantly seeking ways to optimize our learning workflow and process new information more effectively. In this post, I'll explore a powerful combination of tools that can help you achieve just that: Obsidian and the SystemSculpt and the Spaced Repetition plugins. Together, these tools can help you generate flashcards that support a structured learning workflow, making it easier to create knowledge from your source materials.   The Power of Obsidian Obsidian allows you to organize your thoughts and ideas in a flexible and customizable way. Its unique features, such as tags, folders, and links, enable you to create a knowledge graph that connects your notes and ideas. In this workflow, I'll be using Obsidian as the central hub for my learning process.   SystemSculpt and Spaced Repetition: The AI-Powered Flashcard Generators SystemSculpt is an AI-powered plugin that integrates seamless...

Create a react project from scratch - the template for a new start

How to Create a React Project on Ubuntu 24.04 How to Create a React Project on Ubuntu 24.04 Step-by-Step Guide 1. Create a Folder for the Project Start by creating a dedicated folder where your project will reside. Open a terminal and run: mkdir react-project && cd react-project 2. Check if Node.js and npm Are Installed Node.js and npm are essential for creating React projects. Verify their presence with: node -v npm -v If they aren’t installed, use nvm (Node Version Manager) for easy installation: curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.4/install.sh | bash source ~/.bashrc nvm install --lts After installing, verify the installation again with the commands above. Learn more about nvm here. 3. Use Vite to Create the Project Vite is a fast build tool optimized for modern web apps. T...