feat: clone-term on sway

This commit is contained in:
Patrick 2024-06-17 17:26:32 +02:00
parent d23e72a4d1
commit 23c355b2d9
Signed by: patrick
GPG key ID: 451F95EFB8BECD0F
3 changed files with 8 additions and 3 deletions

View file

@ -3,13 +3,18 @@
ps,
procps,
xdotool,
jq,
}:
writeShellApplication {
name = "clone-term";
runtimeInputs = [ps procps xdotool];
runtimeInputs = [ps procps xdotool jq];
text = ''
if [[ $XDG_CURRENT_DESKTOP == sway ]]; then
PAREN=$(swaymsg -t get_tree | jq '.. | select(.type?) | select(.focused==true).pid')
else
PAREN=$(xdotool getwindowfocus getwindowpid)
fi
MAXDEPTH=0
SELECTED=0

View file

@ -24,7 +24,6 @@
maim = "${pkgs.maim}/bin/maim -qs -b 1 --hidecursor";
in {
"Menu" = "exec ${cfg.menu}";
"${cfg.modifier}+c" = "exec ${lib.getExe pkgs.scripts.clone-term}";
"Ctrl+F9" = "exec ${config.xsession.wallpapers.script}";
"${cfg.modifier}+F12" =
"exec "

View file

@ -94,6 +94,7 @@ let
"${modifier}+b" = "exec firefox";
"${modifier}+m" = "exec thunderbird";
"${modifier}+q" = "kill";
"${modifier}+c" = "exec ${lib.getExe pkgs.scripts.clone-term}";
"XF86AudioPlay" = "exec ${pkgs.playerctl}/bin/playerctl play-pause";
"XF86AudioPrev" = "exec ${pkgs.playerctl}/bin/playerctl next";
"XF86AudioNext" = "exec ${pkgs.playerctl}/bin/playerctl previous";