write proper readme, add linux dotfiles, photos

This commit is contained in:
mykola2312 2024-05-01 03:46:13 +03:00
parent bd35259111
commit d0fd409716
8 changed files with 140 additions and 28 deletions

View file

@ -1,4 +1,38 @@
# mptv
MPV front-end for IPTV channels to use on Raspberry Pi.
Uses [PiIR](https://github.com/ts1/PiIR) for reading TV remote IR signals
Convert Your Raspberry Pi into IPTV receiver. Anything that MPV can play.
## Stack
Java Swing application that crawls and parses M3U playlists, displaying them in graphical menu and opening them in MPV.
Reads IR commands from any TV remote, controlling menu, opening and managing MPV player state.
Example configuration ```config.json.example```, rename to ```config.json```. Take look and configure the way You like it. May have multiple IR bind sets, so You can switch between them with ```currentBindSet``` variable. Use ```piir dump``` to dump IR commands from Your TV remote.
Uses [PiIR](https://github.com/ts1/PiIR) for reading TV remote IR signals
```pigpio``` must be present in system, and its daemon ```pigpiod``` must be running. Enable it with ```sudo systemctl enable pigpiod```
Recommended to use Xorg and PulseAudio. PulseAudio default sink must be set to HDMI output.
Some configurations files could be found in linux folder to ease Your setup.
## Configuration
The configuration is a JSON file ```config.json```
- ```frame``` - GUI window parameters. Note that ```fullscreen`` may not work well in Xorg.
- ```db``` - DB configuration. Only supports SQLite.
- ```piir``` - PiIR configuration. You must provide path to piir executable in ```exec``` field. ```gpio``` corresponds to GPIO pin.
Note that You must have pigpiod service running. Enable it with ```sudo systemctl enable pigpiod```
```bindSet``` decribes binds for each remote, select current remote bind set with ```currentBindSet``` field. For bind explanation refer to ```config.json.example```
- ```sources``` - Here You write Your M3U playlist sources. May be either local file or remote URL. Take look at ```config.json.example```
- ```tasks``` - Adjust here intervals for each task to be executed. If You experience frequent MPV restarts, You may want to adjust ```processService``` to 2 second interval. ```crawler``` task will be executed at 24 hour interval.
### Recommended IR connection to GPIO
![](assets/rpi-ir.webp)
## Photos
![](assets/pic1.webp)
![](assets/pic2.webp)

BIN
assets/pic1.webp Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 280 KiB

BIN
assets/pic2.webp Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 110 KiB

BIN
assets/rpi-ir.webp Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 39 KiB

View file

@ -16,33 +16,41 @@
"piir": {
"exec": "/home/iptv/.local/bin/piir",
"gpio": 17,
"binds": [
{
"data": "45 03",
"menuAction": "up"
},
{
"data": "45 5E",
"menuAction": "down"
},
{
"data": "45 02",
"menuAction": "left"
},
{
"data": "45 40",
"menuAction": "right"
},
{
"data": "45 5F",
"menuAction": "open"
},
{
"preData": "45 BA",
"data": "60",
"menuAction": "close"
}
]
"currentBindSet": "gi",
"bindSet": {
"gi": [
{
"preData": "45 BA",
"data": "03",
"menuAction": "up"
},
{
"preData": "45 BA",
"data": "5E",
"menuAction": "down"
},
{
"preData": "45 BA",
"data": "02",
"menuAction": "left"
},
{
"preData": "45 BA",
"data": "40",
"menuAction": "right"
},
{
"preData": "45 BA",
"data": "5F",
"menuAction": "open"
},
{
"preData": "45 BA",
"data": "60",
"menuAction": "close"
}
]
}
},
"sources": [

30
linux/.profile Normal file
View file

@ -0,0 +1,30 @@
# ~/.profile: executed by the command interpreter for login shells.
# This file is not read by bash(1), if ~/.bash_profile or ~/.bash_login
# exists.
# see /usr/share/doc/bash/examples/startup-files for examples.
# the files are located in the bash-doc package.
# the default umask is set in /etc/profile; for setting the umask
# for ssh logins, install and configure the libpam-umask package.
#umask 022
# if running bash
if [ -n "$BASH_VERSION" ]; then
# include .bashrc if it exists
if [ -f "$HOME/.bashrc" ]; then
. "$HOME/.bashrc"
fi
fi
# set PATH so it includes user's private bin if it exists
if [ -d "$HOME/bin" ] ; then
PATH="$HOME/bin:$PATH"
fi
# set PATH so it includes user's private bin if it exists
if [ -d "$HOME/.local/bin" ] ; then
PATH="$HOME/.local/bin:$PATH"
fi
# start X with MPTV
startx -- -nocursor

13
linux/.xinitrc Executable file
View file

@ -0,0 +1,13 @@
#!/bin/sh
# /etc/X11/xinit/xinitrc
#
# global xinitrc file, used by all X sessions started by xinit (startx)
# invoke global X session script
#. /etc/X11/Xsession
# MPTV
# unclutter to remove cursor pointer appearing on screen
unclutter -idle 0 &
/home/iptv/mptv/mptv.sh

27
linux/xorg.conf Normal file
View file

@ -0,0 +1,27 @@
Section "Monitor"
Identifier "Monitor0"
Option "PreferredMode" "auto"
EndSection
Section "Screen"
Identifier "Screen0"
Monitor "Monitor0"
Device "Device0"
DefaultDepth 24
SubSectionSub "Display"
Depth 24
Modes "auto"
EndSubSection
EndSection
Section "Device"
Identifier "Device0"
Driver "modesetting"
Option "PrimaryGPU" "true"
EndSection
Section "ServerLayout"
Identifier "Main Layout"
Screen 0 "Screen0" 0 0
Option "BlankTime" "0"
EndSection