amd gpu
This commit is contained in:
@@ -10,6 +10,8 @@ let
|
||||
sleep 4
|
||||
systemctl --user restart xdg-desktop-portal
|
||||
'';
|
||||
monitor1 = if isPc then "DP-1" else if isLaptop then "eDP-1" else "eDP-1";
|
||||
monitor2 = "HDMI-A-1";
|
||||
in {
|
||||
config = lib.mkIf cfg.enable {
|
||||
|
||||
@@ -28,8 +30,8 @@ in {
|
||||
|
||||
# See https://wiki.hyprland.org/Configuring/Monitors/
|
||||
monitor = if isPc then [
|
||||
"HDMI-A-1,1920x1080@60,0x0,1"
|
||||
"DP-3,2560x1440@150,1920x0,1"
|
||||
"${monitor2},1920x1080@60,0x0,1"
|
||||
"${monitor1},2560x1440@144,1920x0,1"
|
||||
"Unknown-1,disable"
|
||||
] else if isLaptop then [
|
||||
# laptop
|
||||
@@ -45,13 +47,13 @@ in {
|
||||
|
||||
workspace =
|
||||
lib.lists.optionals (osConfig.networking.hostName == "kop-pc") [
|
||||
"1,monitor:DP-3"
|
||||
"2,monitor:DP-3"
|
||||
"3,monitor:DP-3"
|
||||
"4,monitor:DP-3"
|
||||
"5,monitor:DP-3"
|
||||
"9,monitor:HDMI-A-1"
|
||||
"10,monitor:HDMI-A-1"
|
||||
"1,monitor:${monitor1}"
|
||||
"2,monitor:${monitor1}"
|
||||
"3,monitor:${monitor1}"
|
||||
"4,monitor:${monitor1}"
|
||||
"5,monitor:${monitor1}"
|
||||
"9,monitor:${monitor2}"
|
||||
"10,monitor:${monitor2}"
|
||||
];
|
||||
|
||||
# See https://wiki.hyprland.org/Configuring/Keywords/ for more
|
||||
@@ -64,7 +66,7 @@ in {
|
||||
|
||||
# Some default env vars.
|
||||
env =
|
||||
[ "XCURSOR_SIZE,24" "NIXOS_OZONE_WL,1" "WLR_NO_HARDWARE_CURSORS,1" ]
|
||||
[ "XCURSOR_SIZE,24" "NIXOS_OZONE_WL,1" ]
|
||||
++ lib.optionals osConfig.custom.hardware.nvidia.enable [
|
||||
"LIBVA_DRIVER_NAME,nvidia"
|
||||
"GBM_BACKEND,nvidia-drm"
|
||||
@@ -88,7 +90,7 @@ in {
|
||||
sensitivity = 0;
|
||||
};
|
||||
|
||||
cursor = { no_hardware_cursors = true; };
|
||||
#cursor = { no_hardware_cursors = true; };
|
||||
|
||||
#render = {
|
||||
# explicit_sync = 1;
|
||||
@@ -303,6 +305,7 @@ in {
|
||||
] ++ [
|
||||
"sleep 3 && ${pkgs.waybar}/bin/waybar &"
|
||||
"${restartPortals}"
|
||||
"xrandr --monitor ${monitor1} --primary"
|
||||
];
|
||||
};
|
||||
extraConfig = let
|
||||
|
||||
@@ -58,7 +58,7 @@ in {
|
||||
};
|
||||
|
||||
# don't autostart
|
||||
systemd.user.services.hypridle.Service.ExecStart = lib.mkForce "true";
|
||||
systemd.user.services.hypridle.Service.ExecStart = lib.mkForce "${pkgs.coreutils}/bin/true";
|
||||
systemd.user.services.hypridle.Service.Restart = lib.mkForce "no";
|
||||
services.hypridle.enable = true;
|
||||
services.hypridle.settings = {
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
@define-color nvidia-green #76b900;
|
||||
@define-color amdgpu-red #ed1c24;
|
||||
|
||||
#other,
|
||||
#other-drawer,
|
||||
@@ -43,6 +44,10 @@
|
||||
color: @nvidia-green;
|
||||
}
|
||||
|
||||
#custom-amd-gpu {
|
||||
color: @amdgpu-red;
|
||||
}
|
||||
|
||||
#network.disconnected {
|
||||
background-color: #f53c3c;
|
||||
}
|
||||
|
||||
@@ -34,7 +34,9 @@ in {
|
||||
modules-right = [ "group/stats" "group/other" ];
|
||||
"group/stats" = {
|
||||
"orientation" = "horizontal";
|
||||
"modules" = [ "network" "cpu" "memory" "disk" "temperature" ] ++ lib.optionals (osConfig.networking.hostName != "nix-laptop") [ "custom/nvidia" ] ;
|
||||
"modules" = [ "network" "cpu" "memory" "disk" "temperature" ]
|
||||
++ lib.optionals osConfig.custom.hardware.nvidia.enable [ "custom/nvidia" ]
|
||||
++ lib.optionals osConfig.custom.hardware.amd-gpu.enable [ "custom/amd-gpu" ];
|
||||
};
|
||||
"group/other" = {
|
||||
"orientation" = "horizontal";
|
||||
@@ -147,6 +149,11 @@ in {
|
||||
"exec" = "~/.config/waybar/nvidia.sh";
|
||||
"exec-if" = "nvidia-smi";
|
||||
};
|
||||
"custom/amd-gpu" = {
|
||||
"format" = "{}";
|
||||
"interval" = 5;
|
||||
"exec" = "~/.config/waybar/amd-gpu.sh";
|
||||
};
|
||||
"tray".icon-size = 21;
|
||||
"tray".spacing = 10;
|
||||
"hyprland/window" = {
|
||||
|
||||
@@ -55,8 +55,10 @@ in {
|
||||
module-margin = 1;
|
||||
modules-left = "i3 xwindow";
|
||||
modules-center = "";
|
||||
modules-right =
|
||||
"music network memory cpu cpu-wattage cpu-temp gpu pulseaudio date tray";
|
||||
modules-right = [ "music network memory cpu cpu-wattage cpu-temp" ]
|
||||
++ lib.optionals osConfig.custom.hardware.nvidia.enable [ "nvidia-gpu" ]
|
||||
++ lib.optionals osConfig.custom.hardware.amd-gpu.enable [ "amd-gpu" ]
|
||||
++ [ "pulseaudio date tray" ];
|
||||
cursor-click = "pointer";
|
||||
cursor-scroll = "ns-resize";
|
||||
enable-ipc = true;
|
||||
@@ -187,13 +189,20 @@ in {
|
||||
exec = "~/.config/polybar/temperature.sh";
|
||||
interval = 3;
|
||||
};
|
||||
"module/gpu" = {
|
||||
"module/nvidia-gpu" = {
|
||||
type = "custom/script";
|
||||
format-foreground = "76b900"; #nvidia green
|
||||
format-foreground = "76b900"; # nvidia green
|
||||
label = "%output:0:35:...%";
|
||||
exec = "~/.config/polybar/nvidia.sh";
|
||||
interval = 3;
|
||||
};
|
||||
"module/amd-gpu" = {
|
||||
type = "custom/script";
|
||||
format-foreground = "ed1c24";
|
||||
label = "%output:0:35:...%";
|
||||
exec = "~/.config/polybar/amd-gpu.sh";
|
||||
interval = 3;
|
||||
};
|
||||
"module/music" = {
|
||||
type = "custom/script";
|
||||
exec = "~/.config/polybar/player-mpris-simple.sh";
|
||||
|
||||
Reference in New Issue
Block a user