Skip to content

Commit cfec74b

Browse files
author
arch
committed
fix flatpak
1 parent 250ec99 commit cfec74b

File tree

6 files changed

+35
-27
lines changed

6 files changed

+35
-27
lines changed

README.md

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -17,19 +17,3 @@ If you want to contribute to the project and make it better, your help is very w
1717
## License
1818

1919
Distributed under the MIT License. See `LICENSE` for more information.
20-
21-
## Flatpak
22-
23-
```bash
24-
sudo sysctl kernel.unprivileged_userns_clone=1
25-
flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
26-
flatpak install flathub org.freedesktop.Platform//21.08 org.freedesktop.Sdk//21.08
27-
flatpak-builder build-dir org.flatpak.PythonFunscriptEditor.json --force-clean
28-
flatpak-builder --run build-dir org.flatpak.PythonFunscriptEditor.json runner.sh
29-
```
30-
31-
### Debugging
32-
33-
```bash
34-
flatpak-builder --run build-dir org.flatpak.PythonFunscriptEditor.json /bin/bash
35-
```

build_flatpak.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/bin/bash
2+
3+
sudo sysctl kernel.unprivileged_userns_clone=1
4+
flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
5+
flatpak install flathub org.freedesktop.Platform//21.08 org.freedesktop.Sdk//21.08
6+
flatpak install org.gnome.Platform//3.38 org.gnome.Sdk//3.38
7+
flatpak-builder build-dir org.flatpak.PythonFunscriptEditor.json --force-clean

contrib/flatpak/README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# Flatpak
2+
3+
## Cheatsheet
4+
5+
```bash
6+
./build_flatpak.sh
7+
flatpak-builder --run build-dir org.flatpak.PythonFunscriptEditor.json /bin/bash
8+
flatpak-builder --run build-dir org.flatpak.PythonFunscriptEditor.json runner.sh
9+
```

contrib/flatpak/runner.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
#!/bin/sh
22

3-
# /app/bin/conda/bin/activate
3+
/app/bin/conda/bin/activate
44
/app/bin/conda/bin/python /app/bin/main.py "$@"

funscript_editor/ui/funscript_editor_window.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,8 @@ def __open_video(self):
276276
file_name = QtWidgets.QFileDialog.getOpenFileName(
277277
None,
278278
caption="Select Video File",
279-
directory=QtCore.QDir.currentPath())
279+
options=QtWidgets.QFileDialog.DontUseNativeDialog # required to get correct path in flatpak
280+
)
280281
if len(file_name) < 1: return
281282
if not any(file_name[0].lower().endswith(x) for x in ['.mkv', '.mp4']): return
282283

@@ -294,6 +295,7 @@ def __open_video(self):
294295
self.ui.seekBar.setMaximum(max((0, self.video_player.get_length-2)))
295296
self.ui.seekBar.setValue(0)
296297
self.ui.timestamp.setText(FFmpegStream.millisec_to_timestamp(0)+' ')
298+
self.__logger.info("Load Video: %s (%s)" , file_name[0], "True" if os.path.exists(file_name[0]) else "False")
297299

298300
def __new_funscript(self):
299301
self.funscript = Funscript(fps=self.video_player.get_fps)

org.flatpak.PythonFunscriptEditor.json

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,22 @@
11
{
22
"app-id": "org.flatpak.PythonFunscriptEditor",
3-
"runtime": "org.freedesktop.Platform",
4-
"runtime-version": "21.08",
5-
"sdk": "org.freedesktop.Sdk",
3+
"runtime": "org.gnome.Platform",
4+
"runtime-version": "3.38",
5+
"sdk": "org.gnome.Sdk",
66
"command": "runner.sh",
77
"finish-args": [
8-
"--device=all",
9-
"--share=network",
108
"--share=ipc",
11-
"--socket=x11",
9+
"--socket=fallback-x11",
1210
"--socket=wayland",
11+
"--device=all",
12+
"--share=network",
1313
"--socket=pulseaudio",
14-
"--filesystem=home:rw"
14+
"--filesystem=xdg-pictures",
15+
"--filesystem=home:rw",
16+
"--talk-name=org.gtk.vfs",
17+
"--talk-name=org.gtk.vfs.*",
18+
"--talk-name=org.gnome.SettingsDaemon.MediaKeys",
19+
"--env=LC_NUMERIC=C"
1520
],
1621
"modules": [
1722
{
@@ -22,14 +27,15 @@
2227
},
2328
"build-commands": [
2429
"export CONDA_ALWAYS_YES=\"true\"",
25-
"bash Miniconda3-latest-Linux-x86_64.sh -b -p /app/bin/conda -f",
30+
"bash Miniconda3-py38_4.10.3-Linux-x86_64.sh -b -p /app/bin/conda -f",
2631
"/app/bin/conda/bin/activate",
2732
"/app/bin/conda/bin/conda env update -f environment_flatpak.yaml"
2833
],
2934
"sources": [
3035
{
3136
"type": "file",
32-
"path": "Miniconda3-latest-Linux-x86_64.sh"
37+
"url": "https://repo.anaconda.com/miniconda/Miniconda3-py38_4.10.3-Linux-x86_64.sh",
38+
"sha256": "935d72deb16e42739d69644977290395561b7a6db059b316958d97939e9bdf3d"
3339
},
3440
{
3541
"type": "file",

0 commit comments

Comments
 (0)