dotfiles-ansible/roles/config/templates/waybar/config_sway.j2

252 lines
4.8 KiB
Django/Jinja

[{
// ---------------------------------
// General
// ---------------------------------
"layer": "bottom",
"position": "top",
"height": 30,
"modules-left": [
"sway/mode",
"sway/workspaces",
"custom/arrow1",
"sway/window"
],
"modules-right": [
// "bluetooth",
"custom/media",
"tray",
"custom/arrow2",
"mpd",
"custom/arrow3",
"battery",
"custom/arrow4",
"pulseaudio",
"custom/arrow5",
"temperature",
"custom/arrow6",
"cpu",
"custom/arrow7",
"memory",
"custom/arrow8",
"network",
"custom/arrow9",
"custom/weather",
"custom/arrow10",
"clock#date",
"custom/arrow11",
"clock#time"
],
// ---------------------------------
// Modules
// ---------------------------------
"sway/workspaces": {
"all-outputs": false,
"disable-click": false,
"disable-scroll": true,
"disable-scroll-wraparound": true,
"enable-bar-scroll": false,
"format": "{icon}",
"format-icons": {
"1": "一",
"2": "二",
"3": "三",
"4": "四",
"5": "五",
"6": "六",
"7": "七",
"8": "八",
"9": "九",
"10": "十"
}
},
"sway/mode": {
"format": "<span style=\"italic\"> {}</span>",
"tooltip": false
},
"sway/window": {
"format": "{}",
"max-length": 30,
"tooltip": false
},
"tray": {
"icon-size": 24,
"spacing": 8
},
"bluetooth": {
"format": "{icon}",
"format-icons": {
"enabled": "",
"disabled": ""
},
"tooltip-format": "{}"
},
"custom/media": {
"exec": "sh $HOME/.config/waybar/modules/media.sh",
"interval": 2,
"tooltip": false
},
"mpd": {
"server": "{{ ansible_env.XDG_RUNTIME_DIR }}/mpd.sock",
"format": " {stateIcon}{title} - {artist}",
"format-disconnected": "󰝛 ",
"format-stopped": " ",
"unknow-tag": "N/A",
"state-icons": {
"playing": "",
"paused": " "
},
"on-scroll-up": "MPD_HOST='{{ ansible_env.XDG_RUNTIME_DIR }}/mpd.sock' mpc next",
"on-scroll-down": "MPD_HOST='{{ ansible_env.XDG_RUNTIME_DIR }}/mpd.sock' mpc prev",
"on-click": "MPD_HOST='{{ ansible_env.XDG_RUNTIME_DIR }}/mpd.sock' mpc toggle",
"on-click-right": "MPD_HOST='{{ ansible_env.XDG_RUNTIME_DIR }}/mpd.sock' mpc stop",
"interval": 2,
"tooltip": false
},
"battery": {
"states": {
"warning": 20,
"critical": 10
},
"format": " {capacity}%",
"format-discharging": "{icon} {capacity}%",
"format-icons": [
" ",
" ",
" ",
" ",
" "
],
"interval": 5,
"tooltip": false
},
"pulseaudio": {
"format": "{icon} {volume}%",
"format-muted": "󰖁 muted",
"format-bluetooth": "-{icon} {volume}%",
"format-icons": {
"headphone": "󰋋" ,
"headset": "󰋎",
"phone": "",
"default": ["󰕿", "󰖀", "󰕾"]
},
"on-click": "/usr/bin/wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle",
"on-click-right": "/usr/bin/pavucontrol-qt",
"scroll-step": 1,
"tooltip": false
},
"temperature": {
"format": " {temperatureC}°C",
{% include 'by_host/' + ansible_hostname + '/config.j2' ignore missing %}
"critical-threshold": 75,
"interval": 2,
"tooltip": false
},
"cpu": {
"format": "󰍛 {usage}%",
"states": {
"warning": 70,
"critical": 90
},
"interval": 2,
"tooltip": false
},
"memory": {
"format": "󱓞 {percentage}%",
"states": {
"warning": 70,
"critical": 90
},
"interval": 2,
"tooltip": false
},
"network": {
"format-wifi": " {essid}",
"format-ethernet": "󰌘 {ifname}",
"format-disconnected": "",
"interval": 2,
"tooltip": false
},
"custom/weather": {
"exec": "/bin/sh $HOME/.config/waybar/modules/wttr.sh",
"interval": 3600,
"tooltip": false
},
"clock#date": {
"format": "{:%a %e %b %Y}",
"locale": "C",
"interval": 10,
"tooltip": false
},
"clock#time": {
"format": "{:%H:%M}",
"locale": "C",
"interval": 10,
"tooltip": false
},
"custom/arrow1": {
"format": "",
"tooltip": false
},
"custom/arrow2": {
"format": "",
"tooltip": false
},
"custom/arrow3": {
"format": "",
"tooltip": false
},
"custom/arrow4": {
"format": "",
"tooltip": false
},
"custom/arrow5": {
"format": "",
"tooltip": false
},
"custom/arrow6": {
"format": "",
"tooltip": false
},
"custom/arrow7": {
"format": "",
"tooltip": false
},
"custom/arrow8": {
"format": "",
"tooltip": false
},
"custom/arrow9": {
"format": "",
"tooltip": false
},
"custom/arrow10": {
"format": "",
"tooltip": false
},
"custom/arrow11": {
"format": "",
"tooltip": false
}
}]