Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View acro5piano's full-sized avatar
🏠
Working from home

Kay Gosho acro5piano

🏠
Working from home
View GitHub Profile
@acro5piano
acro5piano / keychron_linux.md
Created April 24, 2023 22:48 — forked from andrebrait/keychron_linux.md
Keychron keyboards on Linux + Bluetooth fixes

Here is the best setup (I think so :D) for K-series Keychron keyboards on Linux.

Most of these commands have been tested on Ubuntu 20.04 and should also work on most Debian-based distributions. If a command happens not to work for you, take a look in the comment section.

Make Fn + F-keys work

Keychron Keyboards on Linux use the hid_apple driver (even in Windows/Android mode), both in Bluetooth and Wired modes. By default, this driver uses the F-keys as multimedia shortcuts and you have to press Fn + the key to get the usual F1 through F12 keys.

@acro5piano
acro5piano / gql2ts.sh
Last active August 10, 2018 07:28
Rudimentary graphql to typescript definition generator. Accepts a graphql schema file (not json, nor js) and converts it to typescript defs.
#!/usr/bin/env bash
cat "$1" \
| perl -pe 's/^(\s*)#/\1\/\//' \
| perl -pe 's/!//g' \
| perl -pe 's/^input /export interface /g' \
| perl -pe 's/^enum /export enum /g' \
| perl -pe 's/^type /export interface /g' \
| perl -pe 's/^union /export type /g'\
| perl -pe 's/^schema /export interface schema /g' \