dom0/core: Added call to lock.remove_pidfile() on successful exit
* Adding remove_pidfile on exit * prevents the incorrect 'crash' message on startup * Added proper call to main
This commit is contained in:
parent
d6432a16c4
commit
28b4f82b0a
@ -29,7 +29,6 @@ from qubes.qubes import QubesDaemonPidfile
|
|||||||
qubes_clipboard_info_file = "/var/run/qubes/qubes_clipboard.bin.source"
|
qubes_clipboard_info_file = "/var/run/qubes/qubes_clipboard.bin.source"
|
||||||
|
|
||||||
def watch_qubes_clipboard():
|
def watch_qubes_clipboard():
|
||||||
|
|
||||||
def tray_notify(str, timeout = 3000):
|
def tray_notify(str, timeout = 3000):
|
||||||
notify_object.Notify("Qubes", 0, "dialog-information", "", str, [], [], timeout, dbus_interface="org.freedesktop.Notifications")
|
notify_object.Notify("Qubes", 0, "dialog-information", "", str, [], [], timeout, dbus_interface="org.freedesktop.Notifications")
|
||||||
|
|
||||||
@ -41,7 +40,6 @@ def watch_qubes_clipboard():
|
|||||||
file = open (qubes_clipboard_info_file, 'w')
|
file = open (qubes_clipboard_info_file, 'w')
|
||||||
file.close()
|
file.close()
|
||||||
|
|
||||||
|
|
||||||
class ClipboardWatcher(ProcessEvent):
|
class ClipboardWatcher(ProcessEvent):
|
||||||
def process_IN_CLOSE_WRITE (self, event):
|
def process_IN_CLOSE_WRITE (self, event):
|
||||||
src_info_file = open (qubes_clipboard_info_file, 'r')
|
src_info_file = open (qubes_clipboard_info_file, 'r')
|
||||||
@ -55,7 +53,6 @@ def watch_qubes_clipboard():
|
|||||||
"<small>Press Ctrl-Shift-v to copy this clipboard onto dest VM's clipboard.</small>".format(src_vmname))
|
"<small>Press Ctrl-Shift-v to copy this clipboard onto dest VM's clipboard.</small>".format(src_vmname))
|
||||||
src_info_file.close()
|
src_info_file.close()
|
||||||
|
|
||||||
|
|
||||||
notifier = Notifier(wm, ClipboardWatcher())
|
notifier = Notifier(wm, ClipboardWatcher())
|
||||||
wdd = wm.add_watch(qubes_clipboard_info_file, mask)
|
wdd = wm.add_watch(qubes_clipboard_info_file, mask)
|
||||||
|
|
||||||
@ -64,9 +61,7 @@ def watch_qubes_clipboard():
|
|||||||
if notifier.check_events():
|
if notifier.check_events():
|
||||||
notifier.read_events()
|
notifier.read_events()
|
||||||
|
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
|
|
||||||
lock = QubesDaemonPidfile ("qclipd")
|
lock = QubesDaemonPidfile ("qclipd")
|
||||||
if lock.pidfile_exists():
|
if lock.pidfile_exists():
|
||||||
if lock.pidfile_is_stale():
|
if lock.pidfile_is_stale():
|
||||||
@ -82,4 +77,7 @@ def main():
|
|||||||
with context:
|
with context:
|
||||||
watch_qubes_clipboard()
|
watch_qubes_clipboard()
|
||||||
|
|
||||||
main()
|
lock.remove_pidfile()
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
main()
|
||||||
|
Loading…
Reference in New Issue
Block a user