# Random Arch Stuff

***

## Resources

Swap space guidelines from [Red Hat](https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/7/html/storage_administration_guide/ch-swapspace).

| Amount of RAM in the system | Recommended swap space     | Recommended swap space if allowing for hibernation |
| --------------------------- | -------------------------- | -------------------------------------------------- |
| ⩽ 2 GB                      | 2 times the amount of RAM  | 3 times the amount of RAM                          |
| > 2 GB – 8 GB               | Equal to the amount of RAM | 2 times the amount of RAM                          |
| > 8 GB – 64 GB              | At least 4 GB              | 1.5 times the amount of RAM                        |
| > 64 GB                     | At least 4 GB              | Hibernation not recommended                        |

[ext4 to btrfs conversion](https://btrfs.readthedocs.io/en/latest/Convert.html), [Arch wiki](https://wiki.archlinux.org/title/btrfs#Ext3/4_to_Btrfs_conversion) also has some good information regarding it. Setting up Ubuntu-type subvolumes (@ and @home) necessary for use with [Timeshift](https://wiki.archlinux.org/title/Timeshift) (why else are you converting ext4 to btrfs?). There are [other snapshot tools](https://wiki.archlinux.org/title/snapper) but I haven't checked them out.

## System

Recreate/regenerate the `initramfs` image

```bash
mkinitcpio -P
```

To generate more Unified Kernel Images using sbctl, refer to [sbctl Arch man pages](https://man.archlinux.org/man/sbctl.8#EFI_BINARY_COMMANDS). It's worth keeping a `linux-lts` kernel installed.

{% code overflow="wrap" %}

```bash
sbctl bundle --amducode /boot/amd-ucode.img --save /efi/EFI/Linux/arch-linux-lts.efi

# other useful stuff
sbctl generate-bundles --sign
sbctl list-bundles
```

{% endcode %}

The path for kernel parameters is `/etc/kernel/cmdline`.

### Pacman/Paru

If updating after a while, update the key-ring `pacman-key --refresh-keys`

To create snapshots automatically for Timeshift before an update is applied, use [timeshift-autosnap](https://aur.archlinux.org/packages/timeshift-autosnap) AUR package.

`pacman -Qtdq` or `pacman -Qtd` to query for orphan packages.

`pacman -Rns` to remove packages.

`pacman -Qm` or `paru -Qma` to list all AUR packages.

TODO: Uninstall GNOME/KDE fully.

## Packages

### Bat

If `bat` throws out the following warning,

```bash
[bat warning]: Unknown theme 'Catppuccin Mocha', using default
```

Use `bat cache --build` to fix it.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.specarino.com/specs-corner/arch/random-arch-stuff.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
