如何使用 snap 安装和运行 Gimp

贾斯塔科

我想要:

  1. 询问用户是否安装了 snap。如果没有运行安装 snap & exit 的脚本,如果是,则继续。
  2. 安装 gimp,然后显示一条消息,指示 gimp 安装已完成。
  3. 询问用户是否要运行 gimp。如果是运行 gimp,如果没有退出脚本。
谢恩主教

这是一个sh兼容的脚本。提供了注释来解释脚本的不同部分的作用。

我认为snap使用apt包管理器安装是可以的,因为 OP 没有指定如何安装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 &

本文收集自互联网,转载请注明来源。

如有侵权,请联系[email protected] 删除。

编辑于
0

我来说两句

0条评论
登录后参与评论

相关文章

来自分类Dev

如何为gimp snap安装gimp-GAP

来自分类Dev

如何在GIMP snap中安装Resynthesizer插件?

来自分类Dev

安装GIMP:snap,存储库还是PPA?

来自分类Dev

GIMP安装因ubuntu软件而失败,并且也因“ sudo snap install gimp”而失败

来自分类Dev

如何安装GIMP 2.7?

来自分类Dev

如何安装GIMP 2.7?

来自分类Dev

如何在Ubuntu 16.04上运行GIMP(从flatpak安装)?

来自分类Dev

使用 snap 安装共享库

来自分类Dev

如何运行被安装为snap软件包的inkscape?

来自分类Dev

如何安装其他Gimp字体

来自分类Dev

如何在gimp中安装Resynthesizer

来自分类Dev

如何安装其他Gimp字体

来自分类Dev

如何在gimp中安装Resynthesizer?

来自分类Dev

如何在ubuntu上安装gimp 2.8?

来自分类Dev

如何为 GIMP 2.10 安装 Darktable 插件

来自分类Dev

如何使Gimp作为单个窗口运行?

来自分类Dev

如何使Gimp作为单个窗口运行?

来自分类Dev

如何使用Gimp脚本?

来自分类Dev

如何从 Snap LTS 频道安装 Blender?

来自分类Dev

使用snap安装VS Code,但未显示

来自分类Dev

如何运行以前版本的 snap 包

来自分类Dev

尝试GIMP 2.8后如何重新安装GIMP 2.6?

来自分类Dev

如何查看和修改 Snap 权限?

来自分类Dev

在Snap中使用路线和html(抢劫)

来自分类Dev

如果我同时通过 snap 和 APT 安装了一个应用程序,我如何知道当前正在运行的是哪个应用程序?

来自分类Dev

如果安装了同一程序的 deb 和 snap 版本,我该如何从命令行运行 m?

来自分类Dev

安装(或仅使用)gimp而不使用sudo特权

来自分类Dev

如何在Ubuntu 20.04的GIMP中安装NumPy?

来自分类Dev

安装GIMP的Felimage插件