zapretgui/packaging/linux/deb/postinst
loop-uh 9374126314
All checks were successful
Zapret source guards / validate (push) Successful in 8s
Windows-сборка / Dev Dev 21.1.7.273 опубликован
Linux packaging: no invented file type; presets stay plain .txt/.zip files opened inside the program
The desktop entry claimed `application/x-zapret-preset` (*.zapretpreset), a type nothing in the program produces or reads (presets are .txt/.zip and are imported by drop or the import dialog). Removed the MIME file, the `MimeType` line, `%U`, and the mime-database calls from the install/uninstall and .deb scripts.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-15 16:30:52 -05:00

22 lines
1.1 KiB
Shell

#!/bin/sh
set -e
# The person who installed (sudo or pkexec) is added to the group that may talk to the helper; others add themselves:
# sudo usermod -aG zapretgui NAME
if [ "$1" = configure ]; then
getent group zapretgui >/dev/null || groupadd --system zapretgui
WHO="${SUDO_USER:-}"
[ -z "$WHO" ] && [ -n "${PKEXEC_UID:-}" ] && WHO="$(getent passwd "$PKEXEC_UID" | cut -d: -f1)"
if [ -n "$WHO" ] && [ "$WHO" != root ] && id "$WHO" >/dev/null 2>&1; then
usermod -aG zapretgui "$WHO" && echo "zapretgui: $WHO was added to the group zapretgui (log in again for it to apply)"
else
echo "zapretgui: add each person who uses it to the group: sudo usermod -aG zapretgui NAME"
fi
command -v update-desktop-database >/dev/null && update-desktop-database -q /usr/share/applications || true
command -v gtk-update-icon-cache >/dev/null && gtk-update-icon-cache -q /usr/share/icons/hicolor || true
if [ -d /run/systemd/system ]; then
systemctl daemon-reload || true
systemctl enable zapretgui-helper.service || true
systemctl restart zapretgui-helper.service || true
fi
fi
exit 0