eufon

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README | LICENSE

commit 38f62baa82d7c86aa83466977bc7846fa6a609d2
parent 6a5f2ecb18d0bd2ac8e530de9f0cb71dc855c483
Author: Samuel Dionne-Riel <samuel@dionne-riel.com>
Date:   Mon, 17 Jan 2022 21:13:11 -0500

saturn: Show current instance on re-exec

Allows "less dbus-enthusiastic" setups to *just* re-run the saturn
executable to show it.

Diffstat:
Msaturn/main.fnl | 14+++++++++++---
1 file changed, 11 insertions(+), 3 deletions(-)

diff --git a/saturn/main.fnl b/saturn/main.fnl @@ -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))