@@ -144,6 +144,10 @@ def __init__(self):
144144 self .key_f12 = QShortcut (QKeySequence (Qt .Key_F12 ), self .web )
145145 self .key_f12 .activated .connect (self .devpage )
146146 self .web .page ().profile ().downloadRequested .connect (self .onDownloadRequested )
147+
148+ # Meta+Alt+S Keyboard shortcut for run orca
149+ self .key_meta_alt_s = QShortcut (QKeySequence ("Meta+Alt+S" ), self )
150+ self .key_meta_alt_s .activated .connect (self .run_orca )
147151
148152 # Set up the layout and splitter for the main window
149153 self .hbox = QHBoxLayout (self )
@@ -160,6 +164,22 @@ def __init__(self):
160164 self .web .page ().setWebChannel (self .channel )
161165 self .channel .registerObject ("windowControl" , self .control )
162166
167+ def run_orca (self ):
168+ try :
169+ # Use pgrep to check if there are any running processes named 'orca'
170+ process_check = os .system ("pgrep orca > /dev/null 2>&1" )
171+
172+ if process_check == 0 : # If pgrep returns 0, the Orca process is running
173+ os .system ("killall orca" )
174+ print ("Orca process terminated." )
175+ else :
176+ os .system ("orca &" ) # Start the Orca process in the background
177+ print ("Orca process started." )
178+ except Exception as e :
179+ # Handle any exceptions that occur while managing the Orca process
180+ print (f"Error handling the Orca process: { e } " )
181+
182+
163183 def changeEvent (self , event ):
164184 super ().changeEvent (event )
165185 if event .type () == QEvent .WindowStateChange :
0 commit comments