24

Going from macOS to Ubuntu

 4 years ago
source link: https://www.tuicool.com/articles/qyIreuz
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

It's not the first time I'm switching to Ubuntu. I've been, as they say, around the block when it comes to operating systems. I started out on MS, from DOS to XP, then Ubuntu from 5.10 Breezy to 9.10 Karmic, then on Apple from OSX 10.5 Leopard to macOS 10.14 Mojave. Both in terms of productivity and delight I had my best years on Apple and I didn't think I'd ever look back. But here we are.

Why? I (guess I'm the only person alive that) didn't mind the TouchBar or lack of a real escape key (can map Caps Lock to that). And I liked having 4 USB-C+ ports that I could do anything with. But yes, The Keyboard .

I spent the most money I ever did on this MacBook Pro, and it's also the worst machine I ever had because the keyboard breaks down (like, it won't register the s ). When I dock it and use a different keyboard, it's fine of course. But sometimes I visit my co-founder in Berlin, or want to work from a coffee shop, and then it's nice to have a working keyboard. So far I've brought it in for repairs three times, and each time I'm without my workhorse for a week. Those are unplanned holidays that are dragging my productivity–and basically my company down.

I personally also feel macOS has taken a freefall regarding robustness and polish, but that might be just me. It's they keyboard that ultimately made me feel just really concerned about having my productivity/company/future tied what Apple ships next.

So what machine did I get? I played it safe and went for a Dell XPS. They come with Ubuntu preinstalled so you know you won't have to compile kernels to get Wi-Fi going. There's a time and a place for those things, and it's called (pre)college aq67rmI.png!web Honestly: I really enjoyed experimenting with Linux and occasionally breaking it back in the day. I learned a lot and would not trade that experience for anything. But these days with a family and a company rightfully demanding my time, the time I spent behind a computer needs to be accounted for, and it can't really be: days on compiling my own kernel. So less surprises is better. There may be better options than an XPS for sure, probably research any hardware you intend on buying for Linux compatibility (also just for things like webcams ) and you'll find good options. I do like the XPS, it feels rugged, fast, polished, it has the ~same ports that my MacBook had, battery life is good. My only regret is that I didn't go for the larger 15". I dock it a lot, but for those other times, 13" is just a bit too small to do serious damage for me.

As for why Ubuntu , ~same reason. There may very well be superior distros on many different metrics out there (and NixOS has me tempted), but the sheer community size of Ubuntu makes sure I'm not the first one running into a problem, and I'll find a solution online before it really slows me down.

So, can Linux be my workhorse?

Yes. But this is not a sales pitch. There are sacrifices and mileage may vary. In this post I'm trying to describe the things I ran into, the things I can't fix, and straight up howto's for the things I could. I'll be refering to this post myself when I need to set up another Ubuntu box, and will tweak it as I go. So please regard it as a grabbag containing opinionated things that may very well drive you nuts, and probably don't blindly paste my entire setup.

