Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Starting ulogme at login #42

Open
glung opened this issue Jun 5, 2016 · 3 comments
Open

Starting ulogme at login #42

glung opened this issue Jun 5, 2016 · 3 comments

Comments

@glung
Copy link

glung commented Jun 5, 2016

Hello,

I am not too sure where to put the instructions or the code for starting ulogme at run time. I think though it would be useful for others. I can contribute but need some guidance.

Cheers

@glung
Copy link
Author

glung commented Jun 5, 2016

on macosx, you need to create the file ulogme-launcher.plist in ~/Library/LaunchAgents/

<plist version="1.0">
 <dict>
   <key>Label</key>
   <string>ulogme-daemon</string>
   <key>RunAtLoad</key>
   <true />
   <key>Program</key>
   <string>/Users/<PATH>/launch_ulogme.sh</string>
  </dict>
</plist>

launch_ulogme.sh contains

#!/bin/sh
(cd <{PATH_TO_ULOGME> && ./ulogme.sh)

Then, run :
launchctl load ~/Library/LaunchAgents/ulogme-launcher.plist

@eliatlas
Copy link

I tried this, and noticed that the script stopped recording keyfreq.
Once I run the script directly, with launch_ulogme.sh, the keys are recorded.
Didn't find a solution so far.

@sergregory
Copy link

The problem occurs because the keyfreq recording requires root access (at least on linux). For me, I solved this with the following modification of the ulogme.sh script (please note, this code is for Bash under Linux, I have no Mac OS to check it):

# Assume Linux
  DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
  pushd "${DIR}"
  echo "" > ./ulogme.log
  until [ "$(pgrep -fca 'keyfreq')" -gt 0 ]
  do
      gksudo -D <homedir>/.config/autostart/ulogme.desktop ./keyfreq.sh &
      sleep 10
      echo "trying to start keyfreq" >> ./ulogme.log
      started_count=$(pgrep -fca "keyfreq")
      echo "started_count = ${started_count}"
  done
  until [ "$(pgrep -fca 'logactivewin')" -gt 0 ]
  do
      ./logactivewin.sh &
      echo "trying to start logactivewin" >> ./ulogme.log
      started_count=$(pgrep -fca "logactivewin")
      echo "started_count = ${started_count}"
  done
  until [ "$(pgrep -fca 'ulogme_serve')" -gt 0 ]
  do
      python ./ulogme_serve.py &> /dev/null &
      echo "trying to start ulogme_serve" >> ./ulogme.log
      started_count=$(pgrep -fca "ulogme_serve")
      echo "started_count = ${started_count}"
  done
  echo "all routines started"
  popd

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants