Simulate enter key


Login or Register to Reply

 
Thread Tools Search this Thread
# 1  
Old 3 Weeks Ago
Simulate enter key

I have a popup window that appears on every boot up.

I would like to have it dismissed automatically each time instead of having to hit the enter key.

I thought I could write a script that would execute on startup.

I tried this

xdotool key return

Code:
andy@7_~/Downloads$ xdotool key [return]
Error: Invalid key sequence '[return]'
Failure converting key sequence '[return]' to keycodes
Error: Invalid key sequence '[return]'
Failure converting key sequence '[return]' to keycodes

# 2  
Old 3 Weeks Ago
Isn't that error message self-explaining?
Try - from the man page - return or ctrl+m or ctrl+j; no square brackets.


And - wouldn't it be better to analyse the boot process and find out how NOT to pop up that window?
# 3  
Old 3 Weeks Ago
Code:
andy@7_~/Downloads$ xdotool key -return
key: unrecognized option '-return'

I already have. It is a known bug.

Last edited by drew77; 3 Weeks Ago at 06:24 PM..
# 4  
Old 2 Weeks Ago
The window id changes with each boot even though it is for the same popup window.

Code:
#!/bin/bash
# xdotool selectwindow This determines the window id or 2nd method
# xdotool search --name "Error"
xdotool key --window 16777491 alt+F4

I need help with passing the value of xdotool search --name "Error" to xdotool key --window 16777491 alt+F4 statement.

--- Post updated at 06:35 AM ---

This works if run from a cli window but not when run as a Startup Application.


Using UbuntuMate 18.04.



Code:
#!/bin/bash
#
#  Automatically close that popup windows that occurs with every boot up 
#
# xdotool selectwindow This determines the window id or 2nd method
# xdotool search --name "Error"
id=$(xdotool search --name "Error")

xdotool key --window $id alt+F4

# 5  
Old 2 Weeks Ago
I don't know the tool, but would
Code:
xdotool --name "Error" key alt+F4

work? If not, maybe
Code:
xdotool key --window $(xdotool search --name "Error") alt+F4

?
# 6  
Old 2 Weeks Ago
My script above does work, but only from a terminal which is not what I need.


I need it to run on each bootup.
# 7  
Old 2 Weeks Ago
Moderator's Comments:
Mod Comment Posting "Does not work" without explanation does not help you or anyone. If a command does not work for you, please show the exact circumstances you used it, and the exact error or malfunction you received. Do not paraphrase errors, or post the text as links, images, or attachments if you can avoid it: Paste the exact message, in code tags, like [code] text [/code] or by selecting the text and using the Image button.

Thank you.

The UNIX and Linux Forums


In what way does it not work on boot? What exactly did you do? What ran the code? Was everything in PATH? etc.
Login or Register to Reply

|
Thread Tools Search this Thread
Search this Thread:
Advanced Search

More UNIX and Linux Forum Topics You Might Find Helpful
Script termination without pressing Enter key[nohup] Suganbabu Shell Programming and Scripting 3 03-28-2017 08:03 PM
How to pass Enter key stroke , tried all options? suresh3566 Shell Programming and Scripting 5 07-28-2016 06:37 AM
Auto ENTER key on TERM shorty UNIX for Dummies Questions & Answers 7 09-10-2015 01:10 PM
Disable Enter key to be pressed R0H0N Shell Programming and Scripting 6 12-06-2010 03:55 PM
How to enter a return key in bash script? duker61 Shell Programming and Scripting 14 05-27-2010 09:44 AM
Simulating enter key via shell script proactiveaditya Shell Programming and Scripting 2 12-03-2009 05:18 AM
How to issue ctrl+D and enter key fozay Shell Programming and Scripting 7 07-10-2009 02:20 AM
enter key solaris sajjunaqvi Shell Programming and Scripting 1 06-03-2009 03:45 AM
Want read and an built in enter key stroke RahulJoshi Shell Programming and Scripting 2 01-02-2009 08:38 PM
How to find entering ENTER key?. tsaravanan Shell Programming and Scripting 0 08-28-2008 03:49 AM
Simulate ENTER key in ksh scripting khaos83_2000 Shell Programming and Scripting 6 08-06-2008 05:12 AM
trap signal for enter key Sreejith_VK Shell Programming and Scripting 4 04-21-2008 04:35 AM
using enter key in shell script bishweshwar UNIX for Advanced & Expert Users 1 06-06-2007 10:24 PM
Pressing backspace key simulates enter key vibhor_agarwali UNIX for Dummies Questions & Answers 2 04-19-2007 06:31 PM
read the ENTER key sars Shell Programming and Scripting 4 11-27-2006 07:34 AM