make the amdgpu_top special workspace depend on the presence of an amd gpu

in the future I'll need to make some custom module where I define what
hardware the system has, I'd like not to rely on things like this

for now this is enough I hope
This commit is contained in:
jacekpoz 2024-03-02 23:46:20 +01:00
parent 29fd5eac4c
commit 76cbdaaf2f
No known key found for this signature in database
GPG key ID: 94E812A8B12AAE3C

View file

@ -10,6 +10,8 @@
hmCfg = config.home-manager.users.${username};
osuCfg = config.myOptions.programs.osu;
isAmdGpuPresent = builtins.elem "amdgpu" config.boot.initrd.kernelModules;
inherit (inputs.nixpkgs-wayland.packages.${pkgs.system}) foot wl-clipboard swww wlsunset swaylock;
inherit (inputs.anyrun.packages.${pkgs.system}) anyrun;
hyprcontrib = inputs.hyprcontrib.packages.${pkgs.system};
@ -143,7 +145,8 @@ in {
# scratchpads
"special:btop, decorate:false"
"special:amdgpu_top, decorate:false"
(mkIf isAmdGpuPresent
"special:amdgpu_top, decorate:false")
"special:pipewire, decorate:false"
"special:nixos, decorate:false"
(mkIf config.services.asusd.enable
@ -329,7 +332,8 @@ in {
"$mainMod SHIFT, X, exec, ${hyprland}/bin/hyprctl kill"
# scratchpad binds
"$mainMod, B, togglespecialworkspace, btop"
"$mainMod, A, togglespecialworkspace, amdgpu_top"
(mkIf isAmdGpuPresent
"$mainMod, A, togglespecialworkspace, amdgpu_top")
"$mainMod, V, togglespecialworkspace, pipewire"
"$mainMod, N, togglespecialworkspace, nixos"
# rog button on laptop keyboard
@ -428,13 +432,16 @@ in {
exec = [
# kill (almost) everything on special workspaces
"${pkgs.procps}/bin/pkill btop"
"${pkgs.procps}/bin/pkill amdgpu_top"
(mkIf isAmdGpuPresent
"${pkgs.procps}/bin/pkill amdgpu_top")
"${pkgs.procps}/bin/pkill helvum"
"${pkgs.procps}/bin/pkill pavucontrol"
# and run it all again
"[workspace special:btop silent;tile] ${foot}/bin/foot -e ${pkgs.btop}/bin/btop"
"[workspace special:amdgpu_top silent;tile] ${foot}/bin/foot -e ${pkgs.amdgpu_top}/bin/amdgpu_top -i 0"
"[workspace special:amdgpu_top silent;tile] ${foot}/bin/foot -e ${pkgs.amdgpu_top}/bin/amdgpu_top -i 1"
(mkIf isAmdGpuPresent
"[workspace special:amdgpu_top silent;tile] ${foot}/bin/foot -e ${pkgs.amdgpu_top}/bin/amdgpu_top -i 0")
(mkIf isAmdGpuPresent
"[workspace special:amdgpu_top silent;tile] ${foot}/bin/foot -e ${pkgs.amdgpu_top}/bin/amdgpu_top -i 1")
"[workspace special:pipewire silent;tile] ${pkgs.helvum}/bin/helvum"
"[workspace special:pipewire silent;tile] ${pkgs.pavucontrol}/bin/pavucontrol"