diff --git a/.config/yadm/alt/.Xmodmap##Linux.epiphanius b/.config/yadm/alt/.Xmodmap##o.Linux,h.epiphanius similarity index 100% rename from .config/yadm/alt/.Xmodmap##Linux.epiphanius rename to .config/yadm/alt/.Xmodmap##o.Linux,h.epiphanius diff --git a/.config/yadm/alt/.config/awesome/battery.lua##o.Linux,h.epiphanius b/.config/yadm/alt/.config/awesome/battery.lua##o.Linux,h.epiphanius new file mode 100644 index 0000000..e2c2308 --- /dev/null +++ b/.config/yadm/alt/.config/awesome/battery.lua##o.Linux,h.epiphanius @@ -0,0 +1,58 @@ +-- This function returns a formatted string with the current battery status. It +-- can be used to populate a text widget in the awesome window manager. Based +-- on the "Gigamo Battery Widget" found in the wiki at awesome.naquadah.org + +local naughty = require("naughty") +local beautiful = require("beautiful") + +function readBatFile(adapter, ...) + local basepath = "/sys/class/power_supply/"..adapter.."/" + for i, name in pairs({...}) do + file = io.open(basepath..name, "r") + if file then + local str = file:read() + file:close() + return str + end + end +end + +function batteryInfo(adapter) + local fh = io.open("/sys/class/power_supply/"..adapter.."/present", "r") + if fh == nil then + battery = "A/C" + icon = "" + percent = "" + else + local cur = readBatFile(adapter, "charge_now", "energy_now") + local cap = readBatFile(adapter, "charge_full", "energy_full") + local sta = readBatFile(adapter, "status") + battery = math.floor(cur * 100 / cap) + + if sta:match("Charging") then + icon = "⚡" + percent = "%" + elseif sta:match("Discharging") then + icon = "" + percent = "%" + if tonumber(battery) < 5 then + naughty.notify({ title = "Battery Warning" + , text = "Battery low!".." "..battery..percent.." ".."left!" + , timeout = 300 + , position = "top_right" + , fg = beautiful.fg_focus + , bg = beautiful.bg_focus + }) + end + else + -- If we are neither charging nor discharging, assume that we are on A/C + battery = "🔌" + icon = "" + percent = "" + end + + -- fix 'too many open files' bug on awesome 4.0 + fh:close() + end + return " "..icon..battery..percent.." " +end diff --git a/.config/yadm/alt/.config/awesome/rc.lua##Linux.epiphanius b/.config/yadm/alt/.config/awesome/rc.lua##o.Linux,h.epiphanius similarity index 100% rename from .config/yadm/alt/.config/awesome/rc.lua##Linux.epiphanius rename to .config/yadm/alt/.config/awesome/rc.lua##o.Linux,h.epiphanius diff --git a/.config/yadm/alt/.eyaml/config.yaml##Linux.epiphanius b/.config/yadm/alt/.eyaml/config.yaml##o.Linux,h.epiphanius similarity index 100% rename from .config/yadm/alt/.eyaml/config.yaml##Linux.epiphanius rename to .config/yadm/alt/.eyaml/config.yaml##o.Linux,h.epiphanius diff --git a/.config/yadm/alt/.krb5.conf##Linux.epiphanius b/.config/yadm/alt/.krb5.conf##o.Linux,h.epiphanius similarity index 100% rename from .config/yadm/alt/.krb5.conf##Linux.epiphanius rename to .config/yadm/alt/.krb5.conf##o.Linux,h.epiphanius diff --git a/.config/yadm/alt/.ssh/config##Linux.epiphanius b/.config/yadm/alt/.ssh/config##o.Linux,h.epiphanius similarity index 100% rename from .config/yadm/alt/.ssh/config##Linux.epiphanius rename to .config/yadm/alt/.ssh/config##o.Linux,h.epiphanius diff --git a/.config/yadm/alt/.xinitrc##Linux.epiphanius b/.config/yadm/alt/.xinitrc##o.Linux,h.epiphanius similarity index 100% rename from .config/yadm/alt/.xinitrc##Linux.epiphanius rename to .config/yadm/alt/.xinitrc##o.Linux,h.epiphanius diff --git a/.config/yadm/alt/.zsh.d/00-path.zsh##Linux.epiphanius b/.config/yadm/alt/.zsh.d/00-path.zsh##o.Linux,h.epiphanius similarity index 100% rename from .config/yadm/alt/.zsh.d/00-path.zsh##Linux.epiphanius rename to .config/yadm/alt/.zsh.d/00-path.zsh##o.Linux,h.epiphanius diff --git a/.config/yadm/alt/.zshrc##Darwin b/.config/yadm/alt/.zshrc##o.Darwin similarity index 100% rename from .config/yadm/alt/.zshrc##Darwin rename to .config/yadm/alt/.zshrc##o.Darwin diff --git a/.config/yadm/alt/.zshrc##Linux b/.config/yadm/alt/.zshrc##o.Linux similarity index 100% rename from .config/yadm/alt/.zshrc##Linux rename to .config/yadm/alt/.zshrc##o.Linux diff --git a/.zsh.d/00-path.zsh b/.zsh.d/00-path.zsh deleted file mode 120000 index e014cc2..0000000 --- a/.zsh.d/00-path.zsh +++ /dev/null @@ -1 +0,0 @@ -/home/snarbutas/.yadm/alt/.zsh.d/00-path.zsh##Linux.epiphanius \ No newline at end of file