Giter VIP home page Giter VIP logo

earlgreytv's Introduction

EarlGreyTV

This repository explains how I run my smart TV setup EarlGreyTV.

TV

Tip

I wrote a blog post about this too. And recorded a quick YouTube video.

Summary: I use a Linux-running laptop (which I spilled tea on) to render a browser in constant fullscreen. I then have a homepage with a smart TV-like look. The "apps" are simply links to websites.

Warning: This is mostly a collection of my notes. I haven't tested if these steps work perfectly on a fresh install. You should be able to debug things yourself if anything goes wrong.

I encourage you to customize this as much as possible. Please make it your perfect setup, not mine.

Configuring and Running Locally

The main "homepage" of EarlGreyTV is the earlgreytv.html file found in config_files/home/tv/earlgreytv/. This is where you tweak the homepage appearance and, importantly, configure the "apps".

In this repo, I have my own example with my apps. Maybe I'm paranoid, but I'm too scared of copyright to have logo files hosted here. I made this script so you can download them yourself:

# Download the logos in the logos.txt file
# E.g Netflix logo
./download_logos.sh

Now you should be able to open the HTML file in a browser. e.g.:

firefox config_files/home/tv/earlgreytv/earlgreytv.html

Adding Your Own Apps

The apps are defined in the JavaScript portion of the earlgreytv.html file. Specify your app name, URL, and logo (which should exist in the images/ folder).

const APPS = [
  { name: "App name", url: "https://example.org", image: "app.png" },
  /* ... */
]

Tip: You can add a shortcut icon in the top-right corner by specifying shortcut: true.

Hardware Setup Notes

TV

Get yourself something you can use as a screen for your setup. Ideally, it should be as dumb as possible - simply showing the output of the computer you plug into it.

I couldn't find a dumb TV, so I got a smart TV and used settings to dumb it down a bit.

I got a SAMSUNG 55" 4K UHD LED TV TU55CU7105KXXC (3840x2160), and connected it with HDMI.

I did this setting change:

  • > All Settings
  • > General & Privacy
  • > Start Screen Options
  • "Autorun Last App"

My HDMI connection is considered an "App".

Side note: Some TVs have hidden menus that can allow you to dumb them down even more, example. The regular settings seemed to work okay for me, though.

Computer

You need a computer to power your setup. An old used laptop is perfect.

I used a 5-year-old Lenovo laptop with a broken keyboard (because I spilled Earl Grey tea into it).

Back of TV with computer

Remote

Since this setup is a regular desktop setup disguised as a smart TV, you need something to be your mouse. You also need a keyboard too (although maybe you can trigger an on-screen keyboard).

I chose the WECHIP W3 2.4G 3-i-1 2.4G Air Mouse. It uses a small gyroscope as input for the mouse and has a small keyboard on the back. It's good but a bit flimsy.

Remote front and back

Optional Extras

HDMI USB CEC Adapter

I use CEC to allow my computer to suspend my TV. I need an adapter because the laptop doesn't support the CEC protocol itself.

I use the Pulse Eight USB-CEC Adapter.

CEC adapter

USB Extender

For your mouse, you'll likely get a very small USB receiver, example. Depending on where you place your laptop, you might need to extend the receiver.

I use a generic USB extender, example.

Software Setup Notes

Operating System

I went with Debian Linux. I named my user tv.

Desktop Environment

I chose Sway. I needed something I could easily configure with a config file and that would be highly minimal.

In retrospect, maybe regular i3 would have been better. The automation tools that exist for the X Window System are more documented.

Run:

sudo apt install sway -y

Then log out of GNOME and log into Sway.

Packages

These are the packages I could gather from my notes. There may be a couple I forgot, and some that are not needed.

sudo apt install rsync pulseaudio pulseaudio-utils playerctl pamixer xdotool ydotool input-util xbindkeys wtype udev cec-utils -y

SSH notes

The next steps depend on an SSH connection to your TV. I recommend adding your TV computer to your ~/.ssh/config. This is how I connect to my TV:

ssh tv

Tip: Sway Commands Over SSH:

Interacting with Sway over SSH might give you an error like this: swaymsg/main.c:419] Unable to retrieve socket path.

This is my fix:

export SWAYSOCK=$(find /run/user/1000/ -name "sway-ipc.1000*.sock" -print -quit)
# Now you should be able to e.g. reload Sway:
swaymsg reload

