Skip to content

Commit 87128b8

Browse files
committed
adding watch for base16, pywall and sheme.sh
1 parent cc6281f commit 87128b8

9 files changed

+939
-103
lines changed

README.html

+28
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,14 @@ <h2 id="table-of-contents">Table of Contents <span style="padding-left: 10px;"><
105105
</ul></li>
106106
<li><a href="#using-transparency">Using transparency</a></li>
107107
<li><a href="#updating-themes-automatically">Updating themes automatically</a></li>
108+
<li><a href="#using-project-themes">Using Project Themes</a>
109+
<ul>
110+
<li><a href="#1.-base16">1. base16</a>
111+
<ul>
112+
<li><a href="#using-the-themes-without-base16">Using the themes without base16</a></li>
113+
</ul></li>
114+
<li><a href="#2.-pywal">2. pywal</a></li>
115+
</ul></li>
108116
</ul></li>
109117
<li><a href="#mouse-support">Mouse support</a></li>
110118
<li><a href="#titles-logging">Titles logging</a>
@@ -126,6 +134,7 @@ <h2 id="table-of-contents">Table of Contents <span style="padding-left: 10px;"><
126134
<li><a href="#packaging-pyradio">Packaging PyRadio</a></li>
127135
<li><a href="#todo">TODO</a></li>
128136
<li><a href="#acknowledgment">Acknowledgment</a></li>
137+
<li><a href="#special-thanks">Special thanks</a></li>
129138
</ul>
130139
<!-- vim-markdown-toc -->
131140
<h2 id="features">Features <span style="padding-left: 10px;"><sup style="font-size: 50%"><a href="#" title="Go to top of the page">Top</a></sup></style></h2>
@@ -1320,6 +1329,21 @@ <h3 id="updating-themes-automatically">Updating themes automatically</h3>
13201329
<li><strong>*</strong>” if the theme is the default one (the way it has always been).</li>
13211330
<li><strong>+</strong>” if the theme is the default one, and <strong>PyRadio</strong> will watch it for changes.</li>
13221331
</ul>
1332+
<h3 id="using-project-themes">Using Project Themes</h3>
1333+
<p><strong>PyRadio</strong> is able to use (and watch) the output of certain projects that modify terminal colors.</p>
1334+
<p><strong>PyRadio</strong> will detect theses projects (programs installed and initialized), and will add them under the “<strong>Ext. Themes Projects</strong>” section of the “<em>Themes Selection Window</em>.”</p>
1335+
<p>If loading any of these themes fails, the default <strong>dark</strong> theme will be loaded, but contrary to a local theme being invalid, the selection will persist (so that the theme gets loaded wheneve it is available).</p>
1336+
<p>Currently, the following projects are supported:</p>
1337+
<h4 id="base16">1. <a target="_blank" href="https://github.com/base16-project">base16</a></h4>
1338+
<p>Thanks to the wonderful work by user <a target="_blank" href="https://github.com/edunfelt">edunfelt</a>, there is now a <strong>PyRadio</strong> base16 template in place, and themes have been produced based on the project (there are more than 900 themes available).</p>
1339+
<p>This implementation will add four entries in the theme selection menu (with alternative and variant forms of the main theme).</p>
1340+
<p>Then, any of the themes can either be activated or watched; in which case <strong>PyRadio</strong> will download and apply the corresponding theme.</p>
1341+
<h5 id="using-the-themes-without-base16">Using the themes without base16</h5>
1342+
<p>In case one wants to use any of these themes, but not install or use <a target="_blank" href="https://github.com/base16-project">base16</a>, one can get them <a target="_blank" href="https://github.com/edunfelt/base16-pyradio">from this repo</a>, and use the “<em>cycle_themes.py</em>” and “<em>install_themes.py</em>” scripts to inspect and install them.</p>
1343+
<h4 id="pywal">2. <a target="_blank" href="https://github.com/dylanaraps/pywal">pywal</a></h4>
1344+
<p>When detected, two themes will be added to the menu; the main and the alternative form.</p>
1345+
<p>Since these themes are generated on the fly, as the wallpaper changes, there is no way to use them if <a target="_blank" href="https://github.com/dylanaraps/pywal">pywal</a> is not in use.</p>
1346+
<p style="margin: 1.5em 4em 0 4em; text-indent: -2.5em;"><strong>Note:</strong> If <a target="_blank" href="https://github.com/dylanaraps/pywal">pywal</a> themes are activated but not watched, the theme will be corrupted when the wallpaper changes, and will have to be manually reloaded. So, it’s better to just always watch these themes.</p>
13231347
<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>
13241348
<p>Being a console application, <strong>PyRadio</strong> was never intended to work with a mouse.</p>
13251349
<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>
@@ -1469,5 +1493,9 @@ <h2 id="acknowledgment">Acknowledgment <span style="padding-left: 10px;"><sup st
14691493
<li><a target="_blank" href="https://ranger.github.io/">ranger</a> - A console file manager with VI key bindings.</p></li>
14701494
<li><a target="_blank" href="https://vifm.info/">Vifm</a> - A file manager with curses interface, which provides a Vi[m]-like environment.</p></li>
14711495
</ol>
1496+
<h2 id="special-thanks">Special thanks <span style="padding-left: 10px;"><sup style="font-size: 50%"><a href="#" title="Go to top of the page">Top</a></sup></style></h2>
1497+
<ol type="1">
1498+
<li><strong>PyRadio</strong> user <a target="_blank" href="https://github.com/edunfelt">edunfelt</a>, for her wonderful work on <a href="%5Bedunfelt%5D(https://github.com/edunfelt)">base16</a> themes, and ideas regarding theming and such.</li>
1499+
</ol>
14721500
</body>
14731501
</html>

README.md

+38
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,10 @@ Ben Dowling - [https://github.com/coderholic](https://github.com/coderholic)
5252
* [Converting old themes](#converting-old-themes)
5353
* [Using transparency](#using-transparency)
5454
* [Updating themes automatically](#updating-themes-automatically)
55+
* [Using Project Themes](#using-project-themes)
56+
* [1. base16](#1.-base16)
57+
* [Using the themes without base16](#using-the-themes-without-base16)
58+
* [2. pywal](#2.-pywal)
5559
* [Mouse support](#mouse-support)
5660
* [Titles logging](#titles-logging)
5761
* [Tagging a title](#tagging-a-title)
@@ -66,6 +70,7 @@ Ben Dowling - [https://github.com/coderholic](https://github.com/coderholic)
6670
* [Packaging PyRadio](#packaging-pyradio)
6771
* [TODO](#todo)
6872
* [Acknowledgment](#acknowledgment)
73+
* [Special thanks](#special-thanks)
6974

7075
<!-- vim-markdown-toc -->
7176

@@ -860,6 +865,35 @@ Consecuently, the default theme name will be preceded by:
860865
- "**\***" if the theme is the default one (the way it has always been).
861866
- "**+**" if the theme is the default one, and **PyRadio** will watch it for changes.
862867

868+
### Using Project Themes
869+
870+
**PyRadio** is able to use (and watch) the output of certain projects that modify terminal colors.
871+
872+
**PyRadio** will detect theses projects (programs installed and initialized), and will add them under the "**Ext. Themes Projects**" section of the "*Themes Selection Window*."
873+
874+
If loading any of these themes fails, the default **dark** theme will be loaded, but contrary to a local theme being invalid, the selection will persist (so that the theme gets loaded wheneve it is available).
875+
876+
Currently, the following projects are supported:
877+
878+
#### 1. [base16](https://github.com/base16-project)
879+
880+
Thanks to the wonderful work by user [edunfelt](https://github.com/edunfelt), there is now a **PyRadio** base16 template in place, and themes have been produced based on the project (there are more than 900 themes available).
881+
882+
This implementation will add four entries in the theme selection menu (with alternative and variant forms of the main theme).
883+
884+
Then, any of the themes can either be activated or watched; in which case **PyRadio** will download and apply the corresponding theme.
885+
886+
##### Using the themes without base16
887+
888+
In case one wants to use any of these themes, but not install or use [base16](https://github.com/base16-project), one can get them [from this repo](https://github.com/edunfelt/base16-pyradio), and use the "*cycle_themes.py*" and "*install_themes.py*" scripts to inspect and install them.
889+
890+
#### 2. [pywal](https://github.com/dylanaraps/pywal)
891+
892+
When detected, two themes will be added to the menu; the main and the alternative form.
893+
894+
Since these themes are generated on the fly, as the wallpaper changes, there is no way to use them if [pywal](https://github.com/dylanaraps/pywal) is not in use.
895+
896+
**Note:** If [pywal](https://github.com/dylanaraps/pywal) themes are activated but not watched, the theme will be corrupted when the wallpaper changes, and will have to be manually reloaded. So, it's better to just always watch these themes.
863897

864898
## Mouse support
865899

@@ -1046,3 +1080,7 @@ Having said that, if you are not packaging for a specific distribution, please d
10461080
2. [ranger](https://ranger.github.io/) - A console file manager with VI key bindings.
10471081

10481082
3. [Vifm](https://vifm.info/) - A file manager with curses interface, which provides a Vi[m]-like environment.
1083+
1084+
## Special thanks
1085+
1086+
1. **PyRadio** user [edunfelt](https://github.com/edunfelt), for her wonderful work on [base16]([edunfelt](https://github.com/edunfelt)) themes, and ideas regarding theming and such.

pyradio/browser.py

+4-2
Original file line numberDiff line numberDiff line change
@@ -289,8 +289,10 @@ class RadioBrowser(PyRadioStationsBrowser):
289289

290290
browser_config = _config_win = None
291291

292-
_headers = {'User-Agent': 'PyRadio/dev',
293-
'Content-Type': 'application/json'}
292+
_headers = {
293+
'User-Agent': 'PyRadio/dev',
294+
'Content-Type': 'application/json'
295+
}
294296

295297
_raw_stations = []
296298

0 commit comments

Comments
 (0)