User:Wizetek

From ArchWiki

https://www.wizetek.com

Arch Linux

Medium creation

Different methods:

cp

$ cp archlinux.iso /dev/sdX

cat

$ cat archlinux.iso > /dev/sdX

redirection with sudo to avoid 'Permission denied'

$ cat archlinux.iso | sudo tee /dev/sdX > /dev/null

pv

$ pv archlinux.iso > /dev/sdX

tee: include < or the input file gets zeroed out!

$ tee < archlinux.iso > /dev/sdX

tail

$ tail -c +1 archlinux.iso > /dev/sdX

dd

$ dd if=archlinux.iso of=/dev/sdX bs=4M conv=fsync oflag=direct status=progress

Monitor with 'progress' or 'pv'

$ progress -m
$ pv -d $(pidof cp)

Installation (as of 2020.03)

$ timedatectl set-ntp true
$ fdisk /dev/sda
$ mkfs.ext4 /dev/sda1
$ mkswap /dev/sda2
$ swapon /dev/sda2
$ mount /dev/sda1 /mnt
$ vim /etc/pacman.d/mirrorlist
$ pacstrap /mnt base linux linux-firmware

$ genfstab -U /mnt >> /mnt/etc/fstab
$ arch-chroot /mnt
$ pacman -S networkmanager grub vim man

$ ln -sf /usr/share/zoneinfo/America/Toronto /etc/localtime
$ hwclock --systohc
$ vim /etc/locale.gen
	...
	#en_BW ISO-8859-1
	en_CA.UTF-8 UTF-8
	#en_CA ISO-8859-1
	en_GB.UTF-8 UTF-8
	...

$ locale-gen
$ vim /etc/locale.conf
	LANG="en_CA.UTF-8"
	LC_TIME="en_GB.UTF-8"

$ hostnamectl set-hostname myhostname
$ vim /etc/hosts
	127.0.0.1	localhost
	::1		localhost
	127.0.1.1	myhostname.localdomain	myhostname

$ mkinitcpio --allpresets
$ grub-install --target=i386-pc /dev/sda
$ grub-mkconfig -o /boot/grub/grub.cfg
$ passwd
$ exit
$ umount /mnt

Eject installation medium. Reboot. Log in.

Configuration

Enable network

via NetworkManager:

$ systemctl --now enable NetworkManager.service

via systemd-networkd:

$ networkctl list
$ vim /etc/systemd/network/20-wired.network
	[Match]
	Name=myadapter
	
	[Network]
	DHCP=ipv4

$ systemctl --now enable systemd-networkd.service
$ systemctl --now enable systemd-resolved.service
$ networkctl status

NTP via systemd-timesyncd

$ timedatectl set-ntp true

or

$ systemctl --now enable systemd-timesyncd.service

Swap file

$ dd of=/swapfile if=/dev/zero bs=1G count=1
# or
$ fallocate -l 1G /swapfile

$ chmod 600 /swapfile

$ mkswap /swapfile
# or (also set label)
$ mkswap -L linux_swap /swapfile

$ vim /etc/fstab
	/swapfile none swap defaults 0 0

$ swapon /swapfile
# or (activate all in /fstab)
$ swapon -a

# Check:
$ swapon

SSD optimizations: TRIM and swappiness

$ systemctl --now enable fstrim.timer

file_prio (default=200) minus vm.swappiness equals anon_prio

i.e. 200 - 100 = 100 [link]

$ sysctl -w vm.swappiness=100    # set immediately

Set on boot:

$ vim /etc/sysctl.d/99-swappiness.conf
	 vm.swappiness=100

CPU microcode updates

$ pacman -S intel-ucode
or
$ pacman -S amd-ucode
$ grub-mkconfig -o /boot/grub/grub.cfg
$ reboot

Hardware monitoring

$ pacman -S lm_sensors
$ sensors-detect
$ sensors

vimrc

~/.vimrc
	unlet! skip_defaults_vim
	source $VIMRUNTIME/defaults.vim
	
	set background=dark
	"colorscheme elflord
	
	set nowrap
	set paste
	set mouse=r
	"set clipboard=unnamedplus

inputrc

~/.inputrc
	$include /etc/inputrc

	"\e[A":history-search-backward
	"\e[B":history-search-forward

	# Shift+up/down/right/left
	"\e[1;2A":upcase-word
	"\e[1;2B":downcase-word
	"\e[1;2C":copy-forward-word
	"\e[1;2D":copy-backward-word

	set show-all-if-ambiguous on
	set echo-control-characters off

	# Color files by types
	# Note that this may cause completion text blink in some terminals (e.g. xterm).
	set colored-stats on
	# Append char to indicate type
	set visible-stats on
	# Mark symlinked directories
	set mark-symlinked-directories on
	# Color the common prefix
	set colored-completion-prefix on
	# Color the common prefix in menu-complete
	set menu-complete-display-prefix on

Add Ctrl+left and Ctrl+right to console keymap

$ vim /usr/local/share/kbd/keymaps/personal.map
	control keycode 105 = Meta_b
	control keycode 106 = Meta_f

Load for the current session:

$ loadkeys personal.map

Load on startup:

$ vim /etc/vconsole.conf
	KEYMAP=/usr/local/share/kbd/keymaps/personal.map

Disable power button

$ vim /etc/systemd/logind.conf
	HandlePowerKey=ignore

Disable Ctrl-Alt-Delete in console

$ systemctl mask ctrl-alt-del.target

Don't clear console on boot

$ mkdir /etc/systemd/system/getty@.service.d
$ vim /etc/systemd/system/getty@.service.d/dontclear.conf
[Service]
TTYVTDisallocate=no
$ systemctl daemon-reload

Enable reboot and more (REISUB) via Magic SysRq Key

$ vim /etc/sysctl.d/99-sysrq.conf
	kernel.sysrq=1

Disable account lockout on authentication failure

$ vim /etc/security/faillock.conf
	deny = 0

sudo

$ sudo visudo
...
Defaults editor=/usr/bin/vim
Defaults passwd_timeout=0
Defaults timestamp_timeout=10
Defaults timestamp_type=global

%wheel ALL=(ALL:ALL) ALL
...
$ gpasswd -a myusername wheel
$ vim ~/.bashrc
	alias sudo='sudo '

pkexec auth for Xorg applications

$ vim ~/.bashrc
	alias pkexec="pkexec env DISPLAY=$DISPLAY XAUTHORITY=$XAUTHORITY $@"

Mount NTFS / SMB / SSHFS

/etc/fstab

/dev/sda2		/mnt/windows	ntfs-3g		uid=myuser,gid=mygroup,dmask=022,fmask=133	0 0
//192.168.1.1/music	/mnt/openwrt	cifs		_netdev,guest,vers=1.0,uid=myuser,gid=mygroup,dir_mode=0555,file_mode=0444,nounix,iocharset=utf8	0 0
pi@raspberrypi:/	/mnt/pi		fuse.sshfs	_netdev,reconnect,allow_other,default_permissions,ServerAliveInterval=15,ServerAliveCountMax=3	0 0

udisksctl mount/unmount (removable) device partition

$ udisksctl status

Mount to /run/media/myusername/mydevicelabel:

$ udisksctl mount -b /dev/sdb1
or
$ udisksctl mount -b /dev/disk/by-label/mydevicelabel

Umount:

$ udisksctl unmount -b /dev/sdb1
or
$ udisksctl unmount -b /dev/disk/by-label/mydevicelabel

Eject:

$ udisksctl power-off -b /dev/sdb

locate DB and update via a cron job

$ pacman -S mlocate
$ updatedb
$ locate -S
$ pacman -S cronie
$ vim /etc/cron.daily/update_locate_db
	/usr/bin/updatedb

$ chmod +x /etc/cron.daily/update_locate_db

$ systemctl enable cronie.service
$ systemctl start cronie.service
$ systemctl status cronie.service

Share files via SMB

$ pacman -S samba
$ wget -O /etc/samba/smb.conf 'https://git.samba.org/samba.git/?p=samba.git;a=blob_plain;f=examples/smb.conf.default'
$ vim /etc/samba/smb.conf
	log file = /var/log/samba/%m.log
	workgroup = MYWORKGROUP
	[homes]
	comment = Home Directories
	browseable = no
	writable = yes

$ smbpasswd -a myuser
$ systemctl --now enable smb.service
$ systemctl --now enable nmb.service

Xorg and Xfce desktop

$ pacman -S xorg-server
$ pacman -S xf86-video-amdgpu xf86-video-ati xf86-video-intel xf86-video-nouveau xf86-video-vesa

$ pacman -S xfce4 xfce4-goodies
$ pacman -S pulseaudio pulseaudio-alsa pavucontrol
$ pacman -S gvfs-smb ntfs-3g
$ pacman -S nm-applet

$ pacman -S xdg-user-dirs
$ xdg-user-dirs-update

$ pacman -S lightdm lightdm-gtk-greeter lightdm-gtk-greeter-settings
$ pacman -S accountsservice
$ cp /path/to/myavatar_96x96.png ~/.face
$ systemctl --now enable lightdm.service

Xfce: hide Suspend and Hibernate from the logout dialog

$ xfconf-query -c xfce4-session -np '/shutdown/ShowSuspend' -t bool -s false
$ xfconf-query -c xfce4-session -np '/shutdown/ShowHibernate' -t bool -s false

Xfce: disable CSD (Client-Side Decorations)

$ xfconf-query -c xsettings -p /Gtk/DialogsUseHeader -s false

Qt apps theme appearance

$ pacman -S qt5ct
$ vim .xinitrc
	export QT_QPA_PLATFORMTHEME=qt5ct

Fonts

$ pacman -S ttf-dejavu

and/or

$ pacman -S ttf-liberation

before:

$ cd /etc/fonts/conf.d
$ ln -s /etc/fonts/conf.avail/10-hinting-full.conf
$ ln -s /etc/fonts/conf.avail/10-sub-pixel-rgb.conf
$ ln -s /etc/fonts/conf.avail/11-lcdfilter-default.conf

recently:

$ cd /etc/fonts/conf.d
$ ln -s /usr/share/fontconfig/conf.default/10-hinting-full.conf
$ ln -s /usr/share/fontconfig/conf.default/10-sub-pixel-rgb.conf
$ ln -s /usr/share/fontconfig/conf.default/11-lcdfilter-default.conf

BCI (Byte-Code Interpreter) hinting:

$ vim /etc/profile.d/freetype2.sh
	#truetype:interpreter-version=35 (classic mode, emulates Windows 98; 2.6 default)
	#truetype:interpreter-version=36 (classic Windows ClearType style)
	#truetype:interpreter-version=38 ("Infinality" subpixel mode)
	truetype:interpreter-version=40 (minimal subpixel mode; 2.7 default)

Screensaver and lock

Power off display after 600 seconds (10 min).

$ xset dpms 0 0 600

Disable/enable DPMS.

$ xset -dpms
$ xset +dpms

Screensaver after 5 minutes, release grab after suspend, lock after 1200 seconds (20 min), display off after 600 seconds (10 min), different saver every 60 seconds, password timeout 5 seconds

$ pacman -S xlockmore xautolock
$ xautolock -time 5 -detectsleep -locker "xlock -lockdelay 1200 -dpmsoff 600 -mode random -duration 60 -erasedelay 0 -echokeys -echokey . -timeout 5"

Disable/enable autolock without terminating process.

$ xautolock -disable
$ xautolock -enable

Screensaver without lock

$ xautolock -time 5 -detectsleep -locker "xlock -nolock -mode random -duration 60 -erasedelay 0"

Picture slideshow without lock

$ pacman -S feh
$ xautolock -time 5 -detectsleep -locker "feh -z -D 5 -F --zoom=fill -Y -r /usr/share/backgrounds"

Xfce custom command to lock on sleep (read by xflock4)

$ pacman -S i3lock
$ xfconf-query --create -c xfce4-session -p /general/LockCommand -t string -s "i3lock -f -c 202020"

Check Xfce lock command.

$ xfconf-query -c xfce4-session -p /general/LockCommand

Reset Xfce lock command.

$ xfconf-query --reset -c xfce4-session -p /general/LockCommand

systemd unit to lock screen upon system sleep

$ vim /etc/systemd/system/lock-on-sleep@.service 
[Unit]
Description=Lock screen on sleep/suspend
Before=sleep.target

[Service]
Type=simple
User=%i
Environment="DISPLAY=:0"
ExecStart=/usr/local/bin/lock-on-sleep

# Wait for lock to prevent briefly showing desktop after resume
ExecStartPost=sleep 1

[Install]
WantedBy=sleep.target
#WantedBy=suspend.target
$ vim /usr/local/bin/lock-on-sleep
#!/bin/bash

