snapcrafters/snap-repo-template

Using xwayland for a python app

saiftyfirst opened this issue · 2 comments

Hi guys,

I am trying to modify your example to make my python app work in a similar way.

Here is my yaml file (I basically kept it the same except the parts with the actual app)

name: tk-demo
version: '0.1'
summary: Demo of using tkinter for snappy

description: |
    PyGame bouncing ball on a snappy package
base: core18
confinement: devmode

layout:
    /usr/share/X11:
        bind: $SNAP/usr/share/X11
    /usr/share/tcltk:
        bind: $SNAP/usr/share/tcltk
    /usr/lib/tcltk:
        bind: $SNAP/usr/lib/tcltk

parts:
    xwayland-kiosk-helper:
        plugin: cmake
        source: https://github.com/MirServer/xwayland-kiosk-helper.git
        build-packages: [ build-essential ]
        stage-packages: [ xwayland, i3, libegl1-mesa, libgl1-mesa-glx ]

    pygame-demo:
        plugin: python
        python-version: python3
        source: .
        stage-packages: 
            - python3-tk
            - mesa-utils

environment:
      XWAYLAND_FULLSCREEN_WINDOW_HINT: title="tk"

apps:
    pygame-demo:
        command: xwayland-kiosk-launch bin/tk_demo
        plugs:
        - wayland

However, when I do:

miral-kiosk&
sudo snap install --dangerous ./tk-demo_0.1_amd64.snap --devmode
snap run tk-demo

I get the following error:

Error: Unable to find a valid Wayland socket in /run/user/0
Is a Wayland server running?

Your example works perfectly fine.

Could you possibly give me a pointer on where I might be getting it wrong ?

Many thanks

Please ask such questions on the forum, there are a bunch of really cool and smart people there who can help you further! https://forum.snapcraft.io/