Skip to content

Commit

Permalink
Fix issues with AppArmor profile
Browse files Browse the repository at this point in the history
  • Loading branch information
MilesBHuff committed May 2, 2021
1 parent 6701177 commit f1818e5
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion application/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "ambient-kb"
version = "1.4.1"
version = "1.4.2"
license = "LAGPL3"
authors = ["Miles B Huff <MilesBHuff@Users.NoReply.Github.com>"]
description = "Calculates the average color of the display, and sets the keyboard to that color."
Expand Down
2 changes: 2 additions & 0 deletions configuration/apparmor/get-capabilities.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/bin/sh
exec capsh --print | grep Bounding | sed 's/^Bounding set *= */,/' | sed 's/,cap_/\ncapability /g' | grep capability | sort | sed 's/$/,/gm'
6 changes: 5 additions & 1 deletion configuration/apparmor/usr.bin.ambient-kb
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# AppArmor policy for `ambient-kb`
# Copyright © from 2021 by Miles B Huff per the terms of the GNU LAGPL 3.
include <tunables/home>

/usr/bin/ambient-kb {

Expand All @@ -12,9 +13,12 @@

# Needed to access X display
capability dac_read_search,
/home/*/.Xauthority r,
@{HOME}/.Xauthority r,
/sys/devices/** rw, #WARN: Not a great setting; but there's no way around this...

# Needed to set negative NICE levels
# capability sys_nice,

# Keyboard controllers
/sys/class/leds/system76_acpi::kbd_backlight/color w,
}

0 comments on commit f1818e5

Please sign in to comment.