Skip to content

Instantly share code, notes, and snippets.

View jaderfeijo's full-sized avatar

Jader Feijo jaderfeijo

View GitHub Profile
@jaderfeijo
jaderfeijo / README.md
Created September 21, 2026 06:23
Omarchy/Hyprland: raise the focused window when switching with SUPER+arrows

Omarchy: raise the focused window when switching with SUPER+arrows

On Omarchy, when windows are floating, moving focus with SUPER + ←/→/↑/↓ leaves the newly focused window behind the others. ALT + TAB doesn't have this problem, because Omarchy binds that key twice: once to cycle focus and once to raise the window (/usr/share/omarchy/default/hypr/bindings/tiling.lua):

o.bind("ALT + TAB", "Focus on next window", hl.dsp.window.cycle_next())
@jaderfeijo
jaderfeijo / README.md
Created September 21, 2026 06:13
Hyprland scrolling layout: let keyboard resize grow the last column (Omarchy)

Resize the last column in Hyprland's scrolling layout (Omarchy)

On a workspace using Hyprland's scrolling layout, the keyboard resize keys (SUPER + =, SUPER + ALT + =, SUPER + CTRL + = in Omarchy) cannot make the last window wider. You first have to open another window to its right.

This gist fixes that with a small script and a few keybinding overrides.

Tested on Omarchy 4.0.4 with Hyprland 0.56.2 (Lua config).

