# 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
@{att} = ""
profile lxqt-globalkeysd /{,usr/}bin/lxqt-globalkeysd flags=(complain) {
  include <abstractions/base-strict>
  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
