This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# | |
# This is sp, the command-line Spotify controller. It talks to a running | |
# instance of the Spotify Linux client over dbus, providing an interface not | |
# unlike mpc. | |
# | |
# Put differently, it allows you to control Spotify without leaving the comfort | |
# of your command line, and without a custom client or Premium subscription. | |
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Cocoa | |
class MediaApplication: NSApplication { | |
override func sendEvent(event: NSEvent) { | |
if (event.type == .SystemDefined && event.subtype.rawValue == 8) { | |
let keyCode = ((event.data1 & 0xFFFF0000) >> 16) | |
let keyFlags = (event.data1 & 0x0000FFFF) | |
// Get the key state. 0xA is KeyDown, OxB is KeyUp | |
let keyState = (((keyFlags & 0xFF00) >> 8)) == 0xA | |
let keyRepeat = (keyFlags & 0x1) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"""iTerm script to fetch and display Spotify's current playing song | |
in a status bar component. | |
""" | |
__author__ = "Phixyn (Alpeche Pancha)" | |
__version__ = "1.1.0" | |
import iterm2 |