feat(hyprland): replace gtklock with swaylock

This commit is contained in:
matt1432 2023-12-06 15:04:52 -05:00
parent f4b2a970b1
commit 0bbd6d47e3
9 changed files with 80 additions and 48 deletions

View file

@ -282,8 +282,7 @@ const SecondRow = () => Row({
GridButton({ GridButton({
command: () => { command: () => {
execAsync(['bash', '-c', '$LOCK_PATH/lock.sh']) execAsync(['lock']).catch(print);
.catch(print);
}, },
secondaryCommand: () => App.openWindow('powermenu'), secondaryCommand: () => App.openWindow('powermenu'),
icon: 'system-lock-screen-symbolic', icon: 'system-lock-screen-symbolic',

View file

@ -1,5 +0,0 @@
#!/usr/bin/env bash
grim -t jpeg /tmp/image.jpeg
convert /tmp/image.jpeg -blur 0x8 /tmp/image.jpeg

View file

@ -1,4 +0,0 @@
#!/usr/bin/env bash
ags -r 'Tablet.setLaptopMode()'
$LOCK_PATH/blur.sh
gtklock

View file

@ -1,17 +0,0 @@
@define-color accent rgba(189, 147, 249, 0.8);
@define-color background rgb(40, 42, 54);
window {
background-image: url("/tmp/image.jpeg");
background-size: cover;
background-repeat: no-repeat;
background-position: center;
background-color: rgba(0, 0, 0, 0);
}
#window-box {
padding: 64px;
border: 2px solid @accent;
border-radius: 30px;
background-color: @background;
}

View file

@ -22,7 +22,7 @@ exec-once = ags
exec-once = sleep 3; ags -t applauncher exec-once = sleep 3; ags -t applauncher
## Change HandleLidSwitch to lock in logind.conf ## Change HandleLidSwitch to lock in logind.conf
exec-once = swayidle -w lock $LOCK_PATH/lock.sh exec-once = swayidle -w lock lock
## Special window apps ## Special window apps
exec-once = [workspace special:thunder silent] thunderbird exec-once = [workspace special:thunder silent] thunderbird
@ -55,7 +55,6 @@ binde =, XF86MonBrightnessDown, exec, ags -r 'Brightness.screen -= 0.05'
bindr = CAPS, Caps_Lock, exec, ags -r 'Brightness.fetchCapsState()' bindr = CAPS, Caps_Lock, exec, ags -r 'Brightness.fetchCapsState()'
## Ags & co ## Ags & co
bind = $mainMod , L , exec, $LOCK_PATH/lock.sh
bindn = , Escape, exec, ags run-js 'closeAll()' bindn = , Escape, exec, ags run-js 'closeAll()'
bind = $mainMod SHIFT, E , exec, ags -t powermenu bind = $mainMod SHIFT, E , exec, ags -t powermenu
bind = $mainMod , D , exec, ags -t applauncher bind = $mainMod , D , exec, ags -t applauncher

View file

@ -1,8 +1,4 @@
{ {config, ...}: let
config,
pkgs,
...
}: let
configDir = config.vars.configDir; configDir = config.vars.configDir;
symlink = config.lib.file.mkOutOfStoreSymlink; symlink = config.lib.file.mkOutOfStoreSymlink;
in { in {
@ -11,21 +7,11 @@ in {
env = [ env = [
"AGS_PATH, ${configDir}/ags/bin" "AGS_PATH, ${configDir}/ags/bin"
"HYPR_PATH, ${configDir}/hypr/scripts" "HYPR_PATH, ${configDir}/hypr/scripts"
"LOCK_PATH, ${configDir}/gtklock/scripts"
]; ];
}; };
}; };
xdg.configFile = { xdg.configFile = {
"gtklock/config.ini".text = ''
[main]
modules=${builtins.concatStringsSep ";" [
"${pkgs.gtklock-powerbar-module}/lib/gtklock/powerbar-module.so"
"${pkgs.gtklock-playerctl-module}/lib/gtklock/playerctl-module.so"
]}
'';
"gtklock/style.css".source = symlink "${configDir}/gtklock/style.css";
"dolphinrc".source = symlink "${configDir}/dolphinrc"; "dolphinrc".source = symlink "${configDir}/dolphinrc";
"kdeglobals".source = symlink "${configDir}/kdeglobals"; "kdeglobals".source = symlink "${configDir}/kdeglobals";
"kiorc".source = symlink "${configDir}/kiorc"; "kiorc".source = symlink "${configDir}/kiorc";

View file

@ -23,8 +23,6 @@ in {
''; '';
security.pam.services = { security.pam.services = {
gtklock = {};
# all the changes in /etc/pam.d/* # all the changes in /etc/pam.d/*
sddm.text = lib.mkBefore '' sddm.text = lib.mkBefore ''
auth [success=1 new_authtok_reqd=1 default=ignore] pam_unix.so try_first_pass likeauth nullok auth [success=1 new_authtok_reqd=1 default=ignore] pam_unix.so try_first_pass likeauth nullok

73
home/swaylock.nix Normal file
View file

@ -0,0 +1,73 @@
{
pkgs,
...
}: {
home.packages = [
(pkgs.writeShellScriptBin "lock" ''
ags -r 'Tablet.setLaptopMode()'
swaylock
'')
];
programs.swaylock = {
enable = true;
package = pkgs.swaylock-effects;
settings = {
font = "Ubuntu";
clock = true;
timestr = "%R";
datestr = "%a, %e of %B";
screenshots = true;
# FIXME: doesn't work
submit-on-touch = true;
# Very delayed for some reason
#fade-in = 0.1;
effect-blur = "20x2";
#effect-greyscale = true;
#effect-scale = 0.3;
indicator = true;
indicator-radius = 240;
indicator-thickness = 20;
indicator-caps-lock = true;
key-hl-color = "880033";
separator-color = "00000000";
inside-color = "00000099";
inside-clear-color = "ffd20400";
inside-caps-lock-color = "009ddc00";
inside-ver-color = "d9d8d800";
inside-wrong-color = "ee2e2400";
ring-color = "231f20D9";
ring-clear-color = "231f20D9";
ring-caps-lock-color = "231f20D9";
ring-ver-color = "231f20D9";
ring-wrong-color = "231f20D9";
line-color = "00000000";
line-clear-color = "ffd204FF";
line-caps-lock-color = "009ddcFF";
line-ver-color = "d9d8d8FF";
line-wrong-color = "ee2e24FF";
text-color = "CBA6F7FF";
text-clear-color = "ffd20400";
text-ver-color = "d9d8d800";
text-wrong-color = "ee2e2400";
bs-hl-color = "ee2e24FF";
caps-lock-key-hl-color = "ffd204FF";
caps-lock-bs-hl-color = "ee2e24FF";
disable-caps-lock-text = true;
text-caps-lock-color = "009ddc";
};
};
}

View file

@ -19,6 +19,8 @@ in {
../dolphin.nix ../dolphin.nix
]; ];
security.pam.services.swaylock = {};
programs = { programs = {
kdeconnect.enable = true; kdeconnect.enable = true;
dconf.enable = true; dconf.enable = true;
@ -44,6 +46,7 @@ in {
../../home/alacritty.nix ../../home/alacritty.nix
../../home/dconf.nix ../../home/dconf.nix
../../home/obs.nix ../../home/obs.nix
../../home/swaylock.nix
../../home/theme.nix ../../home/theme.nix
../../home/wofi ../../home/wofi
]; ];
@ -135,6 +138,7 @@ in {
bind = [ bind = [
# Defaults # Defaults
"$mainMod, L, exec, lock"
"$mainMod, Q, exec, alacritty" "$mainMod, Q, exec, alacritty"
"$mainMod, F, fullscreen" "$mainMod, F, fullscreen"
"$mainMod, C, killactive, " "$mainMod, C, killactive, "
@ -245,7 +249,6 @@ in {
gnome.seahorse gnome.seahorse
p7zip # for reshade p7zip # for reshade
gtklock # FIXME: find replacement
swww swww
## libs ## libs