Skip to content

Commit a6ed26e

Browse files
committed
init
0 parents  commit a6ed26e

File tree

16 files changed

+2015
-0
lines changed

16 files changed

+2015
-0
lines changed

.github/workflows/release.yml

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
name: Package and Release
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*'
7+
workflow_dispatch:
8+
inputs:
9+
version:
10+
description: 'Version tag (e.g., v1.0.0)'
11+
required: false
12+
13+
permissions:
14+
contents: write
15+
16+
jobs:
17+
build:
18+
runs-on: ubuntu-latest
19+
20+
steps:
21+
- name: Checkout
22+
uses: actions/checkout@v4
23+
24+
- name: Get version
25+
id: version
26+
run: |
27+
if [ -n "${{ github.event.inputs.version }}" ]; then
28+
echo "version=${{ github.event.inputs.version }}" >> $GITHUB_OUTPUT
29+
else
30+
echo "version=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT
31+
fi
32+
33+
- name: Update version in metadata
34+
run: |
35+
VERSION="${{ steps.version.outputs.version }}"
36+
VERSION="${VERSION#v}" # Remove 'v' prefix
37+
sed -i "s/\"Version\": \"[^\"]*\"/\"Version\": \"$VERSION\"/" plasmoid/package/metadata.json
38+
cat plasmoid/package/metadata.json
39+
40+
- name: Package plasmoid
41+
run: |
42+
cd plasmoid/package
43+
zip -r ../../lgtv-remote.plasmoid . -x "*.pyc" -x "__pycache__/*"
44+
45+
- name: Upload artifact
46+
uses: actions/upload-artifact@v4
47+
with:
48+
name: lgtv-remote-plasmoid
49+
path: lgtv-remote.plasmoid
50+
51+
- name: Create Release
52+
if: startsWith(github.ref, 'refs/tags/')
53+
uses: softprops/action-gh-release@v1
54+
with:
55+
files: lgtv-remote.plasmoid
56+
generate_release_notes: true
57+
body: |
58+
## Installation
59+
60+
### Prerequisites
61+
Install Python websockets:
62+
- **NixOS**: Add `(python3.withPackages (ps: [ps.websockets]))` to your systemPackages
63+
- **Other distros**: `pip install websockets`
64+
65+
### Install Widget
66+
**GUI**: System Settings → Appearance → Plasma Style → Get New... → Install from File → select `lgtv-remote.plasmoid`
67+
68+
**CLI**: `kpackagetool6 -t Plasma/Applet -i lgtv-remote.plasmoid`
69+
70+
### After Installing
71+
1. Right-click panel → Add Widgets → search "LG TV Remote"
72+
2. Enter your TV's IP address and a name
73+
3. Click Auth and accept on your TV
74+
75+
env:
76+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.gitignore

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# Build artifacts
2+
build/
3+
*.so
4+
*.o
5+
*.moc
6+
*_autogen/
7+
*.plasmoid
8+
9+
# IDE
10+
.idea/
11+
.vscode/
12+
*.swp
13+
*.swo
14+
*~
15+
16+
# Python
17+
__pycache__/
18+
*.pyc
19+
*.pyo
20+
.venv/
21+
venv/
22+
23+
# Nix
24+
result
25+
result-*
26+
27+
# OS
28+
.DS_Store
29+
Thumbs.db

QUICKSTART.md

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# Quick Start Guide
2+
3+
## NixOS Users
4+
5+
```bash
6+
# 1. Enter development shell
7+
nix develop
8+
9+
# 2. Install widget
10+
cd plasmoid && ./install.sh
11+
12+
# 3. Add to panel, configure IP, click Auth
13+
```
14+
15+
For persistent use, add to your `configuration.nix`:
16+
```nix
17+
environment.systemPackages = [
18+
(python3.withPackages (ps: [ ps.websockets ]))
19+
];
20+
```
21+
22+
## Other Distros
23+
24+
```bash
25+
# 1. Install dependency
26+
pip install --user websockets
27+
28+
# 2. Install widget
29+
cd plasmoid && ./install.sh
30+
31+
# 3. Add to panel, configure IP, click Auth
32+
```
33+
34+
## First Time Setup
35+
36+
1. Right-click panel → "Add Widgets"
37+
2. Search "LG TV Remote" → drag to panel
38+
3. Click widget to open
39+
4. Enter TV IP address and name
40+
5. Click "Auth" → accept on TV screen
41+
42+
Done! Use buttons or keyboard shortcuts to control your TV.

