tangled
alpha
login
or
join now
jcs.org
/
dotfiles
0
fork
atom
ftp -o - https://jcs.org/move_in | sh -
0
fork
atom
overview
issues
pulls
pipelines
irc: warn me if quartz python module is not installed
jcs.org
3 years ago
60da89de
768dd20a
+13
-2
1 changed file
expand all
collapse all
unified
split
bin
irc
+13
-2
bin/irc
···
1
1
#!/bin/sh
2
2
3
3
+
# doas pip3 install pyobjc-framework-Quartz
4
4
+
if [ X`uname -s` = X"Darwin" ]; then
5
5
+
python3 -c 'import sys, Quartz, time'
6
6
+
if [ $? -ne 0 ]; then
7
7
+
echo ""
8
8
+
echo "Quartz python module not installed"
9
9
+
echo "pip3 install pyobjc-framework-Quartz"
10
10
+
echo ""
11
11
+
exit 1
12
12
+
fi
13
13
+
fi
14
14
+
3
15
while :; do
4
16
host jcs.org > /dev/null 2>&1
5
17
if [ $? -eq 0 ]; then
6
6
-
7
18
env SSH_AUTH_SOCK= ssh -t \
8
19
-o ServerAliveInterval=5 \
9
20
-o ServerAliveCountMax=3 \
···
19
30
# wait until screen is not locked
20
31
sleep 1
21
32
if [ X`uname -s` = X"Darwin" ]; then
22
22
-
python -c 'import sys, Quartz, time
33
33
+
python3 -c 'import sys, Quartz, time
23
34
while True:
24
35
d = Quartz.CGSessionCopyCurrentDictionary()
25
36
if d.get("CGSSessionScreenIsLocked", 0) == 0: