Guest User

waybar-config

a guest
Aug 1st, 2022
176
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
JSON 7.35 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": ["sway/workspaces"],
  21.     "modules-center": ["custom/wf-recorder", "sway/mode", "custom/weather"],
  22.     "modules-right": [
  23.         // informational
  24.         "custom/clipboard",
  25.         "cpu",
  26.         "memory",
  27.         "battery",
  28.  
  29.         // connecting
  30.         "network",
  31.  
  32.         // media
  33.         "custom/playerctl",
  34.         "idle_inhibitor",
  35.         "pulseaudio",
  36.         "backlight",
  37.  
  38.         // system
  39.         "custom/pacman",
  40.  
  41.         "bluetooth",
  42.         "tray",
  43.         "clock"
  44.     ],
  45.  
  46.     // -------------------------------------------------------------------------
  47.     // Modules
  48.     // -------------------------------------------------------------------------
  49.  
  50.     "battery": {
  51.         "interval": 30,
  52.         "states": {
  53.             "warning": 30,
  54.             "critical": 15
  55.         },
  56.         "format-charging": " {capacity}%",
  57.         "format": "{icon} {capacity}%",
  58.         "format-icons": ["", "", "", "", "", ""],
  59.         "tooltip": true
  60.     },
  61.  
  62.     "clock": {
  63.         "interval": 5,
  64.         "format": "Week: {:%V %Y-%m-%d %H:%M:%S}",
  65.         "tooltip": true,
  66.         "tooltip-format": "<big>{:%B %Y}</big>\n<tt>{calendar}</tt>",
  67.         "on-click": "swaymsg exec \\$calendar"
  68.     },
  69.  
  70.     "cpu": {
  71.         "interval": 5,
  72.         "format": "﬙ {usage}%",
  73.         "states": {
  74.             "warning": 70,
  75.             "critical": 90
  76.         },
  77.         "on-click": "swaymsg exec \\$term_float htop"
  78.     },
  79.  
  80.     "memory": {
  81.         "interval": 5,
  82.         "format": " {}%",
  83.         "states": {
  84.             "warning": 70,
  85.             "critical": 90
  86.         },
  87.         "on-click": "swaymsg exec \\$term_float htop"
  88.     },
  89.  
  90.     "network": {
  91.         "interval": 5,
  92.         "format-wifi": " ",
  93.         "format-ethernet": "",
  94.         "format-disconnected": "睊",
  95.         "tooltip-format": "{ifname} ({essid}): {ipaddr}",
  96.         "on-click": "swaymsg exec \\$term_float nmtui"
  97.     },
  98.  
  99.     "sway/mode": {
  100.         "format": "<span style=\"italic\">{}</span>",
  101.         "tooltip": false
  102.     },
  103.  
  104.     "idle_inhibitor": {
  105.         "format": "idle: {icon}",
  106.         "format-icons": {
  107.             "activated": "零",
  108.             "deactivated": "鈴"
  109.         }
  110.     },
  111.  
  112.     "backlight": {
  113.         "format": "{icon} {percent}%",
  114.         "format-icons": ["", "", ""],
  115.         "on-scroll-up": "swaymsg exec \\$brightness_up",
  116.         "on-scroll-down": "swaymsg exec \\$brightness_down"
  117.     },
  118.  
  119.     "pulseaudio": {
  120.         "scroll-step": 5,
  121.         "format": "{icon} {volume}%{format_source}",
  122.         "format-muted": "婢 {format_source}",
  123.         "format-source": "",
  124.         "format-source-muted": " ",
  125.         "format-icons": {
  126.             "headphone": "",
  127.             "headset": "",
  128.             "default": ["奄", "奔", "墳"]
  129.         },
  130.         "tooltip-format": "{icon} {volume}% {format_source}",
  131.         "on-click": "swaymsg exec \\$pulseaudio",
  132.         "on-scroll-up": "swaymsg exec \\$volume_up",
  133.         "on-scroll-down": "swaymsg exec \\$volume_down"
  134.     },
  135.  
  136.     "temperature": {
  137.         "critical-threshold": 90,
  138.         "interval": 5,
  139.         "format": "{icon} {temperatureC}°C",
  140.         "format-icons": ["", "", ""],
  141.         "tooltip": false,
  142.         "on-click": "swaymsg exec \"\\$term_float watch sensors\""
  143.     },
  144.  
  145.     "tray": {
  146.         "icon-size": 21,
  147.         "spacing": 5
  148.     },
  149.  
  150.     "custom/pacman": {
  151.         "format": " {}",
  152.         "interval": 3600,
  153.         "exec-if": "[ $(pamac checkupdates -q | wc -l) -gt 0 ]",
  154.         "exec": "pamac checkupdates -q | wc -l",
  155.         "on-click": "pamac-manager --updates; pkill -RTMIN+4 waybar",
  156.         "signal": 4
  157.     },
  158.  
  159.     "bluetooth": {
  160.         "format": "",
  161.         "format-disabled": "",
  162.         "on-click": "blueberry",
  163.         "on-click-right": "rfkill toggle bluetooth",
  164.         "tooltip-format": "{}"
  165.     },
  166.  
  167.     "custom/playerctl": {
  168.         "interval": "once",
  169.         "tooltip": true,
  170.         "return-type": "json",
  171.         "format": "{icon}",
  172.         "format-icons": {
  173.             "Playing": "",
  174.             "Paused": "奈"
  175.         },
  176.         "exec": "playerctl metadata --format '{\"alt\": \"{{status}}\", \"tooltip\": \"{{playerName}}:  {{markup_escape(title)}} - {{markup_escape(artist)}}\" }'",
  177.         "on-click": "playerctl play-pause; pkill -RTMIN+5 waybar",
  178.         "on-click-right": "playerctl next; pkill -RTMIN+5 waybar",
  179.         "on-scroll-up": "playerctl position 10+; pkill -RTMIN+5 waybar",
  180.         "on-scroll-down": "playerctl position 10-; pkill -RTMIN+5 waybar",
  181.         "signal": 5
  182.     },
  183.  
  184.     "custom/clipboard": {
  185.         "format": "",
  186.         "interval": "once",
  187.         "return-type": "json",
  188.         "on-click": "swaymsg -q exec '$clipboard'; pkill -RTMIN+9 waybar",
  189.         "on-click-right": "swaymsg -q exec '$clipboard-del'; pkill -RTMIN+9 waybar",
  190.         "on-click-middle": "rm -f ~/.cache/cliphist/db; pkill -RTMIN+9 waybar",
  191.         "exec": "printf '{\"tooltip\":\"%s\"}' $(cliphist list | wc -l)' item(s) in the clipboard\r(Mid click to clear)'",
  192.         "exec-if": "[ -x \"$(command -v cliphist)\" ] && [ $(cliphist list | wc -l) -gt 0 ]",
  193.         "signal": 9
  194.     },
  195.  
  196.    "custom/wf-recorder": {
  197.     "format": "",
  198.     "return-type": "json",
  199.     "interval": 1,
  200.     "exec": "echo '{\"class\": \"recording\"}'",
  201.     "exec-if": "pgrep wf-recorder",
  202.         "on-click": "pkill wf-recorder"
  203.     },
  204.  
  205.     "custom/playerctl": {
  206.         "interval": "once",
  207.         "tooltip": true,
  208.         "return-type": "json",
  209.         "format": "{icon}",
  210.         "format-icons": {
  211.             "Playing": "",
  212.             "Paused": "奈"
  213.         },
  214.         "exec": "playerctl metadata --format '{\"alt\": \"{{status}}\", \"tooltip\": \"{{playerName}}:  {{markup_escape(title)}} - {{markup_escape(artist)}}\" }'",
  215.         "on-click": "playerctl play-pause; pkill -RTMIN+5 waybar",
  216.         "on-click-right": "playerctl next; pkill -RTMIN+5 waybar",
  217.         "on-scroll-up": "playerctl position 10+; pkill -RTMIN+5 waybar",
  218.         "on-scroll-down": "playerctl position 10-; pkill -RTMIN+5 waybar",
  219.         "signal": 5
  220.     },
  221.  
  222.     "custom/clipboard": {
  223.         "format": "",
  224.         "interval": "once",
  225.         "return-type": "json",
  226.         "on-click": "swaymsg -q exec '$clipboard'; pkill -RTMIN+9 waybar",
  227.         "on-click-right": "swaymsg -q exec '$clipboard-del'; pkill -RTMIN+9 waybar",
  228.         "on-click-middle": "rm -f ~/.cache/cliphist/db; pkill -RTMIN+9 waybar",
  229.         "exec": "printf '{\"tooltip\":\"%s\"}' $(cliphist list | wc -l)' item(s) in the clipboard\r(Mid click to clear)'",
  230.         "exec-if": "[ -x \"$(command -v cliphist)\" ] && [ $(cliphist list | wc -l) -gt 0 ]",
  231.         "signal": 9
  232.     }
  233.  
  234. }
  235.  
  236. }
Advertisement
Add Comment
Please, Sign In to add comment