Skip to content

Instantly share code, notes, and snippets.

@willbush
Last active May 31, 2023 20:46
Show Gist options
  • Star 9 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save willbush/38aee00bca2f6a6b65333a95b2948c4a to your computer and use it in GitHub Desktop.
Save willbush/38aee00bca2f6a6b65333a95b2948c4a to your computer and use it in GitHub Desktop.
Sane Xubuntu Setup Guide for Mackbook Pro

Sane Xubuntu Setup Guide for Mackbook Pro

I am mostly writing this for myself because I tend to like to start fresh by reformatting and reinstalling everything every few months and forget the solutions to problems I have solved before. This guide was performed on a late 2011 macbook pro with xubuntu 16.04.

One misconception I have noticed that's quite prevalent in many guides is that we must dual boot osx and linux for the fear of having no easy path to getting osx back and installed. Even my old macbook pro has the ability to completely reinstall osx from the internet even if you completely wipe your hard drive, so fear not. As such, this is a sane (opinionated) guide about setting up xubuntu, I am going to cover how to completely replace osx with xubuntu, and not how to setup dual boot.

Installing

  1. Backup your data and look into getting the latest bios update while you still have osx.
  2. Get xubuntu or your favorite distribution and burn it to a dvdr or load it on a flash drive.
  3. Restart and the alt key to boot from a bootable CD, DVD, or USB thumb drive.
  4. It's usually a good idea to click "try" before proceeding with the install.
  5. If you're WIFI is not working, then open the start menu, search "driver" and click on "Additional Drivers" and that should find what you need. Otherwise, you may need to resolving the missing driver issue using ethernet after installing. For me, simply clicking "Using Broadcom 802..." and applying those changes gets the WIFI working even when just "trying" xubuntu.
  6. Now just click on the "install xubuntu" link on the desktop when you are ready and follow the prompts. You might want to include 3rd party software in the install because the WIFI driver and mouse driver are likely proprietary. In addition, since we are replacing OSX, just select "erase disk" and it will handle all the partitioning of the hard drive for you.
  7. Now that you're done installing, preform those previous steps again (if needed) to get your internet working, and run the Software Updater.

Fixing annoying issues.

Hangs on white/gray screen on boot

When you restart you might notice it hangs a while on a gray screen before booting. Do the following to fix this issue:

  1. restart and hold Command key + R. You should see a spinning globe while it is downloading the utilties need to restore osx.
  2. Go to Utilties -> Terminal and type:bash bless --device /dev/disk0s1 --setBoot --legacy See this link for more info.
  3. restart and the delay should be fixed.

Touchpad issues

There are two projects that I'm aware of that help bring the touchpad close to something usable, mtrack and dispad.

Both of those links should be pretty self explanatory of what services those projects provide. If you don't want to build mtrack from source you can install it with the following command from aptitude:

sudo apt-get install xserver-xorg-input-mtrack

You need to edit the file located at /usr/share/X11/xorg.conf.d/50-synaptics.conf using sudo

Find and comment out or replace the section called "InputClass" with the following:

Section "InputClass"
    MatchIsTouchpad "on"
    Identifier      "Touchpads"
    Driver          "mtrack"
EndSection

The above represents the minimal settings you need in the InputClass section. There are a number of settings as specified in the mtrack readme that allow you to tweak all sorts of things. I find myself happy with most of the defaults, but I did edit a couple.

Likely you are going to need to play around with these settings to for your preference. There are some blogs out there that share their settings that they prefer. However, once you read through what these settings do you'll find many of the settings in the previous link are redundant because they have disabled tap to click. Many, if not most, of the settings are set to help prevent accidental mouse clicks while typing, and if you have completely disabled tap to click, then there's no point settings many of the others.

Here are my current settings:

Section "InputClass"
    MatchIsTouchpad "on"
    Identifier      "Touchpads"
    Driver          "mtrack"
    Option          "Sensitivity" "1.25"
    Option          "TapButton1"  "0"
EndSection

First let me make a note on mouse acceleration and how it is missing from the mtrack settings. For whatever reason in xubuntu you'll have to set acceleration through the GUI. Go to the start menu and search "Mouse and Touchpad." I prefer to have my acceleration really low, mine is set to 0.5. Also note that the sensitivity setting in the GUI does nothing. Set the sensitivity in the file like in the example above.

The TapButton1 set to 0 disables tap to click. I like tap to click, but when it happens accidentally when I'm typing, it drives me nuts. So me setting that to zero is essentially giving up. I like to think of myself as a heavy keyboard user anyways, so if I have to physically click to left click, then perhaps it'll reinforce keyboard use. However, if I find this too annoying, I might take another stab at the problem to find the right balance of tap to click and typing without accidental taps. Note though that I still have the ability to tap two fingers to right click since this usually doesn't happen while typing.

If you don't want to give up soo easily, then you probably want to start with the settings that look something like this:

 Section "InputClass"
        MatchIsTouchpad "on"
        Identifier      "Touchpads"
        Driver          "mtrack"
        Option          "FingerHigh" "12"
        Option          "FingerLow" "1"
        Option          "IgnoreThumb" "true"
        Option          "IgnorePalm" "true"
        Option          "BottomEdge" "25"
EndSection

And install that dispad program that will help by disabling the keyboard while typing. I don't have dispad installed because I gave up on tap to click, which solves the tap/click problem while typing. In addition, it kind of bothers me to have a daemon performing polling every 100ms or so just to see if I'm typing, but perhaps that's a misplaced concern. If you find a good balance for this problem please let me know in a comment below.

Keyboard tweaks

Given the layout of the Mackbook Pro keyboard one of the few settings that made sense to me in OSX was the command key behaving much like the control key behaves on a PC. I like to swap the left Control key which defaults do behaving like a PC control key with the left Command key which defaults behaves like the super key. With these two swapped you can hit Command + w to close windows and tabs in browsers, for example.

You can perform that swap by doing the following:

  1. edit /etc/default/keyboard with your favorite editor using sudo
  2. find the line that has XKBOPTIONS and add ctrl:swap_lwin_lctl. Here's mine: XKBOPTIONS="caps:swapescape, ctrl:swap_lwin_lctl".
  3. perform the command: sudo dpkg-reconfigure keyboard-configuration and just follow the prompts.
  4. Now logging out and logging back in should work, but I found that I actually had to restart before the change became permanent.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment