config.jsonc 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208
  1. // -*- mode: jsonc -*-
  2. {
  3. "height": 30, // Waybar height (to be removed for auto height)
  4. "spacing": 4, // Gaps between modules (4px)
  5. // Choose the order of the modules
  6. "modules-left": [
  7. "custom/appmenu",
  8. "wlr/taskbar"
  9. ],
  10. // "modules-center": [
  11. // ""
  12. // ],
  13. "modules-right": [
  14. "tray",
  15. "custom/media",
  16. "mpd",
  17. "idle_inhibitor",
  18. "pulseaudio",
  19. "network",
  20. "power-profiles-daemon",
  21. "cpu",
  22. "memory",
  23. "temperature",
  24. "backlight",
  25. "keyboard-state",
  26. "battery",
  27. "battery#bat2",
  28. "clock",
  29. "custom/power"
  30. ],
  31. // Modules configuration
  32. "keyboard-state": {
  33. "numlock": true,
  34. "capslock": true,
  35. "format": "{name} {icon}",
  36. "format-icons": {
  37. "locked": "",
  38. "unlocked": ""
  39. }
  40. },
  41. // "sway/mode": {
  42. // "format": "<span style=\"italic\">{}</span>"
  43. // },
  44. // "sway/scratchpad": {
  45. // "format": "{icon} {count}",
  46. // "show-empty": false,
  47. // "format-icons": ["", ""],
  48. // "tooltip": true,
  49. // "tooltip-format": "{app}: {title}"
  50. // },
  51. "mpd": {
  52. "format": "{stateIcon} {consumeIcon}{randomIcon}{repeatIcon}{singleIcon}{artist} - {album} - {title} ({elapsedTime:%M:%S}/{totalTime:%M:%S}) ⸨{songPosition}|{queueLength}⸩ {volume}% ",
  53. "format-disconnected": "Disconnected ",
  54. "format-stopped": "{consumeIcon}{randomIcon}{repeatIcon}{singleIcon}Stopped ",
  55. "unknown-tag": "N/A",
  56. "interval": 5,
  57. "consume-icons": {
  58. "on": " "
  59. },
  60. "random-icons": {
  61. "off": "<span color=\"#f53c3c\"></span> ",
  62. "on": " "
  63. },
  64. "repeat-icons": {
  65. "on": " "
  66. },
  67. "single-icons": {
  68. "on": "1 "
  69. },
  70. "state-icons": {
  71. "paused": "",
  72. "playing": ""
  73. },
  74. "tooltip-format": "MPD (connected)",
  75. "tooltip-format-disconnected": "MPD (disconnected)"
  76. },
  77. "idle_inhibitor": {
  78. "format": "{icon}",
  79. "format-icons": {
  80. "activated": "",
  81. "deactivated": ""
  82. }
  83. },
  84. "tray": {
  85. // "icon-size": 21,
  86. "spacing": 10
  87. },
  88. "clock": {
  89. // "timezone": "America/New_York",
  90. "tooltip-format": "<big>{:%Y %B}</big>\n<tt><small>{calendar}</small></tt>",
  91. "format-alt": "{:%Y-%m-%d}"
  92. },
  93. "cpu": {
  94. "format": "{usage}% ",
  95. "tooltip": false
  96. },
  97. "memory": {
  98. "format": "{}% "
  99. },
  100. "temperature": {
  101. // "thermal-zone": 2,
  102. // "hwmon-path": "/sys/class/hwmon/hwmon2/temp1_input",
  103. "critical-threshold": 80,
  104. // "format-critical": "{temperatureC}°C {icon}",
  105. "format": "{temperatureC}°C {icon}",
  106. "format-icons": ["", "", ""]
  107. },
  108. "backlight": {
  109. // "device": "acpi_video1",
  110. "format": "{percent}% {icon}",
  111. "format-icons": ["", "", "", "", "", "", "", "", ""]
  112. },
  113. "battery": {
  114. "states": {
  115. // "good": 95,
  116. "warning": 30,
  117. "critical": 15
  118. },
  119. "format": "{capacity}% {icon}",
  120. "format-full": "{capacity}% {icon}",
  121. "format-charging": "{capacity}% ",
  122. "format-plugged": "{capacity}% ",
  123. "format-alt": "{time} {icon}",
  124. // "format-good": "", // An empty format will hide the module
  125. // "format-full": "",
  126. "format-icons": ["", "", "", "", ""]
  127. },
  128. "battery#bat2": {
  129. "bat": "BAT2"
  130. },
  131. "power-profiles-daemon": {
  132. "format": "{icon}",
  133. "tooltip-format": "Power profile: {profile}\nDriver: {driver}",
  134. "tooltip": true,
  135. "format-icons": {
  136. "default": "",
  137. "performance": "",
  138. "balanced": "",
  139. "power-saver": ""
  140. }
  141. },
  142. "network": {
  143. // "interface": "wlp2*", // (Optional) To force the use of this interface
  144. "format-wifi": "{essid} ({signalStrength}%) ",
  145. "format-ethernet": "{ipaddr}/{cidr} ",
  146. "tooltip-format": "{ifname} via {gwaddr} ",
  147. "format-linked": "{ifname} (No IP) ",
  148. "format-disconnected": "Disconnected ⚠",
  149. "format-alt": "{ifname}: {ipaddr}/{cidr}"
  150. },
  151. "pulseaudio": {
  152. // "scroll-step": 1, // %, can be a float
  153. "format": "{volume}% {icon} {format_source}",
  154. "format-bluetooth": "{volume}% {icon} {format_source}",
  155. "format-bluetooth-muted": " {icon} {format_source}",
  156. "format-muted": " {format_source}",
  157. "format-source": "{volume}% ",
  158. "format-source-muted": "",
  159. "format-icons": {
  160. "headphone": "",
  161. "hands-free": "",
  162. "headset": "",
  163. "phone": "",
  164. "portable": "",
  165. "car": "",
  166. "default": ["", "", ""]
  167. },
  168. "on-click": "pavucontrol"
  169. },
  170. "wlr/taskbar": {
  171. "format": "{icon} {app_id}",
  172. "tooltip": true,
  173. "tooltip-format": "{title}",
  174. "on-click": "minimize-raise",
  175. },
  176. "custom/appmenu": {
  177. "format": "",
  178. "tooltip": true,
  179. "tooltip-format": "Menu",
  180. "format-icon": "󰻀",
  181. // 如果当前用户的 wofi 未运行,则运行 wofi,否则关闭 wofi
  182. "on-click": "if ! pgrep -x -u \"$USER\" \"wofi\" > /dev/null; then wofi --show=drun -i -I --location=1 --prompt=Search & else pkill -u \"$USER\" wofi; fi"
  183. },
  184. "custom/media": {
  185. "format": "{icon} {}",
  186. "return-type": "json",
  187. "max-length": 40,
  188. "format-icons": {
  189. "spotify": "",
  190. "default": "🎜"
  191. },
  192. "escape": true,
  193. "exec": "$HOME/.config/waybar/mediaplayer.py 2> /dev/null" // Script in resources folder
  194. // "exec": "$HOME/.config/waybar/mediaplayer.py --player spotify 2> /dev/null" // Filter player based on name
  195. },
  196. "custom/power": {
  197. "format" : "⏻ ",
  198. "tooltip": false,
  199. "menu": "on-click",
  200. "menu-file": "$HOME/.config/waybar/power_menu.xml", // Menu file in resources folder
  201. "menu-actions": {
  202. "shutdown": "shutdown now",
  203. "reboot": "reboot",
  204. "suspend": "systemctl suspend",
  205. "hibernate": "systemctl hibernate"
  206. }
  207. }
  208. }