How to start a pygame-sdl2 app from Scopes
-
How do I start a simple pygame-sdl2 test app from Scopes, like the one below:
#!/usr/bin/env python2 import time import pygame_sdl2 pygame_sdl2.import_as_pygame() import pygame.display pygame.init() di = pygame.display.Info() screen = pygame.display.set_mode((di.current_w, di.current_h), pygame.FULLSCREEN) screen.fill((255,255,255)) pygame.draw.circle(screen, (255, 0, 0), (di.current_w/2, di.current_h/2), 100, 0) pygame.display.flip() time.sleep(2)I've remounted / as rw, and apt-get install'ed python-pygame-sdl2
I've tried to create a .desktop file in ~/.local/share/applications
and I see that Scopes get's redrawn, but no new icon appears.How should such a .desktop look like? Is it the right way to add an app to Scopes?
Edit: After rebooting the phone, the icon of my app showed up. But how to reload .desktop files in a more smooth way?
-
Firstly, some questions:
- Why are you using python2? It will be end of life next year, and we only support python3 on UT.
- Why are you installing this to rootfs rather than packaging your game into a click?
- What does your
.desktopfile look like?
I don't recall if SDL2 is part of the rootfs, but you will need to include the pygame libraries directly within your click package.
-
Hi @dobey,
- There are only a python2 pygame_sdl2 package available.
- Out of ignorance
No idea how to make a click. I'll give it a try. - After a reboot Scopes shows up my icons. I guess as a click it will work better.
Not sure if SDL2 got included when I installed pygame_sdl2 or not.
Thanks! -
OK. I'm not sure why a python3 version of pygame isn't available in the Ubuntu repositories, so it looks like you will probably need to build your own version to work with python3, as part of the click packaging.
You might want to check out
clickablefor making it easy to package an app up.
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login