summarylogtreecommitdiffstats
path: root/indicator-sensors.install
blob: e340fb267e303e7e6128900afa9fe5303b610292 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
post_install() {
    cat << EOF
==> One way to solve Policykit/UDisks2 related errors ("Error:org.freedesktop.UDisks2.Error.NotAuthorized: Not authorized to perform operation") is to define the following rules in file /etc/polkit-1/rules.d/50-udisks.rules (where <GROUP> is for example your main/initial login user group):

    polkit.addRule(function(action, subject) {
      var YES = polkit.Result.YES;
      var permission = {
        // only required for udisks2:
        "org.freedesktop.udisks2.ata-check-power": YES,
        "org.freedesktop.udisks2.ata-smart-update": YES,
      };
      if (subject.isInGroup("<GROUP>")) {
        return permission[action.id];
      }
    });

    Then restart the polkit service.
EOF
}