<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Development Journey of Patryk Adamczyk]]></title><description><![CDATA[Hi! My name is Patryk. I trying to find good solutions for every problem on my way. I'm creator of PAiP Web. Open Team for every one wanting to make good soluti]]></description><link>https://blog.patrykadamczyk.net</link><generator>RSS for Node</generator><lastBuildDate>Sat, 18 Apr 2026 12:14:36 GMT</lastBuildDate><atom:link href="https://blog.patrykadamczyk.net/rss.xml" rel="self" type="application/rss+xml"/><language><![CDATA[en]]></language><ttl>60</ttl><item><title><![CDATA[Zen Browser: Getting back "New Tab Below" button on tabs]]></title><description><![CDATA[Context
In Zen Browser 1.15.1b they added folders. But in addition to that they removed “New Tab Below” button.
This kinda annoyed me because every time I wanted to use it I was making new folder (I use this button a lot). Looking through issues i fo...]]></description><link>https://blog.patrykadamczyk.net/zen-browser-getting-back-new-tab-below-button-on-tabs</link><guid isPermaLink="true">https://blog.patrykadamczyk.net/zen-browser-getting-back-new-tab-below-button-on-tabs</guid><category><![CDATA[zen-browser]]></category><category><![CDATA[zen-browser-linux]]></category><dc:creator><![CDATA[Patryk Adamczyk]]></dc:creator><pubDate>Thu, 28 Aug 2025 17:35:41 GMT</pubDate><content:encoded><![CDATA[<h1 id="heading-context">Context</h1>
<p>In <a target="_blank" href="https://zen-browser.app/release-notes/#1.15.1b">Zen Browser 1.15.1b</a> they added folders. But in addition to that they removed “New Tab Below” button.</p>
<p>This kinda annoyed me because every time I wanted to use it I was making new folder (I use this button a lot). Looking through issues i found <a target="_blank" href="https://github.com/zen-browser/desktop/issues/10054">Zen Browser/desktop#10054</a> with explanation (which I really disagree but whatever).</p>
<p>Being a dev I wanted to find a way to get it back because it was this annoying.</p>
<p>Things I considered:</p>
<ul>
<li><p>Soft forking Zen Browser just to removing this one line (<a target="_blank" href="https://github.com/zen-browser/desktop/blob/5e790efdceee4b14c44bb6efb7414270deaa3d4f/src/zen/common/ZenUIManager.mjs#L82-L86">Specifically these lines</a>)</p>
<ul>
<li>This sounded a bit extreme for me and like it needed a lot of time and space for building browser from source.</li>
</ul>
</li>
<li><p>Using extension like <a target="_blank" href="https://addons.mozilla.org/en-US/firefox/addon/new-tab-context/">this one</a></p>
<ul>
<li>This option was OK but moved button to bottom of context menu. It’s good fallback though if they ever will fully nuke this button and I would want to still use it.</li>
</ul>
</li>
<li><p>Using <code>userChrome.css</code></p>
<ul>
<li>This option I went with for now and will write how to do it</li>
</ul>
</li>
</ul>
<h1 id="heading-how-to-add-it-back-using-userchromecss">How to add it back using <code>userChrome.css</code></h1>
<ol>
<li><p>Make <code>userChrome.css</code> work</p>
<ul>
<li><p>For up to date guide from Zen Browser documentation go to <a target="_blank" href="https://docs.zen-browser.app/guides/live-editing">Live Editing Zen Theme Page</a></p>
</li>
<li><p>For current way and my notes</p>
<ol>
<li><p>First go to: <code>about:config</code> page and change option <code>toolkit.legacyUserProfileCustomizations.stylesheets</code> to true (by double clicking if its false)</p>
</li>
<li><p>If you want to make your own customizations too and have live editing option</p>
<ol>
<li><p>Open DevTools</p>
</li>
<li><p>Click Three Dots menu and Settings or click F1 in DevTools</p>
</li>
<li><p>In Advanced Settings enable: <code>Enable browser chrome and add-on debugging toolboxes</code> and <code>Enable remote debugging</code></p>
</li>
</ol>
</li>
<li><p>Go to: <code>about:support</code> and click Open Directory button in <code>Profile Directory</code> in <code>Application Basics</code> section</p>
<ol>
<li><p>Note if it doesn’t work and you use flatpak do below things instead:</p>
<ol>
<li><p>Open <code>~/.var/app/app.zen_browser.zen/.zen</code> folder using your File Manager</p>
</li>
<li><p>Using information in <code>about:support</code> in <code>Profile Directory</code> find a name of your profile (which last part of the path so for example if in <code>about:support</code> you have <code>/home/user/.zen/xxx00x00.Default (alpha)</code> as your path then name you need is <code>xxx00x00.Default (alpha)</code>)</p>
</li>
<li><p>Go to folder with name of your profile and continue next steps from here</p>
</li>
</ol>
</li>
</ol>
</li>
<li><p>Make <code>chrome</code> folder (if it doesn’t exist, it can exist normally if you use zen mods for example)</p>
</li>
<li><p>Make <code>userChrome.css</code> file</p>
</li>
</ol>
</li>
</ul>
</li>
<li><p>Now that you have <code>userChrome.css</code> file make it have these content:</p>
<pre><code class="lang-css"> <span class="hljs-keyword">@namespace</span> url(<span class="hljs-string">"http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"</span>);

 <span class="hljs-selector-id">#tabContextMenu</span> <span class="hljs-selector-id">#context_openANewTab</span><span class="hljs-selector-attr">[hidden=<span class="hljs-string">"true"</span>]</span> {
     <span class="hljs-attribute">display</span>: flex;
 }
