Dotfiles/waybar/config.jsonc
2024-05-02 15:28:36 +02:00

351 lines
11 KiB
JSON
Raw Permalink Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

// =============================================================================
//
// Waybar configuration
//
// Configuration reference: https://github.com/Alexays/Waybar/wiki/Configuration
//
// =============================================================================
{
// -------------------------------------------------------------------------
// Global configuration
// -------------------------------------------------------------------------
"layer": "top",
// If height property would be not present, it'd be calculated dynamically
"height": 30,
"position": "top",
"modules-left": [
"custom/menu",
"sway/workspaces",
"custom/scratchpad"
],
"modules-center": [
"custom/wf-recorder",
"sway/mode",
"custom/weather"
],
"modules-right": [
// "custom/playerctl",
// informational
"sway/language",
"custom/clipboard",
"cpu",
"memory",
"temperature",
"battery",
// connecting
"custom/wireguard",
"network",
"bluetooth",
// media
"idle_inhibitor",
"custom/dnd",
"pulseaudio",
"backlight",
// system
"custom/adaptive-light",
"custom/sunset",
"custom/pacman",
"tray",
"clock"
],
// -------------------------------------------------------------------------
// Modules
// -------------------------------------------------------------------------
"battery": {
"interval": 30,
"states": {
"warning": 30,
"critical": 15
},
"format-charging": "󰂄 {capacity}%",
"format": "{icon} {capacity}%",
"format-icons": ["󱃍", "󰁺", "󰁼", "󰁽", "󰁾", "󰁿", "󰂀", "󰂁", "󰂂", "󰁹"],
"tooltip": true
},
"clock": {
"interval": 60,
"format": "{:%e %b %Y %H:%M}",
"tooltip": true,
"tooltip-format": "<big>{:%B %Y}</big>\n<tt>{calendar}</tt>",
"on-click": "swaymsg exec \\$calendar"
},
"cpu": {
"interval": 10,
"format": "󰘚 {usage}%",
"states": {
"warning": 70,
"critical": 90
},
"on-click": "swaymsg exec \\$once \\$term_float htop",
"tooltip": true
},
"memory": {
"interval": 10,
"format": "󰍛 {}%",
"states": {
"warning": 70,
"critical": 90
},
"on-click": "swaymsg exec \\$once \\$term_float htop",
"tooltip": true
},
"network": {
"interval": 5,
"format-wifi": " ",
"format-ethernet": "󰈀",
"format-disconnected": "󰖪",
"tooltip-format": "{icon} {ifname}: {ipaddr}",
"tooltip-format-ethernet": "{icon} {ifname}: {ipaddr}",
"tooltip-format-wifi": "{icon} {ifname} ({essid}): {ipaddr}",
"tooltip-format-disconnected": "{icon} disconnected",
"tooltip-format-disabled": "{icon} disabled",
"on-click": "swaymsg exec \\$once \\$term_float nmtui connect"
},
"sway/mode": {
"format": "<span style=\"italic\">{}</span>",
"tooltip": false
},
"idle_inhibitor": {
"format": "{icon}",
"format-icons": {
"activated": "󰒳",
"deactivated": "󰒲"
},
"tooltip": true,
"tooltip-format-activated": "power-saving disabled",
"tooltip-format-deactivated": "power-saving enabled"
},
"backlight": {
"format": "{icon} {percent}%",
"format-icons": ["󰃞", "󰃟", "󰃠"],
"on-scroll-up": "swaymsg exec \\$brightness_up",
"on-scroll-down": "swaymsg exec \\$brightness_down"
},
"pulseaudio": {
"scroll-step": 5,
"format": "{icon} {volume}%{format_source}",
"format-muted": "󰖁 {format_source}",
"format-source": "",
"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-scroll-up": "swaymsg exec \\$volume_up",
"on-scroll-down": "swaymsg exec \\$volume_down"
},
"temperature": {
"critical-threshold": 90,
"interval": 5,
"format": "{icon} {temperatureC}°C",
"tooltip-format": "{temperatureC}°C",
"format-icons": ["", "", ""],
"tooltip": true,
"on-click": "swaymsg exec \"\\$once \\$term_float watch sensors\""
},
"tray": {
"icon-size": 21,
"spacing": 5
},
"custom/pacman": {
"format": "󰀼 {}",
"interval": 3600,
"exec-if": "[ $(pamac checkupdates -q | wc -l) -gt 0 ]",
"exec": "pamac checkupdates -q | wc -l",
"on-click": "pamac-manager --updates; pkill -RTMIN+4 waybar",
"signal": 4
},
"custom/menu": {
"format": "",
"on-click": "swaymsg exec \\$menu",
"tooltip": false
},
"bluetooth": {
"format": "󰂯",
"format-disabled": "󰂲",
"on-click": "swaymsg exec \\$bluetooth",
"on-click-right": "rfkill toggle bluetooth",
"tooltip-format": "{}"
},
"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/scratchpad": {
"interval": "once",
"return-type": "json",
"format": "{icon}",
"format-icons": {
"one": "󰖯",
"many": "󰖲"
},
"exec": "/bin/sh /usr/share/sway/scripts/scratchpad.sh",
"on-click": "swaymsg 'scratchpad show'",
"signal": 7
},
"custom/sunset": {
"interval": "once",
"tooltip": true,
"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
},
"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
},
"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 -p spotify play-pause; pkill -RTMIN+5 waybar",
"on-click-right": "playerctl -p spotify next; pkill -RTMIN+5 waybar",
"on-scroll-up": "playerctl -p spotify position 10+; pkill -RTMIN+5 waybar",
"on-scroll-down": "playerctl -p spotify position 10-; pkill -RTMIN+5 waybar",
"signal": 5
},
"custom/clipboard": {
"format": "󰨸",
"interval": "once",
"return-type": "json",
"on-click": "swaymsg -q exec '$clipboard'; pkill -RTMIN+9 waybar",
"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)'",
"exec-if": "[ -x \"$(command -v cliphist)\" ] && [ $(cliphist list | wc -l) -gt 0 ]",
"signal": 9
},
"custom/weather": {
"icon-size": 42,
"format": "{icon} {}",
"tooltip": true,
"interval": 3600,
// accepts -c/--city <city> -t/--temperature <C/F> -d/--distance <km/miles>
"exec": "/usr/share/sway/scripts/weather.py",
"return-type": "json",
"format-icons": {
"Unknown": "",
"Cloudy": "󰖐",
"Fog": "",
"HeavyRain": "",
"HeavyShowers": "",
"HeavySnow": "",
"HeavySnowShowers": "󰜗",
"LightRain": "",
"LightShowers": "",
"LightSleet": "",
"LightSleetShowers": "",
"LightSnow": "",
"LightSnowShowers": "󰙿",
"PartlyCloudy": "",
"Sunny": "",
"ThunderyHeavyRain": "󰙾",
"ThunderyShowers": "",
"ThunderySnowShowers": "",
"VeryCloudy": ""
}
},
// curently not in use
"custom/spotify": {
"exec": "/usr/bin/python3 /home/nikhil/Dotfiles/waybar/custom_modules/mediaplayer.py --player spotify",
"format": "{} ",
"return-type": "json",
"on-click": "playerctl play-pause",
"on-click-right": "playerctl next",
"on-click-middle": "playerctl previous"
},
"custom/dnd": {
"interval": "once",
"return-type": "json",
"format": "{}{icon}",
"format-icons": {
"default": "󰚢",
"dnd": "󰚣"
},
"on-click": "makoctl mode | grep 'do-not-disturb' && makoctl mode -r do-not-disturb || makoctl mode -a do-not-disturb; pkill -RTMIN+11 waybar",
"on-click-right": "makoctl restore",
"exec": "printf '{\"alt\":\"%s\",\"tooltip\":\"mode: %s\"}' $(makoctl mode | grep -q 'do-not-disturb' && echo dnd || echo default) $(makoctl mode | tail -1)",
"signal": 11
},
"custom/adaptive-light": {
"interval": "once",
"tooltip": true,
"return-type": "json",
"format": "{icon}",
"format-icons": {
"on": "󰃡",
"off": "󰃠"
},
"exec": "/usr/share/sway/scripts/wluma.sh",
"on-click": "/usr/share/sway/scripts/wluma.sh toggle; pkill -RTMIN+12 waybar",
"exec-if": "/usr/share/sway/scripts/wluma.sh check",
"signal": 12
},
"custom/wireguard": {
"format": "{}",
"exec": "~/Dotfiles/waybar/custom_modules/wireguard-rofi-waybar/wireguard.sh short",
// "on-click": "rofi -modi 'WireGuard:~/Dotfiles/waybar/custom_modules/wireguard-rofi-waybar/wireguard-rofi.sh' -show WireGuard -theme mytheme; pkill -SIGRTMIN+6 waybar",
"signal": 6,
"interval": 60,
"return-type": "json"
}
}