I'm looking for a way to send keystrokes to Firefox from a shell script, Wayland and X11 compatible
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?
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?
Re: I'm looking for a way to send keystrokes to Firefox from a shell script, Wayland and X11 compatible
Have a look at this reddit, where they mention wtype and wlrctl.
Re: I'm looking for a way to send keystrokes to Firefox from a shell script, Wayland and X11 compatible
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.deepo wrote: ↑Tue Feb 11, 2025 9:17 pmHave a look at this reddit, where they mention wtype and wlrctl.
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
Return to "General programming discussion"
Jump to
- Community
- General discussion
- Announcements
- Other languages
- Deutsch
- Español
- Français
- Italiano
- Nederlands
- 日本語
- Polski
- Português
- Русский
- Türkçe
- User groups and events
- Raspberry Pi Official Magazine
- Using the Raspberry Pi
- Beginners
- Troubleshooting
- Advanced users
- Assistive technology and accessibility
- Education
- Picademy
- Teaching and learning resources
- Staffroom, classroom and projects
- Astro Pi
- Mathematica
- High Altitude Balloon
- Weather station
- Programming
- C/C++
- Java
- Python
- Scratch
- Other programming languages
- Windows 10 for IoT
- Wolfram Language
- Bare metal, Assembly language
- Graphics programming
- OpenGLES
- OpenVG
- OpenMAX
- General programming discussion
- Projects
- Networking and servers
- Automation, sensing and robotics
- Graphics, sound and multimedia
- Other projects
- Media centres
- Gaming
- AIY Projects
- Hardware and peripherals
- Camera board
- Compute Module
- Official Display
- HATs and other add-ons
- Device Tree
- Interfacing (DSI, CSI, I2C, etc.)
- Keyboard computers (400, 500, 500+)
- Raspberry Pi Pico
- General
- SDK
- MicroPython
- Other RP2040 boards
- Zephyr
- Rust
- AI Accelerator
- AI Camera - IMX500
- Hailo
- Software
- Raspberry Pi OS
- Raspberry Pi Connect
- Raspberry Pi Desktop for PC and Mac
- Beta testing
- Other
- Android
- Debian
- FreeBSD
- Gentoo
- Linux Kernel
- NetBSD
- openSUSE
- Plan 9
- Puppy
- Arch
- Pidora / Fedora
- RISCOS
- Ubuntu
- Ye Olde Pi Shoppe
- For sale
- Wanted
- Off topic
- Off topic discussion