Start sway with the syndicate-server

This commit is contained in:
Ehmry - 2023-05-18 18:10:26 +01:00
parent 9952c5ef43
commit 0fb81c76d7
11 changed files with 71 additions and 30 deletions

View File

@ -23,4 +23,4 @@ NIM_FLAGS = --noNimblePath
!preserves_schemac = | $(BIN_DIR)/<schemac> |> ^o^ $(BIN_DIR)/schemac |>
SYNDICATE_CONFIG_DIR = $(TUP_CWD)/config
!assert_built = |> ^ <built "%b" …>^ echo "<built %b \"`realpath %f`\" \"`b2sum -l 32 %f | { read sum rest ; echo $sum; }`\">" > %o |> $(SYNDICATE_CONFIG_DIR)/built/%b.pr
!assert_built = |> ^ <built %b …>^ echo "<built %b \"`realpath %f`\" \"`b2sum -l 32 %f | { read sum rest ; echo $sum; }`\">" > %o |> $(SYNDICATE_CONFIG_DIR)/built/%b.pr

1
config/.gitignore vendored Normal file
View File

@ -0,0 +1 @@
sway-env.pr

View File

@ -1,11 +1,11 @@
<require-service <daemon acme>>
<require-service <gui acme>>
; <depends-on <daemon acme> <service-state <daemon fontsrv> ready>>
; <depends-on <daemon acme> <service-state <milestone wayland> ready>>
; <depends-on <daemon acme> <service-state <daemon plumber> ready>>
; <require-service <daemon plumber>>
<daemon acme {
<gui acme {
argv: ["/etc/profiles/per-user/emery/bin/9" "acme" "-f" "/mnt/font/FiraSans-Regular/12a/font" "-F" "/mnt/font/FiraCode-Light/10a/font"]
protocol: none}>

View File

@ -1,8 +1,4 @@
<require-service <daemon swaybg>>
<daemon swaybg {
<gui swaybg {
argv: ["swaybg" "-m" "tile" "-i" "/home/emery/tiles/background.png" ]
env: {
WAYLAND_DISPLAY: "wayland-1"
}
protocol: none
}>

View File

@ -1,4 +0,0 @@
; <require-service <daemon psi>>
<daemon psi {
argv: "/run/current-system/sw/bin/psi-plus"
protocol: none}>

View File

@ -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"

7
config/daemons/sway.pr Normal file
View File

@ -0,0 +1,7 @@
<require-service <milestone wayland>>
<depends-on <milestone wayland> <service-state <daemon sway> ready>>
; TODO: configure Sway over JSON IPC?
<daemon sway {
argv: ["/run/current-system/sw/bin/sway" "--config" "/home/emery/.config/sway/config"]
protocol: none}>

View File

@ -1,5 +1,4 @@
<require-service <daemon waybar>>
<daemon waybar {
<gui waybar {
argv: "/run/current-system/sw/bin/waybar"
protocol: none
}>

View File

@ -1,17 +1,2 @@
let ?exec-space = dataspace
<exec-space $exec-space>
; execute programs in response to handlers
$exec-space ?? <exec ?argv> $config [
let ?id = timestamp
let ?facet = facet
let ?d = <uri_runner-exec $id $argv>
<run-service <daemon $d>>
<daemon $d {
argv: $argv,
readyOnStart: #f,
restart: =never,
}>
? <service-state <daemon $d> complete> [$facet ! stop]
? <service-state <daemon $d> failed> [$facet ! stop]
]

56
config/exec.pr Normal file
View File

@ -0,0 +1,56 @@
? <exec-space ?exec-space> [
; 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
? <gui ?sym { argv: ?argv }> [
<run-service <daemon $sym>>
<daemon $sym {
argv: $argv,
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
}
readyOnStart: #f,
}>
]
; execute programs in response to handlers
$exec-space ?? <exec ?argv> $config [
let ?id = timestamp
let ?facet = facet
let ?d = <uri_runner-exec $id $argv>
<run-service <daemon $d>>
<daemon $d {
argv: $argv,
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
}
readyOnStart: #f,
restart: =never,
}>
? <service-state <daemon $d> complete> [$facet ! stop]
? <service-state <daemon $d> failed> [$facet ! stop]
]
]
]

@ -1 +1 @@
Subproject commit 2a1a3fe200e06dd9eade4b806829d8e5200fd7cd
Subproject commit 51e5a2f7f2fb3271f72d603c37b429573bd83840