dell
This commit is contained in:
@@ -24,6 +24,7 @@ in
|
||||
};
|
||||
#services.xserver.desktopManager.plasma5.enable = true;
|
||||
#services.displayManager.sddm.wayland.enable = true;
|
||||
services.orca.enable = false;
|
||||
services.desktopManager.plasma6 = {
|
||||
enable = true;
|
||||
};
|
||||
|
||||
38
modules/misc/tv-on-off.nix
Normal file
38
modules/misc/tv-on-off.nix
Normal file
@@ -0,0 +1,38 @@
|
||||
{ pkgs, lib, ... }:
|
||||
let
|
||||
cec = "${pkgs.v4l-utils}/bin/cec-ctl";
|
||||
|
||||
tvOn = pkgs.writeShellScriptBin "tvOn" ''
|
||||
if [ $(${cec} -A | ${pkgs.gnugrep}/bin/grep cec0 | ${pkgs.coreutils}/bin/wc -l) -gt 0 ]; then
|
||||
${cec} --tv --skip-info
|
||||
${cec} --skip-info --user-control-pressed ui-cmd=power-on-function --to TV
|
||||
echo "Turning TV on!"
|
||||
fi
|
||||
'';
|
||||
tvOff = pkgs.writeShellScriptBin "tvOff" ''
|
||||
if [ $(${cec} -A | ${pkgs.gnugrep}/bin/grep cec0 | ${pkgs.coreutils}/bin/wc -l) -gt 0 ]; then
|
||||
${cec} --tv --skip-info
|
||||
${cec} --skip-info --user-control-pressed ui-cmd=power-on-function --to TV
|
||||
echo "Turning TV on!"
|
||||
fi
|
||||
'';
|
||||
in
|
||||
{
|
||||
environment.systemPackages = with pkgs; [
|
||||
tvOff
|
||||
tvOn
|
||||
];
|
||||
# after suspend, do `cec-ctl -A | grep cec0 | wc -l`, if >0, do `cec-ctl --standby --to TV`
|
||||
# similar on wakeup, if present send `cec-ctl --user-control-pressed ui-cmd=power-on-function --to TV`
|
||||
environment.etc."systemd/system-sleep/sleep-turn-tv-off-on.sh".source =
|
||||
pkgs.writeShellScript "post-sleep-turn-tv-off.sh" ''
|
||||
case $1/$2 in
|
||||
pre/*)
|
||||
${tvOff}
|
||||
;;
|
||||
post/*)
|
||||
${tvOn}
|
||||
;;
|
||||
esac
|
||||
'';
|
||||
}
|
||||
@@ -1,4 +1,5 @@
|
||||
{
|
||||
services.hardware.bolt.enable = true;
|
||||
services.udev.extraRules = ''
|
||||
# Always authorize thunderbolt connections when they are plugged in.
|
||||
# This is to make sure the USB hub of Thunderbolt is working.
|
||||
|
||||
Reference in New Issue
Block a user