GUI application for controlling Samsung Smart TV connected to the same LAN of ubuntu desktop
You can use YAD to create GUI front end to CLI commands.
As a comment points out there is a CLI controller for the Samsung Smart TV:
- https://github.com/Ape/samsungctl
You just need to install Yad with sudo apt install yad
and create a GUI window like this:
Using this command:
yad --title "Remote Control" --text "Samsung Smart TV" --width 250 --height 400 --form --columns 2 --field "Power:FBTN" --field "Vol +:FBTN" --field "Vol -:FBTN" --field "Input:FBTN" --field "Chan +:FBTN" --field "Chan -:FBTN"
Additional code is required to link each button to the Samsung Control program:
samsungctl --host <host> [options] <key> [key ...]
If I had a Samsung Smart TV I would enjoy writing the full script. However my Smart TVs are Sony and Toshiba. I will try to write a remote control GUI script soon for those TVs.
Seeing it in action
I created a little demo where instead of calling the Samsung Smart TV commands are echoed to the screen.
The one-liner code is a little longer now:
yad --title "Remote Control" --text "Samsung Smart TV" --width 250 --height 400 --form --columns 2 --field "Power:FBTN" 'bash -c "echo Power"' --field "Vol +:FBTN" 'bash -c "echo Volume Up"' --field "Vol -":FBTN 'bash -c "echo Volume Down"' --field "Input:FBTN" "bash -c 'echo "Input"'" --field "Chan +:FBTN" 'echo "Channel up"' --field "Chan -:FBTN" 'bash -c "echo Channel Down"'
As mentioned in comments if you have a Samsung TV newer than 2016 you will also need to download the websocket-client