diff --git a/home/.config/waybar/config b/home/.config/waybar/config new file mode 100644 index 0000000..d42e1eb --- /dev/null +++ b/home/.config/waybar/config @@ -0,0 +1,162 @@ +// vim: set ft=json: +// not actually json, but better than nothing +{ + "layer": "top", + "position": "top", + "height": 24, // Waybar height (to be removed for auto height) + + // Position/Order of modules + "modules-left": [ + "sway/workspaces", + "sway/mode" + ], + "modules-center": [], + "modules-right": [ + "tray", + "custom/redshift", + "idle_inhibitor", + "backlight", + "mpd", + "pulseaudio", + "network", + "custom/vpn", + "network#speed", + "memory", + "cpu", + "temperature", + "battery", + "clock" + ], + + // Modules configuration + "sway/workspaces": { + "disable-scroll": true + }, + "sway/mode": { + "format": "{}" + }, + + "mpd": { + "format": "{stateIcon} {consumeIcon}{randomIcon}{repeatIcon}{singleIcon}{artist} - {album} - {title} ({elapsedTime:%M:%S}/{totalTime:%M:%S}) ", + "format-disconnected": "Disconnected ", + "format-stopped": "{consumeIcon}{randomIcon}{repeatIcon}{singleIcon}Stopped ", + "unknown-tag": "N/A", + "interval": 2, + "consume-icons": { + "on": " " + }, + "random-icons": { + "off": "劣 ", + "on": "列 " + }, + "repeat-icons": { + "on": "凌 " + }, + "single-icons": { + "on": "綾 " + }, + "state-icons": { + "paused": "", + "playing": "契" + }, + "tooltip-format": "MPD (connected)", + "tooltip-format-disconnected": "MPD (disconnected)" + }, + "idle_inhibitor": { + "format": "{icon}", + "format-icons": { + "activated": " ", + "deactivated": " " + } + }, + "tray": { + // "icon-size": 21, + "spacing": 5 + }, + "clock": { + "format": "{:%H:%M %Z}", + "format-alt": "{:%Y-%m-%d (%a)}", + "tooltip-format": "{:%Y %B}\n{calendar}" + }, + "cpu": { + "interval": 2, + "format": "{usage}% ﬙ ", + "tooltip": false + }, + "memory": { + "interval": 2, + "format": "{}%  " + }, + "temperature": { + "critical-threshold": 80, + "format": "{temperatureC}°C {icon}", + "format-icons": ["", "", "", "", ""] + }, + "backlight": { + "format": "{percent}% {icon}", + "format-icons": [" ", " ", " ", " ", " ", " ", " "], + "on-scroll-up": "brightnessctl set +5%", + "on-scroll-down": "brightnessctl set 5%-" + }, + "battery": { + "interval": 5, + "states": { + "good": 95, + "warning": 30, + "critical": 15 + }, + "format": "{capacity}% {icon}", + "format-charging": "{capacity}% ", + "format-plugged": "{capacity}% ﮣ", + "format-alt": "{time} {icon}", + "format-icons": ["", "", "", "", "", "", "", "", "", "", ""] + }, + "network": { + "format-wifi": "{essid} ({signalStrength}%) 直 ", + "format-ethernet": "{ifname}: {ipaddr}/{cidr}  ", + "format-linked": "{ifname} (No IP)  ", + "format-disconnected": "Disconnected ⚠ ", + "format-alt": "{ifname}: {ipaddr}/{cidr}", + "tooltip": false + }, + "network#speed": { + "interval": 2, + "format": "{bandwidthDownBits}  {bandwidthUpBits} 祝", + "format-alt": "{bandwidthDownOctets}  {bandwidthUpOctets} 祝", + "format-disconnected": " 0b/s 祝 0b/s", + "tooltip": false + }, + "pulseaudio": { + "format": "{volume}% {icon} {format_source}", + "format-bluetooth": "{volume}% {icon} {format_source}", + "format-bluetooth-muted": "遼 {icon} {format_source}", // FIXME: see below + "format-muted": "遼 {format_source}", // FIXME: use normal mute icon (ﱝ ), which for some reason is displayed right of the source? + "format-source": "{volume}% \u2009", + "format-source-muted": "\u2009", + "format-icons": { + "headphone": " ", + "hands-free": " ", + "headset": " ", + "phone": " ", + "portable": " ", + "car": " ", + "default": ["奄", "奔", "墳"] + }, + "on-click": "pavucontrol" + }, + "custom/vpn": { + "interval": 10, + "exec": "ip -j link | jq --unbuffered --compact-output '[[.[].ifname | select(. | startswith(\"mullvad\"))][] | split(\"-\")[1] + \" \u2009\"] as $conns | { text: ($conns[0] // \"\"), class: (if $conns | length > 0 then \"connected\" else \"disconnected\" end) }'", + "return-type": "json", + "format": "{}", + "tooltip": false + }, + "custom/redshift": { + "interval": 10, + "exec": "systemctl --user show redshift | grep -q ActiveState=active && echo '{\"tooltip\": \"Redshift active\", \"class\": \"active\"}' || echo '{\"tooltip\": \"Redshift inactive\", \"class\": \"inactive\"}'", + "on-click": "systemctl --user show redshift | grep -q ActiveState=active && systemctl --user stop redshift || systemctl --user start redshift", + "return-type": "json", + "format": "", + "tooltip": false + } +} diff --git a/home/.config/waybar/style.css b/home/.config/waybar/style.css new file mode 100644 index 0000000..4c0884b --- /dev/null +++ b/home/.config/waybar/style.css @@ -0,0 +1,145 @@ +* { + border-radius: 0; + border: none; + font-family: "Iosevka Nerd Font"; + font-size: 12px; + min-height: 0; + transition-property: none; +} + +window#waybar { + background-color: #002b36; + color: #839496; +} + +#workspaces button { + padding: 0 5px; + background-color: #002b36; + color: inherit; + border-bottom: 2px solid transparent; +} + +#workspaces button:hover { + background: #073642; + box-shadow: inherit; + text-shadow: inherit; +} + +#workspaces button.focused { + border-bottom: 2px solid #859900; +} + +#workspaces button.urgent { + background-color: #dc322f; +} + +#mode { + background-color: #073642; + font-style: italic; +} + +/* all modules on the right */ +#waybar > box > box:nth-child(3) > widget > label { + padding: 0 10px; +} + +#battery.charging { + color: #073642; + background-color: #859900; +} + +@keyframes blink { + to { + background-color: #fdf6e3; + color: #657b83; + } +} + +#battery.critical:not(.charging), +#temperature.critical { + background-color: #dc322f; + animation-name: blink; + animation-duration: 0.5s; + /* FIXME use nearest neighbor interpolation if possible */ + animation-timing-function: cubic-bezier(1, 0, 0, 1); + animation-iteration-count: infinite; + animation-direction: alternate; +} + +#cpu { + background-color: #2aa198; + color: #073642 +} + +#memory { + background-color: #b58900; + color: #073642 +} + +#backlight { + background-color: #fdf6e3; + color: #657b83; +} + +#network, +#custom-vpn { + background-color: #6c71c4; + color: #073642 +} + +#network.disconnected { + background-color: #dc322f; +} + +#network.speed { + background-color: #859900; +} + +#pulseaudio { + background-color: #fdf6e3; + color: #657b83; +} + +#pulseaudio.muted { + background-color: #002b36; + color: #839496; +} + +#temperature { + background-color: #d33682; + color: #073642; +} + +#idle_inhibitor.activated { + background-color: #fdf6e3; + color: #002b36; +} + +#mpd { + background-color: #859900; + color: #073642; +} + +#mpd.disconnected { + background-color: #dc322f; +} + +#mpd.stopped { + background-color: #cb4b16; +} + +#mpd.paused { + background-color: #b58900; +} + +#custom-redshift { + color: #073642; +} + +#custom-redshift.active { + background-color: #dc322f; +} + +#custom-redshift.inactive { + background-color: #268bd2; +}