Add some snippy scripts for foxtrot quick switching between performance modes

This commit is contained in:
Daniel Flanagan 2024-09-30 09:14:12 -05:00
parent 9cc15d53fa
commit c007790ecf
3 changed files with 22 additions and 1 deletions

View file

@ -390,6 +390,7 @@
hardware.nixosModules.framework-13-7040-amd hardware.nixosModules.framework-13-7040-amd
common common
kde-connect
password-manager password-manager
graphical-workstation graphical-workstation
laptop laptop
@ -418,6 +419,24 @@
modprobe -v mt7921e modprobe -v mt7921e
''; '';
}) })
(writeShellApplication
{
name = "perfmode";
# 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
'';
})
(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
'';
})
]; ];
}) })
]; ];

View file

@ -119,6 +119,8 @@
}; };
startup = [ startup = [
{command = "kdeconnect-indicator";}
{command = "mako";}
{ {
command = "swaybg -i $HOME/.wallpaper"; command = "swaybg -i $HOME/.wallpaper";
} }
@ -151,7 +153,6 @@
"timeout 600 'swaymsg \"output * dpms off\"' resume 'swaymsg \"output * dpms on\" & maybe-good-morning &'" "timeout 600 'swaymsg \"output * dpms off\"' resume 'swaymsg \"output * dpms on\" & maybe-good-morning &'"
]; ];
} }
{command = "mako";}
# {command = "firefox";} # {command = "firefox";}
# {command = "wezterm";} # {command = "wezterm";}
]; ];

View file

@ -633,6 +633,7 @@
programs.kdeconnect.enable = true; programs.kdeconnect.enable = true;
/* /*
# handled by enabling
networking.firewall = { networking.firewall = {
allowedTCPPortRanges = [ { from = 1714; to = 1764; } ]; allowedTCPPortRanges = [ { from = 1714; to = 1764; } ];
allowedUDPPortRanges = [ { from = 1714; to = 1764; } ]; allowedUDPPortRanges = [ { from = 1714; to = 1764; } ];