Fixed nvidia
server
This commit is contained in:
parent
8cdc5557f9
commit
b284928062
9 changed files with 341 additions and 19 deletions
|
|
@ -1,11 +1,11 @@
|
|||
{ pkgs, lib, ... }:
|
||||
{ pkgs, lib, hwconfig, ... }:
|
||||
let
|
||||
suspendScript = pkgs.writeShellScript "suspend-script" ''
|
||||
# check if any player has status "Playing"
|
||||
${lib.getExe pkgs.playerctl} -a status | ${lib.getExe pkgs.ripgrep} Playing -q
|
||||
# only suspend if nothing is playing
|
||||
if [ $? == 1 ]; then
|
||||
${pkgs.systemd}/bin/systemctl suspend
|
||||
${if hwconfig.isLaptop then "${pkgs.systemd}/bin/systemctl suspend" else "loginctl lock-session"}
|
||||
fi
|
||||
'';
|
||||
in
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue