mirror of
https://github.com/moons-14/dotfiles.git
synced 2026-10-06 02:18:12 +09:00
feat
This commit is contained in:
@@ -4,6 +4,11 @@
|
|||||||
...
|
...
|
||||||
}:
|
}:
|
||||||
{
|
{
|
||||||
|
# This desktop is permanently connected to AC power.
|
||||||
|
systemd.user.services.swayidle.Service.Environment = [
|
||||||
|
"SWAYIDLE_ASSUME_AC=1"
|
||||||
|
];
|
||||||
|
|
||||||
services.kanshi = {
|
services.kanshi = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
|
||||||
|
|||||||
@@ -10,6 +10,8 @@ let
|
|||||||
brightnessState = "$XDG_RUNTIME_DIR/swayidle-brightness";
|
brightnessState = "$XDG_RUNTIME_DIR/swayidle-brightness";
|
||||||
|
|
||||||
onBattery = pkgs.writeShellScript "swayidle-on-battery" ''
|
onBattery = pkgs.writeShellScript "swayidle-on-battery" ''
|
||||||
|
[ "''${SWAYIDLE_ASSUME_AC:-0}" = 1 ] && exit 1
|
||||||
|
|
||||||
for supply in /sys/class/power_supply/*; do
|
for supply in /sys/class/power_supply/*; do
|
||||||
[ -f "$supply/type" ] || continue
|
[ -f "$supply/type" ] || continue
|
||||||
[ "$(< "$supply/type")" = "Battery" ] || continue
|
[ "$(< "$supply/type")" = "Battery" ] || continue
|
||||||
@@ -45,7 +47,7 @@ let
|
|||||||
'';
|
'';
|
||||||
|
|
||||||
suspend = pkgs.writeShellScript "swayidle-suspend" ''
|
suspend = pkgs.writeShellScript "swayidle-suspend" ''
|
||||||
if ${onBattery}; then
|
if ${onBattery} || ${isLocked}; then
|
||||||
exec ${systemctl} suspend
|
exec ${systemctl} suspend
|
||||||
fi
|
fi
|
||||||
'';
|
'';
|
||||||
|
|||||||
@@ -13,6 +13,7 @@
|
|||||||
"https://moons-dotfiles.cachix.org"
|
"https://moons-dotfiles.cachix.org"
|
||||||
"https://noctalia.cachix.org"
|
"https://noctalia.cachix.org"
|
||||||
"https://vicinae.cachix.org"
|
"https://vicinae.cachix.org"
|
||||||
|
"https://ghostty.cachix.org"
|
||||||
"https://cache.numtide.com"
|
"https://cache.numtide.com"
|
||||||
"https://codex-desktop-linux.cachix.org"
|
"https://codex-desktop-linux.cachix.org"
|
||||||
];
|
];
|
||||||
@@ -23,6 +24,7 @@
|
|||||||
"moons-dotfiles.cachix.org-1:WHoroKiNScG2/dpxHHL1I0qVmvuQhJbEAP+DS2j9Rr0="
|
"moons-dotfiles.cachix.org-1:WHoroKiNScG2/dpxHHL1I0qVmvuQhJbEAP+DS2j9Rr0="
|
||||||
"noctalia.cachix.org-1:pCOR47nnMEo5thcxNDtzWpOxNFQsBRglJzxWPp3dkU4="
|
"noctalia.cachix.org-1:pCOR47nnMEo5thcxNDtzWpOxNFQsBRglJzxWPp3dkU4="
|
||||||
"vicinae.cachix.org-1:1kDrfienkGHPYbkpNj1mWTr7Fm1+zcenzgTizIcI3oc="
|
"vicinae.cachix.org-1:1kDrfienkGHPYbkpNj1mWTr7Fm1+zcenzgTizIcI3oc="
|
||||||
|
"ghostty.cachix.org-1:QB389yTa6gTyneehvqG58y0WnHjQOqgnA+wBnpWWxns="
|
||||||
"niks3.numtide.com-1:DTx8wZduET09hRmMtKdQDxNNthLQETkc/yaX7M4qK0g="
|
"niks3.numtide.com-1:DTx8wZduET09hRmMtKdQDxNNthLQETkc/yaX7M4qK0g="
|
||||||
"codex-desktop-linux.cachix.org-1:nX/xy6AdK9hQE24A8ALGjkCKj2ObFmcnemiL5Cid4nk="
|
"codex-desktop-linux.cachix.org-1:nX/xy6AdK9hQE24A8ALGjkCKj2ObFmcnemiL5Cid4nk="
|
||||||
];
|
];
|
||||||
|
|||||||
Reference in New Issue
Block a user