-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Loading status checks…
feat: mem-cap zotero and firefox, implement tb-conservation
- enable ThinkBook conservation mode to preserve battery life - cap the memory footprint of firefox and zotero by systemd-run - use `firefox` instead of `firefox-wayland` as the latter is already an alias
Showing
9 changed files
with
97 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -99,7 +99,7 @@ | |
# minecraft | ||
tor-browser-bundle-bin | ||
sbctl | ||
firefox-wayland | ||
firefox | ||
htop | ||
dnsutils | ||
smartmontools | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -70,7 +70,7 @@ | |
tor-browser-bundle-bin | ||
tpm2-tools | ||
sbctl | ||
firefox-wayland | ||
firefox | ||
tdesktop | ||
htop | ||
qbittorrent | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -70,7 +70,7 @@ | |
tor-browser-bundle-bin | ||
tpm2-tools | ||
sbctl | ||
firefox-wayland | ||
firefox | ||
tdesktop | ||
htop | ||
qbittorrent | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
{ | ||
lib, | ||
pkgs, | ||
config, | ||
... | ||
}: | ||
|
||
with lib; | ||
|
||
let | ||
cfg = config.my.uxplay; | ||
in | ||
{ | ||
options.my.tb-conservation = { | ||
enable = mkEnableOption "ThinkBook Battery Conservation Mode"; | ||
}; | ||
|
||
config = mkIf cfg.enable { | ||
systemd.services.conservation-mode = { | ||
enable = true; | ||
description = "Turn on the ThinkBook power conservation mode for battery health"; | ||
wantedBy = [ "multi-user.target" ]; | ||
|
||
serviceConfig = { | ||
Type = "oneshot"; | ||
RemainAfterExit = true; | ||
}; | ||
|
||
unitConfig.RequiresMountsFor = "/sys"; | ||
serviceConfig = { | ||
ExecStart = ( | ||
pkgs.writeShellScript "start_conservation_mode" '' | ||
echo 1 > /sys/bus/platform/drivers/ideapad_acpi/VPC2004:00/conservation_mode | ||
'' | ||
); | ||
ExecStop = ( | ||
pkgs.writeShellScript "stop_conservation_mode" '' | ||
echo 0 > /sys/bus/platform/drivers/ideapad_acpi/VPC2004:00/conservation_mode | ||
'' | ||
); | ||
}; | ||
}; | ||
}; | ||
} |