</code></pre>
<ul>
<li><p>Notes</p>
<ul>
<li>I don’t know if first line is needed</li>
</ul>
</li>
</ul>
</li>
<li><p>Restart your browser and check your context menu on tabs. If everything went correctly you should see “New Tab Below” button again.</p>
</li>
</ol>
<h1 id="heading-additional-notes">Additional Notes</h1>
<ul>
<li>If someone want to make that as Zen Mod and publish it to Theme Store. You are free to do so. And would probably use that instead (if i will find one for that in future I will try to add it to this post).</li>
</ul>
<h2 id="heading-random-notes-for-settings">Random notes for settings</h2>
<ul>
<li>If you would want to have <code>CTRL+T</code> (new tab shortcut) to open new tab below your active tab always. (So something like new tab below button and changing URL) You can set <code>browser.tabs.insertAfterCurrent</code> in <code>about:config</code> to true.</li>
</ul>
]]></content:encoded></item><item><title><![CDATA[Update old release of Ubuntu after end of life to newer one]]></title><description><![CDATA[Problem
I recently wanted to update my Raspberry Pi 4B where i had Ubuntu 21.04 (which reached end of life) to Ubuntu 22.04. But I couldn't use apt update because it couldn't find repositories.
Solution

Make copy of /etc/apt/sources.list (for backup...]]></description><link>https://blog.patrykadamczyk.net/update-old-release-of-ubuntu-after-end-of-life-to-newer-one</link><guid isPermaLink="true">https://blog.patrykadamczyk.net/update-old-release-of-ubuntu-after-end-of-life-to-newer-one</guid><category><![CDATA[Ubuntu]]></category><category><![CDATA[Raspberry Pi]]></category><dc:creator><![CDATA[Patryk Adamczyk]]></dc:creator><pubDate>Tue, 02 Aug 2022 22:51:08 GMT</pubDate><content:encoded><![CDATA[<h2 id="heading-problem">Problem</h2>
<p>I recently wanted to update my Raspberry Pi 4B where i had Ubuntu 21.04 (which reached end of life) to Ubuntu 22.04. But I couldn't use <code>apt update</code> because it couldn't find repositories.</p>
<h2 id="heading-solution">Solution</h2>
<ol>
<li><p>Make copy of <code>/etc/apt/sources.list</code> (for backup)</p>
</li>
<li><p>Change every <code>http://ports.ubuntu.com/ubuntu-ports/</code>, <code>http://archive.ubuntu.com/ubuntu/</code> or similar repositories to <code>http://old-releases.ubuntu.com/ubuntu/</code></p>
</li>
<li><p>Save and <code>apt update</code></p>
</li>
</ol>
<h2 id="heading-sources">Sources</h2>
<p>I learned this from https://askubuntu.com/a/1131285</p>
]]></content:encoded></item><item><title><![CDATA[Gillar nuvarande låt på Spotify]]></title><description><![CDATA[Other Languages:

Jeżeli chcesz zobaczyć ten post po polsku to jest tutaj: Link
If you want to see this post in english then it's here: Link

Warning / Varning:

I'm learning swedish so if you find any mistakes then feel free to let me know in the co...]]></description><link>https://blog.patrykadamczyk.net/gillar-nuvarande-lat-pa-spotify</link><guid isPermaLink="true">https://blog.patrykadamczyk.net/gillar-nuvarande-lat-pa-spotify</guid><category><![CDATA[Python]]></category><category><![CDATA[Python 3]]></category><category><![CDATA[APIs]]></category><dc:creator><![CDATA[Patryk Adamczyk]]></dc:creator><pubDate>Sat, 28 May 2022 18:47:10 GMT</pubDate><content:encoded><![CDATA[<p><strong>Other Languages</strong>:</p>
<ul>
<li>Jeżeli chcesz zobaczyć ten post po polsku to jest tutaj: <a target="_blank" href="/polubienie-aktualnej-piosenki-na-spotify">Link</a></li>
<li>If you want to see this post in english then it's here: <a target="_blank" href="/like-current-song-on-spotify">Link</a></li>
</ul>
<p><strong>Warning</strong> / <strong>Varning</strong>:</p>
<ul>
<li>I'm learning swedish so if you find any mistakes then feel free to let me know in the comments.</li>
<li>Jag lära mig svenska så om du hittar några misstag får du gärna meddela mig i kommentererna.</li>
</ul>
<h2 id="heading-problemet">Problemet</h2>
<p>Spotify Client saknar en ibland viktig funktion för mig. Låt oss anta som du lyssnar på någon slumpmässig spellista du hittat eller Discover Weekly spellista på Spotify. Du lyssnar på den här spellistan och du gillar en låt. Sedan måste du genom UI klicka på hjärtat för att lägga till det i dina gillade låtar. Men om du just nu gör något och bara lyssnar på Spotify i bakgrunden är detta superirriterande.</p>
<h2 id="heading-losningen">Lösningen</h2>
<p>Den bästa lösningen skulle vara att lägga till den här funktionen till Spotify-klienten men funktionsförfrågningar som denna gick inte för långt: https://community.spotify.com/t5/Closed-Ideas/Desktop-Keyboard-shortcut-to-add-song-to-liked-songs/idi-p/4960129 . Så jag gjorde en tillfällig lösning genom Python-skriptet och i mitt exakta fall Razer Synapse. Men du kan göra din kortkommando på ett annat sätt.</p>
<h2 id="heading-skript">Skript</h2>
<p>Låt oss göra det här skript. Först måste vi göra Spotify API App genom <a target="_blank" href="https://developer.spotify.com/dashboard/applications">denna instrumentpanel</a>. I inställningarna för appen lägg till den här webbadressen till Redirect URIs sektion: <code>http://localhost:7777/callback</code>.
Från denna instrumentpanel behöver vi Client ID och Client Secret, du kan kopiera dem till ditt skript eftersom vi kommer att behöva dem snart.
Det är dags att skapa ett pythonskript. 
Låt oss börja med att installera kraven. Vi behöver ett paket för att göra det här skriptet som heter <code>spotipy</code>. Vi kan installera det genom <code>pip3 install spotipy</code>.
Därefter skapar vi en fil för vårt skript. Och nu börjar vi med att skriva importer.</p>
<pre><code class="lang-python"><span class="hljs-keyword">from</span> spotipy <span class="hljs-keyword">import</span> Spotify, SpotifyOAuth, SpotifyException
</code></pre>
<p>Först vi importerar Spotify API-klienten, sedan vi importerar Auktoriseringshanterare för API och sist vi importerar Exception för felhantering.
Nu måste vi deklarera några variabler.</p>
<pre><code class="lang-python">client_id = <span class="hljs-string">''</span>
client_secret = <span class="hljs-string">''</span>
redirect_uri = <span class="hljs-string">'http://localhost:7777/callback'</span>
scope = <span class="hljs-string">'user-library-modify,user-read-currently-playing'</span>
</code></pre>
<p>De första variablerna är för Spotify-appens Client ID och Client Secret. Används för att auktorisera API:et.
Därefter måste vi variabler för OAuth-auktorisering. Först vi har redirect_uri som vår Auktoriseringshanterare kommer att använda för att omdirigera OAuth-redirect och få token.
För det andra har vi omfattning för token. I det här skriptet använder vi <code>user-library-modify</code> för att säga att vi gillar en låt och <code>user-read-currently-playing</code> för att få reda på vilken låt vi lyssnar på.
Nu är det dags för logiken i skriptet.</p>
<pre><code class="lang-python">auth_manager = SpotifyOAuth(scope=scope, client_id=client_id, client_secret=client_secret, redirect_uri=redirect_uri)
</code></pre>
<p>Först vi behöver vår Auktoriseringshanterare.</p>
<pre><code class="lang-python">sc = Spotify(ouath_manager=auth_manager)
</code></pre>
<p>Därefter behöver vi vår API-klient.</p>
<pre><code class="lang-python">playing = sc.currently_playing()
<span class="hljs-keyword">if</span> <span class="hljs-string">"item"</span> <span class="hljs-keyword">not</span> <span class="hljs-keyword">in</span> playing <span class="hljs-keyword">or</span> <span class="hljs-string">"id"</span> <span class="hljs-keyword">not</span> <span class="hljs-keyword">in</span> playing[<span class="hljs-string">"item"</span>]:
    print(<span class="hljs-string">"Error: Currently not playing anything"</span>)
    exit(<span class="hljs-number">255</span>)
playing_id = playing[<span class="hljs-string">"item"</span>][<span class="hljs-string">"id"</span>]
</code></pre>
<p>Nu vi behöver id för den låt som spelas just nu.</p>
<pre><code class="lang-python"><span class="hljs-keyword">try</span>:
    r = sc.current_user_saved_tracks_add([playing_id])
    print(r)
<span class="hljs-keyword">except</span> SpotifyException <span class="hljs-keyword">as</span> e:
    print(<span class="hljs-string">"Error: Song not found or something else"</span>)
    print(e)
</code></pre>
<p>Nu vi försöker säga att vi gillar den här låten och ta ett undantag om den kommer att misslyckas.</p>
<p>Nu vi måste prova detta skript i praktiken. Lyssna bara på en slumpmässig låt som du inte gillar. Och kör skriptet. Om den efter några sekunder visas som gillad betyder det att det här skriptet fungerade.</p>
<h2 id="heading-min-installning-for-windows-med-razer-synapse">Min inställning för Windows med Razer Synapse</h2>
<p>Nu hur jag har gjort en genväg för det. Jag har gjort ytterligare 2 skript.
Första skriptet med namnet start.bat med detta innehåll:</p>
<pre><code class="lang-bat">@echo off
push $~dp0
python .\main.py
popd
exit 0
</code></pre>
<p>Och ett andra skript som heter start.vbs med följande innehåll:</p>
<pre><code class="lang-vbs">Set WshShell = CreateObject("WScript.Shell")
Dim oFSO : Set oFSO = CreateObject("Scripting.FileSystemObject")
Dim sScriptDir : sScriptDir = oFSO.GetParentFolderName(WScript.ScriptFullName)
WshShell.Run chr(34) &amp; sScriptDir &amp; "/start.bat" &amp; Chr(34), 0
Set WshShell = Nothing
</code></pre>
<p>Det första skriptet är bara för att köra python-skriptet. Om du har namngett det på ett annat sätt ändrar du namnet i det här skriptet.
Det andra skriptet är att köra filen start.bat utan kommandotolkfönster alls. Du kommer alltså inte att skapa fönster för att gilla sången och få fokus från det aktiva fönstret.</p>
<p>I Razer Synapse lade jag till Launch Program selected start.vbs för HyperShift + L på tangentbordet.</p>
<p>Jag hoppas att det här skriptet kan hjälpa dig.</p>
<h2 id="heading-fullstandiga-skript">Fullständiga skript</h2>
<h3 id="heading-mainpy"><code>main.py</code></h3>
<pre><code class="lang-python"><span class="hljs-keyword">from</span> spotipy <span class="hljs-keyword">import</span> Spotify, SpotifyOAuth, SpotifyException

client_id = <span class="hljs-string">''</span>
client_secret = <span class="hljs-string">''</span>
redirect_uri = <span class="hljs-string">'http://localhost:7777/callback'</span>
scope = <span class="hljs-string">'user-library-modify,user-read-currently-playing'</span>

auth_manager = SpotifyOAuth(scope=scope, client_id=client_id, client_secret=client_secret, redirect_uri=redirect_uri)
sc = Spotify(oauth_manager=auth_manager)
playing = sc.currently_playing()
<span class="hljs-keyword">if</span> <span class="hljs-string">"item"</span> <span class="hljs-keyword">not</span> <span class="hljs-keyword">in</span> playing <span class="hljs-keyword">or</span> <span class="hljs-string">"id"</span> <span class="hljs-keyword">not</span> <span class="hljs-keyword">in</span> playing[<span class="hljs-string">"item"</span>]:
    print(<span class="hljs-string">"Error: Currently not playing anything"</span>)
    exit(<span class="hljs-number">255</span>)
playing_id = playing[<span class="hljs-string">"item"</span>][<span class="hljs-string">"id"</span>]
<span class="hljs-keyword">try</span>:
    r = sc.current_user_saved_tracks_add([playing_id])
    print(r)
<span class="hljs-keyword">except</span> SpotifyException <span class="hljs-keyword">as</span> e:
    print(<span class="hljs-string">"Error: Song not found or something else"</span>)
    print(e)
</code></pre>
<h3 id="heading-startbat"><code>start.bat</code></h3>
<pre><code class="lang-bat">@echo off
pushd %~dp0
python .\main.py
popd
exit 0
</code></pre>
<h3 id="heading-startvbs"><code>start.vbs</code></h3>
<pre><code class="lang-vbs">Set WshShell = CreateObject("WScript.Shell") 
Dim oFSO : Set oFSO = CreateObject("Scripting.FileSystemObject")
Dim sScriptDir : sScriptDir = oFSO.GetParentFolderName(WScript.ScriptFullName)
WshShell.Run chr(34) &amp; sScriptDir &amp; "/start.bat" &amp; Chr(34), 0
Set WshShell = Nothing
</code></pre>
]]></content:encoded></item><item><title><![CDATA[Like current song on Spotify]]></title><description><![CDATA[Other Languages:

Jeżeli chcesz zobaczyć ten post po polsku to jest tutaj: Link
Om du vill se detta inlägg på svenska gå in här: Länk

The Problem
Spotify Client lacks one sometimes important feature for me. Let's say you listening to some random pla...]]></description><link>https://blog.patrykadamczyk.net/like-current-song-on-spotify</link><guid isPermaLink="true">https://blog.patrykadamczyk.net/like-current-song-on-spotify</guid><category><![CDATA[Python]]></category><category><![CDATA[Python 3]]></category><category><![CDATA[APIs]]></category><dc:creator><![CDATA[Patryk Adamczyk]]></dc:creator><pubDate>Sat, 28 May 2022 18:46:59 GMT</pubDate><content:encoded><![CDATA[<p><strong>Other Languages</strong>:</p>
<ul>
<li>Jeżeli chcesz zobaczyć ten post po polsku to jest tutaj: <a target="_blank" href="/polubienie-aktualnej-piosenki-na-spotify">Link</a></li>
<li>Om du vill se detta inlägg på svenska gå in här: <a target="_blank" href="/gillar-nuvarande-lat-pa-spotify">Länk</a></li>
</ul>
<h2 id="heading-the-problem">The Problem</h2>
<p>Spotify Client lacks one sometimes important feature for me. Let's say you listening to some random playlist you found or weekly discovery playlist of Spotify. You listening along and you like some song. Then you have to through UI click heart to add it to your liked songs. But if you currently doing something and just listening to Spotify in background this is super annoying.</p>
<h2 id="heading-the-solution">The Solution</h2>
<p>The best solution would be to add this feature to Spotify Client but feature requests like this: https://community.spotify.com/t5/Closed-Ideas/Desktop-Keyboard-shortcut-to-add-song-to-liked-songs/idi-p/4960129 don't go too far. So I made temporary solution through Python script and in my exact case Razer Synapse. But you could make your keyboard shortcut another way.</p>
<h2 id="heading-script">Script</h2>
<p>Let's make this script. Firstly we need to make Spotify API App through <a target="_blank" href="https://developer.spotify.com/dashboard/applications">this dashboard</a>. In settings of App add this url to Redirect URIs section: <code>http://localhost:7777/callback</code>. From this dashboard we need Client ID and Client Secret you can copy that to your script because we will need it soon.
Ok time to create python script. 
Let's start from installing requirements. We need one package to make this script called <code>spotipy</code>. We can install it through <code>pip3 install spotipy</code>.
After that we create file for our script. And now let's start with writing imports.</p>
<pre><code class="lang-python"><span class="hljs-keyword">from</span> spotipy <span class="hljs-keyword">import</span> Spotify, SpotifyOAuth, SpotifyException
</code></pre>
<p>First we importing Spotify API Client, Secondly we are importing Authentication Manager for API and at the end we are importing Exception for error handling.
Now we need to declare few variables.</p>
<pre><code class="lang-python">client_id = <span class="hljs-string">''</span>
client_secret = <span class="hljs-string">''</span>
redirect_uri = <span class="hljs-string">'http://localhost:7777/callback'</span>
scope = <span class="hljs-string">'user-library-modify,user-read-currently-playing'</span>
</code></pre>
<p>First variables is for our Spotify App Client ID and Client Secret. For use to authorize with API.
Afterwards we have to variables for OAuth authorization. Firstly we have redirect_uri which our Authorization Manager will use to redirect OAuth redirect and get token.
Secondly we have scope for token. In this script we use <code>user-library-modify</code> to add like for song and <code>user-read-currently-playing</code> to get what is current song we are listening to.
Now it's time for logic of this script.</p>
<pre><code class="lang-python">auth_manager = SpotifyOAuth(scope=scope, client_id=client_id, client_secret=client_secret, redirect_uri=redirect_uri)
</code></pre>
<p>Firstly we need our authentication manager.</p>
<pre><code class="lang-python">sc = Spotify(ouath_manager=auth_manager)
</code></pre>
<p>Afterwards we need our API client.</p>
<pre><code class="lang-python">playing = sc.currently_playing()
<span class="hljs-keyword">if</span> <span class="hljs-string">"item"</span> <span class="hljs-keyword">not</span> <span class="hljs-keyword">in</span> playing <span class="hljs-keyword">or</span> <span class="hljs-string">"id"</span> <span class="hljs-keyword">not</span> <span class="hljs-keyword">in</span> playing[<span class="hljs-string">"item"</span>]:
    print(<span class="hljs-string">"Error: Currently not playing anything"</span>)
    exit(<span class="hljs-number">255</span>)
playing_id = playing[<span class="hljs-string">"item"</span>][<span class="hljs-string">"id"</span>]
</code></pre>
<p>Now we need id of song which is currently playing.</p>
<pre><code class="lang-python"><span class="hljs-keyword">try</span>:
    r = sc.current_user_saved_tracks_add([playing_id])
    print(r)
<span class="hljs-keyword">except</span> SpotifyException <span class="hljs-keyword">as</span> e:
    print(<span class="hljs-string">"Error: Song not found or something else"</span>)
    print(e)
</code></pre>
<p>Now we are trying to add song to liked and catch exception if it will fail.</p>
<p>Now we need to try this script in practice. Just listen to random song you don't have as liked. And run script. If it's after few seconds be shown as liked that means that this script worked.</p>
<h2 id="heading-my-setup-for-windows-with-razer-synapse">My Setup for Windows with Razer Synapse</h2>
<p>Now how I made shortcut for it. I made 2 additional scripts.
First named start.bat with that content:</p>
<pre><code class="lang-bat">@echo off
push $~dp0
python .\main.py
popd
exit 0
</code></pre>
<p>And second named start.vbs with this content:</p>
<pre><code class="lang-vbs">Set WshShell = CreateObject("WScript.Shell")
Dim oFSO : Set oFSO = CreateObject("Scripting.FileSystemObject")
Dim sScriptDir : sScriptDir = oFSO.GetParentFolderName(WScript.ScriptFullName)
WshShell.Run chr(34) &amp; sScriptDir &amp; "/start.bat" &amp; Chr(34), 0
Set WshShell = Nothing
</code></pre>
<p>First script is just to run python script. If you named it differently then change name in this script.
Second script is to run start.bat file without command prompt window at all. So you will not spawn windows for liking song and getting focused out of active window.</p>
<p>Now in Razer Synapse i added Launch Program selected start.vbs for HyperShift + L on my keyboard.</p>
<p>I hope this script will help you.</p>
<h2 id="heading-full-scripts">Full Scripts</h2>
<h3 id="heading-mainpy"><code>main.py</code></h3>
<pre><code class="lang-python"><span class="hljs-keyword">from</span> spotipy <span class="hljs-keyword">import</span> Spotify, SpotifyOAuth, SpotifyException

client_id = <span class="hljs-string">''</span>
client_secret = <span class="hljs-string">''</span>
redirect_uri = <span class="hljs-string">'http://localhost:7777/callback'</span>
scope = <span class="hljs-string">'user-library-modify,user-read-currently-playing'</span>

auth_manager = SpotifyOAuth(scope=scope, client_id=client_id, client_secret=client_secret, redirect_uri=redirect_uri)
sc = Spotify(oauth_manager=auth_manager)
playing = sc.currently_playing()
<span class="hljs-keyword">if</span> <span class="hljs-string">"item"</span> <span class="hljs-keyword">not</span> <span class="hljs-keyword">in</span> playing <span class="hljs-keyword">or</span> <span class="hljs-string">"id"</span> <span class="hljs-keyword">not</span> <span class="hljs-keyword">in</span> playing[<span class="hljs-string">"item"</span>]:
    print(<span class="hljs-string">"Error: Currently not playing anything"</span>)
    exit(<span class="hljs-number">255</span>)
playing_id = playing[<span class="hljs-string">"item"</span>][<span class="hljs-string">"id"</span>]
<span class="hljs-keyword">try</span>:
    r = sc.current_user_saved_tracks_add([playing_id])
    print(r)
<span class="hljs-keyword">except</span> SpotifyException <span class="hljs-keyword">as</span> e:
    print(<span class="hljs-string">"Error: Song not found or something else"</span>)
    print(e)
</code></pre>
<h3 id="heading-startbat"><code>start.bat</code></h3>
<pre><code class="lang-bat">@echo off
pushd %~dp0
python .\main.py
popd
exit 0
</code></pre>
<h3 id="heading-startvbs"><code>start.vbs</code></h3>
<pre><code class="lang-vbs">Set WshShell = CreateObject("WScript.Shell") 
Dim oFSO : Set oFSO = CreateObject("Scripting.FileSystemObject")
Dim sScriptDir : sScriptDir = oFSO.GetParentFolderName(WScript.ScriptFullName)
WshShell.Run chr(34) &amp; sScriptDir &amp; "/start.bat" &amp; Chr(34), 0
Set WshShell = Nothing
</code></pre>
]]></content:encoded></item><item><title><![CDATA[Moja Opinia na temat LMF 2020 (PL)]]></title><description><![CDATA[Light Move Festival 2020
W opinii biorę pod uwagę tylko dzień 1 oraz bloki wieczorne dnia 2 i 3.
Linki do LMF 2020

Kanał Festiwalu na YT
Strona Festiwalu na FB
Program LMF 2020

Live

Dzień 1
Dzień 2 - Blok poranny
Dzień 2 - Blok wieczorny
Dzień 3 -...]]></description><link>https://blog.patrykadamczyk.net/moja-opinia-na-temat-lmf-2020-pl</link><guid isPermaLink="true">https://blog.patrykadamczyk.net/moja-opinia-na-temat-lmf-2020-pl</guid><dc:creator><![CDATA[Patryk Adamczyk]]></dc:creator><pubDate>Mon, 28 Sep 2020 00:38:13 GMT</pubDate><content:encoded><![CDATA[<h1 id="light-move-festival-2020">Light Move Festival 2020</h1>
<p>W opinii biorę pod uwagę tylko dzień 1 oraz bloki wieczorne dnia 2 i 3.</p>
<h2 id="linki-do-lmf-2020">Linki do LMF 2020</h2>
<ul>
<li><a target="_blank" href="https://www.youtube.com/user/LightMoveFestival">Kanał Festiwalu na YT</a></li>
<li><a target="_blank" href="https://www.facebook.com/LightMoveFestival">Strona Festiwalu na FB</a></li>
<li><a target="_blank" href="https://lmf.com.pl/wizard/content/uploads/ee947d98b91c8ada08f8c15e8f3248fc/check_out_the_programme_258872513.pdf">Program LMF 2020</a></li>
</ul>
<h3 id="live">Live</h3>
<ul>
<li><a target="_blank" href="https://www.youtube.com/watch?v=XA7yyJ9UXv4">Dzień 1</a></li>
<li><a target="_blank" href="https://www.youtube.com/watch?v=P8_An7SW9SI">Dzień 2 - Blok poranny</a></li>
<li><a target="_blank" href="https://www.youtube.com/watch?v=DEYQi8nl6qM">Dzień 2 - Blok wieczorny</a></li>
<li><a target="_blank" href="https://www.youtube.com/watch?v=CKRLCUXDi28">Dzień 3 - Blok poranny</a></li>
<li><a target="_blank" href="https://www.youtube.com/watch?v=mkI8BQLJimA">Dzień 3 - Blok wieczorny</a></li>
</ul>
<h3 id="szczegolowe-wideo-dzien-1">Szczegółowe wideo - Dzień 1</h3>
<ul>
<li><a target="_blank" href="https://www.youtube.com/watch?v=-fTfrZEbfY8">Animacja Otwarcia Light Move Festival 2020</a></li>
<li><a target="_blank" href="https://www.youtube.com/watch?v=S9qQm90Y_eg">Light Move Festival 360</a></li>
<li><a target="_blank" href="https://www.youtube.com/watch?v=_F9JatjuUS0">Odszarzanie - Performance - Aleksandra Ignasiak Light Move Festival 2020</a></li>
<li><a target="_blank" href="https://www.youtube.com/watch?v=usZE0bia85A">Liga Mistrzów LMF</a></li>
<li><a target="_blank" href="https://www.youtube.com/watch?v=6yu-CffVJGY">Światło Przyszłości</a></li>
</ul>
<h3 id="szczegolowe-wideo-dzien-2">Szczegółowe wideo - Dzień 2</h3>
<h4 id="blok-poranny">Blok Poranny</h4>
<ul>
<li><a target="_blank" href="https://www.youtube.com/watch?v=MzxWtQfGgAo">Warsztaty - Sekrety Zabytków</a></li>
<li><a target="_blank" href="https://www.youtube.com/watch?v=YIslHk26_Lo">Warsztaty - Światło w Architekturze</a></li>
<li><a target="_blank" href="https://www.youtube.com/watch?v=xl4ZZNQvbv8">Warsztaty - Światełko w Tunelu</a></li>
</ul>
<h4 id="blok-wieczorny">Blok Wieczorny</h4>
<ul>
<li><a target="_blank" href="https://www.youtube.com/watch?v=6yu-CffVJGY">Światło Przyszłości</a></li>
<li><a target="_blank" href="https://www.youtube.com/watch?v=-Dv9dquVtu0">Light For Unity</a></li>
<li><a target="_blank" href="https://www.youtube.com/watch?v=usZE0bia85A">Liga Mistrzów LMF</a></li>
<li><a target="_blank" href="https://www.youtube.com/watch?v=YgQ_H8nrjcM">Fraktalna Serafina - M. Dolata, I. Borys, K. Wasylowski</a><ul>
<li><a target="_blank" href="https://soundcloud.com/user-749317978/1-for-mother-devi-1">Muzyka z Fraktalna Serafina (Jakby ktoś szukał)</a></li>
</ul>
</li>
</ul>
<h3 id="szczegolowe-wideo-dzien-3">Szczegółowe wideo - Dzień 3</h3>
<h4 id="blok-poranny">Blok Poranny</h4>
<ul>
<li><a target="_blank" href="https://www.youtube.com/watch?v=0ioa6GuyEwQ">Warsztaty - Tajniki Kolorów</a></li>
<li><a target="_blank" href="https://www.youtube.com/watch?v=CLpFLeVDsBc">Warsztaty - Teatr Świateł</a></li>
</ul>
<h4 id="blok-wieczorny">Blok Wieczorny</h4>
<ul>
<li><a target="_blank" href="https://www.youtube.com/watch?v=6yu-CffVJGY">Światło Przyszłości</a></li>
<li><a target="_blank" href="https://www.youtube.com/watch?v=jiXVRvOeJz4">Luminous - Connecting Arts &amp; Theatre Dance Company</a></li>
</ul>
<h2 id="moja-opinia-na-temat-lmf-2020">Moja Opinia na temat LMF 2020</h2>
<h3 id="opinia-wg-dni">Opinia wg Dni</h3>
<h4 id="dzien-1">Dzień 1</h4>
<p>Zaczynając od pierwszego dnia możemy zauważyć że to nie będzie typowy LMF. Projekt Światło Przyszłości jest dosyć ciekawym pomysłem który moim zdaniem bardzo pasuje jako przypomnienie poprzednich LMF jak i dawanie nadzieji na następne wspaniałe LMF. Następną ważną częścią był <strong>Light Move Festival 360</strong> który jest genialnym pomysłem połączenia wielu instalacji i mappingów w ciekawy film 360º który jest pełny ciekawych pomysłów i ciekawy doświadczeń. Następnie mamy koncert który pominę ponieważ nie mam nic ciekawego do powiedzienia poza tym, że to po prostu nie mój styl muzyki. Następnie możemy zobaczyć performance Odszarzanie który jest dosyć ciekawy który można zinterpretować w ten sposób że nie ważne co się stanie nadzieja zawsze zostanie. Kończąc dzień 1 widzimy Ligę Mistrzów LMF czyli kompilację mappingów z poprzednich lat z ankietą który nam się najbardziej podobał. Moim zdaniem jest to dosyć ciekawy pomysł dający miłą interakcję z innymi ludźmi oraz też możliwość zobaczenia co przez tyle lat się najbardziej podobało w LMF. To podsumowuje dzień 1.</p>
<h4 id="dzien-2">Dzień 2</h4>
<p>Dzień 2 zaczynamy dalszą częścią Światła Przyszłości. Przechodząc do Light For Unity wygląda na bardzo ciekawy projekt animacji który podobał mi się przechodząc dalej do powtórki Ligi Mistrzów LMF z końca dnia 1. Potem przechodząc do Fraktalnej Serafina która jest bardzo ciekawy filmem który bardzo mi się spodobał przez bardzo ciekawy dobór muzyki i samego stylu filmu.
Komentarz samego autora też brzmi ciekawie:</p>
<pre><code>Postać „Fraktalnej Serafiny” jest próbą odbicia boskiego pierwiastka w człowieku.
Czy świat duchów z Nami współgra? Jak budząca się świadomość człowieka odbiera istoty astralne?
Czy człowiek w ogóle w nie wierzy?
</code></pre><p>(Źródło: https://www.facebook.com/LightMoveFestival/videos/334774141301792 Timestamp komentarza: <code>44:56</code> oraz opis filmu na <a target="_blank" href="https://www.youtube.com/watch?v=YgQ_H8nrjcM">YT</a>)
 Przechodząc dalej mamy DJ HAMER który dał nam spoko muzykę i w tym czasie przejścia żeby pokazać Światła Przyszłości które wyglądało przez podkłąd muzyczny jeszcze lepiej wyglądający. Blisko końca transmisji pokazała się naprawdę fajny lot dronem nad Łodzią pokazujący jak Światło Przyszłości rozświetla Łódź. W ten sposób kończymy dzień 2.</p>
<h4 id="dzien-3">Dzień 3</h4>
<p>Dzień 3 zaczynamy pokazaniem Światła Przyszłości przechodząc potem do pokazania wszystkich projektów z poprzednich dni LMF 2020 oraz bardzo fajnej animacji. Następnie przechodzimy do "Luminous - Connecting Arts &amp; Theatre Dance Company" który wygladał OK. Następnie mamy Finał Ligi Mistrzów Gdzie było dosyć równo ale jednak Symfonia Koloru wygrała z Ostatnim Smokiem. Dalej mamy więcej pokazywania projektów które już widzieliśmy w LMF 2020. Koncząc dzień 3 widzimy zakończenie całego festiwalu.</p>
<h4 id="dodatki-do-lmf">Dodatki do LMF</h4>
<p>Najciekawszym dodatkiem do całości LMF jest <a target="_blank" href="https://lmf.com.pl/page/57">Galeria LMF</a>. Jest to dosyć ciekawy pomysł i jest bardzo ciekawie wykonany. Fakt faktem milej by było zobaczyć trochę więcej i zobaczyć galerię mappingów ale aktualne wykonanie też jest bardzo ciekawe.</p>
<h3 id="pelna-opinia">Pełna Opinia</h3>
<p>Moim zdaniem LMF 2020 dostaje bardzo zmieszany feedback głównie dlatego że Festiwale z poprzednich lat były kompletnie inne i imponujące mapingami, instalacjami i ilością różnych innych elementów wokoło nich. Z drugiej strony to także okrągły 10 festiwal i ludzie mogli też mieć wielkie nadzieje na imponujące przypomnienie poprzednich lat i nowe imponujące części. Za to dostaliśmy bardzo dobry festiwal który zdecydowanie próbuje dać jak największe wrażenie w formie Streamów na YT i FB. Odnoszę także wrażenie że ta forma też mogła przeszkodzić dotrzeć Festiwalowi do szerszej grupy odbiorców biorąc pod uwagę jak obie platformy działają. Jest też to pierwszy festiwal online przez co po drodze mogłobyć parę elementów które nie były perfekcyjne co jest zrozumiałe. Jako pierwszy Light Move Festival Online wydaje mi się być bardzo dobrym festiwalem. Wydaje mi się też że w przyszłości jakby była znowu potrzeba to następny LMF Online będzie jeszcze lepszy. Mam nadzieję że widzimy się wszyscy na następnym Light Move Festival w roku 2021.</p>
]]></content:encoded></item><item><title><![CDATA[Hello World]]></title><description><![CDATA[Hello World! I'm Patryk Adamczyk. I'm programmer from Poland. I like photography (which you can check on my Instagram), writing stories from time to time and programming. Here I will share my hobbies and passions.]]></description><link>https://blog.patrykadamczyk.net/hello-world</link><guid isPermaLink="true">https://blog.patrykadamczyk.net/hello-world</guid><dc:creator><![CDATA[Patryk Adamczyk]]></dc:creator><pubDate>Wed, 01 Jan 2020 04:55:05 GMT</pubDate><content:encoded><![CDATA[<p>Hello World! I&#39;m Patryk Adamczyk. I&#39;m programmer from Poland. I like photography (which you can check on my <a target='_blank' rel='noopener noreferrer'  href="https://www.instagram.com/patrykastrokiler/">Instagram</a>), writing stories from time to time and programming. Here I will share my hobbies and passions.</p>
]]></content:encoded></item></channel></rss>