Skip to content

Commit

Permalink
Improve support for orca
Browse files Browse the repository at this point in the history
  • Loading branch information
bigbruno committed Jan 5, 2025
1 parent 942044d commit 147bafb
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 2 deletions.
32 changes: 32 additions & 0 deletions bigbashview/usr/bin/bigbashview-orca
Original file line number Diff line number Diff line change
@@ -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
4 changes: 2 additions & 2 deletions bigbashview/usr/lib/bbv/ui/qt.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 147bafb

Please sign in to comment.