Things that bothered me immediately

  • One day, scrolling was superfast . Turns out I had to unplug the USB dongle that came with my mouse and insert it back in.
  • Device support is still lacking. Apple's Magic Trackpad 2 to work without soulcrushingly fragile hacks . But I guess a newer kernel is coming that will fix this nmauM3E.png!web . I was unable to get my TomTom Running Watch to sync. My Fuitsu SnapScan document scanner had no Linux tools (on macOS it can automatically OCR & archive to my Dropbox). This is very dear to me so I ended up using VirtualBox with a Windows VM for that.
  • Photos . Leaves to be desired. This is the main reason I'll probably always at least keep an iPad or very lightweight MacBook around. But if I don't have to buy maxed out Macbook Pro's 1 , there's budget to buy both a highend Linux machine and a modest Apple device, and still save money.
  • Copy paste is still horribly 'broken'. I guess <CMD>C isn't a thing on Linux and <Ctrl>C has a different meaning in terminals, so I can get with that. And I guess there are tricky/valid historical reasons for having two different clipboards, but for the end user, it's just shit not being able to copy in one app and paste in the next if you closed the former. Or having data in one clipboard while you need it in the other. Luckily I found a workaround that I listed further down. Wholeheartedly recommended. Paired with trainging muscle memory to do <Ctrl><Insert> (copy) and <Shift><Insert> (paste) on Ubuntu, that solves the problem.
  • I invested in a screen with high DPI, but it's not ' Retina ', and the fonts don't render like they do on macOS. It seems like a small thing, but 4 weeks in, I never would have thought I still sometimes feel as though my eyes are dry and almost litteraly hurting ABJjE33.png!web Did Steve Jobs spoil/ruin me for life?
  • If I close the lid of my XPS and open it 2 days later, the battery is fully drained. I just opened by MacBook after leaving it for weeks, and it still has juice enough to do serious work with (if the keyboard only allowed!). So it seems hibernation is much better on a Mac.
  • Every reboot my screenbrightness is so low I can barely a thing. The button to increase brightness is maxed out. It turned out I have to venture into the power saving settings to crank the brightness up there, but it does not persist across reboots. I avoid reboots now.
  • Selecting the right audio/video input/output is a proper chore. My Mac seemed to pick sane/seemingly obvious defaults, wether I hooked up a screen with webcam, removed it, etc. With Ubuntu I have to open the audio settings and select the proper i/o at least twice a week as it doesn't pick obvious candidates. It's annoying for me, and often enough also for my teammates who I video conference a lot with. Sorry folks!
  • I thought Snaps were really cool until I used them in my day to day. I used snaps for GitHub Desktop, Spotify, VSCode, Slack, and have since reverted all of that to plain APT/repositories. Issues ranged from intence CPU hogs, to links in Slack not opening, or always opening in a new Firefox window, seemingly random segfaults, etc. I guess it's still a bit too early and some programs don't like to be contained so much, or I'm just plain unlucky. I didn't have time to deep dive, APT works fine.
  • There are other ways but if I want to type an é , out of the box, I have to type: <Ctrl><Shift>U 00e9 , and then, that doesn't not work in my code editor. Long-pressing a button on macOS wins! I keep forgetting this code, so I'm saying Renee a lot. Sorry Renée !

1Since I run a video encoding business, having our test suites pass faster locally often ramps up my productivity near-linearly, so the company is happy to sponsor the fastest machine. I do realize I'm incredibly priviliged like that.

Things I could fix

So here's what I did to make Ubuntu usable as a day-to-day workhorse, coming from Mac. By having everything as CLI commands, I can just paste and have a new machine configured identically. So any change I make to my machine that I want to persist, even if I initially make it in the UI, I'm sure to document that back as a CLI command right here.

Disclaimer: This worked for Ubuntu 19.04. It may not work for other versions.If you use a more recent version and know how to make things compatible, please drop a line in thecomments below.

Basics

Small Tools & Utilities

Install basic tools, some of which ( curl , dconf-cli , xdotool ) we'll also need to execute further steps.

sudo apt install whois \
  awscli \
  curl \
  dconf-cli \
  exiftool \
  htop \
  ipcalc \
  jq \
  logtail \
  tmux \
  xdotool \ 
&& true
# ^-- was dconf-tools before Ubuntu 19.04

Overwrite apt repositories in a denser way, and enable more repos

This will also unlock non-free codecs for example.

release=$(lsb_release -cs)
echo "deb http://archive.ubuntu.com/ubuntu/ ${release} main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu/ ${release}-updates main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu/ ${release}-security main restricted universe multiverse
" | sudo tee /etc/apt/sources.list
sudo apt update

Apt-file

So you can search for e.g. apt-file search bin/aws to find out what APT package the aws command belongs to again.

sudo apt install apt-file && sudo apt-file update

Browser

Trying to have less Google in my live and so I'll open up a Terminal and type:

# First let's install some of those non-free codecs so I can watch videos online:
sudo apt install ubuntu-restricted-extras

# Then let's take the very latest Firefox from Mozilla
cd /tmp \
  && curl -sSLo ./firefox.tar.bz2 'https://download.mozilla.org/?product=firefox-latest&os=linux64' \
  && sudo tar xjf ./firefox.tar.bz2 -C /opt/ \
  && sudo ln -nfs /opt/firefox/firefox /usr/lib/firefox/firefox \
  && firefox \
  && cd -

