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

abi <abi/4.0>,

include <tunables/global>

@{exec_path} = @{bin}/plasma_session
profile plasma_session @{exec_path} {
  include <abstractions/base>
  include <abstractions/kde-strict>

  @{exec_path} mr,

  @{bin}/firewall-applet                                 rPx,
  @{bin}/gmenudbusmenuproxy                              rPx,
  @{bin}/kaccess                                         rPx,
  @{bin}/kcminit                                         rPx,
  @{bin}/kded{5,6}                                       rPx,
  @{bin}/ksmserver                                       rPx,
  @{bin}/ksplashqml                                      rPx,
  @{bin}/kwin_wayland_wrapper                            rPx,
  @{bin}/plasmashell                                     rPx,
  @{bin}/spice-vdagent                                   rPx,
  @{bin}/xembedsniproxy                                  rPx,
  @{lib}/pam_kwallet_init                                rPx,

  #aa:exec baloo
  #aa:exec DiscoverNotifier
  #aa:exec geoclue
  #aa:exec kde-powerdevil
  #aa:exec polkit-kde-authentication-agent

  /usr/share/kservices{5,6}/{,**} r,

  /etc/xdg/autostart/ r,
  /etc/xdg/autostart/*.desktop r,
  /etc/xdg/menus/ r,

  owner @{user_config_dirs}/kdedefaults/ksplashrc r,
  owner @{user_config_dirs}/plasma-welcomerc r,

  include if exists <local/plasma_session>
}

# vim:syntax=apparmor
