diff --git a/bigbashview/usr/bin/bigbashview-orca b/bigbashview/usr/bin/bigbashview-orca new file mode 100755 index 0000000..356af5c --- /dev/null +++ b/bigbashview/usr/bin/bigbashview-orca @@ -0,0 +1,32 @@ +#!/usr/bin/env sh + +# if $1 is --enable start orca, if --disable stop orca + +if [ "$1" = "--enable" ]; then + + # Autostart in GNOME + GSETTINGS_BACKEND=dconf gsettings set org.gnome.desktop.a11y.applications screen-reader-enabled true 2> /dev/null + + # Autostart in XFCE + xfconf-query -c xfce4-session -n -t bool -p /general/StartAssistiveTechnologies -s true 2> /dev/null + + # Autostart in KDE + kwriteconfig6 --file ~/.config/kaccessrc --group ScreenReader --key Enabled true 2> /dev/null + + # Start orca + exec orca + +elif [ "$1" = "--disable" ]; + # Autostart in GNOME + GSETTINGS_BACKEND=dconf gsettings set org.gnome.desktop.a11y.applications screen-reader-enabled false 2> /dev/null + + # Autostart in XFCE + xfconf-query -c xfce4-session -n -t bool -p /general/StartAssistiveTechnologies -s false 2> /dev/null + + # Autostart in KDE + kwriteconfig6 --file ~/.config/kaccessrc --group ScreenReader --key Enabled false 2> /dev/null + + killall orca +else + echo $"Possible options: --enable or --disable" +fi \ No newline at end of file diff --git a/bigbashview/usr/lib/bbv/ui/qt.py b/bigbashview/usr/lib/bbv/ui/qt.py index b4ba046..33f9a57 100644 --- a/bigbashview/usr/lib/bbv/ui/qt.py +++ b/bigbashview/usr/lib/bbv/ui/qt.py @@ -170,10 +170,10 @@ def run_orca(self): process_check = os.system("pgrep orca > /dev/null 2>&1") if process_check == 0: # If pgrep returns 0, the Orca process is running - os.system("killall orca") + os.system("bigbashview-orca --disable &") print("Orca process terminated.") else: - os.system("orca &") # Start the Orca process in the background + os.system("bigbashview-orca --enable &") # Start the Orca process in the background print("Orca process started.") except Exception as e: # Handle any exceptions that occur while managing the Orca process