make mouse script work and add window rules
This commit is contained in:
parent
afc2e8ea66
commit
973993af60
2 changed files with 47 additions and 0 deletions
|
@ -39,6 +39,25 @@ in
|
|||
always-center-single-column = true;
|
||||
border.enable = false;
|
||||
};
|
||||
|
||||
window-rules = [
|
||||
{
|
||||
matches = [{ app-id = "anki"; title = "Add"; }];
|
||||
open-floating = true;
|
||||
}
|
||||
{
|
||||
matches = [{ app-id = "foot"; }];
|
||||
default-column-width.proportion = .5;
|
||||
}
|
||||
{
|
||||
matches = [{ app-id = "Bitwarden"; }];
|
||||
open-floating = true;
|
||||
}
|
||||
{
|
||||
matches = [{ app-id = "mpv"; }];
|
||||
open-floating = true;
|
||||
}
|
||||
];
|
||||
};
|
||||
|
||||
programs.niri.settings.binds =
|
||||
|
@ -112,5 +131,8 @@ in
|
|||
"Mod+Alt+E".action = spawn "evolution";
|
||||
"Mod+P".action = spawn "bitwarden";
|
||||
"Mod+Comma".action = sh clipboard;
|
||||
|
||||
"MouseForward".action = spawn "sh" "${./scripts/remote.sh}" "btn1";
|
||||
"MouseBack".action = spawn "sh" "${./scripts/remote.sh}";
|
||||
};
|
||||
}
|
||||
|
|
25
home/niri/scripts/remote.sh
Executable file
25
home/niri/scripts/remote.sh
Executable file
|
@ -0,0 +1,25 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
active_window=$(niri msg --json focused-window |jq -r .app_id)
|
||||
|
||||
if [ "$1" = "btn1" ]; then
|
||||
if [ "$active_window" = "anki" ]; then
|
||||
wtype " "
|
||||
elif [ "$active_window" = "foot" ]; then
|
||||
wtype -M ctrl -M shift -k c -m ctrl -m shift
|
||||
elif [ "$active_window" = "chromium-browser" ] || [ "$active_window" = "librewolf" ]; then
|
||||
wtype -M alt -P right -p right -m alt
|
||||
else
|
||||
wtype -M ctrl -k c -m ctrl
|
||||
fi
|
||||
else
|
||||
if [ "$active_window" = "anki" ]; then
|
||||
wtype "1"
|
||||
elif [ "$active_window" = "foot" ]; then
|
||||
wtype -M ctrl -M shift -k v -m ctrl
|
||||
elif [ "$active_window" = "chromium-browser" ] || [ "$active_window" = "librewolf" ]; then
|
||||
wtype -M alt -P left -p left -m alt
|
||||
else
|
||||
wtype -M ctrl -k v -m ctrl
|
||||
fi
|
||||
fi
|
Loading…
Add table
Reference in a new issue