What a clusterfuck
This commit is contained in:
parent
91f88b8bb2
commit
f29273be22
221 changed files with 779 additions and 956 deletions
64
modules/home/sway/swaylock/default.nix
Normal file
64
modules/home/sway/swaylock/default.nix
Normal file
|
@ -0,0 +1,64 @@
|
|||
{ pkgs, outputs, ... }:
|
||||
let
|
||||
swayLock = pkgs.writeScriptBin "swaylock" ''
|
||||
# Set the lock script
|
||||
lockscript() {
|
||||
BLANK='#00000000'
|
||||
CLEAR='#FFFFFF22'
|
||||
DEFAULT='#${outputs.look.colors.prime}FF'
|
||||
TEXT='#FFFFFFFF'
|
||||
WRONG='#${outputs.look.colors.split}FF'
|
||||
VERIFYING='#${outputs.look.colors.accent}FF'
|
||||
|
||||
${pkgs.swaylock-effects}/bin/swaylock -f -e \
|
||||
--key-hl-color=$VERIFYING \
|
||||
--bs-hl-color=$WRONG \
|
||||
\
|
||||
--ring-clear-color=$CLEAR \
|
||||
--ring-ver-color=$VERIFYING \
|
||||
--ring-wrong-color=$WRONG \
|
||||
--ring-color=$DEFAULT \
|
||||
--ring-clear-color=$VERIFYING \
|
||||
\
|
||||
--inside-color=$CLEAR \
|
||||
--inside-ver-color=$CLEAR \
|
||||
--inside-wrong-color=$CLEAR \
|
||||
--inside-clear-color=$CLEAR \
|
||||
\
|
||||
--text-color=$TEXT \
|
||||
--text-clear-color=$TEXT \
|
||||
--text-ver-color=$TEXT \
|
||||
--text-caps-lock-color=$TEXT \
|
||||
--text-wrong-color=$TEXT \
|
||||
\
|
||||
--indicator \
|
||||
--indicator-radius=80 \
|
||||
--image=~/.wallpapers/lock.png \
|
||||
--clock \
|
||||
--font=${outputs.look.fonts.main} \
|
||||
--font-size=30 \
|
||||
--timestr="%I:%M%p" \
|
||||
--datestr="%a %b %d %Y"
|
||||
}
|
||||
|
||||
# Handle whether to lock or sleep
|
||||
if [ "$1" == "--sleep" ]; then
|
||||
lockscript &
|
||||
exec ${pkgs.swayidle}/bin/swayidle -w \
|
||||
timeout 1 'swaymsg "output * dpms off"' \
|
||||
resume 'swaymsg "output * dpms on"; pkill -9 swayidle'
|
||||
else
|
||||
lockscript
|
||||
fi
|
||||
'';
|
||||
in {
|
||||
# Enable Sway and write some scripts
|
||||
home.packages = with pkgs; [
|
||||
swayLock
|
||||
];
|
||||
|
||||
# Enable Sway lock on startup
|
||||
wayland.windowManager.sway.config.startup = [
|
||||
{command = "swaylock";}
|
||||
];
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue