Skip to content

Instantly share code, notes, and snippets.

View appsforartists's full-sized avatar

Brenton Simpson appsforartists

View GitHub Profile
@appsforartists
appsforartists / README.md
Last active January 22, 2024 07:25
Legion Go xpad patch, rebased on 6.1.52-valve15

GitHub insists on sending the whole git history if I try to push anything based on the Valve kernel (or even just based on an older Linux commit). It also rejects a push that exceeds 2GB.

Therefore, this is in a gist instead of a commit on my Linux fork.

@appsforartists
appsforartists / Linux for the Lenovo Legion Go.md
Last active February 27, 2024 09:56
Linux for the Lenovo Legion Go

I've been experimenting with running Linux (specifically NixOS) on the Legion Go. I intend to publish my configuration when it's in a good spot, but also thought it would be handy to have a shared space to document what we all learn in the mean time.

I'm admittedly new to both Linux and Nix, and appreciate any advice others can share too.

What's working

  • Touchscreen
  • Basic gamepad when both controllers are attached/detached
  • Rumble
  • Legion L+X to change perf modes
  • Sound + volume control
@appsforartists
appsforartists / controllers
Last active November 15, 2023 04:52
Legion Go, as seen by Linux
## both attached
$ ls /dev/input/by-path/
pci-0000:c2:00.3-usb-0:3:1.1-event-mouse pci-0000:c2:00.3-usb-0:3:1.3-mouse pci-0000:c2:00.3-usbv2-0:3:1.3-event-mouse platform-VPC2004:00-event
pci-0000:c2:00.3-usb-0:3:1.1-mouse pci-0000:c2:00.3-usbv2-0:3:1.1-event-mouse pci-0000:c2:00.3-usbv2-0:3:1.3-mouse
pci-0000:c2:00.3-usb-0:3:1.3-event-kbd pci-0000:c2:00.3-usbv2-0:3:1.1-mouse platform-AMDI0010:03-event
pci-0000:c2:00.3-usb-0:3:1.3-event-mouse pci-0000:c2:00.3-usbv2-0:3:1.3-event-kbd platform-i8042-serio-0-event-kbd
$ lsusb
@appsforartists
appsforartists / MyComponent.tsx
Last active July 19, 2018 20:16
Snippets showing how to use -webkit-canvas to make a paint worklet work in Safari
/** @license
* Copyright 2016 - 2017 Google LLC. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy
* of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
export type Constructor<T> = new(...args: any[]) => T;
export interface B {
fromB(): void;
}
export function withB<T extends Constructor<object>>(superclass: T): Constructor<B> {
return class B extends superclass {
fromB() {
@appsforartists
appsforartists / adk.js
Last active January 9, 2017 18:04
Testing Android Accessory Development Kit in JavaScript
/** @license
* Copyright 2016 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
{time: 0, note: 61, velocity: 97}
{time: 106, note: 61, velocity: 0}
{time: 150, note: 61, velocity: 102}
{time: 1408, note: 44, velocity: 85}
{time: 1410, note: 56, velocity: 81}
{time: 1412, note: 37, velocity: 79}
{time: 1414, note: 53, velocity: 105}
{time: 1504, note: 53, velocity: 0}
{time: 1506, note: 44, velocity: 0}
{time: 1520, note: 37, velocity: 0}
@appsforartists
appsforartists / App.ts
Created November 24, 2016 06:50
Attempting drag in Cycle.js
/** @license
* Copyright 2016 - present The Material Motion Authors. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy
* of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
function pointersStream = function(target) {
return Rx.Observable.from(
[
'pointerdown',
'pointermove',
'pointerup',
].map(
type => Rx.Observable.fromEvent(target, type)
)
).mergeAll().filter(
@appsforartists
appsforartists / TeleportableMotion.jsx
Created February 10, 2016 23:50
Sample usage for Motion.onRest
/* Copyright 2016 Google Inc.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.