config 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227
  1. {
  2. "layer": "top",
  3. "position": "top",
  4. "height": 30,
  5. "modules-left": ["custom/menu", "sway/workspaces", "sway/window"],
  6. "modules-center": ["custom/wf-recorder", "sway/mode", "clock", "battery","network","tray"],
  7. "modules-right": [
  8. "custom/wlsunset",
  9. "custom/playerctl",
  10. "custom/scratchpad",
  11. "idle_inhibitor",
  12. "sway/language",
  13. "cpu",
  14. "memory",
  15. "custom/brightness",
  16. "bluetooth",
  17. "pulseaudio",
  18. "custom/power",
  19. ],
  20. "sway/workspaces": {
  21. "disable-scroll": true,
  22. "all-outputs": true
  23. },
  24. "sway/language": {
  25. "format": " {}",
  26. "min-length": 5,
  27. "tooltip": false,
  28. "on-click": "swaymsg input $(swaymsg -t get_inputs --raw | jq '[.[] | select(.type == \"keyboard\")][0] | .identifier') xkb_switch_layout next"
  29. },
  30. "custom/menu": {
  31. "format": "",
  32. "on-click": "exec alacritty",
  33. "tooltip": false
  34. },
  35. "sway/mode": {
  36. "format": "<span style=\"italic\">{}</span>",
  37. "tooltip": false
  38. },
  39. "sway/window": {
  40. "format": "{}",
  41. "max-length": 50,
  42. "tooltip": true
  43. },
  44. "idle_inhibitor": {
  45. "format": "{icon}",
  46. "format-icons": {
  47. "activated": "",
  48. "deactivated": ""
  49. },
  50. "tooltip": true,
  51. "tooltip-format-activated": "Caffeine on",
  52. "tooltip-format-deactivated": "Caffein off"
  53. },
  54. "pulseaudio": {
  55. "format": "{icon} {volume}% {format_source}",
  56. "format-bluetooth": "{icon} {volume}%",
  57. "format-muted": " {format_source}",
  58. "format-source": "  {volume}%",
  59. "format-source-muted": "",
  60. "format-icons": {
  61. "headphone": "",
  62. "headset": "",
  63. "default": ["", "", ""]
  64. },
  65. "tooltip-format": "{icon}  {volume}% {format_source}",
  66. "on-click": "swaymsg exec \\$pavucontrol",
  67. "on-click-middle": "swaymsg exec \\$volume_mute",
  68. "on-click-right": "swaymsg exec pavucontrol",
  69. "on-scroll-up": "swaymsg exec \\$volume_up",
  70. "on-scroll-down": "swaymsg exec \\$volume_down"
  71. },
  72. "battery": {
  73. "format": "{icon} {capacity}%",
  74. "format-icons": ["", "", "", "", ""]
  75. },
  76. "custom/brightness": {
  77. "format": " {}",
  78. "exec": "light -G | cut -d '.' -f 1",
  79. "interval": 1
  80. },
  81. "network": {
  82. "format-wifi": " ({signalStrength}%)",
  83. "format-ethernet": "",
  84. "format-disconnected": "",
  85. "tooltip-format": "{ifname} ({essid}): {ipaddr}",
  86. "on-click": "swaymsg exec \\$term nmtui"
  87. },
  88. "bluetooth": {
  89. "format": "",
  90. "format-disabled": "",
  91. "on-click": "swaymsg exec \\$rofi_bluetooth",
  92. "on-click-right": "rfkill toggle bluetooth",
  93. "tooltip-format": "{}"
  94. },
  95. "clock": {
  96. "format": "{:%e %b %H:%M}",
  97. "tooltip": true,
  98. "tooltip-format": "{:%d.%m.%Y %H:%M}",
  99. "interval": 5,
  100. "on-click": "swaymsg exec \\$calendar"
  101. },
  102. "cpu": {
  103. "interval": 5,
  104. "format": "CPU {usage}%",
  105. "states": {
  106. "warning": 70,
  107. "critical": 90
  108. },
  109. "on-click": "htop"
  110. },
  111. "memory": {
  112. "interval": 30,
  113. "format": "RAM {}%",
  114. "states": {
  115. "warning": 70,
  116. "critical": 90
  117. },
  118. "on-click": "htop"
  119. },
  120. "custom/wf-recorder": {
  121. "interval": "once",
  122. "return-type": "json",
  123. "format": "{}",
  124. "tooltip-format": "{tooltip}",
  125. "exec": "echo '{\"class\": \"recording\",\"text\":\"\",\"tooltip\":\"press $mod+Esc to stop recording\"}'",
  126. "exec-if": "pgrep wf-recorder",
  127. "on-click": "killall -s SIGINT wf-recorder",
  128. "signal": 8
  129. },
  130. "custom/playerctl": {
  131. "interval": "once",
  132. "tooltip": true,
  133. "return-type": "json",
  134. "format": "{icon}",
  135. "format-icons": {
  136. "Playing": "",
  137. "Paused": ""
  138. },
  139. "exec": "playerctl metadata --format '{\"alt\": \"{{status}}\", \"tooltip\": \"{{playerName}}: {{markup_escape(title)}} - {{markup_escape(artist)}}\" }'",
  140. "on-click": "playerctl play-pause; pkill -RTMIN+5 waybar",
  141. "on-click-right": "playerctl next; pkill -RTMIN+5 waybar",
  142. "on-scroll-up": "playerctl position 10+; pkill -RTMIN+5 waybar",
  143. "on-scroll-down": "playerctl position 10-; pkill -RTMIN+5 waybar",
  144. "signal": 5
  145. },
  146. "custom/power": {
  147. "format": "",
  148. "on-click": "nwg-bar -x"
  149. },
  150. "custom/dnd": {
  151. "interval": "once",
  152. "return-type": "json",
  153. "format": "{}{icon}",
  154. "format-icons": {
  155. "default": "",
  156. "dnd": ""
  157. },
  158. "on-click": "makoctl mode | grep 'do-not-disturb' && makoctl mode -r do-not-disturb || makoctl mode -a do-not-disturb; pkill -RTMIN+11 waybar",
  159. "exec": "printf '{\"alt\":\"%s\",\"tooltip\":\"Notification mode: %s\"}' $(makoctl mode | grep -q 'do-not-disturb' && echo dnd || echo default) $(makoctl mode | tail -1)",
  160. "signal": 11
  161. },
  162. "custom/wlsunset": {
  163. "interval": "once",
  164. "tooltip": true,
  165. "tooltip-format": "{tooltip}",
  166. "return-type": "json",
  167. "format": "{icon}",
  168. "format-icons": {
  169. "on": "",
  170. "off": ""
  171. },
  172. "exec": "fallback_latitude=50.1 fallback_longitude=8.7 latitude= longitude= /usr/share/sway/scripts/sunset.sh",
  173. "on-click": "/usr/share/sway/scripts/sunset.sh toggle; pkill -RTMIN+6 waybar",
  174. "exec-if": "/usr/share/sway/scripts/sunset.sh check",
  175. "signal": 6
  176. },
  177. "custom/scratchpad": {
  178. "interval": "once",
  179. "return-type": "json",
  180. "format": "{icon}",
  181. "format-icons": {
  182. "one": "",
  183. "many": ""
  184. },
  185. "exec": "/home/platon/.config/sway/scripts/scratchpad.sh; pkill -RTMIN+7 waybar",
  186. "on-click": "swaymsg 'scratchpad show'",
  187. "signal": 7
  188. },
  189. "tray": {
  190. "icon-size": 21,
  191. "spacing": 10
  192. }
  193. },