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.
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.
While the trackpad's support of MacOS is hard to beat, it's possible to make the whole experience a bit less painful.
Apply AveYo's tuning of Firefox scrolling https://github.com/AveYo/fox/blob/main/Natural%20Smooth%20Scrolling%20for%20user.js
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!
Additionally: the default scrolling speed is high, imho. Reduce the "Scrolling Speed" a bit in the "Touchpad" settings for a less violent scrolling.
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
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:
- 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
- start the command and enable the unit:
systemctl start suspend-fix.service && systemctl enable suspend-fix.service
Follow instructions here https://wiki.archlinux.org/title/MacBookPro11,x#Web_cam
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.
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.
- 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
- start the command and enable the unit:
systemctl start powertop.service && systemctl enable powertop.service
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
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.
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
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.
(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
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.
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).
@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.