From ce00bd6fedb871636ba2ab4403e0088271162e5f Mon Sep 17 00:00:00 2001 From: Daniel Flanagan Date: Mon, 30 Sep 2024 09:16:54 -0500 Subject: [PATCH] bash -x -c for simpler command echoing --- flake.nix | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/flake.nix b/flake.nix index a2dd6aa..23987fc 100644 --- a/flake.nix +++ b/flake.nix @@ -425,16 +425,16 @@ # we use command -v $cmd here because we only want to invoke these calls _if_ the related package is installed on the system # otherwise, they will likely have no effect anyways text = '' - command -v powerprofilesctl &>/dev/null && set -x && powerprofilesctl set performance && set +x - command -v swaymsg &>/dev/null && set -x && swaymsg output eDP-1 mode 2880x1920@60Hz && set +x + command -v powerprofilesctl &>/dev/null && bash -x -c 'powerprofilesctl set performance' + command -v swaymsg &>/dev/null && bash -x -c 'swaymsg output eDP-1 mode 2880x1920@60Hz' ''; }) (writeShellApplication { name = "battmode"; text = '' - command -v powerprofilesctl &>/dev/null && set -x && powerprofilesctl set power-saver && set +x - command -v swaymsg &>/dev/null && set -x && swaymsg output eDP-1 mode 2880x1920@120Hz && set +x + command -v powerprofilesctl &>/dev/null && bash -x -c 'powerprofilesctl set power-saver' + command -v swaymsg &>/dev/null && bash -x -c 'swaymsg output eDP-1 mode 2880x1920@120Hz' ''; }) ];