I hereby claim:
- I am t184256 on github.
- I am t184256 (https://keybase.io/t184256) on keybase.
- I have a public key ASDQi-vDQ2z-Rt6xOXMHcEv7rMUY5j-cq9FMEBhpY42dAwo
To claim this, I am signing this object:
| #!/usr/bin/python3 | |
| # CC0, originally written by t184256. | |
| # This is an example Python program for Linux that remaps a keyboard. | |
| # The events (key presses releases and repeats), are captured with evdev, | |
| # and then injected back with uinput. | |
| # This approach should work in X, Wayland, anywhere! |
| #!/usr/bin/python3 | |
| # Sorry everyone, it's a real mess. | |
| import atexit | |
| import inspect | |
| import evdev | |
| import evdev.ecodes as ec |
| HARDWARE = r''' | |
| ESC F1 F2 F3 F4 F5 F6 F7 F8 F9 F10 F11 F12 | |
| ` 1 2 3 4 5 6 7 8 9 0 - = YEN BS | |
| TAB Q W E R T Y U I O P [ ] | |
| C_LOCK A S D F G H J K L ; ' \ RET | |
| LSHIFT Z X C V B N M , . / RO RSHIFT | |
| LCTRL FN WIN ALT XX1 SPACE XX2 XX3 RA CP RCTRL BACK | |
| ''' | |
| COLEMAK = r''' |
| monk@cola$ cpupower frequency-info ~ | |
| analyzing CPU 0: | |
| driver: intel_pstate | |
| CPUs which run at the same hardware frequency: 0 | |
| CPUs which need to have their frequency coordinated by software: 0 | |
| maximum transition latency: Cannot determine or is not supported. | |
| hardware limits: 800 MHz - 3.50 GHz | |
| available cpufreq governors: performance powersave | |
| current policy: frequency should be within 800 MHz and 3.50 GHz. | |
| The governor "powersave" may decide which speed to use |
| import os | |
| import atexit | |
| import uinput | |
| import evdev | |
| #os.system('sudo modprobe uinput') | |
| MAPPING = { |
I hereby claim:
To claim this, I am signing this object:
| #!/usr/bin/python | |
| # Given the resolution and diagonal, calculate the mm size of the screen and the ppi | |
| import sys, math | |
| MM_IN_INCH = 25.4 | |
| def size_and_ppi_from_resolution_and_diagonal(x, y, d): # pix, pix, mm | |
| x, y, d = float(x), float(y), float(d) |
| # | |
| # CRC-32 forcer | |
| # | |
| # Copyright (c) 2014 Project Nayuki | |
| # All rights reserved. Contact Nayuki for licensing. | |
| # http://www.nayuki.io/page/forcing-a-files-crc-to-any-value | |
| # | |
| import os, sys, zlib |
| #!/usr/bin/python | |
| a = 'sooner' | |
| def parent_func(): | |
| print a | |
| # Guess what uncommenting the line below would change? | |
| #a = 'parent' | |
| return a |