Skip to content

Instantly share code, notes, and snippets.

View gbishop's full-sized avatar

Gary Bishop gbishop

View GitHub Profile
@gbishop
gbishop / default.conf
Last active June 5, 2026 17:10
Make CapsLock be Escape with tapped and Control when held
[ids]
*
[main]
# Maps capslock to escape when pressed and control when held.
capslock = overload(control, esc)
@gbishop
gbishop / force_lid_suspend
Last active June 6, 2026 12:24
Make Gnome suspend when docked and the lid is closed
event=button/lid.*
action=/etc/acpi/force_lid_suspend.sh
@gbishop
gbishop / libinput-hack-for-keyd.md
Created June 3, 2026 20:26
Make disable-while-typing on my Debian 13.5 trackpad work with keyd
@gbishop
gbishop / fpreader.md
Created June 3, 2026 17:13
Lenovo Carbon X1 with Debian 13.5 fingerprint reader after suspend

Make the fingerprint reader work after suspend

I tried many different hacks suggested by various chatbots to no avail. I finally found https://mike.it-loops.com/item/32 and adapted it to my system. I used lsusb to learn the vendor id and port for the fingerprint reader.

Bus 003 Device 008: ID 06cb:00fc Synaptics, Inc. Prometheus Fingerprint Reader

Then I created this file /etc/udev/hwdb.d/61-autosuspend-fingerprint-reader.hwdb

usb:v06CBp00FC

@gbishop
gbishop / Nerd.md
Created December 23, 2023 19:14
Make Nerd fonts work with the Chromebook terminal

Make Nerd fonts work with the Chromebook terminal

Here is a too complicated hack to make Nerd fonts work on the Chromebook terminal. There should be an easier way. Please tell me if you find it.

First we need a CORS compliant web server to fetch the font. I didn't want to have to be online to use the terminal so I'm going to run the server locally. Fetch the server.py file (below) and save it to your linux environment. I put it in ~/hacks/nerdfont/server.py. This little script adds the CORS headers to the python3 http server. It will only serve files from the current folder.

In my ~/.bashrc I added these lines:

# make the nerdfont available to the chromebook terminal
@gbishop
gbishop / card_viewer.js
Created January 25, 2023 13:51
Hacked version of Harris's card_viewer
import { nextCard } from "./card_list.js";
import { previousCard } from "./card_list.js";
import { flipCard } from "./card_list.js";
// Variable that controls which side of the flashcard comes up first
//Default is Characters
var firstSide = "Characters";
const labels = [
"English", "Pinyin", "Characters"
@gbishop
gbishop / jsdoc.lua
Created November 22, 2022 12:52
Live jsdoc for luasnip - hacked from their demo
-- experiment with live jsdoc
local ls = require("luasnip")
local s = ls.snippet
local sn = ls.snippet_node
local t = ls.text_node
local i = ls.insert_node
local d = ls.dynamic_node
local r = ls.restore_node
local c = ls.choice_node
@gbishop
gbishop / libhack.js
Created September 15, 2022 17:54
A quick bookmarklet or "search engine" hack for jumping to the library proxy.
javascript:(function(){var lib=".libproxy.lib.unc.edu",url=https://${location.host.replaceAll(".","-")}${lib}${location.pathname}${location.search};location.href=url})();
@gbishop
gbishop / Bubble snippet
Created July 22, 2022 17:46
A hack to show how one might add bubbling to THR
// kill any saved interval to make dev easier
if (window.interval) clearInterval(window.interval);
// remember the current url
let url = null;
// Call our read function when the URL changes (there must be a better way)
function pollURL() {
if (document.location.href != url) {
url = document.location.href;
readIt();
}
@gbishop
gbishop / autosave-and-restore.markdown
Created January 3, 2019 18:31
Autosave and restore