From a6551444ec615b8d39e0fe3078c65dc254a81792 Mon Sep 17 00:00:00 2001 From: tomoron Date: Thu, 19 Dec 2024 17:07:58 +0100 Subject: [PATCH] move laptop specific waybar modules to laptop home --- homes/laptop/home.nix | 1 + homes/laptop/waybar.nix | 18 ++++++++++++++++++ modules/waybar.nix | 15 +-------------- 3 files changed, 20 insertions(+), 14 deletions(-) create mode 100644 homes/laptop/waybar.nix diff --git a/homes/laptop/home.nix b/homes/laptop/home.nix index 4009d07..47b50eb 100644 --- a/homes/laptop/home.nix +++ b/homes/laptop/home.nix @@ -5,6 +5,7 @@ ../modules/game.nix ../modules/nitrogen.nix ./hyprland.nix + ./waybar.nix ]; # programs.alacritty.settings.font.size = 8; diff --git a/homes/laptop/waybar.nix b/homes/laptop/waybar.nix new file mode 100644 index 0000000..500fcc6 --- /dev/null +++ b/homes/laptop/waybar.nix @@ -0,0 +1,18 @@ +{ config, lib, pkgs, ... }: + +{ + modules-right = ["custom/fans", "custom/dgpu"]; + "custom/dgpu" = { + exec-if = "test \"$(supergfxctl -g)\" = \"Hybrid\" || test \"$(supergfxctl -g)\" = \"Vfio\""; + exec = "echo \"  on |\""; + interval-if = 10; + interval =100; + }; + + "custom/fans" = { + exec-if = "test \"$(cat /sys/class/hwmon/hwmon6/fan1_input)\" -gt 0 -o \"$(cat /sys/class/hwmon/hwmon6/fan2_input)\" -gt 0"; + exec = "echo \" \" \"$(cat /sys/class/hwmon/hwmon6/fan1_input).$(cat /sys/class/hwmon/hwmon6/fan2_input) |\""; + interval = 1; + interval-if = 1; + }; +} diff --git a/modules/waybar.nix b/modules/waybar.nix index 2cba128..412f75a 100644 --- a/modules/waybar.nix +++ b/modules/waybar.nix @@ -60,7 +60,7 @@ margin-right = 5; modules-left = ["hyprland/workspaces" "custom/music"]; modules-center = ["hyprland/window"]; - modules-right = ["custom/fans" "custom/dgpu" "disk" "pulseaudio" "network" "custom/pipe" "cpu" "temperature" "custom/pipe" "memory" "battery" "clock"]; + modules-right = ["disk" "pulseaudio" "network" "custom/pipe" "cpu" "temperature" "custom/pipe" "memory" "battery" "clock"]; "hyprland/workspaces" = { disable-scroll = true; @@ -143,18 +143,5 @@ interval-if = 5; }; - "custom/dgpu" = { - exec-if = "test \"$(supergfxctl -g)\" = \"Hybrid\" || test \"$(supergfxctl -g)\" = \"Vfio\""; - exec = "echo \"  on |\""; - interval-if = 10; - interval =100; - }; - - "custom/fans" = { - exec-if = "test \"$(cat /sys/class/hwmon/hwmon6/fan1_input)\" -gt 0 -o \"$(cat /sys/class/hwmon/hwmon6/fan2_input)\" -gt 0"; - exec = "echo \" \" \"$(cat /sys/class/hwmon/hwmon6/fan1_input).$(cat /sys/class/hwmon/hwmon6/fan2_input) |\""; - interval = 1; - interval-if = 1; - }; }; }