GNOME Desktop Installer

I couldn’t find an installer for GNOME… so I made my own!

#!/usr/bin/env bash
set -euo pipefail

icon_url="https://cdn.discordapp.com/icons/686053708261228577/1361e62fed2fee55c7885103c864e2a8.png"
dl_url=${1:-}

if [[ -z "$dl_url" ]]; then
	echo "missing download link"
    echo "usage: install-obsidian.sh <download url>"
    exit 1
fi

curl --location --output Obsidian.AppImage "$dl_url"
curl --location --output obsidian.png "$icon_url"

sudo mkdir --parents /opt/obsidian/
sudo mv Obsidian.AppImage /opt/obsidian
sudo chmod u+x /opt/obsidian/Obsidian.AppImage
sudo mv obsidian.png /opt/obsidian
sudo ln -s /opt/obsidian/obsidian.png /usr/share/pixmaps

echo "[Desktop Entry]
Type=Application
Name=Obsidian
Exec=/opt/obsidian/Obsidian.AppImage
Icon=obsidian
Terminal=false" > ~/.local/share/applications/obsidian.desktop

update-desktop-database ~/.local/share/applications
echo "install ok"

It installs the Obsidian.AppImage file and creates a desktop entry so you can launch Obsidian via the normal application launcher.

$ chmod u+x install-obsidian.sh
$ ./install-obsidian.sh <download link>
13 Likes

Nice! If you need to install several AppImages, there’s also AppImageLauncher that automates this setup for you.

1 Like

Here’s a pipeline to get the latest AppImage URL from Github (adapted from here):

dl_url=$( curl -s https://api.github.com/repos/obsidianmd/obsidian-releases/releases/latest  \
	| grep "browser_download_url.*AppImage" | tail -n 1 | cut -d '"' -f 4 )

So, I have a pair of lines in my provisioning script that does that, and then bash PATH_TO_INSTALL_OBSIDIAN/install-obsidin.sh $dl_url. I’m assuing there will never be spaces in $dl_url.

Also, it might be worth adding --silent at the end of the curl lines. Curl is too verbose by default.