nerd-dictation
This commit is contained in:
@@ -110,6 +110,7 @@ in
|
|||||||
"hyprpanel"
|
"hyprpanel"
|
||||||
"nm-applet"
|
"nm-applet"
|
||||||
"hyprsunset"
|
"hyprsunset"
|
||||||
|
"nerd-dictation begin --simulate-input-tool WTYPE --suspend-on-start && touch ~/.cache/nerd-dictation-suspended"
|
||||||
];
|
];
|
||||||
workspace = [
|
workspace = [
|
||||||
# no gaps when only window
|
# no gaps when only window
|
||||||
@@ -169,6 +170,9 @@ in
|
|||||||
# rofi
|
# rofi
|
||||||
"$mod, space, exec, launcher_t2"
|
"$mod, space, exec, launcher_t2"
|
||||||
|
|
||||||
|
# nerd-dictation
|
||||||
|
"$mod, d, exec, nerd-dictation-toggle"
|
||||||
|
|
||||||
# printscreen
|
# printscreen
|
||||||
", Print, exec, hyprshot -m region --output-folder ~/downloads/screenshots"
|
", Print, exec, hyprshot -m region --output-folder ~/downloads/screenshots"
|
||||||
"SHIFT, Print, exec, hyprshot -m window --output-folder ~/screenshots"
|
"SHIFT, Print, exec, hyprshot -m window --output-folder ~/screenshots"
|
||||||
|
|||||||
@@ -78,10 +78,49 @@ let
|
|||||||
|
|
||||||
exec ${nerd-dictation-env}/bin/nerd-dictation-fhs -c "source $VENV/bin/activate && python3 ${nerd-dictation-src}/nerd-dictation $*"
|
exec ${nerd-dictation-env}/bin/nerd-dictation-fhs -c "source $VENV/bin/activate && python3 ${nerd-dictation-src}/nerd-dictation $*"
|
||||||
'';
|
'';
|
||||||
|
|
||||||
|
# Toggle script for hyprland keybind
|
||||||
|
nerd-dictation-toggle = pkgs.writeShellScriptBin "nerd-dictation-toggle" ''
|
||||||
|
hyprctl() {
|
||||||
|
env -u LD_LIBRARY_PATH ${pkgs.hyprland}/bin/hyprctl "$@"
|
||||||
|
}
|
||||||
|
|
||||||
|
set_border() {
|
||||||
|
local size=$1
|
||||||
|
local color=$2
|
||||||
|
# Unset existing rules for single-window workspaces
|
||||||
|
hyprctl keyword windowrulev2 "unset, floating:0, onworkspace:w[t1]"
|
||||||
|
hyprctl keyword windowrulev2 "unset, floating:0, onworkspace:w[tg1]"
|
||||||
|
hyprctl keyword windowrulev2 "unset, floating:0, onworkspace:f[1]"
|
||||||
|
hyprctl keyword windowrulev2 "unset, fullscreen:1"
|
||||||
|
# Re-add with specified border size
|
||||||
|
hyprctl keyword windowrulev2 "bordersize $size, floating:0, onworkspace:w[t1]"
|
||||||
|
hyprctl keyword windowrulev2 "rounding 0, floating:0, onworkspace:w[t1]"
|
||||||
|
hyprctl keyword windowrulev2 "bordersize $size, floating:0, onworkspace:w[tg1]"
|
||||||
|
hyprctl keyword windowrulev2 "rounding 0, floating:0, onworkspace:w[tg1]"
|
||||||
|
hyprctl keyword windowrulev2 "bordersize $size, floating:0, onworkspace:f[1]"
|
||||||
|
hyprctl keyword windowrulev2 "rounding 0, floating:0, onworkspace:f[1]"
|
||||||
|
hyprctl keyword windowrulev2 "bordersize $size, fullscreen:1"
|
||||||
|
# Set border color
|
||||||
|
hyprctl keyword general:col.active_border "$color"
|
||||||
|
}
|
||||||
|
|
||||||
|
# Check if currently suspended (file exists when suspended)
|
||||||
|
if [ -f "$HOME/.cache/nerd-dictation-suspended" ]; then
|
||||||
|
nerd-dictation resume
|
||||||
|
rm -f "$HOME/.cache/nerd-dictation-suspended"
|
||||||
|
set_border 5 "rgb(ff0000)"
|
||||||
|
else
|
||||||
|
nerd-dictation suspend
|
||||||
|
touch "$HOME/.cache/nerd-dictation-suspended"
|
||||||
|
set_border 0 "0x99999999"
|
||||||
|
fi
|
||||||
|
'';
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
home.packages = [
|
home.packages = [
|
||||||
nerd-dictation
|
nerd-dictation
|
||||||
|
nerd-dictation-toggle
|
||||||
pkgs.ydotool
|
pkgs.ydotool
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user