This code is published as part of the corresponding blog article on the Toptal Engineering Blog.
Visit https://www.toptal.com/blog and subscribe to our newsletter to read great articles!
This runs a web server on your Linux-based laptop that can send pre-configured keystrokes to your browser windows (or untargeted). By accessing it via your smartphone's web browser, you can conveniently control the volume and playback of your movie streaming and/or music listening:
On your Linux-based computer:
- Install xdotool and Node.js.
- Clone this repo (
git clone https://github.com/codingthat/old-fashioned-remote.git
) andcd
into the cloned directory. - Run
npm start
(and keep it running) - Open a music player, or have just one browser window open with
Netflix
,YouTube
, orPrime Video
in its title. - Find out your computer's local IP address (e.g. by running
hostname -I | awk '{print $1}'
).
On your phone:
- Connect to the same local network as your computer (via wifi).
- Open your phone's web browser.
- Go to
http://
(your local IP address):3000/
--- e.g.http://192.168.1.102:3000/
if your IP is192.168.1.102
. - Choose your remote control.
- Voilà! No need to get up to pause or turn up the quiet parts.