Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
52 commits
Select commit Hold shift + click to select a range
3190e95
core: add a greetd login backend
PointerDilemma Jan 3, 2025
f347ca6
greetd: use glaze for json handling
PointerDilemma Apr 12, 2025
2330b0b
greetd: add support for a default session and move session handling
PointerDilemma May 3, 2025
8f96be8
session-picker: copy config gradient values
PointerDilemma May 7, 2025
3e01dc4
rebase fixups
PointerDilemma Jul 11, 2025
4dc9129
session-picker: add onclick and onhover
PointerDilemma Jul 11, 2025
0dcef22
greetd: terminate the thread
PointerDilemma Jul 12, 2025
8592935
some cleanup stuff
PointerDilemma Jul 12, 2025
31297a8
version: bump to 0.9.0
vaxerski Jul 17, 2025
1553dd7
core: limit onClick to down events (#826)
PointerDilemma Jul 20, 2025
8ebcee2
seat: restore cursor shape to default (#820)
PointerDilemma Jul 21, 2025
d993bdc
asyncResourceGatherer: fix conditions for skipping screencopy (#829)
PointerDilemma Jul 22, 2025
1e5e62d
background: fix mismatched asset sizes and transforms (#830)
PointerDilemma Jul 25, 2025
7169163
Add ctrl+a as binding to clear password (#832)
leynebe Jul 29, 2025
bdf0ef8
version: bump to 0.9.1
vaxerski Jul 31, 2025
347e05a
Make detection of pam library more portable (#840)
tagattie Aug 5, 2025
a356bf0
background: monitor transforms fixups (#859)
PointerDilemma Aug 27, 2025
8d0e569
core: remove dmabuf listeners after we are done with Screencopy (#858)
PointerDilemma Aug 27, 2025
cedbb24
renderer: move asyncResourceGatherer out of the renderer (#863)
PointerDilemma Sep 3, 2025
04cfdc4
core: recreate rendering context when monitors are empty on nvidia (#…
PointerDilemma Sep 4, 2025
450ae1e
lock-surface: remove redundant sendDestroy calls (#868)
PointerDilemma Sep 10, 2025
a7f2634
Refactor asset management to use shared_ptr (#870)
davc0n Sep 15, 2025
61b36c6
renderer: fix nvidia workaround (#878)
PointerDilemma Sep 17, 2025
1380ca0
background: unload screenshots when monitor is removed
PointerDilemma Sep 17, 2025
7f769fa
Revert "background: unload screenshots when monitor is removed"
PointerDilemma Sep 17, 2025
c48279d
version: bump to 0.9.2
vaxerski Oct 2, 2025
3cb799b
core: nvidia workaround destroy renderer before EGL (#884)
PointerDilemma Oct 3, 2025
c8a6768
misc: remove hyprland-protocols from README (#887)
PointerDilemma Oct 4, 2025
de2cc5b
core: migrate to Hyprutils::CAsyncResourceGatherer and improve resour…
PointerDilemma Oct 8, 2025
bdc44ab
flake.lock: update (#890)
PointerDilemma Oct 8, 2025
36ec73f
cmake: add "libpam" as an alias for "pam" (#893)
PointerDilemma Oct 9, 2025
98b8675
background: reload screenshot if reload_cmd specified (#903)
Nathanwoodburn Oct 28, 2025
a1be0c0
fix glaze nix build
PointerDilemma Nov 29, 2025
e2da7c6
animation: migrate PHLANIMVAR from SP to UP (#920)
PointerDilemma Dec 10, 2025
d099f87
pam: prevent nullpointer crash when user passwd isn't found (#928)
wescande Dec 19, 2025
ef3017f
nix: remove sdbus-cpp overlay
PointerDilemma Dec 20, 2025
b3a1076
core: fix use-after-free segfault in async resource widget callbacks …
kiivihal Feb 20, 2026
5ba5ff5
background: run reload_cmd in configure if path is empty (#950)
nikitax44 Feb 20, 2026
38a3142
treewide: alejandra -> nixfmt
fufexan Mar 2, 2026
4db980a
nix: separate overlay with deps
fufexan Mar 2, 2026
512e71d
flake.lock: update
fufexan Mar 2, 2026
d7079a1
version: bump to 0.9.3
vaxerski Mar 22, 2026
768ade8
pam: get username once (#974)
PointerDilemma Mar 23, 2026
e1dca57
input-field: add `check_text` option (#959)
rain-lua Mar 28, 2026
d6c02b4
label: fix sigusr2 update when reload time is 0 (#978)
PointerDilemma Mar 28, 2026
9f9ee0c
label: fix alpha rendering (#979)
PointerDilemma Mar 28, 2026
4e4f03c
core: use Hyprutils::CLI (#977)
PointerDilemma Mar 31, 2026
24c66d1
input-field: allow smaller dots_size (#938)
BlueskyFR Mar 31, 2026
a9059b5
resolve merge conflicts (jj style)
PointerDilemma Apr 1, 2026
02066fe
session-picker: fix placing, per entry size, font size
PointerDilemma Apr 2, 2026
da52cc6
rename g_p global pointer
PointerDilemma Apr 3, 2026
989c1f3
remove start session workaround and disable fadeout when greetd
PointerDilemma Apr 4, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 19 additions & 6 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ find_package(Threads REQUIRED)
find_package(PkgConfig REQUIRED)
find_package(OpenGL REQUIRED COMPONENTS EGL GLES3)
find_package(hyprwayland-scanner 0.4.4 REQUIRED)
find_package(glaze REQUIRED)
pkg_check_modules(
deps
REQUIRED
Expand All @@ -86,15 +87,27 @@ pkg_check_modules(
pangocairo
libdrm
gbm
pam
hyprutils>=0.8.0
hyprutils>=0.11.0
sdbus-c++>=2.0.0
hyprgraphics)
hyprgraphics>=0.1.6)
find_library(PAM_FOUND NAMES pam libpam)
if(PAM_FOUND)
set(PAM_LIB ${PAM_FOUND})
else()
pkg_check_modules(PAM IMPORTED_TARGET pam libpam)
if(PAM_FOUND)
set(PAM_LIB PkgConfig::PAM)
else()
message(FATAL_ERROR "The required library libpam was not found.")
endif()
endif()

message(STATUS "Found pam at ${PAM_LIB}")

file(GLOB_RECURSE SRCFILES CONFIGURE_DEPENDS "src/*.cpp")
add_executable(hyprlock ${SRCFILES})
target_link_libraries(hyprlock PRIVATE pam rt Threads::Threads PkgConfig::deps
OpenGL::EGL OpenGL::GLES3)
target_link_libraries(hyprlock PRIVATE ${PAM_LIB} rt Threads::Threads PkgConfig::deps
OpenGL::EGL OpenGL::GLES3 glaze::glaze)

# protocols
pkg_get_variable(WAYLAND_PROTOCOLS_DIR wayland-protocols pkgdatadir)
Expand Down Expand Up @@ -129,7 +142,7 @@ function(protocolWayland)
endfunction()

make_directory(${CMAKE_SOURCE_DIR}/protocols) # we don't ship any custom ones so
# the dir won't be there
# the dir won't be there

protocolwayland()

Expand Down
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ You need the following dependencies

- cairo
- hyprgraphics
- hyprland-protocols
- hyprlang
- hyprutils
- hyprwayland-scanner
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.8.2
0.9.3
3 changes: 3 additions & 0 deletions assets/example.conf
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,9 @@ input-field {
placeholder_text = Input password...
fail_text = $PAMFAIL

# uncomment if you wish to display a message during authentication
# check_text = Authenticating...

# uncomment to use a letter instead of a dot to indicate the typed password
# dots_text_format = *
# dots_size = 0.4
Expand Down
30 changes: 15 additions & 15 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

57 changes: 31 additions & 26 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -32,34 +32,39 @@
};
};

outputs = {
self,
nixpkgs,
systems,
...
} @ inputs: let
inherit (nixpkgs) lib;
eachSystem = lib.genAttrs (import systems);
pkgsFor = eachSystem (system:
import nixpkgs {
localSystem.system = system;
overlays = with self.overlays; [default];
});
in {
overlays = import ./nix/overlays.nix {inherit inputs lib self;};
outputs =
{
self,
nixpkgs,
systems,
...
}@inputs:
let
inherit (nixpkgs) lib;
eachSystem = lib.genAttrs (import systems);
pkgsFor = eachSystem (
system:
import nixpkgs {
localSystem.system = system;
overlays = with self.overlays; [ hyprlock-with-deps ];
}
);
in
{
overlays = import ./nix/overlays.nix { inherit inputs lib self; };

packages = eachSystem (system: {
default = self.packages.${system}.hyprlock;
inherit (pkgsFor.${system}) hyprlock;
});
packages = eachSystem (system: {
default = self.packages.${system}.hyprlock;
inherit (pkgsFor.${system}) hyprlock;
});

homeManagerModules = {
default = self.homeManagerModules.hyprlock;
hyprlock = builtins.throw "hyprlock: the flake HM module has been removed. Use the module from Home Manager upstream.";
};
homeManagerModules = {
default = self.homeManagerModules.hyprlock;
hyprlock = builtins.throw "hyprlock: the flake HM module has been removed. Use the module from Home Manager upstream.";
};

checks = eachSystem (system: self.packages.${system});
checks = eachSystem (system: self.packages.${system});

formatter = eachSystem (system: pkgsFor.${system}.alejandra);
};
formatter = eachSystem (system: pkgsFor.${system}.nixfmt-tree);
};
}
8 changes: 5 additions & 3 deletions nix/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@
lib,
stdenv,
cmake,
pkg-config,
cairo,
glaze,
pkg-config,
libdrm,
libGL,
libxkbcommon,
Expand All @@ -14,7 +15,7 @@
hyprwayland-scanner,
pam,
pango,
sdbus-cpp,
sdbus-cpp_2,
systemdLibs,
wayland,
wayland-protocols,
Expand All @@ -37,6 +38,7 @@ stdenv.mkDerivation {

buildInputs = [
cairo
glaze
libdrm
libGL
libxkbcommon
Expand All @@ -46,7 +48,7 @@ stdenv.mkDerivation {
hyprutils
pam
pango
sdbus-cpp
sdbus-cpp_2
systemdLibs
wayland
wayland-protocols
Expand Down
57 changes: 30 additions & 27 deletions nix/overlays.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,43 +2,46 @@
lib,
inputs,
self,
}: let
mkDate = longDate: (lib.concatStringsSep "-" [
(builtins.substring 0 4 longDate)
(builtins.substring 4 2 longDate)
(builtins.substring 6 2 longDate)
]);
}:
let
mkDate =
longDate:
(lib.concatStringsSep "-" [
(builtins.substring 0 4 longDate)
(builtins.substring 4 2 longDate)
(builtins.substring 6 2 longDate)
]);

version = lib.removeSuffix "\n" (builtins.readFile ../VERSION);
in {
in
{
default = inputs.self.overlays.hyprlock;

hyprlock = lib.composeManyExtensions [
hyprlock-with-deps = lib.composeManyExtensions [
inputs.hyprgraphics.overlays.default
inputs.hyprlang.overlays.default
inputs.hyprutils.overlays.default
inputs.hyprwayland-scanner.overlays.default
inputs.self.overlays.sdbuscpp
(final: prev: {
hyprlock = prev.callPackage ./default.nix {
stdenv = prev.gcc15Stdenv;
version = version + "+date=" + (mkDate (inputs.self.lastModifiedDate or "19700101")) + "_" + (inputs.self.shortRev or "dirty");
inherit (final) hyprlang;
shortRev = self.sourceInfo.shortRev or "dirty";
};
})
self.overlays.hyprlock
self.overlays.glaze
];

sdbuscpp = final: prev: {
sdbus-cpp = prev.sdbus-cpp.overrideAttrs (self: super: {
version = "2.0.0";

src = final.fetchFromGitHub {
owner = "Kistler-group";
repo = "sdbus-cpp";
rev = "refs/tags/v${self.version}";
hash = "sha256-W8V5FRhV3jtERMFrZ4gf30OpIQLYoj2yYGpnYOmH2+g=";
};
glaze = final: prev: {
glaze = prev.glaze.overrideAttrs (self: super: {
cmakeFlags = super.cmakeFlags ++ ["-Dglaze_ENABLE_SSL=OFF"];
});
};

hyprlock = final: prev: {
hyprlock = prev.callPackage ./default.nix {
stdenv = prev.gcc15Stdenv;
version =
version
+ "+date="
+ (mkDate (inputs.self.lastModifiedDate or "19700101"))
+ "_"
+ (inputs.self.shortRev or "dirty");
shortRev = self.sourceInfo.shortRev or "dirty";
};
};
}
24 changes: 15 additions & 9 deletions src/auth/Auth.cpp
Original file line number Diff line number Diff line change
@@ -1,20 +1,26 @@
#include "Auth.hpp"
#include "Pam.hpp"
#include "Fingerprint.hpp"
#include "../config/ConfigManager.hpp"
#include "../core/hyprlock.hpp"
#include "Fingerprint.hpp"
#include "GreetdLogin.hpp"
#include "Pam.hpp"
#include "src/helpers/Log.hpp"

#include <hyprlang.hpp>
#include <memory>

CAuth::CAuth() {
static const auto ENABLEPAM = g_pConfigManager->getValue<Hyprlang::INT>("auth:pam:enabled");
if (*ENABLEPAM)
m_vImpls.emplace_back(makeShared<CPam>());
CAuth::CAuth(bool sessionLogin) {
static const auto ENABLEPAM = g_pConfigManager->getValue<Hyprlang::INT>("auth:pam:enabled");
static const auto ENABLEFINGERPRINT = g_pConfigManager->getValue<Hyprlang::INT>("auth:fingerprint:enabled");
if (*ENABLEFINGERPRINT)
m_vImpls.emplace_back(makeShared<CFingerprint>());

if (sessionLogin)
m_vImpls.emplace_back(makeShared<CGreetdLogin>());
else {
if (*ENABLEPAM)
m_vImpls.emplace_back(makeShared<CPam>());
if (*ENABLEFINGERPRINT)
m_vImpls.emplace_back(makeShared<CFingerprint>());
}

RASSERT(!m_vImpls.empty(), "At least one authentication method must be enabled!");
}
Expand Down Expand Up @@ -106,7 +112,7 @@ void CAuth::enqueueFail(const std::string& failText, eAuthImplementations implTy
m_sCurrentFail.failSource = implType;
m_sCurrentFail.failedAttempts++;

Debug::log(LOG, "Failed attempts: {}", m_sCurrentFail.failedAttempts);
Log::logger->log(Log::INFO, "Failed attempts: {}", m_sCurrentFail.failedAttempts);

if (m_resetDisplayFailTimer) {
m_resetDisplayFailTimer->cancel();
Expand Down
3 changes: 2 additions & 1 deletion src/auth/Auth.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
enum eAuthImplementations {
AUTH_IMPL_PAM = 0,
AUTH_IMPL_FINGERPRINT = 1,
AUTH_IMPL_GREETD = 2,
};

class IAuthImplementation {
Expand All @@ -28,7 +29,7 @@ class IAuthImplementation {

class CAuth {
public:
CAuth();
CAuth(bool sessionLogin);

void start();

Expand Down
Loading
Loading