README.md

Lines changed: 138 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,138 @@
1+
# LG TV Remote for KDE Plasma 6
2+
3+
A KDE Plasma 6 widget to control your LG webOS TV directly from your desktop.
4+
5+
![Plasma Widget](https://img.shields.io/badge/Plasma-6.0+-blue)
6+
![License](https://img.shields.io/badge/License-MIT-green)
7+
8+
## Features
9+
10+
- **Power Control**: Turn your TV on (Wake-on-LAN) and off
11+
- **Navigation**: D-pad controls for menu navigation
12+
- **Volume**: Volume up/down and mute/unmute
13+
- **Keyboard Shortcuts**: Control your TV with keyboard
14+
- **Persistent Daemon**: Fast response with background connection
15+
- **SSL Support**: Works with newer TV firmware
16+
17+
## Installation
18+
19+
### Step 1: Install Python websockets
20+
21+
**NixOS** - Add to your `configuration.nix`:
22+
```nix
23+
environment.systemPackages = with pkgs; [
24+
(python3.withPackages (ps: [ ps.websockets ]))
25+
];
26+
```
27+
28+
**Other distros**:
29+
```bash
30+
pip install --user websockets
31+
```
32+
33+
### Step 2: Install the Widget
34+
35+
**Option A: From .plasmoid file** (easiest)
36+
1. Download `lgtv-remote.plasmoid` from [Releases](https://github.com/jaredcat/plasmoid-lgtv-remote/releases)
37+
2. Open System Settings → Appearance → Plasma Style
38+
3. Click "Get New..." → "Install from File..."
39+
4. Select the downloaded `.plasmoid` file
40+
41+
**Option B: From source**
42+
```bash
43+
git clone https://github.com/jaredcat/plasmoid-lgtv-remote.git
44+
cd plasmoid-lgtv-remote/plasmoid
45+
./install.sh
46+
```
47+
48+
### Step 3: Add to Panel
49+
50+
1. Right-click your panel → "Add Widgets"
51+
2. Search for "LG TV Remote"
52+
3. Drag to your panel
53+
54+
### Step 4: Setup
55+
56+
1. Click the widget to open it
57+
2. Enter your TV's IP address (find in TV Settings → Network)
58+
3. Enter a name for your TV (e.g., "LivingRoomTV")
59+
4. Click "Auth" and accept the pairing on your TV screen
60+
61+
## Keyboard Shortcuts
62+
63+
| Key | Action |
64+
|-----|--------|
65+
| Arrow Keys | Navigate |
66+
| Enter | OK/Select |
67+
| Backspace/Esc | Back |
68+
| + / = | Volume Up |
69+
| - | Volume Down |
70+
| Shift + = | Unmute |
71+
| Shift + - | Mute |
72+
73+
## Power On (Wake-on-LAN)
74+
75+
For Power On to work, enable "Wake on LAN" on your TV:
76+
- Settings → Network → "Mobile TV On" or "Wake on LAN"
77+
78+
## Updating the Widget
79+
80+
After reinstalling, refresh Plasma:
81+
```bash
82+
plasmashell --replace &
83+
```
84+
85+
## Building from Source
86+
87+
```bash
88+
# Clone
89+
git clone https://github.com/jaredcat/plasmoid-lgtv-remote.git
90+
cd plasmoid-lgtv-remote
91+
92+
# NixOS: Enter dev shell
93+
nix develop
94+
95+
# Install
96+
cd plasmoid && ./install.sh
97+
98+
# Package for distribution
99+
./package.sh
100+
```
101+
102+
## Creating a Release
103+
104+
Push a version tag to trigger automatic packaging:
105+
```bash
106+
git tag v1.0.0
107+
git push origin v1.0.0
108+
```
109+
110+
The GitHub Action will create a release with the `.plasmoid` file attached.
111+
112+
## Troubleshooting
113+
114+
### Widget not appearing after install
115+
```bash
116+
plasmashell --replace &
117+
```
118+
119+
### "websockets module not found"
120+
Install the Python websockets module (see Step 1 above).
121+
122+
### Authentication fails
123+
- Make sure TV is on and connected to network
124+
- Check the IP address is correct
125+
- Accept the pairing prompt on TV screen
126+
127+
### Power On doesn't work
128+
- Enable "Wake on LAN" in TV network settings
129+
- Wait a few seconds after Power Off before trying Power On
130+
131+
## License
132+
133+
MIT License
134+
135+
## Credits
136+
137+
- Protocol based on [LGWebOSRemote](https://github.com/klattimer/LGWebOSRemote)
138+
- Built for KDE Plasma 6

flake.lock

Lines changed: 27 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

flake.nix

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
{
2+
description = "LG TV Remote - KDE Plasma 6 Widget";
3+
4+
inputs = {
5+
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
6+
};
7+
8+
outputs = { self, nixpkgs }:
9+
let
10+
supportedSystems = [ "x86_64-linux" "aarch64-linux" ];
11+
forAllSystems = nixpkgs.lib.genAttrs supportedSystems;
12+
in
13+
{
14+
devShells = forAllSystems (system:
15+
let
16+
pkgs = nixpkgs.legacyPackages.${system};
17+
in
18+
{
19+
default = pkgs.mkShell {
20+
buildInputs = with pkgs; [
21+
kdePackages.kpackage
22+
(python3.withPackages (ps: with ps; [
23+
websockets
24+
]))
25+
];
26+
27+
shellHook = ''
28+
echo "═══════════════════════════════════════════════════════"
29+
echo " LG TV Remote - Development Shell"
30+
echo "═══════════════════════════════════════════════════════"
31+
echo ""
32+
echo "Install the widget:"
33+
echo " cd plasmoid && ./install.sh"
34+
echo ""
35+
echo "Test widget:"
36+
echo " plasmawindowed com.codekitties.lgtv.remote"
37+
echo "═══════════════════════════════════════════════════════"
38+
'';
39+
};
40+
});
41+
};
42+
}

package.sh

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
#!/usr/bin/env bash
2+
# Package LG TV Remote widget for distribution
3+
# Creates a .plasmoid file that users can install via System Settings
4+
5+
set -e
6+
7+
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
8+
PACKAGE_DIR="$SCRIPT_DIR/plasmoid/package"
9+
OUTPUT_NAME="lgtv-remote.plasmoid"
10+
OUTPUT_PATH="$SCRIPT_DIR/$OUTPUT_NAME"
11+
12+
echo "Packaging LG TV Remote widget..."
13+
14+
# Remove old package if exists
15+
rm -f "$OUTPUT_PATH"
16+
17+
# Create the .plasmoid file (it's just a zip)
18+
cd "$PACKAGE_DIR"
19+
zip -r "$OUTPUT_PATH" . -x "*.pyc" -x "__pycache__/*" -x ".git/*"
20+
21+
echo ""
22+
echo "Package created: $OUTPUT_PATH"
23+
echo ""
24+
echo "Users can install it via:"
25+
echo " 1. System Settings → Appearance → Plasma Style → Get New... → Install from File"
26+
echo " 2. Or: kpackagetool6 -t Plasma/Applet -i $OUTPUT_NAME"
27+
echo ""
28+
echo "Requirements for users:"
29+
echo " - KDE Plasma 6"
30+
echo " - Python 3 with 'websockets' module"
31+
echo " NixOS: Add (python3.withPackages (ps: [ps.websockets])) to systemPackages"
32+
echo " Other: pip install websockets"

0 commit comments

Comments
 (0)