#!/usr/bin/env bash
set -u
if command -v wtype >/dev/null 2>&1 && [[ -n "${WAYLAND_DISPLAY:-}" ]]; then
  wtype -M ctrl -P r -p r -m ctrl
elif command -v xdotool >/dev/null 2>&1 && [[ -n "${DISPLAY:-}" ]]; then
  xdotool search --onlyvisible --class 'chromium' windowactivate --sync key --clearmodifiers ctrl+r
else
  systemctl --user restart salsabil-tv.service
fi
