#!/bin/bash
sudo rm /usr/lib/python3/dist-packages/htdocs/gfx/openwebrx-background-cool-blue.png
sudo rm /usr/lib/python3/dist-packages/htdocs/gfx/openwebrx-background-cool-blue.webp

sudo cp openwebrx-background-cool-blue.png /usr/lib/python3/dist-packages/htdocs/gfx
sudo cp openwebrx-background-cool-blue.webp /usr/lib/python3/dist-packages/htdocs/gfx
sudo cp icon_files.png /usr/lib/python3/dist-packages/htdocs/gfx/icon_files.png
sudo cp icon_help.png /usr/lib/python3/dist-packages/htdocs/gfx/icon_help.png
sudo cp icon_log.png /usr/lib/python3/dist-packages/htdocs/gfx/icon_log.png
sudo cp icon_map.png /usr/lib/python3/dist-packages/htdocs/gfx/icon_map.png
sudo cp icon_receiver.png /usr/lib/python3/dist-packages/htdocs/gfx/icon_receiver.png
sudo cp icon_settings.png /usr/lib/python3/dist-packages/htdocs/gfx/icon_settings.png
sudo cp icon_status.png /usr/lib/python3/dist-packages/htdocs/gfx/icon_status.png
sudo cp play.png /usr/lib/python3/dist-packages/htdocs/gfx/play.png
sudo cp icon_directcall.png /usr/lib/python3/dist-packages/htdocs/gfx/icon_directcall.png
sudo cp icon_groupcall.png /usr/lib/python3/dist-packages/htdocs/gfx/icon_groupcall.png

sudo chown -R openwebrx:openwebrx /usr/lib/python3/dist-packages/htdocs/gfx/openwebrx-background-cool-blue.png
sudo chown -R openwebrx:openwebrx /usr/lib/python3/dist-packages/htdocs/gfx/openwebrx-background-cool-blue.webp

sudo sed -i 's|<svg viewBox="0 -960 960 960"><use xlink:href="${document_root}static/gfx/svg-defs.svg#panel-help"></use></svg>|<img src="${document_root}static/gfx/icon_help.png">|g' /usr/lib/python3/dist-packages/htdocs/include/header.include.html
sudo sed -i 's|<svg viewBox="0 -960 960 960"><use xlink:href="${document_root}static/gfx/svg-defs.svg#panel-status"></use></svg>|<img src="${document_root}static/gfx/icon_status.png">|g' /usr/lib/python3/dist-packages/htdocs/include/header.include.html
sudo sed -i 's|<svg viewBox="0 -960 960 960"><use xlink:href="${document_root}static/gfx/svg-defs.svg#panel-log"></use></svg>|<img src="${document_root}static/gfx/icon_log.png">|g' /usr/lib/python3/dist-packages/htdocs/include/header.include.html
sudo sed -i 's|<svg viewBox="0 -960 960 960"><use xlink:href="${document_root}static/gfx/svg-defs.svg#panel-receiver"></use></svg>|<img src="${document_root}static/gfx/icon_receiver.png">|g' /usr/lib/python3/dist-packages/htdocs/include/header.include.html
sudo sed -i 's|<svg viewBox="0 -960 960 960"><use xlink:href="${document_root}static/gfx/svg-defs.svg#panel-map"></use></svg>|<img src="${document_root}static/gfx/icon_map.png">|g' /usr/lib/python3/dist-packages/htdocs/include/header.include.html
sudo sed -i 's|<svg viewBox="0 -960 960 960"><use xlink:href="${document_root}static/gfx/svg-defs.svg#panel-files"></use></svg>|<img src="${document_root}static/gfx/icon_files.png">|g' /usr/lib/python3/dist-packages/htdocs/include/header.include.html
sudo sed -i 's|<svg viewBox="0 -960 960 960"><use xlink:href="${document_root}static/gfx/svg-defs.svg#panel-settings"></use></svg>|<img src="${document_root}static/gfx/icon_settings.png">|g' /usr/lib/python3/dist-packages/htdocs/include/header.include.html
sudo sed -i 's|<svg viewBox="0 0 700 700"><use xlink:href="static/gfx/svg-defs.svg#play-button"></use></svg>|<img src="${document_root}static/gfx/play.png">|g' /usr/lib/python3/dist-packages/htdocs/index.html
sudo sed -i 's|<img class="directcall" src="static/gfx/openwebrx-directcall.svg">|<img class="directcall" src="static/gfx/icon_directcall.png">|g' /usr/lib/python3/dist-packages/htdocs/index.html
sudo sed -i 's|<img class="groupcall" src="static/gfx/openwebrx-groupcall.svg">|<img class="groupcall" src="static/gfx/icon_groupcall.png">|g' /usr/lib/python3/dist-packages/htdocs/index.html

sudo systemctl restart openwebrx

