Skip to content

Commit

Permalink
Add gtklock-userinfo-module and cleanup gtklock
Browse files Browse the repository at this point in the history
Now its possible to display user name when system is locked using
gtklock-userinfo-module. Also we need to enable accounts-daemon
service which is needed to retrieve user details.
Some cleanup done for gtklock code which are no longer required.

Signed-off-by: Vunny Sodhi <[email protected]>
  • Loading branch information
vunnyso authored and brianmcgillion committed Nov 26, 2024
1 parent 027f92a commit 01bb7e3
Show file tree
Hide file tree
Showing 8 changed files with 279 additions and 9 deletions.
232 changes: 232 additions & 0 deletions LICENSES/GPL-3.0-only.txt

Large diffs are not rendered by default.

6 changes: 2 additions & 4 deletions REUSE.toml
Original file line number Diff line number Diff line change
Expand Up @@ -55,13 +55,11 @@ SPDX-FileCopyrightText = "labwc contributors"
path = "overlays/custom-packages/labwc/*.patch"

[[annotations]]
# gtklock doesn't specify if later versions is allowed
SPDX-License-Identifier = "GPL-3.0-only"
SPDX-FileCopyrightText = [
"Copyright (c) 2022 Kenny Levinsen, Jovan Lanik, Erik Reider, Melih Darcan, Bhaskar Khoraja",
"Copyright (c) 2022 Zephyr Lykos"
"Copyright (c) 2024 Erik Reider, Jovan Lanik"
]
path = "overlays/custom-packages/gtklock/*.patch"
path = "overlays/custom-packages/gtklock-userinfo-module/0001-update.patch"

[[annotations]]
SPDX-License-Identifier = "LGPL-2.1-or-later"
Expand Down
2 changes: 1 addition & 1 deletion modules/desktop/graphics/labwc.config.nix
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ let
drawerStyle = pkgs.callPackage ./styles/launcher-style.nix { };
inherit (config.ghaf.services.audio) pulseaudioTcpControlPort;
gtklockStyle = pkgs.callPackage ./styles/lock-style.nix { };
lockCmd = "${pkgs.gtklock}/bin/gtklock -s ${gtklockStyle}";
lockCmd = "${pkgs.gtklock}/bin/gtklock -s ${gtklockStyle} -m ${pkgs.gtklock-userinfo-module}/lib/gtklock/userinfo-module.so";
autostart = pkgs.writeShellApplication {
name = "labwc-autostart";

Expand Down
3 changes: 3 additions & 0 deletions modules/desktop/graphics/labwc.nix
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,9 @@ in
# dconf is necessary for gsettings to work
programs.dconf.enable = true;

# DBus service for accessing the list of user accounts and information attached to those accounts
services.accounts-daemon.enable = true;

ghaf.graphics.launchers = lib.mkIf config.ghaf.profiles.debug.enable [
{
name = "Terminal";
Expand Down
5 changes: 1 addition & 4 deletions overlays/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,7 @@ The status of the integration in nixpkgs can be tracked using the [Pull Request

## From Overlays

[gtklock: Guard against race condition](https://github.com/jovanlanik/gtklock/pull/95)

[gtklock: Fix black screen SP-4849](https://github.com/jovanlanik/gtklock/commit/e0e7f6d5ae7667fcc3479b6732046c67275b2f2f)

[gtklock-userinfo-module: update](https://github.com/jovanlanik/gtklock-userinfo-module/commit/aa4b5832185d2dd9e7f88826fd9d03e3d5ea1ad6)

## carried in tiiuae/nixpkgs/...
[texinfo: cross compile failure](https://github.com/NixOS/nixpkgs/pull/328919)
1 change: 1 addition & 0 deletions overlays/custom-packages/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,5 @@
globalprotect-openconnect =
final.libsForQt5.callPackage ../../packages/globalprotect-openconnect
{ };
gtklock-userinfo-module = import ./gtklock-userinfo-module { inherit prev; };
})
28 changes: 28 additions & 0 deletions overlays/custom-packages/gtklock-userinfo-module/0001-update.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
From aa4b5832185d2dd9e7f88826fd9d03e3d5ea1ad6 Mon Sep 17 00:00:00 2001
From: Jovan Lanik <[email protected]>
Date: Sun, 3 Nov 2024 10:48:42 +0100
Subject: [PATCH] update

---
source.c | 5 -----
1 file changed, 5 deletions(-)

diff --git a/source.c b/source.c
index 8a12fbb..a908b5e 100644
--- a/source.c
+++ b/source.c
@@ -157,11 +157,6 @@ static void setup_userinfo(struct Window *ctx) {
gtk_widget_show_all(USERINFO(ctx)->user_revealer);
}

-void g_module_unload(GModule *m) {
- g_object_unref(act_user);
- g_object_unref(act_manager);
-}
-
void on_activation(struct GtkLock *gtklock, int id) {
self_id = id;

--
2.40.1

11 changes: 11 additions & 0 deletions overlays/custom-packages/gtklock-userinfo-module/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Copyright 2022-2024 TII (SSRC) and the Ghaf contributors
# SPDX-License-Identifier: Apache-2.0
#
# TODO: Remove patch, once there new release for gtklock-userinfo-module
#
{ prev }:
prev.gtklock-userinfo-module.overrideAttrs {
patches = [
./0001-update.patch
];
}

0 comments on commit 01bb7e3

Please sign in to comment.