Skip to content

Instantly share code, notes, and snippets.

@spidernik84
Last active November 29, 2025 11:20
Show Gist options
  • Select an option

  • Save spidernik84/f6e0eefb5c981f5036934b822ee9f47f to your computer and use it in GitHub Desktop.

Select an option

Save spidernik84/f6e0eefb5c981f5036934b822ee9f47f to your computer and use it in GitHub Desktop.
Macbook Pro late 2013 assorted fixes and optimizations for Arch and EndeavourOS

A collection of steps to apply after installing Archlinux or EndeavorOS on a Macbook Pro Late 2013 , making it fully functional and a bit more pleasant to use. The steps consist of usability improvements (keyboard mappings) and performance (thermal management, battery management).

Testing has been performed on the following setup:

KDE Plasma Version: 6.4.2
KDE Frameworks Version: 6.15.0
Qt Version: 6.9.1
Kernel Version: 6.15.5-arch1-1 (64-bit)
Graphics Platform: Wayland
Processors: 4 × Intel® Core™ i5-4288U CPU @ 2.60GHz
Memory: 8 GiB of RAM (7,7 GiB usable)
Graphics Processor: Mesa Intel® Iris® Graphics 5100
Manufacturer: Apple Inc.
Product Name: MacBookPro11,1
System Version: 1.0
» lsusb          
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 002: ID 0a5c:4500 Broadcom Corp. BCM2046B1 USB 2.0 Hub (part of BCM2046 Bluetooth)
Bus 001 Device 003: ID 05ac:0259 Apple, Inc. Internal Keyboard/Trackpad
Bus 001 Device 006: ID 05ac:8289 Apple, Inc. Bluetooth Host Controller
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 002 Device 002: ID 05ac:8406 Apple, Inc. Internal Memory Card Reader

» lspci
00:00.0 Host bridge: Intel Corporation Haswell-ULT DRAM Controller (rev 09)
00:02.0 VGA compatible controller: Intel Corporation Haswell-ULT Integrated Graphics Controller (rev 09)
00:03.0 Audio device: Intel Corporation Haswell-ULT HD Audio Controller (rev 09)
00:14.0 USB controller: Intel Corporation 8 Series USB xHCI HC (rev 04)
00:16.0 Communication controller: Intel Corporation 8 Series HECI #0 (rev 04)
00:1b.0 Audio device: Intel Corporation 8 Series HD Audio Controller (rev 04)
00:1c.0 PCI bridge: Intel Corporation 8 Series PCI Express Root Port 1 (rev e4)
00:1c.1 PCI bridge: Intel Corporation 8 Series PCI Express Root Port 2 (rev e4)
00:1c.2 PCI bridge: Intel Corporation 8 Series PCI Express Root Port 3 (rev e4)
00:1c.4 PCI bridge: Intel Corporation 8 Series PCI Express Root Port 5 (rev e4)
00:1c.5 PCI bridge: Intel Corporation 8 Series PCI Express Root Port 6 (rev e4)
00:1f.0 ISA bridge: Intel Corporation 8 Series LPC Controller (rev 04)
00:1f.3 SMBus: Intel Corporation 8 Series SMBus Controller (rev 04)
02:00.0 Multimedia controller: Broadcom Inc. and subsidiaries 720p FaceTime HD Camera
03:00.0 Network controller: Broadcom Inc. and subsidiaries BCM4360 802.11ac Dual Band Wireless Network Adapter (rev 03)
04:00.0 Non-Volatile memory controller: Sandisk Corp WD_BLACK SN7100 NVMe SSD (DRAM-less) (rev 01)
05:00.0 PCI bridge: Intel Corporation DSL5520 Thunderbolt 2 Bridge [Falcon Ridge 4C 2013]
06:00.0 PCI bridge: Intel Corporation DSL5520 Thunderbolt 2 Bridge [Falcon Ridge 4C 2013]
06:03.0 PCI bridge: Intel Corporation DSL5520 Thunderbolt 2 Bridge [Falcon Ridge 4C 2013]
06:04.0 PCI bridge: Intel Corporation DSL5520 Thunderbolt 2 Bridge [Falcon Ridge 4C 2013]
06:05.0 PCI bridge: Intel Corporation DSL5520 Thunderbolt 2 Bridge [Falcon Ridge 4C 2013]
06:06.0 PCI bridge: Intel Corporation DSL5520 Thunderbolt 2 Bridge [Falcon Ridge 4C 2013]
07:00.0 System peripheral: Intel Corporation DSL5520 Thunderbolt 2 NHI [Falcon Ridge 4C 2013]

