about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--users/grfn/system/home/modules/desktop.nix17
-rw-r--r--users/grfn/system/home/modules/i3.nix3
2 files changed, 20 insertions, 0 deletions
diff --git a/users/grfn/system/home/modules/desktop.nix b/users/grfn/system/home/modules/desktop.nix
index fed3cb47a48f..cab3b658e031 100644
--- a/users/grfn/system/home/modules/desktop.nix
+++ b/users/grfn/system/home/modules/desktop.nix
@@ -14,6 +14,23 @@
       # Slack support is broken as of 2023-06-15
       withSlack = false;
     })
+    (writeShellApplication {
+      name = "edit-input";
+
+      runtimeInputs = [ xdotool xclip ];
+      text = ''
+        set -euo pipefail
+
+        sleep 0.2
+        xdotool key ctrl+a ctrl+c
+        xclip -out -selection clipboard > /tmp/EDIT
+        emacsclient -c /tmp/EDIT
+        xclip -in -selection clipboard < /tmp/EDIT
+        sleep 0.2
+        xdotool key ctrl+v
+        rm /tmp/EDIT
+      '';
+    })
   ];
 
   services.syncthing.tray.enable = true;
diff --git a/users/grfn/system/home/modules/i3.nix b/users/grfn/system/home/modules/i3.nix
index 311ccd94b49a..1ce842af20e6 100644
--- a/users/grfn/system/home/modules/i3.nix
+++ b/users/grfn/system/home/modules/i3.nix
@@ -149,6 +149,9 @@ in
                   # Passwords
                   "${mod}+p" = "exec rofi-pass -font '${decorationFont}'";
 
+                  # Edit current buffer
+                  "${mod}+v" = "exec edit-input";
+
                   # Media
                   "XF86AudioPlay" = "exec playerctl -p spotify play-pause";
                   "XF86AudioNext" = "exec playerctl -p spotify next";