From f87766150b690581d7a54fbaeb5b5458bb5a7bd5 Mon Sep 17 00:00:00 2001 From: Fuwn Date: Fri, 20 Sep 2024 01:52:34 +0000 Subject: feat(rui): only notify in window manager --- flake.nix | 2 +- rui.go | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/flake.nix b/flake.nix index 107afa6..114ffc8 100644 --- a/flake.nix +++ b/flake.nix @@ -33,7 +33,7 @@ { packages.default = pkgs.buildGoModule { pname = "rui"; - version = "2024.09.18"; + version = "2024.09.19"; src = pkgs.lib.cleanSource ./.; vendorHash = "sha256-mN/QjzJ4eGfbW1H92cCKvC0wDhCR6IUes2HCZ5YBdPA="; diff --git a/rui.go b/rui.go index 5400e2c..00c7adb 100644 --- a/rui.go +++ b/rui.go @@ -241,6 +241,10 @@ func command(name string, args ...string) error { } func notify(message string) error { + if os.Getenv("DISPLAY") == "" && os.Getenv("WAYLAND_DISPLAY") == "" { + return nil + } + notifySend, err := exec.LookPath("notify-send") if err != nil { -- cgit v1.2.3