Skip to content

Commit cc6281f

Browse files
committed
- version 0.8.9.22 (0.9-beta19)
- themes can declare transparency hint - theme auto update implemented - themes updated (1 added) - updating docs megring branch devel...
2 parents fce2d25 + 0edc0de commit cc6281f

16 files changed

+321
-66
lines changed

Changelog

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
2022-07-03 s-n-g
2+
* version 0.8.9.22 (0.9-beta19)
3+
* themes can declare transparency hint
4+
* theme auto update implemented
5+
* themes updated (1 added)
6+
* updating docs
7+
18
2022-06-26 s-n-g
29
* version 0.8.9.21 (0.9-beta18)
310
* Theme Selection window partly rewritten

README.html

Lines changed: 37 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,7 @@ <h2 id="table-of-contents">Table of Contents <span style="padding-left: 10px;"><
104104
<li><a href="#converting-old-themes">Converting old themes</a></li>
105105
</ul></li>
106106
<li><a href="#using-transparency">Using transparency</a></li>
107+
<li><a href="#updating-themes-automatically">Updating themes automatically</a></li>
107108
</ul></li>
108109
<li><a href="#mouse-support">Mouse support</a></li>
109110
<li><a href="#titles-logging">Titles logging</a>
@@ -158,6 +159,13 @@ <h2 id="requirements">Requirements <span style="padding-left: 10px;"><sup style=
158159
<h2 id="changelog">Changelog <span style="padding-left: 10px;"><sup style="font-size: 50%"><a href="#" title="Go to top of the page">Top</a></sup></style></h2>
159160
<pre style="height: 200px;">
160161

162+
2022-07-03 s-n-g
163+
* version 0.8.9.22 (0.9-beta19)
164+
* themes can declare transparency hint
165+
* theme auto update implemented
166+
* themes updated (1 added)
167+
* updating docs
168+
161169
2022-06-26 s-n-g
162170
* version 0.8.9.21 (0.9-beta18)
163171
* Theme Selection window partly rewritten
@@ -1215,6 +1223,8 @@ <h2 id="pyradio-themes">PyRadio Themes <span style="padding-left: 10px;"><sup st
12151223
Two themes by <a target="_blank" href="https://github.com/edunfelt">edunfelt</a> inspired by the <a target="_blank" href="https://github.com/base16-project">base16</a> project.</li>
12161224
<li><strong>gruvbox_dark_by_sng</strong> and <strong>gruvbox_light_by_sng</strong><br />
12171225
Two themes based on the <a target="_blank" href="https://github.com/morhetz/gruvbox">gruvbox</a> theme.</li>
1226+
<li><strong>minima_by_ben_chile</strong><br />
1227+
A theme by user <a target="_blank" href="https://forum.maboxlinux.org/u/ben_chile">ben_chile</a> created on the <a target="_blank" href="https://maboxlinux.org">Mabox Linux</a> Forum.</li>
12181228
<li><strong>pastel_based_by_sng</strong><br />
12191229
A dim but colorful theme.</li>
12201230
</ul>
@@ -1252,10 +1262,18 @@ <h2 id="pyradio-themes">PyRadio Themes <span style="padding-left: 10px;"><sup st
12521262

