From 385c0c55f90aa3ad0c482390027edf6ac83e4cae Mon Sep 17 00:00:00 2001 From: Jakob Lechner Date: Fri, 3 Nov 2023 15:43:05 +0000 Subject: [PATCH] Attempt to remove sensitive stuff from notifications --- home-manager/modules/sway/waybar.nix | 32 ++++++++++++++++++++++++++++ modules/sway.nix | 5 +++-- 2 files changed, 35 insertions(+), 2 deletions(-) diff --git a/home-manager/modules/sway/waybar.nix b/home-manager/modules/sway/waybar.nix index 4ac79e0..dad792d 100644 --- a/home-manager/modules/sway/waybar.nix +++ b/home-manager/modules/sway/waybar.nix @@ -14,6 +14,37 @@ let fi ''; + makoInhibitorTest = pkgs.writeShellScript "mako-inhibitor-test" '' + export PATH=${pkgs.lib.makeBinPath (with pkgs; [pkgs.libnotify])} + notify-send "test" + notify-send "bla $1" + ''; + setMakoMode = pkgs.writeShellScript "set-mako-mode" '' + export PATH=${pkgs.lib.makeBinPath (with pkgs; [pkgs.mako])} + + if [[ "$2" = "toggle" ]]; then + if makoctl mode | grep -Fxq "$1"; then + action = "add" + else + action = "remove" + fi + else + action = "$2" + fi + + case "$action" in + add) + makoctl mode -a "$1" + ;; + remove) + makoctl mode -d "$1" + ;; + *) + exit 1 + ;; + esac + ''; + # for fine-grained control over spacing thinsp = " "; @@ -75,6 +106,7 @@ in activated = "󰈈 "; deactivated = "󰈉 "; }; + on-click = "${makoInhibitorTest} {}"; }; "custom/screencast" = { exec = pkgs.writeScript "screencast-monitor" /* python */ '' diff --git a/modules/sway.nix b/modules/sway.nix index c9c0e5c..2867007 100644 --- a/modules/sway.nix +++ b/modules/sway.nix @@ -5,9 +5,10 @@ lib.mkIf config.jalr.gui.enable { enable = true; # FIXME: move to home manager extraPackages = with pkgs; [ - grim - mako gammastep + grim + libnotify # notify-send + mako slurp wl-clipboard xwayland