Add a flatpak wrapper to start Tuhi on demand
No-one but Arch packages Tuhi at the moment, so let's assume it's not running/installed, install it and start it up together with TuhiGui and voila, everything just works as it should be.
This commit is contained in:
parent
7677ce60eb
commit
bd66b8dbd3
10
README.md
10
README.md
|
@ -34,6 +34,16 @@ Install TuhiGUI
|
|||
|
||||
TuhiGui requires Python v3.6 or above.
|
||||
|
||||
Flatpak
|
||||
-------
|
||||
|
||||
```
|
||||
$> git clone http://github.com/tuhiproject/tuhigui
|
||||
$> cd tuhigui
|
||||
$> flatpak-builder flatpak_builddir org.freedesktop.TuhiGui.json --install --user --force-clean
|
||||
$> flatpak run org.freedesktop.TuhiGui
|
||||
```
|
||||
|
||||
License
|
||||
-------
|
||||
|
||||
|
|
|
@ -104,3 +104,8 @@ if appstream_util.found()
|
|||
test('appstream-util validate-relax', appstream_util,
|
||||
args: ['validate-relax', appdata])
|
||||
endif
|
||||
|
||||
# A wrapper to start tuhi at the same time as tuhigui, used by the flatpak
|
||||
configure_file(input: 'tools/tuhi-gui-flatpak.py',
|
||||
output: 'tuhi-gui-flatpak.py',
|
||||
copy: true)
|
||||
|
|
|
@ -3,11 +3,12 @@
|
|||
"runtime": "org.gnome.Platform",
|
||||
"runtime-version": "3.30",
|
||||
"sdk": "org.gnome.Sdk",
|
||||
"command": "tuhigui",
|
||||
"command": "tuhi-gui",
|
||||
"finish-args": [
|
||||
"--share=ipc",
|
||||
"--socket=x11",
|
||||
"--talk-name=org.freedesktop.tuhi1",
|
||||
"--own-name=org.freedesktop.tuhi1",
|
||||
"--system-talk-name=org.bluez"
|
||||
],
|
||||
"modules": [
|
||||
|
@ -51,6 +52,19 @@
|
|||
"pip3 install --no-index --find-links=\"file://${PWD}\" --prefix=${FLATPAK_DEST} ."
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "tuhi",
|
||||
"buildsystem": "simple",
|
||||
"sources": [
|
||||
{
|
||||
"type": "git",
|
||||
"url": "https://github.com/tuhiproject/tuhi"
|
||||
}
|
||||
],
|
||||
"build-commands": [
|
||||
"pip3 install --no-index --find-links=\"file://${PWD}\" --prefix=${FLATPAK_DEST} ."
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "tuhigui",
|
||||
"buildsystem": "meson",
|
||||
|
@ -59,6 +73,10 @@
|
|||
"type": "git",
|
||||
"url": "."
|
||||
}
|
||||
],
|
||||
"post-install": [
|
||||
"cp tuhi-gui-flatpak.py /app/bin/tuhi-gui",
|
||||
"chmod +x /app/bin/tuhi-gui"
|
||||
]
|
||||
}
|
||||
]
|
||||
|
|
|
@ -0,0 +1,29 @@
|
|||
#!/usr/bin/env python3
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
|
||||
import subprocess
|
||||
from multiprocessing import Process
|
||||
|
||||
def start_tuhi():
|
||||
subprocess.run('tuhi')
|
||||
|
||||
def start_tuhigui():
|
||||
subprocess.run('tuhigui')
|
||||
|
||||
if __name__ == '__main__':
|
||||
tuhi = Process(target=start_tuhi)
|
||||
tuhi.daemon = True
|
||||
tuhi.start()
|
||||
tuhigui = Process(target=start_tuhigui)
|
||||
tuhigui.start()
|
||||
tuhigui.join()
|
Loading…
Reference in New Issue