can't get clock offset to run in service/i3
This commit is contained in:
@@ -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
|
||||
# alternative if you installed aside with XFCE4:
|
||||
# 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
|
||||
# https://github.com/nwg-piotr/autotiling
|
||||
|
||||
@@ -116,24 +116,27 @@ in {
|
||||
};
|
||||
systemd.services.nvidiaSetClocks = lib.mkIf cfg.clock.enable {
|
||||
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" ];
|
||||
after = [ "display-manager.service" ];
|
||||
requires = [ "display-manager.service" ];
|
||||
environment.DISPLAY = ":0";
|
||||
environment.XAUTHORITY = "/home/kopatz/.Xauthority";
|
||||
};
|
||||
systemd.user.services.nvidiaSetOffset = lib.mkIf cfg.clock.enable {
|
||||
description = "Sets gpu offset";
|
||||
enable = true;
|
||||
serviceConfig = { Type = "oneshot"; };
|
||||
script = ''
|
||||
${config.hardware.nvidia.package.settings}/bin/nvidia-settings -a "[gpu:0]/GPUGraphicsClockOffsetAllPerformanceLevels=${
|
||||
toString cfg.clock.offset
|
||||
}"'';
|
||||
environment = { DISPLAY = ":0"; };
|
||||
after = [ "xdg-desktop-autostart.target" ];
|
||||
wantedBy = [ "default.target" ];
|
||||
};
|
||||
# doesn't work
|
||||
#systemd.user.services.nvidiaSetOffset = lib.mkIf cfg.clock.enable {
|
||||
# description = "Sets gpu offset";
|
||||
# enable = true;
|
||||
# serviceConfig = { Type = "oneshot"; };
|
||||
# script = ''
|
||||
# ${config.hardware.nvidia.package.settings}/bin/nvidia-settings -a "[gpu:0]/GPUGraphicsClockOffsetAllPerformanceLevels=${
|
||||
# toString cfg.clock.offset
|
||||
# }"'';
|
||||
# environment = { DISPLAY = ":0"; };
|
||||
# after = [ "graphical-session.target" ];
|
||||
#};
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user