#!/bin/bash #This script builds luapam module for the appropriate lua version #Lua-pam is needed by the lock screen widget doasroot() { nohup which sudo > /dev/null if [ "$?" != "0" ]; then doas $@ else sudo $@ fi } LUA_VERSION=$(awesome --version | \ grep -Po "(?<=Compiled against Lua )5\.\d") if [ "$LUA_VERSION" == "" ]; then echo "Unable to detect the lua version which awesome uses" exit 1 fi echo "Target version: $LUA_VERSION" git clone --recursive https://github.com/devurandom/lua-pam lua-pam cd lua-pam make LUA_VERSION="$LUA_VERSION" mkdir -p ../pam/ cp LICENSE ../pam/ echo "https://github.com/devurandom/lua-pam" > ../pam/README cp pam.so ../