From 07b311071ce3ad62bcf9ee6062b0fc001ed52966 Mon Sep 17 00:00:00 2001 From: Joel Mathew Thomas Date: Tue, 19 Aug 2025 16:24:39 +0530 Subject: [PATCH] redesign waybar --- .config/waybar/config.jsonc | 525 ++++++++++++++++++++---------------- .config/waybar/style.css | 297 +++++++++++++------- dependencies.txt | 2 +- 3 files changed, 482 insertions(+), 342 deletions(-) diff --git a/.config/waybar/config.jsonc b/.config/waybar/config.jsonc index 8e4b95b..7914970 100644 --- a/.config/waybar/config.jsonc +++ b/.config/waybar/config.jsonc @@ -1,240 +1,291 @@ { - "layer": "top", + // "layer": "top", // Waybar at top layer + // "position": "bottom", // Waybar position (top|bottom|left|right) + "height": 30, // Waybar height (to be removed for auto height) + // "width": 1280, // Waybar width + "spacing": 0, // Gaps between modules (4px) + "reload_style_on_change": true, + + // Choose the order of the modules + "modules-left": ["group/group-cpu", "hyprland/workspaces", "mpris"], + "modules-center": ["hyprland/window"], + "modules-right": [ + "cava", + "gamemode", + "tray", + "power-profiles-daemon", + "network", + "pulseaudio", + "backlight", + "battery", + "clock", + "group/group-power" + ], + + // Modules configuration + "hyprland/workspaces": { + "all-outputs": true, + "on-click": "activate", + "format": "{icon}", + "format-icons": { + "1": "󰮯", + "2": "󰈹", + "3": "", + "4": "󱊷", + "5": "", + "6": "", + "7": "", + "8": " ", + "9": "", + "10": "", + "urgent": "", + "default": "" + }, + "persistent-workspaces": { "*": [1] } + }, + + "hyprland/window": { + "format": "{}", + "rewrite": { + "(.*) — Mozilla Firefox": "$1", + ".*YouTube.*": "YouTube" + }, + "separate-outputs": true + }, + + "idle_inhibitor": { + "format": "{icon}", + "on-click": "activate", + "format-icons": { + "activated": "󰔡", + "deactivated": "󰨙" + }, + "tooltip": true, + "tooltip-format-activated": "Idle Inhibitor On", + "tooltip-format-deactivated": "Idle Inhibitor Off" + }, + + "tray": { + "spacing": 10 + }, + + "clock": { + "tooltip-format": "{:%A, %B %d, %Y}", + "format": "{:%I:%M %p}" + }, + + "cpu": { + "interval": 5, + "format": " {usage}% ", + "tooltip": false + }, + + "memory": { + "interval": 5, + "format": " {used:0.1f}G/{total:0.1f}G", + "tooltip": true, + "tooltip-format": "{used:0.1f}G/{total:0.1f}G " + }, + + "temperature": { + // "thermal-zone": 2, + // "hwmon-path": "/sys/class/hwmon/hwmon2/temp1_input", + "interval": 5, + "critical-threshold": 80, + // "format-critical": "{temperatureC}°C {icon}", + "format": "🌡 {temperatureC}°C ", + "format-icons": ["", "", ""] + }, + + "backlight": { + // "device": "acpi_video1", + "format": "{icon} {percent}%", + "format-icons": ["󰃜", "󰃛", "󰃚"], + "scroll-step": 5.0, + "tooltip": false + }, + + "battery": { + "states": { + "warning": 30, + "critical": 15 + }, + "interval": 2, + "format": "{icon}", + "format-full": "{icon}", + "format-charging": "󰂄", + "format-plugged": "", + // "format-alt": "{icon}", + // "format-good": "", // An empty format will hide the module + // "format-full": "", + "format-icons": ["󰁺", "󰁼", "󰁾", "󰂁", "󰁹"] + }, + + "power-profiles-daemon": { + "format": "{icon}", + "tooltip-format": "Power profile: {profile}\nDriver: {driver}", + "tooltip": true, + "format-icons": { + "default": "", + "performance": "", + "balanced": "󰾞", + "power-saver": "" + } + }, + + "network": { + "interval": 60, + "format": "{ifname}", + "format-wifi": "{essid}", + "format-disconnected": "󰤭", + "tooltip-format": "{ifname} (via {gwaddr}): {ipaddr}", + "tooltip-format-wifi": "{essid} ({signalStrength}%) (via {gwaddr}): {ipaddr}", + "tooltip-format-ethernet": "{ifname} (via {gwaddr}): {ipaddr}", + "tooltip-format-disconnected": "Disconnected", + "max-length": 50, + "on-click": "kitty -- nmtui" + }, + + "pulseaudio": { + "format": "{icon} {volume}%", + "format-muted": "󰖁", + "format-icons": { + "default": ["", "", "󰕾"], + "alsa_output.pci-0000_00_1f.3.analog-stereo": "", + "alsa_output.pci-0000_00_1f.3.analog-stereo-muted": "", + "headphone": "", + "hands-free": "", + "headset": "", + "phone": "", + "phone-muted": "", + "portable": "", + "car": "" + }, + "tooltip-format": "{desc} {volume}%", + "on-click": "pavucontrol" + }, + + "cava": { + "framerate": 144, + "autosens": 0, + "sensitivity": 10, + "bars": 14, + "lower_cutoff_freq": 50, + "higher_cutoff_freq": 10000, + "sleep_timer": 2, + "hide_on_silence": true, + //"format_silent": "quiet", + "method": "pulse", + "source": "auto", + "stereo": true, + "reverse": false, + "bar_delimiter": 0, + "monstercat": false, + "waves": false, + "noise_reduction": 0.77, + "input_delay": 2, + "format-icons": ["▁", "▂", "▃", "▄", "▅", "▆", "▇", "█"], + "actions": { + "on-click-right": "mode" + } + }, + + "mpris": { + "format": "{dynamic}", + "format-paused": "{dynamic}", + "format-stopped": "", + "interval": 2, + "dynamic-order": ["title", "artist"], + "tooltip-format": "{player}({status})", + "dynamic-importance-order": ["title", "artist"], + "title-len": 30, + "artist-len": 20, + "max-len": 30, + "ellipsis": "...", + "ignored-players": ["firefox", "chromium"] + }, + + "gamemode": { + "format": "{glyph}", + "format-alt": "{glyph} {count}", + "glyph": "", + "hide-not-running": true, + "use-icon": true, + "icon-name": "input-gaming-symbolic", + "icon-spacing": 4, + "icon-size": 20, + "tooltip": true, + "tooltip-format": "Games running: {count}" + }, + + "group/group-cpu": { + "orientation": "inherit", + "drawer": { + "transition-duration": 250, + "children-class": "not-cpu", + "transition-left-to-right": true + }, + "modules": [ + "custom/arch", // First element is the "group leader" and won't ever> + "cpu", + "memory", + "temperature" + ] + }, + "group/group-power": { + "orientation": "inherit", + "drawer": { + "transition-duration": 250, + "children-class": "not-power", + "transition-left-to-right": false + }, + "modules": [ + "user", // First element is the "group leader" and won't ever be hidden + "idle_inhibitor", + "custom/quit", + "custom/lock", + "custom/reboot", + "custom/sleep", + "custom/power" + ] + }, + + "custom/quit": { + "format": "󰗼", + "tooltip": false, + "on-triple-click": "hyprctl dispatch exit" + }, + "custom/lock": { + "format": "󰍁", + "tooltip": false, + "on-click": "hyprlock" + }, + "custom/reboot": { + "format": "", + "tooltip": false, + "on-triple-click": "reboot" + }, + "custom/power": { + "format": " ", + "tooltip": false, + "on-triple-click": "shutdown now" + }, + "custom/sleep": { + "format": "󰤄", + "tooltip": false, + "on-double-click": "systemctl suspend" + }, + "custom/arch": { + "format": " 󰣇", + "tooltip": false, + "on-click": "~/.local/bin/rofi-waybar" + }, + + "user": { + "format": "{user}", + "interval": 60, "height": 30, - "spacing": 5, - "modules-left": [ - "group/group-cpu", - "hyprland/workspaces", - "mpris" - ], - "modules-center": [ - "hyprland/window" - ], - "modules-right": [ - "custom/pacman", - "gamemode", - "tray", - "network", - "pulseaudio", - "backlight", - "battery", - "clock", - "group/group-power" - ], - "hyprland/window": { - "separate-outputs": true - }, - "hyprland/workspaces": { - "format": "{icon}", - "on-click": "activate", - "format-icons": { - "1": "󰮯", - "2": "󰈹", - "3": "", - "4": "󱊷", - "5": "", - "6": "", - "7": "", - "8": " ", - "9": "", - "10": "", - "urgent": "", - "default": "" - }, - "sort-by-number": true - }, - "mpris": { - "format": " {dynamic}", - "format-paused": "{ {dynamic}}", - "format-stopped": "", - "interval": 2, - "dynamic-order": ["title", "artist"], - "dynamic-importance-order": ["title", "artist"], - "title-len": 30, - "artist-len": 20, - "max-length": 30, - "elipsis": "...", - "ignored-players": ["firefox", "chromium"] - }, - "gamemode": { - "format": "{glyph}", - "format-alt": "{glyph} {count}", - "glyph": "", - "hide-not-running": true, - "use-icon": true, - "icon-name": "input-gaming-symbolic", - "icon-spacing": 4, - "icon-size": 20, - "tooltip": true, - "tooltip-format": "Games running: {count}" - }, - "tray": { - "spacing": 10 - }, - "custom/pacman": { - "interval": 3600, - "return-type": "json", - "exec": "pacman-updates", - "exec-if": "exit 0", - "on-click": "kitty -e 'paru'; pkill -SIGRTMIN+8 waybar", - "signal": 8 - }, - "clock": { - "tooltip-format": "{:%A, %B %d, %Y}", - "format": "{:%I:%M %p}" - }, - "battery": { - "interval": 2, - "states": { - "warning": 30 - }, - "format": "{icon}", - "format-charging": "󰂄", - "format-icons": ["󰂎", "󰁺", "󰁻", "󰁼", "󰁽", "󰁾", "󰁿", "󰂀", "󰂁", "󰂂", "󰁹"], - "tooltip-format": "{capacity}% capacity" - }, - "network": { - "interval": 60, - "format": "{ifname}", - "format-wifi": "{essid}", - "format-disconnected": "󰤭", - "tooltip-format": "{ifname} (via {gwaddr}): {ipaddr}", - "tooltip-format-wifi": "{essid} ({signalStrength}%) (via {gwaddr}): {ipaddr}", - "tooltip-format-ethernet": "{ifname} (via {gwaddr}): {ipaddr}", - "tooltip-format-disconnected": "Disconnected", - "max-length": 50, - "on-click": "kitty -- nmtui" - }, - "cava": { - "framerate": 144, - "autosens": 1, - "bars": 6, - "lower_cutoff_freq": 50, - "higher_cutoff_freq": 10000, - "hide_on_silence": true, - "sleep_timer": 1, - "method": "pulse", - "source": "auto", - "stereo": true, - "reverse": false, - "bar_delimiter": 0, - "monstercat": false, - "waves": false, - "noise_reduction": 0.77, - "input_delay": 2, - "format-icons" : ["▁", "▂", "▃", "▄", "▅", "▆", "▇", "█" ], - "actions": { - "on-click-right": "mode" - } - }, - "pulseaudio": { - "format": "{icon} {volume}%", - "format-muted": "󰖁", - "format-icons": { - "default": ["", "", "󰕾"], - "alsa_output.pci-0000_00_1f.3.analog-stereo": "", - "alsa_output.pci-0000_00_1f.3.analog-stereo-muted": "", - "headphone": "", - "hands-free": "", - "headset": "", - "phone": "", - "phone-muted": "", - "portable": "", - "car": "" - }, - "tooltip-format": "{desc} {volume}%", - "on-click": "pavucontrol" - }, - "group/group-power": { - "orientation": "inherit", - "drawer": { - "transition-duration": 250, - "children-class": "not-power", - "transition-left-to-right": false - }, - "modules": [ - "user", - "idle_inhibitor", - "custom/quit", - "custom/sleep", - "custom/lock", - "custom/reboot", - "custom/power" - ] - }, - "custom/quit": { - "format": " 󰗼 ", - "tooltip": false, - "on-triple-click": "hyprctl dispatch exit" - }, - "custom/lock": { - "format": " 󰍁 ", - "tooltip": false, - "on-click": "hyprlock" - }, - "custom/sleep": { - "format": " 󰤄 ", - "tooltip": false, - "on-triple-click": "systemctl suspend" - }, - "custom/reboot": { - "format": "  ", - "tooltip": false, - "on-triple-click": "reboot" - }, - "custom/power": { - "format": " ", - "tooltip": false, - "on-triple-click": "shutdown now" - }, - "idle_inhibitor": { - "format": "{icon}", - "format-icons": { - "activated": "", - "deactivated": "" - }, - "tooltip": true, - "tooltip-format-activated": "Idle inhibitor on", - "tooltip-format-deactivated": "Idle inhibitor off" - }, - "user": { - "format": "{user} ", - "interval": 60, - "height": 30, - "width": 30, - "icon": false - }, - "backlight": { - "format": "{icon} {percent}%", - "format-icons": ["󰃜", "󰃛", "󰃚"], - "scroll-step": 5 - }, - "group/group-cpu": { - "orientation": "inherit", - "drawer": { - "transition-duration": 250, - "children-class": "not-cpu", - "transition-right-to-left": true - }, - "modules": [ - "custom/arch", - "cpu", - "memory" - ] - }, - "cpu": { - "interval": 10, - "format": " {usage}%", - "max-length": 10 - }, - "custom/arch": { - "format": " 󰣇", - "tooltip": false, - "on-click":"~/.local/bin/rofi-waybar" - }, - "memory": { - "interval": 30, - "format": " {used:0.1f}G/{total:0.1f}G" - }, - + "width": 30, + "icon": true + } } diff --git a/.config/waybar/style.css b/.config/waybar/style.css index 88374aa..5affd81 100644 --- a/.config/waybar/style.css +++ b/.config/waybar/style.css @@ -29,174 +29,263 @@ @define-color pink #f5c2e7; @define-color flamingo #f2cdcd; @define-color rosewater #f5e0dc; +@define-color pastel #dce3f5; +@define-color pastel-inactive rgba(220, 227, 245, 0.3); * { - font-family: Cantarell, Symbols Nerd Font; - font-weight: bolder; - font-size: 14px; + /* `otf-font-awesome` is required to be installed for icons */ + font-family: Cantarell, "Symbols Nerd Font"; + font-size: 14px; + font-weight: bolder; } -window#waybar { - background-color: @crust; - color: @text; - transition-property: background-color; - transition-duration: .5s; +#waybar { + background-color: rgba(0, 0, 0, 0); + color: @pastel; + transition-property: background-color; + transition-duration: 0.5s; } window#waybar.hidden { - opacity: 0.2; + opacity: 0.2; } - - -window#waybar.termite { - background-color: #3F3F3F; +tooltip { + background: rgba(43, 48, 59, 1); } -window#waybar.chromium { - background-color: #000000; - border: none; +tooltip label { + color: white; } button { - /* Use box-shadow instead of border so the text isn't offset */ - box-shadow: inset 0 -3px transparent; - /* Avoid rounded borders under each button name */ - border: none; - border-radius: 0; + /* Use box-shadow instead of border so the text isn't offset */ + box-shadow: inset 0 -3px transparent; + /* Avoid rounded borders under each button name */ + border: none; + border-radius: 0; } /* https://github.com/Alexays/Waybar/wiki/FAQ#the-workspace-buttons-have-a-strange-hover-effect */ -#workspaces button:hover { - color: @blue; - box-shadow: inherit; - text-shadow: inherit; - background: @crust; - border: @crust; -} - #workspaces button { - padding: 0px; - color: @lavender-inactive; - margin: 2px; - transition: color 200ms ease-in-out; + padding: 0px; + margin: 2px; + color: @pastel-inactive; + transition: color 200ms ease-in-out; } -#workspaces button.selected { - color: @blue; +#workspaces button:hover { + color: @pastel; + box-shadow: inherit; + text-shadow: inherit; + background: transparent; + border: #1e1e2e; } #workspaces button.active { - color: @blue; + color: @pastel; } #workspaces button.urgent { - color: @red; + color: @red; } +#cava, #clock, #battery, #cpu, #memory, -#disk, #temperature, #backlight, #network, #pulseaudio, -#wireplumber, -#custom-pacman, #tray, -#cava, -#mode, -#idle_inhibitor, -#scratchpad, -#mpris { - padding: 0 2px; - color: @lavender; - border-radius: 15px; - margin: 2px 0; +#mpris, +#power-profiles-daemon { + padding: 0px 4px; + color: @pastel; } -#cpu { - margin-left: 4px; +#workspaces { + margin: 0 8px; } -#idle_inhibitor.activated { - color: @green; +/* If workspaces is the leftmost module, omit left margin */ +.modules-left > widget:first-child > #workspaces { + margin-left: 0; +} + +/* If workspaces is the rightmost module, omit right margin */ +.modules-right > widget:last-child > #workspaces { + margin-right: 0; } #clock { - color: @text; -} - -#custom-pacman { - color: @peach; -} - -#pulseaudio { - color: @mauve; -} - -#pulseaudio.muted { - color: @surface2; -} - -#network.disconnected { - color: @surface2; + background-color: transparent; + color: @pastel; } #battery { - color: @green; + background-color: transparent; + color: #81c784; +} + +#battery.charging { + color: #81c784; + background-color: transparent; } #battery.plugged { - color: @blue; + color: @blue; + background-color: transparent; } -#battery.warning { - color: @red; +@keyframes blink { + to { + background-color: #ffffff; + color: #000000; + } +} + +/* Using steps() instead of linear as a timing function to limit cpu usage */ +#battery.critical:not(.charging) { + background-color: @red; + color: #ffffff; + animation-name: blink; + animation-duration: 0.5s; + animation-timing-function: steps(12); + animation-iteration-count: infinite; + animation-direction: alternate; +} +#power-profiles-daemon { + font-size: 13px; + padding: 0 8px; +} + +#power-profiles-daemon.performance { + color: @red; +} + +#power-profiles-daemon.balanced { + color: #2980b9; +} + +#power-profiles-daemon.power-saver { + color: @green; +} + +label:focus { + background-color: #000000; +} + +#cpu { + background-color: transparent; + margin-left: 6px; +} + +#memory { + background-color: transparent; +} + +#backlight { + background-color: transparent; + color: #ffd580; +} + +#network { + background-color: transparent; +} + +#network.disconnected { + background-color: transparent; +} + +#pulseaudio { + background-color: transparent; + color: @mauve; +} + +#pulseaudio.muted { + background-color: transparent; + padding: 0 10px; +} + +#temperature { + background-color: transparent; +} + +#idle_inhibitor { + background-color: transparent; + padding: 0 4px; + font-weight: normal; + font-size: 20px; + margin-left: 4px; +} + +#idle_inhibitor.activated { + background-color: transparent; + color: @green; +} + +#idle_inhibitor.deactivated { + background-color: transparent; + color: @lavender; +} + +#tray { + background-color: transparent; +} + +#tray > .passive { + -gtk-icon-effect: dim; +} + +#tray > .needs-attention { + -gtk-icon-effect: highlight; + background-color: transparent; +} + +#cava { + color: @pastel; + letter-spacing: 1px; + font-size: 9px; } #group-power { - color: @maroon; -} - -#group-cpu { - margin-right: 3px; -} - -#custom-reboot { - color: @green; -} - -#custom-lock { - color: @blue; + margin-right: 4px; } #custom-quit { - color: @lavender; + padding: 0 4px; + color: #ff6f61; +} + +#custom-reboot { + padding: 0 4px; + color: @green; +} + +#custom-lock { + padding: 0 4px; + color: @lavender; +} + +#custom-power { + padding: 0 4px; + color: @red; } #custom-sleep { - color: @sky; + padding: 0 4px; + color: #ffd54f; } -#keyboard-state > label { - padding: 0 5px; +#mpris { + color: @pastel; } -#keyboard-state > label.locked { - background: rgba(0, 0, 0, 0.2); +#user { + padding: 0 2px; + color: @red; } - -#scratchpad { - background: rgba(0, 0, 0, 0.2); -} - -#scratchpad.empty { - background-color: transparent; -} - - - diff --git a/dependencies.txt b/dependencies.txt index 055048a..493bec3 100644 --- a/dependencies.txt +++ b/dependencies.txt @@ -27,7 +27,7 @@ emote rofi-wayland wlogout waybar-cava -ttf-fira-sans noto-fonts noto-fonts-cjk noto-fonts-emoji noto-fonts-extra ttf-font-awesome nerd-fonts +ttf-fira-sans noto-fonts noto-fonts-cjk noto-fonts-emoji noto-fonts-extra ttf-font-awesome nerd-fonts otf-font-awesome gnome-keyring eww cava iniparser fftw