LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 05-24-2019, 09:28 AM   #1
jamesd1
LQ Newbie
 
Registered: May 2019
Posts: 24

Rep: Reputation: Disabled
Autokey script: why doesn't the last command work?


The Autokey script below launches a screen capture program and that part works. But the last line is suppose to issue a alt-o that starts the capture yet the last line does not work and I must still do the alt-o by hand after the application starts.

What's wrong?


import subprocess
subprocess.Popen(["dpscreenocr"])
time.sleep(3)
keyboard.send_keys("<alt>+o")

I'm on:

Desktop: MATE 1.20.1 Distro: Linux Mint 19.1 Tessa
 
Old 05-25-2019, 03:21 AM   #2
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 19,872
Blog Entries: 12

Rep: Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053
I would use your DE's existing hotkey functionality, not autokey.
and what's the Alt-o for?
if it's really necessary, I'd use xdotool for that.
so, a little wrapper script:
Code:
#!/bin/sh
dpscreenocr &
sleep 3
xdotool key Alt+o

Last edited by ondoho; 05-25-2019 at 03:26 AM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Execute a terminal command using Autokey? jamesd1 Linux - Software 5 05-25-2019 03:42 AM
How do I toggle the microphone with a command or with Autokey jamesd1 Linux - Desktop 9 05-24-2019 09:08 AM
[SOLVED] [SOLVED] bash script: can echo command, command works if I type, but command doesn't work in script ... why? hopeless_n00b Linux - Newbie 10 07-12-2018 05:57 AM
Get first day of last month and last day of last month in bash xowl Linux - Software 18 02-09-2017 09:49 AM
'last' command doesn't show last shutdown Lyle Linux - Newbie 1 07-06-2010 11:57 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 11:37 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration