A script to switch NVIDIA graphics card using bbswitch
git clone https://github.com/YiPrograms/NV-Card.git
sudo cp NV-Card/card /usr/local/binAUR package is available here
yay nv-card
card on : Turn the graphics card on
card off : Turn the graphics card off
card run : Turn the card on and turn it off after keyboard interruption
card stat : Show graphics card status
card watch : Monitor graphics card status
card display : Start external display
card [command] : Run [command] using optirun
ON/OFF script from nvidia-xrun