Skip to content

Commit 66510fb

Browse files
authored
Bundle PhotoGIMP in the AppImage (#20)
1 parent be5837f commit 66510fb

File tree

3 files changed

+70
-24
lines changed

3 files changed

+70
-24
lines changed

README.md

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,18 @@
1-
# GIMP-AppImage
1+
# GIMP-and-PhotoGIMP-AppImage
2+
3+
Unofficial AppImage of GIMP that includes PhotoGIMP, in order to use PhotoGIMP simply run the AppImage once this way:
4+
5+
```
6+
ENABLE_PHOTO_GIMP=1 ./GIMP-3.0.2-3-anylinux-x86_64.AppImage
7+
```
8+
9+
* This will cause it to create a `$XDG_CONFIG_HOME/PhotoGIMP` directory and copy over the PhotoGIMP config files.
10+
11+
* It will also make a desktop entry in `$XDG_DATA_HOME/applications/PhotoGIMP-AppImage.desktop` and copy needed icons to `$XDG_DATA_HOME/icons`
12+
13+
Once done you will be able to keep using PhotoGIMP by launching the new desktop entry, you will also be able to keep using regular GIMP both at the same time.
14+
15+
----------------------------------------
216

317
AppImage made using [sharun](https://github.com/VHSgunzo/sharun), which makes it extremely easy to turn any binary into a portable package without using containers or anything like that.
418

get-dependencies.sh

Lines changed: 22 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -18,27 +18,28 @@ OPUS_URL="https://github.com/pkgforge-dev/llvm-libs-debloated/releases/download/
1818
echo "Installing dependencies..."
1919
echo "---------------------------------------------------------------"
2020
pacman -Syu --noconfirm \
21-
aalib \
22-
alsa-lib \
23-
base-devel \
24-
cfitsio \
25-
curl \
26-
desktop-file-utils \
27-
ffmpeg \
28-
ghostscript \
29-
gimp \
30-
git \
31-
gjs \
32-
gtk3 \
33-
gvfs \
34-
libheif \
35-
libmng \
36-
librsvg \
37-
patchelf \
38-
strace \
39-
wget \
40-
xorg-server-xvfb \
41-
zsync
21+
aalib \
22+
alsa-lib \
23+
base-devel \
24+
cfitsio \
25+
curl \
26+
desktop-file-utils \
27+
ffmpeg \
28+
ghostscript \
29+
gimp \
30+
git \
31+
gjs \
32+
gtk3 \
33+
gvfs \
34+
libheif \
35+
libmng \
36+
librsvg \
37+
patchelf \
38+
strace \
39+
unzip \
40+
wget \
41+
xorg-server-xvfb \
42+
zsync
4243

4344
echo "Installing debloated pckages..."
4445
echo "---------------------------------------------------------------"

gimp-appimage.sh

Lines changed: 33 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ export STRACE_TIME=20
1010
UPINFO="gh-releases-zsync|$(echo $GITHUB_REPOSITORY | tr '/' '|')|continuous|*$ARCH.AppImage.zsync"
1111
LIB4BN="https://raw.githubusercontent.com/VHSgunzo/sharun/refs/heads/main/lib4bin"
1212
URUNTIME="https://github.com/VHSgunzo/uruntime/releases/latest/download/uruntime-appimage-dwarfs-$ARCH"
13+
PHOTOGIMP="https://github.com/Diolinux/PhotoGIMP/releases/latest/download/PhotoGIMP-linux.zip"
1314

1415
# Prepare AppDir
1516
mkdir -p ./AppDir/etc ./AppDir/share/icons
@@ -117,6 +118,8 @@ echo 'unset GEGL_PATH' > ./.env
117118
# PREPARE SHARUN
118119
echo '#!/bin/sh
119120
CURRENTDIR="$(readlink -f "$(dirname "$0")")"
121+
CONFIGDIR="${XDG_CONFIG_HOME:-$HOME/.config}"
122+
DATADIR="${XDG_DATA_HOME:-$HOME/.local/share}"
120123
export GIMP3_DATADIR="$CURRENTDIR"/share/gimp/3.0
121124
export GIMP3_SYSCONFDIR="$CURRENTDIR"/etc/gimp/3.0
122125
export GIMP3_LOCALEDIR="$CURRENTDIR"/share/locale
@@ -125,13 +128,41 @@ export GIMP3_PLUGINDIR="$CURRENTDIR"/shared/lib/gimp/3.0
125128
ln -sfn "$CURRENTDIR"/share /tmp/xdg69
126129
ln -sfn "$CURRENTDIR"/lib /tmp/o_0
127130
131+
if [ "$ENABLE_PHOTO_GIMP" = 1 ]; then
132+
if [ ! -d "$CONFIGDIR"/PhotoGIMP ]; then
133+
mkdir -p "$CONFIGDIR"
134+
cp -rv "$CURRENTDIR"/PhotoGIMP/.config/GIMP "$CONFIGDIR"/PhotoGIMP
135+
cp -rvn "$CURRENTDIR"/PhotoGIMP/.local/share/* "$DATADIR"
136+
fi
137+
export GIMP3_DIRECTORY="$CONFIGDIR"/PhotoGIMP/3.0
138+
fi
139+
128140
exec "$CURRENTDIR"/bin/gimp "$@"' > ./AppRun
129141
chmod +x ./AppRun
130142
./sharun -g
131143

144+
# ADD PHOTOGIMP
145+
wget "$PHOTOGIMP" -O ./PhotoGIMP.zip
146+
unzip ./PhotoGIMP.zip
147+
rm -f ./PhotoGIMP.zip
148+
mv -v ./PhotoGIMP-linux ./PhotoGIMP
149+
mv -v ./PhotoGIMP/.local/share/applications/org.gimp.GIMP.desktop \
150+
./PhotoGIMP/.local/share/applications/PhotoGIMP-AppImage.desktop
151+
152+
if ! grep -q 'StartupWMClass=' ./PhotoGIMP/.local/share/applications/PhotoGIMP-AppImage.desktop; then
153+
echo 'StartupWMClass=Gimp' >> ./PhotoGIMP/.local/share/applications/PhotoGIMP-AppImage.desktop
154+
fi
155+
if ! grep -q 'TryExec=' ./PhotoGIMP/.local/share/applications/PhotoGIMP-AppImage.desktop; then
156+
echo 'TryExec=gimp' >> ./PhotoGIMP/.local/share/applications/PhotoGIMP-AppImage.desktop
157+
fi
158+
159+
sed -i -e 's|Exec=.*|Exec=ENABLE_PHOTO_GIMP=1 gimp %U|g' \
160+
-e 's|StartupWMClass=.*|StartupWMClass=Gimp|g' \
161+
-e 's|TryExec=.*|TryExec=gimp|g' ./PhotoGIMP/.local/share/applications/PhotoGIMP-AppImage.desktop
162+
132163
# MAKE APPIMAGE WITH URUNTIME
133164
cd ..
134-
wget -q "$URUNTIME" -O ./uruntime
165+
wget "$URUNTIME" -O ./uruntime
135166
chmod +x ./uruntime
136167

137168
# Keep the mount point (speeds up launch time)
@@ -150,7 +181,7 @@ echo "Generating AppImage..."
150181
--header uruntime \
151182
-i ./AppDir -o ./GIMP-"$VERSION"-anylinux-"$ARCH".AppImage
152183

153-
wget -qO ./pelf "https://github.com/xplshn/pelf/releases/latest/download/pelf_$ARCH"
184+
wget -O ./pelf "https://github.com/xplshn/pelf/releases/latest/download/pelf_$ARCH"
154185
chmod +x ./pelf
155186
echo "Generating [dwfs]AppBundle...(Go runtime)"
156187
./pelf --add-appdir ./AppDir \

0 commit comments

Comments
 (0)