add xidlehook

This commit is contained in:
Cyryl Płotnicki 2019-07-15 20:52:19 +01:00
parent 199862d874
commit 1ff8c90653
4 changed files with 23 additions and 6 deletions

16
lock.sh Executable file
View file

@ -0,0 +1,16 @@
#!/usr/bin/env bash
export PRIMARY_DISPLAY="$(xrandr | awk '/ primary/{print $1}')"
xidlehook \
--not-when-fullscreen \
--not-when-audio \
--timer normal 60 \
'xrandr --output "$PRIMARY_DISPLAY" --brightness .1' \
'xrandr --output "$PRIMARY_DISPLAY" --brightness 1' \
--timer primary 10 \
'xrandr --output "$PRIMARY_DISPLAY" --brightness 1; physlock -d' \
'' \
--timer normal 600 \
'systemctl suspend' \
''

View file

@ -13,7 +13,7 @@ in
};
};
home.packages = with pkgs; [
wirelesstools ranger xpdf apvlv
wirelesstools ranger xpdf apvlv unstable.xidlehook
keepass fontconfig nodejs rustup gcc gdb
binutils xclip pkgconfig veracrypt gitAndTools.diff-so-fancy
openjdk11 gimp restic glxinfo discord

View file

@ -63,8 +63,8 @@
battery = "BAT0";
adapter = "AC";
poll-interval = "5";
format-discharging = "BAT0: <label-discharging>";
label-discharging = "%percentage%%|%time%";
format-discharging = "<label-discharging>";
label-discharging = "%time%";
};
"module/battery1" = {
@ -72,8 +72,8 @@
battery = "BAT1";
adapter = "AC";
poll-interval = "5";
format-discharging = "BAT1: <label-discharging>";
label-discharging = "%percentage%%|%time%";
format-discharging = "<label-discharging>";
label-discharging = "%time%";
};
};

View file

@ -14,7 +14,8 @@ in
package = pkgs.i3-gaps;
config = {
startup = [
{ command = "exec i3-sensible-terminal"; always = true; notification = false; }
{ command = "exec i3-sensible-terminal"; always = false; notification = false; }
{ command = "exec $HOME/dev/dotfiles/lock.sh"; always = false; notification = false; }
];
window = {
hideEdgeBorders = "horizontal";