--- title: KDE description: The KDE Desktop Environment published: true date: 2023-04-30T02:13:34.300Z tags: editor: markdown dateCreated: 2023-04-28T07:55:35.043Z --- # Introduction This guide will set you up with a fresh Arch Linux installation combined with the KDE desktop environment and most of the applications you will ever need, And a graphical package manager in the case you need even more. But before we can go there you need to understand a few things. ## Basic Instructions Understand a command before you execute it, Executing code you don't understand is the best way to break your machine, let your machine get raped, get scammed, or end up in prison. So understand every letter of a command before you execute it. Be sure to read everything, On this page but also the output of the terminal. Not only because you need to know what you are doing, but also because there are a lot of parameters that need to be changed. No response means everything went well, If you get an error back make sure you typed the command correctly ## Basic Commands Troughout the guide we will use several basic commands, The guide assumes you know what they do, And I do not allow you to run a command you do not understand. `pwd` print working directory If you type `pwd` in a terminal and press enter it will show in which directory you are at the moment. `ls` list it will display all contents of the current directory. I would recommend using this with the options -a and -l `ls -la` would list all files including hidden files in a list with some handy details. `mkdir` make directory creates a directory. `mkdir bla` would create a folder called bla in the current directory `cd` change directory change to a different directory. `cd bla` would move you to the folder bla in the current directory. `touch` touch it will create a file and update the time if it already exists. `touch bla` would create an empty file called bla `cp` copy it will copy a file `cp file1 file2` would copy file1 to file2, `cp -r folder1 ../folder2` would copy folder 1 to folder2 next to this directory. `mv` move move does the same as copy, only it will move the file or folder and not leave a duplicate, This command is also used to rename files and folders using `mv file1 file2` will rename file1 into file2. `ln` link link is used to create links between files, kind of like "Shortcuts" on Windows. we create links like this `ln -sf realfile linkfile` now linkfile will point to realfile and if you make changes to one both will be affected. `exit` exit Kinda obvious, but here we exit the shell, if you open bash by typing `bash` pressing enter and then type `exit` and press enter you would be back in the terminal where you started. `reboot` reboot Also very obvious, this one reboots your machine, just type `reboot` and press enter `chmod` change mode With this you can change the permissions on a file or folder like so `chmod +x file` it would make file executable for everyone, you can do + and - to add and remove permissions, r is read, w is write and x is execute. You can also use numbers like so `chmod 755 file` it would give all permissions to the owner, but only read and execute for the group and others. 4 is read, 2 is write, 1 is execute, you can add them to give multiple rights, so 4 would be read, 6 would be read and write, 7 would be all rights. `chmod 421 file` would make the file readable for only the owner, writeable for only the group, and executable only for others. `chown` change owner This changes the owner of a file, a file has a owner, and a file belongs to a group, you can set both like so `chown owner:group file` file will now be owned by owner and belong to the group group. `echo` echo echo simply repeats whatever argument you give it `echo Hello` would print back "Hello" `sudo` super user do sudo allows you to execute commands as a different user it is mostly used for executing something as the root user `sudo bash` would open a new terminal as the root user. It is not recommended to use your system as the root user, therefore sudo was invented, just use sudo if you need to do something as root. But again, know what you execute. There are lots and lots more, but these are all you need to know for this guide. ## Basic Syntax ` ` space The space is a seperator, it seperates commands from the options and the options from the arguments, different forms of whitespace can be used `/` forward slash this means next folder if you lead with it you will get an absolute path `/home/user/file` is an absolute path. `./file` or `file` is a relative path, it will expect file in the current directory `.` period Current directory, you can use it as an argument for many commands it is most often used to execute something in or on the current directory like `./executable` or `chown user .` `..` double period Upper Directory, probably most often used for `cd` like so `cd ../..` to go up 2 directories you can also use it to execute a file in a relative directory like so `../folder/executable` `\` backslash Escape character, is used for lots of things, but we only use it for when we want to use a character that has a special meaning, for example space, if we want open a file with vim called "A B C" we would run this command `vim A\ B\ C` `>` Is Greater Than overwrite file, when you see this character in a command it is redirecting the output, for the scope of this guide we will use it to redirect output to a file but appending a file behind it, like so `echo Hello > file` will overwrite the content of file with Hello. `>>` Double Is Greater Than add to end of file, it does the same as the Greater Than above, but this one doesn't overwrite but adds the output on a new line in the file. `*` Asterisk wildcard, expands to everything you can use it to open all files in the current directory using `vim *` only open .c files with `vim *.c` or open all files in every folder `vim */*` ofcourse this also works with absolute paths. There are lots and lots more, but this is all the syntax you need to know for this guide ## Vim Basics Vim is this amazing text editor, it is without a doubt the best text editor in existance, you can do more with it than you will ever be able to remember. all in such a nice small extendable package. Yes emacs can do more, But we just want a text editor, not play tetris and browse the web :P One important thing to know about vim is that it uses different modes, and in the "normal" mode you can't insert characters normally. There are 3 modes in vim; Normal, Insert and Visual. Normal mode is the default mode in Vim, you can always go back to it from other modes by pressing `esc` on your keyboard. In Normal mode you can look at the file, execute commands that start with `:` search for something by pressing `/` and much much more. Insert mode is where we edit the file as if it was a normal text editor, you can press `i` to go into it after the cursor, there are different ways to get into it, but they are out of scope for this guide. Visual mode is not relevant for this guide, but you can use it, if you press `v` from normal mode you go into visual mode to select text, `d` to cut and `y` to copy. You can also select whole lines with `shift + v` and select a block with `ctrl + v` The last thing you need to know are commands, with these commands you can save a file, quit vim, or manipulate the text in ways you can't imagine, listing all commands and explaining it alone would make this guide much larger than it is now, so just a few relevant ones. go to the end of the line by pressing `$` go to the beginning with `0` go to the end of file with `G` go back to the beginning with `g` go to line 34 with `34gg` paste content with `p` cut a line with `dd` to save a file type `:w` and press enter to quit vim type `:q` and press enter to force an action like `q` and `w` add `!` to your command like this `:q!` or `:w!` You can also combine actions like so `:wq!` to execute a terminal command type `:! command` and press enter # Preparation ## Creating the Bootable USB First we need to download the latest version of the Arch installation media Open a webbrowser and go to https://www.archlinux.org/download/ Here you can download the latest image, I recommend using the Torrent or Magnet link, But if you don't have a torrent client you can scroll down for HTTP downloads. Wait for the download to finish. Next we need to burn the ISO file to an empty USB If you are already on Linux you probably know how to flash an image to USB, if not try to right click the .ISO file and open with image writer, Just select the right drive and click write/flash/revert If you are on Windows I recommend downloading Etcher https://www.balena.io/etcher/ Just download the portable version or install the normal version and open the program Select the .ISO file as the image, The USB as the drive and click flash After it is finished you should have a bootable Arch USB. ## Booting the USB Next we need to boot the USB drive, We need to get in the BIOS for that. Turn off the device and put the USB in the device and keep pressing f2/Del/etc while turning it on to get into your BIOS, Most of the times you will get a screen where it tells you which button you need to press to enter the BIOS When you are in the BIOS Navigate to the boot screen and make sure the USB is on top. In most cases you can change their priority with F5/F6 or +/-. Press F10, select yes and press enter to save the settings and reboot, Now you just have to wait untill you are logged in as the root user on the arch iso ## Check your boot mode Run the following command to see if you are running in UEFI mode ls /sys/firmware/efi/efivars If it shows you a bunch of filenames you are in UEFI mode. If you get an error you are in BIOS mode. If you are sure your system has UEFI disable legacy boot mode or force UEFI in the BIOS. If you can not get the USB to boot into UEFI you can use the legacy mode. Remember which boot mode you use, It will be important later on. ## Set your Keyboard Layout for the installation If you use US International as your keyboard layout you can skip this step. To list all available keyboard layouts run localectl list-keymaps navigate with the arrow keys to choose the right keyboard layout for your keyboard when you made your choice press q to quit and run the following command with your keyboard layout loadkeys layout for Turkey layout would be replaced with trq for German it would be replaced with de-latin1 If you have set a custom layout remember which layout you set, It will be important later on. ## Make sure you have a network connection If you are wired you can skip the WiFi step But test the connection either way. If you use Wifi or have no option to connect a cable run the following command iwctl You should spawn in an alternative prompt, run the following command to check for devices device list Remember the name of the device and use it in the following command to let it scan for networks station wlan0 scan Then run the following command to display the scan results station wlan0 get-networks And finally you should be able to connect using the Device name and the Network Name (SSID) station wlan0 connect SSID Simply enter the password of your wifi if it asks for it. then exit the alternative prompt with the following command exit run the following command to test your network connection. ping archlinux.org If you get a ping back hit CTRL + C and go to the next step It your network device is powered down it is probably soft blocked, in that case run the following command rfkill unblock all ## Make sure the time is set correctly Not having the right time will prevent your system from installing anything so run the following command timedatectl set-ntp true Check which disk you want to install Arch on Run the following command to list all connected drives fdisk -l Check which disk you want to install on, **/dev/sda** or **/dev/nvme0n1** for example, I am going to use **/dev/nvme0n1** from this point on, Remember or write down the drive you want to install on and always replace **/dev/nvme0n1** with the right drive. # Formatting Disks ## Partitioning the disk (UEFI) **Only do this part if you are in UEFI boot mode.** Start fdisk with the drive of your choice. fdisk /dev/nvme0n1 Now we are in fdisk, you can press m for help in the program, But if you do exactly as below everything should be alright #### Disk Options 1. Hit d and then enter untill there are no more partitions left. 2. Hit g Then press enter, This will make it a gpt disk #### Boot Partition 1. Press n and then enter to make our first partition 2. press 2 and press enter to give it partition number 2 3. just press enter to put it in the beginning of the disk 4. type +2G to give it 2GB for the boot partition and press enter 5. press t and press enter to set the type 6. skip this step if 2 is preselected otherwise, press 2 and press enter to select the second partition 7. type 1 and hit enter this will make the second partition an EFI partition. #### Swap Partition 1. press n and press enter to create our swap partition 2. press 3 and press enter to give it partition number 3 3. press enter again to put it next to the previous partition 4. type +8G to give it 8GB swap, If you have less ram I would recommend making it equal to your ram, So +4G if you have 4GB Ram. 5. press t and press enter to set the type 6. press 3 and press enter to select the third partition 7. type 19 and hit enter this will make the third partition a Swap partition. #### Root Partition 1. press n to create our final root partition 2. press 1 and press enter to give it partition number 1 3. press enter again to put it next to the previous partition 4. press enter again to give it the remaining space on the disk. 5. press t and press enter to set the type 6. press 1 and press enter to select the first partition 7. type 20 and press enter this will make the first partition a Linux filesystem. #### Apply changes 1. Finally hit w and press enter to write all changes to disk ## Partitioning the disk (BIOS) **Only do this part if you are in BIOS boot mode.** Start fdisk with the drive of your choice. fdisk /dev/nvme0n1 Now we are in fdisk, you can press m for help in the program, But if you do exactly as below everything should be alright #### Disk Options 1. Hit d and then enter untill there are no more partitions left. 2. Hit o Then press enter, This will make it a mbr disk #### Boot Partition 1. Press n and then enter to make our first partition 2. press p and press enter to make it a primary partition 3. press 2 and press enter to give it partition number 2 4. just press enter to put it in the beginning of the disk 5. type +2G to give it 2GB for the boot partition 6. press t and press enter to set the type 7. press 2 and press enter to select the second partition 8. type 83 and hit enter this will make the second partition an EFI partition. #### Swap Partition 1. press n and press enter to create our swap partition 2. press p and press enter to make it a primary partition 3. press 3 and press enter to give it partition number 3 4. press enter again to put it next to the previous partition 5. type +8G to give it 8GB swap, If you have less ram I would recommend making it equal to your ram, So +4G if you have 4GB Ram. 6. press t and press enter to set the type 7. press 3 and press enter to select the third partition 8. type a and hit enter this will make the third partition a Swap partition. #### Root Partition 1. press n to create our final root partition 2. press p and press enter to make it a primary partition 3. press 1 and press enter to give it partition number 1 4. press enter again to put it next to the previous partition 5. press enter again to give it the remaining space on the disk. 6. press t and press enter to set the type 7. press 1 and press enter to select the first partition 8. type 82 and press enter this will make the first partition a Linux filesystem. #### Apply changes 1. Finally hit w and press enter to write all changes to disk ## Format Partitions Now we have set the partitions and the labels now we are going to format them all Be sure that you replace /dev/nvme0n1p# with the correct drive and partition If if is /dev/sda be sure to include the partition number /dev/sda1, /dev/sda2 and /dev/sda3. For the /dev/nvme0n1 you need to add a p and then the partition number so /dev/nvme0n1p1, /dev/nvme0n1p2 and /dev/nvme0n1p3 First we need to give the root partition a filesystem You can opt for btrfs, f2fs or ext4. btrfs is a newer filesystem with a lot of very cool features, It is not great for databases tho, so if you plan to go for a server it is not the best choice if your database is going to be on your root partition. I have not tested this one with encryption. But let me know how it goes :) f2fs is made with SSDs in mind, it might be the best choice for SSDs. Also not tested this one with encryption, But let me know how it goes :) ext4 is very stable and thourogly tested, you can't really go wrong with this one. So pick a single one of the following options mkfs.btrfs /dev/nvme0n1p1 mkfs.f2fs /dev/nvme0n1p1 mkfs.ext4 /dev/nvme0n1p1 Then we make the boot partition fat 32 mkfs.fat -F32 /dev/nvme0n1p2 Make partition 3 swap mkswap /dev/nvme0n1p3 Then enable swap on partition 3 swapon /dev/nvme0n1p3 ## Full Disk Encryption (Optional) **Encryption is completely optional, If you don't want it, just skip this step completely.** Many things can go wrong, and if you forget your password the data is lost, Nothing you can do to recover it. Use it at your own risk. I would recommend Encryption for Mobile devices that hold sensitive data, Laptops you take with you for example. I would not recommend Encryption for desktops, unless you are worried someone can get physical access. make the root partition an LUKS partition cryptsetup -y -v luksFormat /dev/nvme0n1p1 Mount the encrypted partition to cryptroot cryptsetup open /dev/nvme0n1p1 cryptroot Create a ext4 filesystem on the encrypted partition mkfs.ext4 /dev/mapper/cryptroot You can also encrypt swap if you want to swapoff /dev/nvme0n1p3 cryptsetup -y -v luksFormat /dev/nvme0n1p3 cryptsetup open /dev/nvme0n1p3 cryptswap mkswap /dev/mapper/cryptswap swapon /dev/mapper/cryptswap You can encrypt any partition you want, just don't encrypt the boot partition because this guide doesn't cover that, and it is pretty useless imho. ## Mounting the partitions now we are going to mount the 2 partitions and create the /boot directory Be sure that you replace /dev/nvme0n1p# with the correct drive and partition If it is /dev/sda be sure to include the partition number /dev/sda1 and /dev/sda2. If it is /dev/nvme0n1 you need to add a p and then the partition number so /dev/nvme0n1p1 and /dev/nvme0n1p2. mount the first partition to /mnt, if you use encryption you mount /dev/mapper/cryptroot here mount /dev/nvme0n1p1 /mnt create the /boot directory mkdir /mnt/boot mount the second partition to /mnt/boot mount /dev/nvme0n1p2 /mnt/boot # Base Install ## Install the base system The following command will install the base system and a text editor we need later on. pacstrap /mnt base base-devel vim ## Install a Kernel You can stick to the normal kernel, but you have options For Desktop use I would recommend the zen kernel For A Server I would recommend the hardened kernel so install the kernel you want with one of the following commands pacstrap /mnt linux linux-headers pacstrap /mnt linux-zen linux-zen-headers pacstrap /mnt linux-hardened linux-hardened-headers ## Generate the fstab file Generating the fstab file will take all mounted partitions and add them to a file so they mount at boot so if you have any more drives you want to mount at boot mount it before you run the command. Run the following command genfstab -U /mnt > /mnt/etc/fstab ## chroot into the new system chroot is a tool to treat any directory as its root directory, In a way we "break" into the system from the live image, So we will switch from USB to your drive with the following command. arch-chroot /mnt ## Set your timezone and time If you are unsure about your timezone you can list all timezones with the following command. timedatectl list-timezones go up and down with the arrows look for your timezone and hit q to exit. Next we are going to change the timezone to the one you selected ln -sf /usr/share/zoneinfo/your/timezone /etc/localtime Replace your/timezone with your correct timezone Europe/Amsterdam for example Finally run hwclock to generate the time file hwclock --systohc ## Generate the locale and set the language run the following command and remove the # in front of en_US.UTF-8 UTF-8 and any other locales you need. vim /etc/locale.gen Hit esc then :wq and enter to save and exit Run the following command to generate the locales locale-gen Next we are going to set the language run the following command vim /etc/locale.conf The language you want your system to be should be in this file in this form, if you want it Dutch for example you change en_US.UTF-8 to nl_NL.UTF-8 ``` LANG=en_US.UTF-8 ``` Hit esc then :wq and enter to save and quit If you have not set a different keyboard layout in the earlier part "Set your keyboard layout for installation" you can skip the rest of the commands in this step. If you have set a different layout back in the earlier part "Set your keyboard layout for installation" run the following command vim /etc/vconsole.conf add the keyboard layout you set in the beginning. ``` KEYMAP=layout ``` layout should be trq for Turkish and de-latin1 for German Hit esc then :wq and enter to save and quit ## Set the hostname and hosts file Next we are going to set the hostname, This is the name of your device in the local network. vim /etc/hostname enter a good name for your device without any capital letters or spaces. You can just call it laptop or personal-computer ``` coolcomputername ``` Hit esc then :wq and enter to save and quit Now we have to create a file, run vim /etc/hosts Type exactly whats below replacing yourdevicename with the name you just gave your device in /etc/hostname You can use the tab key for the spaces to make it lign up properly ``` 127.0.0.1 localhost ::1 localhost 127.0.1.1 yourdevicename.localdomain yourdevicename ``` Hit esc then :wq and enter to save and quit ## Set the root password now we have to set a root password The root user is like the superuser or administrator account, You will need this password to update your system or change anything outside your personal home folder. run the following command then type your new password, hit enter, then again to confirm. passwd ## Configure Pacman Pacman is the PACkage MANager of Arch Linux, It is great, but we can make it even better :) First we are going to open the pacman.conf file to make some adjustments vim /etc/pacman.conf Under Misc Options uncomment UseSysLog, Color and Parallel Downloads You can also up the number. And add ILoveCandy to get the other Pacman to appear too :) ``` # Misc options UseSyslog Color #NoProgressBar CheckSpace #VerbosePkgLists ParallelDownloads = 16 ILoveCandy ``` Also add base and grub after HoldPkg ``` HoldPkg = pacman glibc base grub ``` Hit esc then :wq and enter to save and quit Next up are the mirrors, The defaults are okay and this takes a while, but for faster speeds I would seriously recommend this step. So go ahead and install reflector pacman -S reflector then just run reflector with the following command reflector --latest 200 --protocol https --sort rate --save /etc/pacman.d/mirrorlist You will see a bunch of errors but that is normal, just let it run and wait untill the prompt shows up again. ## Install Microcode (Optional) PROPRIETARY Now we are going to install the microcode, this is PROPRIETARY but it will improve stability, choose the right one for your CPU, you can install none if you are in doubt or don't want any non free software on your machine. AMD pacman -S amd-ucode Intel pacman -S intel-ucode ## install and configure grub grub stands for GRand Unified Bootloader just so you know. Now we are going to install grub, only do UEFI or BIOS depending on your system UEFI pacman -S grub efibootmgr grub-install --target=x86_64-efi --efi-directory=/boot --bootloader-id=Arch grub-mkconfig -o /boot/grub/grub.cfg BIOS pacman -S grub grub-install --target=i386-pc /dev/nvme0n1 grub-mkconfig -o /boot/grub/grub.cfg ## Full Disk Encryption (Optional) if you did the first Encryption part you can NOT skip this step If you did not go for disk encryption after formatting the disks you MUST skip this step First we need to get the UUID of the root partition of /dev/nvme0n1p1 in this case and remember it blkid We need to include it in the grub config so open the grub file vim /etc/default/grub Look for the following GRUB_CMDLINE_LINUX_DEFAULT somewhere at the top ``` GRUB_CMDLINE_LINUX_DEFAULT="loglevel=3 quiet" ``` Adjust it so the line looks like this remember that you have to replace UUID with the correct UUID. ``` GRUB_CMDLINE_LINUX_DEFAULT="loglevel=3 quiet rd.luks.name=UUID=root root=/dev/mapper/root" ``` Now let grub generate a new config file grub-mkconfig -o /boot/grub/grub.cfg Open the mkinitcpio.conf file vim /etc/mkinitcpio.conf Look for the following HOOKS line, it should be somewhere at the bottom ``` HOOKS=(base udev autodetect modconf block filesystems fsck) ``` Make it look like this (order is important) ``` HOOKS=(base systemd autodetect keyboard modconf block sd-encrypt filesystems fsck) ``` finally run the following command to generate the new image mkinitcpio -p linux ## Creating the user Now it is time to create a user account, This is where you log into, It can do almost everything except install software or change things outside of your personal folder. you need to remember your username and you can not have capital letters in your username useradd -m yourusername Set a password for the user, You will log into the device with this password, You can make it the same as the root account. passwd yourusername enter a new password and press enter twice ## install and configure sudo Sudo allows you to do root stuff while logged in as a user, It will probably become your most used command so install it. pacman -S sudo Now we need to add your username to the sudoers file, run the following command vim /etc/sudoers Look for the lines under User Privilege Specification There should be a line root ALL=(ALL) ALL Add your username in the exact same manner one line below it so that part looks like this. ``` root ALL=(ALL:ALL) ALL yourusername ALL=(ALL:ALL) ALL ``` You can also make your computer try to insult you if you enter a wrong password, Just add a line with the following content under the Defaults Specification ``` Defaults insults ``` Hit esc then :wq and Enter to save and quit # DE Installation ## Installing KDE simply run the command and let it run, pacman -S sddm plasma-desktop xorg networkmanager kde-applications plasma-wayland-session plasma-nm this one could take a while, but after it is done enable Networkmanager and sddm systemctl enable NetworkManager systemctl enable sddm ## Set the SDDM keyboard layout If you use the US keyboard layout you can skip this step. We need to do this before we restart because if you have any strange characters in your password it might be hard getting in. So we are going to edit the following file nano /usr/share/sddm/scripts/Xsetup Edit the file and add in the following line setxkbmap "dk, us" You can change the country codes here, the first one will be the default one selected. If you don't know which one you need you can list them all with the following command localectl list-keymaps We will change the keyboard layout in KDE later on after we are in the Desktop Environment ## Reboot into Desktop Environment Run the following command to escape from the chroot exit Run the following command to restart reboot Remove the USB when your screen turns black and it should boot into the sddm, here you can enter your password and this should bring you into KDE Plasma ## KDE Tweaks If you use a laptop, having some power management features can be very handy. Things like changing the screen brightness, advanced power management and settings for different states. Install powerdevil with the following command sudo pacman -S powerdevil Go to the settings, there should be an icon in the taskbar On the first page you can change the theme to Dark, Speed up the animation speed and select files by clicking them instead of opening them immediately. Also be sure to set the correct timezone, you can also right click on your taskbar and then adjust every little thing on there to your liking. I would recommend adjusting the digital clock to ddd d MMM and include the second for example. If you have a different keyboard layout than US you need to adjust it here too. under input devices and click on the layouts tab here, Check the configure layouts checkbox and add all the keyboard layouts you need, After a reboot you will be able to switch easily by just clicking on the layout in the taskbar. After a reboot it should all work just fine # Terminal ## Installing ZSH ZSH is a pretty cool lightweight shell that is very configurable, Install it with the following command sudo pacman -S zsh Now we are going to make ZSH the default shell with the following command chsh -s $(chsh -l | grep -m1 zsh) We are going to create zshrc config files in a central config folder for easy backups. mkdir ~/Config then create 2 files in there touch ~/Config/zshrc-global ~/Config/zshrc-user Now we need to create a new user zsh config folder mkdir ~/.config/zsh now we are going to symlink the config files to where zsh expects them to be sudo ln -sf ~/Config/zshrc-global /etc/zsh/zshrc ln -sf ~/Config/zshrc-user ~/.config/zsh/.zshrc Now we need to set the dotfile location in zshenv sudo vim /etc/zsh/zshenv Add in the following line export ZDOTDIR=~/.config/zsh Save and exit ZSH should be functional with a terrible prompt, so lets fix that first. ## Installing a Powerline Font We are gonna need the right fonts for all the icons sudo pacman -S ttf-meslo-nerd Change the terminal/monospace font to MesloLGS NF Regular in your terminal or DE settings ## Configuring Guake Guake is my terminal of choice, I like that it can split the window and it opens and closes fullscreen with a single button nice quick and easy. For KDE users there is Yauake, It is very much like Guake, but there are a ton more Guake clones out there, You should be able to follow this guide for most of them. Install Guake with the following command sudo pacman -S guake Now open guake preferences from your menu. Under General disable the tray icon and the startup popup Under Main Window Disable the Tab Bar and put the height and width full Under Appearance Set Meslo LGS Nerd Font Regular as your font, set Tango as your color scheme and set the transparency to your liking. Under Keyboard Shortcuts I set "Toggle Guake Visibility" to \`, this can give problems, in this case also set the hotkey in your DE to "guake", set "Split tab vertical" to CTRL + N, "Split tab horizontal" to CTRL + B, "Focus terminal above" to Ctrl + Up, "Focus terminal below" to Ctrl + Down, "Focus terminal on the left" to Ctrl + Left, "Focus terminal to the right" to Ctrl + Right, "Increase heigth" to Ctrl + Shift + Down, "Decrease Height" to Ctrl + Shift + Up, "Increase transparency" to Ctrl + Shift + Left and finally "Decrease transparancy" to Ctrl + Shift + Right Ofcourse you can config anything else you like, but for me this is enough ## Configuring Alacritty I use Alacritty for a quick and fast terminal it works especially great with tiling window managers you can install it with the following command sudo pacman -S alacritty First we are going to create a config file for Alacritty touch ~/Config/alacritty.yml Now we are going to create the config folder alacritty expects mkdir ~/.config/alacritty And finally symlink the file to the location alacritty expects it to be. ln -sf ~/Config/alacritty.yml ~/.config/alacritty/alacritty.yml Now it is time to configure alacritty using the file nvim ~/Config/alacritty.yml We are gonna need some fonts to properly display the icons with our theme so add in the following lines, you can change the font, But I recommend putting this one first to follow along with the guide. ``` # MesloLGS font font: normal: family: MesloLGS Nerd Font style: Regular bold: family: MesloLGS Nerd Font style: Bold italic: family: MesloLGS Nerd Font style: Italic bold_italic: family: MesloLGS Nerd Font style: Bold Italic size: 11 ``` Setting a nice color theme is vital, The same applies here, you can change it later, but I recommend just following along for now. There are tons of color schemes available. ``` #Tango color theme colors: primary: background: '#000000' foreground: '#ffffff' normal: black: '#000000' red: '#cc0000' green: '#4e9a06' yellow: '#c4a000' blue: '#3465a4' magenta: '#75507b' cyan: '#06989a' white: '#d3d7cf' bright: black: '#555753' red: '#ef2929' green: '#8ae234' yellow: '#fce94f' blue: '#729fcf' magenta: '#ad7fa8' cyan: '#34e2e2' white: '#eeeeec' ``` Spawn a new terminal in the current location with CTRL + SHIFT + N ``` key_bindings: - { key: N, mods: Control|Shift, action: SpawnNewInstance } ``` ## Powerlevel10K Powerlevel10K is a great theme for ZSH, it is very configurable and has a lot of cool features Sadly it is unmaintained, but it works fine, we can clone the repo into our /usr/share folder. sudo git clone https://github.com/romkatv/powerlevel10k.git /usr/share/zsh-theme-powerlevel10k/ Now we need to include the following lines in our zshrc-global file ``` #P10k source /usr/share/zsh-theme-powerlevel10k/powerlevel10k.zsh-theme ``` And the following lines to our zshrc-user file ``` #P10k [[ ! -f ~/.config/zsh/.p10k.zsh ]] || source ~/.config/zsh/.p10k.zsh ``` To configure Powerlevel10K you must run the following command p10k configure Have some patience and run trough the interactive configuration Now we just need to symlink the config file to the expected location ln -sf ~/Config/p10k.zsh ~/.config/zsh/.p10k.zsh When you exit the terminal and start it again it should look all nice :) ## Installing LSD lsd is like ls with colors, nice icons and other visual cues that help you. It is in the repos, simply install it with the following command sudo pacman -S lsd You can now run it with lsd, we will later alias ls to lsd in our zsh configuration. try the following command for example lsd -la ~ ## Adding ZSH Options and Keybinds ZSH options change the default behavior so do keybinds You can add them all or just the ones you like to your zshrc-global file Give flag suggestions for programs ``` autoload -Uz compinit && compinit ``` Gives you a menu when navigating suggestions ``` zstyle ':completion:*' menu select zstyle ':completion::complete:*' gain-privileges 1 ``` History settings for ZSH ``` export HISTFILE=~/.config/zsh/.zsh_history export HISTSIZE=1000000 export SAVEHIST=1000000 setopt EXTENDED_HISTORY setopt HIST_IGNORE_ALL_DUPS setopt HIST_FIND_NO_DUPS setopt inc_append_history ``` Press up and down to search to matching history ``` bindkey "^[[A" history-beginning-search-backward bindkey "^[[B" history-beginning-search-forward ``` Case insensitive tab completion, Also enables cd doc/fo/su to go to /documents/folder/subfolder ``` zstyle ':completion:*' matcher-list 'm:{a-z}={A-Z}' 'r:|[._-]=* r:|=*' 'l:|=* r:|=*' ``` I really don't see the use for Flow Control ``` unsetopt flow_control ``` Fix navigation keys ``` bindkey "^[[H" beginning-of-line bindkey "^[[F" end-of-line bindkey "^[[3~" delete-char bindkey "^[[5~" beginning-of-line bindkey "^[[6~" end-of-line ``` ## Adding Aliases Aliases are simply alternatives for a string of text, as an easy example, v will type nvim, and sv will type sudo nvim. You can also chose to remove some or add more. Simply add the following text to one of your ~/config/zshrc files, user will set it for you, and global will set it for everyone, ``` alias a="awk" alias b="btrfs" alias c="cryptsetup" alias d="docker" alias e="echo" alias f="fdisk" alias g="git" alias h="history" alias j="jobs -l" alias k="kubectl" alias l="ls -la" alias m="man" alias n="neofetch" alias o="openssl" alias p="pacman" alias r="reboot" alias s="sudo" alias t="tail -f" alias u="uname" alias v="nvim" alias w="whence" alias sudo="sudo " alias ffs="sudo !!" alias distro="cat /etc/*-release" alias hk="cat ~/config/hotkeys" alias sv="sudo v" alias md="mkdir -p" alias tk="take" alias rmd="rm -rf" alias sgrep="grep -R -n -H -C 5 --exclude-dir={.git,.svn,CVS} " alias hgrep="fc -El 0 | grep" alias please='sudo' alias phone='ssh houtworm@pinephone' alias server='ssh houtworm@server' alias game='gamemoderun mangohud' alias ytflac="youtube-dl -x --audio-format flac --prefer-ffmpeg" alias ytmkv="youtube-dl -F" alias lol='lolcat' alias cd1="cd .." alias cd2="cd ../.." alias cd3="cd ../../.." alias cd4="cd ../../../.." alias cd5="cd ../../../../.." alias cd6="cd ../../../../../.." alias cd7="cd ../../../../../../.." alias cd8="cd ../../../../../../../.." alias cd9="cd ../../../../../../../../.." alias scls="systemctl list-unit-files" alias scs="sudo systemctl status " alias scre="sudo systemctl restart " alias scst="sudo systemctl start " alias scsp="sudo systemctl stop " alias scen="sudo systemctl enable " alias scenn="sudo systemctl enable now " alias scdi="sudo systemctl disable " alias fwd="firewall-cmd" alias fwdlist="firewall-cmd --list-all-zones" alias fwdre="firewall-cmd --reload" alias gi="git init" alias ga="git add *" alias gc="git commit -m" alias gp="git push" alias me="ifconfig | grep "inet " | cut -b 9- | cut -d" " -f2" alias allcolor="for i in {0..255}; do print -Pn "%K{$i} %k%F{$i}${(l:3::0:)i}%f " ${${(M)$((i%6)):#3}:+$"\n"}; done" alias rainbow="printf "$BBLA\n$BRED\n$BGRE\n$BYEL\n$BBLU\n$BMAG\n$BCYA\n$BWHI\n\n"" alias dud="du -d 1 -h" alias duf="du -sh *" alias :q="exit" alias ls="lsd" alias ports="netstat -tulanp" alias compr="gcc -Wall -Wextra -Werror *.c && ./a.out && rm a.out" alias compra="gcc -Wall -Wextra -Werror *.c && ./a.out" alias norme="norminette -R CheckForbiddenSourceHeader" alias valg="gcc *.c -ggdb3 && valgrind --show-leak-kinds=all --leak-check=full --track-origins=yes ./a.out && rm a.out" alias valga="gcc *.c -ggdb3 && valgrind --show-leak-kinds=all --leak-check=full --track-origins=yes ./a.out" alias normsh="checkbashisms" alias banned='sudo fail2ban-client banned | tr -t "[{" " \n" | tr -d ":]},"' ``` ## Adding ZSH Functions ZSH functions are like tiny scripts that perform a task, you can add the ones you think are useful to you to one of the zshrc files, I suggest global so anyone can use them :) Press Ctrl + Z to bring stuff to the background but also bring stuff back to the foreground instead of typing fg ``` backforeswitch () { if [[ $#BUFFER -eq 0 ]]; then BUFFER="fg" zle accept-line -w else zle push-input -w zle clear-screen -w fi } zle -N backforeswitch bindkey '^Z' backforeswitch ``` Press Esc twice to put sudo in front of your previous command. ``` sudoswitch() { [[ -z $BUFFER ]] && zle up-history if [[ $BUFFER == sudo\ * ]]; then LBUFFER="${LBUFFER#sudo }" elif [[ $BUFFER == $EDITOR\ * ]]; then LBUFFER="${LBUFFER#$EDITOR }" LBUFFER="sudoedit $LBUFFER" elif [[ $BUFFER == sudoedit\ * ]]; then LBUFFER="${LBUFFER#sudoedit }" LBUFFER="$EDITOR $LBUFFER" else LBUFFER="sudo $LBUFFER" fi } zle -N sudoswitch bindkey "\e\e" sudoswitch bindkey -M vicmd '\e\e' sudoswitch ``` Make the man pages all colorful ``` function man() { env \ LESS_TERMCAP_mb=$(printf "\e[1;31m") \ LESS_TERMCAP_md=$(printf "\e[1;31m") \ LESS_TERMCAP_me=$(printf "\e[0m") \ LESS_TERMCAP_se=$(printf "\e[0m") \ LESS_TERMCAP_so=$(printf "\e[0;37;102m") \ LESS_TERMCAP_ue=$(printf "\e[0m") \ LESS_TERMCAP_us=$(printf "\e[4;32m") \ PAGER="${commands[less]:-$PAGER}" \ _NROFF_U=1 \ GROFF_NO_SGR=1 \ PATH=${HOME}/bin:${PATH} \ man "$@" } ``` Creates a TAR archive of a file or folder. ``` function maketar() { tar cvzf "${1%%/}.tar.gz" "${1%%/}/"; } ``` Create a ZIP archive of a file or folder. ``` function makezip() { zip -r "${1%%/}.zip" "$1" ; } ``` Extracts any type of archive automagically ``` function extract { if []; then echo "Usage: extract ." else if [] ; then case $1 in *.tar.bz2) tar xvjf $1 ;; *.tar.gz) tar xvzf $1 ;; *.tar.xz) tar xvJf $1 ;; *.lzma) unlzma $1 ;; *.bz2) bunzip2 $1 ;; *.rar) unrar x -ad $1 ;; *.gz) gunzip $1 ;; *.tar) tar xvf $1 ;; *.tbz2) tar xvjf $1 ;; *.tgz) tar xvzf $1 ;; *.zip) unzip $1 ;; *.Z) uncompress $1 ;; *.7z) 7z x $1 ;; *.xz) unxz $1 ;; *.exe) cabextract $1 ;; *) echo "extract: '$1' - unknown archive method" ;; esac else echo "$1 - file does not exist" fi fi } ``` The git riddle ``` function iacp() { if [] then echo "Usage: iacp " else git init git add * git commit -m "$3" git remote add $1 $2 git push --set-upstream $1 master fi } ``` The git push ``` function acp() { if [] then echo "Usage: acp " else git add * git commit -m "$1" git push fi } ``` take or tk = mkdir -p and cd in one ``` function take() { md "$1" cd "$1" } ``` Really clear the screen with Ctrl + L ``` clearbetter () { BUFFER="clear" zle accept-line -w } zle -N clearbetter bindkey '^L' clearbetter ``` Reload ZSH with Ctrl + S ``` resourcezsh () { BUFFER="exec -l zsh" zle accept-line -w BUFFER="clear" zle accept-line -w } zle -N resourcezsh bindkey '^S' resourcezsh ``` Exit with Ctrl + Q ``` ctrlqexit () { BUFFER=":q" zle accept-line -w } zle -N ctrlqexit bindkey '^Q' ctrlqexit ``` Unban IPs with fail2ban ``` unban () { sudo fail2ban-client unban $@ } ``` ## ZSH Plugins To add plugins to ZSH we simply need to download them and source the main .zsh file of that plugin in one of your zshrc files. Below are the ones I use Fast Syntax Highlighting is great, it gives your input color based on brackets, if it is correct or not, etc git clone https://github.com/z-shell/F-Sy-H /usr/share/zsh/plugins/F-Sy-H Now simply source the .zsh file in your global zshrc by adding the following line to it ``` source /usr/share/zsh/plugins/F-Sy-H/F-Sy-H.plugin.zsh ``` Alias Tips helps you remember the aliases you set, if you don't use a set alias it will notify you of the alias in a way that doesn't annoy you. git clone https://github.com/djui/alias-tips /usr/share/zsh/plugins/alias-tips Now simply source the .zsh file in your global zshrc by adding the following line to it ``` source /usr/share/zsh/plugins/alias-tips/alias-tips.plugin.zsh ``` ZSH Autosuggestions is nice, it tries to complete a command based on your history git clone https://github.com/zsh-users/zsh-autosuggestions /usr/share/zsh/plugins/zsh-autosuggestions Now simply source the .zsh file in your global zshrc by adding the following line to it ``` source /usr/share/zsh/plugins/zsh-autosuggestions/zsh-autosuggestions.zsh ``` Also add the following line to the /etc/zsh/zshenv file to drastically speed up this plugin ``` export ZSH_AUTOSUGGEST_MANUAL_REBIND ``` Z is a pretty cool plugin for fast navigation just type z nameoffolder and it will jump to it based on history. git clone https://github.com/agkozak/zsh-z /usr/share/zsh/plugins/z Now simply source the .zsh file in your global zshrc by adding the following line to it ``` source /usr/share/zsh/plugins/z/zsh-z.plugin.zsh ``` Also be sure to set the ZSHZ_DATA variable in /etc/zsh/zshenv by adding the following line to it ``` export ZSHZ_DATA=~/.config/zsh/.z ``` You can install any more you like, just be sure it doesn't slow down your shell. ## Updating ZSH Plugins with Pacman Updating these plugins is important for compatibility and new features. Create a file for the script vim ~/Scripts/update-zshplugins.sh Add in the following content ``` git -C /usr/share/zsh/plugins/F-Sy-H pull git -C /usr/share/zsh/plugins/alias-tips pull git -C /usr/share/zsh/plugins/zsh-autosuggestions pull git -C /usr/share/zsh/plugins/z pull ``` create a file in the pacman hooks directory for zsh plugins sudo vim /usr/share/libalpm/hooks/zsh.hook Add in the following text ``` [Trigger] Operation = Upgrade Type = Package Target = * [Action] Description = Update ZSH Plugins When = PostTransaction Exec = /bin/bash /home/USERNAME/Scripts/update-zshplugins.sh ``` Save and exit and try to update your system, if you are lucky you have an update and you can see the script in action after the update. ## ZSH Hotkeys Just a simple overview of all the hotkeys you can use Up and Down Arrow = Browse history matching current line Ctrl + A = Go to start of line Ctrl + B = Move 1 character back Ctrl + C = Cancel, Stop the current operation. Ctrl + D = Quit the session Ctrl + E = Go to end of line Ctrl + F = Move 1 character forward Ctrl + G = Nothing Ctrl + H = DOUBLE Delete Character before the cursor Ctrl + I = Nothing Ctrl + J = Nothing Ctrl + K = Remove everything behind the cursor Ctrl + L = clear screen Ctrl + M = Nothing Ctrl + N = Browse History matching current line Ctrl + O = Nothing Ctrl + P = Browse History matching current line Ctrl + Q = Quit, Types exit and presses enter. Ctrl + R = Search in History Ctrl + S = Nothing Ctrl + T = Nothing Ctrl + U = Delete everything before the cursor Ctrl + V = Nothing Ctrl + W = Delete the word before the cursor Ctrl + X = Nothing Ctrl + Y = Undo Ctrl + Z = toggle program to background and foreground ## Installing Neofetch Neofetch is a cool tool that shows some system information and a asci art logo of your distro. Install it with the following command sudo pacman -S neofetch Now you can run it by just typing neofetch in a terminal :) # Programming Even if you are not into programming and have no interest in learning it, some of these programs might be useful, in the case of Neovim it is a lot easier to read configuration files for example, If you want to get into programming these programs are an absolute must. ## Installing Neovim We are using Neovim over Vim because Neovim has LSP support install it using pacman sudo pacman -S neovim We will configure it later, we will start with ZSH ## Neovim Options and Keybinds We already installed Neovim in the first step, but we still need to configure it the way we want to. First we need create config files touch ~/Config/init.vim ~/Config/sysinit.vim Now we are going to create a symlink for the user config file ln -sf ~/Config/init.vim ~/.config/nvim/init.vim Do the same for the global config file sudo ln -sf ~/Config/sysinit.vim /etc/xdg/nvim/sysinit.vim We can now set some options, I recommend putting them in the system file this way you have the same configuration with the root user sv ~/Config/init.vim Add in the following options, Going over them all is beyond the scope of this guide, But you can look them all up to see what they do exactly. ``` "Options for Neovim" :setlocal list set listchars=eol:↓,tab:··▸,trail:●,extends:…,precedes:…,space:· set updatetime=300 set shortmess+=c syntax on set number set nu rnu set tabstop=4 set cursorline set showcmd filetype indent on set wildmenu set showmatch set incsearch set hlsearch set nospell set spelllang=en_us set autoindent set ruler set confirm set cmdheight=2 set shiftwidth=4 set noexpandtab set hidden set nowrap set encoding=utf-8 set pumheight=10 set mouse=a set splitbelow set splitright set t_Co=256 set conceallevel=0 set smarttab set smartindent set background=dark set showtabline=0 set noshowmode set nobackup set nowritebackup set clipboard=unnamedplus set dir=~/tmp,/tmp set scrolloff=3 set sidescrolloff=7 set sidescroll=1 set ignorecase smartcase set undofile set undodir=~/.nvim/undo set inccommand=nosplit set signcolumn=number set backspace=indent,eol,start set complete-=i ``` Now add some keyboard remaps ``` "Keyboard Remaps" nmap :windo bd nmap :tabnew nmap :tabp nmap :tabn nmap :ene nmap :bp nmap :bn nmap :vs nmap :split nmap :q nmap :w nmap :set nu! rnu! nmap :set list! nmap :resize +3 nmap :resize -3 nmap :vertical resize +3 nmap :vertical resize -3 nmap :resize +3 nmap :resize -3 nmap :vertical resize +3 nmap :vertical resize -3 nmap :wincmd k nmap :wincmd j nmap :wincmd h nmap :wincmd l nmap :wincmd k nmap :wincmd j nmap :wincmd h nmap :wincmd l nmap :m .+1== nmap :m .-2== imap :m .+1==gi imap :m .-2==gi vmap :m '>+1gv=gv vmap :m '<-2gv=gv nmap :m .+1== nmap :m .-2== imap :m .+1==gi imap :m .-2==gi vmap :m '>+1gv=gv vmap :m '<-2gv=gv nmap << nmap >> imap << imap >> vmap < vmap > nmap << nmap >> imap << imap >> vmap < vmap > ``` ## Neovim Plugins Vim Plug will be our plugin manager, It will handle most of the work We will install it system wide sudo mkdir /etc/xdg/nvim/autoload sudo curl -o /etc/xdg/nvim/autoload/plug.vim https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim Plugins get installed locally so we have to install plugins for every user seperately, We can make it universal, but this will prevent users from adding their own plugins. With our configuration we can set global plugins for everyone and any extra plugins the user may want using their own init.vim file. We can add plugins to either init.vim or sysinit.vim If you want to Install for yourself or everyone respectively, they do have to be inside a special block like this. ``` call plug#begin() Plug '' Plug ''' call plug#end() ``` You can use PlugUpdate to update and install all selected plugins, PlugClean te remove unselected plugins and, PlugUpgrade to update vim plug itself. Just add whichever plugin you think will improve your workflow, these are the ones I use. This plugin will add a ton of icons to Neovim, many of the following plugins will use them, but they are optional. ``` Plug 'kyazdani42/nvim-web-devicons' ``` vim-airline is a very cool plugin that gives some color to Neovim, it gives you a powerline with a ton of information, clear visual cues in which mode you are, where you are in the document, how big it is, what type it is, etc. ``` Plug 'vim-airline/vim-airline' ``` Barbar is a very nice Tab bar for Neovim, It will help you navigate your open tabs visually instead of just guessing the next or previous tab. ``` Plug 'romgrk/barbar.nvim' ``` Nvim-Tree is a directory browser, It is very handy if you want to have an overview of the files in the directory, browse and open them for editing. ``` Plug 'kyazdani42/nvim-tree.lua' ``` Be sure to add the Ctrl + T keybind ``` nmap :NvimTreeToggle ``` Also add the following to your vim.init somewhere after loading the plugins ``` lua require("nvim-tree").setup() ``` Floaterm is a simple terminal which is handy for obvious reasons. ``` Plug 'voldikss/vim-floaterm' ``` Be sure to add the Ctrl + Y keybind ``` nmap :FloatermNew --autoclose=2 --wintype=split --height=0.3 ``` Ctrl P is a great plugin that allows you to open files directly with a hotkey typing (part of) the filename you want to open and press enter to edit it directly. ``` Plug 'ctrlpvim/ctrlp.vim' ``` Be sure to add the Ctrl + F Keybind ``` nmap :CtrlP ``` Also add the following between the plugin options somewhere after the plug block ``` let g:ctrlp_map = '' ``` Undotree is a great plugin that allows you to look into your undo history see the acctual changes you made and revert to any of the previous stages of your document, You can also go forward after you went back ofcourse. ``` Plug 'mbbill/undotree' ``` Be sure to add the Ctrl + U keymap ``` nmap :UndotreeToggle ``` GitGutter is a great plugin that can show you git diffs and much much more git functionality ``` Plug 'airblade/vim-gitgutter' ``` Be sure to add the CTRL + G toggle as a keymap to your init.vim ``` nmap :GitGutterToggle ``` Nerdcommenter is a handy plugin to comment out lines or a bunch of lines with a single key. ``` Plug 'preservim/nerdcommenter' ``` Be sure to add the keymaps for Ctrl + C in normal and visual mode ``` nmap NERDCommenterInvert vmap NERDCommenterInvert ``` Autopairs is a simple plugin to handle quotes, brackets and other pairs of characters for you. ``` Plug 'jiangmiao/auto-pairs' ``` 42Header is something we need to use for school, But I made some little changes to it so it supports changing the ascii art to something like a little Tux :) ``` Plug 'pbondoer/vim-42header' ``` ## Neovim LSP Config Language Server Protocol is used for live code checking using external Language Servers For the scope of this guide we will set up a few languages but first we need to install the nvim-lspconfig plugin to make it all a bit easier Add the following line in your init.vim on a empty line inside the plug block ``` Plug 'neovim/nvim-lspconfig' ``` Run the following command to install it nvim +PlugUpdate +qall Now we can simply install language servers using pacman and add them to the init.vim file accordingly Lets start with Bash, simply install the language server using pacman sudo pacman -S bash-language-server Now add the language server to your init.vim file of choice ``` lua require'lspconfig'.bashls.setup{} ``` Next up is C, Install the language server with pacman sudo pacman -S ccls And add the language server to your init.vim file of choice ``` lua require'lspconfig'.ccls.setup{} ``` Next up is CSS, Install the language server with pacman sudo pacman -S vscode-css-languageserver And add the language server to your init.vim file of choice ``` lua require'lspconfig'.cssls.setup{} ``` Next up is HTML, Install the language server with pacman sudo pacman -S vscode-html-languageserver And add the language server to your init.vim file of choice ``` lua require'lspconfig'.html.setup{} ``` Next up is JS, Install the language server with pacman sudo pacman -S deno And add the language server to your init.vim file of choice ``` lua require'lspconfig'.denols.setup{} ``` Next up is json, Install the language server with pacman sudo pacman -S vscode-json-languageserver And add the language server to your init.vim file of choice ``` lua require'lspconfig'.jsonls.setup{} ``` Next up is Lua, Install the language server with pacman sudo pacman -S lua-language-server And add the language server to your init.vim file of choice ``` lua require'lspconfig'.sumneko_lua.setup{} ``` Next up is Python, Install the language server with pacman sudo pacman -S pyright And add the language server to your init.vim file of choice ``` lua require'lspconfig'.pyright.setup{} ``` Next up is Rust, Install the language server with pacman sudo pacman -S rust-analyzer And add the language server to your init.vim file of choice ``` lua require'lspconfig'.rust_analyzer.setup{} ``` Next up is YAML, Install the language server with pacman sudo pacman -S yaml-language-server And add the language server to your init.vim file of choice ``` lua require'lspconfig'.yamlls.setup{} ``` You can add many many more, just look for nvim plugins online ## Hotkeys Just a simple overview of all the hotkeys you can use ``` a = Append, Enter Insert mode 1 character after the cursor b = Move 1 word backwards, Works with numbers c = Nothing d = Delete, Deletes a character, double press it to delete the line, also works with numbers and move commands e = Nothing f = Find, Finds a character and jumps to that position g = Goto, enter a line press g twice and you will jump to the line, double press it to go to the first line h = Left, Same function as the left arrow, but closer to your hand. i = Insert, Enter Insert mode on the cursor j = Down, Same function as the down arrow, but closer to your hand. k = Up, Same function as the up arrow, but closer to your hand. l = Right, Same function as the right arrow, but closer to your hand. m = Bookmark position, press m, then press another character to bind it to, use ' to go to the section n = Nothing o = Enter insert mode on a new line below the current line. p = Paste, Pastes the buffer after the current cursor position q = Record, Press a key after hitting q to start recording, do some stuff and press q again in normal mode to save the recording, then type @key to repeat the action, type 20@key to do it 20 times. r = Nothing s = Nothing t = Nothing u = Undo your previous action. v = Visual mode, Switch to Visual mode to select stuff character for character. w = Move 1 word forward, works with numbers x = Delete character under the cursor y = Yank, Or Copy in recent terms, press it once to copy the selection, press it twice to copy the entire line and include a number to copy that amount of line. z = Nothing Shift + Arrows = Resize Splits A = Append, Enter insert mode at the end of the line. B = Move 1 whitespace backwards C = Nothing D = Delete everything on line after the cursor E = Nothing F = Find, Finds a character going backwards and jumps to that position G = Move to the end of the file H = Make split smaller horizontally I = Nothing J = Make split smaller vertically K = Make split bigger vertically L = Make split bigger horizontally M = Nothing N = Nothing O = Nothing P = Paste before cursor Q = Enter insert mode on a new line above the current line R = Replace Characters instead of Inserting them S = Nothing T = Nothing U = Nothing V = Visual Line mode, Select lines to edit, yank, or manipulate W = Move 1 whitespace forward X = Nothing Y = Nothing Z = Double press it to save and exit 0 = Go to beginning of line ~ = Change case of current character ! @ = enter @ and then type the letter of the recording made with q to play in # = Highlight the word you are standing on in the rest of the document $ = Go to end of line % ^ = Go to the first character on the line & * ( = Jump to previous sentence ) = Jump to next sentence = - [ ] { = Navigate up a codeblock } = Navigate down a codeblock ' = Go to bookmark saved earlier with m " ; : < > , . / search, type, press enter and press n/N to go to the next/previous result ? Ctrl + Arrows = Change active split Ctrl + A = increments ints Ctrl + B = Split window below Ctrl + C = Comment out line or selection Ctrl + D = Delete current buffer Ctrl + E = Next Buffer Ctrl + F = Find file and open it quickly Ctrl + G = Toggle Git Ctrl + H = Navigate around splits to the left Ctrl + I = Nothing Ctrl + J = Navigate around splits to below Ctrl + K = Navigate around splits to up Ctrl + L = Navigate around splits to the right Ctrl + M = Toggle invisible characters Ctrl + N = Split window next Ctrl + O = Open new Buffer Ctrl + P = Toggle Numberline Ctrl + Q = Quit Ctrl + R = Redo your previous action Ctrl + S = Save current buffer Ctrl + T = Toggle directory tree Ctrl + U = Open undo history Ctrl + V = Visual Block Mode, Select a custom block of text to manipulate Ctrl + W = Previous Buffer Ctrl + X = Decrements ints Ctrl + Y = Show Terminal Ctrl + Z = Places the application in the background Alt + Arrows = move line or selection Alt + A = Nothing Alt + B = Nothing Alt + C = Toggle Invisible Characters Alt + D = Nothing Alt + E = Next Tab Alt + F = Nothing Alt + G = Nothing Alt + H = Remove indent for line or selection Alt + H = Nothing Alt + I = Move Tab to the Right Alt + J = Nothing Alt + J = Move line or selection to the line below Alt + K = Move line or selection to the line above Alt + L = Add indent for line or selection Alt + M = Nothing Alt + N = Nothing Alt + O = Open New Tab Alt + P = Toggle Autopairs Alt + Q = Nothing Alt + R = Nothing Alt + S = Nothing Alt + T = Nothing Alt + U = Move Tab to the Left Alt + V = Nothing Alt + W = Previous Tab Alt + X = Nothing Alt + Y = Nothing Alt + Z = Nothing ``` ## Pacman Hooks for Updating Plugins It is important that we update our plugins regularly, I will add more later WIP! ## GDB GDB is the GNU Debugger, It is extremely powerfull, I will add this one later WIP! ## Valgrind Valgrind is the best memory checker I have used, I will add this one later WIP! # Basic Programs ## Installing Nextcloud If you don't use Nextcloud, Go buy a raspberry pi now, Or build a small server if you really want to get serious in self hosting. You can also sign up at one of the many Nextcloud providers. It is a free and open source Cloud storage and syncing tool, for all your files, contacts, passwords, bookmarks, you name it, It even syncs everything with your phone, Desktop, anything really, It has some amazing features. To clarify, This installs the Nextcloud sync client, You will need a provider or your own Nextcloud installation on a server. Install the Sync Client sudo pacman -S nextcloud-client You set it up by signing in to your nextcloud account, I do not recommend using the default settings or fast setup, I would skip the automatic folder configuration and set sync manually and just link your pictures folder to your pictures folder, your documents folder to your documents folder, and whatever folder you may need, This prevents the uploading of all your files or pretty dumb file management. If you use Nautilus the Gnome File Manager, be sure to install this too, it will enhance your nextcloud experience with Nautilus integration. Install git sudo pacman -S git Clone the repository git clone https://aur.archlinux.org/nautilus-nextcloud.git Now change the directory to the just downloaded folder cd nautilus-nextcloud Now build and install the package makepkg -si Give it your password when it asks you for it and answer yes to every question. ## Install a Graphical User Interface for Pacman Now we are going to install pamac, Which is a front end for pacman the default package manager in Arch. be sure to install git if you have not done this already sudo pacman -S git Clone the repository git clone https://aur.archlinux.org/libpamac-aur.git Now change the directory to the just downloaded folder cd libpamac-aur Now build and install the package makepkg -si Give it your password when it asks you for it and answer yes to every question. git clone https://aur.archlinux.org/pamac-aur.git Now change the directory to the just downloaded folder cd pamac-aur Now build and install the package makepkg -si Give it your password when it asks you for it and answer yes to every question. Now we need to enable AUR support, The AUR is the Arch User Repository, Here Arch Users can upload pre compiled packages that are available for Linux but are not in the Arch repositories, Then others can just easily download it from there. 1. Launch pamac 2. go to the settings 3. click on the AUR tab 4. Enable AUR support 5. enable checking for updates from AUR. You can now install any program you want from this "app store" ## Install and Configure the Browser First we need to install Firefox with the following command, Open it after it is done. sudo pacman -S firefox Welcome to Firefox, We can't set all settings in the application settings, we need to adjust the profile for that, You can create your own configuration over at https://ffprofile.com/. Now we need to extract it, and put the contents of the folder in our firefox profile folder. First create a new profile open firefox and go to about:profiles Here click on create new profile, Click next, give it a name, Be sure to make it the default profile and click on Finish. Now go to /home/USERNAME/.mozilla/firefox/RANDOMCHARACTERS.PROFILENAME Close firefox, remove all contents in the folder and then copy the contents of the downloaded archive into the current folder So in the RANDOMCHARACTERS.PROFILENAME folder should be prefs.json and the other files and folders, Don't put the FirefoxProfile folder in it but the contents of that folder. Start Firefox, wait a bit, close it and start it again, All extensions settings and configuration should be done :) ## Install instant Messaging clients Surely there are a lot of chat services, And you probably need more than 1, In that case I would recommend using Rambox or Ferdium, They have the advantage of having all web based chat services in 1 program, From Whatsapp to Discord and from IRC to Riot. The following steps will install Ferdium on your system Clone the repository git clone https://aur.archlinux.org/ferdium-bin.git Now change the directory to the just downloaded folder cd ferdium-bin Now build and install the package makepkg -si Give it your password when it asks you for it and answer yes to every question. Now you can open Ferdium, go to the settings, Disable every setting under general, and enable every setting under Appearance. Now you can go to services and enable any chat service you need. ## Install Mumble Mumble is an encrypted UDP voice chat service, you can host your own servers or use one of the many public ones to chat to your friends using the highest quality possible. Install it with the following command sudo pacman -S mumble If you need a good public server you can use mine on houtworm.im :) ## Install some handy fonts If you want to see the unicode emoticons you need to install the emoticon pack. sudo pacman -S noto-fonts-emoji ## Install Transmission If you ever download stuff, try to use Torrents where possible, you do need a Torrent Client for that and Transmission is a great one, you can install it with the following command sudo pacman -S transmission-gtk now you can use Torrents instead of overloading your favorite distros by downloading distro images over HTTP :) ## Installing Virtualbox Virtualbox is a Virtual Machine manager, You can run operating systems within your current operating system. This can be handy if you like to mess around with systems, want to learn more about Linux or you need proprietary software that doesn't run trough Wine. Install it with the following command sudo pacman -S virtualbox When you get asked a question go with the dkms option. ## Installing Geekbench Geekbench is a very nice benchmarking toolkit for benchmarking your CPU and GPU, It runs on almost everything, So you can compare your PC against your Phone and your Server for example :) git clone https://aur.archlinux.org/geekbench.git Now change the directory to the just downloaded folder cd geekbench Now build and install the package makepkg -si Now you should be able to benchmark your system by running the following commands, There are more beenchmarks available but these 2 are the important ones :) CPU geekbench --cpu GPU Vulkan geekbench --compute vulkan ## Install MPD MPD is the Media Player Daemon, It is a media player as a service that needs an mpd client to steer it. It is great for a raspberry connected to your receiver for example. I use it on my PC with Ampache installed on my server controlling it. sudo pacman -S mpd && systemctl --user enable mpd If you want media keys to work with MPD sudo pacman -S mpd-mpris ## Install Audacious Audacious is a nice smalll music player that will play about every format Install it with the following command sudo pacman -S audacious ## Install VLC Same thing applies for VLC is is a great Video player that will play anything from anywhere Install it with the following command sudo pacman -S vlc ## Install Sublime Sublime is a Subsonic music player. If you have a server somewhere I would recommend installing it. Simply search for sublime-music in pamac and you can install it easily :) ## Installing OBS OBS Studio is the go to streaming software on all platforms, Surely not everyone streams, but it is also very handy to record your screen or from other devices. Install it with the following command sudo pacman -S obs-studio ## Installing NoiseTorch NoiseTorch is simply amazing noise cancellation software, There could be a circus a mariachi band and a sporting event in your living room, and even when you are talking on a low volume, people on the other side will hear nothing but your voice. Truly amazing. We need to install it from the AUR, so go ahead and clone the repo git clone https://aur.archlinux.org/noisetorch.git change the directory cd noisetorch install the package makepkg -si Now you can find NoiseTorch in your menu, just open it configure it and load it to use it, Unload it again to stop it. # Office Programs ## Installing Libreoffice Libreoffice is the total office package that can do everything and open anything Install it if you ever come across office documents. sudo pacman -S libreoffice-fresh if you need a different language than English also install the language packs you need Exectute the following command, be sure to replace nl with your own country letters. sudo pacman -S libreoffice-fresh-nl ## Installing Spell correction If you need spelling correction you can install Aspell or Hunspell or both I would suggest using Pamac for this because you can easily see what languages are available. Just open it and search for aspell or hunspell, or both. ## Enable Printing Surely not everyone needs this one, But if you need a printer install cups with the following command sudo pacman -S cups cups-pdf Enable the service sudo systemctl enable --now org.cups.cupsd.socket The print server should be running, you can configure it by going to http://localhost:631 and just following the wizard. There is a possibility you need custom drivers, In that case look for your printer in the AUR, it is very likely they are in there :) ## Install GIMP GIMP (GNU Image Manipulation Program) is an amazing photoshop like tool that can do about everything with images, It might be a bit overwhelming at first, but just look for tutorials if you want to accomplish a specific task. Install it with the following command sudo pacman -S gimp ## Install Inkscape Inkscape is also a very powerful tool, Instead of raster images it tackles vector images, Which is great for designing logos and other stuff that needs to be infinitely scaleable. Install it with the following command sudo pacman -S inkscape # Gaming ## Enable Multilib Steam is a 32 bit application, like many of the games in its library, So to be able to install it we need to add multilib to our 64 bit system. Edit /etc/pacman.conf and uncomment the multilib section. sudo vim /etc/pacman.conf Remove the # in front of all the multilib section lines so that section looks like this ``` [multilib] Include = /etc/pacman.d/mirrorlist ``` Now simply update the system to enable 32 bit applications sudo pacman -Syyuu If you are running KDE be sure to install lib32-fontconfig with the following command sudo pacman -S lib32-fontconfig ## GPU Drivers Having the right GPU drivers is imporant, else games won't run properly. If you have a GTX9xx or newer you need the newest drivers, If you even have an older card, manually check which driver you need: https://www.nvidia.com/Download/index.aspx?lang=en-us But install them trough the AUR. Nvidia For the newest Nvidia you need these packages so install them. sudo pacman -S nvidia-dkms nvidia-settings nvidia-utils lib32-nvidia-utils lib32-opencl-nvidia opencl-nvidia libvdpau libxnvctrl vulkan-icd-loader lib32-vulkan-icd-loader AMD you need these packages so install them if you have a AMD GPU sudo pacman -S mesa lib32-mesa mesa-vdpau lib32-mesa-vdpau lib32-vulkan-radeon vulkan-radeon glu lib32-glu vulkan-icd-loader lib32-vulkan-icd-loader Now update and reboot sudo pacman -Syu && sudo reboot If you use Gnome or GDM with Nvidia you might need to disable Wayland, This is not always the case, But I include it here just in case, If your System won't reboot you can try this sudo vim /etc/gdm/custom.conf Remove the # in front of the #WaylandEnable=false line and it should force Xorg. ## Feral Gamemode Gamemode puts all your hardware in performance mode, it fixes some common problems and it just sounds cool :P Gamemode is in the repos these days, so simply run the following command to install gamemode. sudo pacman -S gamemode lib32-gamemode Now that it is installed we need to enable the service with this command systemctl --user enable gamemoded && systemctl --user start gamemoded To use gamemode for supertuxkart for example, run this terminal gamemoderun supertuxkart To use it in Steam edit the launch option for the desired game to gamemoderun %command% ## Nvidia Improvements Nvidia users might want to enable all options listed here to improve performance in games Force Full Composition Pipeline avoids screen tearing by letting the GPU do all the scaling. Triple Buffer avoids stuttering gameplay It allows for a stream of data instead of chunks of data. IndirectGLXProtocol forces the game to directly communicate with the Nvidia drivers. Coolbits enables your card to be overclocked which gamemode will make use of. Create a Xorg Config file: sudo nvidia-xconfig Move it to the right directory: sudo mv /etc/X11/xorg.conf /etc/X11/xorg.conf.d/20-nvidia.conf Edit the file with the following command sudo nano /etc/X11/xorg.conf.d/20-nvidia.conf Add in these lines under the "Device" section between the other options ``` Option "TripleBuffer" "on" Option "Coolbits" "28" ``` Add in these lines under the "Screen" section between the other options. Don't add the ForceFullCompositionPipeline line if you want Gsync ``` Option "metamodes" "nvidia-auto-select +0+0 {ForceCompositionPipeline=On, ForceFullCompositionPipeline=On}" Option "AllowIndirectGLXProtocol" "off" ``` Try this one with risk, It will be sure to crash GNOME, I am not sure about other DEs just add it to the end of the file ``` Section "Extensions" Option "Composite" "Disable" EndSection ``` If you run into any problems, just hit CTRL ALT F3 to switch to a different tty login, run the command to edit the file again and put a # in front of the options that are giving you trouble and reboot Alternatively you can just completely remove the file with the following command and reboot sudo rm /etc/X11/xorg.conf.d/20-nvidia.conf ## Libstrangle Libstrangle is a tool that helps you control framerates but also vsync settings. This is especially handy for games that do not support these features, You would like to half your framerate to make it run better save some power or just give your hardware a break. Install it with the following command git clone https://aur.archlinux.org/libstrangle.git && cd libstrangle && makepkg -si && cd Libstrangle can be used in multiple ways depending on what you want to achieve. To use libstrangle you can simply type strangle and then the amount of frames you want to run. There are some examples below, But the features you will probably use are Vsync which you use by using the -v option, the rules for OpenGL and Vulkan are different, Here is what each number does for the different apis. OpenGL 0 Force off, 1 Force on, n - Sync to refresh rate Vulkan 0 Force off, 1 Mailbox mode, 2 Traditional vsync, 3 Adaptive vsync You can also limit the game depending on the power state of your device, Set it to 60 while charging and on 30 while discharging for example. You do this by adding a second number right after a colon. in example, strangle 60:30. There are more features but they are not that commonly used, you can check the gitlab link above or simply type strangle -h for more information. To limit the framerate of supertuxkart to 30 simply run strangle 30 supertuxkart To Force enable vsync on 60 fps for an OpenGL Steam game set the launch option to strangle -v 1 60 %command% To set the framerate of a vulkan game on Steam to 120 fps but 60 on battery power with adaptive vsync set this as your launch command strangle -v 3 120:60 %command% ## Mangohud Mangohud is a monitoring tool for Vulkan and OpenGL applications. It can show CPU and GPU usage, temps, But also framerates, frametimes and a lot more. Install it with the following command git clone https://aur.archlinux.org/mangohud.git && cd mangohud && makepkg -si && cd Don't forget about the 32bit version git clone https://aur.archlinux.org/lib32-mangohud.git && cd lib32-mangohud && makepkg -si && cd To configure it with a GUI you can check out GOverlay below. For a manual configuration you can edit ~/.config/MangoHud/MangoHud.conf If you want exactly my configuration you can just copy this into it without the need for GOverlay. ``` background_alpha=0.3 font_size=20 background_color=020202 text_color=ffffff position=top-right no_display toggle_hud=F11 cpu_stats cpu_temp cpu_color=007AFA gpu_stats gpu_temp gpu_color=00BD00 ram ram_color=B3000A vram vram_color=00801B io_read io_write io_color=B84700 arch engine_color=B200B0 frame_timing=1 frametime_color=00ff00 #output_file=/home/houtworm/mangohud_log_ #fps_limit 120 #media_player #toggle_logging=F10 ``` You can tweak all the little things you want here. You can also create different configurations per game by adding a MangoHud.conf file to the game directory. To use it for any game change its launch option to mangohud %command% To use it with non Steam games use the following command mangohud supertuxkart Some games might need the 32 bit version, try this if the normal command fails. mangohud.x86 %command% ## VKBasalt VKBasalt is a post processing layer for Vulkan which enables you to enhance graphics further. It only works with Vulkan, This includes all Proton games. Install it with the following command git clone https://aur.archlinux.org/vkbasalt.git && cd mangohud && makepkg -si && cd To configure it first you need to create a config file, Run the following command to copy the example to a folder you can edit as the user. mkdir ~/.config/vkBasalt && cp /usr/share/vkBasalt/vkBasalt.conf.example ~/.config/vkBasalt/vkBasalt.conf You can tweak all the little things you want here. You can also create different configurations per game by adding a vkBasalt.conf file to the game directory. To use VKBasalt for any particular game enter this as a launch option. ENABLE_VKBASALT=1 %command% You can also start non Steam games this way by typing the following command ENABLE_VKBASALT=1 supertuxkart ## GOverlay GOverlay is a Graphical User Interface for managing MangoHud and VKBasalt git clone https://aur.archlinux.org/vkbasalt.git && cd vkbasalt && makepkg -si && cd mesa-demos and vulkan-tools are optional, You need them if you want to show the previews. Install them with the following command sudo pacman -S mesa-demos vulkan-tools ## AOC Compiler WIP! ## fsync WIP! ## Freesync WIP! ## Gsync WIP! ## Monitor switching hotkey WIP! ## disabling composition WIP! ## Open Joystick Display WIP! ## Gamescope WIP! ## Using a separate special gaming DE at login WIP! # Emulation If you want to play console games on your system you need some emulators, If you only want to play Windows PC games you can just scroll down to the Steam Play section. ## RetroArch WIP! ## Dolphin WIP! ## Yuzu WIP! ## Duckstation WIP! ## PCSX2 WIP! ## RPCS3 WIP! ## Flycast WIP! ## Xemu WIP! ## Steam Rom Manager WIP! ## Steam Play Steam Play Compatibility Tools are great for running Steam games that do not work natively on your system. Of course there is no guarantee games will work, But it certainly boosts the list of playable games on Steam for Linux. You can run Windows games or DOS games on Linux, You can even run Linux games that fail to run when you start them normally. First up we need to enable Steam Play in the Steam settings, 1. Click on Steam in the top bar 2. Click on Settings 3. Select the Steam Play tab on the right 4. Enable "Enable Steam Play for supported Titles" You can optionally enable the second box to enable Steam Play automatically for all games in your library, I would not recommend this because It breaks the Native Linux filtering tool. Now Save and Steam will restart, To actually use it now we need to force it for each game we want to play, 1. Right click the game you want to run using Steam Play 2. Click Properties 3. Click on the Compatibility tab on the right 4. Enable "Force the use of a specific Steam Play compatibility tool" 5. Select the Steam Play Compatibility tool that you want to use Below I will list all Steam Play Compatibility tools out there, describe what they do and how to install them. ### Proton This is Valves own fork of Wine, It will be installed automatically if you select it as the tool of choice in any games properties. Proton should be the go to tool if you want to play Windows games. ### ProtonDB protondb.com is a Proton DataBase, Here anyone can report how well games run for them with Proton, It creates some nice stats and it is a useful place to check which games you will be able to play. I would also urge everyone to report the games you have played, It helps a lot. Good or bad, even if there are already hundreds of reports. Also check out this Curator who lists Platinum rated games. ### Proton Github The Proton Github is where you can report problems with games, It probably won't get fixed because of it, but it is good to let everyone know there is interest, and who knows maybe the community finds a fix together. ### Protontricks Winetricks is a tool that helps you set certain tweaks to Wine to help make programs run or run better. Protontricks is just a simple wrapper which deals with proton directories in a manageable way. Install it with the following command WIP! Now you should be able to execute protontricks commands in your terminal, If a listing on ProtonDB works by using a certain protontricks command you can make the adjustment pretty easily ### Proton GE Proton GE is a fork of proton by Glorious Eggroll, That's where the GE comes from. It fixes a lot of game specific bugs, so if your game does not work with Proton, You can always try this one. Install it with the following command WIP! Now you should be able to restart steam and the compatibility tool should show up in the game properties when you enable Force the use of a specific Steam Play compatibility tool. ### Boxtron Boxtron is a tool to run DOS games with DOSBox right from the Steam Client, This fixes some broken DOS games on the Steam Store, and it enhances the performance for most. You can check this Curator for supported games Install it with the following command WIP! Now you should be able to restart steam and the compatibility tool should show up in the game properties when you enable Force the use of a specific Steam Play compatibility tool. ### Roberta Roberta is a tool to run SCUMM games with ScummVM right from the Steam Client, This Enables you to play some Windows ports on the Steam Store with a Native Linux Engine. which greatly improves everything ofcourse. Also check out this Curator that lists compatible games. Install it with the following command WIP! Now you should be able to restart steam and the compatibility tool should show up in the game properties when you enable Force the use of a specific Steam Play compatibility tool. ### Luxtorpeda Luxtorpeda is a tool that makes Windows only games run natively running the game with the official game assets using open source engines like OpenMW, OpenXcom, GZDoom and much more. Install it with the following command WIP! Now you should be able to restart steam and the compatibility tool should show up in the game properties when you enable Force the use of a specific Steam Play compatibility tool. ### Steam Linux Runtime Steam Linux Runtime is a container for your native Linux games, it will use more of Steams own libraries instead of the ones from your system. If a game does not run normally you could try this one. Steam Linux Runtime has a few advantages for users; Games can not access your home directory, they are isolated in their own little container. It can help support older games that don't work on newer systems. For developers it creates a single runtime they can test against. # Special Hardware ## Programmable Mouse If you have a mouse with profiles or adjustable DPI, there is a chance it is supported by Piper, If you are in doubt you can simply try it and remove Piper if it doesn't work install it with the following command sudo pacman -S piper Now open the program and check if it detects your mouse ## BlackMagic Capture Cards WIP! ## Xbox One Controller ### Xpad xpad works great, is the default on modern Linux distros and supports a wide range of controllers For Bluetooth to work with xpad and the Xbox One controllers you need to disable ertm (This is not needed for xpadneo) create the config file sudo vim /etc/modprobe.d/xbox_bt.conf Add the following line to the document and save and exit with CTRL + X. ``` options bluetooth disable_ertm=1 ``` ### Xpadneo xpadneo is a better driver for xbox one controllers if you use bluetooth, It enables vibration and even the vibration inside the triggers, It supports battery level indication, It also fixes the mapping in many many games that where previously unplayable with a Xbox One controller on Linux. Install the dependencies sudo pacman -S dkms bluez bluez-utils Install xpadneo from the AUR git clone https://aur.archlinux.org/xpadneo-dkms-git.git && cd xpadneo-dkms-git && makepkg -si Now you should be able to reboot and it should be all good, Having the controllers vibrate for a second when connected is a good indicator that it works. ### Xow Xow is a better driver for xbox one controllers if you use the official wireless controller dongle from Microsoft, I don't own one so I can't test anything I would write here, So I just don't, I do mention it in case you have one. ## Racing Wheels Racing wheels should work out of the box on Linux, Including Force Feedback, Shifters, pedals and most things you can throw at it. But if you like to fine tune some things you may need some software. This is mostly not even the case, I played a long time just using the default kernel drivers, But some of these tools might come in very handy if you play different games, with different settings or with unsupported wheels. ### Oversteer Oversteer will enable a few cool things like Turning Degree and Lock if the game you want to play doesn't support it. It also enables you to set profiles for games and gives you compatibility modes so that you can play older games that expect a G27 for example. Install it with the following command git clone https://aur.archlinux.org/oversteer.git && cd oversteer && makepkg -si You can open the program now and check some things out. ### lg4ff lg4ff is a kernel module for steering wheels which enables you to adjust the lights on a G29 for example, It also allows you to fine tune and even amplify the Force Feedback, Aplify it on your own risk tho, I already wrecked a G29, The inner housing broke, don't worry about it overheating or anything. Install it with the following command git clone https://aur.archlinux.org/new-lg4ff-dkms-git.git && cd new-lg4ff-dkms-git && makepkg -si ### Handbrake Handbrakes are not that common sadly, You can purchase an expensive one from Fanatec, buy one from Aliexpress or create your own. If you use a Fanatec Handbrake You just need to add a few lines with the correct ProductID and VendorID to the inputdevices.json file of the game. For Feral games it will be located in the installation folder under the /Share directory. Just add the folllowing lines with the correct ProductID and VendorID before the last ] of the file. These Product and Vendor IDs are for a Arduino Leonardo. You can find the right Product and Vendor IDs by typing lsusb -v in a terminal when the device is connected. ``` { "Name": "Handbrake", "VendorID": "0x2341", "ProductIDs": [ "0x8036" ], "Category": "Wheel", "Type": "UnknownWheel" } ``` If you made your own or bought a complete handbrake sim set from Aliexpress or Ebay and it is not working properly follow the following instructions. Download this little zip file, It includes inputdevice.json files for Dirt Rally and Dirt 4, It also includes the Arduino Sketch, The Joystick Library and a little readme file. https://houtworm.cloud/s/ksrijLyYseQPFKx We will need arduino installed on our system sudo pacman -S arduino Copy the Joystick folder in the Joystick master zip file to the Arduino libraries folder which is located in ~/Arduino/libraries Open Arduino and replace all text with this content ``` #include const int potPin = A0; Joystick_ Joystick; void setup() { Joystick.begin(); } void loop() { int rawValue = analogRead(potPin); int value = 255 - map(rawValue, 750, 1023, 0, 255); Joystick.setXAxis(value); } ``` Make sure you put the right Arduino model and the right USB port in tools, Then click on Verify and if it succeeds press Upload to flash it to the Arduino. If needed you can adjust the values (rawValue, 750, 1023, 0, 255). These may be different depending on how you built it Now the Arduino is a functional Handbrake in Racing games :) # Cleaning up and maintaining the system Lastly we are going to clean up a bit, We left a lot of mess in your home directory during in the few hours, You can remove all the folders we used for installing the AUR packages, like pamac-aur, nautilus-nextcloud, numix-square-icons, etc To maintain your system all you have to do is update it, you can run the following command to update your entire system. sudo pacman -Syu If you followed the complete guide and installed Pamac, you can just use pamac to update all packages on your system including the ones from the AUR. You don't have to update every day, You can ofcourse, But if you want to update every week or every 2 weeks that is fine too, I do think the sweet spot is between 3 days and a week. Unless you don't use the device I would not wait longer than a month with updates, some of the updates are pretty important for the security of the device, Which is the main reason why you MUST update. You can also remove orphaned packages every once in a while with the following command sudo pacman -Rnsc $(pacman -Qqdt) You do this in pamac by going to the installed tab, then click on orphans and then select all to remove them. I would be careful with executing commands from the internet, especially the sudo command, It is extremely powerful, You could mess up everything with many simple commands. If you need extra software, always try the repos first! Nothing wrong with needing something from the AUR, but try to keep it to a minimum, and regularly check the "Foreign Packages" under installed in Pamac to check what AUR packages are still installed, If you see anything you don't recognize, try to remove it, If it is a dependency Pamac will warn you and you can always cancel. I would recommend against Installing software from git, web, trough scripts, make, curl, wget, etc. Don't unless you absolutely need it and know what you are doing, But by that time I would recommend to just add it to the AUR yourself. I would also recommend keeping your home directory nice and orderly.