mirror of
https://github.com/alyraffauf/nixcfg.git
synced 2024-11-22 05:53:56 -05:00
hyprland/sway/river: hostname aware idle settings
This commit is contained in:
parent
c20299ec28
commit
da89069f32
|
@ -2,6 +2,7 @@
|
|||
pkgs,
|
||||
lib,
|
||||
config,
|
||||
osConfig,
|
||||
...
|
||||
}: {
|
||||
options = {
|
||||
|
@ -46,7 +47,7 @@
|
|||
|
||||
listener {
|
||||
timeout = 900 # 15min
|
||||
on-timeout = [ $(${pkgs.nettools}/bin/hostname) != "mauville" ] && ${pkgs.systemd}/bin/systemctl suspend # suspend pc unless on mauville
|
||||
on-timeout = ${if osConfig.networking.hostName == "mauville" then "" else "${pkgs.systemd}/bin/systemctl suspend"} # suspend pc unless on mauville
|
||||
}
|
||||
'';
|
||||
};
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
pkgs,
|
||||
lib,
|
||||
config,
|
||||
osConfig,
|
||||
...
|
||||
}: {
|
||||
imports = [./randomWallpaper.nix];
|
||||
|
@ -130,9 +131,29 @@
|
|||
launcher = pkgs.fuzzel + "/bin/fuzzel";
|
||||
notifyd = pkgs.mako + "/bin/mako";
|
||||
wallpaperd = pkgs.swaybg + "/bin/swaybg -i ~/.local/share/backgrounds/jr-korpa-9XngoIpxcEo-unsplash.jpg";
|
||||
idle = pkgs.swayidle + "/bin/swayidle";
|
||||
logout = pkgs.wlogout + "/bin/wlogout";
|
||||
lock = pkgs.swaylock + "/bin/swaylock -f -c 000000";
|
||||
idled =
|
||||
if osConfig.networking.hostName == "mauville"
|
||||
then ''
|
||||
${pkgs.swayidle}/bin/swayidle -w \
|
||||
timeout 240 '${pkgs.brightnessctl}/bin/brightnessctl -s set 10' \
|
||||
resume '${pkgs.brightnessctl}/bin/brightnessctl -r' \
|
||||
timeout 300 '${lock} \
|
||||
timeout 330 '${config.wayland.windowManager.sway.package}/bin/swaymsg "output * dpms off"' \
|
||||
resume '${config.wayland.windowManager.sway.package}/bin/swaymsg "output * dpms on"' \
|
||||
before-sleep '${lock}'
|
||||
''
|
||||
else ''
|
||||
${pkgs.swayidle}/bin/swayidle -w \
|
||||
timeout 240 '${pkgs.brightnessctl}/bin/brightnessctl -s set 10' \
|
||||
resume '${pkgs.brightnessctl}/bin/brightnessctl -r' \
|
||||
timeout 300 '${lock}' \
|
||||
timeout 330 '${config.wayland.windowManager.sway.package}/bin/swaymsg "output * dpms off"' \
|
||||
resume '${config.wayland.windowManager.sway.package}/bin/swaymsg "output * dpms on"' \
|
||||
timeout 900 '${pkgs.systemd}/bin/systemctl suspend' \
|
||||
before-sleep '${lock}'
|
||||
'';
|
||||
riverctl = pkgs.river + "/bin/riverctl";
|
||||
|
||||
brightness = "${pkgs.swayosd}/bin/swayosd-client";
|
||||
|
@ -332,7 +353,7 @@
|
|||
${pkgs.swayosd}/bin/swayosd-server &
|
||||
${fileManager} --daemon &
|
||||
${bar} &
|
||||
${idle} -w timeout 300 '${lock}' before-sleep '${lock}' &
|
||||
${idled} &
|
||||
'';
|
||||
};
|
||||
}
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
pkgs,
|
||||
lib,
|
||||
config,
|
||||
osConfig,
|
||||
...
|
||||
}: {
|
||||
imports = [./randomWallpaper.nix];
|
||||
|
@ -70,9 +71,29 @@
|
|||
launcher = pkgs.fuzzel + "/bin/fuzzel";
|
||||
notifyd = pkgs.mako + "/bin/mako";
|
||||
wallpaperd = pkgs.swaybg + "/bin/swaybg -i ~/.local/share/backgrounds/jr-korpa-9XngoIpxcEo-unsplash.jpg";
|
||||
idle = pkgs.swayidle + "/bin/swayidle";
|
||||
logout = pkgs.wlogout + "/bin/wlogout";
|
||||
lock = pkgs.swaylock + "/bin/swaylock -f -c 000000";
|
||||
idled =
|
||||
if osConfig.networking.hostName == "mauville"
|
||||
then ''
|
||||
${pkgs.swayidle}/bin/swayidle -w \
|
||||
timeout 240 '${pkgs.brightnessctl}/bin/brightnessctl -s set 10' \
|
||||
resume '${pkgs.brightnessctl}/bin/brightnessctl -r' \
|
||||
timeout 300 '${lock} \
|
||||
timeout 330 '${config.wayland.windowManager.sway.package}/bin/swaymsg "output * dpms off"' \
|
||||
resume '${config.wayland.windowManager.sway.package}/bin/swaymsg "output * dpms on"' \
|
||||
before-sleep '${lock}'
|
||||
''
|
||||
else ''
|
||||
${pkgs.swayidle}/bin/swayidle -w \
|
||||
timeout 240 '${pkgs.brightnessctl}/bin/brightnessctl -s set 10' \
|
||||
resume '${pkgs.brightnessctl}/bin/brightnessctl -r' \
|
||||
timeout 300 '${lock}' \
|
||||
timeout 330 '${config.wayland.windowManager.sway.package}/bin/swaymsg "output * dpms off"' \
|
||||
resume '${config.wayland.windowManager.sway.package}/bin/swaymsg "output * dpms on"' \
|
||||
timeout 900 '${pkgs.systemd}/bin/systemctl suspend' \
|
||||
before-sleep '${lock}'
|
||||
'';
|
||||
|
||||
brightness = "${pkgs.swayosd}/bin/swayosd-client";
|
||||
brightness_up = "${brightness} --brightness=raise";
|
||||
|
@ -281,18 +302,7 @@
|
|||
{command = "${pkgs.swayosd}/bin/swayosd-server";}
|
||||
{command = "${pkgs.networkmanagerapplet}/bin/nm-applet";}
|
||||
{command = "${pkgs.trayscale}/bin/trayscale --hide-window";}
|
||||
{
|
||||
command = ''
|
||||
${pkgs.swayidle}/bin/swayidle -w \
|
||||
timeout 240 '${pkgs.brightnessctl}/bin/brightnessctl -s set 10' \
|
||||
resume '${pkgs.brightnessctl}/bin/brightnessctl -r' \
|
||||
timeout 300 '${pkgs.swaylock}/bin/swaylock -f -c 000000' \
|
||||
timeout 330 '${config.wayland.windowManager.sway.package}/bin/swaymsg "output * dpms off"' \
|
||||
resume '${config.wayland.windowManager.sway.package}/bin/swaymsg "output * dpms on"' \
|
||||
timeout 900 '${pkgs.systemd}/bin/systemctl suspend' \
|
||||
before-sleep '${pkgs.swaylock}/bin/swaylock -f -c 000000'
|
||||
'';
|
||||
}
|
||||
{command = "${idled}";}
|
||||
];
|
||||
output = {
|
||||
"BOE 0x095F Unknown" = {
|
||||
|
|
Loading…
Reference in a new issue