Firefox Manual Settings

Set Zoom

You likely need some extra zoom on the website you visit. How much depends on how big your screen is. 200% looks good on my TV.

Navigate to about:preferences.

Set "Default zoom" to 200%.

Zoom

Create Profile

The profile is used for a predictable path to place a config file.

Navigate to about:profiles.

Make sure to click "Choose Folder..." and set it to /home/tv/.mozilla/firefox/earlgreytv.

profile wizard

"Default Profile" should be set to "Yes"

Set Homepage

Navigate to about:preferences#home.

For the homepage, pick "Custom URLs...". Then set it to file:///home/tv/earlgreytv/earlgreytv.html.

home page settings

Enable Stylesheets

Navigate to about:config, and set toolkit.legacyUserProfileCustomizations.stylesheets to true.

stylesheets option

Enable Activity Cursor

This will indicate on the cursor if the page is loading.

Navigate to about:config, and set ui.use_activity_cursor to true.

activity cursor

Sync Configs

Run ./sync.sh in this directory, to sync files needed for the EarlgreyTV setup.

# Make sure you have rsync
sudo apt install rsync -y
# Sync files 
./sync.sh

Apply Configs

Run ./apply.sh to restart any services that use config files. It doesn't restart Firefox.

./apply.sh

Casting via iPhone Shortcut

EarlGreyTV implements a very simple casting mechanism. A server will receive a URL from an HTTP request, and paste it into the Firefox address bar. The script for the casting server can be found here: config_files/home/tv/casting_server.py.

To make calls to the casting server easily from my iPhone, I created a shortcut that shows up in the Sharing Sheet when sharing a link from any app.

If you want to recreate the shortcut yourself, you can refer to these screenshots:

Casting shortcut

Further Notes

  • I ran into some issues with ydotool. This solution helped.
  • Your TV screen might not be primary on the initial Debian login screen. This can correct that.

Thanks To

License

This project is licensed under the MIT License - see the LICENSE file for details

earlgreytv's People

Contributors

carltheperson avatar

Stargazers

Christopher Massey avatar  avatar Sobirov Diyorbek avatar Tom Zimmerlinkat avatar  avatar Jarrod Wells avatar  avatar Wes Tapp avatar Coriolan avatar  avatar Santhosh Veer avatar Thejesh GN avatar  avatar Maciej [MyChai] Jankowski avatar Eren Kaplan avatar James Tooze avatar Ysael Sáez  avatar Marek Hudik avatar Sunny avatar Jan Čejka avatar  avatar Austen Goodson avatar Kollan House avatar Ryu avatar Sandalots avatar Brian Lee avatar PÁSZTOR György avatar Eric McCormick avatar  avatar Justin Miller avatar Laszlo Boros avatar  avatar  avatar Jim Hobbs avatar Adam Morgan avatar Julian McClellan avatar  avatar  avatar Hugo Posca avatar Lukas Michel avatar  avatar vwik avatar  avatar JAcek avatar Adrian avatar Simon Menke avatar Leonardo Ferreira Fontenelle avatar Josh Smailes avatar Henfur avatar Markus Kohler avatar  avatar Michiel Tukker avatar stirling campbell avatar  avatar David Konsumer avatar  avatar Neuralyze avatar Edward Gryspeerdt avatar  avatar  avatar  avatar Glenn avatar James Edward Lewis II avatar Simon Justesen avatar  avatar Sebastian Schlatow avatar Jordan Williams avatar  avatar  avatar Sai Nikhilesh Murty Kottapalli avatar Aspen Mayer avatar  avatar  avatar ChangAkira avatar Visionario avatar  avatar Label avatar LicrimoVor avatar Kirill avatar Pluto avatar Ворон avatar  avatar  avatar  avatar st01cs avatar Alexander Livanov avatar Valentin avatar KAM avatar Elena T. avatar Aleksandr avatar Vladislav avatar haratak avatar Den avatar Pavel Kazak avatar krump4you avatar  avatar Roman Troitsky avatar  avatar Vladimir avatar Alexander Maslyakov avatar

Watchers

 avatar Дед avatar

earlgreytv's Issues

[Suggestion] Use Raspberry Pi

Even though it's Linux under the hood, I recommend basing this project on usage of RPi, this would make an amazing project for the raspberry pi community and the tinkerer community.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.