diff --git a/libs/pam.so b/libs/pam.so index 182f05f..e35c601 100644 Binary files a/libs/pam.so and b/libs/pam.so differ diff --git a/libs/thumbnail.lua b/libs/thumbnail.lua index fdc792c..e1ea4a8 100644 --- a/libs/thumbnail.lua +++ b/libs/thumbnail.lua @@ -1,17 +1,26 @@ -- A small utility function to generate thumbnails for images local spawn = require("awful.spawn") local thumbnailer = {} +-- annoying shit but that's what happens +if _VERSION ~= "Lua 5.1" then + execute = function(comm) + return select(3,os.execute(comm)) + end +else + execute = os.execute +end thumbnailer.generate = function(path,thumb_path,height) assert(type(path) == "string", "argumenr #1 (path) is not a string") assert(type(thumb_path) == "string", "argument #2 (thumbnail path) is not a string") assert(type(height) == "number","argument #3 (height) is not a number") - if os.execute("ls "..path) ~= 0 then + require("naughty").notify({text = tostring(path).." "..tostring(thumb_path.." ")..tostring(height)}) + if execute("ls "..path) ~= 0 then return false, "unable to access image directory" end - if os.execute("ls "..thumb_path) == 0 then + if execute("ls "..thumb_path) == 0 then return true end - if os.execute("mkdir "..thumb_path) ~= 0 then + if execute("mkdir "..thumb_path) ~= 0 then return false, "unable to create thumbnail directory" end spawn("mogrify -thumbnail x"..tostring(height).." -path '"..thumb_path.."' '"..path.."'/*.{jpg,png}") diff --git a/modules/awesomerc.lua b/modules/awesomerc.lua index aa228dc..5f3b7a0 100644 --- a/modules/awesomerc.lua +++ b/modules/awesomerc.lua @@ -3,6 +3,16 @@ -- It's like cron's @reboot but with additional awesomewm specific features local awful = require("awful") local rcfile = io.open(global.config_dir.."rc.lua") +local execute +-- why thank you lua changes, i appreciate this shit. +-- (luajit is deprecated my ASS, find me a faster version then) +if _VERSION ~= "Lua 5.1" then + execute = function(comm) + return select(3,os.execute(comm)) + end +else + execute = os.execute +end local execd = {} -- load persistent file for "o" tag local execd_file = io.open("/tmp/awesomerc.started","r") @@ -25,7 +35,7 @@ local function check_pid(prg) break end end - if os.execute("pgrep "..prgname) == 0 then + if execute("pgrep "..prgname) == 0 then return true else return false