forked from troubadoour/sdwdate-gui
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fixed stale status bug and better error handling
solved duplicate event processing
- Loading branch information
Patrick Schleizer
committed
Apr 22, 2016
1 parent
ddd3d80
commit 0046d21
Showing
2 changed files
with
48 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
#!/bin/bash | ||
|
||
set -x | ||
set -e | ||
|
||
counter=0 | ||
|
||
while true ; do | ||
for icon in /usr/share/icons/sdwdate-gui/* ; do | ||
msg="$(cat /proc/sys/kernel/random/uuid)" | ||
|
||
echo "(dp0 | ||
S'message' | ||
p1 | ||
S\"$msg\" | ||
p2 | ||
sS'icon' | ||
p3 | ||
S'$icon' | ||
p4 | ||
s." > /var/run/sdwdate/status | ||
|
||
counter=$(( counter + 1 )) | ||
if [ "$counter" -ge 1000 ]; then | ||
do_break=true | ||
fi | ||
|
||
#sleep 1 | ||
done | ||
if [ "$do_break" = "true" ]; then | ||
break | ||
fi | ||
done |