12531263
# Message window borser foreground
12541264
# (background color will come from Stations)
1255-
Messages Border #a3b367</pre>
1265+
Messages Border #a3b367
1266+
1267+
# Theme Transparency
1268+
# Values are:
1269+
# 0: No transparency (default)
1270+
# 1: Theme is transparent
1271+
# 2: Obey config setting
1272+
transparency 0</pre>
12561273
<p>Pressing “<strong>t</strong>” will bring up the <em>Theme selection window</em>, which can be used to activate a theme and set the default one.</p>
12571274
<p style="margin: 1.5em 4em 0 4em; text-indent: -2.5em;"><strong>Note:</strong> If the theme selected in the “<em>Theme selection window</em>”, (or requested using the “<strong>-t</strong>” command line option), is in any way invalid, or is of the old format, <strong>PyRadio</strong> will fall-back to the “<strong>dark</strong>” theme and will display a relevant message.</p>
12581275
<p>The “<em>Theme selection window</em>” will remain open after activating a theme, so that the user can inspect the visual result and easily change it, if desired. Then, when he is satisfied with the activated theme, the window will have to be manually closed (by pressing “<strong>q</strong>” or any other relevant key - pressing “<strong>?</strong>” will bring up its help).</p>
1276+
<p>Pressing “<strong>SPACE</strong>”, will apply the theme and make it default, and pressing “<strong>c</strong>” will apply the theme and make it default and start a file watch function on the file, so that if the file changes, <strong>PyRadio</strong> will automatically update itself.</p>
12591277
<h3 id="css-color-themes-restrictions">CSS color themes restrictions</h3>
12601278
<p>Using CSS colors imposes a couple of restrictions on the type of terminals <strong>PyRadio</strong> will be able to run:</p>
12611279
<ol type="1">
@@ -1276,18 +1294,32 @@ <h3 id="user-themes">User themes</h3>
12761294
<ol type="1">
12771295
<li>Save the theme provided as a template above in their themes folder using any (short) file name and a “<strong>.pyradio-theme</strong>” file extension.<br />
12781296
<br />
1279-
For this reason, a folder called “<strong>themes</strong>” will probably have to be created in <strong>PyRadio</strong> config directory (<strong>~/.config/pyradio</strong> or **%APPDATA* on Windows)</p></li>
1297+
For this reason, a folder called “<strong>themes</strong>” will probably have to be created in <strong>PyRadio</strong> config directory (<strong>~/.config/pyradio</strong> or <strong>%APPDATA%\pyradio</strong> on Windows)</p></li>
12801298
<li>Customize it as desired</p></li>
12811299
<li>Load it from the “<em>Theme selection window</em>” (it will be found under “<strong>User Themes</strong>”).</p></li>
12821300
</ol>
12831301
<h4 id="converting-old-themes">Converting old themes</h4>
12841302
<p>An old theme (using the old format) can be asily converted to the new format, using the script found at <a target="_blank" href="https://gist.github.com/s-n-g/65aa6ae12e135481bf3a503ece4e92d2">this gist</a>.</p>
12851303
<p style="margin: 1.5em 4em 0 4em; text-indent: -2.5em;"><strong>Note:</strong> In order to get the color intended to be used, the same palette as the one used when the original theme was created, must be used.</p>
12861304
<h3 id="using-transparency">Using transparency</h3>
1287-
<p><strong>PyRadio</strong> themes are able to be used with a transparent background.</p>
1288-
<p>Pressing “<strong>T</strong>” will toggle the transparency setting and save this state in <strong>PyRadio</strong>’s configuration file (transparency is off by default).</p>
1289-
<p>Setting transparency on, will actually force <strong>PyRadio</strong> to not use its own background color, effectively making it to display whatever is on the terminal (color/picture/transparency). The visual result depends on terminal settings and whether a compositor is running.</p>
1305+
<p>For <strong>PyRadio</strong>, transparency means that a theme’s background actually disappears, effectively making it to display whatever is on the terminal (color/picture/transparency). The visual result depends on terminal settings and whether a compositor is running.</p>
1306+
<p>Not all themes look good when transparency is ON, so themes can now declare whether they want to use transparency or not. This is the “<strong>transparency</strong>” variable of the theme, which can have these values:</p>
1307+
<ul>
1308+
<li>0 means that the theme looks better with no transparency (default)</li>
1309+
<li>1 means that the theme looks better when transparency in ON</li>
1310+
<li>2 means that the theme looks good either way, and the global transparency setting (defined in <strong>PyRadio</strong> config file) can be used.</li>
1311+
</ul>
1312+
<p>Please notice that this is just a hint; themes will obey the rules above, but transparency can still be toggled using “<strong>T</strong>” (capital “<strong>t</strong>”).</p>
12901313
<p>When the “<em>Theme selection window</em>” is visible, a “<strong>[T]</strong>” string displayed at its bottom right corner will indicate that transparency is <em>on</em>.</p>
1314+
<h3 id="updating-themes-automatically">Updating themes automatically</h3>
1315+
<p>Terminal users have been using all kind of software to change / update / adapt their terminal colors and palettes, such as <a target="_blank" href="https://github.com/chriskempson/base16">bASE16</a>, <a target="_blank" href="https://github.com/dylanaraps/pywal">pywal</a>, <a target="_blank" href="https://github.com/deviantfero/wpgtk">wpgtk</a>, <a target="_blank" href="https://github.com/lemnos/theme.sh">theme.sh</a>, to name a few.</p>
1316+
<p><strong>PyRadio</strong> is now able to “watch” a given theme for changes and update its colors whenever the theme changes.</p>
1317+
<p>To set up a theme for auto update, one would just open the “<em>Theme Selection</em>” window, navigate to a theme under “<strong>User Themes</strong>” and press “<strong>c</strong>”. To create a <strong>user theme</strong> just follow the procedure described in section <a href="#user-themes">User themes</a>.</p>
1318+
<p>Consecuently, the default theme name will be preceded by:</p>
1319+
<ul>
1320+
<li><strong>*</strong>” if the theme is the default one (the way it has always been).</li>
1321+
<li><strong>+</strong>” if the theme is the default one, and <strong>PyRadio</strong> will watch it for changes.</li>
1322+
</ul>
12911323
<h2 id="mouse-support">Mouse support <span style="padding-left: 10px;"><sup style="font-size: 50%"><a href="#" title="Go to top of the page">Top</a></sup></style></h2>
12921324
<p>Being a console application, <strong>PyRadio</strong> was never intended to work with a mouse.</p>
12931325
<p>Furthermore, when using the mouse on a console application, the result is highly dependent on the terminal used and the way it implements mouse support.</p>

