Skip to content

Instantly share code, notes, and snippets.

View dansanderson's full-sized avatar

Dan Sanderson dansanderson

View GitHub Profile
@follower46
follower46 / pico-8-volume.py
Last active May 4, 2022 18:00
Adds volume control to PICO-8 on the gameshell
# you need to `sudo pip install pyxhook` as it's used to intercept the volume presses
# you will also want to update your launcher to call this script (I just have mine in the pico-8 directory
# and have my PICO-8.sh run:
# SDL_VIDEODRIVER=x11 DISPLAY=:0 python /home/cpi/pico-8/pico-8-volume.py
# video of what it looks like: https://www.youtube.com/watch?v=BAoYapdMiPM
import pygame
import os
import pyxhook
import alsaaudio