diff options
Diffstat (limited to 'config/waybar-2/waybar')
| -rwxr-xr-x | config/waybar-2/waybar/config.jsonc | 154 | ||||
| -rwxr-xr-x | config/waybar-2/waybar/style.css | 207 | ||||
| -rwxr-xr-x | config/waybar-2/waybar/window.sh | 77 |
3 files changed, 438 insertions, 0 deletions
diff --git a/config/waybar-2/waybar/config.jsonc b/config/waybar-2/waybar/config.jsonc new file mode 100755 index 0000000..8d04fac --- /dev/null +++ b/config/waybar-2/waybar/config.jsonc @@ -0,0 +1,154 @@ +{ + "reload-style-on-change": true, + "layer": "top", + "position": "top", + "output": "HDMI-A-1", + "spacing": 0, + "height": 35, + "border-radius": 25, + + "modules-left": ["niri/workspaces"], + "modules-center": [], + "modules-right": ["group/right"], + + "group/right": { + "orientation": "inherit", + "modules": [ + "clock" + ] + }, + + "custom/active_window": { + "exec": "~/.config/waybar/window.sh", + "return-type": "json", + "markup": true + }, + + "niri/workspaces": { + "on-click": "activate", + "format": "{icon}", + "format-icons": { + "default": "", + "active": "", + "urgent": "", + "empty": "" + }, + "persistent-workspaces": { + "1": [], + "2": [], + "3": [], + "4": [], + "5": [], + "6": [], + "7": [], + "8": [] + } + }, + + "custom/wbmenu": { + "format": "<span size='13500'></span>", + "on-click": "rofi -show drun -config ~/.config/rofi/gruvbox.rasi", + "on-click-right": "xdg-terminal-exec", + "tooltip-format": "Menu\n\nSuper + Return" + }, + + "cpu": { + "interval": 2, + "format": "{icon} ", + "format-icons": ["", "", "", "", "", "", "", ""] + }, + + "memory": { + "interval": 2, + "format": "{icon}", + "format-icons": ["", "", "", "", "", "", "", ""] + }, + + "clock": { + "format": " {:%I:%M %p • %a, %d/%m} ", + "format-alt": "{:%A, %d %B %Y}", + "tooltip-format": "<big>{:%Y %B}</big>\n<tt><small>{calendar}</small></tt>" + }, + + "network": { + "format-icons": ["", "", "", "", ""], + "format": "{icon}", + "format-wifi": "{icon}", + "format-ethernet": "<span size='11500'></span>", + "format-disconnected": "<span size='11500'></span>", + "tooltip-format-wifi": "{essid} ({frequency} GHz)\n⇣{bandwidthDownBytes} ⇡{bandwidthUpBytes}", + "tooltip-format-ethernet": "⇣{bandwidthDownBytes} ⇡{bandwidthUpBytes}", + "tooltip-format-disconnected": "Disconnected", + "interval": 3, + "spacing": 1 + }, + + "battery": { + "format": "{capacity}% {icon}", + "format-discharging": "{icon}", + "format-charging": "{icon}", + "format-plugged": "", + "format-icons": { + "charging": ["", "", "", "", "", "", "", "", "", ""], + "default": ["", "", "", "", "", "", "", "", "", ""] + }, + "format-full": "", + "tooltip-format-discharging": "{power:>1.0f}W↓ {capacity}%", + "tooltip-format-charging": "{power:>1.0f}W↑ {capacity}%", + "interval": 5, + "states": { + "warning": 20, + "critical": 10 + } + }, + + "bluetooth": { + "format": "<span size='11500'></span>", + "format-disabled": "<span size='11500'></span>", + "format-connected": "<span size='11500'></span>", + "format-no-controller": "", + "tooltip-format": "Devices connected: {num_connections}" + }, + + "pulseaudio": { + "format": "<span size='11500'>{icon}</span>", + "on-click-right": "pamixer -t", + "tooltip-format": "Playing at {volume}%", + "scroll-step": 5, + "format-muted": "", + "format-icons": { + "default": [" ", " ", " "] + } + }, + + "group/tray-expander": { + "orientation": "inherit", + "drawer": { + "transition-duration": 600, + "children-class": "tray-group-item" + }, + "modules": ["custom/expand-icon", "tray"] + }, + + "custom/expand-icon": { + "format": "", + "tooltip": false + }, + + "tray": { + "icon-size": 16, + "spacing": 8 + }, + + "custom/separator#blank": { + "format": " ", + "interval": "once", + "tooltip": false + }, + + "custom/separator#dot": { + "format": " ", + "interval": "once", + "tooltip": false + } +} diff --git a/config/waybar-2/waybar/style.css b/config/waybar-2/waybar/style.css new file mode 100755 index 0000000..7f63e4b --- /dev/null +++ b/config/waybar-2/waybar/style.css @@ -0,0 +1,207 @@ +@define-color background #0E0F12; +@define-color foreground #E6DAD1; +@define-color accent #A07A6A; +@define-color muted #6E5A52; +@define-color subtle #15161A; + +* { + color: @foreground; + border: none; + border-radius: 0; + min-height: 0; + font-family: 'JetBrainsMono Nerd Font Propo'; + font-size: 12px; +} + +window#waybar { + background-color: @background; + transition-property: background-color; + transition-duration: .5s; +} + +window#waybar > box { + background-color: @background; + border-radius: 32px; + margin: 2px 10px 0px 10px; +} + +window#waybar.empty #window { + background: transparent; + background-color: transparent; + border: none; + border-radius: 0; + color: transparent; + padding: 0; + margin: 0; +} + +#waybar.empty .modules-center { + opacity: 0; +} + +.modules-left { + margin-left: 8px; +} +.modules-right { + margin-right: 8px; +} + +#workspaces { + padding: 0px 5px; + margin: 3.5px 3.5px; + border-radius: 11px; + background-color: alpha(@foreground, 0.06); + opacity: 0.95; +} + +#workspaces button { + all: initial; + color: @foreground; + padding: 0 6px; + margin: 0 1.5px; + min-width: 9px; +} + +#workspaces button.empty { + opacity: 0.45; +} + +#workspaces button.active { + border-radius: 18px; + background: alpha(@foreground, 0.14); + opacity: 1; + margin-top: 4px; + margin-bottom: 4px; + margin-left: 5px; + padding-right: 5px; + padding-left: 5px; +} + +#workspaces button:hover { + border-radius: 18px; + background: alpha(@foreground, 0.08); + opacity: 1; +} + +#workspaces button.urgent { + border-radius: 18px; + background: alpha(#f13333, 0.4); + opacity: 1; + margin-top: 4px; + margin-bottom: 4px; + margin-left: 5px; + padding-right: 5px; + padding-left: 5px; +} + +#clock { + font-size: 13px; + font-weight: 700; +} + +#battery, +#pulseaudio, +#custom-screenrecording-indicator, +#custom-update { + min-width: 12px; + margin: 0 7.5px; +} + +#pulseaudio { + margin-right: 5px; +} + +#bluetooth { + margin-right: 12px; +} + +#network { + margin-right: 9px; +} + +#custom-idle-indicator, +#custom-notification-silencing-indicator { + margin-right: 2px; + min-width: 15px; +} + +#custom-update { + font-size: 10px; +} + +#custom-screenrecording-indicator { + min-width: 12px; + margin-left: 8.75px; + font-size: 10px; +} + +#custom-screenrecording-indicator.active { + color: red; +} + +#tray { + background: alpha(@foreground, 0.0); + border-radius: 16px; + padding: 0px 5px; + margin: 3.5px 2px; + margin-right: 4px; +} + +#custom-omarchy { + background: alpha(@foreground, 0.08); + border-radius: 99px; + margin-top: 4px; + margin-bottom: 4px; + margin-left: -3px; + margin-right: 5px; + padding-right: 7px; + padding-left: 7px; +} + +#cpu, #memory { + font-size: 18px; + padding: 2px 1px; +} + +#custom-active_window { + padding: 3px 6px; + border-radius: 14px; + background: alpha(@foreground, 0.06); + font-size: 12px; +} + +#group-right1, +#group_right1, +#right1 { + font-weight: 800; + background: transparent; + padding: 0px 5px; + margin: 3.5px 2px; +} + +#group-left, +#group_left, +#left, +#group-right, +#group_right, +#right { + font-weight: 800; + background: alpha(@foreground, 0.06); + border-radius: 12px; + padding: 0px 5px; + margin: 3.5px 2px; +} + +tooltip { + background: @subtle; + border: 1px solid alpha(@foreground, 0.12); + border-radius: 4px 4px 11px 11px; +} + +tooltip label { + color: alpha(@foreground, 0.92); +} + +.hidden { + opacity: 0; +} diff --git a/config/waybar-2/waybar/window.sh b/config/waybar-2/waybar/window.sh new file mode 100755 index 0000000..abf1e39 --- /dev/null +++ b/config/waybar-2/waybar/window.sh @@ -0,0 +1,77 @@ +#!/usr/bin/env bash + +MAX_TITLE_LEN=20 + +print_status() { + window=$(hyprctl activewindow -j 2>/dev/null) + address=$(jq -r '.address // empty' <<< "$window") + + # No active window → show Desktop + Workspace + if [[ -z "$address" || "$address" == "null" ]]; then + ws=$(hyprctl activeworkspace -j | jq -r '.id') + + top_line="Desktop" + bottom_line="Workspace $ws" + + esc_top=$(sed 's/&/&/g; s/</</g; s/>/>/g' <<< "$top_line") + esc_bottom=$(sed 's/&/&/g; s/</</g; s/>/>/g' <<< "$bottom_line") + + text="<span size='7500' foreground='#a6adc8' rise='-2000'>$esc_top</span> +<span size='9000' weight='bold' foreground='#ffffff'>$esc_bottom</span>" + + jq -nc \ + --arg text "$text" \ + --arg tooltip "$bottom_line" \ + '{ text: $text, class: "custom-window", tooltip: $tooltip }' + return + fi + + class=$(jq -r '.class // "Unknown"' <<< "$window") + title=$(jq -r '.title // ""' <<< "$window") + + app_class="${class,,}" + + # Discord / Vesktop cleanup + if [[ "$app_class" == *discord* || "$app_class" == *vesktop* ]]; then + title=$(sed -E 's/^\([0-9]+\)[[:space:]]*//' <<< "$title") + title=$(sed -E 's/^Discord[[:space:]]*\|[[:space:]]*//' <<< "$title") + fi + + # Truncate title + if (( ${#title} > MAX_TITLE_LEN )); then + title="${title:0:$((MAX_TITLE_LEN-3))}..." + fi + + esc_top=$(sed 's/&/&/g; s/</</g; s/>/>/g' <<< "$class") + esc_bottom=$(sed 's/&/&/g; s/</</g; s/>/>/g' <<< "$title") + + text="<span size='7500' foreground='#a6adc8' rise='-2000'>$esc_top</span> +<span size='9000' weight='bold' foreground='#ffffff'>$esc_bottom</span>" + + tooltip="$class: $title" + + jq -nc \ + --arg text "$text" \ + --arg tooltip "$tooltip" \ + '{ text: $text, class: "custom-window", tooltip: $tooltip }' +} + +# Initial output +print_status + +last="" + +# Update only when state changes +while true; do + current_window=$(hyprctl activewindow -j 2>/dev/null) + current_ws=$(hyprctl activeworkspace -j 2>/dev/null) + + current="$current_window$current_ws" + + if [[ "$current" != "$last" ]]; then + print_status + last="$current" + fi + + sleep 0.5 +done |
