515
submitted 1 year ago* (last edited 1 year ago) by christos@lemmy.world to c/linux@lemmy.ml

radion is an internet radio CLI client, written in Bash.

https://gitlab.com/christosangel/radion

Radion can be customized as far as the station selecting program is concerned. The user can choose between:

  • read

read

  • fzf

fzf

  • rofi

rofi

  • dmenu

dmenu


Update: Introduced new feature: customizing prompt text for fzf dmenu and rofi.


Update: MacOS support added now thanks to Andrea Schäfer

Also, I was forced by my daughter to add some anime radio stations...


Update: Recording functionality added, with the use of another (you guessed it) bash script

icy

Also options in read as Preferred selector are also case insensitive.

Any feedback is appreciated!

all 50 comments
sorted by: hot top controversial new old
[-] Maeve@kbin.social 51 points 1 year ago
[-] folkrav@lemmy.world 43 points 1 year ago

My first thought every time I see a pure bash project: "wow" followed by "but... why".

I get that we have bash on most machines, reducing dependencies, all that jazz. But it's so painful to do anything nontrivial with it. There are so many small potential papercuts and edge cases, I'd rather pull my teeth out with a pair of pliers than code more than a simple script in it.

[-] Maeve@kbin.social 12 points 1 year ago

That’s why it’s impressive. It’s not easy.

[-] folkrav@lemmy.world 14 points 1 year ago* (last edited 1 year ago)

Oh, for sure, but to me it's "building a car with a screwdriver" impressive. It's impressive that the feat is doable at all, but why one would subject themselves to this eludes me haha.

[-] Maeve@kbin.social 6 points 1 year ago

Some people just have a natural affinity, I guess. If it made the programmer happy and it’s not full of maliciously exploitable bugs, why not?

[-] folkrav@lemmy.world 3 points 1 year ago

Oh, for sure! But I'm a developer myself, so like most of us, I tend to take my technical opinions as gospel by default 😉

Sometimes it can be fun to push your limits or see how far you can go down some personally motivated rabbit hole. Just saying, I'd never do it with bash myself. Don't get me wrong, I write bash scripts all the damn time, but the second it gets more complicated than aligning a handful of simple commands without too much output parsing BS, requiring some obscure awk one liner nobody understands after 2 days, I bail out to something less awkward.

[-] Dran_Arcana@lemmy.world 10 points 1 year ago

My entire homelab env is written in "pure bash". Bare metal deployments, creation, build, deployment, update, and backup, of docker containers (which are also just convenience wrappers around other pure bash projects of mine.). Etc...

I do it because I got sick of losing data, work, workflow or convenience to black boxes I didn't create myself. Hell, even with my third party projects like Plex I have a lot of bash automation around extracting playlists from the internal sqlite db, etc. It really shifts your perspective on what's possible when you build things by hand yourself.

[-] folkrav@lemmy.world 8 points 1 year ago

I've been working as a dev for 8+ years, been programming for much longer. Yes, many things are possible with bash. Many things are also possible using straight assembly, but nobody does that - for good reasons...

Many of those problems you mentioned have well established, open source solutions that should not end up in lost work or data. Building things yourself also has the downside of maintaining those things, and dealing with your own (inevitable) failures yourself too. I'd rather trust established solutions for things as complex as provisioning than roll my own. But whatever works for you.

If I were to write that much code by hand, I'd just choose something saner than bash, purely from a language perspective. That's all.

[-] Dran_Arcana@lemmy.world 3 points 1 year ago

It's not like I don't use open source solutions, I use docker for example rather than automating chroots/cgroups by hand in bash. I just use them as little as possible. While you're correct, I don't lose data in a well designed open source project, I do lose work, workflow, and convenience when those projects change or shut down. What's really nice about the pure bash solutions is they're entirely portable once you have them dialed in. If I wanted to switch from docker back to vms or forward to something like harvester/rancher/k3s I'd be able to port the projects very trivially. If I built everything around one of those projects in mind, all of my work would rely on it not changing. I acknowledge it's sometimes a little more work but it's work that I get to decide when to do, not when the project maintainers decide it for me.

[-] shino@lemmy.shinomoroll.net 10 points 1 year ago

Everything is not pure bash here, it's a radio frontend for mpv. It is also using sed, awk... A standard bash use case actually.

[-] tdawg@lemmy.world 5 points 1 year ago

Not to mention the tool isn't meant to be anything more than glue between other programs

[-] dragnet@lemmy.dbzer0.com 3 points 1 year ago

Keep in mind that what you find painful, some people find fun :)

[-] HexesofVexes@lemmy.world 12 points 1 year ago

Well, I know what I'll be using to listen to my radio stations from now on. Really neat project!

Also, it doesn't pick up user defined tags because it's looking in the wrong place for them!

Row 114:

TAGS=( $(sed 's/ /\n/g' stations.txt |grep "#"|grep -v "#Favorites"|sort|uniq|sed 's/#//g') )

Should be

TAGS=( $(sed 's/ /\n/g' $HOME/.cache/radion/stations.txt |grep "#"|grep -v "#Favorites"|sort|uniq|sed 's/#//g') )

