Updated duo configuration

This commit is contained in:
2025-01-09 10:39:36 -04:00
parent 3b5312647b
commit 81b226dfec

View File

@@ -9,19 +9,25 @@
# Path to the duo script
duoScript = "${duoRepo}/duo";
# Modify the shebang and create a new script
modifiedDuoScript = pkgs.writeShellScript "modified-duo" ''
#!${pkgs.bash}/bin/bash
cd "$(dirname "$(realpath "$0")")"
${builtins.readFile duoScript}
'';
# Read and modify the script content
modifiedScriptContent =
builtins.replaceStrings [
"#!/usr/bin/env bash"
"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 {
systemd.services.watchBacklight = {
description = "synchronize screen brightness";
wantedBy = ["default.target"];
path = [pkgs.inotify-tools pkgs.sudo];
serviceConfig = {
ExecStart = "${modifiedDuoScript} watch-backlight";
ExecStart = "${patchedDuoScript} watch-backlight";
Restart = "always";
RestartSec = 5;
};
@@ -34,7 +40,7 @@ in {
path = [pkgs.gnome-monitor-config pkgs.usbutils pkgs.inotify-tools];
serviceConfig = {
ExecStart = "${modifiedDuoScript} watch-displays";
ExecStart = "${patchedDuoScript} watch-displays";
Restart = "always";
RestartSec = 5;
};
@@ -46,7 +52,7 @@ in {
after = ["graphical-session.target"];
path = [pkgs.gnome-monitor-config pkgs.iio-sensor-proxy];
serviceConfig = {
ExecStart = "${modifiedDuoScript} watch-rotation";
ExecStart = "${patchedDuoScript} watch-rotation";
Restart = "always";
RestartSec = 5;
};