I am trying to achieve the same thing on linux. I am trying to search for the API that can help me do this I dont want a third party library but any nudge in the right direction will help me. If you have any idea I would be grateful for your help.
I am using Pop!_OS 22.04