about summary refs log tree commit diff
path: root/nixpkgs/pkgs/desktops/pantheon/services
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/desktops/pantheon/services')
-rw-r--r--nixpkgs/pkgs/desktops/pantheon/services/elementary-settings-daemon/default.nix10
-rw-r--r--nixpkgs/pkgs/desktops/pantheon/services/elementary-settings-daemon/fix-paths.patch11
-rw-r--r--nixpkgs/pkgs/desktops/pantheon/services/elementary-settings-daemon/global-backlight-helper.patch26
3 files changed, 45 insertions, 2 deletions
diff --git a/nixpkgs/pkgs/desktops/pantheon/services/elementary-settings-daemon/default.nix b/nixpkgs/pkgs/desktops/pantheon/services/elementary-settings-daemon/default.nix
index 1dfa64ae3732..aa451ba75166 100644
--- a/nixpkgs/pkgs/desktops/pantheon/services/elementary-settings-daemon/default.nix
+++ b/nixpkgs/pkgs/desktops/pantheon/services/elementary-settings-daemon/default.nix
@@ -22,6 +22,7 @@
 , libxml2
 , libxslt
 , meson
+, mousetweaks
 , networkmanager
 , ninja
 , nss
@@ -30,12 +31,12 @@
 , pkgconfig
 , polkit
 , python3
+, stdenv
 , substituteAll
 , systemd
 , tzdata
 , upower
 , wrapGAppsHook
-, stdenv
 }:
 
 stdenv.mkDerivation rec {
@@ -63,8 +64,9 @@ stdenv.mkDerivation rec {
   patches = let patchPath = "${src2}/debian/patches"; in [
     (substituteAll {
       src = ./fix-paths.patch;
-      inherit tzdata;
+      inherit tzdata mousetweaks;
     })
+    ./global-backlight-helper.patch
     "${patchPath}/45_suppress-printer-may-not-be-connected-notification.patch"
     "${patchPath}/64_restore_terminal_keyboard_shortcut_schema.patch"
     "${patchPath}/correct_logout_action.patch"
@@ -97,6 +99,10 @@ stdenv.mkDerivation rec {
     # This breaks lightlocker https://github.com/elementary/session-settings/commit/b0e7a2867608c3a3916f9e4e21a68264a20e44f8
     # TODO: shouldn't be neeed for the 5.1 greeter (awaiting release)
     rm $out/etc/xdg/autostart/org.gnome.SettingsDaemon.ScreensaverProxy-pantheon.desktop
+
+    # So the polkit policy can reference /run/current-system/sw/bin/elementary-settings-daemon/gsd-backlight-helper
+    mkdir -p $out/bin/elementary-settings-daemon
+    ln -s $out/libexec/gsd-backlight-helper $out/bin/elementary-settings-daemon/gsd-backlight-helper
   '';
 
   nativeBuildInputs = [
diff --git a/nixpkgs/pkgs/desktops/pantheon/services/elementary-settings-daemon/fix-paths.patch b/nixpkgs/pkgs/desktops/pantheon/services/elementary-settings-daemon/fix-paths.patch
index 2229302cab7c..272656fae78c 100644
--- a/nixpkgs/pkgs/desktops/pantheon/services/elementary-settings-daemon/fix-paths.patch
+++ b/nixpkgs/pkgs/desktops/pantheon/services/elementary-settings-daemon/fix-paths.patch
@@ -13,3 +13,14 @@
  
  typedef struct _TzDB TzDB;
  typedef struct _TzLocation TzLocation;
+--- a/plugins/mouse/gsd-mouse-manager.c
++++ b/plugins/mouse/gsd-mouse-manager.c
+@@ -118,7 +118,7 @@ set_mousetweaks_daemon (GsdMouseManager *manager,
+         gboolean run_daemon = dwell_click_enabled || secondary_click_enabled;
+
+         if (run_daemon || manager->priv->mousetweaks_daemon_running)
+-                comm = g_strdup_printf ("mousetweaks %s",
++                comm = g_strdup_printf ("@mousetweaks@/bin/mousetweaks %s",
+                                         run_daemon ? "" : "-s");
+         else
+                 return;
diff --git a/nixpkgs/pkgs/desktops/pantheon/services/elementary-settings-daemon/global-backlight-helper.patch b/nixpkgs/pkgs/desktops/pantheon/services/elementary-settings-daemon/global-backlight-helper.patch
new file mode 100644
index 000000000000..dcdc83934ba6
--- /dev/null
+++ b/nixpkgs/pkgs/desktops/pantheon/services/elementary-settings-daemon/global-backlight-helper.patch
@@ -0,0 +1,26 @@
+diff --git a/plugins/power/gsd-backlight.c b/plugins/power/gsd-backlight.c
+index d7d10fd2..5619d6ad 100644
+--- a/plugins/power/gsd-backlight.c
++++ b/plugins/power/gsd-backlight.c
+@@ -358,7 +358,7 @@ gsd_backlight_run_set_helper (GsdBacklight *backlight, GTask *task)
+                 proc = g_subprocess_new (G_SUBPROCESS_FLAGS_STDOUT_SILENCE,
+                                          &error,
+                                          "pkexec",
+-                                         LIBEXECDIR "/gsd-backlight-helper",
++                                         "/run/current-system/sw/bin/elementary-settings-daemon/gsd-backlight-helper",
+                                          g_udev_device_get_sysfs_path (backlight->udev_device),
+                                          data->value_str, NULL);
+         } else {
+diff --git a/plugins/power/org.gnome.settings-daemon.plugins.power.policy.in.in b/plugins/power/org.gnome.settings-daemon.plugins.power.policy.in.in
+index f16300f8..79d6bd17 100644
+--- a/plugins/power/org.gnome.settings-daemon.plugins.power.policy.in.in
++++ b/plugins/power/org.gnome.settings-daemon.plugins.power.policy.in.in
+@@ -25,7 +25,7 @@
+       <allow_inactive>no</allow_inactive>
+       <allow_active>yes</allow_active>
+     </defaults>
+-    <annotate key="org.freedesktop.policykit.exec.path">@libexecdir@/gsd-backlight-helper</annotate>
++    <annotate key="org.freedesktop.policykit.exec.path">/run/current-system/sw/bin/elementary-settings-daemon/gsd-backlight-helper</annotate>
+   </action>
+
+ </policyconfig>