This script is extremly simple and is done for a system with kde and a standard webcam.
The script can be run with sh togglecamera.sh.
To call it with a shortcut go to
System Settings > Shortcuts > Custom Shortcuts > Edit > Global Shortcut > Command/URL
Choose your shortcut in the section triggler.
And in Action put your command sh /absulote/path/to/scipt/togglecamera.sh.
Finally apply and you are done. :)
Copyright (C) 2019 OnikenX
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.