Skip to content

Commit

Permalink
fprint: Add terminal based app for finger print.
Browse files Browse the repository at this point in the history
For user finger print enrollment add terminal based
app which will take finger input to enroll finger based
authenication in the system.
Works fine across system reboot as well.

Signed-off-by: Vunny Sodhi <[email protected]>
  • Loading branch information
vunnyso committed Oct 10, 2024
1 parent 77cbd40 commit b5447e5
Show file tree
Hide file tree
Showing 5 changed files with 90 additions and 0 deletions.
6 changes: 6 additions & 0 deletions modules/common/services/desktop.nix
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,12 @@ in
icon = "${pkgs.ghaf-artwork}/icons/falcon-icon.svg";
}

{
name = "FPrint Enroll";
path = "${pkgs.foot}/bin/foot -H -T Finger_Print_Enrollment -L ${pkgs.fprint-enroll}/bin/finger-print-enroll";
icon = "${pkgs.icon-pack}/authy.svg";
}

{
name = "Shutdown";
description = "Shutdown System";
Expand Down
1 change: 1 addition & 0 deletions overlays/custom-packages/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,5 @@
globalprotect-openconnect =
final.libsForQt5.callPackage ../../packages/globalprotect-openconnect
{ };
fprint-enroll = final.callPackage ../../packages/fprint-enroll { };
})
23 changes: 23 additions & 0 deletions packages/fprint-enroll/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Copyright 2022-2024 TII (SSRC) and the Ghaf contributors
# SPDX-License-Identifier: Apache-2.0
#
#
{
writeShellApplication,
util-linux,
fprintd,
}:
writeShellApplication {
name = "finger-print-enroll";
runtimeInputs = [
util-linux
fprintd
];
text = builtins.readFile ./enroll.sh;
meta = {
description = "Helper script for finger print enrollment";
platforms = [
"x86_64-linux"
];
};
}
59 changes: 59 additions & 0 deletions packages/fprint-enroll/enroll.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
#! /usr/bin/env bash
# shellcheck shell=bash
# Copyright 2022-2024 TII (SSRC) and the Ghaf contributors
# SPDX-License-Identifier: Apache-2.0
# Notes:
# Thi script can be used enroll finger print
set +xo pipefail
mainmenu () {
echo "Please choose which finger you want to enroll"
echo "0. Right Thumb"
echo "1. Right Index Finger"
echo "2. Right Middle Finger"
echo "3. Right Ring Finger"
echo "4. Right Little Finger"
echo "5. Left Thumb"
echo "6. Left Index Finger"
echo "7. Left Middle Finger"
echo "8. Left Ring Finger"
echo "9. Left Little Finger"
echo ""
}
readfunc()
{
while true; do
read -r -n 1 -p "Input Selection:" mainmenuinput
echo ""
echo "Please tap on power button for finger enrollment"
echo ""
if [ "$mainmenuinput" = "0" ]; then
fprintd-enroll -f right-thumb
elif [ "$mainmenuinput" = "1" ]; then
fprintd-enroll -f right-index-finger
elif [ "$mainmenuinput" = "2" ]; then
fprintd-enroll -f right-middle-finger
elif [ "$mainmenuinput" = "3" ]; then
fprintd-enroll -f right-ring-finger
elif [ "$mainmenuinput" = "4" ]; then
fprintd-enroll -f right-little-finger
elif [ "$mainmenuinput" = "5" ];then
fprintd-enroll -f left-thumb
elif [ "$mainmenuinput" = "6" ];then
fprintd-enroll -f left-index-finger
elif [ "$mainmenuinput" = "7" ];then
fprintd-enroll -f left-middle-finger
elif [ "$mainmenuinput" = "8" ];then
fprintd-enroll -f left-ring-finger
elif [ "$mainmenuinput" = "9" ];then
fprintd-enroll -f left-ring-finger
else
echo "Invalid Input"
mainmenu
readfunc
fi
echo ""
exit 0
done
}
mainmenu
readfunc
1 change: 1 addition & 0 deletions packages/icon-pack/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
}:
let
icons = [
"authy.svg"
"bluetooth-48.svg"
"preferences-sound.svg"
"chromium.svg"
Expand Down

0 comments on commit b5447e5

Please sign in to comment.