Email

Haven't found a really neat one yet. So far using Thunderbird for work email and a webinterface (yeah still Gmail) for personal. Thunderbird is fast and functional and doesn't surprise me in bad ways. That's about all the nice things that I can say about it aq67rmI.png!web To install it:

sudo apt install thunderbird

Spotify

Can't not have music! We'll add their own APT repository so we can enjoy regular updates. And you can read a little higher up why I try to stay away from Snaps for now, and use APT instead.

curl -sSL https://download.spotify.com/debian/pubkey.gpg | sudo apt-key add - \
  && echo "deb http://repository.spotify.com stable non-free" | sudo tee /etc/apt/sources.list.d/spotify.list \
  && sudo apt update \
  && sudo apt install spotify-client

Collaboration

Slack

cd /tmp \
  && curl -sSLo slack.deb https://downloads.slack-edge.com/linux_releases/slack-desktop-4.0.2-amd64.deb \
  && sudo apt install ./slack.deb \
  && cd -

Install Dropbox

cd /tmp \
  && apt install libpango1.0-0 libpangox-1.0-0 python3-gpg \
  && curl -sSLo dropbox.deb https://www.dropbox.com/download?dl=packages/ubuntu/dropbox_2019.02.14_amd64.deb \
  && sudo apt install ./dropbox.deb \
  && dropbox autostart y
# now type CMD+SPACE (or just CMD if you don't remap like I did below), type dropbox, ENTER

Install Signal

We use this with the team to transmit secrets to each oter.

echo "deb [arch=amd64] https://updates.signal.org/desktop/apt xenial main" | sudo tee -a /etc/apt/sources.list
curl -sSL https://updates.signal.org/desktop/apt/keys.asc | sudo apt-key add -
sudo apt update
sudo apt install signal-desktop

Install Gimp

Probably not as nice as Photoshop, but I'm not a designer and for me it gets the job done.

sudo apt install gimp

Development

VSCode

You'll know how to replace this with your own favorite editor.

curl -sSL https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > packages.microsoft.gpg \
  && sudo install -o root -g root -m 644 packages.microsoft.gpg /usr/share/keyrings/ \
  && sudo sh -c 'echo "deb [arch=amd64 signed-by=/usr/share/keyrings/packages.microsoft.gpg] https://packages.microsoft.com/repos/vscode stable main" > /etc/apt/sources.list.d/vscode.list' \
  && sudo apt install apt-transport-https \
  && sudo apt update \
  && sudo apt install code \
  && true
# Afterwards I install the extension Settings Sync and enter the Gist ID (df2624fb06dc2d3b8890a28d4caa3820 in my case)
# to setup VSCode to my preferences. For uploading changes to the settings, you'll need a GitHub token.

GitHub Desktop

I also still use the CLI, but for nit-picking commits, there's no beating the UI. Yes I did try git add -p . No it doesn't come close! Sorry! aq67rmI.png!web

# ran into multiple issues (such a segmentation faults and https://github.com/shiftkey/desktop/issues/59) with the default snap, as well as the shiftkey fork's 2.x versions. So using this for now:
cd /tmp \
  && curl -sSLo GitHubDesktop-linux-2.1.0-linux1.deb https://github.com/shiftkey/desktop/releases/download/release-2.1.0-linux1/GitHubDesktop-linux-2.1.0-linux1.deb \
  && sudo apt install ./GitHubDesktop-linux-2.1.0-linux1.deb \
  && cd -
# if you have GitHub 2FA and use HTTPS repositories (vs SSH) and get 
# create a personal access token on GitHub, and use that as your password
# to make it presist, set: git config --global credential.helper store (more convenient)
# or: git config --global credential.helper cache (safer)

If you want to allow incoming SSH connections:

sudo apt install openssh-server

Access to code, SSH Key for github and syncing your code dir from another machine

