Skip to content

Instantly share code, notes, and snippets.

@shaybensasson
Created July 10, 2021 07:02
Show Gist options
  • Star 15 You must be signed in to star a gist
  • Fork 7 You must be signed in to fork a gist
  • Save shaybensasson/3e8e49af92d7e5013fc77da22bd3ae4c to your computer and use it in GitHub Desktop.
Save shaybensasson/3e8e49af92d7e5013fc77da22bd3ae4c to your computer and use it in GitHub Desktop.
Installing Obsidian (an advanced markdown editor) on Ubuntu
#!/usr/bin/env bash
# see https://forum.obsidian.md/t/gnome-desktop-installer/499
set -euo pipefail
icon_url="https://cdn.discordapp.com/icons/686053708261228577/1361e62fed2fee55c7885103c864e2a8.png"
#dl_url=${1:-}
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 )
if [[ -z "$dl_url" ]]; then
echo "missing download link"
echo "usage: install-obsidian.sh"
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" > ~/usr/share/applications/obsidian.desktop
update-desktop-database ~/usr/share/applications
echo "install ok"
@calvincramer
Copy link

Thanks! This all worked for me except I had to use /usr/share/applications instead of ~/usr/share/applications

@chapmanjacobd
Copy link

chapmanjacobd commented Dec 18, 2021

#!/usr/bin/env bash
# see https://forum.obsidian.md/t/gnome-desktop-installer/499

set -euo pipefail

icon_url="https://cdn.discordapp.com/icons/686053708261228577/1361e62fed2fee55c7885103c864e2a8.png"
#dl_url=${1:-}
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 )

if [[ -z "$dl_url" ]]; then
	echo "missing download link"
    echo "usage: install-obsidian.sh"
    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 chmod +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" | sudo tee /usr/share/applications/obsidian.desktop

sudo update-desktop-database /usr/share/applications
echo "install ok"

@white-ice
Copy link

Hello. Tell me how to remove all this? Thank you.

@calvincramer
Copy link

@white-ice try putting some effort in and doing it yourself rather than ask random people to do free work for you?

@calvincramer
Copy link

To remove: sudo rm -rf /opt/obsidian.
AppImages are cool: https://askubuntu.com/questions/774490/what-is-an-appimage-how-do-i-install-it
No config files to clean up.


I installed obsidian again in a new Ubuntu 22 and needed to run install these packages in order for the AppImage to be able to run: sudo apt-get install fuse libfuse2

@hardyrarso
Copy link

To remove: sudo rm -rf /opt/obsidian. AppImages are cool: https://askubuntu.com/questions/774490/what-is-an-appimage-how-do-i-install-it No config files to clean up.

I installed obsidian again in a new Ubuntu 22 and needed to run install these packages in order for the AppImage to be able to run: sudo apt-get install fuse libfuse2

thank you for this, mine wasn't working after upgrading to 22.04 and this fixed it!

@petrokoriakin1
Copy link

jfui:

petro@petro-laptop:~/prod$ ./obsidian.sh 
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
100 93.6M  100 93.6M    0     0  6278k      0  0:00:15  0:00:15 --:--:-- 7307k
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  4473  100  4473    0     0  11294      0 --:--:-- --:--:-- --:--:-- 11324
[sudo] password for petro: 
ln: failed to create symbolic link '/usr/share/pixmaps/obsidian.png': File exists

@cfgnunes
Copy link

Simple script to download and install Obsidian:

url=$(wget --inet4-only -O - "https://api.github.com/repos/obsidianmd/obsidian-releases/releases/latest" 2>/dev/null | grep --only-matching -m 1 "https.*obsidian.*deb")
wget --inet4-only "$url"
sudo dpkg --install obsidian*.deb

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment