Advertisement
Guest User

Untitled

a guest
Sep 16th, 2021
313
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.57 KB | None | 0 0
  1. // =============================================================================
  2. //
  3. // Waybar configuration
  4. //
  5. // Configuration reference: https://github.com/Alexays/Waybar/wiki/Configuration
  6. //
  7. // =============================================================================
  8.  
  9. {
  10. // -------------------------------------------------------------------------
  11. // Global configuration
  12. // -------------------------------------------------------------------------
  13.  
  14. "layer": "top",
  15.  
  16. // If height property would be not present, it'd be calculated dynamically
  17. "height": 30,
  18. "position": "bottom",
  19.  
  20. "modules-left": [
  21. "custom/menu",
  22. "sway/workspaces",
  23. "custom/scratchpad"
  24. ],
  25. "modules-center": [
  26. "custom/wf-recorder",
  27. "sway/mode"
  28. ],
  29. "modules-right": [
  30. // informational
  31. // "sway/language",
  32.  
  33. "custom/weather",
  34. "custom/github",
  35. "cpu",
  36. "memory",
  37. "battery",
  38. "temperature",
  39.  
  40. // connecting
  41. "network",
  42. "bluetooth",
  43.  
  44. // media
  45. "custom/playerctl",
  46. "idle_inhibitor",
  47. "pulseaudio",
  48. "backlight",
  49.  
  50. // system
  51. "custom/sunset",
  52. "custom/pacman",
  53.  
  54. "tray",
  55. "clock"
  56. ],
  57.  
  58. // -------------------------------------------------------------------------
  59. // Modules
  60. // -------------------------------------------------------------------------
  61.  
  62. "battery": {
  63. "interval": 30,
  64. "states": {
  65. "warning": 30,
  66. "critical": 15
  67. },
  68. "format-charging": " {capacity}%",
  69. "format": "{icon} {capacity}%",
  70. "format-icons": ["","","","","",""],
  71. "tooltip": true,
  72. "bat": "BAT0"
  73. },
  74.  
  75. "clock": {
  76. "interval": 60,
  77. "format": "{:%e %b %Y %H:%M}",
  78. "tooltip": true,
  79. "tooltip-format": "<big>{:%B %Y}</big>\n<tt>{calendar}</tt>",
  80. "on-click": "swaymsg exec \\$calendar"
  81. },
  82.  
  83. "cpu": {
  84. "interval": 5,
  85. "format": "﬙ {usage}%",
  86. "states": {
  87. "warning": 70,
  88. "critical": 90
  89. },
  90. "on-click": "swaymsg exec \\$term_float htop"
  91. },
  92.  
  93. "memory": {
  94. "interval": 5,
  95. "format": " {}%",
  96. "states": {
  97. "warning": 70,
  98. "critical": 90
  99. },
  100. "on-click": "swaymsg exec \\$term_float htop"
  101. },
  102.  
  103. "network": {
  104. "interval": 5,
  105. "format-wifi": " ",
  106. "format-ethernet": "",
  107. "format-disconnected": "睊",
  108. "tooltip-format": "{ifname} ({essid}): {ipaddr}",
  109. "on-click": "swaymsg exec \\$term_float nmtui"
  110. },
  111.  
  112. "sway/mode": {
  113. "format": "<span style=\"italic\">{}</span>",
  114. "tooltip": false
  115. },
  116.  
  117. "idle_inhibitor": {
  118. "format": "{icon}",
  119. "format-icons": {
  120. "activated": "零",
  121. "deactivated": "鈴"
  122. }
  123. },
  124.  
  125. "backlight": {
  126. "format": "{icon} {percent}%",
  127. "format-icons": ["", "", ""],
  128. "on-scroll-up": "light -A 1",
  129. "on-scroll-down": "light -U 1"
  130. },
  131.  
  132. "pulseaudio": {
  133. "scroll-step": 5,
  134. "format": "{icon} {volume}%{format_source}",
  135. "format-muted": "婢 {format_source}",
  136. "format-source": "",
  137. "format-source-muted": " ",
  138. "format-icons": {
  139. "headphone": "",
  140. "headset": "",
  141. "default": ["奄", "奔", "墳"]
  142. },
  143. "tooltip-format": "{icon} {volume}% {format_source}",
  144. "on-click": "swaymsg exec \\$pulseaudio"
  145. },
  146.  
  147. "temperature": {
  148. "critical-threshold": 90,
  149. "interval": 5,
  150. "format": "{icon} {temperatureC}°C",
  151. "format-icons": ["","",""],
  152. "tooltip": false,
  153. "on-click": "swaymsg exec \"\\$term_float watch sensors\""
  154. },
  155.  
  156. "tray": {
  157. "icon-size": 21,
  158. "spacing": 5
  159. },
  160.  
  161. "custom/pacman": {
  162. "format": " {}",
  163. "interval": 3600,
  164. "exec-if": "[ $(pamac checkupdates -q | wc -l) -gt 0 ]",
  165. "exec": "pamac checkupdates -q | wc -l",
  166. "on-click": "pamac-manager --updates; pkill -RTMIN+4 waybar",
  167. "signal": 4
  168. },
  169.  
  170. "custom/menu": {
  171. "format": "",
  172. "on-click": "swaymsg exec \\$menu",
  173. "tooltip": false
  174. },
  175.  
  176. "bluetooth": {
  177. "format": "{icon}",
  178. "interval": 30,
  179. "format-icons": {
  180. "enabled": "",
  181. "disabled": ""
  182. },
  183. "on-click": "blueberry",
  184. "tooltip-format": "{}"
  185. },
  186.  
  187. "sway/language": {
  188. "format": " {}",
  189. "min-length": 5,
  190. "tooltip": false,
  191. "on-click": "swaymsg input $(swaymsg -t get_inputs --raw | jq '[.[] | select(.type == \"keyboard\")][0] | .identifier') xkb_switch_layout next"
  192. },
  193.  
  194. "custom/scratchpad": {
  195. "interval": "once",
  196. "return-type": "json",
  197. "format" : "{icon}",
  198. "format-icons": {
  199. "one": "类",
  200. "many": "缾"
  201. },
  202. "exec": "/bin/sh /usr/share/sway/scripts/scratchpad.sh",
  203. "on-click": "swaymsg 'scratchpad show'",
  204. "signal": 7
  205. },
  206.  
  207. "custom/sunset": {
  208. "interval": "once",
  209. "tooltip": false,
  210. "return-type": "json",
  211. "format" : "{icon}",
  212. "format-icons": {
  213. "on": "" ,
  214. "off": ""
  215. },
  216. "exec": "/usr/share/sway/scripts/sunset.sh",
  217. "on-click": "/usr/share/sway/scripts/sunset.sh toggle; pkill -RTMIN+6 waybar",
  218. "exec-if": "/usr/share/sway/scripts/sunset.sh check",
  219. "signal": 6
  220. },
  221.  
  222. "custom/wf-recorder": {
  223. "interval": "once",
  224. "return-type": "json",
  225. "format" : "{}",
  226. "tooltip-format": "{tooltip}",
  227. "exec": "echo '{\"class\": \"recording\",\"text\":\"雷\",\"tooltip\":\"press $mod+Esc to stop recording\"}'",
  228. "exec-if": "pgrep wf-recorder",
  229. "on-click": "killall -s SIGINT wf-recorder",
  230. "signal": 8
  231. },
  232.  
  233. "custom/github": {
  234. "interval": 300,
  235. "tooltip": false,
  236. "return-type": "json",
  237. "format" : " {}",
  238. "exec": "gh api '/notifications' -q '{ text: length }' | cat -",
  239. "exec-if": "command -v gh >/dev/null && gh auth status 2>&1 | grep -q -m 1 'Logged in' && gh api '/notifications' -q 'length' | grep -q -m 1 '0' ; test $? -eq 1",
  240. "on-click": "xdg-open https://github.com/notifications && sleep 30 && pkill -RTMIN+4 waybar",
  241. "signal": 4
  242. },
  243.  
  244. "custom/playerctl": {
  245. "interval": "once",
  246. "tooltip": true,
  247. "return-type": "json",
  248. "format" : "{icon}",
  249. "format-icons": {
  250. "Playing": "奈",
  251. "Paused": ""
  252. },
  253. "exec": "playerctl metadata --format '{\"alt\": \"{{status}}\", \"tooltip\": \"{{playerName}}: {{markup_escape(title)}} - {{markup_escape(artist)}}\" }'",
  254. "on-click": "playerctl play-pause; pkill -RTMIN+5 waybar",
  255. "on-click-right": "playerctl next; pkill -RTMIN+5 waybar",
  256. "on-scroll-up": "playerctl position 10+; pkill -RTMIN+5 waybar",
  257. "on-scroll-down": "playerctl position 10-; pkill -RTMIN+5 waybar",
  258. "signal": 5
  259. },
  260.  
  261. "custom/weather": {
  262. "format": "{}",
  263. "tooltip": true,
  264. "interval": 2,
  265. "exec": "waybar-wttr.py",
  266. "return-type": "json"
  267. }
  268. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement