waybar.nix 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167
  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/memory" "custom/slash" "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/memory" = {
  67. format = "<span color=\"#ACA69E\">mem:</span> {} ";
  68. exec = "~/.config/waybar/memory.sh";
  69. return-type = "json";
  70. restart-interval = 1;
  71. };
  72. "custom/lang" = {
  73. format = "<span color=\"#ACA69E\">key:</span> no";
  74. };
  75. "tray" = {
  76. icon-size = 16;
  77. spacing = 16;
  78. };
  79. };
  80. };
  81. style = ''
  82. @define-color foreground #ACA69E;
  83. @define-color foreground-inactive #ffffff;
  84. @define-color background #101010;
  85. * {
  86. font-family: JetBrainsMono Nerd Font;
  87. font-size: 12px;
  88. }
  89. #waybar {
  90. color: #ffffff;
  91. background-color: @background;
  92. }
  93. #workspaces {
  94. background: transparent;
  95. }
  96. #custom-slash,
  97. #custom-block_start,
  98. #custom-block_stop {
  99. color: #272727;
  100. }
  101. #workspaces button {
  102. min-width: 20px;
  103. padding: 0 0.6em;
  104. margin: 0 0.2em;
  105. color: @foreground-inactive;
  106. background: transparent;
  107. border: none;
  108. border-bottom: 2px solid transparent;
  109. border-radius: 0;
  110. padding: 0px;
  111. margin: 0 5px;
  112. }
  113. #workspaces button.active,
  114. #workspaces button.focused {
  115. color: #ACA69E;
  116. /*border-bottom: 2px solid @foreground;*/
  117. }
  118. #workspaces button.empty {
  119. color: #ACA69E;
  120. }
  121. #workspaces button.urgent {
  122. color: #A64443;
  123. }
  124. #workspaces button:hover {
  125. color: @foreground;
  126. }
  127. #mode {
  128. color: #A64443;
  129. }
  130. #memory,
  131. #wireplumber,
  132. #battery,
  133. #idle_inhibitor,
  134. #language,
  135. #network,
  136. #bluetooth,
  137. #tray {
  138. padding-right: 1em
  139. }
  140. '';
  141. };
  142. }