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

abi <abi/4.0>,

include <tunables/global>

@{exec_path} = @{bin}/i3lock
@{att} = ""
profile i3lock /{,usr/}bin/i3lock flags=(complain) {
  include <abstractions/base-strict>
  include <abstractions/fonts>
  include <abstractions/fontconfig-cache-read>
  include <abstractions/nameservice-strict>
  include <abstractions/authentication>
  include <abstractions/wutmp>

  network netlink raw,

  @{exec_path} mr,

  owner @{HOME}/.Xauthority r,

  owner @{PROC}/@{pid}/fd/ r,

  # For background image.
  owner @{HOME}/*.png r,
  owner @{HOME}/*/*.png r,

  # When using also i3lock-fancy.
  owner @{tmp}/tmp.*.png r,

  # file_inherit
  owner /dev/tty@{int} rw,

  include if exists <local/i3lock>
}

# vim:syntax=apparmor
