Complete Waybar modules

This commit is contained in:
Aleksey Samoilov 2023-05-19 18:04:30 +04:00
parent b6125c2d8b
commit 41c397f190

View file

@ -5,41 +5,33 @@
"modules-left": ["custom/menu", "sway/workspaces", "sway/window"], "modules-left": ["custom/menu", "sway/workspaces", "sway/window"],
"modules-center": ["custom/wf-recorder", "sway/mode"], "modules-center": ["custom/wf-recorder", "sway/mode"],
"modules-right": [ "modules-right": [
"custom/scratchpad",
"custom/playerctl", "custom/playerctl",
"custom/wlsunset",
"idle_inhibitor", "idle_inhibitor",
"custom/dunst", "custom/dunst",
"sway/language", "sway/language",
"custom/clipboard",
"cpu", "cpu",
"memory", "memory",
"battery", "battery",
"network", "network",
"bluetooth",
"pulseaudio", "pulseaudio",
"clock", "clock",
"custom/power", "custom/power",
"tray" "tray"
], ],
"sway/workspaces": {
"disable-scroll": true,
"all-outputs": true
},
"sway/language": {
"format": " {}",
"min-length": 5,
"tooltip": false,
"on-click": "swaymsg input $(swaymsg -t get_inputs --raw | jq '[.[] | select(.type == \"keyboard\")][0] | .identifier') xkb_switch_layout next"
},
"custom/menu": { "custom/menu": {
"format": "", "format": "",
"on-click": "exec nwg-drawer", "on-click": "exec nwg-drawer",
"tooltip": false "tooltip": false
}, },
"sway/mode": { "sway/workspaces": {
"format": "<span style=\"italic\">{}</span>", "disable-scroll": true,
"tooltip": false "all-outputs": true
}, },
"sway/window": { "sway/window": {
@ -48,6 +40,68 @@
"tooltip": true "tooltip": true
}, },
"custom/wf-recorder": {
"interval": "once",
"return-type": "json",
"format": "{}",
"tooltip-format": "{tooltip}",
"exec": "echo '{\"class\": \"recording\",\"text\":\"\",\"tooltip\":\"press $mod+Esc to stop recording\"}'",
"exec-if": "pgrep wf-recorder",
"on-click": "killall -s SIGINT wf-recorder",
"signal": 8
},
"sway/mode": {
"format": "<span style=\"italic\">{}</span>",
"tooltip": false
},
"custom/scratchpad": {
"interval": "once",
"return-type": "json",
"format": "{icon}",
"format-icons": {
"one": "",
"many": ""
},
"exec": "/bin/bash /usr/share/sway/scripts/scratchpad.sh; pkill -RTMIN+7 waybar",
"on-click": "swaymsg 'scratchpad show'",
"signal": 7
},
"custom/playerctl": {
"interval": "once",
"tooltip": true,
"return-type": "json",
"format": "{icon}",
"format-icons": {
"Playing": "",
"Paused": ""
},
"exec": "playerctl metadata --format '{\"alt\": \"{{status}}\", \"tooltip\": \"{{playerName}}: {{markup_escape(title)}} - {{markup_escape(artist)}}\" }'",
"on-click": "playerctl play-pause; pkill -RTMIN+5 waybar",
"on-click-right": "playerctl next; pkill -RTMIN+5 waybar",
"on-scroll-up": "playerctl position 10+; pkill -RTMIN+5 waybar",
"on-scroll-down": "playerctl position 10-; pkill -RTMIN+5 waybar",
"signal": 5
},
"custom/wlsunset": {
"interval": "once",
"tooltip": true,
"tooltip-format": "{tooltip}",
"return-type": "json",
"format": "{icon}",
"format-icons": {
"on": "",
"off": ""
},
"exec": "fallback_latitude=50.1 fallback_longitude=8.7 latitude= longitude= /usr/share/sway/scripts/sunset.sh",
"on-click": "/usr/share/sway/scripts/sunset.sh toggle; pkill -RTMIN+6 waybar",
"exec-if": "/usr/share/sway/scripts/sunset.sh check",
"signal": 6
},
"idle_inhibitor": { "idle_inhibitor": {
"format": "{icon}", "format": "{icon}",
"format-icons": { "format-icons": {
@ -59,44 +113,29 @@
"tooltip-format-deactivated": "power-saving enabled" "tooltip-format-deactivated": "power-saving enabled"
}, },
"pulseaudio": { "custom/dunst": {
"format": "{icon} {volume}% {format_source}", "exec": "/usr/share/sway/scripts/dunst.sh",
"format-bluetooth": "{icon} {volume}%", "on-click": "dunstctl set-paused toggle",
"format-muted": " {format_source}", "restart-interval": 1,
"format-source": "  {volume}%",
"format-source-muted": "",
"format-icons": {
"headphone": "",
"headset": "",
"default": ["", "", ""]
},
"tooltip-format": "{icon} {volume}% {format_source}",
"on-click": "swaymsg exec \\$pulseaudio",
"on-click-middle": "swaymsg exec \\$volume_mute",
"on-click-right": "swaymsg exec pavucontrol",
"on-scroll-up": "swaymsg exec \\$volume_up",
"on-scroll-down": "swaymsg exec \\$volume_down"
}, },
"battery": { "sway/language": {
"format": "{icon} {capacity}%", "format": " {}",
"format-icons": ["", "", "", "", ""] "min-length": 5,
"tooltip": false,
"on-click": "swaymsg input $(swaymsg -t get_inputs --raw | jq '[.[] | select(.type == \"keyboard\")][0] | .identifier') xkb_switch_layout next"
}, },
"network": { "custom/clipboard": {
"format-wifi": " ({signalStrength}%)", "format": "",
"format-ethernet": "", "interval": "once",
"format-disconnected": "", "return-type": "json",
"tooltip-format": "{ifname} ({essid}): {ipaddr}", "on-click": "swaymsg -q exec '$clipboard'; pkill -RTMIN+9 waybar",
"on-click": "swaymsg exec \\$term_float nmtui" "on-click-right": "swaymsg -q exec '$clipboard-del'; pkill -RTMIN+9 waybar",
}, "on-click-middle": "rm -f ~/.cache/cliphist/db; pkill -RTMIN+9 waybar",
"exec": "printf '{\"tooltip\":\"%s\"}' $(cliphist list | wc -l)' item(s) in the clipboard\r(Mid click to clear)'",
"clock": { "exec-if": "[ -x \"$(command -v cliphist)\" ] && [ $(cliphist list | wc -l) -gt 0 ]",
"format": "{:%e %b %H:%M}", "signal": 9
"tooltip": true,
"tooltip-format": "{:%d.%m.%Y %H:%M}",
"interval": 5,
"on-click": "swaymsg exec \\$calendar"
}, },
"cpu": { "cpu": {
@ -120,32 +159,52 @@
}, },
"custom/wf-recorder": { "battery": {
"interval": "once", "format": "{icon} {capacity}%",
"return-type": "json", "format-icons": ["", "", "", "", ""]
"format": "{}",
"tooltip-format": "{tooltip}",
"exec": "echo '{\"class\": \"recording\",\"text\":\"\",\"tooltip\":\"press $mod+Esc to stop recording\"}'",
"exec-if": "pgrep wf-recorder",
"on-click": "killall -s SIGINT wf-recorder",
"signal": 8
}, },
"custom/playerctl": { "network": {
"interval": "once", "format-wifi": " ({signalStrength}%)",
"tooltip": true, "format-ethernet": "",
"return-type": "json", "format-disconnected": "",
"format": "{icon}", "tooltip-format": "{ifname} ({essid}): {ipaddr}",
"format-icons": { "on-click": "swaymsg exec \\$term_float nmtui"
"Playing": "",
"Paused": ""
}, },
"exec": "playerctl metadata --format '{\"alt\": \"{{status}}\", \"tooltip\": \"{{playerName}}: {{markup_escape(title)}} - {{markup_escape(artist)}}\" }'",
"on-click": "playerctl play-pause; pkill -RTMIN+5 waybar", "bluetooth": {
"on-click-right": "playerctl next; pkill -RTMIN+5 waybar", "format": "",
"on-scroll-up": "playerctl position 10+; pkill -RTMIN+5 waybar", "format-disabled": "",
"on-scroll-down": "playerctl position 10-; pkill -RTMIN+5 waybar", "on-click": "swaymsg exec \\$bluetooth",
"signal": 5 "on-click-right": "rfkill toggle bluetooth",
"tooltip-format": "{}"
},
"pulseaudio": {
"format": "{icon} {volume}% {format_source}",
"format-bluetooth": "{icon} {volume}%",
"format-muted": " {format_source}",
"format-source": "  {volume}%",
"format-source-muted": "",
"format-icons": {
"headphone": "",
"headset": "",
"default": ["", "", ""]
},
"tooltip-format": "{icon} {volume}% {format_source}",
"on-click": "swaymsg exec \\$pulseaudio",
"on-click-middle": "swaymsg exec \\$volume_mute",
"on-click-right": "swaymsg exec pavucontrol",
"on-scroll-up": "swaymsg exec \\$volume_up",
"on-scroll-down": "swaymsg exec \\$volume_down"
},
"clock": {
"format": "{:%e %b %H:%M}",
"tooltip": true,
"tooltip-format": "{:%d.%m.%Y %H:%M}",
"interval": 5,
"on-click": "swaymsg exec \\$calendar"
}, },
"custom/power": { "custom/power": {
@ -153,12 +212,6 @@
"on-click": "nwg-bar -x" "on-click": "nwg-bar -x"
}, },
"custom/dunst": {
"exec": "/usr/share/sway/scripts/dunst.sh",
"on-click": "dunstctl set-paused toggle",
"restart-interval": 1,
},
"tray": { "tray": {
"icon-size": 21, "icon-size": 21,
"spacing": 10 "spacing": 10