1
0

default.nix 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136
  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=nn_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. on-click = "eww open calendar --toggle --screen $(swaymsg -t get_outputs | jq 'map(.focused) | index(true)')";
  43. };
  44. tray = {
  45. spacing = 8;
  46. };
  47. battery = {
  48. format = "{icon}";
  49. tooltip-format = "{capacity}%";
  50. format-icons = {
  51. default = [
  52. "battery_android_0"
  53. "battery_android_1"
  54. "battery_android_2"
  55. "battery_android_3"
  56. "battery_android_4"
  57. "battery_android_5"
  58. "battery_android_6"
  59. "battery_android_full"
  60. ];
  61. charging = [
  62. "battery_charging_full_2"
  63. "battery_charging_20_2"
  64. "battery_charging_30_2"
  65. "battery_charging_50_2"
  66. "battery_charging_60_2"
  67. "battery_charging_80_2"
  68. ];
  69. };
  70. };
  71. network = {
  72. format-wifi = "{icon}";
  73. format-icons = [
  74. "signal_wifi_0_bar"
  75. "network_wifi_1_bar"
  76. "network_wifi_2_bar"
  77. "network_wifi_3_bar"
  78. "network_wifi"
  79. "signal_wifi_4_bar"
  80. ];
  81. format-ethernet = "lan";
  82. format-disconnected = "signal_wifi_off";
  83. format-disabled = "flight";
  84. format-linked = "lan";
  85. tooltip-format = "{essid}\n{ipaddr}";
  86. on-click = "eww open network --toggle --screen $(swaymsg -t get_outputs | jq 'map(.focused) | index(true)')";
  87. };
  88. pulseaudio = {
  89. format = "{icon}";
  90. tooltip-format = "{volume}%";
  91. format-icons = {
  92. default = [
  93. "󰕿"
  94. "󰖀"
  95. "󰕾"
  96. ];
  97. };
  98. };
  99. mpris = {
  100. format = "{artist} - {title}";
  101. format-paused = "{artist} - {title}";
  102. max-length = 25;
  103. };
  104. bluetooth = {
  105. format = "{icon}";
  106. format-on = "bluetooth";
  107. format-off = "bluetooth_disabled";
  108. format-disabled = "bluetooth_disabled";
  109. format-connected = "bluetooth_connected";
  110. tooltip-format-connected = "{device_enumerate}";
  111. tooltip-format-enumerate-connected = "{device_alias}\t{device_address}";
  112. };
  113. "custom/cap-left" = {
  114. format = " ";
  115. tooltip = false;
  116. };
  117. "custom/cap-right" = {
  118. format = " ";
  119. tooltip = false;
  120. };
  121. };
  122. };
  123. };
  124. }