added a current shortcut in system tray menue
This commit is contained in:
2
run.bat
2
run.bat
@@ -5,3 +5,5 @@ call venv\Scripts\activate.bat
|
|||||||
echo Starting the application...
|
echo Starting the application...
|
||||||
|
|
||||||
start "OopsWrongLang" /B pythonw src\main.pyw
|
start "OopsWrongLang" /B pythonw src\main.pyw
|
||||||
|
|
||||||
|
pause
|
||||||
@@ -139,6 +139,7 @@ def setup_tray(config):
|
|||||||
|
|
||||||
image = Image.open("assets/icon.png")
|
image = Image.open("assets/icon.png")
|
||||||
menu = pystray.Menu(
|
menu = pystray.Menu(
|
||||||
|
pystray.MenuItem(f'Current Shortcut: {get_shortcut()}',lambda icon, item: None),
|
||||||
pystray.MenuItem(
|
pystray.MenuItem(
|
||||||
'Run on Startup',
|
'Run on Startup',
|
||||||
on_toggle_startup,
|
on_toggle_startup,
|
||||||
@@ -161,7 +162,7 @@ def main():
|
|||||||
|
|
||||||
# Register the keyboard shortcut
|
# Register the keyboard shortcut
|
||||||
shortcut = get_shortcut()
|
shortcut = get_shortcut()
|
||||||
keyboard.add_hotkey(shortcut, on_shortcut, suppress=True)
|
keyboard.add_hotkey(shortcut, on_shortcut)
|
||||||
print(f"Press {shortcut} to convert text to Persian.")
|
print(f"Press {shortcut} to convert text to Persian.")
|
||||||
|
|
||||||
# Keep the script running
|
# Keep the script running
|
||||||
|
|||||||
Reference in New Issue
Block a user