{"id":13440644,"url":"https://github.com/shdown/luastatus","last_synced_at":"2025-03-20T10:31:38.011Z","repository":{"id":41583716,"uuid":"75958176","full_name":"shdown/luastatus","owner":"shdown","description":"universal status bar content generator","archived":false,"fork":false,"pushed_at":"2024-08-13T10:05:37.000Z","size":1156,"stargazers_count":293,"open_issues_count":5,"forks_count":12,"subscribers_count":8,"default_branch":"master","last_synced_at":"2024-10-29T18:47:35.609Z","etag":null,"topics":["bspwm","c","dwm","dzen","dzen2","i3","i3bar","i3wm","lemonbar","lua","statusbar","xmobar","xmonad"],"latest_commit_sha":null,"homepage":null,"language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/shdown.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"COPYING.LESSER.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-12-08T17:04:56.000Z","updated_at":"2024-10-24T11:29:42.000Z","dependencies_parsed_at":"2024-11-06T00:36:12.224Z","dependency_job_id":"693e0dac-312c-4704-8df9-a6ce23802b3e","html_url":"https://github.com/shdown/luastatus","commit_stats":{"total_commits":777,"total_committers":12,"mean_commits":64.75,"dds":0.07979407979407982,"last_synced_commit":"ff64f9c4ae13c5546a537136b35a987d39c376dc"},"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shdown%2Fluastatus","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shdown%2Fluastatus/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shdown%2Fluastatus/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shdown%2Fluastatus/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/shdown","download_url":"https://codeload.github.com/shdown/luastatus/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244173682,"owners_count":20410354,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bspwm","c","dwm","dzen","dzen2","i3","i3bar","i3wm","lemonbar","lua","statusbar","xmobar","xmonad"],"created_at":"2024-07-31T03:01:24.732Z","updated_at":"2025-03-20T10:31:37.974Z","avatar_url":"https://github.com/shdown.png","language":"C","readme":"[![CircleCI build status](https://circleci.com/gh/shdown/luastatus.svg?style=shield)](https://circleci.com/gh/shdown/luastatus)\n[![Gitter](https://badges.gitter.im/luastatus/community.svg)](https://gitter.im/luastatus/community)\n\n**luastatus** is a universal status bar content generator. It allows you to configure the way the\ndata from event sources is processed and shown, with Lua.\n\nIts main feature is that the content can be updated immediately as some event occurs, be it a change\nof keyboard layout, active window title, volume or a song in your favorite music player (provided\nthat there is a plugin for it) — a thing rather uncommon for tiling window managers.\n\nIts motto is:\n\n\u003e No more heavy-forking, second-lagging shell-script status bar generators!\n\nScreenshot\n===\n\n![Screenshot](https://user-images.githubusercontent.com/5462697/39099519-092459aa-4685-11e8-94fe-0ac1cf706d82.gif)\n\nAbove is i3bar with luastatus with Bitcoin price, time, volume, and keyboard layout widgets.\n\nKey concepts\n===\n\n![Explanation](https://user-images.githubusercontent.com/5462697/42400208-5b54f5f2-8179-11e8-9836-70d4e46d5c13.png)\n\nIn short:\n  * plugin is a thing that decides when to call the callback function `widget.cb` and what to pass to it;\n  * barlib (**bar** **lib**rary) is a thing that decides what to with values that `widget.cb` function returns;\n  * there are also *derived plugins*, which are plugins written in Lua that use regular plugins.\n\nExamples\n===\nALSA volume widget:\n\n```lua\nwidget = {\n    plugin = 'alsa',\n    opts = {\n        channel = 'PCM'\n    },\n    cb = function(t)\n        if t.mute then\n            return {full_text = '[mute]', color = '#e03838'}\n        else\n            local percent = (t.vol.cur - t.vol.min)\n                          / (t.vol.max - t.vol.min)\n                          * 100\n            return {full_text = string.format('[%3d%%]', math.floor(0.5 + percent)),\n                    color = '#718ba6'}\n        end\n    end,\n    event = function(t)\n        if t.button == 1 then     -- left mouse button\n            os.execute('urxvt -e alsamixer \u0026')\n        end\n    end\n}\n```\n\nGMail widget (uses the derived plugin `imap`):\n\n```lua\n--[[\n-- Expects 'credentials.lua' to be present in the current directory; it may contain, e.g.,\n--     return {\n--         gmail = {\n--             login = 'john.smith',\n--             password = 'qwerty'\n--         }\n--     }\n--]]\ncredentials = require 'credentials'\nwidget = luastatus.require_plugin('imap').widget{\n    host = 'imap.gmail.com',\n    port = 993,\n    mailbox = 'Inbox',\n    use_ssl = true,\n    timeout = 2 * 60,\n    handshake_timeout = 10,\n    login = credentials.gmail.login,\n    password = credentials.gmail.password,\n    error_sleep_period = 60,\n    cb = function(unseen)\n        if unseen == nil then\n            return nil\n        elseif unseen == 0 then\n            return {full_text = '[-]', color = '#595959'}\n        else\n            return {full_text = string.format('[%d unseen]', unseen)}\n        end\n    end,\n    event = [[                    -- separate-state event function\n        local t = ...             -- obtain argument of this implicit function\n        if t.button == 1 then     -- left mouse button\n            os.execute('xdg-open https://gmail.com \u0026')\n        end\n    ]]\n}\n```\n\nSee more examples [here](https://github.com/shdown/luastatus/tree/master/examples).\n\nInstallation\n===\n`cmake . \u0026\u0026 make \u0026\u0026 sudo make install`\n\nYou can specify a Lua library to build with: `cmake -DWITH_LUA_LIBRARY=luajit .`\n\nYou can disable building certain barlibs and plugins, e.g. `cmake -DBUILD_PLUGIN_XTITLE=OFF .`\n\nYou can disable building man pages: `cmake -DBUILD_DOCS=OFF .`\n\nArchLinux\n---\nArchLinux users can use one of the following AUR packages:\n\n* [luastatus](https://aur.archlinux.org/packages/luastatus)\n* [luastatus-luajit](https://aur.archlinux.org/packages/luastatus-luajit)\n* [luastatus-git](https://aur.archlinux.org/packages/luastatus-git)\n* [luastatus-luajit-git](https://aur.archlinux.org/packages/luastatus-luajit-git)\n\nThere is also the [luastatus-meta](https://aur.archlinux.org/packages/luastatus-meta)\nmeta package which installs the dependencies of all of luastatus's plugins.\n\nGetting started\n===\nIt is recommended to first have a look at the\n[luastatus' man page](https://github.com/shdown/luastatus/blob/master/luastatus/README.rst).\n\nThen, read the barlib's and plugins' documentation, either via directly viewing\n`barlibs/\u003cname\u003e/README.rst` and `plugins/\u003cname\u003e/README.rst` files, or via installing the man pages\nand reading `luastatus-barlib-\u003cname\u003e(7)` and `luastatus-plugin-\u003cname\u003e(7)`.\n\nBarlib-specific notes on usage follow.\n\ni3\n---\n`luastatus-i3-wrapper` should be specified as the i3bar's status command in the i3 config, e.g.:\n```\nbar {\n    status_command cd ~/.config/luastatus \u0026\u0026 exec luastatus-i3-wrapper -B no_separators time-battery-combined.lua alsa.lua xkb.lua\n```\n\nSee also [README for i3](https://github.com/shdown/luastatus/blob/master/barlibs/i3/README.rst) and\n[examples for i3](https://github.com/shdown/luastatus/tree/master/examples/i3).\n\ndwm\n---\nluastatus should simply be launched with `-b dwm`, e.g.:\n```\nluastatus -b dwm -B separator=' • ' alsa.lua time-battery-combined.lua\n```\n\nSee also [README for dwm](https://github.com/shdown/luastatus/blob/master/barlibs/dwm/README.rst)\nand [examples for dwm](https://github.com/shdown/luastatus/tree/master/examples/dwm).\n\nlemonbar\n--------\n`lemonbar` should be launched with `luastatus-lemonbar-launcher`, e.g.:\n```\nluastatus-lemonbar-launcher -p -B#111111 -p -f'Droid Sans Mono for Powerline:pixelsize=12:weight=Bold' -- -Bseparator=' ' alsa.lua time-date.lua\n```\n\nSee also\n[README for lemonbar](https://github.com/shdown/luastatus/blob/master/barlibs/lemonbar/README.rst)\nand [examples for lemonbar](https://github.com/shdown/luastatus/tree/master/examples/lemonbar).\n\nstdout\n------\nluastatus should be launched with `luastatus-stdout-wrapper`; or write your own wrapper, see e.g.\nthe [wrapper for launching dvtm with luastatus](https://github.com/shdown/luastatus/blob/master/barlibs/stdout/luastatus-dvtm).\n\nSee also\n[README for stdout](https://github.com/shdown/luastatus/blob/master/barlibs/stdout/README.rst) and\nand [examples for stdout](https://github.com/shdown/luastatus/tree/master/examples/stdout).\n\nSupported Lua versions\n===\n* 5.1\n* LuaJIT, which is currently 5.1-compatible with \"some language and library extensions from Lua 5.2\"\n* 5.2\n* 5.3\n* 5.4\n\nReporting bugs, requesting features, suggesting patches\n===\nFeel free to open an issue or a pull request. You can also chat on [our Gitter chat room](https://gitter.im/luastatus/community).\n\nMigrating from older versions\n===\nSee the [Migration Guide](https://github.com/shdown/luastatus/blob/master/DOCS/MIGRATION_GUIDE.md).\n\nAcknowledgements\n===\n* I would like to thank [wm4](https://github.com/wm4) for developing [mpv](https://mpv.io), which,\n  also being a “platform” for running Lua scripts, served as an inspiration for this project.\n","funding_links":[],"categories":["C","Projects","Packages"],"sub_categories":["Bars, Panels, and Widgets"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshdown%2Fluastatus","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fshdown%2Fluastatus","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshdown%2Fluastatus/lists"}