This is specifically useful for Pi Zero W but it works for any Pi with onboard wifi.
Assuming you already have downloaded a Manjaro ARM image (any flavor) and written to your sd-card and now you have the urge to connect over WiFi to finalize the setup process.
- sd-card prepared with Manjaro ARM image
Open a terminal and do
su -l root
Mount the root image from the sdcard
mkdir tmproot mount /dev/mmcblk0p2 tmproot
Create a network definition
cat << EOF >> tmproot/etc/systemd/network/wlan0.network [Match] Name=wlan0 [Network] DHCP=yes EOF
Create a wpa_supplicant configuration - replace the variables $SSID and $PASS with your actual values (keep the quotation marks - it ensures special characters are not misinterpreted)
wpa_passphrase "$SSID" "$PASS" > tmproot/etc/wpa_supplicant/wpa_supplicant-wlan0.conf
Create a symlink to start wpa_supplicant for the wlan0 network
ln -s /usr/lib/systemd/system/wpa_supplicant@.service \ email@example.com
Unmount the partition and exit root context
umount tmproot rm -r tmproot exit
A complete script - optionally setting a static IP
Insert the sd-card in your pi and power up.