You are not logged in.
Hello everyone
I'm working on customizing my rc.lua for multiple, highly similar computers. For realizing the small differences, a check upon
require("awful")
...
host = os.getenv("HOSTNAME")seemed the smart choice.
However, both os.getenv("HOSTNAME") and os.getenv("EDITOR") return nil from within rc.lua.
When i call the same functions from a arbitary lua script or via the lua console, os.getenv("EDITOR") works, while os.getenv("HOSTNAME") still doesn't.
By now I feel positively stupid for propably overlooking something fairly simple, but I'm out of ideas.
I'm running lua 5.1.5 and awesome 3.4.13.
Any ideas?
Offline
Any ideas?
If you don't use BASH there's no guarantee this variable will be exported when X is started.
If you use vicious I propose an alternative:
$ lua
> widgets = require("vicious.widgets")
> print(widgets.os()[4])
sputnik
You need to install an RTFM interface.
Offline
Would exporting environmental variables via .xsession / .xinitrc help?
Either way,
widgets = require("vicious.widgets")
...
host = (widgets.os()[4])works, thanks.
--edit: add--
as does
host = awful.util.pread("hostname")just for future reference and those who don't use vicious.
Last edited by foyrkopp (2012-11-17 11:17:33)
Offline