From 7df763fd70ae3b5c08a2878c12286928a4b80e15 Mon Sep 17 00:00:00 2001 From: Romain Gayon Date: Mon, 1 Mar 2021 17:44:18 +0100 Subject: [PATCH] Add a couple hotkeys to start acquisition withouth a pointing device (#125) --- tools/remaster_scripts/post-install-root.sh | 2 +- tools/remaster_scripts/post-install-user.sh | 37 +++++++++++++++++++++ 2 files changed, 38 insertions(+), 1 deletion(-) diff --git a/tools/remaster_scripts/post-install-root.sh b/tools/remaster_scripts/post-install-root.sh index dd14305..d79a838 100644 --- a/tools/remaster_scripts/post-install-root.sh +++ b/tools/remaster_scripts/post-install-root.sh @@ -34,7 +34,7 @@ function install_forensication_tools { } function install_basic_pkg { - readonly local COMMON_UTILS=( git jq python3-pip pv zenity ) + readonly local COMMON_UTILS=( git jq python3-pip pv zenity vim ) readonly local WIRELESS_PKG=( firmware-b43-installer bcmwl-kernel-source ) apt-get -y update diff --git a/tools/remaster_scripts/post-install-user.sh b/tools/remaster_scripts/post-install-user.sh index 50f8e6b..f3b4a68 100644 --- a/tools/remaster_scripts/post-install-user.sh +++ b/tools/remaster_scripts/post-install-user.sh @@ -57,4 +57,41 @@ EOCHIPSHORT } +function user_add_setup_script { + # Sets up a script to be run after GiftStick has booted and user is logged in. + # This currently adds: + # - A hotkey to start the acquisition script with no mouse interaction: + # ctrl + alt + f and ctrl + shift +y + readonly local SENTINEL=".gift_is_setup" + readonly local SETUP_SCRIPT="gift_setup.sh" + cat << EOSETUPSCRIPT | sudo tee ${SETUP_SCRIPT} > /dev/null +#!/bin/bash + +if [[ ! -e \$HOME/${SENTINEL} ]] +then + xfconf-query --create --channel xfce4-keyboard-shortcuts \ + --property "/commands/custom/y" --type string \ + --set "xfce4-terminal -e \\"bash -c 'sudo bash \$HOME/call_auto_forensicate.sh ; /bin/bash'\\"" + xfconf-query --create --channel xfce4-keyboard-shortcuts \ + --property "/commands/custom/f" --type string \ + --set "xfce4-terminal -e \\"bash -c 'sudo bash \$HOME/call_auto_forensicate.sh ; /bin/bash'\\"" + + touch \$HOME/${SENTINEL} +fi +EOSETUPSCRIPT + + sudo mkdir -p .config/autostart + + cat << EOSTARTUPSCRIPT | sudo tee .config/autostart/gift_setup.desktop > /dev/null +# This ensures the GiftStick setup script is run when the user logs in. +[Desktop Entry] +Name=GiftStick Setup +Type=Application +Exec=/bin/sh -c "bash \$HOME/${SETUP_SCRIPT}" +EOSTARTUPSCRIPT +} + + +user_add_setup_script + user_customise_desktop