README.md

Lines changed: 34 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ Ben Dowling - [https://github.com/coderholic](https://github.com/coderholic)
5151
* [User themes](#user-themes)
5252
* [Converting old themes](#converting-old-themes)
5353
* [Using transparency](#using-transparency)
54+
* [Updating themes automatically](#updating-themes-automatically)
5455
* [Mouse support](#mouse-support)
5556
* [Titles logging](#titles-logging)
5657
* [Tagging a title](#tagging-a-title)
@@ -734,6 +735,8 @@ A clasic theme by [The OpenBSD Guy](https://github.com/OpenBSDGuy), originally c
734735
Two themes by [edunfelt](https://github.com/edunfelt) inspired by the [base16](https://github.com/base16-project) project.
735736
- **gruvbox_dark_by_sng** and **gruvbox_light_by_sng** \
736737
Two themes based on the [gruvbox](https://github.com/morhetz/gruvbox) theme.
738+
- **minima_by_ben_chile** \
739+
A theme by user [ben_chile](https://forum.maboxlinux.org/u/ben_chile) created on the [Mabox Linux](https://maboxlinux.org) Forum.
737740
- **pastel_based_by_sng** \
738741
A dim but colorful theme.
739742

@@ -775,6 +778,13 @@ PyRadio URL #a3b367
775778
# Message window borser foreground
776779
# (background color will come from Stations)
777780
Messages Border #a3b367
781+
782+
# Theme Transparency
783+
# Values are:
784+
# 0: No transparency (default)
785+
# 1: Theme is transparent
786+
# 2: Obey config setting
787+
transparency 0
778788
```
779789

780790
Pressing "**t**" will bring up the *Theme selection window*, which can be used to activate a theme and set the default one.
@@ -783,6 +793,8 @@ Pressing "**t**" will bring up the *Theme selection window*, which can be used t
783793

784794
The "*Theme selection window*" will remain open after activating a theme, so that the user can inspect the visual result and easily change it, if desired. Then, when he is satisfied with the activated theme, the window will have to be manually closed (by pressing "**q**" or any other relevant key - pressing "**?**" will bring up its help).
785795

796+
Pressing "**SPACE**", will apply the theme and make it default, and pressing "**c**" will apply the theme and make it default and start a file watch function on the file, so that if the file changes, **PyRadio** will automatically update itself.
797+
786798
### CSS color themes restrictions
787799

788800
Using CSS colors imposes a couple of restrictions on the type of terminals **PyRadio** will be able to run:
@@ -807,7 +819,7 @@ Users can easiliy create their own themes, using for example [CSS color names](h
807819

808820
1. Save the theme provided as a template above in their themes folder using any (short) file name and a "**.pyradio-theme**" file extension. \
809821
\
810-
For this reason, a folder called "**themes**" will probably have to be created in **PyRadio** config directory (**~/.config/pyradio** or **%APPDATA\pyradio** on Windows)
822+
For this reason, a folder called "**themes**" will probably have to be created in **PyRadio** config directory (**~/.config/pyradio** or **%APPDATA%\\pyradio** on Windows)
811823

812824

813825
2. Customize it as desired
@@ -823,14 +835,32 @@ An old theme (using the old format) can be asily converted to the new format, us
823835

824836
### Using transparency
825837

826-
**PyRadio** themes are able to be used with a transparent background.
838+
For **PyRadio**, transparency means that a theme's background actually disappears, effectively making it to display whatever is on the terminal (color/picture/transparency). The visual result depends on terminal settings and whether a compositor is running.
839+
840+
Not all themes look good when transparency is ON, so themes can now declare whether they want to use transparency or not. This is the "**transparency**" variable of the theme, which can have these values:
827841

828-
Pressing "**T**" will toggle the transparency setting and save this state in **PyRadio**'s configuration file (transparency is off by default).
842+
- 0 means that the theme looks better with no transparency (default)
843+
- 1 means that the theme looks better when transparency in ON
844+
- 2 means that the theme looks good either way, and the global transparency setting (defined in **PyRadio** config file) can be used.
829845

830-
Setting transparency on, will actually force **PyRadio** to not use its own background color, effectively making it to display whatever is on the terminal (color/picture/transparency). The visual result depends on terminal settings and whether a compositor is running.
846+
Please notice that this is just a hint; themes will obey the rules above, but transparency can still be toggled using "**T**" (capital "**t**").
831847

832848
When the "*Theme selection window*" is visible, a "**[T]**" string displayed at its bottom right corner will indicate that transparency is *on*.
833849

850+
### Updating themes automatically
851+
852+
Terminal users have been using all kind of software to change / update / adapt their terminal colors and palettes, such as [bASE16](https://github.com/chriskempson/base16), [pywal](https://github.com/dylanaraps/pywal), [wpgtk](https://github.com/deviantfero/wpgtk), [theme.sh](https://github.com/lemnos/theme.sh), to name a few.
853+
854+
**PyRadio** is now able to "watch" a given theme for changes and update its colors whenever the theme changes.
855+
856+
To set up a theme for auto update, one would just open the "*Theme Selection*" window, navigate to a theme under "**User Themes**" and press "**c**". To create a **user theme** just follow the procedure described in section [User themes](#user-themes).
857+
858+
Consecuently, the default theme name will be preceded by:
859+
860+
- "**\***" if the theme is the default one (the way it has always been).
861+
- "**+**" if the theme is the default one, and **PyRadio** will watch it for changes.
862+
863+
834864
## Mouse support
835865

836866
Being a console application, **PyRadio** was never intended to work with a mouse.

pyradio.1

Lines changed: 36 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
.\" Copyright (C) 2011 Ben Dowling <http://www.coderholic.com/pyradio>
22
.\" This manual is freely distributable under the terms of the GPL.
33
.\"
4-
.TH pyradio 1 "June 2022" PyRadio
4+
.TH pyradio 1 "July 2022" PyRadio
55

66
.SH Name
77
.PP
@@ -826,6 +826,9 @@ A clasic theme by \fBThe OpenBSD Guy\fR (\fIhttps://github.com/OpenBSDGuy\fR), o
826826
Two themes by \fBedunfelt\fR (\fIhttps://github.com/edunfelt\fR) inspired by the \fBbase16\fR (\fIhttps://github.com/base16-project\fR) project.
827827
.IP \fBgruvbox_dark_by_sng\fR and \fBgruvbox_light_by_sng\fR
828828
Two themes based on the \fBgruvbox\fR (\fIhttps://github.com/morhetz/gruvbox\fR) theme.
829+
.IP \fBminima_by_ben_chile\fR \
830+
A theme by \fBben_chile\fR (\fIhttps://forum.maboxlinux.org/u/ben_chile\fR) created on the \fBMabox Linux\fR Forum (https://maboxlinux.org).
831+
829832
.IP \fBpastel_based_by_sng\fR
830833
A dim but colorful theme.
831834

@@ -841,6 +844,10 @@ If the theme selected in the \fITheme selection window\fR, (or requested using t
841844
.PP
842845
The \fITheme selection window\fR will remain open after activating a theme, so that the user can inspect the visual result and easily change it, if desired. Then, when he is satisfied with the activated theme, the window will have to be manually closed (by pressing "\fBq\fR" or any other relevant key - pressing "\fB?\fR" will bring up its help).
843846

847+
.PP
848+
849+
Pressing "\fISPACE\fR", will apply the theme and make it default, and pressing "\fIc\fR" will apply the theme and make it default and start a file watch function on the file, so that if the file changes, \fBpyradio\fR will automatically update itself.
850+
844851
.PP
845852
\fBCSS color themes restrictions\fR
846853

@@ -898,23 +905,45 @@ An old theme (using the old format) can be asily converted to the new format, us
898905
In order to get the color intended to be used, the same palette as the one used when the original theme was created, must be used.
899906

900907

908+
.PP
909+
\fBUsing Transparency\fR
901910

911+
For \fBpyradio\fR, transparency means that a theme's background actually disappears, effectively making it to display whatever is on the terminal (color/picture/transparency). The visual result depends on terminal settings and whether a compositor is running.
902912

913+
Not all themes look good when transparency is ON, so themes can now declare whether they want to use transparency or not. This is the "\fBtransparency\fR" variable of the theme, which can have these values:
903914

915+
.RS 5
916+
.IP \fI0\fR 3
917+
means that the theme looks better with no transparency (default)
904918

919+
.IP \fI1\fR 3
920+
means that the theme looks better when transparency in ON
905921

922+
.IP \fI2\fR 3
923+
means that the theme looks good either way, and the global transparency setting (defined in \fBpyrRadio\fR config file) can be used.
906924

907-
925+
.RE
908926
.PP
909-
\fBUsing Transparency\fR
927+
Please notice that this is just a hint; themes will obey the rules above, but transparency can still be toggled using "\fIT\fR" (capital "\fIt\fR").
928+
929+
When the \fITheme selection window\fR is visible, a "\fI[T]\fR" string displayed at its bottom right corner will indicate that transparency is \fIon\fR.
910930

911-
\fBPyRadio\fR themes are able to be used with a transparent background.
931+
.SH Updating themes automatically
912932

913-
Pressing "\fBT\fR" will toggle the transparency setting (it is \fIoff\fR by default) and save this state in \fBPyRadio\fR's configuration file.
933+
Terminal users have been using all kind of software to change / update / adapt their terminal colors and palettes, such as i\fBbASE16\fR (\fIhttps://github.com/chriskempson/base16\fR), \fBpywal\fR (\fIhttps://github.com/dylanaraps/pywal\fR), \fBwpgtk\fR (\fIhttps://github.com/deviantfero/wpgtk\fR), \fBtheme.sh\fR (\fIhttps://github.com/lemnos/theme.sh\fR), to name a few.
914934

915-
Setting transparency on, will actually force \fBPyRadio\fR to not use its own background color, effectively making it to display whatever is on the terminal (color/picture/transparency). The visual result depends on terminal settings and whether a compositor is running.
935+
\fBpyradio\fR is now able to "watch" a given theme for changes and update its colors whenever the theme changes.
916936

917-
When the \fITheme selection window\fR is visible, a "\fI[T]\fR" string displayed at its bottom right corner will indicate that transparency is \fIon\fR.
937+
To set up a theme for auto update, one would just open the "\fITheme Selection\fR window, navigate to a theme under \fBUser Themes\fR and press "\fBc\fR". To create a \fIuser theme\fR just follow the procedure described in section \fBUser themes\fR.
938+
939+
Consecuently, the default theme name will be preceded by:
940+
941+
.RS 5
942+
.IP \fB*\fR 3
943+
if the theme is the default one (the way it has always been).
944+
945+
.IP \fB-\fR 3
946+
if the theme is the default one, and \fBpyradio\fR will watch it for changes.
918947

919948
.SH Mouse Support
920949

pyradio/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
" pyradio -- Console radio player. "
22

3-
version_info = (0, 8, 9, 21)
3+
version_info = (0, 8, 9, 22)
44

55
# Set it to True if new stations have been
66
# added to the package's stations.csv

pyradio/config

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,9 @@ force_http = False
7474
# light_16_colors (16 colors light theme alternative)
7575
# black_on_white (bow) (256 colors)
7676
# white_on_black (wob) (256 colors)
77+
# If theme is watched for changes, prepend its name
78+
# with an asterisk (i.e. '*my_theme')
79+
# This is applicable for user themes only!
7780
# Default value = 'dark'
7881
theme = dark
7982

0 commit comments

Comments
 (0)