Fix clipboard in flatpak
This commit is contained in:
parent
4081d7fac4
commit
e675703c35
4 changed files with 18 additions and 11 deletions
|
|
@ -22,6 +22,9 @@ modules:
|
||||||
- "--share=network"
|
- "--share=network"
|
||||||
build-commands:
|
build-commands:
|
||||||
- pip3 install --prefix=/app tendo
|
- pip3 install --prefix=/app tendo
|
||||||
|
- git clone https://github.com/bugaevc/wl-clipboard.git
|
||||||
|
- cd wl-clipboard && meson setup build && cd build && ninja
|
||||||
|
- install -D wl-clipboard/build/src/wl-copy /app/bin/wl-copy
|
||||||
- install -D main.py /app/bin/main.py
|
- install -D main.py /app/bin/main.py
|
||||||
- install -D com.quexten.Goldwarden.desktop /app/share/applications/com.quexten.Goldwarden.desktop
|
- install -D com.quexten.Goldwarden.desktop /app/share/applications/com.quexten.Goldwarden.desktop
|
||||||
- install -D goldwarden.svg /app/share/icons/hicolor/scalable/apps/com.quexten.Goldwarden.svg
|
- install -D goldwarden.svg /app/share/icons/hicolor/scalable/apps/com.quexten.Goldwarden.svg
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,9 @@
|
||||||
import subprocess
|
import subprocess
|
||||||
|
import os
|
||||||
|
|
||||||
def write(text):
|
def write(text):
|
||||||
process = subprocess.Popen(["/bin/sh", "-c", "wl-copy"], stdin=subprocess.PIPE)
|
# set path
|
||||||
|
env = os.environ.copy()
|
||||||
|
env["PATH"] = env["PATH"] + ":/app/bin"
|
||||||
|
process = subprocess.Popen(["/bin/sh", "-c", "wl-copy"], stdin=subprocess.PIPE, env=env)
|
||||||
process.communicate(text.encode('utf-8'))
|
process.communicate(text.encode('utf-8'))
|
||||||
12
ui/main.py
12
ui/main.py
|
|
@ -18,6 +18,7 @@ if not is_hidden:
|
||||||
try:
|
try:
|
||||||
subprocess.Popen(["python3", "/app/bin/settings.py"], start_new_session=True)
|
subprocess.Popen(["python3", "/app/bin/settings.py"], start_new_session=True)
|
||||||
except:
|
except:
|
||||||
|
subprocess.Popen(["python3", "./settings.py"], start_new_session=True)
|
||||||
pass
|
pass
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
|
@ -32,16 +33,11 @@ def run_daemon():
|
||||||
if not goldwarden.is_daemon_running():
|
if not goldwarden.is_daemon_running():
|
||||||
goldwarden.run_daemon()
|
goldwarden.run_daemon()
|
||||||
|
|
||||||
if not goldwarden.is_daemon_running():
|
|
||||||
print("daemon not running.. autostarting")
|
|
||||||
daemonThread = Thread(target=run_daemon)
|
|
||||||
daemonThread.start()
|
|
||||||
|
|
||||||
print("starting autofill monitor")
|
|
||||||
|
|
||||||
def on_autofill():
|
def on_autofill():
|
||||||
subprocess.Popen(["python3", "/app/bin/autofill.py"], start_new_session=True)
|
subprocess.Popen(["python3", "/app/bin/autofill.py"], start_new_session=True)
|
||||||
monitors.dbus_autofill_monitor.on_autofill = on_autofill
|
|
||||||
|
monitors.dbus_autofill_monitor.on_autofill = lambda: on_autofill()
|
||||||
|
monitors.dbus_autofill_monitor.run_daemon()
|
||||||
|
|
||||||
while True:
|
while True:
|
||||||
time.sleep(60)
|
time.sleep(60)
|
||||||
|
|
@ -6,6 +6,7 @@ import dbus
|
||||||
import dbus.service
|
import dbus.service
|
||||||
from dbus.mainloop.glib import DBusGMainLoop
|
from dbus.mainloop.glib import DBusGMainLoop
|
||||||
from threading import Thread
|
from threading import Thread
|
||||||
|
import gi.repository.GLib
|
||||||
|
|
||||||
on_autofill = lambda: None
|
on_autofill = lambda: None
|
||||||
|
|
||||||
|
|
@ -19,5 +20,8 @@ class GoldwardenDBUSService(dbus.service.Object):
|
||||||
on_autofill()
|
on_autofill()
|
||||||
return ""
|
return ""
|
||||||
|
|
||||||
DBusGMainLoop(set_as_default=True)
|
def run_daemon():
|
||||||
service = GoldwardenDBUSService()
|
mainloop = DBusGMainLoop(set_as_default=True)
|
||||||
|
service = GoldwardenDBUSService()
|
||||||
|
mloop = gi.repository.GLib.MainLoop()
|
||||||
|
mloop.run()
|
||||||
Loading…
Reference in a new issue