How to stop and start streaming music on UT

Last time I had UT installed on the BraX3 I found a CLI music streamer snap called mpv. U can make your radio stream into a short script with nano. Use a keyboard for nano as there is no screen option for CTRL X. This can be turned into a GUI executable.

Once streaming this can be stopped by tapping on the Sound option at the top of the UT screen. The media player is in there and under this is your mpv stream with icy information so u can see what’s playing. Press the pause button to pause and again to resume.

Here are the files I made. Reboot and when u log back in the desktop file should be in the tray to listen to. Control it from the toolbar sound docked at the top of your phone!

Open the terminal and from the /home/phablet directory type this using a real keyboard:

nano radio.sh

I entered this into this file:

#!/bin/bash
mpv https://listen.christianrock.net/stream/7/

save this with CTRL X and Y

Make it executable:

chmod +x radio.sh

Add this to your desktop apps now. In the terminal:

cd .local/share/applications
nano radio.desktop

I entered this:

[Desktop Entry]
Version=1.0
Type=Application
Terminal=true
Exec=/home/phablet/radio.sh
Icon=/usr/share/click/preinstalled/.click/users/@all/terminal.ubports/terminal-app.svg
Name=Christian Radio
X-Lomiri-Touch=true
X-Lomiri-Default-Department-ID=accessories

Save the file with CTRL X and Y then reboot.

1 Like

That makes the script and desktop icon OK. The problem is stopping it at times. It does pause and resume-but once. After that a reboot works. That script generates a child process so just closing the window doesn’t work.

Figured this out. Bash scripts can use the command exec so that u put snaps in a wrapper and they won’t generate child processes. When used, u can just swipe up on the GUI window it is in when it is in a small window (slowly drag the right of any UT screen to get in this mode and see what’s in the memory. This is how the radio.sh script looks:

#!/bin/bash
exec mpv https://listen.christianrock.net/stream/7/

This topic was automatically closed 4 days after the last reply. New replies are no longer allowed.