aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--data/50-org.ayatana.indicator.display.AccountsService.rules7
-rw-r--r--data/CMakeLists.txt19
-rw-r--r--data/org.ayatana.indicator.display.AccountsService.policy21
-rw-r--r--data/org.ayatana.indicator.display.AccountsService.xml17
4 files changed, 64 insertions, 0 deletions
diff --git a/data/50-org.ayatana.indicator.display.AccountsService.rules b/data/50-org.ayatana.indicator.display.AccountsService.rules
new file mode 100644
index 0000000..d3126f3
--- /dev/null
+++ b/data/50-org.ayatana.indicator.display.AccountsService.rules
@@ -0,0 +1,7 @@
+// Allow LightDM to set AccountsService fields
+polkit.addRule (function (action, subject) {
+ if (action.id == "org.ayatana.indicator.display.AccountsService.ModifyAnyUser" && subject.user == "lightdm")
+ {
+ return polkit.Result.YES;
+ }
+});
diff --git a/data/CMakeLists.txt b/data/CMakeLists.txt
index 38ba788..451c9e8 100644
--- a/data/CMakeLists.txt
+++ b/data/CMakeLists.txt
@@ -64,3 +64,22 @@ install (FILES "${AYATANA_INDICATOR_FILE}"
# ayatana-indicator-display-brightness-high
install (DIRECTORY "icons/" DESTINATION "${CMAKE_INSTALL_FULL_DATADIR}/icons/hicolor/scalable/status" FILES_MATCHING PATTERN "*.svg")
+
+if (ENABLE_COLOR_TEMP)
+
+ # org.ayatana.indicator.display.AccountsService.xml
+
+ install (FILES org.ayatana.indicator.display.AccountsService.xml DESTINATION "${CMAKE_INSTALL_FULL_DATADIR}/dbus-1/interfaces")
+ install (DIRECTORY DESTINATION "${CMAKE_INSTALL_FULL_DATADIR}/accountsservice/interfaces/")
+ install (CODE "message(STATUS \"Symlinking: \$ENV{DESTDIR}${CMAKE_INSTALL_FULL_DATADIR}/accountsservice/interfaces/org.ayatana.indicator.display.AccountsService.xml\")")
+ install (CODE "execute_process(COMMAND ${CMAKE_COMMAND} -E create_symlink ../../dbus-1/interfaces/org.ayatana.indicator.display.AccountsService.xml \$ENV{DESTDIR}${CMAKE_INSTALL_FULL_DATADIR}/accountsservice/interfaces/org.ayatana.indicator.display.AccountsService.xml)")
+
+ # org.ayatana.indicator.display.AccountsService.policy
+
+ install (FILES org.ayatana.indicator.display.AccountsService.policy DESTINATION "${CMAKE_INSTALL_FULL_DATADIR}/polkit-1/actions")
+
+ # 50-org.ayatana.indicator.display.AccountsService.rules
+
+ install (FILES 50-org.ayatana.indicator.display.AccountsService.rules DESTINATION "${CMAKE_INSTALL_FULL_DATADIR}/polkit-1/rules.d")
+
+endif ()
diff --git a/data/org.ayatana.indicator.display.AccountsService.policy b/data/org.ayatana.indicator.display.AccountsService.policy
new file mode 100644
index 0000000..a2bff7a
--- /dev/null
+++ b/data/org.ayatana.indicator.display.AccountsService.policy
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<policyconfig>
+ <action id="org.ayatana.indicator.display.AccountsService.ModifyOwnUser">
+ <description>Set properties of own user</description>
+ <message>Authentication is required to set one's own indicator display properties.</message>
+ <defaults>
+ <allow_any>yes</allow_any>
+ <allow_inactive>yes</allow_inactive>
+ <allow_active>yes</allow_active>
+ </defaults>
+ </action>
+ <action id="org.ayatana.indicator.display.AccountsService.ModifyAnyUser">
+ <description>Set properties of any user</description>
+ <message>Authentication is required to set another user's indicator display properties.</message>
+ <defaults>
+ <allow_any>no</allow_any>
+ <allow_inactive>no</allow_inactive>
+ <allow_active>no</allow_active>
+ </defaults>
+ </action>
+</policyconfig>
diff --git a/data/org.ayatana.indicator.display.AccountsService.xml b/data/org.ayatana.indicator.display.AccountsService.xml
new file mode 100644
index 0000000..9e41ef2
--- /dev/null
+++ b/data/org.ayatana.indicator.display.AccountsService.xml
@@ -0,0 +1,17 @@
+<node>
+ <interface name="org.ayatana.indicator.display.AccountsService">
+ <annotation name="org.freedesktop.Accounts.VendorExtension" value="true"/>
+ <annotation name="org.freedesktop.Accounts.Authentication.ChangeOwn" value="org.ayatana.indicator.display.AccountsService.ModifyOwnUser"/>
+ <annotation name="org.freedesktop.Accounts.Authentication.ReadAny" value="org.ayatana.indicator.display.AccountsService.ModifyAnyUser"/>
+ <annotation name="org.freedesktop.Accounts.Authentication.ChangeAny" value="org.ayatana.indicator.display.AccountsService.ModifyAnyUser"/>
+ <property name="brightness" type="d" access="readwrite">
+ <annotation name="org.freedesktop.Accounts.DefaultValue" value="1.0"/>
+ </property>
+ <property name="color-temp" type="q" access="readwrite">
+ <annotation name="org.freedesktop.Accounts.DefaultValue" value="4913"/>
+ </property>
+ <property name="color-temp-profile" type="q" access="readwrite">
+ <annotation name="org.freedesktop.Accounts.DefaultValue" value="2"/>
+ </property>
+ </interface>
+</node>