can't get clock offset to run in service/i3

This commit is contained in:
Kopatz
2025-02-12 11:14:11 +01:00
parent 00384c9f5e
commit 865527d74b
2 changed files with 17 additions and 14 deletions

View File

@@ -351,7 +351,7 @@ exec_always --no-startup-id sleep 5 && pactl list short sources | grep 'alsa_inp
exec --no-startup-id /usr/bin/env dunst exec --no-startup-id /usr/bin/env dunst
# alternative if you installed aside with XFCE4: # alternative if you installed aside with XFCE4:
# exec --no-startup-id /usr/lib/xfce4/notifyd/xfce4-notifyd & # exec --no-startup-id /usr/lib/xfce4/notifyd/xfce4-notifyd &
exec --no-startup-id nvidia-settings -a "[gpu:0]/GPUGraphicsClockOffsetAllPerformanceLevels=230" exec --no-startup-id sleep 5 && nvidia-settings -a "[gpu:0]/GPUGraphicsClockOffsetAllPerformanceLevels=230"
# autotiling script # autotiling script
# https://github.com/nwg-piotr/autotiling # https://github.com/nwg-piotr/autotiling

View File

@@ -116,24 +116,27 @@ in {
}; };
systemd.services.nvidiaSetClocks = lib.mkIf cfg.clock.enable { systemd.services.nvidiaSetClocks = lib.mkIf cfg.clock.enable {
description = "Set GPU clocks"; description = "Set GPU clocks";
script = ''/run/current-system/sw/bin/nvidia-smi -i 0 -lgc ${toString cfg.clock.min},${toString cfg.clock.max}''; script =
"/run/current-system/sw/bin/nvidia-smi -pm 1 && /run/current-system/sw/bin/nvidia-smi -i 0 -lgc ${
toString cfg.clock.min
},${toString cfg.clock.max}";
wantedBy = [ "multi-user.target" ]; wantedBy = [ "multi-user.target" ];
after = [ "display-manager.service" ]; after = [ "display-manager.service" ];
requires = [ "display-manager.service" ]; requires = [ "display-manager.service" ];
environment.DISPLAY = ":0"; environment.DISPLAY = ":0";
environment.XAUTHORITY = "/home/kopatz/.Xauthority"; environment.XAUTHORITY = "/home/kopatz/.Xauthority";
}; };
systemd.user.services.nvidiaSetOffset = lib.mkIf cfg.clock.enable { # doesn't work
description = "Sets gpu offset"; #systemd.user.services.nvidiaSetOffset = lib.mkIf cfg.clock.enable {
enable = true; # description = "Sets gpu offset";
serviceConfig = { Type = "oneshot"; }; # enable = true;
script = '' # serviceConfig = { Type = "oneshot"; };
${config.hardware.nvidia.package.settings}/bin/nvidia-settings -a "[gpu:0]/GPUGraphicsClockOffsetAllPerformanceLevels=${ # script = ''
toString cfg.clock.offset # ${config.hardware.nvidia.package.settings}/bin/nvidia-settings -a "[gpu:0]/GPUGraphicsClockOffsetAllPerformanceLevels=${
}"''; # toString cfg.clock.offset
environment = { DISPLAY = ":0"; }; # }"'';
after = [ "xdg-desktop-autostart.target" ]; # environment = { DISPLAY = ":0"; };
wantedBy = [ "default.target" ]; # after = [ "graphical-session.target" ];
}; #};
}); });
} }