ssh-keygen -t rsa -b 4096 -C "${USER}@${HOSTNAME}"
# Press enter on all questions, then 
cat ~/.ssh/id_rsa.pub
# and add it to https://github.com/settings/keys
# probably also add it to the machine that currently has 
#your code in ~/.ssh/authorized_keys <-- and chmod it to 600, 
# so you can sync it to your new machine via, e.g.:
rsync -a --progress --ignore-existing --exclude='node_modules/' "${HOME}/code/" "10.0.1.144:/${HOME}/code"

Install Git LFS

curl -sSL https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | sudo bash \
  && sudo apt install git-lfs \
  && git lfs install

Starship & powerline fonts

This gives me a cool prompt.

cd /tmp \
  && sudo apt install fonts-powerline fonts-firacode \
  && curl -sSLo starship-v0.15.0-x86_64-unknown-linux-gnu.tar.gz https://github.com/starship/starship/releases/download/v0.15.0/starship-v0.15.0-x86_64-unknown-linux-gnu.tar.gz \
  && tar zxvf starship-v0.15.0-x86_64-unknown-linux-gnu.tar.gz \
  && sudo cp -af ./x86_64-unknown-linux-gnu/starship /usr/local/bin/starship \
  && cd -
# Now add to your ~/.bash_profile: [ -x /usr/local/bin/starship ] && eval "$(starship init bash)"

Shellcheck

Linting for Bash scripts.

sudo apt install cabal-install && cabal update && cabal install ShellCheck

Install Node.js

