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

abi <abi/4.0>,

include <tunables/global>

@{exec_path} = @{bin}/lxqt-globalkeysd
profile lxqt-globalkeysd @{exec_path} {
  include <abstractions/base>
  include <abstractions/bus-accessibility>
  include <abstractions/lxqt>
  include <abstractions/nameservice-strict>

  @{exec_path} mr,

  @{open_path} rPx -> child-open-help,
  @{bin}/screengrab rPx,
  @{bin}/lxqt-config-brightness rPx,

  /usr/share/lxqt/globalkeyshortcuts.conf rw,

  /var/lib/dbus/machine-id r,

  owner @{user_config_dirs}/lxqt/ r,
  owner @{user_config_dirs}/lxqt/globalkeyshortcuts.conf.lock wrk,
  owner @{user_config_dirs}/lxqt/#@{int} wr,
  owner @{user_config_dirs}/lxqt/globalkeyshortcuts.conf.@{rand6} rw,
  owner @{user_config_dirs}/lxqt/globalkeyshortcuts.conf.@{rand6} l -> @{user_config_dirs}/lxqt/#@{int},

  owner /tmp/@{int} r,

  /dev/tty rw,

  include if exists <local/lxqt-globalkeysd>
}

# vim:syntax=apparmor
