saturn: Show current instance on re-exec

Allows "less dbus-enthusiastic" setups to *just* re-run the saturn
executable to show it.
phoen
Samuel Dionne-Riel 2022-01-17 21:13:11 -05:00 committed by Daniel Barlow
parent 6a5f2ecb18
commit 38f62baa82
1 changed files with 11 additions and 3 deletions

View File

@ -36,9 +36,17 @@
(= ret DBUS_REQUEST_NAME_REPLY_IN_QUEUE)
(error "unexpected DBUS_REQUEST_NAME_REPLY_IN_QUEUE")
(= ret DBUS_REQUEST_NAME_REPLY_EXISTS)
(do
(print "already running")
(os.exit 0))))
;; Show the currently running instance
(let [saturn (dbus.Proxy:new
{
: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))