# apparmor.d - Full set of apparmor profiles
# Copyright (C) 2024 odomingao
# SPDX-License-Identifier: GPL-2.0-only

abi <abi/4.0>,

include <tunables/global>

@{exec_path} = @{bin}/pypr
@{att} = /att/pypr/
profile pypr /{,usr/}bin/pypr  flags=(attach_disconnected,attach_disconnected.path=@{att},complain) {
  include <abstractions/attached/base>
  include <abstractions/app-launcher-user>
  include <abstractions/attached/consoles>

  signal send set=(term kill),

  ptrace read,

  @{exec_path} mr,

  owner @{user_config_dirs}/hypr/pyprland.toml r,

  owner @{run}/user/@{uid}/hypr/*/.pyprland.sock rw,

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

  include if exists <local/pypr>
}

# vim:syntax=apparmor
