Add swaylock module and update swaylock calls
This commit is contained in:
parent
1d6b8a63e0
commit
6551644ced
7 changed files with 100 additions and 27 deletions
|
@ -9,11 +9,12 @@ let
|
||||||
cfg = config.eboskma.programs.river;
|
cfg = config.eboskma.programs.river;
|
||||||
|
|
||||||
mod = "Mod4";
|
mod = "Mod4";
|
||||||
lockcmd = "${pkgs.swaylock}/bin/swaylock --ignore-empty-password --daemonize --show-failed-attempts --indicator-caps-lock --image ${cfg.wallpaper} --scaling fill";
|
# lockcmd = "${pkgs.swaylock}/bin/swaylock --ignore-empty-password --daemonize --show-failed-attempts --indicator-caps-lock --image ${cfg.wallpaper} --scaling fill";
|
||||||
|
lockcmd = "${lib.getExe pkgs.swaylock}";
|
||||||
rofiPower = pkgs.writeShellScriptBin "rofi-power" (
|
rofiPower = pkgs.writeShellScriptBin "rofi-power" (
|
||||||
builtins.replaceStrings [ "{WALLPAPER}" ] [ (builtins.toString cfg.wallpaper) ] (
|
# builtins.replaceStrings [ "{WALLPAPER}" ] [ (builtins.toString cfg.wallpaper) ] (
|
||||||
builtins.readFile ./powermenu.sh
|
builtins.readFile ./powermenu.sh
|
||||||
)
|
# )
|
||||||
);
|
);
|
||||||
|
|
||||||
menu = "${config.programs.anyrun.package}/bin/anyrun";
|
menu = "${config.programs.anyrun.package}/bin/anyrun";
|
||||||
|
@ -136,10 +137,12 @@ in
|
||||||
"None XF86AudioMute" = "spawn '${pkgs.pamedia}/bin/pamedia mute'";
|
"None XF86AudioMute" = "spawn '${pkgs.pamedia}/bin/pamedia mute'";
|
||||||
"None XF86Calculator" = "spawn ${pkgs.gnome-calculator}/bin/gnome-calculator";
|
"None XF86Calculator" = "spawn ${pkgs.gnome-calculator}/bin/gnome-calculator";
|
||||||
|
|
||||||
"${mod} c" = mkIf config.eboskma.programs.emacs.enable "spawn '${config.eboskma.programs.emacs.package}/bin/emacsclient -c'";
|
"${mod} c" =
|
||||||
|
mkIf config.eboskma.programs.emacs.enable "spawn '${config.eboskma.programs.emacs.package}/bin/emacsclient -c'";
|
||||||
|
|
||||||
"${mod} d" = "spawn '${pkgs.swaynotificationcenter}/bin/swaync-client --toggle-panel --skip-wait'";
|
"${mod} d" = "spawn '${pkgs.swaynotificationcenter}/bin/swaync-client --toggle-panel --skip-wait'";
|
||||||
"${mod}+Shift d" = "spawn '${pkgs.swaynotificationcenter}/bin/swaync-client --toggle-dnd --skip-wait'";
|
"${mod}+Shift d" =
|
||||||
|
"spawn '${pkgs.swaynotificationcenter}/bin/swaync-client --toggle-dnd --skip-wait'";
|
||||||
|
|
||||||
"${mod}+Shift f" = "spawn ${rofiPower}/bin/rofi-power";
|
"${mod}+Shift f" = "spawn ${rofiPower}/bin/rofi-power";
|
||||||
|
|
||||||
|
|
|
@ -23,7 +23,8 @@ exit_wm="" # Icon: exit_to_app
|
||||||
# Variable passed to rofi
|
# Variable passed to rofi
|
||||||
options="${shutdown}\n${reboot}\n${lock}\n${hibernate}\n${exit_wm}"
|
options="${shutdown}\n${reboot}\n${lock}\n${hibernate}\n${exit_wm}"
|
||||||
uptime=$(uptime | awk '{print $1}' || true)
|
uptime=$(uptime | awk '{print $1}' || true)
|
||||||
lockcmd="swaylock --ignore-empty-password --daemonize --show-failed-attempts --indicator-caps-lock --image {WALLPAPER} --scaling fill"
|
# lockcmd="swaylock --ignore-empty-password --daemonize --show-failed-attempts --indicator-caps-lock --image {WALLPAPER} --scaling fill"
|
||||||
|
lockcmd="swaylock"
|
||||||
|
|
||||||
chosen="$(echo -e "${options}" | rofi -theme power -p "Uptime: ${uptime}" -dmenu -selected-row 2)"
|
chosen="$(echo -e "${options}" | rofi -theme power -p "Uptime: ${uptime}" -dmenu -selected-row 2)"
|
||||||
|
|
||||||
|
|
|
@ -8,11 +8,12 @@ with lib;
|
||||||
let
|
let
|
||||||
cfg = config.eboskma.programs.sway;
|
cfg = config.eboskma.programs.sway;
|
||||||
mod = "Mod4";
|
mod = "Mod4";
|
||||||
swaylockcmd = "${pkgs.swaylock}/bin/swaylock --ignore-empty-password --daemonize --show-failed-attempts --indicator-caps-lock --image ${cfg.lock-wallpaper} --scaling fill";
|
# swaylockcmd = "${pkgs.swaylock}/bin/swaylock --ignore-empty-password --daemonize --show-failed-attempts --indicator-caps-lock --image ${cfg.lock-wallpaper} --scaling fill";
|
||||||
|
swaylockcmd = "${lib.getExe pkgs.swaylock}";
|
||||||
rofiPower = pkgs.writeShellScriptBin "rofi-power" (
|
rofiPower = pkgs.writeShellScriptBin "rofi-power" (
|
||||||
builtins.replaceStrings [ "{WALLPAPER}" ] [ (builtins.toString cfg.lock-wallpaper) ] (
|
# builtins.replaceStrings [ "{WALLPAPER}" ] [ (builtins.toString cfg.lock-wallpaper) ] (
|
||||||
builtins.readFile ./powermenu.sh
|
builtins.readFile ./powermenu.sh
|
||||||
)
|
# )
|
||||||
);
|
);
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
|
@ -23,10 +24,10 @@ in
|
||||||
default = true;
|
default = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
lock-wallpaper = mkOption {
|
# lock-wallpaper = mkOption {
|
||||||
description = "Wallpaper to use for the lockscreen";
|
# description = "Wallpaper to use for the lockscreen";
|
||||||
type = types.path;
|
# type = types.path;
|
||||||
};
|
# };
|
||||||
terminal = mkOption {
|
terminal = mkOption {
|
||||||
description = "Default terminal to run";
|
description = "Default terminal to run";
|
||||||
type = types.str;
|
type = types.str;
|
||||||
|
@ -152,7 +153,10 @@ in
|
||||||
right = "o";
|
right = "o";
|
||||||
|
|
||||||
floating = {
|
floating = {
|
||||||
criteria = [ { app_id = "gnome-calculator"; } ];
|
criteria = [
|
||||||
|
{ app_id = "gnome-calculator"; }
|
||||||
|
{ app_id = "dev.deedles.Trayscale"; }
|
||||||
|
];
|
||||||
modifier = mod;
|
modifier = mod;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -379,13 +383,5 @@ in
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
systemd.user = {
|
|
||||||
targets.tray = {
|
|
||||||
Unit = {
|
|
||||||
Description = "Home Manager System Tray";
|
|
||||||
Requires = [ "sway-session-pre.target" ];
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -23,7 +23,8 @@ exit_wm="" # Icon: exit_to_app
|
||||||
# Variable passed to rofi
|
# Variable passed to rofi
|
||||||
options="${shutdown}\n${reboot}\n${lock}\n${hibernate}\n${exit_wm}"
|
options="${shutdown}\n${reboot}\n${lock}\n${hibernate}\n${exit_wm}"
|
||||||
uptime=$(uptime | awk '{print $1}' || true)
|
uptime=$(uptime | awk '{print $1}' || true)
|
||||||
lockcmd="swaylock --ignore-empty-password --daemonize --show-failed-attempts --indicator-caps-lock --image {WALLPAPER} --scaling fill"
|
# lockcmd="swaylock --ignore-empty-password --daemonize --show-failed-attempts --indicator-caps-lock --image {WALLPAPER} --scaling fill"
|
||||||
|
lockcmd="swaylock"
|
||||||
|
|
||||||
chosen="$(echo -e "${options}" | rofi -theme power -p "Uptime: ${uptime}" -dmenu -selected-row 2)"
|
chosen="$(echo -e "${options}" | rofi -theme power -p "Uptime: ${uptime}" -dmenu -selected-row 2)"
|
||||||
|
|
||||||
|
|
65
home-manager/modules/swaylock/default.nix
Normal file
65
home-manager/modules/swaylock/default.nix
Normal file
|
@ -0,0 +1,65 @@
|
||||||
|
{
|
||||||
|
pkgs,
|
||||||
|
config,
|
||||||
|
lib,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
with lib;
|
||||||
|
let
|
||||||
|
cfg = config.eboskma.programs.swaylock;
|
||||||
|
in
|
||||||
|
{
|
||||||
|
options.eboskma.programs.swaylock = {
|
||||||
|
enable = mkEnableOption "swaylock";
|
||||||
|
wallpaper = mkOption {
|
||||||
|
description = "Wallpaper to use for the lockscreen";
|
||||||
|
type = types.nullOr types.path;
|
||||||
|
default = null;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
config = mkIf cfg.enable {
|
||||||
|
programs.swaylock = {
|
||||||
|
enable = true;
|
||||||
|
settings = {
|
||||||
|
ignore-empty-password = true;
|
||||||
|
daemonize = true;
|
||||||
|
show-failed-attempts = true;
|
||||||
|
indicator-caps-lock = true;
|
||||||
|
image = mkIf (cfg.wallpaper != null) cfg.wallpaper;
|
||||||
|
scaling = "fill";
|
||||||
|
|
||||||
|
# Catppuccin Mocha
|
||||||
|
color = "1e1e2e";
|
||||||
|
bs-hl-color = "f5e0dc";
|
||||||
|
caps-lock-bs-hl-color = "f5e0dc";
|
||||||
|
caps-lock-key-hl-color = "a6e3a1";
|
||||||
|
inside-color = "00000000";
|
||||||
|
inside-clear-color = "00000000";
|
||||||
|
inside-caps-lock-color = "00000000";
|
||||||
|
inside-ver-color = "00000000";
|
||||||
|
inside-wrong-color = "00000000";
|
||||||
|
key-hl-color = "a6e3a1";
|
||||||
|
layout-bg-color = "00000000";
|
||||||
|
layout-border-color = "00000000";
|
||||||
|
layout-text-color = "cdd6f4";
|
||||||
|
line-color = "00000000";
|
||||||
|
line-clear-color = "00000000";
|
||||||
|
line-caps-lock-color = "00000000";
|
||||||
|
line-ver-color = "00000000";
|
||||||
|
line-wrong-color = "00000000";
|
||||||
|
ring-color = "b4befe";
|
||||||
|
ring-clear-color = "f5e0dc";
|
||||||
|
ring-caps-lock-color = "fab387";
|
||||||
|
ring-ver-color = "89b4fa";
|
||||||
|
ring-wrong-color = "eba0ac";
|
||||||
|
separator-color = "00000000";
|
||||||
|
text-color = "cdd6f4";
|
||||||
|
text-clear-color = "f5e0dc";
|
||||||
|
text-caps-lock-color = "fab387";
|
||||||
|
text-ver-color = "89b4fa";
|
||||||
|
text-wrong-color = "eba0ac";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
|
@ -226,7 +226,6 @@ in
|
||||||
enable = true;
|
enable = true;
|
||||||
package = pkgs.swayfx;
|
package = pkgs.swayfx;
|
||||||
terminal = lib.getExe pkgs.ghostty;
|
terminal = lib.getExe pkgs.ghostty;
|
||||||
lock-wallpaper = "${homeCfg.home.homeDirectory}/.wallpapers/river-2560.png";
|
|
||||||
output = {
|
output = {
|
||||||
"DP-2" = {
|
"DP-2" = {
|
||||||
bg = "${homeCfg.home.homeDirectory}/.wallpapers/river-2560.png fill";
|
bg = "${homeCfg.home.homeDirectory}/.wallpapers/river-2560.png fill";
|
||||||
|
@ -249,6 +248,10 @@ in
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
swaylock = {
|
||||||
|
enable = true;
|
||||||
|
# wallpaper = "${homeCfg.home.homeDirectory}/.wallpapers/river-2560.png";
|
||||||
|
};
|
||||||
swaynotificationcenter.enable = true;
|
swaynotificationcenter.enable = true;
|
||||||
tea = {
|
tea = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
@ -531,6 +534,10 @@ in
|
||||||
};
|
};
|
||||||
|
|
||||||
playerctld.enable = true;
|
playerctld.enable = true;
|
||||||
|
|
||||||
|
trayscale = {
|
||||||
|
enable = true;
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
imports =
|
imports =
|
||||||
|
|
|
@ -214,7 +214,6 @@ in
|
||||||
package = pkgs.sway;
|
package = pkgs.sway;
|
||||||
terminal = lib.getExe pkgs.ghostty;
|
terminal = lib.getExe pkgs.ghostty;
|
||||||
swayidle = false;
|
swayidle = false;
|
||||||
lock-wallpaper = "${homeCfg.home.homeDirectory}/.wallpapers/river-3840.png";
|
|
||||||
output = {
|
output = {
|
||||||
"DP-1" = {
|
"DP-1" = {
|
||||||
bg = "${../../wallpapers/river-3840.png} fill";
|
bg = "${../../wallpapers/river-3840.png} fill";
|
||||||
|
@ -252,6 +251,7 @@ in
|
||||||
"--locked Mod4+Ctrl+r" = "output DP-1 disable, output DP-3 disable, output HDMI-A-1 enable";
|
"--locked Mod4+Ctrl+r" = "output DP-1 disable, output DP-3 disable, output HDMI-A-1 enable";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
swaylock.enable = true;
|
||||||
swaynotificationcenter.enable = true;
|
swaynotificationcenter.enable = true;
|
||||||
tmux.enable = true;
|
tmux.enable = true;
|
||||||
waybar = {
|
waybar = {
|
||||||
|
|
Loading…
Reference in a new issue