@jaderfeijo
jaderfeijo / 8250-lpss-pm.patch
Last active September 15, 2026 05:47
MacBook8,1 (12" 2015) on Linux 7.2: fix built-in keyboard/trackpad at boot and after sleep, trackpad lag and Bluetooth UART after sleep
--- a/drivers/tty/serial/8250/8250_lpss.c
+++ b/drivers/tty/serial/8250/8250_lpss.c
@@ -45,6 +45,10 @@
#define BYT_TX_OVF_INT 0x820
#define BYT_TX_OVF_INT_MASK BIT(1)
+#define BYT_PRV_RESETS 0x804
+#define BYT_PRV_RESETS_FUNC 0x3
+#define BYT_PRV_RESETS_IDMA BIT(2)
+
@jaderfeijo
jaderfeijo / macbook8-1-cs4208-speakers.md
Last active September 15, 2026 06:22
Omarchy / Arch on a MacBook8,1 (12-inch, Early 2015): silent internal speakers with CS4208 — chime un-mute + omnidecker/macbook8.1-speaker-driver, quiet chime via SystemAudioVolumeDB, plus everything that was tried and didn't work

Silent internal speakers on a MacBook8,1 (12-inch, Early 2015) under Linux — what works

Codec: Cirrus Logic CS4208 (codec SSID 106b:6400) · Verified on: MacBook8,1 running Omarchy (Arch Linux), kernel 7.2.3-arch1-3, PipeWire 1.6.8 + WirePlumber 0.5.17

Headphones work. Internal speakers are completely silent. PipeWire shows an active sink, speaker-test exits 0, the PCM is RUNNING — and nothing comes out.

MacBook9,1 / MacBook10,1 (2016–2017)? You want the other guide: Silent internal speakers on a 12-inch MacBook (MacBook9,1 / MacBook10,1).

@jaderfeijo
jaderfeijo / 00-README.md
Last active September 14, 2026 17:31
Bluetooth on the MacBook8,1 (12-inch, Early 2015) under Linux 7.2: serdev swap module, hci_bcm/btbcm patches, DKMS package, investigation notes

Bluetooth on the MacBook8,1 (12", Early 2015) under Linux 7.2

The MacBook8,1's Broadcom Bluetooth controller is attached to an Intel LPSS UART, not USB, and on a stock kernel it never appears: there is no hci0, bluetooth.service stays inactive and bluetoothctl reports No default controller available. This gist contains the investigation and a working fix: a small out-of-tree module plus two small patches to hci_bcm and btbcm, packaged with DKMS.

Tested on Arch Linux (Omarchy), kernel 7.2.3-arch1-3, BlueZ 5.87. After the fix the controller initialises (Broadcom, HCI 4.2, LMP subversion 0x6152, build 1288), is powered on by BlueZ, and LE scanning works.

TL;DR

Three separate problems stack up:

@jaderfeijo
jaderfeijo / macbook12-cs4208-silent-speakers.md
Last active September 14, 2026 18:38
Omarchy / Arch on a 12-inch MacBook (MacBook9,1 / MacBook10,1): silent internal speakers with CS4208 — the out-of-tree driver plus the EFI startup-chime NVRAM fix everyone misses (MacBook8,1: see the separate model-specific gist)

Silent internal speakers on a 12-inch MacBook (MacBook9,1 / MacBook10,1) under Linux

Codec: Cirrus Logic CS4208 · Verified on: MacBook10,1 (2017) running Omarchy (Arch Linux), kernel 7.2.3, PipeWire + WirePlumber 0.5.17

Headphones work. Internal speakers are completely silent. Every mixer looks fine, PipeWire shows an active sink, speaker-test exits 0 — and nothing comes out.

MacBook8,1 (12-inch, Early 2015)? This guide does not work on your model. The leifliddy driver below is built from a MacBook9,1 capture and stays silent on the 8,1 even with the chime un-muted. See the model-specific guide instead:

@jaderfeijo
jaderfeijo / README.md
Last active September 8, 2026 07:19
Ambient-light auto-brightness for T2 MacBooks on Linux - Touch Bar + display, no root required (userspace daemon using the IIO ALS + logind)

Ambient-light auto-brightness for T2 MacBooks (Touch Bar + display) on Linux

macOS adjusts the Touch Bar and display brightness from the ambient light sensor. Linux doesn't, but everything needed is already exposed — this is a ~250-line userspace daemon, no root, no udev rules, no kernel patches.

Tested on

@jaderfeijo
jaderfeijo / README.md
Created September 7, 2026 21:12
Fix thin/harsh MacBook Pro speaker sound on Arch/Omarchy (T2 Macs) - PipeWire speaker DSP, incl. MacBookPro15,3 support

Fixing thin, harsh MacBook Pro speaker sound on Arch / Omarchy (T2 Macs)

Out of the box on Linux, the speakers on a T2 MacBook sound thin and harsh next to macOS. It isn't your imagination and it isn't just EQ.

These machines have four drivers — two woofers and two tweeters — and Linux plays the same full-range signal into all of them. The tweeters get bass they physically cannot reproduce, the woofers get treble, and everything is louder and nastier than it should be. macOS instead runs a real DSP stack: an FIR crossover that sends each driver only its own band, psychoacoustic bass synthesis,

@jaderfeijo
jaderfeijo / README.md
Last active September 19, 2026 21:57
T2 MacBook Pro: power off the AMD dGPU under Linux (23W -> ~10W) with suspend/resume still working - two kernel patches (amdgpu switcheroo + PCI bridge-wait, the latter required on kernel 7.2), systemd unit and guide

Powering off the AMD dGPU on a T2 MacBook Pro under Linux — with working sleep

Result: idle draw 23 W → ~10 W, suspend/resume still working.

Update 2026-09-19 — kernel 7.2.x needs a second patch. The amdgpu patch alone is no longer enough: on 7.2 a real suspend hangs the machine hard. See Kernel 7.2: the second patch. 7.1.8 is unaffected.

Tested on

@jaderfeijo
jaderfeijo / ExampleTest.m
Created January 5, 2022 09:19 — forked from pk/ExampleTest.m
Using method swizzling and blocks to test Class methods in Objective-C.
#import "SenTestCase+MethodSwizzling.m"
@interface ExampleTest : SenTestCase {}
+ (BOOL)trueMethod;
+ (BOOL)falseMethod;
@end
@implementation ExampleTest
+ (BOOL)trueMethod { return YES; }