waybar.nix 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181
  1. { pkgs, lib, ... }:
  2. {
  3. imports = [
  4. ./scripts.nix
  5. ];
  6. programs.waybar = {
  7. enable = true;
  8. settings = {
  9. main = {
  10. position = "bottom";
  11. layer = "top";
  12. exclusive = "false";
  13. height = 30;
  14. spacing = 5;
  15. modules-left = [ "custom/block_start" "sway/workspaces" "mpris" "custom/block_stop" "sway/mode" ];
  16. modules-center = [ "custom/block_start" "custom/clock" "custom/block_stop" ];
  17. modules-right = [ "custom/block_start" "custom/net" "custom/slash" "custom/memory" "custom/slash" "custom/mic" "custom/volume" "custom/block_stop" "tray" ];
  18. "mpris" = {
  19. player = "spotify";
  20. format = "<span color=\"#272727\">/</span> <span color=\"#ACA69E\">mus:</span> {artist} - {title}";
  21. format-paused = "<span color=\"#272727\">/</span> <span color=\"#ACA69E\">mus:</span> {artist}";
  22. max-length = 200;
  23. };
  24. "sway/workspaces" = {
  25. format = "{icon}{name}";
  26. on-click = "activate";
  27. icon-size = 10;
  28. sort-by-number = "true";
  29. justify = "right";
  30. "format-icons" = {
  31. focused = "*";
  32. urgent = "!";
  33. default = "";
  34. };
  35. };
  36. "custom/space" = {
  37. format = " ";
  38. };
  39. "custom/slash" = {
  40. format = "/ ";
  41. };
  42. "custom/block_start" = {
  43. format = " [";
  44. };
  45. "custom/block_stop" = {
  46. format = "] ";
  47. };
  48. "custom/clock" = {
  49. format = "{}";
  50. exec = "~/.config/waybar/clock.sh";
  51. return-type = "json";
  52. restart-interval = 1;
  53. };
  54. "battery" = {
  55. bat = "BAT1";
  56. interval = 60;
  57. format = "{icon} {capacity}%";
  58. format-icons = ["\uf244" "\uf243" "\uf242" "\uf241" "\uf240"];
  59. };
  60. "custom/volume" = {
  61. format = "<span color=\"#ACA69E\">vol:</span> {} ";
  62. exec = "~/.config/waybar/volume.sh";
  63. return-type = "json";
  64. restart-interval = 0;
  65. };
  66. "custom/mic" = {
  67. format = "<span color=\"#ACA69E\">mic:</span> {} ";
  68. exec = "~/.config/waybar/mic.sh";
  69. return-type = "json";
  70. restart-interval = 0;
  71. };
  72. "custom/net" = {
  73. format = "<span color=\"#ACA69E\">net:</span> {} ";
  74. exec = "~/.config/waybar/net.sh";
  75. return-type = "json";
  76. restart-interval = 0;
  77. };
  78. "custom/memory" = {
  79. format = "<span color=\"#ACA69E\">mem:</span> {} ";
  80. exec = "~/.config/waybar/memory.sh";
  81. return-type = "json";
  82. restart-interval = 1;
  83. };
  84. "custom/lang" = {
  85. format = "<span color=\"#ACA69E\">key:</span> no";
  86. };
  87. "tray" = {
  88. icon-size = 16;
  89. spacing = 16;
  90. };
  91. };
  92. };
  93. style = ''
  94. @define-color foreground #ACA69E;
  95. @define-color foreground-inactive #ffffff;
  96. @define-color background #101010;
  97. * {
  98. font-family: JetBrainsMono Nerd Font;
  99. font-size: 12px;
  100. }
  101. #waybar {
  102. color: #ffffff;
  103. background-color: @background;
  104. }
  105. #workspaces {
  106. background: transparent;
  107. }
  108. #custom-slash,
  109. #custom-block_start,
  110. #custom-block_stop {
  111. color: #272727;
  112. }
  113. #workspaces button {
  114. min-width: 20px;
  115. padding: 0 0.6em;
  116. margin: 0 0.2em;
  117. color: @foreground-inactive;
  118. background: transparent;
  119. border: none;
  120. border-bottom: 2px solid transparent;
  121. border-radius: 0;
  122. padding: 0px;
  123. margin: 0 5px;
  124. }
  125. #workspaces button.active,
  126. #workspaces button.focused {
  127. color: #ACA69E;
  128. /*border-bottom: 2px solid @foreground;*/
  129. }
  130. #workspaces button.empty {
  131. color: #ACA69E;
  132. }
  133. #workspaces button.urgent {
  134. color: #A64443;
  135. }
  136. #workspaces button:hover {
  137. color: @foreground;
  138. }
  139. #mode {
  140. color: #A64443;
  141. }
  142. #memory,
  143. #wireplumber,
  144. #battery,
  145. #idle_inhibitor,
  146. #language,
  147. #network,
  148. #bluetooth,
  149. #tray {
  150. padding-right: 1em
  151. }
  152. '';
  153. };
  154. }