-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathx52setup.sh
executable file
·55 lines (47 loc) · 1.53 KB
/
x52setup.sh
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
50
51
52
53
#!/bin/zsh -
#===============================================================================
#
# FILE: x52setup.sh
#
# USAGE: ./x52setup.sh
#
# DESCRIPTION:
#
# OPTIONS: ---
# REQUIREMENTS: ---
# BUGS: ---
# NOTES: ---
# AUTHOR: Cláudio "Patola" Sampaio (Patola), patola@gmail.comm
# ORGANIZATION: MakerLinux
# CREATED: 14/09/2019 20:40:25 -03
# REVISION: ---
#===============================================================================
set -o nounset # Treat unset variables as an error
exec > /tmp/x52-patola.log 2>&1
x52output bri 0 127
x52output bri 1 127
x52output text 0 "$(date '+%Y-%m-%d %H:%M')"
x52output text 1 "Ready f/ Action "
x52output text 2 "[X] Cmdr.Patola "
x52output text 0 "$(date '+%Y-%m-%d %H:%M')"
x52output text 1 "Ready f/ Action "
x52output text 2 "[X] Cmdr.Patola "
for i in 1 2 4 6 8 10 12 14 16 18
do
x52output led ${i} 1
done
X52ERR=0
set -o nomonitor
while [[ $X52ERR == 0 ]]; do
sleep 20
x52output time 1 $(date '+%H') $(date '+%M')
x52output date $(date '+%Y') $(date '+%m') $(date '+%d')
X52ERR=$?
x=$((RANDOM%3))
y=$((RANDOM%9))
x52output led $((y*2+3)) $(((x+1)/2))
x52output led $((y*2+2)) $(((x+1)%2))
x52output text 1 " $(LC_NUMERIC=C uptime | cut -d, -f3-5 | cut -d: -f2 | cut -c2-)"
textres="$(ps -ef | grep 'jogos\\steam\\steamapps\\common' | grep -v grep | head -1 | sed 's/.*common\\\(.*\)\\.*/\1 /' | cut -c1-16)"
[[ "$textres" != "" ]] && x52output text 2 "$textres"
done &