From 8bdae74ebe172239573bab9fca634cf350cbd29d Mon Sep 17 00:00:00 2001 From: Ophestra Umiker Date: Mon, 16 Sep 2024 20:31:15 +0900 Subject: final: refactor for removal of system package and reduction of interactions to state package State query command has been moved to main where it belongs, "system" information are now fetched in app.New and stored in *App with accessors for relevant values. Exit (cleanup-related) functions are separated into its dedicated "final" package. Signed-off-by: Ophestra Umiker --- internal/app/x.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'internal/app/x.go') diff --git a/internal/app/x.go b/internal/app/x.go index 20c0de1c..07034026 100644 --- a/internal/app/x.go +++ b/internal/app/x.go @@ -2,6 +2,7 @@ package app import ( "fmt" + "git.ophivana.moe/cat/fortify/internal/final" "os" "git.ophivana.moe/cat/fortify/internal/state" @@ -16,16 +17,16 @@ func (a *App) ShareX() { // discovery X11 and grant user permission via the `ChangeHosts` command if d, ok := os.LookupEnv(display); !ok { - state.Fatal("X11: DISPLAY not set") + final.Fatal("X11: DISPLAY not set") } else { // add environment variable for new process a.AppendEnv(display, d) verbose.Printf("X11: Adding XHost entry SI:localuser:%s to display '%s'\n", a.Username, d) if err := xcb.ChangeHosts(xcb.HostModeInsert, xcb.FamilyServerInterpreted, "localuser\x00"+a.Username); err != nil { - state.Fatal(fmt.Sprintf("Error adding XHost entry to '%s':", d), err) + final.Fatal(fmt.Sprintf("Error adding XHost entry to '%s':", d), err) } else { - state.XcbActionComplete() + final.XcbActionComplete() } } } -- cgit v1.3.1