We use some essential cookies to make our website work.

We use optional cookies, as detailed in our cookie policy, to remember your settings and understand how you use our website.

4 posts • Page 1 of 1
kshetline
Posts: 106
Joined: Thu Jun 07, 2018 3:17 am

I'm looking for a way to send keystrokes to Firefox from a shell script, Wayland and X11 compatible

Tue Feb 11, 2025 3:08 pm

Chromium has a command line option to open up the browser in full-screen mode, but without all of the restrictions of kiosk mode.

I'd like to be able to do the same with Firefox, but it doesn't have a command line option to support this.

As an alternative I'd like to simply launch Firefox without the --kiosk option, and then send an F11 keystroke to cause the browser to go into full screen mode.

Further, to make sure audio can play without the user first interacting with the browser, any sort of interaction that simulates user input would help avoid the need to have the user change Firefox settings to allow audio autoplay. This is important because the application I'm working on is a clock that can provide alarms, and I wouldn't want the user to miss hearing an alarm simply because the browser is blocking audio playback.

I've searched for solutions, and what I've found so far is this:

xdotool -- which might be fine, but it's X11 only.
ydotool -- something meant to possible work like xdotool for Wayland, but doesn't have much capability yet, and has possibly been abandoned.
dotool -- maybe this has the features I need, but doesn't seem to be available as something that can be installed with apt-get, making it hard for me to create an installer for my own application that would also install dotool.

Does anyone know any other way to accomplish what I'm trying to do?

deepo
Posts: 1439
Joined: Sun Dec 30, 2018 8:36 pm

kshetline
Posts: 106
Joined: Thu Jun 07, 2018 3:17 am

Re: I'm looking for a way to send keystrokes to Firefox from a shell script, Wayland and X11 compatible

Wed Feb 12, 2025 6:42 pm

deepo wrote:
Tue Feb 11, 2025 9:17 pm
Have a look at this reddit, where they mention wtype and wlrctl.
I was hoping for something that could be installed with "apt-get" that'd do the trick, but nothing so easy to use seems available. So I grabbed the repo for wlrctl and tried to build it.

Ugh. One unfulfilled dependency after another. I haven't gotten to the bottom of all of the dependencies yet.

tpyo kingg
Posts: 1277
Joined: Mon Apr 09, 2018 5:26 pm

Re: I'm looking for a way to send keystrokes to Firefox from a shell script, Wayland and X11 compatible

Wed Feb 12, 2025 7:13 pm

There are xdotool (already mentioned above) or selenium which might be options, depending on what you aim to accomplish.

4 posts • Page 1 of 1

Return to "General programming discussion"

AltStyle によって変換されたページ (->オリジナル) /