Most of this stuff is taken from the excellent Arch wiki https://wiki.archlinux.org/title/Laptop/Apple or from Reddit posts.

Status: most of the tips work, some need to be tested more extensively. Proceed at your own risk.

Cannot connect to wifi on 5GHz

Keep in mind this: https://wiki.archlinux.org/title/Broadcom_wireless#No_5GHz_for_BCM4360_(14e4:43a0)_/_BCM43602_(14e4:43ba)_devices

According to the above paragraph, the broadcom wifi card cannot connect to an antenna trasmitting on high channels. I am currently connected to channel 44 and it's working fine.

What caused problems for me - using a Unifi Express - was some setting in the "advanced" section of the 5GHz antenna for the Unifi device.

I set the antenna settings to "automatic" and the laptop is now connecting. I haven't gotten to find out which setting caused this, just be aware.

Touchpad Improvements

While the trackpad's support of MacOS is hard to beat, it's possible to make the whole experience a bit less painful.

Firefox

Apply AveYo's tuning of Firefox scrolling https://github.com/AveYo/fox/blob/main/Natural%20Smooth%20Scrolling%20for%20user.js

Plasma

Inertial scrolling is available in plasma 6.5.0:

All scrollable views in all QtQuick-based KDE software now have inertial scrolling when scrolled using a touchpad! Note: only with a touchpad, not with a mouse wheel. No inertia there. Say it with me: no inertia for mouse wheels!

Source: https://blogs.kde.org/2025/06/28/this-week-in-plasma-inertial-scrolling-rdp-clipboard-syncing-and-more-session-restore/#frameworks-616

Additionally: the default scrolling speed is high, imho. Reduce the "Scrolling Speed" a bit in the "Touchpad" settings for a less violent scrolling.

Mac keybindings

Toshy is a solution to replicate the keybindings of MacOS on linux. It smartly detects the context (App, Terminal, etc.) and remaps ctrl/option/cmd to the linux equivalents on the fly. This means you can do the familiar cmd+w to close a tab in Firefox, cmd+q to quit an app, cmd+h to hide (minimize) an app, and so on, without compromising the more common ctrl+... combos. It even goes as far as to map cmd+, to "preferences" where the app is supported.

Truly magical. https://github.com/RedBearAK/toshy

Resume on lid

The OS tends to resume from sleep immediately if the screen is left open during suspend. To prevent this, disable the wakeup for the LID0 element. You will lose the wakeup-on-lid-open convenience, though. Keep that in mind.

To do that at boot:

  1. create a file /etc/systemd/system/suspend-fix.service:
[Unit]
Description=Fix for the suspend issue

[Service]
Type=oneshot
ExecStart=/bin/sh -c "echo LID0 > /proc/acpi/wakeup"

[Install]
WantedBy=multi-user.target

  1. start the command and enable the unit:

systemctl start suspend-fix.service && systemctl enable suspend-fix.service

Facetime HD Camera

Follow instructions here https://wiki.archlinux.org/title/MacBookPro11,x#Web_cam

Internal Display stays off when external HDMI monitor is disconnected

Odd behavior with an external HDMI screen connected. I'm looking for a solution. To reproduce

  • In "Preferences > Display Configuration": the internal display is disabled ("enable" checkbox unticked)
  • unplug the HDMI monitor
  • the internal display stays disabled

Workaround: re-enable the internal display before disconnecting the HDMI monitor.

Power optimizations

Power Daemon

Plasma 6.x has its own power daemon, so TLP is not used.

One first optimization step is to run powertop in auto-tune mode at boot.

  1. Create the systemd unit file:
