From 0fb81c76d7d28de1da2c5aa36d5d12d107d9cf69 Mon Sep 17 00:00:00 2001 From: Emery Hemingway Date: Thu, 18 May 2023 18:10:26 +0100 Subject: [PATCH] Start sway with the syndicate-server --- Tuprules.tup | 2 +- config/.gitignore | 1 + config/daemons/acme.pr | 4 +-- config/daemons/background.pr | 6 +--- config/daemons/psi.nix | 4 --- config/daemons/sway.config | 1 + config/daemons/sway.pr | 7 +++++ config/daemons/waybar.pr | 3 +- config/dataspaces/exec.pr | 15 ---------- config/exec.pr | 56 ++++++++++++++++++++++++++++++++++++ syndicate_utils | 2 +- 11 files changed, 71 insertions(+), 30 deletions(-) create mode 100644 config/.gitignore delete mode 100644 config/daemons/psi.nix create mode 100644 config/daemons/sway.config create mode 100644 config/daemons/sway.pr create mode 100644 config/exec.pr diff --git a/Tuprules.tup b/Tuprules.tup index c7ab121..91dbe9b 100644 --- a/Tuprules.tup +++ b/Tuprules.tup @@ -23,4 +23,4 @@ NIM_FLAGS = --noNimblePath !preserves_schemac = | $(BIN_DIR)/ |> ^o^ $(BIN_DIR)/schemac |> SYNDICATE_CONFIG_DIR = $(TUP_CWD)/config -!assert_built = |> ^ ^ echo "" > %o |> $(SYNDICATE_CONFIG_DIR)/built/%b.pr +!assert_built = |> ^ ^ echo "" > %o |> $(SYNDICATE_CONFIG_DIR)/built/%b.pr diff --git a/config/.gitignore b/config/.gitignore new file mode 100644 index 0000000..2c4802d --- /dev/null +++ b/config/.gitignore @@ -0,0 +1 @@ +sway-env.pr diff --git a/config/daemons/acme.pr b/config/daemons/acme.pr index 324a70d..eb3265f 100644 --- a/config/daemons/acme.pr +++ b/config/daemons/acme.pr @@ -1,11 +1,11 @@ -> +> ; ready>> ; ready>> ; ready>> ; > - diff --git a/config/daemons/background.pr b/config/daemons/background.pr index a376352..8c9569b 100644 --- a/config/daemons/background.pr +++ b/config/daemons/background.pr @@ -1,8 +1,4 @@ > - diff --git a/config/daemons/psi.nix b/config/daemons/psi.nix deleted file mode 100644 index a9197a4..0000000 --- a/config/daemons/psi.nix +++ /dev/null @@ -1,4 +0,0 @@ -; > - diff --git a/config/daemons/sway.config b/config/daemons/sway.config new file mode 100644 index 0000000..28d7c22 --- /dev/null +++ b/config/daemons/sway.config @@ -0,0 +1 @@ +exec "/home/emery/src/bin/preserve_process_environment sway-env-magic-cookie | preserves-tool convert > /home/emery/src/config/sway-env.pr" diff --git a/config/daemons/sway.pr b/config/daemons/sway.pr new file mode 100644 index 0000000..08c7eaa --- /dev/null +++ b/config/daemons/sway.pr @@ -0,0 +1,7 @@ +> + ready>> + +; TODO: configure Sway over JSON IPC? + diff --git a/config/daemons/waybar.pr b/config/daemons/waybar.pr index 5ba6363..fa578a2 100644 --- a/config/daemons/waybar.pr +++ b/config/daemons/waybar.pr @@ -1,5 +1,4 @@ > - diff --git a/config/dataspaces/exec.pr b/config/dataspaces/exec.pr index a0485e7..cf8b90d 100644 --- a/config/dataspaces/exec.pr +++ b/config/dataspaces/exec.pr @@ -1,17 +1,2 @@ let ?exec-space = dataspace - -; execute programs in response to handlers -$exec-space ?? $config [ - let ?id = timestamp - let ?facet = facet - let ?d = - > - - ? complete> [$facet ! stop] - ? failed> [$facet ! stop] -] diff --git a/config/exec.pr b/config/exec.pr new file mode 100644 index 0000000..6a937f7 --- /dev/null +++ b/config/exec.pr @@ -0,0 +1,56 @@ +? [ + + ; get the Sway environment and exec with it + ? { argv: ["sway-env-magic-cookie"] + env: { + "DBUS_SESSION_BUS_ADDRESS" : ?DBUS_SESSION_BUS_ADDRESS + "DISPLAY": ?DISPLAY + "SWAYSOCK" : ?SWAYSOCK + "WAYLAND_DISPLAY" : ?WAYLAND_DISPLAY + "XDG_SEAT" : ?XDG_SEAT + "XDG_SESSION_TYPE" : ?XDG_SESSION_TYPE + } } [ + + ; start GUI programs in the Sway environment + ? [ + > + + ] + + ; execute programs in response to handlers + $exec-space ?? $config [ + let ?id = timestamp + let ?facet = facet + let ?d = + > + + ? complete> [$facet ! stop] + ? failed> [$facet ! stop] + ] + + ] + +] diff --git a/syndicate_utils b/syndicate_utils index 2a1a3fe..51e5a2f 160000 --- a/syndicate_utils +++ b/syndicate_utils @@ -1 +1 @@ -Subproject commit 2a1a3fe200e06dd9eade4b806829d8e5200fd7cd +Subproject commit 51e5a2f7f2fb3271f72d603c37b429573bd83840