question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

This is a call to help, primarily intended for users @edunfelt and @OpenBSDGuy who have submitted personal themes to pyradio (here https://github.com/coderholic/pyradio/issues/60#issuecomment-833287617 and here https://github.com/coderholic/pyradio/pull/158), and any other user who has created a personal theme for pyradio

I have started working on pyradio theming; trying to use CSS colors instead of color numbers. This is still at a very early stage and I would like to see your color settings based on your palette 😃

So, can you please downaload this script: https://gist.github.com/s-n-g/eefd2307ae9713c7a6c707c096995077

and execute it, like so

python pyradio_themes.py [path to your theme]

This will create a file ~/pyradio_themes.log; can you please post it here?

Let me remind you these are the themes submittted:

pink_by_edunfelt.pyradio-theme

PyRadio URL = 2,0
Messages Border = 2,0
Status Bar = 0,1
Stations = 7,0
Active Station = 1,0
Active Cursor = 0,1
Normal Cursor = 0,3
Edit Cursor = 0,8

classic_by_obsdg.pyradio-theme

PyRadio URL = 0,0
Messages Border = 15,0
Status Bar = 16,4
Stations = 7,0
Active Station = 1,0
Active Cursor = 0,1
Normal Cursor = 0,4
Edit Cursor = 7,4

Issue Analytics

  • State:closed
  • Created a year ago
  • Reactions:2
  • Comments:19 (8 by maintainers)

github_iconTop GitHub Comments

3reactions
s-n-gcommented, Jun 10, 2022

Hi guys! I have just pushed the changes to my test repo, here’s how you get it; just fork

https://github.com/s-n-g/pyradio

then git clone to your fork

and finally

cd pyradio
devel/build_install_pyradio

Now, about the themes…

@edunfelt’s theme should be correctly converted; I already knew the palette she was using when she created the original theme.

@OpenBSDGuy 's theme is different; I do not know the original palette used, so I had to guess the colors from the color value and screenshot, so the theme may be a bit off (the “red” color, for example, and the URL color, for sure). BTW, do you still get the first line’s background same as the status bar background?

I have included the “converted” themes for you to test, plus a pastel_based theme I’ve put together (too dim I think, but I still like the colors), and two themes based on https://github.com/morhetz/gruvbox (requested by @bnsv in https://github.com/coderholic/pyradio/issues/116#issuecomment-743735344, a long time ago).

@bnsv, if you are still interested, please do have a look at the gruvbox_* themes and PR if needed 😄

The themes will appear under “System Themes”, so you can edit them as needed and create a PR

Things to consider:

  1. I have added a Extra Func color. It is the text color for extra function indication and jump numbers within the status bar (background color will come from Stations).
  2. I have discovered that xterm and xterm based terminals have a problem updating the colors on the fly.

    I believe I have fixed this issue, but I have found at least one terminal (roxterm on MX Linux Fulubox) which still does not behave 😄

    So, if you do find a such terminal, please do report!
  3. This new theming scheme uses 14 colors and 9 color pairs, which means that all themes will work even on 16 color terminals (TERM parameter). Normal xterm will not work; the program will set TERM=xterm-256color in this case.

    The same goes if TERM not set, or TERM=screen-*

    The program will display current TERM value in stdout (you can see it after you close it)
  4. Please do also check the “Edit Cursor” color (just press “e” and see the cursor in the line editor).
  5. The theme selection window may be a bit off when you first open it (always displays the top of the list of themes, even when the default one is way down the list). Just press “G” to get to it

CSS3 Color Names is a valuable resource…

I’ll be updating this repo with whatever fixes I have, until I get a reply 😉

2reactions
s-n-gcommented, Jun 14, 2022

Hi again guys!

I have just pushed new changes to master.

The way to get the changes is this. Get into your fork

git remote add upstream https://github.com/s-n-g/pyradio.git
git fetch upstream
# keep local changes
git stash
git merge upstream/master

(hope I got these instructions right…)

Now for the changes…

  1. This should be fixing @OpenBSDGuy crash
    TERM is set to xterm-256color if original TERM is tmux*
  2. All themes updated
  3. pyradio is now watching a theme called auto for changes
    Any changes done to this theme (files is ~/.config/pyradio/themes/auto.pyradio-theme) will be immediately applied to pyradio

This is just a “test” condition for the program; it would normally allow the user to set the file to “watch”

You can use the following script to see all theme 😉

#!/bin/bash
PYTHON_USER_SITE_PACKAGES=`python -c 'import site; print(site.getusersitepackages())'`

while true
do
    clear
    for n in "$PYTHON_USER_SITE_PACKAGES"/pyradio/themes/*.pyradio-theme
    do
        sleep 3
        echo $(basename "$n")
        \cp "$n" ~/.config/pyradio/themes/auto.pyradio-theme
    done
done

This will simulate a mechanism (like base16) that will update a given watched pyradio theme

So @edunfelt I hope this would be enough for you to test the creation of a base16 template?

I mean, if ~/.config/pyradio/themes/auto.pyradio-theme is set to be the output of a base16 theme based on your template, we can just test the behavior of the whole thing

What do you think?

Read more comments on GitHub >

github_iconTop Results From Across the Web

coderholic/pyradio: Curses based internet radio player - GitHub
Displaying Station Info; Copying and pasting - Registers; PyRadio Themes. Virtual terminal restrictions; CSS color themes restrictions; Secondary windows ...
Read more >
PyRadio themes - Terminals & CLI - Mabox Linux Forum
Hi everybody! Pyradio 0.8.9.21 introduced real color themes (CSS colors), so some of you asked on telegram how to create their own themes…...
Read more >
PyRadio: An open source alternative for internet radio
PyRadio is a convenient, open source, command-line application for playing any radio station that has a streaming link.
Read more >
PyRadio - curses based internet radio player - Page 3 of 4
PyRadio themes can be used with a transparent background. There's also the option to apply a theme and make it default.
Read more >
How to Install Pyradio on Ubuntu 20.04 - LinuxWays
Written in Python, Pyradio is a free and convenient command-line application for streaming internet radio straight from your Linux console.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found