From 84c351f8fca3989bb1dd6bdc4bc22c7fc1617674 Mon Sep 17 00:00:00 2001 From: ElnuDev Date: Thu, 25 May 2023 11:38:34 -0700 Subject: [PATCH 1/3] Revert "i3: disable middle mouse paste" This reverts commit 015a277c4774fdb6ca421d12b778b2f5b5890d08. --- modules/i3/default.nix | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/modules/i3/default.nix b/modules/i3/default.nix index a6fc8c4..08c06e2 100644 --- a/modules/i3/default.nix +++ b/modules/i3/default.nix @@ -10,19 +10,8 @@ in with theme.colors; { wmctrl # For rofi power menu xborders # Active window borders maim xdotool unclutter # Active window screenshots - xbindkeys xsel xdotool # Disable middle mouse paste ]; - home.file = { - # Disable middle mouse paste - # May require running xbindkeys -p first time after rebuild - # https://unix.stackexchange.com/a/277488 - ".xbindkeysrc".text = '' - "echo -n | xsel -n -i; pkill xbindkeys; xdotool click 2; xbindkeys" - b:2 + Release - ''; - }; - # Screenshots services.flameshot = { enable = true; From 1acbedab95130386712dea2ab65b80344dfa62bc Mon Sep 17 00:00:00 2001 From: ElnuDev Date: Thu, 25 May 2023 11:48:16 -0700 Subject: [PATCH 2/3] i3: separate startup commands --- modules/i3/default.nix | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/modules/i3/default.nix b/modules/i3/default.nix index 08c06e2..f5ef213 100644 --- a/modules/i3/default.nix +++ b/modules/i3/default.nix @@ -63,7 +63,22 @@ in with theme.colors; { }; startup = [ { - command = "(systemctl --user restart polybar &) && (nm-applet &) && (nextcloud &) && (xborders --border-rgb ${builtins.substring 1 6 primary}ff --border-radius 12 --border-width 2 --smart-hide-border --disable-version-warning)"; + command = "systemctl --user restart polybar &"; + always = true; + notification = false; + } + { + command = "nm-applet &"; + always = true; + notification = false; + } + { + command = "nextcloud &"; + always = true; + notification = false; + } + { + command = "(xborders --border-rgb ${builtins.substring 1 6 primary}ff --border-radius 12 --border-width 2 --smart-hide-border --disable-version-warning) &"; always = true; notification = false; } From ba699a120905c225d813e31d9625039d5ec9477e Mon Sep 17 00:00:00 2001 From: ElnuDev Date: Thu, 25 May 2023 11:53:00 -0700 Subject: [PATCH 3/3] i3: disable middle mouse paste --- modules/i3/default.nix | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/modules/i3/default.nix b/modules/i3/default.nix index f5ef213..6557fd5 100644 --- a/modules/i3/default.nix +++ b/modules/i3/default.nix @@ -10,6 +10,7 @@ in with theme.colors; { wmctrl # For rofi power menu xborders # Active window borders maim xdotool unclutter # Active window screenshots + xsel # Disable middle mouse paste ]; # Screenshots @@ -82,6 +83,16 @@ in with theme.colors; { always = true; notification = false; } + { + # Disable middle mouse paste + # https://unix.stackexchange.com/a/501445 + # Other solutions such as the xbindkeys approach + # will break other functionality, such as panning + # https://unix.stackexchange.com/a/277488 + command = "(while true; do xsel -fin < /dev/null; done) &"; + always = true; + notification = false; + } ]; keybindings = lib.mkOptionDefault { "${mod}+Return" = "exec kitty";