Inspired by LGTV Companion for Windows, LG Buddy controls an LG WebOS TV from Linux so the TV follows the PC lifecycle more like a dedicated monitor.
The current runtime is implemented in Rust. Shell is still used for setup, installation, and removal.
LG Buddy currently uses bscpylgtv as its TV control backend.
- Turn the TV on at boot and wake.
- Turn the TV off at shutdown and before system sleep.
- Blank and restore the panel on desktop idle and activity.
- Support GNOME and
swayidle-based idle monitoring. - Adjust OLED pixel brightness with a
zenityslider. - Configure TV and backend settings with
configure.sh.
Required:
- a Rust toolchain with
cargo python3-venvpython3-pipzenity
Backend-specific:
gdbusfor the GNOME monitor backendswayidlefor theswayidlemonitor backend
Notes:
- Wake-on-LAN is sent natively by the Rust runtime. A separate
wakeonlanorwolpackage is no longer required. - The installer builds
lg-buddyfrom the local source tree. It does not download a prebuilt binary. - The TV control path still depends on the Python
bscpylgtvcommandCLI, which the installer places in/usr/bin/LG_Buddy_PIP.
Typical package installs:
Debian/Ubuntu/Pop!_OS
sudo apt install python3-venv python3-pip zenity libglib2.0-binFedora
sudo dnf install python3 python3-pip python3-virtualenv zenity glib2Arch
sudo pacman -S python python-pip python-virtualenv zenity glib2If you want the swayidle backend, install swayidle separately for your distro.
- Clone the repository.
- Make sure
cargois installed and available inPATH. - Run the installer:
chmod +x ./install.sh
./install.shThe installer will:
- run
configure.sh - build
lg-buddywithcargo build --release -p lg-buddy - create
/usr/bin/LG_Buddy_PIPand installbscpylgtv - install
/usr/bin/lg-buddy - install systemd units for boot, wake, sleep, and the user-session monitor
- install the brightness desktop entry
- install a NetworkManager pre-down hook that runs
lg-buddy sleep
On first use, you may need to accept a pairing prompt on the TV:
https://github.com/chros73/bscpylgtv/blob/master/docs/guides/first_use.md
The installed runtime command is:
lg-buddy <command>Current commands:
startup [auto|boot|wake]shutdownsleep-presleepbrightnessscreen-offscreen-onmonitordetect-backend
Examples:
lg-buddy detect-backend
lg-buddy monitor
lg-buddy brightnessLG Buddy supports two session backends:
gnomeswayidle
screen_backend=auto prefers GNOME when GNOME Shell is available, then falls back to swayidle if installed.
The GNOME backend uses:
org.gnome.ScreenSaverorg.gnome.Mutter.IdleMonitorgdbus wait,gdbus call, andgdbus monitor
LG Buddy follows GNOME’s own idle timing and uses Mutter idle-monitor activity to restore the screen early when possible.
The swayidle backend delegates idle timing to swayidle and currently wires:
timeout-> idle blank/power-off policyresume-> restore policy
When screen_backend=swayidle, configure.sh prompts for screen_idle_timeout.
Check the user-session monitor:
systemctl --user status LG_Buddy_screen.serviceTemporarily force a backend:
systemctl --user edit LG_Buddy_screen.serviceThen add:
[Service]
Environment=LG_BUDDY_SCREEN_BACKEND=gnomeSupported values are auto, gnome, and swayidle.
To change settings after installation:
./configure.shThe configurator writes config.env to:
LG_BUDDY_CONFIG, if set- otherwise
${XDG_CONFIG_HOME}/lg-buddy/config.env - otherwise
~/.config/lg-buddy/config.env
Current config keys:
tv_iptv_macinputscreen_backendscreen_idle_timeout
Installed services receive the resolved config path through LG_BUDDY_CONFIG.
To remove LG Buddy:
chmod +x ./uninstall.sh
./uninstall.shThis removes the installed services, desktop entry, Rust runtime binary, Python TV-control environment, and optionally the user config file.
| Path | Purpose |
|---|---|
crates/lg-buddy/src/lib.rs |
CLI parsing and command dispatch |
crates/lg-buddy/src/commands.rs |
Runtime lifecycle and policy commands |
crates/lg-buddy/src/session/runner.rs |
Session monitor loop |
crates/lg-buddy/src/gnome.rs |
GNOME backend integration |
crates/lg-buddy/src/swayidle.rs |
swayidle backend integration |
crates/lg-buddy/src/tv.rs |
TV transport boundary and facade |
crates/lg-buddy/src/wol.rs |
Native Wake-on-LAN support |
configure.sh |
Interactive configuration tool |
install.sh |
Installer |
uninstall.sh |
Uninstaller |
bin/LG_Buddy_Common |
Shared shell config helper used by setup scripts |
systemd/ |
Installed unit files and tmpfiles config |
docs/architecture-overview.md |
Current runtime architecture |
docs/session-backend-model.md |
Session backend semantics and capability model |
docs/testing-strategy.md |
Test strategy and scope |
- https://github.com/chros73 for
bscpylgtv - https://github.com/JPersson77 for the original inspiration