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.

81 lines
2.0 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. if Process.euid != 0
  46. raise Exception, "You need to be root to install extras"
  47. end
  48. cp "./extra/udev/backlight.rules", "/etc/udev/rules.d"
  49. mkdir "#{ConfigPath}/autostart"
  50. begin
  51. cp "/usr/share/applications/picom.desktop", "#{ConfigPath}/autostart/"
  52. rescue
  53. puts "picom not installed - ignoring"
  54. else
  55. cp "./extra/picom.conf", "#{ConfigPath}"
  56. end
  57. puts "Done! Reload awesome to complete installation"
  58. end
  59. desc "Uninstall from .config"
  60. task :clean do
  61. rm_rf "#{ConfigPath}/awesome"
  62. end
  63. desc "Install dependencies for code cleaner"
  64. task "install-janitor-deps" do
  65. if Process.euid != 0
  66. raise Exception, "You need to be root to install gems"
  67. end
  68. Gem.install "language_server-protocol"
  69. end
  70. desc "Wipe configuration and reinstall from scratch"
  71. task reinstall: [:clean,:install]