Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- kanji = {}
- kanji.w = wibox.widget {
- widget = wibox.widget.textbox,
- text = " 漢字 "
- }
- kanji.t = awful.tooltip { }
- kanji.t:add_to_object(kanji.w)
- kanji.timer = gears.timer {
- timeout = 120,
- call_now = true,
- autostart = true,
- callback = function()
- awful.spawn.easy_async({"bash", "-c", "cat ".. config_dir .. "/jlpt5_4_list.txt | head -n`shuf -i 1-320 -n 1` | tail -n1"},
- function(out)
- local kanji_current = string.match(out, "^(.*);.*;")
- local on_kun = string.match(out, ";(.*);")
- local rus = string.match(out, "^.*;(.*)$")
- kanji.w:set_text(kanji_current)
- kanji.t.text = on_kun .. "\n" .. rus
- end
- )
- end
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement