Created
July 10, 2021 07:02
-
-
Save shaybensasson/3e8e49af92d7e5013fc77da22bd3ae4c to your computer and use it in GitHub Desktop.
Installing Obsidian (an advanced markdown editor) on Ubuntu
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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" |
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
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
thank you for this, mine wasn't working after upgrading to 22.04 and this fixed it!