feat(grfn/system): Command to edit the current text input in emacs

First pass at an xdotool-based command to edit the current text input in
emacs

Change-Id: I1e04612478292fe83083d197d481e034a9fce97f
Reviewed-on: https://cl.tvl.fyi/c/depot/+/9971
Reviewed-by: grfn <grfn@gws.fyi>
Autosubmit: grfn <grfn@gws.fyi>
Tested-by: BuildkiteCI
This commit is contained in:
Aspen Smith 2023-11-06 10:39:39 -05:00 committed by clbot
parent 7c32d85455
commit 81047cfcd7
2 changed files with 20 additions and 0 deletions

View file

@ -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;

View file

@ -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";