View Single Post
Posts: 5 | Thanked: 8 times | Joined on Jul 2015 @ Germany
#7
Simple fix if anybody needs this:

startgpsrecorder.sh
Code:
#!/bin/sh
lYMD=`date '+%Y.%m.%d'`
/usr/bin/gpsrecorder &
while true; do
        sleep 3
        YMD=`date '+%Y.%m.%d'`
        HMS=`date '+%H:%M:%S'`
        echo $YMD $HMS
        if [ "$lYMD" != "$YMD" ]; then
                sudo date -s "$lYMD-$lHMS"
                break
        fi
        lYMD=$YMD
        lHMS=$HMS
done
date '+%Y.%m.%d - %H:%M:%S'
add in /etc/sudoers
user ALL = NOPASSWD: /bin/date

in /usr/share/applications/hildon/ create a file gpsrecorder2.desktop
Code:
[Desktop Entry]
Type=Application
Terminal=true
Name=GPS Recorder2
Exec=/home/user/startgpsrecorder.sh
Icon=gpsrecorder
Now there should be an entry GPS Recorder2 and you can create an icon.
 

The Following 4 Users Say Thank You to sbk510 For This Useful Post: