superproperties.lua 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195
  1. --@author cedlemo
  2. ---Centralize theming values for blingbling widgets
  3. --Users can create a theme.blingbling table in theirs theme.lua and defines some values for theirs widgets.
  4. --@module blingbling.superproperties
  5. local beautiful = require("beautiful")
  6. local function init(path)
  7. beautiful.init(path)
  8. end
  9. local blingbling_theme= (type(beautiful.blingbling) == "table") and beautiful.blingbling or {}
  10. local tagslist_theme = blingbling_theme.tagslist or {}
  11. local tagslist_theme_normal = tagslist_theme.normal or {}
  12. local tagslist_theme_focus = tagslist_theme.focus or {}
  13. local tagslist_theme_urgent = tagslist_theme.urgent or {}
  14. local tagslist_theme_occupied = tagslist_theme.occupied or {}
  15. local calendar_theme = blingbling_theme.calendar or {}
  16. local calendar_theme_prev_next_widget_style = calendar_theme.prev_next_widget_style or {}
  17. local calendar_theme_current_date_widget_style = calendar_theme.current_date_widget_style or {}
  18. local calendar_theme_days_of_week_widget_style = calendar_theme.days_of_week_widget_style or {}
  19. local calendar_theme_days_of_month_widget_style = calendar_theme.days_of_month_widget_style or {}
  20. local calendar_theme_weeks_number_widget_style = calendar_theme.weeks_number_widget_style or {}
  21. local calendar_theme_corner_widget_style = calendar_theme.corner_widget_style or {}
  22. local calendar_theme_current_day_widget_style = calendar_theme.current_day_widget_style or {}
  23. local calendar_theme_focus_widget_style = calendar_theme.focus_widget_style or {}
  24. local calendar_theme_info_cell_style = calendar_theme.info_cell_style or {}
  25. return {
  26. h_margin = blingbling_theme.h_margin or 2 ;
  27. v_margin = blingbling_theme.v_margin or 2 ;
  28. background_border = blingbling_theme.background_border or nil ;
  29. background_color = blingbling_theme.background_color or "#00000000" ;
  30. graph_background_color = blingbling_theme.graph_background_color or "#00000066" ;
  31. graph_background_border= blingbling_theme.graph_background_border or "#00000000" ;
  32. rounded_size= blingbling_theme.rounded_size or 0 ;
  33. graph_color= blingbling_theme.graph_color or "#7fb21966" ;
  34. graph_line_color= blingbling_theme.graph_line_color or "#7fb219" ;
  35. text_color= blingbling_theme.text_color or "#ffffff" ;
  36. font_size= blingbling_theme.font_size or 9 ;
  37. font = blingbling_theme.font or "sans";
  38. value_format = blingbling_theme.value_format or "%2.f";
  39. text_background_color = blingbling_theme.text_background_color or "#00000066" ;
  40. background_text_border = blingbling_theme.background_text_border or "#ffffff";
  41. --theme values for popups module:
  42. htop_title_color = blingbling_theme.htop_title_color or "#7fb219";
  43. htop_user_color = blingbling_theme.htop_user_color or "#7fb219";
  44. htop_root_color = blingbling_theme.htop_root_color or "#000000";
  45. netstat_title_color = blingbling_theme.netstat_title_color or "#7fb219";
  46. nestat_established_color = blingbling_theme.nestat_established_color or "#7fb219";
  47. netstat_listen_color = blingbling_theme.netstat_listen_color or "#f38915";
  48. --theme values for value_text_box
  49. padding = blingbling_theme.padding or 2;
  50. menu_width = blingbling_theme.menu_width or 300;
  51. --theme values for system menus
  52. reboot = blingbling_theme.reboot or nil;
  53. shutdown = blingbling_theme.shutdown or nil;
  54. logout = blingbling_theme.logout or nil;
  55. accept = blingbling_theme.accept or nil;
  56. cancel = blingbling_theme.cancel or nil;
  57. lock = blingbling_theme.lock or nil;
  58. values_text_color = { {"#00ff00", 0},
  59. {"#0000ff", 0.5},
  60. {"#ff0000", .75}};
  61. --theme values for tagslist
  62. tagslist= {
  63. normal ={ background_color = tagslist_theme_normal.background_color or beautiful.bg_normal,
  64. text_background_color = tagslist_theme_normal.text_background_color or "#000000",
  65. text_color = tagslist_theme_normal.text_color or beautiful.fg_normal,
  66. h_margin = tagslist_theme_normal.h_margin or blingbling_theme.h_margin or 2,
  67. v_margin = tagslist_theme_normal.v_margin or blingbling_theme.v_margin or 2,
  68. rounded_size = tagslist_theme_normal.rounded_size or blingbling_theme.rounded_size or 0,
  69. font_size= tagslist_theme_normal.font_size or 9,
  70. font = tagslist_theme_normal.font or "sans"
  71. },
  72. focus = { background_color = tagslist_theme_focus.background_color or beautiful.taglist_bg_focus or beautiful.bg_focus,
  73. text_background_color = tagslist_theme_focus.text_background_color or "#000000",
  74. text_color = tagslist_theme_focus.text_color or beautiful.taglist_fg_focus or beautiful.fg_focus,
  75. h_margin = tagslist_theme_focus.h_margin or blingbling_theme.h_margin or 2 ,
  76. v_margin = tagslist_theme_focus.v_margin or blingbling_theme.v_margin or 2,
  77. rounded_size = tagslist_theme_focus.rounded_size or blingbling_theme.rounded_size or 0,
  78. font_size= tagslist_theme_focus.font_size or 9,
  79. font = tagslist_theme_focus.font or "sans"
  80. },
  81. urgent = { background_color = tagslist_theme_urgent.background_color or beautiful.taglist_bg_urgent or beautiful.bg_urgent or beautiful.taglist_bg_focus or beautiful.bg_focus,
  82. text_background_color = tagslist_theme_urgent.text_background_color or "#00000000",
  83. text_color = tagslist_theme_urgent.text_color or beautiful.taglist_fg_urgent or beautiful.fg_urgent or beautiful.taglist_fg_focus or beautiful.fg_focus,
  84. h_margin = blingbling_theme.h_margin or 2 ,
  85. v_margin = blingbling_theme.v_margin or 2,
  86. rounded_size = tagslist_theme_urgent.rounded_size or blingbling_theme.rounded_size or 0,
  87. font_size= tagslist_theme_urgent.font_size or 9,
  88. font = tagslist_theme_urgent.font or "sans"
  89. },
  90. occupied={background_color = tagslist_theme_occupied.background_color or beautiful.taglist_bg_occupied or beautiful.bg_occupied or beautiful.taglist_bg_focus or beautiful.bg_focus,
  91. text_background_color = tagslist_theme_occupied.text_background_color or "#00000000",
  92. text_color = tagslist_theme_occupied.text_color or beautiful.fg_occupied or beautiful.fg_occupied or beautiful.taglist_fg_focus or beautiful.fg_focus,
  93. h_margin = blingbling_theme.h_margin or 2 ,
  94. v_margin = blingbling_theme.v_margin or 2,
  95. rounded_size = tagslist_theme_occupied.rounded_size or blingbling_theme.rounded_size or 0,
  96. font_size= tagslist_theme_occupied.font_size or 9,
  97. font = tagslist_theme_occupied.font or "sans"
  98. }
  99. };
  100. --theme values for calendar
  101. calendar = {
  102. days_of_month_widget_style = {
  103. background_color = calendar_theme_days_of_month_widget_style.background_color or beautiful.bg_normal,
  104. text_background_color = calendar_theme_days_of_month_widget_style.text_background_color or beautiful.bg_normal,
  105. text_color = calendar_theme_days_of_month_widget_style.text_color or beautiful.fg_normal,
  106. h_margin = calendar_theme_days_of_month_widget_style.h_margin or blingbling_theme.h_margin or 2,
  107. v_margin = calendar_theme_days_of_month_widget_style.v_margin or blingbling_theme.v_margin or 2,
  108. rounded_size = calendar_theme_days_of_month_widget_style.rounded_size or blingbling_theme.rounded_size or 0,
  109. font_size= calendar_theme_days_of_month_widget_style.font_size or 9,
  110. font = calendar_theme_days_of_month_widget_style.font or "sans"
  111. },
  112. prev_next_widget_style = {
  113. background_color = calendar_theme_prev_next_widget_style.background_color or beautiful.bg_normal,
  114. text_background_color = calendar_theme_prev_next_widget_style.text_background_color or beautiful.bg_normal,
  115. text_color = calendar_theme_prev_next_widget_style.text_color or beautiful.fg_normal,
  116. h_margin = calendar_theme_prev_next_widget_style.h_margin or blingbling_theme.h_margin or 2,
  117. v_margin = calendar_theme_prev_next_widget_style.v_margin or blingbling_theme.v_margin or 2,
  118. rounded_size = calendar_theme_prev_next_widget_style.rounded_size or blingbling_theme.rounded_size or 0,
  119. font_size= calendar_theme_prev_next_widget_style.font_size or 9,
  120. font = calendar_theme_prev_next_widget_style.font or "sans"
  121. },
  122. current_date_widget_style = {
  123. background_color = calendar_theme_current_date_widget_style.background_color or beautiful.bg_normal,
  124. text_background_color = calendar_theme_current_date_widget_style.text_background_color or beautiful.bg_normal,
  125. text_color = calendar_theme_current_date_widget_style.text_color or beautiful.fg_normal,
  126. h_margin = calendar_theme_current_date_widget_style.h_margin or blingbling_theme.h_margin or 2,
  127. v_margin = calendar_theme_current_date_widget_style.v_margin or blingbling_theme.v_margin or 2,
  128. rounded_size = calendar_theme_current_date_widget_style.rounded_size or blingbling_theme.rounded_size or 0,
  129. font_size= calendar_theme_current_date_widget_style.font_size or 9,
  130. font = calendar_theme_current_date_widget_style.font or "sans"
  131. },
  132. days_of_week_widget_style = {
  133. background_color = calendar_theme_days_of_week_widget_style.background_color or beautiful.bg_normal,
  134. text_background_color = calendar_theme_days_of_week_widget_style.text_background_color or beautiful.bg_normal,
  135. text_color = calendar_theme_days_of_week_widget_style.text_color or beautiful.fg_normal,
  136. h_margin = calendar_theme_days_of_week_widget_style.h_margin or blingbling_theme.h_margin or 2,
  137. v_margin = calendar_theme_days_of_week_widget_style.v_margin or blingbling_theme.v_margin or 2,
  138. rounded_size = calendar_theme_days_of_week_widget_style.rounded_size or blingbling_theme.rounded_size or 0,
  139. font_size= calendar_theme_days_of_week_widget_style.font_size or 9,
  140. font = calendar_theme_days_of_week_widget_style.font or "sans"
  141. },
  142. weeks_number_widget_style = {
  143. background_color = calendar_theme_weeks_number_widget_style.background_color or beautiful.bg_normal,
  144. text_background_color = calendar_theme_weeks_number_widget_style.text_background_color or beautiful.bg_normal,
  145. text_color = calendar_theme_weeks_number_widget_style.text_color or beautiful.fg_normal,
  146. h_margin = calendar_theme_weeks_number_widget_style.h_margin or blingbling_theme.h_margin or 2,
  147. v_margin = calendar_theme_weeks_number_widget_style.v_margin or blingbling_theme.v_margin or 2,
  148. rounded_size = calendar_theme_weeks_number_widget_style.rounded_size or blingbling_theme.rounded_size or 0,
  149. font_size= calendar_theme_weeks_number_widget_style.font_size or 9,
  150. font = calendar_theme_weeks_number_widget_style.font or "sans"
  151. },
  152. corner_widget_style = {
  153. background_color = calendar_theme_corner_widget_style.background_color or beautiful.bg_normal,
  154. text_background_color = calendar_theme_corner_widget_style.text_background_color or beautiful.bg_normal,
  155. text_color = calendar_theme_corner_widget_style.text_color or beautiful.fg_normal,
  156. h_margin = calendar_theme_corner_widget_style.h_margin or blingbling_theme.h_margin or 2,
  157. v_margin = calendar_theme_corner_widget_style.v_margin or blingbling_theme.v_margin or 2,
  158. rounded_size = calendar_theme_corner_widget_style.rounded_size or blingbling_theme.rounded_size or 0,
  159. font_size= calendar_theme_corner_widget_style.font_size or 9,
  160. font = calendar_theme_corner_widget_style.font or "sans"
  161. },
  162. current_day_widget_style = {
  163. background_color = calendar_theme_current_day_widget_style.background_color or beautiful.bg_normal,
  164. text_background_color = calendar_theme_current_day_widget_style.text_background_color or beautiful.bg_normal,
  165. text_color = calendar_theme_current_day_widget_style.text_color or beautiful.fg_normal,
  166. h_margin = calendar_theme_current_day_widget_style.h_margin or blingbling_theme.h_margin or 2,
  167. v_margin = calendar_theme_current_day_widget_style.v_margin or blingbling_theme.v_margin or 2,
  168. rounded_size = calendar_theme_current_day_widget_style.rounded_size or blingbling_theme.rounded_size or 0,
  169. font_size= calendar_theme_current_day_widget_style.font_size or 9,
  170. font = calendar_theme_current_day_widget_style.font or "sans"
  171. },
  172. focus_widget_style = {
  173. background_color = calendar_theme_focus_widget_style.background_color or beautiful.bg_normal,
  174. text_background_color = calendar_theme_focus_widget_style.text_background_color or beautiful.bg_normal,
  175. text_color = calendar_theme_focus_widget_style.text_color or beautiful.fg_normal,
  176. h_margin = calendar_theme_focus_widget_style.h_margin or blingbling_theme.h_margin or 2,
  177. v_margin = calendar_theme_focus_widget_style.v_margin or blingbling_theme.v_margin or 2,
  178. rounded_size = calendar_theme_focus_widget_style.rounded_size or blingbling_theme.rounded_size or 0,
  179. font_size= calendar_theme_focus_widget_style.font_size or 9,
  180. font = calendar_theme_focus_widget_style.font or "sans"
  181. },
  182. info_cell_style = {
  183. background_color = calendar_theme_info_cell_style.background_color or beautiful.bg_normal,
  184. text_background_color = calendar_theme_info_cell_style.text_background_color or beautiful.bg_normal,
  185. text_color = calendar_theme_info_cell_style.text_color or beautiful.fg_normal,
  186. h_margin = calendar_theme_info_cell_style.h_margin or blingbling_theme.h_margin or 2,
  187. v_margin = calendar_theme_info_cell_style.v_margin or blingbling_theme.v_margin or 2,
  188. rounded_size = calendar_theme_info_cell_style.rounded_size or blingbling_theme.rounded_size or 0,
  189. font_size= calendar_theme_info_cell_style.font_size or 9,
  190. font = calendar_theme_info_cell_style.font or "sans"
  191. },
  192. };
  193. init = init
  194. }