Skip to content

Instantly share code, notes, and snippets.

@thnikk
thnikk / volume.sh
Created June 2, 2020 23:20
Polybar volume script
#!/bin/bash
# Simple demo volume control script module for Polybar
# Get current volume
VOL="$(pamixer --get-volume)"
MUTE="$(pamixer --get-mute)"
# Desired width of module
WIDTH="10"
# Multiply volume by this value
SVM="$(( 100/$WIDTH ))"
@thnikk
thnikk / main.py
Created April 17, 2019 18:32
Final circuitpython keypad with minimal dependencies
# Import all necessary libraries
import board
import touchio
from digitalio import DigitalInOut, Direction, Pull
from adafruit_hid.keyboard import Keyboard
from adafruit_hid.keyboard_layout_us import KeyboardLayoutUS
# Change these values for what you want each key to print when pressed
keys_pressed = ["Button 1 ", "Button 2 ", "Button 3 "]
@thnikk
thnikk / main.py
Created April 10, 2019 17:14
Simplified CircuitPython code for new hot-swap keypad
# Import all necessary libraries
import board
import touchio
from digitalio import DigitalInOut, Direction, Pull
from adafruit_hid.keyboard import Keyboard
from adafruit_hid.keycode import Keycode
from adafruit_hid.keyboard_layout_us import KeyboardLayoutUS
import adafruit_dotstar as dotstar
#import time
import neopixel
@thnikk
thnikk / qemu-combined.patch
Created March 26, 2019 00:45
combined patch test
diff --git a/ui/input-linux.c b/ui/input-linux.c
index 9720333..abb4e04 100644
--- a/ui/input-linux.c
+++ b/ui/input-linux.c
@@ -335,12 +335,6 @@ static void input_linux_complete(UserCreatable *uc, Error **errp)
}
qemu_set_fd_handler(il->fd, input_linux_event, NULL, il);
- if (il->keycount) {
- /* delay grab until all keys are released */
@thnikk
thnikk / qemu-evdev-remap.patch
Created March 26, 2019 00:39
testing single key evdev switching
diff --git a/ui/input-linux.c b/ui/input-linux.c
index 9720333b2c..485b3bc9c6 100644
--- a/ui/input-linux.c
+++ b/ui/input-linux.c
@@ -16,6 +16,14 @@
#include <sys/ioctl.h>
#include "standard-headers/linux/input.h"
+#ifndef EVDEV_SWITCH_KEY_1
+#define EVDEV_SWITCH_KEY_1 KEY_CAPSLOCK
@thnikk
thnikk / qemu-dont-capture-on-start.patch
Created March 25, 2019 23:19
prevents evdev passthrough from being captured on guest startup
diff --git a/ui/input-linux.c b/ui/input-linux.c
index 9720333..abb4e04 100644
--- a/ui/input-linux.c
+++ b/ui/input-linux.c
@@ -335,12 +335,6 @@ static void input_linux_complete(UserCreatable *uc, Error **errp)
}
qemu_set_fd_handler(il->fd, input_linux_event, NULL, il);
- if (il->keycount) {
- /* delay grab until all keys are released */
tasks:
GJM:
rss: https://nyaa.si/?page=rss&u=GoodJobMedia
series:
- To Aru Majutsu no Index III:
set:
ratio: 0.01
path: "/mnt/media/Videos/Anime/Toaru Majitsu no Index/Season 03"
deluge: yes
<domain type='kvm' id='1' xmlns:qemu='http://libvirt.org/schemas/domain/qemu/1.0'>
<name>win10</name>
<uuid>47e3c094-275b-4bd6-97d4-6bb4a25e7b97</uuid>
<metadata>
<libosinfo:libosinfo xmlns:libosinfo="http://libosinfo.org/xmlns/libvirt/domain/1.0">
<libosinfo:os id="http://microsoft.com/win/10"/>
</libosinfo:libosinfo>
</metadata>
<memory unit='KiB'>16384000</memory>
<currentMemory unit='KiB'>16384000</currentMemory>
@thnikk
thnikk / autohotkey_guide.md
Created August 8, 2017 22:10
Quick and dirty guide to remap keys using autohotkey

Remapping keypad keys to volume keys

So you want volume control or any other oddball keys that aren't supported by Arduino? Fret not, my friend, for this short guide will help you get your keys (and any keys) remapped quickly.

Let's say we're using ctrl+pg up/pg down for volume up and volume down. The reason we want to use something weird here is because AutoHotKey will remap all keys, including th keyboard keys. That means if you tell c and v to remap to volume up and volume down, c and v will also be unusable on your keybaord. Though it sounds harder, it's a pretty simple process.

Remapping your keypad keys

Download Termite from my website here

/*****************************************************
New RGB keypad
Written to replace the old code to revert back
from RGBW to RGB LEDs. Gateron's transparent body
switches are no longer available so the revert
was required to go from 5050 to 3535 LEDs for
compatibility with Gateron SMD switches.
It also implements the new button remapper. Since
the side button has multiple functions on this