Skip to content

Commit 3a8ba45

Browse files
author
Harsh Shandilya
committed
Linux: Add script to re-enable overlays after disabling
1 parent 98264a7 commit 3a8ba45

File tree

3 files changed

+29
-1
lines changed

3 files changed

+29
-1
lines changed

Linux/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
disabled_overlays

Linux/disable_overlays.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,4 @@ fi
2424
"${ADB}" start-server
2525

2626
echo -e "${CL_YLW}Disabling overlays${CL_RST}"
27-
for item in $("${ADB}" shell cmd overlay list | grep '\[x\]' | sed 's/\[x\]//');do echo "${item}" && "${ADB}" shell cmd overlay disable "${item}";done
27+
for item in $("${ADB}" shell cmd overlay list | grep '\[x\]' | sed 's/\[x\]//');do echo "${item}" && echo "${item}" >> "${ROOT}/disabled_overlays" && "${ADB}" shell cmd overlay disable "${item}";done

Linux/enable_overlays.sh

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
#!/bin/bash
2+
echo "Overlay Enabler Shell Script by [projekt.] development team"
3+
echo ""
4+
echo "Make sure the device is connected and ADB option enabled"
5+
echo "Please only have one device connected at a time to use this!"
6+
echo ""
7+
8+
CL_RST="\033[0m"
9+
CL_YLW="\033[01;33m"
10+
11+
# Get the current directory of the device running this script
12+
ROOT="$(cd "$( dirname "$( readlink -f "${BASH_SOURCE[0]}" )" )" && pwd)"
13+
14+
# Device configuration of the testing rack
15+
ADB="$(command -v adb)"
16+
if [[ "${ADB}" == "" ]]; then
17+
ADB="${ROOT}/adb"
18+
fi
19+
20+
# ADB specific commands for termination
21+
# Don't kill existing servers in case someone has
22+
# a wireless ADB setup going.
23+
# adb kill-server
24+
"${ADB}" start-server
25+
26+
echo -e "${CL_YLW}Enabling overlays${CL_RST}"
27+
for item in $(cat "${ROOT}/disabled_overlays");do echo "${item}" && "${ADB}" shell cmd overlay enable "${item}";done

0 commit comments

Comments
 (0)