# Install Node 10
(curl -sSL https://deb.nodesource.com/setup_10.x | sudo -E bash -) \
  && sudo apt install nodejs

# Install yarn
(curl -sSL https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -) \
  && echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list \
  && sudo apt update \
  && sudo apt install yarn

# Login to npm if you need that
npm login

Install Go

sudo add-apt-repository ppa:longsleep/golang-backports \
  && sudo apt update \
  && sudo apt install golang-go golang-go.tools \
  && mkdir ~/go ~/code

Install basic PHP & MySQL cli

sudo apt install php-cli php-mbstring php-mysql mysql-client
# and enable extension=mbstring, extension=mysqlnd, extension=mysqli in $EDITOR /etc/php/*/cli/php.ini

DataGrip

This is the only software I installed that costs money. Although I was lucky enough to be donated a license for work done on my open source project Locutus.

sudo mkdir -p /opt \
  && curl -sSLo datagrip.tar.gz https://download.jetbrains.com/datagrip/datagrip-2019.2.4.tar.gz \
  && tar zxvf datagrip.tar.gz \
  && cd DataGrip-2019.2.4 \
  && ./bin/datagrip.sh \
  && true
# You should be able to create a launcher from within the 
# application itself. Choose "Tools" > "Create desktop entry" 
# This will create an item in the dash (CTRL+SPACE), which you can 
# then drag into the dock.

Vagrant & VBox

cd /tmp \
  && sudo apt install virtualbox \
  && curl -sSLo vagrant.deb https://releases.hashicorp.com/vagrant/2.2.5/vagrant_2.2.5_x86_64.deb \
  && sudo apt install ./vagrant.deb \
  && vagrant plugin install vagrant-vbguest \
  && cd -

Docker

sudo apt install \
    apt-transport-https \
    ca-certificates \
    curl \
    software-properties-common \
&& (curl -sSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -) \
&& sudo apt-key fingerprint 0EBFCD88 \
&& sudo add-apt-repository \
   "deb [arch=amd64] https://download.docker.com/linux/ubuntu \
   $(lsb_release -cs) \
   stable" \
&& sudo apt update \
&& sudo apt install docker-ce \
&& sudo usermod -aG docker kvz \
&& sudo systemctl enable docker \
&& true

# Login to docker Hub if you need that
docker login

# DANGER: Add current user to admin group and allow admins to not type sudo passwords
sudo adduser "${USER}" admin
sudo sed -i -e 's/%admin ALL=(ALL) ALL/%admin ALL=NOPASSWD:ALL/g' /etc/sudoers
sudo visudo -cf /etc/sudoers

echo "WARNING! REBOOTING HARD NOW. PRESS CTRL+C IF YOU ARE NOT SURE! Sleeping 10s" && sleep 10 & sudo reboot

Tweak Desktop

Fix copy-paste

10 years later, copy-paste is still a horrible user experience. Different apps use different clipboards jMfque7.png!web Even for copying these commands from Firefox to the terminal with keyboard shortcuts ( <Ctrl><Insert> , <Shift><Insert> , as <Ctrl>C has a different meaning in terminals), you'll need copy-paste fixed already.

xclip is nice for copying from the CLI like: cat /etc/config |xclip

sudo apt install parcellite libcanberra-gtk-module xclip

I had to sudo reboot before this worked then press <Ctrl><Alt>P to bring up the menu, open preferences, make sure box 1 is checked, box 2 is unchecked.

Add emoji support

cd /tmp \
  && sudo apt install fonts-emojione \
  && curl -sSLo noto-color-emoj.deb https://launchpad.net/~ubuntu-desktop/+archive/ubuntu/transitions/+files/fonts-noto-color-emoji_0~20170913-0ubuntu1~bionic1_all.deb \
  && sudo apt install ./noto-color-emoj.deb \
  && cd -
# then install GNOME Characters to easily browse emoji:
snap install gnome-characters
# Some apps will need a hand, e.g. for VSCode you could set (single config shared between ubuntu & macos, worked for me): `"editor.fontFamily": "Monaco, Menlo, Consolas, 'Droid Sans Mono', 'Inconsolata', 'Courier New', 'Droid Sans Fallback', 'Noto Color Emoji', 'Apple Color Emoji'",`

Move around windows or resize them by holding ALT and dragging a window

# holding ALT and dragging left, USER or right, i used:
sudo apt install compizconfig-settings-manager
cssm
# Then enabling the Move plugin. I set Initiate Move to <Alt>Button1. The 'xev' tool lets you see what button number is associated with e.g. a two finger drag on a touchpad 
# you can also use this to let apps open on certain places by default:
# https://askubuntu.com/questions/107951/how-to-set-a-specific-window-size-and-placement-for-all-windows-that-open-to-def

Better screenshots

# Save screenshots in ~/Dropbox/Screenshots
# Use annotation screenshot tool by default:
sudo apt install flameshot \
  && flameshot config -f '%Y-%m-%d_%H-%M-%S-screenshot' \
  && dconf write /org/gnome/gnome-screenshot/auto-save-directory "['file:///home/${USER}/Dropbox/Screenshots']" \
  && dconf write /org/gnome/gnome-screenshot/border-effect "['shadow']"
# https://askubuntu.com/a/1039949/2222
# Release the PrtScr binding by this command
gsettings set org.gnome.settings-daemon.plugins.media-keys screenshot ''
# Go to Settings -> Devices -> Keyboard and scroll to the end. Press + and you will create custom shortcut.
# Enter name: "flameshot", command: `/usr/bin/flameshot gui --path /home/kvz/Dropbox/Screenshots/`. # <-- replace 'kvz' with your username
# Set shortcut to PrtScr (print).

Make keyboard shortcuts, navigation, gestures, layout more like i had on macOS

This is highly personal so you'll probably only cherry-pick a few here

dconf write /org/gnome/deskstop/wm/keybindings/move-to-monitor-left "['disabled']"
dconf write /org/gnome/desktop/input-sources/xkb-options "['caps:escape']" # to swap vs map both to escape: "['caps:swapescape']". to reset: dconf reset /org/gnome/desktop/input-sources/xkb-options
dconf write /org/gnome/desktop/wm/keybindings/move-to-monitor-down "['disabled']"
dconf write /org/gnome/desktop/wm/keybindings/move-to-monitor-left "['disabled']"
dconf write /org/gnome/desktop/wm/keybindings/move-to-monitor-right "['disabled']"
dconf write /org/gnome/desktop/wm/keybindings/move-to-monitor-up "['disabled']"
dconf write /org/gnome/desktop/wm/keybindings/move-to-workspace-down "['<Super><Ctrl>Right','<Super><Ctrl>Down']"
dconf write /org/gnome/desktop/wm/keybindings/move-to-workspace-left "['disabled']"
dconf write /org/gnome/desktop/wm/keybindings/move-to-workspace-right "['disabled']"
dconf write /org/gnome/desktop/wm/keybindings/move-to-workspace-up "['<Super><Ctrl>Left','<Super><Ctrl>Up']"
dconf write /org/gnome/desktop/wm/keybindings/switch-applications "['<Ctrl>Tab','<Alt>Tab']"
dconf write /org/gnome/desktop/wm/keybindings/switch-applications-backward "['<Shift><Alt>Tab','<Shift><Ctrl>Tab']"
dconf write /org/gnome/desktop/wm/keybindings/switch-group "['<Ctrl>Above_Tab','<Alt>Above_Tab']"
dconf write /org/gnome/desktop/wm/keybindings/switch-group-backward "['<Shift><Ctrl>Above_Tab','<Shift><Alt>Above_Tab']"
dconf write /org/gnome/desktop/wm/keybindings/switch-input-source "['disabled']"
dconf write /org/gnome/desktop/wm/keybindings/switch-input-source-backward "['disabled']"
dconf write /org/gnome/desktop/wm/keybindings/switch-panels "['disabled']"
dconf write /org/gnome/desktop/wm/keybindings/maximize "['disabled']"
dconf write /org/gnome/desktop/wm/keybindings/unmaximize "['disabled']"
dconf write /org/gnome/desktop/wm/keybindings/switch-panels-backward "['disabled']"
dconf write /org/gnome/desktop/wm/keybindings/switch-to-workspace-down "['<Super>Right','<Super>Down']"
dconf write /org/gnome/desktop/wm/keybindings/switch-to-workspace-left "['disabled']"
dconf write /org/gnome/desktop/wm/keybindings/switch-to-workspace-right "['disabled']"
dconf write /org/gnome/desktop/wm/keybindings/switch-to-workspace-up "['<Super>Left','<Super>Up']"
dconf write /org/gnome/mutter/keybindings/switch-monitor "['XF86Display']"
dconf write /org/gnome/mutter/keybindings/toggle-tiled-left "['<Super><Ctrl><Alt>Left']"
dconf write /org/gnome/mutter/keybindings/toggle-tiled-right "['<Super><Ctrl><Alt>Right']"
dconf write /org/gnome/shell/keybindings/toggle-overview "['<Super>Space','<Ctrl>Space']"

# More macOS like tab navigation in the terminal
# Find all possible config keys via: gsettings list-recursively |grep Terminal
gsettings set org.gnome.Terminal.Legacy.Keybindings:/org/gnome/terminal/legacy/keybindings/ next-tab '<Primary>braceright'
gsettings set org.gnome.Terminal.Legacy.Keybindings:/org/gnome/terminal/legacy/keybindings/ prev-tab '<Primary>braceleft'
gsettings set org.gnome.Terminal.Legacy.Keybindings:/org/gnome/terminal/legacy/keybindings/ move-tab-left '<Primary><Shift>Left'
gsettings set org.gnome.Terminal.Legacy.Keybindings:/org/gnome/terminal/legacy/keybindings/ move-tab-right '<Primary><Shift>Right'
gsettings set org.gnome.Terminal.Legacy.Keybindings:/org/gnome/terminal/legacy/keybindings/ close-tab '<Primary>w'
gsettings set org.gnome.Terminal.Legacy.Keybindings:/org/gnome/terminal/legacy/keybindings/ new-tab '<Primary>t'
 
# Make dock more macOS like
gsettings set org.gnome.shell.extensions.dash-to-dock extend-height false
gsettings set org.gnome.shell.extensions.dash-to-dock dock-position BOTTOM
gsettings set org.gnome.shell.extensions.dash-to-dock transparency-mode FIXED
gsettings set org.gnome.shell.extensions.dash-to-dock dash-max-icon-size 32
gsettings set org.gnome.shell.extensions.dash-to-dock unity-backlit-items true
# to reset e.g.: $ gsettings reset org.gnome.shell.extensions.dash-to-dock dash-max-icon-size

# Activate Gnome Activities Overview on hot corner <-- careful some find this annoying
gsettings set org.gnome.shell enable-hot-corners true

# Disable left super overview, bind to Super Up (use alt-F1 or hot corner)
gsettings set org.gnome.mutter overlay-key ""

# Alt left click to move windows (without dragging the titlebar)
gsettings set org.gnome.desktop.wm.preferences mouse-button-modifier "<Alt>"
# Alt right click to resize windows (without dragging the titlebar)
gsettings set org.gnome.desktop.wm.preferences resize-with-right-button true

# Disable Alt-Ctrl-S minimizing windows (and freeing it up for VsCode Save-All)
gsettings set org.gnome.desktop.wm.keybindings toggle-shaded "['disabled']"

# Show directories above files
dconf write /org/gtk/settings/file-chooser/sort-directories-first true

Bug workarounds / fixes

# Remove ocra screenreader which was doing 100% CPU and making the system laggy
# Disable screenreader activitating on what used to be Save-All in vcode on osx
killall -9 orca \
  ; sudo apt purge orca \
  ; gsettings set org.gnome.settings-daemon.plugins.media-keys screenreader "['disabled']"

# Fix ENOSPC when watching many files (content repo)
echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p

# Remove Amazon launcher
sudo rm /usr/share/applications/ubuntu-amazon-default.desktop

How to enable all APT repos again after upgrading to a new release

From cosmic to eoan :

for f in /etc/apt/sources.list.d/*.list; do 
  sudo sed -i \
    -e 's/cosmic/eoan/g'\
    -e 's/^# \(.*\) # disabled on upgrade to.*/\1/g' \
  "${f}"
done

Games

Steam

# Steam
cd /tmp \
  && curl -sSLo steam.deb https://steamcdn-a.akamaihd.net/client/installer/steam.deb \
  && sudo apt install ./steam.deb \
  && cd -

AOEII

Start Steam, login, go to settings, advanced, check: Enable Steam Play for all Other titles. Latest Proto. Restart Steam. Now you can Install AOEII :)

