|
|
@ -1,21 +1,45 @@ |
|
|
|
task default: [:install] |
|
|
|
ConfigPath = (ENV["XDG_DATA_HOME"] or ENV["HOME"]+'/.config') |
|
|
|
|
|
|
|
desc "Copy files to .config" |
|
|
|
file "copy-config" => ["rc.lua"] do |
|
|
|
desc "Install (copy) config files" |
|
|
|
task "install-files" do |
|
|
|
base = ["libs","modules","themes","widgets","rc.lua","desktop.conf"] |
|
|
|
sh "mkdir -p #{ConfigPath}/awesome" |
|
|
|
["libs","modules","themes","widgets","rc.lua","desktop.conf"].each { |x| |
|
|
|
cp_r "./#{x}" "#{ConfigPath}/awesome" |
|
|
|
base.each { |f| |
|
|
|
cp_r "./#{f}", "#{ConfigPath}/awesome" |
|
|
|
} |
|
|
|
end |
|
|
|
|
|
|
|
desc "Compile and install luapam" |
|
|
|
file "build-luapam" => "#{ConfigPath}/libs/pam.so" do |
|
|
|
sh "sh ./extra/install_luapam.sh" |
|
|
|
desc "Install LuaPAM" |
|
|
|
task "install-luapam" do |
|
|
|
unless File.exist? "#{ConfigPath}/awesome/libs/pam.so" |
|
|
|
sh "sh ./extra/install_luapam.sh" |
|
|
|
cp "./pam.so","#{ConfigPath}/awesome/libs/" |
|
|
|
cp_r "./pam","#{ConfigPath}/awesome/libs/" |
|
|
|
rm "./pam.so" |
|
|
|
rm_rf "./pam" |
|
|
|
rm_rf "./lua-pam" |
|
|
|
else |
|
|
|
puts "LuaPAM already installed - skipping" |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
desc "Force install config" |
|
|
|
task "install-force" => ["install-files","install-luapam"] |
|
|
|
|
|
|
|
desc "Install config" |
|
|
|
task install: ["copy-config","build-luapam"] |
|
|
|
task :install do |
|
|
|
installed = true |
|
|
|
base = ["libs","modules","themes","widgets","rc.lua","desktop.conf"] |
|
|
|
(base+["libs/pam.so"]).each { |f| |
|
|
|
installed &= File.exist? "#{ConfigPath}/awesome/#{f}" |
|
|
|
} |
|
|
|
if installed |
|
|
|
puts "Baseline files already installed - skipping" |
|
|
|
else |
|
|
|
Rake::Task["install-force"].invoke |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
desc "Build documentation" |
|
|
|
task :doc do |
|
|
@ -27,14 +51,14 @@ task "install-extra" do |
|
|
|
if Process.euid != 0 |
|
|
|
raise Exception, "You need to be root to install extras" |
|
|
|
end |
|
|
|
cp "./extra/udev/backlight.rules" "/etc/udev/rules.d" |
|
|
|
cp "./extra/udev/backlight.rules", "/etc/udev/rules.d" |
|
|
|
mkdir "#{ConfigPath}/autostart" |
|
|
|
begin |
|
|
|
cp "/usr/share/applications/picom.desktop" "#{ConfigPath}/autostart/" |
|
|
|
cp "/usr/share/applications/picom.desktop", "#{ConfigPath}/autostart/" |
|
|
|
rescue |
|
|
|
puts "picom not installed - ignoring" |
|
|
|
else |
|
|
|
cp "./extra/picom.conf" "#{ConfigPath}" |
|
|
|
cp "./extra/picom.conf", "#{ConfigPath}" |
|
|
|
end |
|
|
|
puts "Done! Reload awesome to complete installation" |
|
|
|
end |
|
|
@ -44,6 +68,14 @@ task :clean do |
|
|
|
rm_rf "#{ConfigPath}/awesome" |
|
|
|
end |
|
|
|
|
|
|
|
desc "Install dependencies for code cleaner" |
|
|
|
task "install-janitor-deps" do |
|
|
|
if Process.euid != 0 |
|
|
|
raise Exception, "You need to be root to install gems" |
|
|
|
end |
|
|
|
Gem.install "language_server-protocol" |
|
|
|
end |
|
|
|
|
|
|
|
desc "Wipe configuration and reinstall from scratch" |
|
|
|
task reinstall: [:clean,:install] |
|
|
|
|