[-] christos@lemmy.world 10 points 1 year ago
  • Excellent catch! This one slipped through! I just fixed the bug, thank you very much!

I am happy you like it!

[-] Qkall@lemmy.ml 11 points 1 year ago

This looks crazy promising for us sxmo users ... I'll def check this out.

[-] christos@lemmy.world 6 points 1 year ago

I must admit I had to look sxmo up...

thx!

[-] Qkall@lemmy.ml 1 points 1 year ago

How can we connect... I'm having weird graphical issues.... But I might be drunk and missing something. Tomorrow morning I'll send a video

[-] z3rOR0ne@lemmy.ml 9 points 1 year ago

Very cool. You might want to crosspost this to c/bash on lemmy.ml

[-] Diplomjodler@feddit.de 8 points 1 year ago

Just because you can doesn't mean you should.

[-] christos@lemmy.world 28 points 1 year ago

Of course, next time I feel like writing a script, I will make sure that I let you know first, and get your approval.

[-] darcy@sh.itjust.works 4 points 1 year ago

respectfully, why did you write it in bash? for the challenge?

[-] christos@lemmy.world 5 points 1 year ago

This script could might as well be an one-liner. It was simple and easy.

[-] ndonkersloot@feddit.nl 4 points 1 year ago

Yeah right, that's what my co-worker said writing the most obscure bash scripts... *looks at code Ah, it is easy and well structured indeed. Nice :-) .

[-] christos@lemmy.world 2 points 1 year ago

I know this feeling! However this script in its essence is quite simple...

[-] rivalary@lemmy.ca 1 points 1 year ago

Maybe simple to Chris Angel and his magic.

[-] christos@lemmy.world 1 points 1 year ago

Try this, it is less pretty, but in essence, the same:

cat ~/.cache/radion/stations.txt |fzf|awk '{print $1}'|xargs mpv

[-] rivalary@lemmy.ca 2 points 1 year ago

Sorry, I was mainly trying to say, "Good job, it's impressive!" Your name is close to the name of a famous magician, so I was referring to your code as magic. Bit of a dumb joke.

[-] christos@lemmy.world 2 points 1 year ago

Hey, I am glad you like it ;)

[-] Diplomjodler@feddit.de 1 points 1 year ago

That's the least you can do.

[-] christos@lemmy.world 1 points 1 year ago

I like how people I don't know insist on telling me what to do. Actually, I like the part where I ignore them.

[-] Diplomjodler@feddit.de 1 points 1 year ago

Dude, I was trying to be funny. Feel absolutely free to ignore me.

[-] christos@lemmy.world 1 points 1 year ago

Oh, no problem 😀

[-] lemmyvore@feddit.nl 5 points 1 year ago

Unrelated but, in case it's not dyslexia, it's "customize" not "costumize". It comes from "custom" not "costume".

load more comments (1 replies)
[-] dragnet@lemmy.dbzer0.com 4 points 1 year ago

Awesome :) I think I shall set this up in Termux later for one more on the go music option.

[-] luthis@lemmy.nz 4 points 1 year ago

No metal, blues, or dnb option?

[-] christos@lemmy.world 7 points 1 year ago

Through the script you could go to https://www.radio-browser.info/search?page=1&order=clickcount&reverse=true&hidebroken=true&tagList=metal, pick the stations you fancy and headbang yourself unconscious... 🎸 🤘

[-] christos@lemmy.world 5 points 1 year ago

De gustibus et coloribus...

Each user can create add and enjoy any tag and station they like!

[-] christos@lemmy.world 3 points 1 year ago

Update: Recording functionality added, with the use of another (you guessed it) bash script

icy

Also options in read as Preferred selector are also case insensitive.

Any feedback is appreciated!

[-] superguy@lemm.ee 1 points 1 year ago

Maybe it's just me, but I think we don't need more command line functionality.

[-] christos@lemmy.world 14 points 1 year ago

Maybe. Respectfuly, feel free to move along. I fail to see the aim of your message.

[-] superguy@lemm.ee 2 points 1 year ago

That's fine. Not everything is for you.

[-] christos@lemmy.world 7 points 1 year ago

By the way: Who's "we"? Do you represent a group of people? Are you elected to speak for someone? Or is it the plural of some royal family? Please.

load more comments (3 replies)
this post was submitted on 21 Oct 2023
515 points (100.0% liked)

Linux

47943 readers
1025 users here now

From Wikipedia, the free encyclopedia

Linux is a family of open source Unix-like operating systems based on the Linux kernel, an operating system kernel first released on September 17, 1991 by Linus Torvalds. Linux is typically packaged in a Linux distribution (or distro for short).

Distributions include the Linux kernel and supporting system software and libraries, many of which are provided by the GNU Project. Many Linux distributions use the word "Linux" in their name, but the Free Software Foundation uses the name GNU/Linux to emphasize the importance of GNU software, causing some controversy.

Rules

Related Communities

Community icon by Alpár-Etele Méder, licensed under CC BY 3.0

founded 5 years ago
MODERATORS