Conclusion

If this makes you scared of trying something similar, good. Switching OSes is not for the faint-hearted. Especially to Linux. I read a Hacker News comment saying that

In a hotel (=on Mac), everything is stylish and cared for, but you have very little freedom to change things. At home (=on Linux), you need to do the dishes yourself but there's no external agenda. It's simply yours.

And even though there's enough to disagree with in analogy, it still resonated. I may still very keep visiting hotels, I may well buy Apple's next thing, but having the option now vs basically being forced is liberating.

As you noticed I have plenty complaints, but no regrets about adding Linux to the mix. Two weeks in, allowing time to tweak my habbit/taste, I was feel I'm more productive than I was before. That's mostly due to the OS being so robust and snappy, and also because it's finetuned to my routines more than I could reasonably do with macOS. Having GNU tools vs the minimalistic BSD versions helps, native/faster Docker helps, and having APT to install all the things is a godsent.

And say what you will about Electron being a memory hungry beast and so on, and yes that's true and if everything was written in ~Rust that'd be nice. But it is what allows me to make this jump now, at all.

On the one hand, yes Electron eats a lot of RAM and native apps are more efficient, BUT you can buy 16GB for $100 (and that will only get cheaper/more abundant), and we do finally get to have nice things on Linux, which is new and exciting. #vscode #slack

— Kev van Zonneveld (@kvz) September 4, 2019

Pretty much all my day-to-day tools are cross-platform now thanks to it, so I really even have the freedom to try Windows too. Although I was deep in Linux land when Ballmer said 'Linux is a cancer' and such, and so it will probably still take a few more years of Microsoft good-doing before I'm emotionally ready for something like that. Not having GPU support in the Linux that now ships with Windows, and seeing that Windows now offers ads in the start menu, as well as being a surveillance station by default, all don't help I'm afraid!

I'd love to hear what you think about all of this. Maybe I'm seeing it all wrong. I'd also like to hear what other tools you install to make your Linux install just right . I regard this post as a Work In Progress so it'll evolve with your feedback. Leave a note in thecomments below, on Twitter , Hacker News or Reddit .


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK