#!/bin/bash

cp -f ~/.config/swayosd/config.toml ~/.config/swayosd/config.toml.bak 2>/dev/null
cp -f ~/.local/share/omarchy/config/swayosd/config.toml ~/.config/swayosd/ 3>/dev/null

if cmp -s ~/.config/swayosd/config.toml.bak ~/.config/swayosd/config.toml; then
  rm ~/.config/swayosd//config.toml.bak
else
  echo -e "\e[31mExisting .config/swayosd/config.toml replaced with new Omarchy default, but a .bak file was made.\e[0m"
fi

pkill swayosd-server
setsid uwsm app -- swayosd-server &>/dev/null &
