diff options
| author | Ophestra Umiker <cat@ophivana.moe> | 2024-09-17 13:48:42 +0900 |
|---|---|---|
| committer | Ophestra Umiker <cat@ophivana.moe> | 2024-09-17 13:48:42 +0900 |
| commit | 4b7d616862dc7d8c73561b85deb0ca1fabf30781 (patch) | |
| tree | d069af086d1fcfeca2f9a629e0f3eb3e2f19500f /internal/app/wayland.go | |
| parent | 6a6f62efa672bdb439c2f9056055193a53c1df01 (diff) | |
exit: move final and early code to internal package
Exit cleanup state information is now stored in a dedicated struct and built up using methods of that struct.
Signed-off-by: Ophestra Umiker <cat@ophivana.moe>
Diffstat (limited to 'internal/app/wayland.go')
| -rw-r--r-- | internal/app/wayland.go | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/internal/app/wayland.go b/internal/app/wayland.go index 3b12e3ec..33ed9914 100644 --- a/internal/app/wayland.go +++ b/internal/app/wayland.go @@ -6,8 +6,7 @@ import ( "path" "git.ophivana.moe/cat/fortify/acl" - "git.ophivana.moe/cat/fortify/internal/final" - "git.ophivana.moe/cat/fortify/internal/state" + "git.ophivana.moe/cat/fortify/internal" "git.ophivana.moe/cat/fortify/internal/verbose" ) @@ -17,19 +16,19 @@ const ( ) func (a *App) ShareWayland() { - a.setEnablement(state.EnableWayland) + a.setEnablement(internal.EnableWayland) // ensure Wayland socket ACL (e.g. `/run/user/%d/wayland-%d`) if w, ok := os.LookupEnv(waylandDisplay); !ok { - final.Fatal("Wayland: WAYLAND_DISPLAY not set") + internal.Fatal("Wayland: WAYLAND_DISPLAY not set") } else { // add environment variable for new process wp := path.Join(a.runtimePath, w) a.AppendEnv(waylandDisplay, wp) if err := acl.UpdatePerm(wp, a.UID(), acl.Read, acl.Write, acl.Execute); err != nil { - final.Fatal(fmt.Sprintf("Error preparing Wayland '%s':", w), err) + internal.Fatal(fmt.Sprintf("Error preparing Wayland '%s':", w), err) } else { - final.RegisterRevertPath(wp) + a.exit.RegisterRevertPath(wp) } verbose.Printf("Wayland socket '%s' configured\n", w) } |
