diff options
author | ZachIR <zachir@librem.one> | 2022-07-28 17:52:48 -0500 |
---|---|---|
committer | ZachIR <zachir@librem.one> | 2022-07-28 17:52:48 -0500 |
commit | a10a0274b2b329490fdbfdc82937f4c42357ecda (patch) | |
tree | 186f30b18504a9e858ff19f368f0493a0c166c9a /rc.lua | |
parent | f52ad4441f33174caa137c260eb2ecdfb33d0199 (diff) |
tidiness
Diffstat (limited to 'rc.lua')
-rw-r--r-- | rc.lua | 38 |
1 files changed, 21 insertions, 17 deletions
@@ -114,6 +114,25 @@ awful.layout.layouts = { -- Config function definitions {{{ +function crcparse(substr) + local file=assert(io.open(config_dir .. "/computerrc","r")) + local line = "" + repeat + line=file:read("*line") + if line and line:find(string.format("^%s=",substr)) then + return string.sub(line,#substr + 2,-1) + end + until not line +end + +function is_linux () + return crcparse("OS") == "Linux" +end + +function is_obsd () + return crcparse("OS") == "OpenBSD" +end + function terminal_sp_cmd (spc, cmd) if terminal == "st" then local cflag = "-c" @@ -134,21 +153,6 @@ function terminal_sp_cmd (spc, cmd) end end -function crcparse(substr) - local file=assert(io.open(config_dir .. "/computerrc","r")) - local line = "" - repeat - line=file:read("*line") - if line and line:find(string.format("^%s=",substr)) then - return string.sub(line,#substr + 2,-1) - end - until not line -end - -function islinux () - return crcparse("OS") == "Linux" -end - -- }}} -- {{{ Menu @@ -269,7 +273,7 @@ awful.screen.connect_for_each_screen(function(s) -- Create the wibox s.mywibox = awful.wibar({ position = "top", screen = s, height = 24}) - if islinux() then + if is_linux() then -- Add widgets to the wibox s.mywibox:setup { layout = wibox.layout.align.horizontal, @@ -306,7 +310,7 @@ awful.screen.connect_for_each_screen(function(s) s.mylayoutbox, }, } - elseif isobsd() then + elseif is_obsd() then -- Add widgets to the wibox s.mywibox:setup { layout = wibox.layout.align.horizontal, |