Hi there,
Please forgive my newness in this post. I’ve been working on trying to package Transmission Remote GUI (aka transgui) as a Snap, but I’m running into a lot of issues with GTK2 theming that I can’t solve easily.
I have tried to follow the guide in the docs and the accompanying thread but I’m struggling to make things work.
The Snap builds successfully, but the app runs with the same “Windows 98 era window scheme” that I’ve seen discussed in other threads recently.
Most of my other experimentation has involved stalking the Snapcrafters GitHub for signs of other GTK2 apps and attempting to lift bits from their yaml
files to get things to work. Nothing I have tried seems to work unfortunately. I’ve tried so many things at this point that I’m losing track of what I have actually tried.
My current snapcraft.yaml
file is below. I’m aware that I’m almost certainly connecting too many plugs for this kind of app, and the .desktop
file, icons and launchers and other such cosmetic stuff still needs sorting out, but I was going to handle that later after solving the theming issue.
I’m not looking for someone to hold my hand through creating the entire Snap as I’m wanting to learn how to do this myself, but if anyone has any clues or could point me in the right direction on how to fix the theming that would be great!
name: transgui
version: 5.18.0
grade: stable
summary: A feature rich cross platform Transmission BitTorrent client.
description: |
Transmission Remote GUI is feature rich cross platform front-end
to remotely control Transmission daemon via its RPC protocol.
It is faster and has more functionality than builtin Transmission
web interface.
confinement: strict
base: core18
architectures:
- build-on: amd64
- build-on: i386
apps:
transgui:
command: transgui
parts:
transgui:
plugin: dump
source:
- on amd64: https://github.com/transmission-remote-gui/transgui/releases/download/v$SNAPCRAFT_PROJECT_VERSION/transgui-$SNAPCRAFT_PROJECT_VERSION-x86_64-Linux.txz
- on i386: https://github.com/transmission-remote-gui/transgui/releases/download/v$SNAPCRAFT_PROJECT_VERSION/transgui-$SNAPCRAFT_PROJECT_VERSION-i686-Linux.txz
source-type: tar
stage-packages:
- libx11-6
- libcairo2
- libssl-dev
- libatk1.0-0
- libgtk2.0-0
- libglib2.0-0
- libpango-1.0-0
- libgdk-pixbuf2.0-0
after:
- desktop-gtk2
desktop-gtk2:
source: https://github.com/ubuntu/snapcraft-desktop-helpers.git
source-subdir: gtk
plugin: make
make-parameters: ["FLAVOR=gtk2"]
build-packages:
- build-essential
- libgtk2.0-dev
stage-packages:
- libxkbcommon0 # XKB_CONFIG_ROOT
- ttf-ubuntu-font-family
- dmz-cursor-theme
- light-themes
- adwaita-icon-theme
- gnome-themes-standard
- shared-mime-info
- libgtk2.0-0
- libgdk-pixbuf2.0-0
- libglib2.0-bin
- libgtk2.0-bin
- unity-gtk2-module
- locales-all
- libappindicator1
- xdg-user-dirs
- ibus-gtk
- libibus-1.0-5
plugs:
# For file picker demo
avahi-observe: # Non-A/C
home:
mount-observe: # Non-A/C
removable-media: # Non-A/C
# Common graphical application resources
desktop:
desktop-legacy:
unity7:
wayland:
x11:
# On a Wayland session, GTK instead uses the GSettings API to read the users preferences directly, bypassing the display server. So plugging the gsettings interface is also necessary.
# Allowing GTK to detect the selected system theme - How to use the system GTK theme via the gtk-common-themes snap - doc - snapcraft.io
# https://forum.snapcraft.io/t/how-to-use-the-system-gtk-theme-via-the-gtk-common-themes-snap/6235
gsettings:
# For networking
network:
gtk-2-engines:
interface: content
target: $SNAP/lib/gtk-2.0
default-provider: gtk2-common-themes
gtk-2-themes:
interface: content
target: $SNAP/data-dir/themes
default-provider: gtk-common-themes
icon-themes:
interface: content
target: $SNAP/data-dir/icons
default-provider: gtk-common-themes
sound-themes:
interface: content
target: $SNAP/data-dir/sounds
default-provider: gtk-common-themes
As an aside, there is a snapcraft.yaml
file in the root of the transgui GitHub repo which I know of. Snap support has been worked on before by the devs, but they got stuck wrestling with the same GTK2 issue as I have and it isn’t finished or published in the store. I can’t post more than 2 links in this post as a new user, but the GitHub issue can be found by searching “snap” in the repo.
Thanks for any help anyone can provide