[Unit]
Description=Powertop tunings

[Service]
Type=oneshot
RemainAfterExit=yes
ExecStart=/usr/bin/powertop --auto-tune

[Install]
WantedBy=multi-user.target

  1. start the command and enable the unit: systemctl start powertop.service && systemctl enable powertop.service

NEW - ASPM

From the RedHat documentation:

Active-State Power Management (ASPM) saves power in the Peripheral Component Interconnect Express (PCI Express or PCIe) subsystem by setting a lower power state for PCIe links when the devices to which they connect are not in use. ASPM controls the power state at both ends of the link, and saves power in the link even when the device at the end of the link is in a fully powered-on state.

Afaik, none of the solutions described below apply ASPM settings. The following script does. I managed to drop the idle consumption to around 6W, from 10w.

https://github.com/notthebee/AutoASPM

Thermals & Throttling

There's no denying this laptop runs pretty hot on Linux. My assumption - currently based purely on impressions - is that MacOS aggressively throttles the CPU whenever it reaches higher temps. This prevents the fans from kicking in, leading to a quiet, relatively cool but at times slow-performing machine.

Linux has no aggressive tuning by default except for the standard intel CPU scheduler:

» powerprofilesctl 
  performance:
    CpuDriver:	intel_pstate
    Degraded:   no

  balanced:
    CpuDriver:	intel_pstate
    PlatformDriver:	placeholder

* power-saver:
    CpuDriver:	intel_pstate
    PlatformDriver:	placeholder

We can tune this a bit further with thermald, mbpfan and especially cpufreq.

Thermald

Just install thermald as shown in the Arch wiki end enable it at boot. I'm still questioning its utility but it's worth trying nevertheless: https://wiki.archlinux.org/title/CPU_frequency_scaling#thermald

Mbpfan

This is a nifty daemon which takes over the control of the fan, which is autonomous in this machine. The advantage of manually controlling the fan speed is in forcing a higher minimum speed and capping the top speed. This allows a somewhat more aggressive active cooling while limiting the obnoxiousness of a high pitched fan spinning.

