1
0

default.nix 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134
  1. { pkgs, lib, ... }:
  2. {
  3. imports = [
  4. ./style.nix
  5. ];
  6. programs.waybar = {
  7. enable = true;
  8. settings = {
  9. main = {
  10. layer = "top";
  11. position = "bottom";
  12. height = 16;
  13. spacing = 0;
  14. modules-left = [
  15. "sway/workspaces"
  16. "sway/mode"
  17. "mpris"
  18. ];
  19. modules-center = [
  20. "custom/clock"
  21. ];
  22. modules-right = [
  23. "tray"
  24. "custom/cap-left"
  25. "pulseaudio"
  26. "bluetooth"
  27. "network"
  28. "battery"
  29. "custom/cap-right"
  30. ];
  31. "sway/mode" = {
  32. format = "transform";
  33. };
  34. "custom/clock" = {
  35. format = "{}";
  36. exec = ''
  37. formatted_date=$(LC_TIME=nb_NO.UTF-8 date +"%H:%M %A, %d %b" | tr '[:upper:]' '[:lower:]' | sed 's/\.//g')
  38. printf '{"text": "%s"}\n' "$formatted_date"
  39. '';
  40. return-type = "json";
  41. restart-interval = 1;
  42. };
  43. tray = {
  44. spacing = 8;
  45. };
  46. battery = {
  47. format = "{icon}";
  48. tooltip-format = "{capacity}%";
  49. format-icons = {
  50. default = [
  51. "battery_android_0"
  52. "battery_android_1"
  53. "battery_android_2"
  54. "battery_android_3"
  55. "battery_android_4"
  56. "battery_android_5"
  57. "battery_android_6"
  58. "battery_android_full"
  59. ];
  60. charging = [
  61. "battery_charging_full_2"
  62. "battery_charging_20_2"
  63. "battery_charging_30_2"
  64. "battery_charging_50_2"
  65. "battery_charging_60_2"
  66. "battery_charging_80_2"
  67. ];
  68. };
  69. };
  70. network = {
  71. format-wifi = "{icon}";
  72. format-icons = [
  73. "signal_wifi_0_bar"
  74. "network_wifi_1_bar"
  75. "network_wifi_2_bar"
  76. "network_wifi_3_bar"
  77. "network_wifi"
  78. "signal_wifi_4_bar"
  79. ];
  80. format-ethernet = "lan";
  81. format-disconnected = "signal_wifi_off";
  82. format-disabled = "signal_wifi_off";
  83. tooltip-format = "{essid}\n{ipaddr}";
  84. on-click = "eww open --toggle network";
  85. };
  86. pulseaudio = {
  87. format = "{icon}";
  88. tooltip-format = "{volume}%";
  89. format-icons = {
  90. default = [
  91. "󰕿"
  92. "󰖀"
  93. "󰕾"
  94. ];
  95. };
  96. };
  97. mpris = {
  98. format = "{artist} - {title}";
  99. format-paused = "{artist} - {title}";
  100. max-length = 25;
  101. };
  102. bluetooth = {
  103. format = "{icon}";
  104. format-on = "bluetooth";
  105. format-off = "bluetooth_disabled";
  106. format-disabled = "bluetooth_disabled";
  107. format-connected = "bluetooth_connected";
  108. tooltip-format-connected = "{device_enumerate}";
  109. tooltip-format-enumerate-connected = "{device_alias}\t{device_address}";
  110. };
  111. "custom/cap-left" = {
  112. format = " ";
  113. tooltip = false;
  114. };
  115. "custom/cap-right" = {
  116. format = " ";
  117. tooltip = false;
  118. };
  119. };
  120. };
  121. };
  122. }