#!/bin/bash

mkdir /home/$USERNAME/CamApp
cp ./app-icon.png /home/$USERNAME/CamApp/icon.png
cp ./CamApp-x86_64.AppImage /home/$USERNAME/CamApp/CamApp.AppImage
echo "[Desktop Entry]
Type=Application
Name=C(am)App
Comment=Measurement camera application
Icon=/home/$USERNAME/CamApp/icon.png
Exec=/home/$USERNAME/CamApp/CamApp.AppImage" >> C\(am\)App.desktop
sudo chmod +x ./C\(am\)App.desktop
cp ./C\(am\)App.desktop /home/$USERNAME/Desktop/C\(am\)App.desktop
cp ./C\(am\)App.desktop ~/.local/share/applications/C\(am\)App.desktop
rm ./C\(am\)App.desktop
sudo cp ./90-camPerm.rules /etc/udev/rules.d/90-camPerm.rules
sudo udevadm control --reload
sudo udevadm trigger --action=add
