python

Spotify song in i3 status bar

Feb 20, 2020
linux, i3, python

While customizing my i3 status bar, I wanted to have currently played Spotify song in it. Some time ago, I created an open source script in Python called spotify-cli-linux and I wanted to use it. When we want to put something custom into the i3 status bar, the easiest way to do it, is to save data into the file and then read the file. I created the following config inside ~/. ...

Publishing Python package to PyPi

Apr 8, 2018
python

Introduction # I have my own tiny Python project called spotify-cli-linux, which is (surprise!) command line interface for Spotify desktop app on Linux. Python is not my primary programming language and I work more with Java. Nevertheless, I find this language enjoyable and useful in many cases, so I try to learn something new about it from time to time. In the beginning, I’ve provided instructions how to install my Python script in the system via curl and wget, which is fine, but it’s not recommended and official way to do it. ...

Control Spotify on Linux like a hacker

Mar 5, 2017
linux, python

Recently, I created a tiny script called spotify-cli, which allows you to control Spotify on Linux from terminal. It’s inspired by shpotify, which is a shell script doing similar things, but on macOS. My script is written in Python and uses dbus under the hood, which allows to communicate with bus daemon to pass messages between applications. I used pactl for controlling the system sound. You can install spotify-cli as follows via wget: ...

Automate boring stuff

Jan 1, 2017
git, python

Introduction # In my current company all the people who perform creative work (mostly programmers) need to prepare so-called PKUP report. PKUP stands for Podwy┼╝szone Koszty Uzyskania Przychodu in the Polish language. It’s legal regulation in Poland, which allows paying a lower income tax due to the particular type of work. For the regular employee, it means that he or she will simply get a bit higher salary per month. ...

3 questions about your Git repository

Dec 28, 2015
git, python

Introduction # Can you answer the following questions about your Git repository? Does development branch has all changes from master branch? Is your gitlog a crap? How old are your branches? If not, but you want to know answers, you’re lucky, because I prepared 3 simple scripts for you, which can help to find it out. Does development branch has all changes from master branch? # git-branch-comparator is a python script, which checks if development branch has all changes from master branch in Git repository. ...

Learning python

Sep 1, 2015
python

Some time ago, I’ve decided to learn Python programming language. I thought it may be useful during performing some basic tasks in the system and Linux or Windows scripting. Moreover, it’s good language for developing web applications with frameworks like Django, Flask or Bottle. I’ve decided to go through all of the tasks in the Learn Python - The Hard Way course. Basic tasks weren’t surprising. They were similar to other object oriented languages. ...

Checking consistency of git branches

May 14, 2015
git, python

Recently I’ve created a simple Python script, which checks whether ‘development’ branch has all changes from ‘master’ branch in a Git repository. It’s important when we work in a Git Flow. Branch inconsistency may occur when change with hot-fix will be committed to ‘master’ branch and we forget to merge ‘master’ branch back to ‘development’ branch to have our hot-fix in a ‘development’ version of the project as well. We should keep branch consistency to avoid merge conflicts and problems with release of the project in the future. ...

Android resource converter

Jan 17, 2015
android, python, open-source

In international projects sometimes there’s a need to send resource files to the client in order to have translated strings. Client doesn’t have to understand XML notation and editing two or more files at the same time is inconvenient. It’s easier to send file which can be edited in MS Excel or Libre Office Calc. I’ve created Python scripts, which are able to convert Android xml resources with translations to a single *. ...