-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathdeckpad.sh
More file actions
executable file
·49 lines (41 loc) · 1.49 KB
/
deckpad.sh
File metadata and controls
executable file
·49 lines (41 loc) · 1.49 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#!/bin/bash
DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null 2>&1 && pwd)"
cd "$DIR"
set -o pipefail
function run_as_root() {
source ./functions.sh
if ! command -v figlet &>/dev/null || ! command -v xinput &>/dev/null; then
echo "Make sure to run '~/Deckpad/initialize_after_os_update.sh' after updating SteamOS"
echo "Make sure to run '~/Deckpad/initialize_after_os_update.sh' after updating SteamOS"
echo "Make sure to run '~/Deckpad/initialize_after_os_update.sh' after updating SteamOS"
echo "Make sure to run '~/Deckpad/initialize_after_os_update.sh' after updating SteamOS"
echo "Make sure to run '~/Deckpad/initialize_after_os_update.sh' after updating SteamOS"
echo "Make sure to run '~/Deckpad/initialize_after_os_update.sh' after updating SteamOS"
echo "Make sure to run '~/Deckpad/initialize_after_os_update.sh' after updating SteamOS"
sleep 5
exit 1
fi
# Start
set_brightness_to_minimum
disable_sleep
start_virtualhere
# Run - Block until Tap on screen
run_prompt_start
block_until_press_on_target
# Quit
run_prompt_stop
quit_prompt &
quit_prompt_pid=$!
restore_brightness
reenable_sleep
stop_virtualhere
wait quit_prompt_pid
}
source ./functions.sh
prepare_fullscreen
show_prompt "Enter sudo password" 'big'
show_prompt "(screen will dim)" 'big'
xhost local:root >/dev/null
FUNC=$(declare -f run_as_root)
sudo bash -c "$FUNC; run_as_root"
cd - >/dev/null