To achieve that, install mbpfan-git (https://wiki.archlinux.org/title/Mac/Troubleshooting#Fan_Control ) and configure it via the /etc/mbpfan.conf file. My current configuration, still subject to tuning:

[general]

min_fan1_speed = 2200	# put the *lowest* value of "cat /sys/devices/platform/applesmc.768/fan*_min"
max_fan1_speed = 5000	# put the *highest* value of "cat /sys/devices/platform/applesmc.768/fan*_max"
low_temp = 55			# if temperature is below this, fans will run at minimum speed
high_temp = 60			# if temperature is above this, fan speed will gradually increase
max_temp = 87			# if temperature is above this, fans will run at maximum speed
polling_interval = 2	# default is 1 seconds

Don't forget to enable the service at boot.

Cpufreq

(Note: here's a small script for setting cpufreq and intel_gpu_frequency values without running the commands manually: https://github.com/spidernik84/mbp-scripts/tree/main. I'm still explaining the manual steps and background in the coming text)

cpufreq can do many things. What we will use it for is to throttle the CPU. This is naturally going to impact the performance of the machine at high loads, but I can't really see any major drawback during normal usage.

The setup below makes the CPU scale speed up slowly by choosing the conservative governor, and reach a maximum of 2GHz vs 3.10GHz of max speed. With these settings, combined with mbpfan, I get an average temp of 55-60 degrees celsius and a quiet operation.

First, install cpufreq via pacman. Then configure it by editing /etc/default/cpupower as following:

governor='conservative'
min_freq="800MHz"
max_freq="2.00GHz"

Don't forget to start the daemon and enable it at boot:

systemctl start cpupower.service
systemctl enable cpupower.service

Intel GPU throttling

Like the CPU, the integrated GPU runs wild unless tamed. Following the same reasoning, throttling it when not in use allows the temperatures to be maintained within control.

First install intel-gpu-tools.

At this point, the max clock can be capped like this:

intel_gpu_frequency --custom max=<x>

This GPU can reach a peak frequency of 1200MHz, going as low as 200MHz. A conservative value is something between 200 and 500. Experiment freely.

Example:

intel_gpu_frequency --custom max=200 or intel_gpu_frequency --custom max=500.

Firefox

Note: the below settings may cause unpredictable video playback issues, since we are basically disabling the playback of certain formats. Remember this and reset the settings in case of surprises.

The Intel GPU only supports h264 hardware decoding, which means more modern codecs (AV1, VP9, h265) will be software decoded, causing higher battery usage. The only way to prevent Firefox falling back to software decoding is to restrict video content playback to h264. For youtube, this can be done through the extension enhanced-h264ify https://addons.mozilla.org/en-US/firefox/addon/enhanced-h264ify/

Further settings:

Disable av1 codec for webrtc:

media.webrtc.codec.video.av1.enabled -> false

Disable vp9

media.mediasource.vp9.enabled -> false

Also ensure hardware decoding actually works. For my model, this driver needs installing for VA-API to work:

libva-intel-driver

Extra steps to enable video decoding and verify it works in Firefox: https://wiki.archlinux.org/title/Firefox/Tweaks#Force-enable_hardware_video_decoding https://wiki.archlinux.org/title/Firefox#Hardware_video_acceleration

Disable firefox GUI transitions and animations:

In about:config add the preference ui.prefersReducedMotion and set it to type number, value 1. If you set it to a boolean it won't work!

Average power consumption with an aftermarket SSD (Sandisk Corp WD_BLACK SN7100 NVMe SSD), 10% screen brightness:

10.38W 6.5W (after the ASPM addition!)

This is better than what I see on MacOS Sonoma (9/10 W) (installed via OCLP).

@RedBearAK
Copy link

RedBearAK commented Jul 12, 2025

@spidernik84

Hey, I saw your star on my repo (Toshy) and checked out this gist when I saw it pinned on your user page. I really appreciate the nice note and link you have here about Toshy. I'm trying to keep it working on as many distros and desktop environments (Wayland sessions) as possible. No simple task.

I don't have this model of MacBook and am actually usually on a cheap Acer laptop (although still using Toshy and the Mac shortcut remappings constantly, and I do have Linux on some other old Intel Macs), so there's not much relevant to me here, aside from maybe the scrolling issues. But since this gist is about what to do after installing Linux on your MacBook, I thought I'd leave a note here about a new script that's now in the Toshy repo, that can modify the volume (or mute) the Mac startup sound (aka, the "boot chime"). This is potentially useful on any Intel Mac model.

The script works entirely from Linux, without needing to boot up some version of macOS on the machine. So no need to dedicate space on the drive to dual-boot macOS, or have a macOS boot drive around just to deal with the startup sound volume. I wrote up a Wiki about how it works, with a direct link to the script, which can be used independently of Toshy (but also gets installed in Toshy's scripts folder, so you should have it if you're using Toshy and installed recently).

https://github.com/RedBearAK/toshy/wiki/How-to-set-the-Mac-startup-sound-volume-level-(or-mute-it)

This is as solution to something a lot of Linux-on-Mac users search for, since the inability to control the loud startup sound without booting into macOS has always been an annoyance when running Linux on Apple hardware. Until recently the only instructions found online were complicated commands that just muted the boot chime, with no known way to leave it audible but at a lower volume. With the script you can set the volume to any level and mute or unmute it, and if you run the script from a system-level startup script it could fix the volume automatically if you ever need to reset the NVRAM with Cmd+Opt+P+R.

I hope Toshy continues to serve you well, whether you run it on a real Mac or some kind of PC laptop or desktop machine. Works either way.

@spidernik84
Copy link
Author

Hello @RedBearAK , thanks for the message. Great work again :)

I tried your nice script, two things:

  1. it works (mutes, unmutes, sets the volume), but I am unable to test it properly: when I boot my mac the white Apple logo+chime sound are completely skipped. Even from total shutdown. I'm trying to figure out how exactly Endeavour boots. It's the first time I see a distro skipping this stage.
    I did hear the chime and saw the logo only right after the NVRAM reset.
  2. bc is not installed by default in EndeavourOS, you may want to add it to the requirements list

