You are not logged in.

#1 2013-10-20 00:59:59

nomorewindows
Member
Registered: 2010-04-03
Posts: 3,548

Awesome obvious.gps

The obvious for awesome is not in the repos.  It can be had in the AUR.  I was trying to use obvious.gps.  Just placing the require line for it, causes awesome to show a naughty message:

Oops, there were errors during startup!
error while running function
stack traceback:
[C]: in ?
[C]: in function 'require'
~/.config/awesome/rc.lua:xx: in main chunk
error: error loading module 'obvious.gps' form file '/usr/share/awesome/lib/obvious/gps/init.lua':
/usr/share/awesome/lib/obvious/gps/init.lua:84: invalid escape sequence near '\$'

This is the line that is

 local time, latitude, longitude, quality, satellites, dilution, altitude, height, checksum = line:match("^\$GPGGA,([0-9.]+),([0-9.]+),[NS],([0-9.]+),[EW],([0-8]?),([0-9]+),([0-9.]*),([0-9.-]+),M,([0-9.]+),M,,\*(.*)")

but it's not the only sentence that the gps module processes. 
Not sure what change needs to be made here.  I guess nobody has used this?


I may have to CONSOLE you about your usage of ridiculously easy graphical interfaces...
Look ma, no mouse.

Offline

#2 2013-10-20 14:22:37

nomorewindows
Member
Registered: 2010-04-03
Posts: 3,548

Re: Awesome obvious.gps

I was also trying to find a way to take gps coordinates from gpsd and put them in place of redshift lat and lon thought it would be kinda cool.  But it looks like I would have some of the same problems getting that to work in rc.lua.  I found this around the internet:

#!/bin/bash
gpsdata=$( gpspipe -w -n 10 |   grep -m 1 lon )
lat=$( echo "$gpsdata"  | jsawk 'return this.lat' )
lon=$( echo "$gpsdata"  | jsawk 'return this.lon' )
echo "You are here: $lat, $lon"

So I would just substitute this for redshift:

function getcoords()
local gpsdata=$( gpspipe -w -n 10 |   grep -m 1 lon )
local lat=$( echo "$gpsdata"  | jsawk 'return this.lat' )
local lon=$( echo "$gpsdata"  | jsawk 'return this.lon' )
redshift.options="-l $lat:$lon -t 5700:1000"

It is necessary to capture the information in one read and then decipher from there.  Jsawk is in the AUR, but this is what the person was using to do this with to read JSON output.  The obvious.gps module gets the same information deciphering NMEA sentences.


I may have to CONSOLE you about your usage of ridiculously easy graphical interfaces...
Look ma, no mouse.

Offline

#3 2013-11-16 20:48:31

nomorewindows
Member
Registered: 2010-04-03
Posts: 3,548

Re: Awesome obvious.gps

Was able to get the gps coordinates to show up in the wibox as a textbox widget using bashets, but slows down awesome operations too slow.  Still not sure how to pump the datas into a commandline like redshift.


I may have to CONSOLE you about your usage of ridiculously easy graphical interfaces...
Look ma, no mouse.

Offline

Board footer

Powered by FluxBB