Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

xdotool key Alt+Tab on Ubuntu, not switch app window #440

Open
yezhengli-Mr9 opened this issue Nov 5, 2023 · 0 comments
Open

xdotool key Alt+Tab on Ubuntu, not switch app window #440

yezhengli-Mr9 opened this issue Nov 5, 2023 · 0 comments

Comments

@yezhengli-Mr9
Copy link

yezhengli-Mr9 commented Nov 5, 2023

xdotool key Alt+Tab on Ubuntu, not switch app window? To use as alternative to pyautogui asweigart/pyautogui#93

xdotool key Alt+Tab

or

import subprocess
import time
# Give some time to switch to the desired window
time.sleep(2)
# Use xdotool to simulate Alt+Tab
subprocess.run(['xdotool', 'key', 'Alt+Tab'])

nor does the following work

import subprocess
import time
if __name__=='__main__':
    # pyautogui.keyDown('alt')
    # Use xdotool to simulate Alt+Tab
    subprocess.run(['xdotool', 'keydown', 'alt', 'key', 'Tab'])
    time.sleep(1)  # You might need to adjust the sleep duration
    subprocess.run(['xdotool', 'keyup', 'alt']) 
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant