Merge pull request 'Fixes for hosts rebuilding with ISO config, fixes for swaylock, swayidle' (#128) from fix/iso-hosts-swaylock-swayidle into main
Reviewed-on: https://git.b12f.io/pub-solar/os/pulls/128 Reviewed-by: Benjamin Bädorf <hello@benjaminbaedorf.eu>
This commit is contained in:
commit
0c11e9119e
|
@ -92,7 +92,10 @@
|
|||
imports = [ (digga.lib.importExportableModules ./modules) ];
|
||||
modules = [
|
||||
{ lib.our = self.lib; }
|
||||
digga.nixosModules.bootstrapIso
|
||||
# FIXME: upstream module causes a huge number of unnecessary
|
||||
# dependencies to be pulled in for all systems -- many of them are
|
||||
# graphical. should only be imported as needed.
|
||||
# digga.nixosModules.bootstrapIso
|
||||
digga.nixosModules.nixConfig
|
||||
home.nixosModules.home-manager
|
||||
agenix.nixosModules.age
|
||||
|
|
|
@ -12,11 +12,11 @@
|
|||
Environment = "PATH=/run/current-system/sw/bin:${pkgs.sway}/bin";
|
||||
ExecStart = ''${pkgs.swayidle}/bin/swayidle -w \
|
||||
after-resume 'swaymsg "output * dpms on"' \
|
||||
before-sleep 'swaylock-bg' '' + (if psCfg.paranoia.enable then '' \
|
||||
before-sleep '${pkgs.swaylock-bg}/bin/swaylock-bg' '' + (if psCfg.paranoia.enable then '' \
|
||||
timeout 120 'swaymsg "output * dpms off"' resume 'swaymsg "output * dpms on"' \
|
||||
timeout 150 'systemctl hibernate'
|
||||
'' else '' \
|
||||
timeout 600 'swaylock-bg'
|
||||
timeout 600 '${pkgs.swaylock-bg}/bin/swaylock-bg' \
|
||||
timeout 900 'swaymsg "output * dpms off"' resume 'swaymsg "output * dpms on"'
|
||||
'');
|
||||
};
|
||||
|
|
|
@ -3,18 +3,17 @@ self: with self; ''
|
|||
# swaylock
|
||||
|
||||
# Make sure we aren't running twice
|
||||
RUNNING=$(ps -A | grep swaylock | wc -l)
|
||||
if [ $RUNNING -ne 0 ]; then
|
||||
RUNNING=$(${procps}/bin/pgrep -c ${swaylock}/bin/swaylock)
|
||||
if [ "$RUNNING" -ne 0 ]; then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
IMAGE=$XDG_CONFIG_HOME/wallpaper.jpg
|
||||
IMAGE="$XDG_CONFIG_HOME/wallpaper.jpg"
|
||||
LOCKARGS=""
|
||||
|
||||
for OUTPUT in `${sway}/bin/swaymsg -t get_outputs | jq -r '.[].name'`
|
||||
for OUTPUT in $(${sway}/bin/swaymsg -t get_outputs | ${jq}/bin/jq -r '.[].name')
|
||||
do
|
||||
LOCKARGS="''${LOCKARGS} --image ''${OUTPUT}:''${IMAGE}"
|
||||
IMAGES="''${IMAGES} ''${IMAGE}"
|
||||
done
|
||||
exec ${swaylock}/bin/swaylock $LOCKARGS
|
||||
''
|
||||
|
|
Loading…
Reference in a new issue