#!/bin/bash
# - bof - #



<<'comment'
# - Configured - #

cd ~/; rm -rf ~/Sound.sh; vim ~/Sound.sh;
copy & paste this content
chmod +x ~/Sound.sh; ~/./Sound.sh;

rm -rf ~/.bashrc;
vim ~/.bashrc;

ssh-keygen -R 192.168.1.1

# - On client - #
cd ~/.ssh;
ssh-keygen -t rsa;

cat ~/.ssh/id_rsa.pub;

# - On server - #
vim ~/.ssh/authorized_keys;

sudo apt install curl git htop inxi net-tools ntp neovim screenfetch tree -y;

# -  - #
# - Inxi documentation - #
https://itsfoss.com/inxi-system-info-linux/


comment



clear;





# :a
# -  - #
# - Install sound/audio drivers on HPLaptopArch - #

# -  - #
# - Documentation - #
https://github.com/DarkStalkr/Xiaomi_RedmiBookPro16_Audio_Fix



lspci -k -d ::03xx;
sudo pacman -S alsa-utils linux-firmware pavucontrol \
               pipewire pipewire-alsa pipewire-jack pipewire-pulse \
               sof-firmware wireplumber --needed;

sudo modprobe snd-hda-intel;
sudo modprobe snd-sof-pci-intel-mtl;


sudo vim /etc/default/grub;
GRUB_CMDLINE_LINUX_DEFAULT="snd_hda_intel.dmic_detect=0"

sudo grub-mkconfig -o /boot/grub/grub.cfg;


systemctl --user enable wireplumber;
systemctl --user start wireplumber;
systemctl --user restart pipewire pipewire-pulse wireplumber;

sudo alsactl restore;
sudo reboot now;



# -  - #
# - Post-reboot checks - #
# - Verify audio functionality with alsamixer & pavucontrol - #

# -  - #
# - Confirm services are running - #
systemctl --user status pipewire pipewire-pulse wireplumber;

# -  - #
# - Verify audio functionality - #
aplay /usr/share/sounds/alsa/Front_Center.wav;

# -  - #
# - Troubleshooting - #
sudo dmesg | grep -i audio;








# :b
# -  - #
# - Show nVidia hardware - #
lspci -k;
lspci -k | grep -A 2 -E "(VGA|3D)";
sudo dmesg | grep -i audio;
lspci | grep -i audio
nvidia-smi;


# :c
# -  - #
# - Show computer hardware with inxi - #

# -  - #
# - Basic - #
inxi;

# -  - #
# - CPU - #
inxi -a;

# -  - #
# - Sound - #
inxi -A;

# -  - #
# - General - #
sudo inxi -b;

# -  - #
# - CPU & speed - #
inxi -C;

# -  - #
# - Details - #
inxi -F;
inxi -Fazy;
sudo inxi -FAZ;

# -  - #
# - Memory - #
inxi -I;
sudo inxi -m;

# -  - #
# - Details - #
sudo inxi -SCMm -t c -P -x;

# -  - #
# - Graphics - #
inxi -G;

# -  - #
# - Raid - #
inxi -R;

# -  - #
# - CPU temperature - #
inxi -t;

# -  - #
# - CPU & memory use - #
inxi -t cm10;





# :d
# -  - #
# - Show computer sound hardware with dmseg - #
sudo dmesg | grep -E 'snd|sof';





# :e
# -  - #
# - Sound test - #
aplay -l;
speaker-test -c0;
pacman -Q | grep -P '^(alsa|sof|pipe)';











<<'comment'
cd ~/; rm -rf ~/Sound.sh; vim ~/Sound.sh;
copy & paste this content
chmod +x ~/Sound.sh; ~/./Sound.sh;
comment



# - eof - #