Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fprint: Add terminal based app for finger print. #842

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
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
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