Skip to content

Instantly share code, notes, and snippets.

@tomoe-mami
Last active August 29, 2015 14:23
Show Gist options
  • Save tomoe-mami/86bd0831cf4427e34cb2 to your computer and use it in GitHub Desktop.
Save tomoe-mami/86bd0831cf4427e34cb2 to your computer and use it in GitHub Desktop.
Weechat script for adding ${info:time} variable into eval
-- Example usage: /eval -n ${info:time,%Y-%m-%d %H:%M:%S}
function info_cb(_, _, format)
return os.date(format)
end
if weechat.register("info_time", "singalaut", "0.1", "WTFPL", "Add ${info:time} variable to eval", "", "") then
weechat.hook_info(
"time",
"Gets current date and time info",
"Format of date/time (see `man strftime`)",
"info_cb", "")
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment