Skip to content

Instantly share code, notes, and snippets.

Avatar

Diego Fernández Giraldo aiguofer

View GitHub Profile
@aiguofer
aiguofer / README.md
Last active Jun 18, 2020
Polybar module for Google Play Music Desktop Player
View README.md

I've been making an effort for a while to hit like on songs I like, mainly so I can always fail over to a playlist of liked songs. I generally use GPMDP as my main player and Polybar as my taskbar. I control my media player using playerctl and a while back I wrote songliker to set up a shortcut to like my songs. I decided to put it all together into a neat little polybar module and thought others might enjoy this.

I'm including the necessary files to do this yourself, although this might not work for you 'as-is' since I have a pretty customized systemd service management set up. Easiest way would be to just ignore the systemd stuff and just add an exec now_playing, but I'm including it here in case you want to use it and just modify that.

This will display the currently playing song in your bar in the following format {artist} - {song} | {liked?}. It uses Nerd Font symbols for a prefixing musical note and a thumbs up outline if not liked, or full if liked. It wi

@aiguofer
aiguofer / GPMDP Shortcuts.md
Last active Nov 6, 2017
Script to like a song in GPMDP (Google Play Music Desktop Player)
View GPMDP Shortcuts.md

Custom Global GPMDP Shortcuts

GPMDP is an awesome application to use Google Play on the desktop. The only problem with it is that the built in keyshortcuts are very limited by design. They only allow shortcuts with the Control key, but if you use Emacs this is very limiting.

Most media control keys can be configured using the built in media keys for your DE. The 2 shortcuts that I was missing are to like a song, and to raise the player (I generally have it closed to tray). After some digging around dbus and sockets, I managed to write a copule of simple python scripts to accomplish this:

song_liker.py:

@aiguofer
aiguofer / encrypeted_cert_session.py
Created Feb 13, 2017
Creating a Python requests session using a passphrase protected Client side Cert
View encrypeted_cert_session.py
import ssl
from requests.adapters import HTTPAdapter
CFG_FILE = '<path_to_cfg>'
secure_hosts = [
'https://<host>'
]
class SSLAdapter(HTTPAdapter):
def __init__(self, certfile, keyfile, password=None, *args, **kwargs):
@aiguofer
aiguofer / Width Change Doesnt Work.ipynb
Last active May 12, 2017
Width Change Doesnt Work
View Width Change Doesnt Work.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View Not Working.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View Bokeh.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@aiguofer
aiguofer / README.md
Last active May 26, 2020
Get info about running jupyter notebooks including memory consumption, how long they've been running, etc.
View README.md
@aiguofer
aiguofer / 81-thinkpad-dock.rules
Last active Jun 16, 2020
Automatic setup external monitors when docking ThinkPad T530 to ThinkPad Mini Dock
View 81-thinkpad-dock.rules
# Save this file (after modifying ID_VENDOR and ID_MODEL if necessary) as /etc/udev/rules.d/81-thinkpad-dock.rules
# These values seem to work for "ThinkPad Mini Dock Plus Series 3"
SUBSYSTEM=="usb", ACTION=="add", ENV{ID_VENDOR}=="17ef", ENV{ID_MODEL}=="100a", SYMLINK+="tp_mini_dock", TAG+="systemd"
You can’t perform that action at this time.