Skip to content

Instantly share code, notes, and snippets.

@lelinhtinh
Forked from Wind213/install-postman.sh
Last active June 17, 2022 13:48
Show Gist options
  • Save lelinhtinh/0c7b70d4362aa7b422052d166f03d4c6 to your computer and use it in GitHub Desktop.
Save lelinhtinh/0c7b70d4362aa7b422052d166f03d4c6 to your computer and use it in GitHub Desktop.
#!/bin/bash
cd /tmp || exit
echo "Downloading Postman ..."
wget -q https://dl.pstmn.io/download/latest/linux?arch=64 -O postman.tar.gz
tar -xzf postman.tar.gz
rm postman.tar.gz
echo "Installing to opt..."
if [ -d "/opt/Postman" ];then
sudo rm -rf /opt/Postman
fi
sudo mv Postman /opt/Postman
echo "Creating symbolic link..."
if [ -L "/usr/bin/postman" ];then
sudo rm -f /usr/bin/postman
fi
sudo ln -s /opt/Postman/Postman /usr/bin/postman
echo "Creating ico ..."
if [ -L "~/.local/share/applications/postman.desktop" ];then
rm -f ~/.local/share/applications/postman.desktop
fi
cat > ~/.local/share/applications/postman.desktop <<EOL
[Desktop Entry]
Name=Postman
Exec=postman
Icon=/opt/Postman/app/icons/icon_128x128.png
Terminal=false
Type=Application
Categories=Development;
EOL
echo "Installation completed successfully."
gtk-update-icon-cache
@lelinhtinh
Copy link
Author

xdg-mime default postman.desktop x-scheme-handler/postman
xdg-settings check default-url-scheme-handler postman postman.desktop

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