config 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197
  1. // =============================================================================
  2. //
  3. // Waybar configuration
  4. //
  5. // Configuration reference: https://github.com/Alexays/Waybar/wiki/Configuration
  6. //
  7. // =============================================================================
  8. {
  9. // -------------------------------------------------------------------------
  10. // Global configuration
  11. // -------------------------------------------------------------------------
  12. "layer": "top",
  13. "position": "top",
  14. // If height property would be not present, it'd be calculated dynamically
  15. "height": 30,
  16. "modules-left": [
  17. "sway/workspaces",
  18. "sway/mode"
  19. ],
  20. "modules-center": [
  21. "sway/window"
  22. ],
  23. "modules-right": [
  24. // @host tompot
  25. "custom/brightness",
  26. // @end
  27. "pulseaudio",
  28. "network",
  29. "memory",
  30. "cpu",
  31. "custom/keyboard-layout",
  32. "tray",
  33. // @host jellyfish
  34. "battery",
  35. // @end
  36. "clock#date",
  37. "clock#time"
  38. ],
  39. // -------------------------------------------------------------------------
  40. // Modules
  41. // -------------------------------------------------------------------------
  42. // @host tompot
  43. "custom/brightness": {
  44. "exec": "~/.config/sway/scripts/get-monitor-brightness.sh",
  45. "return-type": "json",
  46. "interval": 2,
  47. "on-click": "~/.config/sway/scripts/brightness-slider.sh",
  48. "on-scroll-up": "ddcutil setvcp --sn 6L1M413 10 + 5 && pkill -RTMIN+8 waybar",
  49. "on-scroll-down": "ddcutil setvcp --sn 6L1M413 10 - 5 && pkill -RTMIN+8 waybar",
  50. // "signal": 8,
  51. "format": "🖵 {}",
  52. "smooth-scrolling-threshold": 1
  53. },
  54. // @end
  55. "battery": {
  56. "interval": 10,
  57. "states": {
  58. "warning": 30,
  59. "critical": 15
  60. },
  61. // Connected to AC
  62. "format": " {icon} {capacity}%", // Icon: bolt
  63. // Not connected to AC
  64. "format-discharging": "{icon} {capacity}%",
  65. "format-icons": [
  66. "", // Icon: battery-full
  67. "", // Icon: battery-three-quarters
  68. "", // Icon: battery-half
  69. "", // Icon: battery-quarter
  70. "" // Icon: battery-empty
  71. ],
  72. "tooltip": true
  73. },
  74. "clock#time": {
  75. "interval": 1,
  76. "format": "{:%H:%M:%S}",
  77. "tooltip": false
  78. },
  79. "clock#date": {
  80. "interval": 10,
  81. "format": " {:%e %b %Y}", // Icon: calendar-alt
  82. "tooltip-format": "{:%e %B %Y}"
  83. },
  84. "cpu": {
  85. "interval": 5,
  86. "format": " {usage}% ({load})", // Icon: microchip
  87. "states": {
  88. "warning": 70,
  89. "critical": 90
  90. }
  91. },
  92. "custom/keyboard-layout": {
  93. "exec": "swaymsg -t get_inputs | grep -m1 'xkb_active_layout_name' | cut -d '\"' -f4",
  94. // Interval set only as a fallback, as the value is updated by signal
  95. "interval": 30,
  96. "format": " {}", // Icon: keyboard
  97. // Signal sent by Sway key binding (~/.config/sway/key-bindings)
  98. "signal": 1, // SIGHUP
  99. "tooltip": false
  100. },
  101. "memory": {
  102. "interval": 5,
  103. "format": " {}%", // Icon: memory
  104. "states": {
  105. "warning": 70,
  106. "critical": 90
  107. }
  108. },
  109. "network": {
  110. "interval": 5,
  111. "format-wifi": " {essid} ({signalStrength}%)", // Icon: wifi
  112. "format-ethernet": " {ifname}: {ipaddr}/{cidr}", // Icon: ethernet
  113. "format-disconnected": "⚠ Disconnected",
  114. "tooltip-format": "{ifname}: {ipaddr}",
  115. // @host tompot
  116. "on-click": "~/.config/waybar/scripts/iwd-connect.sh"
  117. // @end
  118. },
  119. "sway/mode": {
  120. "format": "<span style=\"italic\"> {}</span>", // Icon: expand-arrows-alt
  121. "tooltip": false
  122. },
  123. "sway/window": {
  124. "format": "{}",
  125. "max-length": 120
  126. },
  127. "sway/workspaces": {
  128. "all-outputs": false,
  129. "disable-scroll": true,
  130. "format": "{icon} {name}",
  131. "format-icons": {
  132. "1:www": "龜", // Icon: firefox-browser
  133. "2:mail": "", // Icon: mail
  134. "3:editor": "", // Icon: code
  135. "4:terminals": "", // Icon: terminal
  136. "5:portal": "", // Icon: terminal
  137. "urgent": "",
  138. "focused": "",
  139. "default": ""
  140. }
  141. },
  142. "pulseaudio": {
  143. //"scroll-step": 1,
  144. "format": "{icon} {volume}%",
  145. "format-bluetooth": "{icon} {volume}%",
  146. "format-muted": "",
  147. "format-icons": {
  148. "headphones": "",
  149. "handsfree": "",
  150. "headset": "",
  151. "phone": "",
  152. "portable": "",
  153. "car": "",
  154. "default": ["", ""]
  155. },
  156. "on-click": "pavucontrol"
  157. },
  158. "temperature": {
  159. "critical-threshold": 80,
  160. "interval": 5,
  161. "format": "{icon} {temperatureC}°C",
  162. "format-icons": [
  163. "", // Icon: temperature-empty
  164. "", // Icon: temperature-quarter
  165. "", // Icon: temperature-half
  166. "", // Icon: temperature-three-quarters
  167. "" // Icon: temperature-full
  168. ],
  169. "tooltip": true
  170. },
  171. "tray": {
  172. "icon-size": 21,
  173. "spacing": 10
  174. }
  175. }