Updated duo configuration
This commit is contained in:
@@ -9,19 +9,25 @@
|
|||||||
# Path to the duo script
|
# Path to the duo script
|
||||||
duoScript = "${duoRepo}/duo";
|
duoScript = "${duoRepo}/duo";
|
||||||
|
|
||||||
# Modify the shebang and create a new script
|
# Read and modify the script content
|
||||||
modifiedDuoScript = pkgs.writeShellScript "modified-duo" ''
|
modifiedScriptContent =
|
||||||
#!${pkgs.bash}/bin/bash
|
builtins.replaceStrings [
|
||||||
cd "$(dirname "$(realpath "$0")")"
|
"#!/usr/bin/env bash"
|
||||||
${builtins.readFile duoScript}
|
"prefered_resolution=\"2880x1800@120.000\""
|
||||||
'';
|
] [
|
||||||
|
"#!${pkgs.bash}/bin/bash"
|
||||||
|
"prefered_resolution=\"2880x1800@120.000+vrr\""
|
||||||
|
] (builtins.readFile duoScript);
|
||||||
|
|
||||||
|
# Write the modifications to a patched duo file
|
||||||
|
patchedDuoScript = pkgs.writeShellScript "patched-duo" modifiedScriptContent;
|
||||||
in {
|
in {
|
||||||
systemd.services.watchBacklight = {
|
systemd.services.watchBacklight = {
|
||||||
description = "synchronize screen brightness";
|
description = "synchronize screen brightness";
|
||||||
wantedBy = ["default.target"];
|
wantedBy = ["default.target"];
|
||||||
path = [pkgs.inotify-tools pkgs.sudo];
|
path = [pkgs.inotify-tools pkgs.sudo];
|
||||||
serviceConfig = {
|
serviceConfig = {
|
||||||
ExecStart = "${modifiedDuoScript} watch-backlight";
|
ExecStart = "${patchedDuoScript} watch-backlight";
|
||||||
Restart = "always";
|
Restart = "always";
|
||||||
RestartSec = 5;
|
RestartSec = 5;
|
||||||
};
|
};
|
||||||
@@ -34,7 +40,7 @@ in {
|
|||||||
|
|
||||||
path = [pkgs.gnome-monitor-config pkgs.usbutils pkgs.inotify-tools];
|
path = [pkgs.gnome-monitor-config pkgs.usbutils pkgs.inotify-tools];
|
||||||
serviceConfig = {
|
serviceConfig = {
|
||||||
ExecStart = "${modifiedDuoScript} watch-displays";
|
ExecStart = "${patchedDuoScript} watch-displays";
|
||||||
Restart = "always";
|
Restart = "always";
|
||||||
RestartSec = 5;
|
RestartSec = 5;
|
||||||
};
|
};
|
||||||
@@ -46,7 +52,7 @@ in {
|
|||||||
after = ["graphical-session.target"];
|
after = ["graphical-session.target"];
|
||||||
path = [pkgs.gnome-monitor-config pkgs.iio-sensor-proxy];
|
path = [pkgs.gnome-monitor-config pkgs.iio-sensor-proxy];
|
||||||
serviceConfig = {
|
serviceConfig = {
|
||||||
ExecStart = "${modifiedDuoScript} watch-rotation";
|
ExecStart = "${patchedDuoScript} watch-rotation";
|
||||||
Restart = "always";
|
Restart = "always";
|
||||||
RestartSec = 5;
|
RestartSec = 5;
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user