Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
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
5 changes: 3 additions & 2 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 @@ -94,7 +95,7 @@ pkg_check_modules(
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)
OpenGL::EGL OpenGL::GLES3 glaze::glaze)

# protocols
pkg_get_variable(WAYLAND_PROTOCOLS_DIR wayland-protocols pkgdatadir)
Expand Down Expand Up @@ -129,7 +130,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
4 changes: 3 additions & 1 deletion 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 Down Expand Up @@ -37,6 +38,7 @@ stdenv.mkDerivation {

buildInputs = [
cairo
glaze
libdrm
libGL
libxkbcommon
Expand Down
22 changes: 14 additions & 8 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
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