This is a step-by-step guide on setting up Arch Linux for personal daily use. The following video shows what we'll have at the end.
A few notes to begin with:
-
This is just my way to do things. You're free to have different preferences.
-
I've tried to keep things simple and include tips here and there so beginners can follow through.
-
A minimal background knowledge on Linux commands and Linux in general will be helpful, but isn't mandatory.
I will be using the GNOME desktop environment because it looks modern out of the box and gets the job done.
Boot into an Arch installation ISO and prepare yourself for a wonderful journey. (that was corny as hell but I'm keeping it)
Right off the bat, we can use tmux to spin up multiple tabs in the shell which can be really useful if we need to run other commands or write notes while the installation is running in another tab.
# run tmux which creates a single tab
tmux4 hotkeys is all you need to create and navigate around tabs.
| Hotkey | Action |
|---|---|
| Ctrl+B, C | Create a new tab |
| Ctrl+B, N | Switch to the next tab |
| Ctrl+B, P | Switch to the previous tab |
| Ctrl+B, , | Rename the current tab |
Usually, I keep at least 2 tabs and run the installation in the first tab.
# list stations (think WiFi drivers, for me there's only one: wlan0)
iwctl station list
# scan for WiFi access points
# (replace wlan0 with your station name)
iwctl station wlan0 scan
# list access points
iwctl station wlan0 get-networks
# connect to a certain access point
iwctl station wlan0 connect YOUR-WIFIarchinstall is a convenience tool that makes installing Arch orders of magnitude easier by automating the boring steps. We can type archinstall and hit [Enter] to start it.
Here are the settings I use in archinstall. I will only mention the ones that are different from the default values.
| Setting | Value |
|---|---|
| Mirrors > Select regions | Your country and a few more near it or on the same continent. |
| Mirrors > Optional repositories | multilib |
| Disk configuration > Partitioning | Depends on your setup, but don't use a swap partition as we'll handle swap later. I used Manual partitioning, chose my SSD, and then chose "Suggest partition layout" using the ext4 filesystem. I didn't enable creating a separate partition for the /home directory. |
| Swap | Enable swap on zram using the zstd compression algorithm. |
| Kernels | Just "linux" |
| Hostname | Up to you |
| Authentication > Root password | Won't tell you |
| Authentication > User account > Add user | Username and password are up to you. For "Should this user be a superuser (sudo)?" you should answer yes unless you never need root permissions (even temporarily). |
| Profile > Type | Desktop > GNOME |
| Profile > Graphics driver | All open-source (we'll cover switching to proprietary NVIDIA drivers later) |
| Profile > Greeter | gdm |
| Applications > Bluetooth | Enabled |
| Applications > Audio | pipewire |
| Applications > Print service | Enabled |
| Applications > Power management | power-profiles-daemon |
| Applications > Firewall | ufw |
| Applications > Additional fonts | All selected |
| Network configuration | Use NetworkManager (iwd backend) |
| Timezone | Up to you |
After dialing in the settings, we simply hit Install and wait for a while. If something goes wrong in the middle of the installation, search engines and LLMs are your friends.
Once the installation is over, you can remove your bootable USB (or whatever you're using) and restart into your new Arch system!
Throughout the journey, we'll need to run a lot of commands. In a graphical desktop environment, we use what's called a "terminal emulator" or console to run commands. By default, GNOME provides kgx which is simply named Console in the applications menu. This is what I'll be using, but you're free to use something with more features or eye candy.
nano is a terminal text editor available on almost any Linux shell you'll encounter. I personally use Visual Studio Code for editing text, but since we are in a fresh installation of Arch, we'll go with nano for now.
Package managers lets yo install, remove, and search for packages. Every Linux distro has a package manager pre-installed. In Arch Linux, we have pacman.
A package can be a program, game, library (for programming languages), theme, font, etc.
yay gives us access to tons of packages from the AUR (Arch User Repository) which contains almost any program, font, or theme you could imagine.
NOTE: The AUR is community-maintained and malicious packages can exist. Try to install things with pacman unless it only exists on the AUR, and even then, try to read and verify its PKGBUILD script if possible.
sudo pacman -S --needed --noconfirm git base-devel && \
tmpdir=$(mktemp -d) && \
trap 'rm -rf "$tmpdir"' EXIT && \
git clone https://aur.archlinux.org/yay-bin.git "$tmpdir/yay-bin" && \
cd "$tmpdir/yay-bin" && \
makepkg -siNext, install your favorite browser. For me, that's Firefox.
sudo pacman -S --noconfirm firefoxYou can search for both pacman and AUR packages using a yay command. Example:
yay -Ss game engine
The AUR has two significant problems.
-
A lot of packages build (compile) code on the user's machine. This has its own advantages, but it can take a long time to finish and many users frankly don't care about the potential benefits. Some packages do have
-binversions, but not all. -
More importantly, malicious code can and has gotten into the AUR, albeit mostly in orphan ("maintainer-less") packages which are rarely downloaded anyway. Still, ideally, we want zero malicious packages.
Chaotic-AUR is a community-driven project that automatically pre-builds many AUR packages and provides them through a pacman repository. It also uses automated checks to verify updates to AUR packages before building and publishing them.
Chaotic-AUR does NOT prevent malicious packages, but its automated checks have detected and prevented some in the past. Therefore, it's still recommended to prioritize the official pacman repos over both Chaotic-AUR and the regular AUR (which is ironically more chaotic).
The website provides an installation guide, if you're interested.
Use yay -Ss some keywords to search for different instances of the package. This searches through the official pacman repositories (core, extra, multilib), the Chaotic-AUR (chaotic-aur) if you've added it, and the regular AUR. Every item has a prefix denoting which repo it comes from. Here's a made-up example:
> yay -Ss some-package
aur/some-package 0.21-1
Some cool package
aur/some-package-git 0.29.r15
Some cool package
extra/some-package 0.30-2
Some cool package
chaotic-aur/some-package 0.21-1
Some cool package
Our hypothetical package has two versions on the AUR, one on "extra" (one of the official pacman repos: core, extra, multilib), and one on chaotic-aur (an unofficial pacman repo added manually). Typically, the one from an official pacman repo is preferred, so we can run either of these two commands:
sudo pacman -S some-package
sudo pacman -S extra/some-packageThe bottom one specifies exactly which repo we want to use. It wouldn't make a difference in this particular case, though, because "extra" comes before chaotic-aur in /etc/pacman.conf so it's already preferred by pacman.
If we wanted to get the Chaotic-AUR version instead, we would have to use the chaotic-aur/ prefix.
sudo pacman -S chaotic-aur/some-packageAnd if we wanted to use the AUR version for some reason, we would have to use yay instead of pacman. Without sudo. You do not use yay with sudo.
yay -S some-packageWhen you open a terminal, you're entering a shell. Shells in Linux allow you to run and combine commands in interesting ways. They're basically programming languages.
The most well-known shell is bash which is the default in Arch Linux, but it's quite old and something modern like zsh has a lot more to offer. Let's see how we can switch our default shell from bash to zsh.
# install zsh
sudo pacman -S --noconfirm zsh zsh-autosuggestions
# switch to zsh
chsh -s $(which zsh)Restart your terminal app and you shall see a first-time welcome message with a menu for setting different options based on your taste. Here's some of the more important ones I used.
| Setting | Value |
|---|---|
| Use the new completion system | Yes |
| Configure how keys behave | Emacs keymap |
If you need to re-run the zsh setup wizard in the future, you can invoke it by running autoload -Uz zsh-newuser-install; zsh-newuser-install -f.
By default, zsh has unintuitive keybinds for moving the text cursor, at least for a noob like me who has never worked with vim. For example, [Ctrl+LeftArrow] doesn't move to the previous word, [Home] doesn't go to the beginning of the line, and so on.
Unless you're a terminal nerd and enjoy weird keyboard moves, you can fix this by adding a few lines at the end of your .zshrc file. We'll get into what this file does soon. Run the following command to start editing .zshrc.
nano ~/.zshrcEvery user has a home directory at
/home/username(replaceusernamewith the name of the user). In most shells, we can simply use~as a shorthand for the current user's home directory. For example,~/Desktopis the same as/home/username/Desktop.
Now, go to the very bottom and paste these using [Ctrl+Shift+V].
autoload -Uz select-word-style
select-word-style bash
bindkey -e
# Home/End
bindkey '^[[H' beginning-of-line
bindkey '^[[F' end-of-line
# alternate Home/End sequences
bindkey '^[OH' beginning-of-line
bindkey '^[OF' end-of-line
# Ctrl + Left/Right
bindkey '^[[1;5D' backward-word
bindkey '^[[1;5C' forward-word
# alternate Ctrl + Left/Right
bindkey '^[[5D' backward-word
bindkey '^[[5C' forward-word
# Delete
bindkey '^[[3~' delete-char
bindkey '^[3~' delete-char
# Ctrl + Backspace
bindkey '^H' backward-kill-wordHit [Ctrl+O] and then [Enter] to save the file. Then, hit [Ctrl+X] to exit nano.
The zsh-autosuggestions plugin auto-completes our commands based on our command history which can come in real handy. To enable it, add the following line to .zshrc.
source /usr/share/zsh/plugins/zsh-autosuggestions/zsh-autosuggestions.zshBy now, you probably have some idea of what
.zshrcis. Put simply, it's a bunch of commands run by zsh as soon as you open a terminal. Other shells have their own versions of this. For example, bash has.bashrc.
p10k is a zsh theme that decorates the terminal with eye candy. We can install it from the AUR.
yay -S --noconfirm zsh-theme-powerlevel10k-bin-gitTo enable p10k, we need to edit .zshrc once again and add this line at the end:
source /usr/share/zsh-theme-powerlevel10k/powerlevel10k.zsh-themeAfter saving it and exiting the text editor (nano), run this command to reload .zshrc without restarting the terminal.
source ~/.zshrcYou will now be presented with the p10k configuration wizard which simply asks you a couple multi-choice questions on how you want your terminal to look.
.zshrc is a script zsh runs every time you open a terminal. Environment variables (think global settings every program can read), aliases, functions, and shell customization commands (i.e. loading plugins or themes) usually go here.
As an example, we can add an alias named pac for installing packages with pacman without typing out a long command every time.
alias pac="sudo pacman --color auto --needed --noconfirm -S"Now we can do pac firefox.
We can also "export" environment variables to let programs know our favorite text editor and file manager, for example. Only programs launched from the terminal will see these, though.
export EDITOR="code --wait"
export FILE_MANAGER=nautilusOf course, we haven't installed
code(Visual Studio Code) yet, and you might prefer another text editor, but this is just an example.
If you use the terminal a lot, you'll end up adding lots of little functions and aliases here to make your workflow faster. This is highly subjective and different for every person, so I recommend slowly building it up yourself instead of copying someone else's .zshrc.
The reason I have included my .zshrc in this repo is mostly to keep a backup, but also provide a reference for others. I hope it'll be helpful for someone.
These packages can help prevent headaches down the line regarding disk mounting.
sudo pacman -S --noconfirm ntfs-3g udiskie gvfs gvfs-mtp gvfs-gphoto2 gvfs-afc udiskie udisks2Make sure to restart your computer after this step.
Some of the volumes (drives) in my HDD use the NTFS file system and, even with the above packages installed, GNOME's file manager (nautilus) still fails to mount (think open or load) them and shows an error. Here's a permanent fix to that, unless you physically swap out your disk.
Use lsblk to see the list of disks and volumes on your system and write down the UUID(s) of the desired volume(s).
lsblk -fIn case you didn't know, in Linux, we typically create an empty directory in /mnt and then mount a volume onto that directory so that the contents of the volume appear there. The name of the directory is totally up to you and has nothing to do with the traditional "name" of the volume. I will use "Stuff" for this example.
sudo mkdir -p /mnt/Stuffsudo nano /etc/fstabAdd the following section at the end, replacing YOUR-UUID with the UUID you got earlier and /mnt/Stuff with your mount point.
# auto-mount NTFS volumes
UUID=YOUR-UUID /mnt/Stuff ntfs-3g defaults,noatime,uid=1000,gid=1000,umask=000 0 0
Hit [Ctrl+O, Enter] to save the file and [Ctrl+X] to exit nano.
Run sudo mount -a to apply the changes instantly without a restart. If you see an error here (other than the warning "your fstab has been modified, but systemd still uses the old version"), the internet is your friend. Otherwise, it should output nothing.
Finally, open the mount point directory in the file manager and bookmark it to make it easy to access.
nautilus /mnt/Stuff &Adding
&at the end of a command makes it non-blocking, meaning we can keep typing and running other commands in the meantime. Typically we want to usedisownas well (e.g.some-gui-program & disown).
Admittedly, this isn't the most important thing in the world, but pacman has a feature where it shows a cute little pacman animation when showing download progress, and I just have to enable it.
sudo nano /etc/pacman.confFind the line that says #VerbosePkgLists, and add this line below it:
ILoveCandy
NOTE: This is highly subjective and based on my own personal preferences. You are free to make your desktop look however you want it to.
-
Go to Settings > Appearance.
-
Click Add Picture to add your wallpapers and choose whatever you find more appealing. I usually keep my wallpapers in
~/Pictures/Wallpapers. -
Set Style and Accent Color to whatever you prefer or whatever works best with your wallpaper.
Because of my screen size and average viewing distance, I find 100% scaling too small and 125% too large, so I settle for increasing the font size. Of course, your case could be different.
-
Go to Settings > Display.
-
Adjust scale and other settings based on your conditions.
-
Open GNOME Tweaks (press [Super] to open Overview, then type Tweaks and hit [Enter]).
-
Go to the Fonts tab and set Scaling Factor to something you're comfortable with. For me, 1.13.
-
While you're at it, set Hinting to Full.
- Install the Kora icon theme and Bibata cursor theme from the AUR.
yay -S --noconfirm kora-icon-theme bibata-cursor-theme-bin- Install additional fonts
sudo pacman -S --needed --noconfirm ttf-jetbrains-mono ttf-jetbrains-mono-nerd inter-font awesome-terminal-fonts otf-font-awesome woff2-font-awesome
# beware, ttf-google is huge!
yay -S --needed --noconfirm ttf-google ttf-material-symbols-variable ttf-material-symbols-variable ttf-rethink-sans ttf-rethink-sans-variableSince I'm Iranian, I'll also install some Persian fonts. No matter where you live, there's probably a font pack for your language on the AUR.
yay -S --noconfirm vazirmatn-fonts ir-standard-fonts iranian-fonts vazir-code-fonts persian-fonts-
Go to Tweaks > Appearance.
-
Set Cursor to Bibata-Modern-Classic and Icons to Kora.
-
Switch to the Fonts tab in Tweaks.
-
Under Preferred Fonts, set Monospace Text to JetBrainsMono Nerd Font Light at size 11 (or whatever is comfortable for you).
-
Go to Tweaks > Windows.
-
Enable Maximize and Minimize in the Titlebar Buttons section.
-
In the Click Actions section, disable Attach Modal Dialogs.
Some apps use older versions of GTK (the GUI toolkit for most GNOME apps) and don't have the modern GNOME look. To fix that, we need to install and enable adw-gtk-theme.
sudo pacman -S --noconfirm adw-gtk-themeNow go to Tweaks > Appearance and set Legacy Applications to Adw-gtk3-dark (or Adw-gtk3 if you prefer that).
-
Go to Settings > Privacy & Security.
-
Set File History Duration to 30 days.
-
Enable Automatically Empty Trash and Automatically Delete Temporary Files and set Automatic Deletion Period to 30 days.
Workspaces are one of the best features a desktop can provide IMHO, but personally, I find the default settings a bit unintuitive.
-
Go to Settings > Multitasking.
-
Disable Hot Corner in the Screen Edges section.
-
In the Workspaces section, switch to Fixed Number of Workspaces and set Number of Workspaces to whatever works for you. For me, that's 6.
If you haven't used workspaces before, here's an example. You could put your browser in workspace 1, coding editor in workspace 2, music player in workspace 3, and so on.
Another reminder that these settings are subjective.
-
Go to Settings > Keyboard and click on View and Customize Shortcuts.
-
Find Show the notification list and set its shortcut to [Super+N].
-
Find Close window and set its shortcut to [Super+W].
-
Find Launch calculator and set its shortcut to [Super+Z].
-
Go to Custom Shortcuts and click Add Shortcut.
-
Add a new shortcut named Open Terminal and set the Command to
kgx &and the Shortcut to [Super+Q]. -
Add another one named Open Files with command
nautilus --new-windowand shortcut [Super+E]. -
One more: Open Mission Center,
missioncenter, [Ctrl+Shift+Esc].
We can now:
- Hit [Super+N] to open and close the notification panel.
- Hit [Super+W] to close the focused window.
- Hit [Super+Z] to open the calculator.
- Hit [Super+Q] to quickly open a new terminal window.
- Hit [Super+E] to open a new file manager window.
- Hit [Ctrl+Shift+Esc] to open Mission Center, once we install it in later steps.
Mission Center is similar to the task manager on Windows. It shows us how different programs are utilizing our hardware along with CPU and GPU usage graphs, temperature graphs, and so forth. We'll install Mission Center in later steps.
These are already set by default, but we can also:
- Hit [Super+A] to show the apps menu without going to the Overview first.
- Hit [Super+S] to open the quick settings panel without using the mouse.
For some reason, someone at GNOME thought single-user setups don't need a logout button, so they made it only show when there are multiple users on the system. To show it all the time, we can run this command.
gsettings set org.gnome.shell always-show-log-out true-
Open Files and go to its Preferences.
-
Enable Sort Folders Before Files.
-
Under Performance, set Search in Subfolders to All Locations and Show Thumbnails to All Files.
-
Install
nautilus-admin-gtk4.
yay -S --noconfirm nautilus-admin-gtk4You shall now see a new option Open as Admin on directories and Edit as Admin on some files.
Extensions can, without exaggeration, transform GNOME. We'll use a few popular ones to make our desktop way more enjoyable for daily driving.
- Install gnome-browser-connector.
This package allows us to install GNOME extensions directly from the browser.
sudo pacman -S --noconfirm gnome-browser-connector-
Install GNOME Shell Integration extension for your browser (Firefox, Chrome).
-
Install the following extensions:
- All-in-One Clipboard
- Blur my Shell
- Burn My Windows
- Color Picker
- Dash to Dock
- Edit Desktop Files
- GSConnect
- Hibernate Power Menu
- Just Perfection
- Slider Percentages
- Status Tray
- Switch Workspace
- Top Panel Workspace Scroll
Open Extensions from the app menu. Here you'll see a list of the extensions we just installed. Most of them have a settings button in their "three-dots menu".
-
In the Extensions app, open the settings for All-in-One Clipboard.
-
In the General section, set Width and Height to 420 and 450, respectively, and enable Hide Panel Icon.
-
In the Global Shortcuts section, set Open Clipboard Tab to [Super+V]
-
Go to the Features tab, turn on Enable Auto-Paste
-
Open a terminal and run
ibus-setupto open IBus Preferences. -
Go to the Emoji tab in IBus Preferences.
-
Click on ... for Emoji annotation.
-
For every item in the list, click on it and then hit Delete until the list is empty.
-
Hit OK and close IBus Preferences.
We can now open clipboard history with [Super+V] and use Emojis with [Super+.].
IBus is an Input Method Editor (IME). Learn more on Wikipedia if you're interested.
-
Open its settings and go to the Pipelines tab if not already there.
-
Under the Default pipeline, Click Manage effects.
-
Expand Native gaussian blur. Set Radius to 60 and Brightness to 0.45.
-
Click Add Effect and choose Noise. Expand it and set Noise to 0.15 and Lightness to 0.70.
-
Repeat the same steps for the Default rounded pipeline, making sure the Corner effect comes at the very bottom. Also, set the Radius of the Corner effect to 20.
-
Click Add Pipeline to add a new pipeline and name it Lockscreen.
-
Click Manage effects on the new Lockscreen pipeline and add a Native gaussian blur with a Radius of 100 and a Brightness of 0.60 followed by a Noise effect with the same values as in the Default pipeline.
-
Go to the Overview tab and set Overview components style to Light. In the Application folder blur section, set Sigma to 50 and Brightness to 0.60.
-
Go to the Applications tab and enable Applications blur.
-
Set Blur type to Dynamic, Sigma to 35, Brightness to 1.00, and Opacity to 215.
-
Disable Opaque focused window.
-
Prepare the applications which you want to have a translucent blurry background. For me, that's the default console (kgx) and text editor, so I'll have them open.
-
In the Whitelist section, hit Add Window and click on the app you want to get blurred.
-
Go to the Other tab. Under Lockscreen blur, set Pipeline to Lockscreen.
-
To avoid artifacts near rounded corners, it's recommended to install the gnome-rounded-blur helper script.
yay -S --noconfirm gnome-rounded-blurBlurry backgrounds are probably one of the greatest inventions in graphicals UIs.
-
Open its settings.
-
Disable everything and then enable TV Effect. Expand TV Effect and set Animation Time to 250 ms.
Now your windows will have a super cool TV effect when opening and closing!
-
The usual.
-
Turn off Enable systray.
-
Turn on Enable shortcut and set it to [Super+C].
We can now hit [Super+C] to pick a color anywhere on the screen and copy it to the clipboard.
-
Go to the Position and size tab.
-
There's a gear icon next to the toggle for Intelligent autohide. Click it.
-
Choose All windows under Dodge windows.
-
Set Animation duration to 0.150 s, Hide timeout to 0.0 s, and Pressure threshold to 100.
-
Close Intelligent autohide settings.
-
Set Icon size limit to 48 px.
-
Switch to the Launchers tab.
-
Under Show Applications icon, enable Move at beginning of the dock.
-
Disable Show trash can.
-
Disable Show volumes and devices.
-
Switch to the Behavior tab.
-
Disable Use keyboard shortcuts to activate apps.
-
Set Click action to Minimize and Scroll action to Cycle through windows.
-
Switch to the Appearance tab
-
Enable Shrink the dash and Show overview on startup.
This extension allows us to right click on an app icon and edit its .desktop file. Useful for both learning and modifying commands for certain apps.
No settings to change for this one!
This is the GNOME version of KDE Connect. You can install KDE Connect on your phone to transfer files between your desktop and phone and remote control your desktop too.
No settings to change for this one either.
-
Turn off Show Hybrid Sleep unless you actually use that feature.
-
Turn on Skip Hibernate Dialog.
NOTE: The hibernate button may not show up yet. We'll handle this in later sections.
-
Go to the Visibility tab.
-
Turn off Accessibility Menu unless you use it frequently.
-
Personally, I always use [Fn + ArrowUp/Down] instead of the Quick settings panel (at the top right) to adjust my keyboard's backlight, so I turn off Backlight Toggle Button here.
-
Switch to the Behavior tab.
-
Turn on Workspace Wraparound.
-
Switch to the Customize tab.
-
Set Panel Size to 32 px and Panel Icon Size to 16 px.
-
Set Workspace Switcher Size to 8%.
No settings to change for this one either either.
-
Set Icon Style to Original (colored).
-
Set Icon Size to 18 px and Padding between icons to 8 px.
-
In the Panel Overflow section, turn on Enable overflow icon, set Overflow button icon to Dynamic preview (colour), and set Inline icon limit to 3.
Set Switch Workspace Keybinding to [Super+Tab]. We can now use this hotkey to switch workspaces.
Another way to switch workspaces is to hold [Super] and scroll with your mouse. You can also hover your mouse over the workspace indicator at the top left and scroll there.
This one is an absolute must-have for me. It lets you switch workspaces by simply hovering over the top bar and scrolling with your mouse!
-
Turn on Wrap around and keep Show indicator off.
-
Set Minimum delay between scroll events to 50 ms.
A considerable number of apps use the Qt framework for their UI and, by default, they can look quite out-of-place in GNOME because of inconsistencies in styling. To fix this, we will install adwaita-qt, a Qt theme similar (enough) to GNOME's modern look.
- Install qt5ct and qt6ct. These are global control panels for Qt apps.
sudo pacman -S --noconfirm qt5ct qt6ct- Change global environment variables.
sudo nano /etc/environmentAdd QT_QPA_PLATFORMTHEME=qt6ct at the end.
- Install
adwaita-qt5-gitandadwaita-qt6-gitfrom the AUR.
yay -S --noconfirm adwaita-qt5-git adwaita-qt6-git-
Open qt5ct and qt6ct. They're named Qt5/6 Settings in the app menu.
-
In both control panels, go to the Appearance tab.
-
Set Style to Adwaita-Dark or Adwaita.
-
Set Color scheme to Style's colors.
-
Set Standard dialogs to GTK3.
-
Go to the Fonts tab and set General to Adwaita Sans and Fixed width to JetBrainsMono Nerd Font Light at whatever size is comfortable for you.
In my case, qt5ct was properly scaled based on my font scaling factor while qt6ct was not. Therefore, I had to use size 11 for the fonts in qt5ct and 12 in qt6ct.
-
Go to the Icon theme tab and double-click on Kora.
-
Hit OK to apply the changes.
-
Reboot.
Personally, I want my system to stay awake when I close my laptop lid. We can edit a system file to fix that.
sudo nano /etc/systemd/logind.confFind the three lines that say:
#HandleLidSwitch=suspend
#HandleLidSwitchExternalPower=suspend
#HandleLidSwitchDocked=ignore
For each line, remove the # at the beginning to uncomment it, and change the last word to ignore.
HandleLidSwitch=ignore
HandleLidSwitchExternalPower=ignore
HandleLidSwitchDocked=ignore
Save the file and exit the editor.
Our LARP wouldn't be complete without something like fastfetch, a command that shows a general overview of our system in the terminal.
sudo pacman -S --noconfirm fastfetchThe default options are fine on their own, but I like to change things up a bit.
mkdir -p ~/.config/fastfetch
nano ~/.config/fastfetch/config.jsoncHere are my settings.
Unless you have tons of RAM, you may occasionally run out of memory when using heavy applications or games, resulting in a freeze and jump back to the login screen.
The traditional solution to that is to put the extra bits onto the disk (in a swap file or partition), but that's slow, so some great developers made zram, a tool that compresses RAM into... RAM. In real time. Since reading and writing to RAM is a lot faster than a disk (even a fast SSD), this results in a net improve over disk-only swap.
Let's see how we can setup zram as well as a swap file for fallback.
# see the list of active swaps
swapon --show
# if any swapfiles show up, delete them
sudo rm -f /example-swapfile
# disable all swaps
sudo swapoff -a
# delete/comment lines where the third column (type) is swap, if any.
sudo nano /etc/fstab
# install zram
sudo pacman -S --needed --noconfirm zram-generator
# configure
sudo nano /etc/systemd/zram-generator.confHere's my zram config.
[zram0]
zram-size = ram * 0.5
compression-algorithm = zstd
swap-priority = 100Swappiness tells the system how much to prefer swapping out cold pieces of memory (i.e. rarely accessed memory pages). It's a unitless value and doesn't correspond to a single threshold or percentage. Rather, the kernel makes decisions based on several factors, and swappiness steers that decision around. A swappiness of 100 is recommended for zram.
echo "vm.swappiness=100" | sudo tee /etc/sysctl.d/99-swappiness.confNext, we'll add a swap file as a backup for when we fully run out of memory, even with compression. I think it's recommended to use the size of your RAM plus 1 GiB to allow hibernation, which we'll handle later. I have 16 GiB of RAM, so I'll create a 17 GiB swap file.
# make swapfile
sudo fallocate -l 17G /swapfile
sudo chmod 600 /swapfile
sudo mkswap /swapfile
sudo swapon /swapfile
# add fstab entry
echo "/swapfile none swap sw,pri=10 0 0" | sudo tee /etc/fstabNotice how the priority (pri=10 on the last line) is set to 10 which is lower than what we used for zram (swap-priority = 100). This means the swap file will only kick in when zram is exhausted.
Finally, we'll do a restart to start using our new optimized memory system.
Hibernation puts the contents of your RAM into the swap file and fully powers off the system. It's similar to suspend (sleep) but survives power and battery outages.
You can skip this section if you never need to hibernate your system.
- Edit
/etc/mkinitcpio.conf.
sudo nano /etc/mkinitcpio.conf-
Find the line that looks like
HOOKS=(...)(without a#at the beginning). -
Add
resumeafterblockand beforefilesystem. -
Save and exit.
-
Regenerate initramfs (initial RAM filesystem) for the kernel.
sudo mkinitcpio -P- Reboot.
If you've installed the Hibernate Power Menu GNOME extension as mentioned in a previous section, you should see a new Hibernate option in the power menu of the Quick settings panel.
Needless to say, this is different for every person. The following is just the list of programs and packages I use frequently or want to have installed on my system.
7zip amberol apostrophe audacity audio-sharing authenticator autoconf automake blanket blender calf celluloid clang cmake collision copyparty cpu-x curl darktable dconf-editor decoder discord element-desktop errands eyedropper fastfetch fd ffmpeg fzf gcc gimp git glider gnome-sound-recorder godot-mono gpu-viewer graphs handbrake harfbuzz helvum hieroglyphic identity impression kdenlive kget kicad kicad-library kicad-library-3d krita lazygit less libreoffice-fresh linux-headers lsof lsp-plugins lutris make man-db man-pages mission-center mplayer mpv ninja nodejs nvtop obs-studio openrgb patch pinta playerctl python-numpy python-opengl python-pillow python-pycurl python-requests python-yaml qbittorrent qpwgraph qrencode reaper reflector resources ripgrep rust shortwave spirv-tools steam telegram-desktop telegram-desktop totem typescript unrar unzip unzip v2ray-domain-list-community v2ray-geoip virtualbox virtualbox-ext-vnc virtualbox-host-dkms vlc vlc-plugins-all vulkan-headers vulkan-tools wget wl-clipboard yt-dlp zoxide
anydesk-bin debtap freedownloadmanager gapless gg-bin glcapsviewer-git google-chrome gradia heroic-games-launcher-bin jamesdsp localsend-bin material-maker-bin psiphonlinuxgui redsocks2 reflector-simple unified-remote-server v2rayn-bin ventoy-bin visual-studio-code-bin vulkan-caps-viewer-wayland-bin
My laptop has a dedicated NVIDIA GTX 1650 graphics card and, open-source drivers (like nouveau), as much as I support FOSS, just don't give the same experience as the real ones from the vendor.
You can skip this section if you don't have an NVIDIA GPU or are satisfied with nouveau.
- Install the relevant packages.
sudo pacman -S --needed --noconfirm nvidia-open nvidia-utils lib32-nvidia-utils nvidia-prime- Remove
xf86-video-nouveau.
sudo pacman -Rns xf86-video-nouveau- Blacklist nouveau.
sudo nano /etc/modprobe.d/blacklist-nouveau.confAdd the following lines and save the file:
blacklist nouveau
options nouveau modeset=0
- Regenerate initramfs (initial RAM filesystem) for the kernel.
sudo mkinitcpio -P- Install switcheroo-control to get the Launch Using Discrete Graphics Card option in GNOME.
sudo pacman -S --noconfirm switcheroo-control
sudo systemctl enable --now switcheroo-control- Reboot.
It's pretty rare, but occasionally a parent or guest needs to use my laptop for a simple task like web browsing or editing documents. Now, I don't want them to have full access to my main setup, so I create a guest account with a different password that they can use. Here's how we can do that.
-
Go to Settings > System > Users.
-
Hit Unlock at the top and enter your password to gain root permissions.
-
Hit Add User.
-
Set Full Name and Username to "guest" or whatever you prefer.
-
Keep Administrator off.
-
Hit Set password now and then Next.
-
Enter a password for the guest account and hit Add.
I've also adjusted some settings here and there in the guest user (e.g. set display scale to 125% and changed the wallpaper) to make the experience slightly better for the "guests".
Ignore this section if you have unrestricted internet access.
If you're in a highly controlled internet environment or country where most services (even some package repositories) are blocked, you probably already know about VPNs, V2Ray, proxies, etc., so I won't get into the details. In my case, I have a SOCKS5 proxy server running on my phone using the Every Proxy app which allows me to route my laptop's network traffic into the VPN that's running on my phone (e.g. Npv Tunnel, V2RayNG, Psiphon, etc.).
Below are three different methods for routing your network traffic through a SOCKS5 proxy server. We will assume an imaginary address of 192.168.1.5:1080 for the proxy server.
The simplest solution is to set the all_proxy environment variable. This only works in the current shell session and not all programs respect these values, but it can be effective when other methods are not feasible. It can also be used in the Arch installation shell (e.g. when running archinstall).
export all_proxy=socks5h://192.168.1.5:1080
export ALL_PROXY=$all_proxyv2rayN is a free and open-source GUI program that allows us to set system-wide proxies using different protocols supported by V2Ray (SOCKS5, VLESS, etc.).
-
Use the quick and dirty method from above to set environment variables for bootstrapping (because installing v2rayN itself requires access to the AUR).
-
Install v2rayN from the AUR.
yay -S --noconfirm v2rayn-bin-
Go to Configuration > Add [SOCKS], enter the address of the proxy server, and hit Confirm. You can also use Import Share Links from clipboard if you have a V2Ray share link in your clipboard.
-
Right click on the newly added item and click Set as active.
-
Switch to Set system proxy at the bottom. Enabling Tun mode doesn't seem to work properly for me, so I usually keep it off.
A couple things to keep in mind:
-
This is a wonky setup and doesn't work for some command-line apps, but most browsers and GUI apps should be fine.
-
v2rayN runs its own local SOCKS5 proxy server that other programs can use, even if you Clear system proxy. The address is usually 127.0.0.1:10808 by default.
A lot of programs (GUI and CLI) ignore proxy-related environment variables like all_proxy, and v2rayN's Tun mode doesn't always work reliably, but worry not! There's a tool named gg that routes a command's network traffic through a V2Ray config. For example, we can run gg curl https://google.com and it will proxy the entire command through a previously set V2Ray config or share link. gg is available on the AUR.
yay -S --noconfirm gg-binBelow is a zsh function that takes the address of a SOCKS5 proxy and sets the appropriate share link for gg. Feel free to add it to your .zshrc.
# set a SOCKS5 proxy config (share link) for gg. gg lets us proxy an entire
# command. for example: `gg curl https://google.com` will route the network
# traffic of that command through the previously set config or share link.
ggset() {
if [[ $# -ne 1 ]]; then
echo "usage: ggset <host:port>"
return 1
fi
gg config -w "node=socks://Og@$1"
}Example usage:
ggset 192.168.1.5:1080
gg some-command-that-requires-internetBetter yet, we can put our entire shell inside gg! This way, all our aliases and functions will be available as well.
# set V2Ray config for gg
ggset 192.168.1.5:1080
# enter a new zsh session inside our already running zsh
# session (zsh-ception!).
gg zsh
# any command will be routed through gg!
curl https://google.com
git clone ...
speedtest
custom-alias-from-zshrc
# exit our nested zsh session to stop proxying
exitThere are a few problems with this approach, though. First of all, if another program like v2rayN has already set values for proxy-related environment variables (e.g. all_proxy), it may interfere with gg. Secondly, sudo commands or anything that requires root permissions won't run inside the nested zsh session.
To fix both problems, I've created ggsh, a function that starts a zsh+gg session with the ability to run sudo commands when needed and makes the nested shell blind to proxy-related env vars to avoid interference. Feel free to add this to your .zshrc.
# start a zsh session with network traffic routed through gg
ggsh() {
env -u ALL_PROXY -u HTTP_PROXY -u HTTPS_PROXY \
-u all_proxy -u http_proxy -u https_proxy \
sudo -EH \
gg -n "$(gg config node)" \
sudo -EH -u "$USER" zsh
}Example usage:
ggset 192.168.1.5:1080
ggsh
# we are now inside a zsh+gg session
curl ...
sudo pacman -S ...
# exit to outer session when needed
exit
{ "$schema": "https://github.com/fastfetch-cli/fastfetch/raw/master/doc/json_schema.json", "logo": { "type": "small" }, "modules": [ "title", "separator", "os", "host", "kernel", "uptime", //"packages", "shell", "display", "de", "wm", //"wmtheme", //"theme", //"icons", //"font", //"cursor", "terminal", //"terminalfont", "cpu", "gpu", "memory", "swap", "disk", "localip", //"battery", "poweradapter", //"locale", "break", "colors" ] }