From fe3693a44ad045e3cfbe77ff1a77f89380a27dc0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cyryl=20P=C5=82otnicki?= Date: Sun, 16 May 2021 13:06:22 +0100 Subject: [PATCH] Add intel gpu stats to the bar --- .config/i3/i3-status.toml | 5 +++++ nixos/i3/default.nix | 7 +++++++ nixos/i3/i3.nix | 2 +- 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/.config/i3/i3-status.toml b/.config/i3/i3-status.toml index 5f50434f..dbb887cc 100644 --- a/.config/i3/i3-status.toml +++ b/.config/i3/i3-status.toml @@ -26,6 +26,11 @@ block = "memory" display_type = "memory" format_mem = "{mem_used} /{mem_total}({mem_used_percents})" +[[block]] +block = "custom" +command = ''' sudo intel_gpu_top -l | head -n4 | tail -n1 | awk '{print " " $8 "%"}' ''' +interval = 5 + [[block]] block = "load" interval = 5 diff --git a/nixos/i3/default.nix b/nixos/i3/default.nix index 451db57c..ad77450f 100644 --- a/nixos/i3/default.nix +++ b/nixos/i3/default.nix @@ -5,6 +5,13 @@ ]; programs.dconf.enable = true; + security.sudo.extraRules = [ + { + users = [ "cyryl" ]; + commands = [ { command = "${pkgs.intel-gpu-tools}/bin/intel_gpu_top"; options = [ "NOPASSWD" ]; } ]; + } + ]; + services = { physlock = { enable = true; diff --git a/nixos/i3/i3.nix b/nixos/i3/i3.nix index 720b848a..56fc0d06 100644 --- a/nixos/i3/i3.nix +++ b/nixos/i3/i3.nix @@ -5,7 +5,7 @@ in { home.packages = with pkgs; [ font-awesome-ttf - unstable.i3status-rust + intel-gpu-tools ]; xsession.windowManager.i3 = {