config 5.5 KB

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