I'll try to reproduce this further.

@RedBearAK
Copy link

@spidernik84

What you said sounded very odd, so I pulled out an EndeavourOS ISO and installed it on a 13-inch MacBookPro5,5 (2009). Surprisingly the WiFi worked without using a nano USB WiFi adapter, both with the live ISO environment and after install. Nice. But then I had to replace SDDM with GDM due to some kind of problem with nouveau. After that I was able to log into Plasma 6 and get Toshy installed, and test the startup sound script.

Depending on the Mac model, volume levels below 64 will rapidly become inaudible. I suspect you were setting a numeric volume level that just made it seem as if the boot chime wasn't there. But it's part of the firmware, so I can't imagine how a Linux distro could bypass playing the boot chime unless they were writing to this EFI variable at every boot to mute it. You said it was audible after resetting the PRAM/NVRAM.

As for the Apple logo at boot, I'm pretty sure that comes from the macOS boot loader, so it's natural that you wouldn't see it. I chose systemd-boot (the default) instead of GRUB, but they both should work similarly, and shouldn't be capable of interfering with the boot chime. I get a gray screen, then black with the EndeavourOS boot menu (looks quite different from a GRUB menu). I think that's perfectly normal.

Try setting your startup sound level to 64, or something just slightly below 64. On some models I can still hear it just fine at 32, on others it's almost too quite to hear at 45. The drop-off can be very non-linear.

I tried Cmd+Opt+P+R on this model and get the original boot chime volume back, but did not see the Apple logo at all. Maybe there's a remnant of the macOS boot loader in the EFI that didn't get wiped when you installed EndeavourOS. Hard to say.

I will look at putting bc in the requirements, or update the script to let the user know to install it, like efivar, which does come pre-installed on EndeavourOS, unlike other distro types I've tested.

@spidernik84
Copy link
Author

I checked, you were right on all fronts: the Apple logo is part of the bootloader, and the chime was indeed muted.
I must have muted the chime while still on Macos (my model still has a swappable SSD so I kept the original SSD with MacOS while I transition to Endeavour).

I confirm the script works both to unmute and mute. Thanks for the great work again.

I might have found a bug while using Dolphin: I cannot ctrl+select several files or shift+select a range in a list of files. I'll see if it's my setup before opening any bug!

@RedBearAK
Copy link

RedBearAK commented Jul 13, 2025

@spidernik84

I confirm the script works both to unmute and mute. Thanks for the great work again.

Excellent. I'm adding a check in the script for the bc command, just like efivar. Since not that many people will ever be on a Mac and try to run the script, I'm not going to add it to the packages Toshy automatically installs. The script will just notify the user to install the package if it's missing.

I might have found a bug while using Dolphin: I cannot ctrl+select several files or shift+select a range in a list of files. I'll see if it's my setup before opening any bug!

This is the most common thing people need to adjust in their Toshy config file. The keymapper tries to prevent certain issues like the menu focus stealing that happens in apps like Firefox by delaying when the app sees a modifier key press until you either click with a mouse device that's been "grabbed" by the keymapper, or combine it with a normal key to make a combo. This often doesn't really work as intended, especially with trackpads. The default delay is 1 second, you'll see if you hold the modifier key beyond one second that it will operate normally.

Follow the instructions in the FAQ to fix it by reducing the suspend timeout, and then see the other FAQ entry about the side effects in apps like Firefox and VSCode.

https://github.com/RedBearAK/toshy/wiki/FAQ-(Frequently-Asked-Questions)#modclicking-blocked-by-keymapper-suspend-timeout

https://github.com/RedBearAK/toshy/wiki/FAQ-(Frequently-Asked-Questions)#vscodes-and-firefox-menu-stealing-focus-when-hitting-optionalt

That should take care of it.

@spidernik84
Copy link
Author

Thanks, that's brilliant. You thought of everything :)
It definitely fixes my problem.

@RedBearAK
Copy link

Thanks, that's brilliant. You thought of everything :) It definitely fixes my problem.

👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment