From 57ceb8a8067bda7f8f02c26925c4d92cb459d421 Mon Sep 17 00:00:00 2001 From: Simon Rieger Date: Wed, 20 Sep 2023 11:34:52 +0200 Subject: [PATCH] add nerd-dictation and ydotoold --- dot_config/i3/executable_config.tmpl | 10 ++++++---- dot_config/mimeapps.list | 2 +- dot_config/nerd-dictation/executable_run-dictation.sh | 11 +++++++++++ dot_config/sway/executable_config.tmpl | 8 +++++++- 4 files changed, 25 insertions(+), 6 deletions(-) create mode 100644 dot_config/nerd-dictation/executable_run-dictation.sh diff --git a/dot_config/i3/executable_config.tmpl b/dot_config/i3/executable_config.tmpl index 373d0e4..fae9854 100644 --- a/dot_config/i3/executable_config.tmpl +++ b/dot_config/i3/executable_config.tmpl @@ -76,6 +76,9 @@ focus_on_window_activation urgent # start a terminal bindsym $mod+Return exec wezterm +# Start Offline Speech +bindsym $mod+F1 exec ~/.config/nerd-dictation/run-dictation.sh + # kill focused window bindsym $mod+Shift+q kill @@ -337,10 +340,6 @@ for_window [class="calcurse"] floating enable border none for_window [class="newsbeuter"] floating enable border none for_window [class="weechat"] floating enable border none -# Starter für Progs im Terminal -bindsym $mod+F1 exec wezterm start arch-install -bindsym $mod+F2 exec wezterm start htop - # assign special properties for_window [class="^Pavucontrol$"] floating enable for_window [title="MonoDevelop External Console"] floating enable @@ -534,6 +533,9 @@ exec --no-startup-id lxpolkit # notify service from smartphone #exec --no-startup-id /opt/an2linuxserver/an2linuxserver.py +# Using ydotool for nerd-dictation +exec --no-startup-id ydotoold + # starting Steam {{- if eq .chezmoi.hostname "SpectreOS-deck" }} exec --no-startup-id steam -steamdeck -gamepadui diff --git a/dot_config/mimeapps.list b/dot_config/mimeapps.list index 870693c..2fc1257 100644 --- a/dot_config/mimeapps.list +++ b/dot_config/mimeapps.list @@ -37,7 +37,7 @@ application/x-extension-shtml=firefox.desktop application/xhtml+xml=firefox.desktop application/x-extension-xhtml=firefox.desktop application/x-extension-xht=firefox.desktop -x-scheme-handler/mailto=userapp-Thunderbird-5B6Z91.desktop +x-scheme-handler/mailto=chromium.desktop message/rfc822=userapp-Thunderbird-5B6Z91.desktop x-scheme-handler/mid=userapp-Thunderbird-5B6Z91.desktop x-scheme-handler/news=userapp-Thunderbird-OQN591.desktop diff --git a/dot_config/nerd-dictation/executable_run-dictation.sh b/dot_config/nerd-dictation/executable_run-dictation.sh new file mode 100644 index 0000000..0bea406 --- /dev/null +++ b/dot_config/nerd-dictation/executable_run-dictation.sh @@ -0,0 +1,11 @@ +#!/bin/bash + +set -e + +if ! pgrep -f /usr/bin/nerd-dictation >/dev/null; then + notify-send "Hinweis" "Speech to Text wurde gestartet" -t 3000 -i /usr/share/icons/Arc/actions/symbolic/call-start-symbolic.svg + nerd-dictation begin --simulate-input-tool=YDOTOOL +else + nerd-dictation end + notify-send "Hinweis" "Speech to Text wurde beendet" -t 3000 -i /usr/share/icons/Arc/actions/symbolic/call-stop-symbolic.svg +fi diff --git a/dot_config/sway/executable_config.tmpl b/dot_config/sway/executable_config.tmpl index e56d579..2b01371 100644 --- a/dot_config/sway/executable_config.tmpl +++ b/dot_config/sway/executable_config.tmpl @@ -22,7 +22,7 @@ set $inactive-text-color #676E7D set $urgent-bg-color #E53935 # window colors -# border background text indicat> +# border background text indicat client.focused $bg-color $bg-color $text-color #00ff00 client.unfocused $inactive-bg-color $inactive-bg-color $inactive-text-color #00ff00 client.focused_inactive $inactive-bg-color $inactive-bg-color $inactive-text-color #00ff00 @@ -34,6 +34,9 @@ floating_modifier $mod # start a terminal bindsym $mod+Return exec wezterm +# Start Offline Speech +bindsym $mod+F1 exec ~/.config/nerd-dictation/run-dictation.sh + # kill focused window bindsym $mod+Shift+q kill @@ -408,6 +411,9 @@ exec /usr/bin/lxqt-policykit-agent # Clipboard Manager exec wl-paste -t text --watch clipman store +# Using ydotool for nerd-dictation +exec ydotoold + exec swayidle -w \ timeout 300 'swaylock -f' \ timeout 600 'swaymsg "output * dpms off"' resume 'swaymsg "output * dpms on"' \