waybar.nix 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223
  1. { pkgs, lib, ... }:
  2. {
  3. programs.waybar = {
  4. enable = true;
  5. settings = {
  6. main = {
  7. layer = "top";
  8. position = "bottom";
  9. height = 16;
  10. spacing = 0;
  11. modules-left = [
  12. "sway/workspaces"
  13. "mpris"
  14. ];
  15. modules-center = [
  16. "custom/clock"
  17. ];
  18. modules-right = [
  19. "tray"
  20. "custom/cap-left"
  21. "pulseaudio"
  22. "bluetooth"
  23. "network"
  24. "battery"
  25. "custom/cap-right"
  26. ];
  27. "custom/clock" = {
  28. format = "{}";
  29. exec = "~/.config/waybar/clock.sh";
  30. return-type = "json";
  31. restart-interval = 1;
  32. };
  33. tray = {
  34. spacing = 8;
  35. };
  36. battery = {
  37. format = "{icon}";
  38. tooltip-format = "{capacity}%";
  39. format-icons = [
  40. "󰁺"
  41. "󰁻"
  42. "󰁼"
  43. "󰁽"
  44. "󰁾"
  45. "󰁿"
  46. "󰂀"
  47. "󰂁"
  48. "󰂂"
  49. "󰁹"
  50. ];
  51. };
  52. network = {
  53. format-wifi = "{icon}";
  54. format-icons = [
  55. "󰤯"
  56. "󰤟"
  57. "󰤢"
  58. "󰤥"
  59. "󰤨"
  60. ];
  61. format-ethernet = "󰈀";
  62. format-disconnected = "󰖪";
  63. tooltip-format = "{essid}\n{ipaddr}";
  64. };
  65. pulseaudio = {
  66. format = "{icon}";
  67. tooltip-format = "{volume}%";
  68. format-icons = {
  69. default = [
  70. "󰕿"
  71. "󰖀"
  72. "󰕾"
  73. ];
  74. };
  75. };
  76. mpris = {
  77. format = "{artist} - {title}";
  78. format-paused = "{artist} - {title}";
  79. max-length = 25;
  80. };
  81. bluetooth = {
  82. format-on = "󰂯";
  83. format-off = "󰂲";
  84. format-disabled = "";
  85. format-connected = "󰂱 {num_connections}";
  86. tooltip-format-connected = "{device_enumerate}";
  87. tooltip-format-enumerate-connected = "{device_alias}\t{device_address}";
  88. };
  89. "custom/cap-left" = {
  90. format = " ";
  91. tooltip = false;
  92. };
  93. "custom/cap-right" = {
  94. format = " ";
  95. tooltip = false;
  96. };
  97. };
  98. };
  99. style = ''
  100. * {
  101. border: none;
  102. font-family: "JetBrainsMono Nerd Font", "Material Symbols Rounded";
  103. font-size: 12px;
  104. font-weight: 700;
  105. }
  106. window#waybar {
  107. /*background: rgb(26,28,23);*/
  108. background: rgb(10,1,1);
  109. border-radius: 0px;
  110. }
  111. #custom-clock,
  112. #tray,
  113. #mpris,
  114. #workspaces,
  115. #workspace button {
  116. background: rgb(15,2,2);
  117. color: #e6e1e5;
  118. min-width: 12px;
  119. min-height: 12px;
  120. padding: 0 6px;
  121. margin: 2px 2px;
  122. border-radius: 10px;
  123. border: 1px solid rgba(255,255,255,0.08);
  124. transition: all 0.2s ease;
  125. }
  126. #workspaces {
  127. padding: 0;
  128. }
  129. #workspaces button label {
  130. padding: 0;
  131. margin: 0;
  132. }
  133. #workspaces button.active,
  134. #workspaces button.focused {
  135. background: rgba(57, 150, 181, 0.1);
  136. color: white;
  137. }
  138. #workspaces button:hover {
  139. background: rgba(255,255,255,0.08);
  140. }
  141. #mpris.playing {
  142. background: rgba(57, 150, 181, 0.1);
  143. }
  144. #mpris.spotify.playing {
  145. background: rgba(29,185,84,0.1);
  146. }
  147. #mpris.firefox.playing {
  148. background: rgba(255,102,42,0.1);
  149. }
  150. #pulseaudio,
  151. #network,
  152. #bluetooth,
  153. #battery,
  154. #custom-taskmgr {
  155. font-family: "Material Symbols Rounded";
  156. background: rgb(15,2,2);
  157. color: #e6e1e5;
  158. font-weight: 600;
  159. padding: 0 6px;
  160. margin: 2px 0;
  161. border-radius: 0;
  162. border-top: 1px solid rgba(255,255,255,0.08);
  163. border-bottom: 1px solid rgba(255,255,255,0.08);
  164. }
  165. #pulseaudio {
  166. font-size: 18px;
  167. }
  168. #bluetooth,
  169. #network {
  170. font-size: 14px;
  171. }
  172. #custom-cap-left {
  173. background: rgb(15,2,2);
  174. margin: 2px 0 2px 2px;
  175. border-radius: 12px 0 0 12px;
  176. padding: 0 1px;
  177. border: 1px solid rgba(255,255,255,0.08);
  178. border-right: none;
  179. }
  180. #custom-cap-right {
  181. background: rgb(15,2,2);
  182. margin: 2px 2px 2px 0;
  183. border-radius: 0 12px 12px 0;
  184. padding: 0 3px;
  185. border: 1px solid rgba(255,255,255,0.08);
  186. border-left: none;
  187. }
  188. '';
  189. };
  190. }