add integration shell script

This commit is contained in:
Adam Velebil 2022-10-07 09:12:54 +02:00
parent cfe1c79fe3
commit 1e2c6f61e4
No known key found for this signature in database
GPG Key ID: AC6D6B9D715FC084
5 changed files with 84 additions and 3 deletions

View File

@ -117,3 +117,10 @@ endif()
# Copy the Helper
install(DIRECTORY "../build/linux/helper" DESTINATION "${BUILD_BUNDLE_DIR}" USE_SOURCE_PERMISSIONS)
# Copy Linux support files
install(DIRECTORY "../resources/linux/linux_support" DESTINATION "${BUILD_BUNDLE_DIR}" USE_SOURCE_PERMISSIONS)
install(FILES "../resources/linux/README.adoc" DESTINATION "${BUILD_BUNDLE_DIR}")
install(FILES "../resources/linux/desktop_integration.sh"
DESTINATION "${BUILD_BUNDLE_DIR}"
PERMISSIONS OWNER_EXECUTE OWNER_READ OWNER_WRITE)

View File

@ -1,5 +1,6 @@
== Instructions for Linux
=== Basic usage
To run Yubico Authenticator, execute the authenticator binary by double clicking or running it from command line:
./authenticator
@ -11,4 +12,9 @@ On Ubuntu:
Note that the QR scanning feature requires gnome-screenshot when using Wayland.
sudo apt install gnome-screenshot
sudo apt install gnome-screenshot
=== Integration with desktop environments
Execute following command to integrate Yubico Authenticator to your environment:
desktop_integration.sh --install

View File

@ -0,0 +1,68 @@
#!/bin/bash
#
# Copyright (C) 2022 Yubico.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
VERSION="6.0.0"
PRODUCT_NAME="Yubico Authenticator $VERSION"
DESKTOP_FILENAME="com.yubico.authenticator.desktop"
DESKTOP_FILE="${HOME}/.local/share/applications/${DESKTOP_FILENAME}"
EXEC_PATH=$(pwd)
help() {
echo "Integrate Yubico Authenticator 6.0 with common desktop environments."
echo
echo "Usage: -i | --install -- install desktop file"
echo " -u | --uninstall -- uninstall desktop file"
echo " -h | --help -- show usage"
}
install() {
cat "./linux_support/${DESKTOP_FILENAME}" | sed -e "s|@EXEC_PATH|${EXEC_PATH}|g" >"${DESKTOP_FILE}"
echo "Created file: ${DESKTOP_FILE}"
}
uninstall() {
rm "${DESKTOP_FILE}"
echo "Removed: ${DESKTOP_FILE}"
}
while [[ "$#" -gt 0 ]]; do
case $1 in
-i | --install)
install
exit 0
;;
-u | --uninstall)
uninstall
exit 0
;;
-h | --help)
help
exit 0
;;
*)
echo "Unknown parameter passed: $1"
help
exit 1
;;
esac
shift
done
help

View File

@ -1,8 +1,8 @@
[Desktop Entry]
Name=Yubico Authenticator
GenericName=Yubico Authenticator
Exec=authenticator
Icon=com.yubico.yubioath
Exec="@EXEC_PATH/authenticator"
Icon=@EXEC_PATH/linux_support/com.yubico.yubioath.png
Type=Application
Categories=Utility;
Keywords=Yubico;Authenticator;

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.5 KiB