superproperties.lua 13 KB

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