2024-02-19 20:49:12 -05:00
|
|
|
#!/bin/sh
|
2023-06-17 01:34:05 -04:00
|
|
|
|
2024-02-19 20:49:12 -05:00
|
|
|
user=$(id -u)
|
|
|
|
time=$(date +"%b %d, %Y %T")
|
|
|
|
log_file=$XDG_STATE_HOME/waylock.log
|
2023-06-17 01:34:05 -04:00
|
|
|
|
2024-02-19 20:49:12 -05:00
|
|
|
echo "--- $time ---" > "$log_file"
|
|
|
|
|
|
|
|
if pgrep -u "$user" -x waylock >/dev/null; then
|
|
|
|
echo "error: waylock is already running" >> "$log_file"
|
2023-06-17 01:34:05 -04:00
|
|
|
exit 1
|
|
|
|
else
|
|
|
|
waylock \
|
|
|
|
-fork-on-lock \
|
|
|
|
-init-color 0x000000 \
|
2023-06-17 05:00:33 -04:00
|
|
|
-fail-color 0x000000 \
|
|
|
|
-input-color 0x525c62 \
|
2024-02-19 20:49:12 -05:00
|
|
|
2>&1 | tee -a "$log_file"
|
2023-06-17 01:34:05 -04:00
|
|
|
fi
|
|
|
|
|