Guest User

Untitled

a guest
Mar 15th, 2018
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.29 KB | None | 0 0
  1. import "/home/gig/.passwords.rb" # GMAIL_PWD in there
  2.  
  3. awesome {
  4.  
  5. set :statusbar => "top"
  6. set :screen => 0
  7.  
  8. widget("battery") {
  9.  
  10. set :module => :battery
  11.  
  12. property("text") {
  13.  
  14. case @state
  15. when :charged
  16. text "=#{@percentage.to_i}="
  17. when :charging
  18. text "^#{@percentage.to_i}^"
  19. when :discharging
  20. text "v#{@percentage.to_i}v"
  21. end
  22.  
  23. }
  24.  
  25. property("fg") {
  26.  
  27. if @percentage.to_i <= 25
  28. "#ff5656"
  29. else
  30. "#ffffff"
  31. end
  32.  
  33. }
  34. }
  35.  
  36. widget("mpd") {
  37.  
  38. set :module => :mpd
  39. set :interval => 1
  40.  
  41. property("text") {
  42.  
  43. case @state
  44. when :playing
  45. text ">>: #@artist - #@title (#@position/#@length)"
  46. when :paused
  47. text "||: #@artist - #@title (#@position/#@length)"
  48. when :stopped
  49. text "[]: not playing"
  50. end
  51.  
  52. }
  53. }
  54.  
  55. widget("mail") {
  56.  
  57. set :module => :gmail
  58. set :interval => 300
  59. set :username => "gigamo"
  60. set :password => GMAIL_PWD
  61.  
  62. property("text") {
  63.  
  64. "#@count"
  65.  
  66. }
  67.  
  68. property("fg") {
  69.  
  70. if @count > 0
  71. "#ff5656"
  72. else
  73. "#ffffff"
  74. end
  75.  
  76. }
  77. }
  78.  
  79. widget("pacman") {
  80.  
  81. set :module => :pacman
  82. set :interval => 3600
  83.  
  84. property("text") {
  85.  
  86. "@count"
  87.  
  88. }
  89.  
  90. property("fg") {
  91.  
  92. if @count > 0
  93. "#ff5656"
  94. else
  95. "#ffffff"
  96. end
  97.  
  98. }
  99. }
  100.  
  101. widget("clock") {
  102.  
  103. set :module => :clock
  104. set :interval => 1
  105. set :time_format => "%H:%M:%S %d.%m.%Y"
  106.  
  107. property("text") {
  108.  
  109. "#@time"
  110.  
  111. }
  112. }
  113.  
  114. widget("cpu_usage") {
  115.  
  116. set :module => :cpu_usage
  117. set :interval => 3
  118.  
  119. property("text") {
  120.  
  121. "#@usage[1]%/#@usage[2]%"
  122.  
  123. }
  124.  
  125. property("fg") {
  126.  
  127. if @usage[0] >= 75
  128. "#ff5656"
  129. else
  130. "#ffffff"
  131. end
  132.  
  133. }
  134. }
  135.  
  136. widget("cpu_freq") {
  137.  
  138. set :module => :cpu_info
  139. set :interval => 3
  140.  
  141. property ("text") {
  142.  
  143. if @speed[0] >= 1000
  144. ghz = @speed[0] / 1000
  145. "@ %3.2fGHz" % ghz
  146. else
  147. "@ #{@speed[0]}MHz"
  148. end
  149.  
  150. }
  151.  
  152. property("fg") {
  153.  
  154. if @speed[0] >= 1000
  155. "#ff5656"
  156. else
  157. "#ffffff"
  158. end
  159.  
  160. }
  161. }
  162.  
  163. }
Add Comment
Please, Sign In to add comment