xset dpms 0 0 120

# Release grab from 'xlock -nolock'
xautolock -unlocknow

#xlock -mode random -duration 60 -erasedelay 0 -echokeys -echokey . -timeout 5
i3lock -n -f -c 202020 -i $(shuf -n 1 -e /usr/local/backgrounds/*.png)

xset dpms 0 0 600
$ systemctl enable lock-on-sleep@myusername

Reload systemd after any changes to the unit.

$ systemctl daemon-reload 

DPI

Warning: !!! 96 DPI is not standard !!!

Calculate proper DPI for specific hardware at https://www.pxcalc.com/

Example: 27" 2560x1440 display

  • DPI: 108.79
  • Dot Pitch: 0.2335 mm
  • Size: 23.53" × 13.24" (59.77 cm × 33.62 cm)
$ pacman -S xorg-xrandr
$ xrandr --dpi 109
$ xdpyinfo | grep dots

Login/Desktop Managers in general:

$ vim /etc/xprofile
	xrandr --dpi 109

or

$ vim ~/.xprofile
	xrandr --dpi 109

LightDM specifically:

$ vim /etc/lightdm/lightdm-gtk-greeter.conf
	xft-dpi = 109

X Server:

$ vim /etc/X11/xinit/xserverrc
	exec /usr/bin/X -dpi 109 -nolisten tcp "$@"

or

$ vim ~/.xserverrc
	exec /usr/bin/X -dpi 109 -nolisten tcp "$@"

X Resources (if not set by Desktop Environment):

$ vim ~/.Xresources
	Xft.dpi: 109
	Xft.autohint: 0
	Xft.lcdfilter: lcddefault
	Xft.hintstyle: hintfull
	Xft.hinting: 1
	Xft.antialias: 1
	Xft.rgba: rgb

Firefox:

Note: Web pages appearance
  • Default DPI is 96. Change it in about:config by setting:
layout.css.devPixelsPerPx = x

...where x = DPI / 96

Example: 27" 2560x1440 display, x = 108.79 / 96 = 1.133229167

Note: Application window and menus appearance
  • Default DPI is 96. System DPI is only used if system DPI > 96. Force using lower system DPI by setting in about:config layout.css.dpi = 0
  • Default font scale in about:config is font.size.systemFontScale = 100
  • Do not increase Default zoom in Preferences

x11vnc

$ pacman -S x11vnc
$ x11vnc -storepasswd
$ x11vnc -usepw -shared -forever -reopen -nolookup

Drop current client connection when new client connects: -nevershared

Ignore options in rc file: -norc

$ vim ~/.x11vncrc

desktop My Desktop
rfbport 5900
display :0
usepw
shared
forever
reopen
nolookup

Run X apps without real X

$ pacman -S xorg-server-xvfb

Virtual framebuffer X -screen num WxHxD (color depth)

$ Xvfb :1 -screen 0 1x1x8
$ DISPLAY=:1 myxapp

xbindkeys

$ pacman -S xbindkeys
$ xbindkeys -d > ~/.xbindkeysrc
$ vim ~/.xbindkeysrc
	# Volume up/down via Super + mouse wheel
	"pamixer -i 5"
	  Mod2+Mod4 + b:4

	"pamixer -d 5"
	  Mod2+Mod4 + b:5

	# Volume up/down via Super + Keypad +/-
	"pamixer -i 5"
	  Mod2+Mod4 + KP_Add

	"pamixer -d 5"
	  Mod2+Mod4 + KP_Subtract

	# Toggle mute via Super + Keypad *
	"pamixer -t"
	  Mod2+Mod4 + KP_Multiply

	# Set volume to 50% via Super + Keypad /
	"pamixer --set-volume 50"
	  Mod2+Mod4 + KP_Divide

	# Toggle Play/Pause in active player via Super + Pause/Break
	"playerctl play-pause"
	  Mod2+Mod4 + Pause

Identify multi key pressed:

$ xbindkeys -mk

Run in foreground first to check if rc file is valid:

$ xbindkeys -n

Intel hardware video acceleration

$ pacman -S intel-media-driver libva-intel-driver libvdpau-va-gl
$ pacman -S libva-utils vdpauinfo

Pro audio

CPU frequency governor
$ pacman -S cpupower
$ cpupower frequency-set -g performance
$ cat /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor
$ cpupower frequency-info
...
hardware limits: 800 MHz - 3.00 GHz
...(max 2.4 with turbo boost to 3.0)

$ cpupower frequency-set -d 2.4GHz
$ cpupower frequency-set -u 3.0GHz
$ vim /etc/default/cpupower
$ systemctl enable cpupower.service
Low-latency kernel
Warning: !!! realtime preemption (PREEMPT) ≠ realtime scheduling (PREEMPT_RT) !!!

Check:

$ uname -v
#1 SMP PREEMPT Wed, 18 May 2022 17:30:11 +0000 x86_64 GNU/Linux

Threaded IRQs non-realtime kernel (optional)

Check:

$ zgrep "CONFIG_IRQ_FORCED_THREADING" /proc/config.gz
CONFIG_IRQ_FORCED_THREADING=y

Enable:

$ vim /etc/default/grub
...
GRUB_CMDLINE_LINUX_DEFAULT="... ... threadirqs"
...
Realtime priority
$ pacman -S realtime-privileges
$ vim /etc/security/limits.d/99-realtime-privileges.conf
	@realtime - rtprio 98
	@realtime - memlock unlimited
	@realtime - nice -11

(nice uses SCHED_OTHER so it is not applicable to low-latency real-time audio using SCHED_FIFO / SCHED_RR)

$ gpasswd -a myusername realtime

If not using a login manager, configure PAM too:

$ vim /etc/pam.d/su
	session required pam_limits.so

Log out, log back in.

Check:

$ ulimit -r
$ ulimit -a
$ chrt -m

Test:

(should not return: Operation not permitted)

$ chrt -v 90 true
MIDI & JACK
$ pacman -S jack2 python-dbus qjackctl a2jmidid alsa-utils

QjackCtl

- Driver: alsa
- Realtime: ✓ (if using linux-rt)
- MIDI Driver: seq
- Output Device: myoutputdevice
- Enable D-Bus interface: ✓
- Enable JACK D-Bus interface: ✓

(Soon to be replaced by PipeWire)

PipeWire

(soon...)

$ pacman -S pipewire
$ pacman -S pipewire-alsa pipewire-pulse pipewire-jack
$ pacman -S helvum
$ pacman -S easyeffects
DAW, plugin hosts & softsynths

~/.bashrc

# VST3 in ~/.vst3
# VST/VST2
export VST_PATH=/usr/lib/vst:/usr/local/lib/vst:~/.vst
# uncommon, only used by Ardour and Qtractor
export LXVST_PATH=/usr/lib/lxvst:/usr/local/lib/lxvst:~/.lxvst
# current Linux-only native container
export LV2_PATH=/usr/lib/lv2:/usr/local/lib/lv2:~/.lv2
# old precursor to LV2
export LADSPA_PATH=/usr/lib/ladspa:/usr/local/lib/ladspa:~/.ladspa
# old LADSPA successor
export DSSI_PATH=/usr/lib/dssi:/usr/local/lib/dssi:~/.dssi
$ pacman -Sgq vst-plugins | pacman -Si -
$ pacman -Si $(pacman -Sgq lv2-plugins)
  • DAW (Digital Audio Workstation)

renoise
reaper
bitwig
tracktion-waveform
qtractor (sequencer with DAW features)
ardour
sunvox


  • Host

carla


  • VST / VST2 / VST3 / lxvst (.so)

surge
helm-synth
vital
dexed
odin2
zynaddsubfx
obxd [old] [new]
xhip
tunefish4
amsynth
digitsvst-git
tal-plugins
uhe-podolski-vst
uhe-triplecheese-vst
uhe-tyrellN6


  • LV2 (.so)

yoshimi
bristol (+ pybristol GUI)
calf (various stuff) [1]
synthv1
padthv1
samplv1
drumkv1

Windows© VST (.dll) plugin bridge
$ pacman -S wine-staging winetricks
$ pacman -S yabridge yabridgectl
$ wine vst1_installer.exe
$ wine vst2_installer.exe
...
$ yabridgectl sync
$ yabridgectl status
$ yabridgectl add /custom/path/to/windows/vst
$ yabridgectl list
$ yabridgectl sync
$ yabridgectl status


http://www.linuxsynths.com/index.html
https://distrho.sourceforge.io/ports.php


pacman

Generate mirror list:

$ reflector --country CA,US --protocol http,https --latest 200 --fastest 5 --sort score --save /etc/pacman.d/mirrorlist

Sync install package:

$ pacman -S ttf-dejavu

Sync refresh and update all packages (-w only download, don't install):

$ pacman -Syu
$ pacman -Syuw

Ignore -Syu updates for specified packages:

/etc/pacman.conf
	IgnorePkg = linux linux-headers systemd xorg-server

Update including ignored packages:

$ pacman -S linux linux-headers

Update despite dependency errors (e.g. with AUR packages):

$ paru -Sd package1
$ pacman -S package2

Don't touch certain files during upgrade:

/etc/pacman.conf
	NoUpgrade = etc/passwd etc/group etc/shadow

Sync search for string (-q quiet):

$ pacman -Ss ttf font
$ pacman -Ssq ttf font

Sync display info about package:

$ pacman -Si kodi

Sync display groups:

$ pacman -Sg

Sync display members of group:

$ pacman -Sg kodi-addons

Sync list packages in given repository:

$ pacman -Sl core
$ pacman -Sl extra
$ pacman -Sl community
$ pacman -Sl multilib

Install local package file:

$ pacman -U redshifter-20200404-1-any.pkg.tar.xz

Find package that will provide file:

$ pacman -Fy
$ pacman -F lsusb
	core/usbutils 012-2
	    usr/bin/lsusb

Find list files that would be owned by package:

$ pacman -Fl usbutils

Query search installed packages (all / by string):

$ pacman -Qs
$ pacman -Qs ttf

Query display explicitly installed packages:

$ pacman -Qe

Query display installed packages not directly required and not optionally required:

$ pacman -Qt

Query display installed packages optionally required but not directly required:

$ pacman -Qtt

Query display installed native packages:

$ pacman -Qn

Query display installed AUR / foreign packages:

$ pacman -Qm

Query display info about installed package:

$ pacman -Qi usbutils

Query list files owned by installed package:

$ pacman -Ql usbutils

Query which installed package owns file:

$ pacman -Qo /usr/bin/pactl
	/usr/bin/pactl is owned by libpulse 13.0-3

Query local package file (-i display info, -l list files):

$ pacman -Qp redshifter-20200404-1-any.pkg.tar.xz
$ pacman -Qip redshifter-20200404-1-any.pkg.tar.xz
$ pacman -Qlp redshifter-20200404-1-any.pkg.tar.xz

Remove package only:

$ pacman -R usbutils

(recursively) Remove package, dependencies (if not needed by other packages), and saved files:

$ pacman -Rsn usbutils

-ss force remove ALL dependencies:

Warning: !!! DANGEROUS !!! Will break other packages
$ pacman -Rssn usbutils

(cascade) Remove package and all packages that depend on it:

Warning: !!! CAUTION !!! Will remove needed packages
$ pacman -Rc exo

Maintenance

Install pacdiff:

$ pacman -S pacman-contrib

Scan for .pacorig, .pacnew, .pacsave files:

$ pacdiff -o

or

$ pacdiff -o -l    # use locate
$ pacdiff -o -f    # use find

Merge or delete:

$ pacdiff

or

$ pacdiff -l
$ pacdiff -f
$ pacdiff -s    # use sudo

Remove orphans (unused packages):

$ pacman -Rsn $(pacman -Qtdq)

Clean uninstalled packages cache and syncdb (-cc also installed packages cache):

$ pacman -Sc
$ pacman -Scc

Check integrity of installed packages (all / specific / filter by missing files):

$ pacman -Qk
$ pacman -Qk fontconfig
$ pacman -Qk | grep -v '0 missing'

Display modified files:

$ pacman -Qii | awk '/^MODIFIED/ {print $2}'

IF EVER NEEDED, reinstall all native packages:

$ pacman -S $(pacman -Qnq)

AUR helpers / wrappers

aurget: written in Bash (no longer maintained)

$ wget -O PKGBUILD https://aur.archlinux.org/cgit/aur.git/plain/PKGBUILD?h=aurget
$ makepkg -si

aurget configuration:

$ cp /usr/share/doc/aurget/samples/aurgetrc ~/.config/aurgetrc
$ vim ~/.config/aurgetrc
	build_directory="$HOME/Builds"
	edit_pkgbuilds='never'

paru: written in Rust (pre-made bin package)

$ git clone https://aur.archlinux.org/paru-bin.git
$ cd paru-bin
$ makepkg -si

paru configuration:

$ cp /etc/paru.conf ~/.config/paru/paru.conf
$ vim ~/.config/aurgetrc
	[options]
	SkipReview
	AurOnly

Others: yay [Go], aura [Haskell], pikaur [Python]

https://wiki.archlinux.org/title/AUR_helpers

AUR make a package

Set packager name:

$ vim /etc/makepkg.conf
	PACKAGER="Your Name <your@email.dom>"

makepkg common options:

$ makepkg -si    # build and install
$ makepkg -fs    # force rebuild
$ makepkg -fsi    # force rebuild and install

Optional validation tool:

$ pacman -S namcap

Build steps:

$ wget -O PKGBUILD https://gitlab.archlinux.org/pacman/pacman/raw/master/proto/PKGBUILD.proto
$ vim PKGBUILD
$ makepkg -g >> PKGBUILD
$ namcap PKGBUILD    # for information messages in addition to warnings: namcap -i PKGBUILD
$ makepkg -s
$ namcap yourpackagename-1.0-1-x86_64.pkg.tar.xz

AUR upload package

#    Generate keypair
$ ssh-keygen -f ~/.ssh/aur

#    Change/remove passphrase if needed
$ ssh-keygen -p -f ~/.ssh/aur

#    Change/remove comment if needed
$ ssh-keygen -c -f ~/.ssh/aur

#    Specify private key for AUR remote
$ vim ~/.ssh/config
	Host aur.archlinux.org
	  IdentityFile ~/.ssh/aur
	  User aur

==> Copy public key ~/.ssh/aur.pub to AURweb under My Account
#    Configure git

$ git config --global user.name "Your Name"
$ git config --global user.email "your@email.dom"
#    Method 1: clone empty git repo to create it

$ cd ~/Builds
$ git clone ssh://aur@aur.archlinux.org/redshifter.git
$ cd redshifter

$ vim PKGBUILD
$ makepkg --printsrcinfo > .SRCINFO

$ git add PKGBUILD .SRCINFO
$ git commit -m "your comment"
$ git push
#    Method 2: add empty remote repo to create it

$ cd ~/Builds/xhip
$ vim PKGBUILD
$ makepkg --printsrcinfo > .SRCINFO

$ git init
$ git add PKGBUILD .SRCINFO
$ git commit -m "your comment"

$ git remote add origin ssh://aur@aur.archlinux.org/xhip.git
$ git push -u origin master
#    Method 3a: pull from existing repo

$ cd ~/Builds/freepats-ydp-grand-piano
$ git init
$ git remote add origin ssh://aur@aur.archlinux.org/freepats-ydp-grand-piano.git
$ git pull origin master

$ vim PKGBUILD
$ makepkg --printsrcinfo > .SRCINFO

$ git add PKGBUILD .SRCINFO
$ git commit -m "your comment"
$ git push
#    Method 3b: fetch and branch from existing repo

$ cd ~/Builds/freepats-ydp-grand-piano
$ git init
$ git remote add origin ssh://aur@aur.archlinux.org/freepats-ydp-grand-piano.git
$ git fetch    # git fetch origin master
$ git checkout -tb master    # git checkout -tb master origin/master

$ vim PKGBUILD
$ makepkg --printsrcinfo > .SRCINFO

$ git add PKGBUILD .SRCINFO
$ git commit -m "your comment"
$ git push
#    More git commands

$ git remote -v    # See remotes
$ git branch -a    # See all branches (local and remote)
$ git branch -vv    # See hash and subject

$ git status
$ git log    # See commits log
$ git log -p    # See commits diffs (--patch)
$ git diff master origin/master
$ git diff master...origin/master

$ git commit -am "your comment"    # Commit all (-a) changed files

$ git reset    # Reset uncommitted changes
$ git revert HEAD    # Undo commits

Favorite essential packages

bash-completion
mc
screen
nmap
locate
wget
rsync
htop
iftop
progress

redshift
xrandr
xbindkeys
pamixer
playerctl
x11vnc
remmina freerdp
networkmanager-applet networkmanager-openconnect

More info