开源软件名称(OpenSource Name):shdown/luastatus开源软件地址(OpenSource Url):https://github.com/shdown/luastatus开源编程语言(OpenSource Language):C 71.0%开源软件介绍(OpenSource Introduction):luastatus is a universal status bar content generator. It allows you to configure the way the data from event sources is processed and shown, with Lua. Its main feature is that the content can be updated immediately as some event occurs, be it a change of keyboard layout, active window title, volume or a song in your favorite music player (provided that there is a plugin for it) — a thing rather uncommon for tiling window managers. Its motto is:
ScreenshotAbove is i3bar with luastatus with Bitcoin price, time, volume, and keyboard layout widgets. Key conceptsIn short:
ExamplesALSA volume widget: widget = {
plugin = 'alsa',
opts = {
channel = 'PCM'
},
cb = function(t)
if t.mute then
return {full_text = '[mute]', color = '#e03838'}
else
local percent = (t.vol.cur - t.vol.min)
/ (t.vol.max - t.vol.min)
* 100
return {full_text = string.format('[%3d%%]', math.floor(0.5 + percent)),
color = '#718ba6'}
end
end,
event = function(t)
if t.button == 1 then -- left mouse button
os.execute('urxvt -e alsamixer &')
end
end
} GMail widget (uses the derived plugin --[[
-- Expects 'credentials.lua' to be present in the current directory; it may contain, e.g.,
-- return {
-- gmail = {
-- login = 'john.smith',
-- password = 'qwerty'
-- }
-- }
--]]
credentials = require 'credentials'
widget = luastatus.require_plugin('imap').widget{
host = 'imap.gmail.com',
port = 993,
mailbox = 'Inbox',
use_ssl = true,
timeout = 2 * 60,
handshake_timeout = 10,
login = credentials.gmail.login,
password = credentials.gmail.password,
error_sleep_period = 60,
cb = function(unseen)
if unseen == nil then
return nil
elseif unseen == 0 then
return {full_text = '[-]', color = '#595959'}
else
return {full_text = string.format('[%d unseen]', unseen)}
end
end,
event = [[ -- separate-state event function
local t = ... -- obtain argument of this implicit function
if t.button == 1 then -- left mouse button
os.execute('xdg-open https://gmail.com &')
end
]]
} See more examples here. Installation
You can specify a Lua library to build with: You can disable building certain barlibs and plugins, e.g. You can disable building man pages: Getting startedIt is recommended to first have a look at the luastatus' man page. Then, read the barlib's and plugins' documentation, either via directly viewing
Barlib-specific notes on usage follow. i3
See also README for i3 and examples for i3. dwmluastatus should simply be launched with
See also README for dwm and examples for dwm. lemonbar
See also README for lemonbar and examples for lemonbar. stdoutluastatus should be launched with See also README for stdout and and examples for stdout. Supported Lua versions
Reporting bugs, requesting features, suggesting patchesFeel free to open an issue or a pull request. You can also chat on our Gitter chat room. Migrating from older versionsSee the Migration Guide. Acknowledgements
DonateYou can donate to our collective on Open Collective. |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论