Created
May 23, 2015 05:10
-
-
Save spahl/ecf80325d9e35867f7f7 to your computer and use it in GitHub Desktop.
i3status + awesome wm
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| general { | |
| output_format = none | |
| interval = 0 | |
| } | |
| order += "run_watch DHCP" | |
| order += "wireless _first_" | |
| order += "ethernet _first_" | |
| order += "battery 1" | |
| order += "battery 0" | |
| wireless _first_ { | |
| format_up = "W: (%quality at %essid) %ip" | |
| format_down = "W: down" | |
| } | |
| ethernet _first_ { | |
| format_up = "E: %ip (%speed)" | |
| format_down = "E: down" | |
| } | |
| battery 0 { | |
| last_full_capacity = true | |
| integer_battery_capacity = true | |
| format_down = "No battery" | |
| status_chr = "⚇" | |
| status_bat = "⚡" | |
| status_full = "☻" | |
| hide_seconds = true | |
| format = "B1: %status %percentage %remaining" | |
| } | |
| battery 1 { | |
| last_full_capacity = true | |
| integer_battery_capacity = true | |
| format_down = "No battery" | |
| status_chr = "⚇" | |
| status_bat = "⚡" | |
| status_full = "☻" | |
| hide_seconds = true | |
| format = "B0: %status %percentage %remaining" | |
| } | |
| run_watch DHCP { | |
| pidfile = "/var/run/dhcpcd*.pid" | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| local setmetatable = setmetatable | |
| local io = require("io") | |
| local textbox = require("wibox.widget.textbox") | |
| local capi = { timer = timer } | |
| local i3status = { mt = {} } | |
| function read_status() | |
| local p = io.popen("i3status") | |
| local status = p:read() | |
| p:close() | |
| return " " .. status .. " |" | |
| end | |
| function i3status.new(format, timeout) | |
| local timeout = timeout or 60 | |
| local w = textbox() | |
| local timer = capi.timer { timeout = timeout } | |
| timer:connect_signal("timeout", function() w:set_markup(read_status()) end) | |
| timer:start() | |
| timer:emit_signal("timeout") | |
| return w | |
| end | |
| function i3status.mt:__call(...) | |
| return i3status.new(...) | |
| end | |
| return setmetatable(i3status, i3status.mt) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Nice solution!
@chr1swallace:
Save i3status.lua to ~/.config/awesome/i3status.lua
Add to ~/.config/awesome/rc.lua something like this