How to install & run Gimp using snap

jastako

I want to:

  1. Ask if user has installed snap. If not run a script that installs snap & exit, if yes continue.
  2. Install gimp, then show a message indicating that gimp install is complete.
  3. Ask user if they want to run gimp. If yes run gimp, if no exit script.
Shane Bishop

Here is an sh-compliant script. Comments are provided to explain what different parts of the script do.

I assumed it was okay to install snap with the apt package manager, because the OP did not specify how to install snap.

#!/usr/bin/env sh

# Exit early if any command fails
set -e

installSnap() {
    # Assumption: This script is run only on Debian-based Linux distributions
    echo 'snap not installed, installing snap...'
    sudo apt update
    sudo apt install snapd
    echo 'snap installed. Log out and back in again before using snap.'
}

# If snap is not installed, install snap and exit
command -v snap || { installSnap && echo 'Exiting install script.' && exit 0; }

# Install GIMP
echo 'Installing GIMP...'
snap install gimp
echo 'GIMP installed.'

# Prompt user for input, and store input in answer
printf 'Would you like to run GIMP (y/n)? '
read -r answer

# If answer begins with 'Y' or 'y', start gimp
# Run gimp in background with nohup so gimp will continue running after
# this script terminates
# We likely aren't interested in gimp's output, so redirect it to /dev/null
[ "$answer" != "${answer#[Yy]}" ] && nohup gimp > /dev/null 2>&1 &

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

How to install additional Gimp fonts

From Dev

How to make Gimp run as a single window?

From Dev

How to run GIMP on Ubuntu 16.04 (install from flatpak)?

From Dev

How to install Resynthesizer in gimp?

From Dev

How to install GIMP 2.7?

From Dev

How to run a previous version of a snap package

From Dev

How to install Chromium without snap?

From Dev

How to install additional Gimp fonts

From Dev

How to make Gimp run as a single window?

From Dev

How to run GIMP on Ubuntu 16.04 (install from flatpak)?

From Dev

How to install Resynthesizer in gimp?

From Dev

How to install GIMP 2.7?

From Dev

Can't find or run spotify after `snap install spotify`

From Dev

How to install Gimp Toolbox Photoshop Theme

From Dev

How to install gimp-GAP for gimp snap

From Dev

GIMP install failed by ubuntu-software and also "sudo snap install gimp"

From Dev

How to Install gimp 2.8 on ubuntu?

From Dev

How to re-install GIMP 2.6 after trying GIMP 2.8?

From Dev

How to configure port number for OwnCloud snap install?

From Dev

How to get e.g Gimp (snap package) to access printers

From Dev

How to move config files during snap install

From Dev

How to install Resynthesizer Plugin in GIMP snap?

From Dev

Installing GIMP: snap, repository, or PPA?

From Dev

How do I install Firefox as a snap?

From Dev

How to install Chromium without snap?

From Dev

How to install the Darktable plugin for GIMP 2.10

From Dev

how to launch the tor browser from a snap install?

From Dev

How to run a previous version of a snap package

From Dev

Install shared library using snap