Fix background portal task idling in the background
This commit is contained in:
parent
ccbfbfe3e3
commit
4081d7fac4
1 changed files with 6 additions and 1 deletions
|
|
@ -5,11 +5,13 @@ import gc
|
||||||
from gi.repository import Gtk, Adw, GLib, Gio
|
from gi.repository import Gtk, Adw, GLib, Gio
|
||||||
from random import randint
|
from random import randint
|
||||||
import time
|
import time
|
||||||
|
import os
|
||||||
|
from threading import Timer
|
||||||
|
|
||||||
def receive_autostart(self, *args):
|
def receive_autostart(self, *args):
|
||||||
print("autostart enabled..!?")
|
print("autostart enabled..!?")
|
||||||
print(args)
|
print(args)
|
||||||
|
os._exit(0)
|
||||||
|
|
||||||
def request_autostart():
|
def request_autostart():
|
||||||
bus = Gio.bus_get_sync(Gio.BusType.SESSION, None)
|
bus = Gio.bus_get_sync(Gio.BusType.SESSION, None)
|
||||||
|
|
@ -54,5 +56,8 @@ def request_autostart():
|
||||||
|
|
||||||
request_autostart()
|
request_autostart()
|
||||||
|
|
||||||
|
thread = Timer(10, os._exit, [0])
|
||||||
|
thread.start()
|
||||||
|
|
||||||
loop = GLib.MainLoop()
|
loop = GLib.MainLoop()
|
||||||
loop.run()
|
loop.run()
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue