saturn: Show current instance on re-exec
Allows "less dbus-enthusiastic" setups to *just* re-run the saturn executable to show it.
This commit is contained in:
parent
6a5f2ecb18
commit
38f62baa82
@ -36,9 +36,17 @@
|
|||||||
(= ret DBUS_REQUEST_NAME_REPLY_IN_QUEUE)
|
(= ret DBUS_REQUEST_NAME_REPLY_IN_QUEUE)
|
||||||
(error "unexpected DBUS_REQUEST_NAME_REPLY_IN_QUEUE")
|
(error "unexpected DBUS_REQUEST_NAME_REPLY_IN_QUEUE")
|
||||||
(= ret DBUS_REQUEST_NAME_REPLY_EXISTS)
|
(= ret DBUS_REQUEST_NAME_REPLY_EXISTS)
|
||||||
(do
|
;; Show the currently running instance
|
||||||
(print "already running")
|
(let [saturn (dbus.Proxy:new
|
||||||
(os.exit 0))))
|
{
|
||||||
|
:bus dbus.Bus.SESSION
|
||||||
|
:name "net.telent.saturn"
|
||||||
|
:interface "net.telent.saturn"
|
||||||
|
:path "/net/telent/saturn"
|
||||||
|
})]
|
||||||
|
(saturn:SetVisible true)
|
||||||
|
(os.exit 0)
|
||||||
|
)))
|
||||||
|
|
||||||
|
|
||||||
(local lfs (require :lfs))
|
(local lfs (require :lfs))
|
||||||
|
Loading…
Reference in New Issue
Block a user