Reno is the second iteration of the AWMTK-powered AwesomeWM config.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

73 lines
1.8 KiB

  1. task default: [:install]
  2. ConfigPath = (ENV["XDG_DATA_HOME"] or ENV["HOME"]+'/.config')
  3. desc "Install (copy) config files"
  4. task "install-files" do
  5. base = ["libs","modules","themes","widgets","rc.lua","desktop.conf"]
  6. sh "mkdir -p #{ConfigPath}/awesome"
  7. base.each { |f|
  8. cp_r "./#{f}", "#{ConfigPath}/awesome"
  9. }
  10. end
  11. desc "Install LuaPAM"
  12. task "install-luapam" do
  13. unless File.exist? "#{ConfigPath}/awesome/libs/pam.so"
  14. sh "sh ./extra/install_luapam.sh"
  15. cp "./pam.so","#{ConfigPath}/awesome/libs/"
  16. cp_r "./pam","#{ConfigPath}/awesome/libs/"
  17. rm "./pam.so"
  18. rm_rf "./pam"
  19. rm_rf "./lua-pam"
  20. else
  21. puts "LuaPAM already installed - skipping"
  22. end
  23. end
  24. desc "Force install config"
  25. task "install-force" => ["install-files","install-luapam"]
  26. desc "Install config"
  27. task :install do
  28. installed = true
  29. base = ["libs","modules","themes","widgets","rc.lua","desktop.conf"]
  30. (base+["libs/pam.so"]).each { |f|
  31. installed &= File.exist? "#{ConfigPath}/awesome/#{f}"
  32. }
  33. if installed
  34. puts "Baseline files already installed - skipping"
  35. else
  36. Rake::Task["install-force"].invoke
  37. end
  38. end
  39. desc "Build documentation"
  40. task :doc do
  41. sh "ldoc ./.ldoc.lua"
  42. end
  43. desc "Install extras"
  44. task "install-extra" do
  45. cp "./extra/udev/backlight.rules", "/etc/udev/rules.d"
  46. mkdir "#{ConfigPath}/autostart"
  47. begin
  48. sh "sudo cp /usr/share/applications/picom.desktop #{ConfigPath}/autostart/"
  49. rescue
  50. puts "picom not installed - ignoring"
  51. else
  52. cp "./extra/picom.conf", "#{ConfigPath}"
  53. end
  54. puts "Done! Reload awesome to complete installation"
  55. end
  56. desc "Uninstall from .config"
  57. task :clean do
  58. base = ["libs","modules","themes","widgets","rc.lua"]
  59. base.each { |x|
  60. rm_rf "#{ConfigPath}/awesome/"+x
  61. }
  62. end
  63. desc "Wipe configuration and reinstall from scratch"
  64. task reinstall: [:clean,:install]