# apparmor.d - Full set of apparmor profiles
# Copyright (C) 2024 Alexandre Pujol <alexandre@pujol.io>
# SPDX-License-Identifier: GPL-2.0-only

abi <abi/3.0>,

include <tunables/global>

@{exec_path} = @{bin}/xfce4-screensaver
profile xfce-screensaver @{exec_path} flags=(attach_disconnected) {
  include <abstractions/base>
  include <abstractions/authentication>
  include <abstractions/graphics>
  include <abstractions/xfce>
  include <abstractions/nameservice-strict>

  @{exec_path} mr,

  @{sh_path}    rix,
  @{bin}/pidof  rix,
  @{bin}/wc     rix,

  @{lib}/xfce4-screensaver-dialog rix,
  @{lib}/xfce4-screensaver-gl-helper rix,

  /etc/xdg/menus/xfce4-screensavers.menu r,

  @{run}/systemd/inhibit/*.ref rw,

  include if exists <local/xfce-screensaver>
}