# 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/3.0>,

include <tunables/global>

@{exec_path} = @{bin}/lxqt-backlight_backend
profile lxqt-backlight_backend @{exec_path} {
  include <abstractions/base>
  include <abstractions/gtk>
  include <abstractions/video>
  include <abstractions/lxqt>
  include <abstractions/qt5-shader-cache>
  include <abstractions/bus-accessibility>
  include <abstractions/bus-session>
  include <abstractions/gvfs-open>
  
  @{exec_path}			mr,

  @{sys}/class/backlight/ 	r,
  @{sys}/devices/@{pci_bus}/0000:00:02.0/drm/card@{int}/card@{int}-eDP-@{int}/intel_backlight/                   r,
  @{sys}/devices/@{pci_bus}/0000:00:02.0/drm/card@{int}/card@{int}-eDP-@{int}/intel_backlight/max_brightness     r,
  @{sys}/devices/@{pci_bus}/0000:00:02.0/drm/card@{int}/card@{int}-eDP-@{int}/intel_backlight/bl_power           r,
  @{sys}/devices/@{pci_bus}/0000:00:02.0/drm/card@{int}/card@{int}-eDP-@{int}/intel_backlight/actual_brightness  r,
  owner @{sys}/devices/@{pci_bus}/0000:00:02.0/drm/card@{int}/card@{int}-eDP-@{int}/intel_backlight/brightness  rw,
  @{sys}/devices/@{pci_bus}/**/**/drm/card@{int}/card@{int}-eDP-1/amdgpu_bl@{int}/*  				 r,
  owner @{sys}/devices/@{pci_bus}/**/**/drm/card@{int}/card@{int}-eDP-1/amdgpu_bl@{int}/brightness  		 rw,

  owner /tmp/@{int}  		r,

  /dev/tty 			rw,

  include if exists <local/lxqt-backlight_backend>
}

# vim:syntax=apparmor
