On Mon, 19 Nov 2012, Adrian C. wrote:

> On Wed, 31 Oct 2012, Andre Kl?rner wrote:
> 
> > -- Determine hostname (stolen from https://github.com/xtaran )
> > local io = { popen = io.popen }
> > local f = io.popen("hostname")
> > local hostname = f:read("*all")
> > f:close()
> > hostname = string.gsub(hostname, '[\n\r]+', '')
> > naughty.notify ( { text = "awesome running on " .. hostname } )
> 
> Hi that's a lot of code. I was just talking with someone in Arch Linux 
> about hostnames in Lua.
> 
> If you use BASH you can read os.getenv("HOSTNAME") or if you use 
> vicious you can read vicious.widgets.os()[4]

Forgot another thing awful.util.pread helper provided by awesome, which 
compacts all this as it would execute, and strip the newline.


-- 
Adrian C. (anrxc) | anrxc..sysphere.org | PGP ID: D20A0618
PGP FP: 02A5 628A D8EE 2A93 996E  929F D5CB 31B7 D20A 0618

-- 
To unsubscribe, send mail to [email protected].

Reply via email to