#!/bin/bash

## Copyright (C) 2012 - 2025 ENCRYPTED SUPPORT LLC <adrelanos@whonix.org>
## See the file COPYING for copying conditions.

set -x

true "$0: START"

## OLD - No longer in use.
## This script gets run by the /etc/xdg/autostart/msgdispatcher.desktop hook.
#/usr/libexec/msgcollector/msgdispatcher & disown

## Workaround for:
## Qubes fails to start/activate systemd graphical-session.target target #9576
## https://github.com/QubesOS/qubes-issues/issues/9576
## See also:
## /usr/lib/systemd/user/msgcollector-gui.service

if [ "$(systemctl --user is-enabled msgcollector-gui.service 2>/dev/null)" == "masked" ]; then
  exit 0
fi

## Use '2>/dev/null' to hide messages such as:
## > Warning: The unit file, source configuration file or drop-ins of msgcollector-gui.service changed on disk. Run 'systemctl --user daemon-reload' to reload units.
systemctl --user --no-pager --no-block start msgcollector-gui.service 2>/dev/null

true "$0: END"
