From dce3f2176ced8667dd0945a21035be014678b909 Mon Sep 17 00:00:00 2001 From: Maxwell Jeffress Date: Sat, 23 Aug 2025 19:35:59 +1000 Subject: [PATCH] Add my own fully custom waybar --- waybar/config | 156 +++++++---------- waybar/refresh.sh | 2 - waybar/scripts/colorpicker.sh | 60 ------- waybar/style.css | 317 +++++++++++++++++++--------------- 4 files changed, 247 insertions(+), 288 deletions(-) delete mode 100755 waybar/refresh.sh delete mode 100755 waybar/scripts/colorpicker.sh diff --git a/waybar/config b/waybar/config index b314721..de76e52 100644 --- a/waybar/config +++ b/waybar/config @@ -1,94 +1,72 @@ { "layer": "top", - "position": "top", - "reload_style_on_change": true, - "modules-left": ["custom/notification","clock","custom/pacman","tray"], - "modules-center": ["hyprland/workspaces"], - "modules-right": ["group/expand","bluetooth","network","battery","power-profiles-daemon"], - - - "hyprland/workspaces": { - "format": "{icon}", - "format-icons": { - "active": "", - "default": "", - "empty": "" - }, - "persistent-workspaces": { - "*": [ 1,2,3,4,5 ] - } + "position": "top", + "height": 40, + "modules-left": ["hyprland/workspaces", "hyprland/window"], + "modules-center": [], + "modules-right": ["network", "bluetooth", "pulseaudio", "battery", "power-profiles-daemon", "clock"], + "hyprland/workspaces": { + "disable-scroll": true, + "all-outputs": true, + "format": "{name}" + }, + "hyprland/window": { + "format": "{}" + }, + "network": { + "format-wifi": "{essid} ({signalStrength}%) ", + "format-ethernet": "{ifname}: {ipaddr}/{cidr} ", + "format-disconnected": "Disconnected ⚠", + "tooltip-format": "{ifname} via {gwaddr} ", + "on-click": "nm-connection-editor" + }, + "bluetooth": { + "format": " {status}", + "format-disabled": "", + "format-connected": " {device_alias}", + "tooltip-format": "{device_enumerate}", + "tooltip-format-enumerate-connected": "{device_alias} {device_address}" + }, + "pulseaudio": { + "format": "{volume}% {icon} {format_source}", + "format-bluetooth": "{volume}% {icon} {format_source}", + "format-bluetooth-muted": " {icon} {format_source}", + "format-icons": { + "headphone": "", + "hands-free": "", + "headset": "", + "phone": "", + "portable": "", + "car": "", + "default": ["", "", ""] }, - "custom/notification": { - "tooltip": false, - "format": "Menu", - "on-click": "swaync-client -t -sw", - "escape": true + "on-click": "pavucontrol" + }, + "battery": { + "states": { + "good": 95, + "warning": 30, + "critical": 15 }, - "clock": { - "format": "{:%H:%M:%S %A %b %d} ", - "interval": 1, - "tooltip-format": "{calendar}", - "calendar": { - "format": { - "today": "{}" - } - }, - "actions": { - "on-click-right": "shift_down", - "on-click": "shift_up" - } + "format": "{capacity}% {icon}", + "format-charging": "{capacity}% ", + "format-plugged": "{capacity}% ", + "format-alt": "{time} {icon}", + "format-icons": ["", "", "", "", ""] + }, + "power-profiles-daemon": { + "format": "{icon}", + "tooltip-format": "Power profile: {profile}", + "format-icons": { + "power-saver": "🙑", + "balanced": "", + "performance": "" }, - "network": { - "format-wifi": "", - "format-ethernet":"", - "format-disconnected": "", - "tooltip-format-disconnected": "Error", - "tooltip-format-wifi": "{essid} ({signalStrength}%) ", - "tooltip-format-ethernet": "{ifname} 🖧 ", - "on-click": "kitty nmtui" - }, - "power-profiles-daemon": { - "format": "{icon}", - "tooltip-format": "Power profile: {profile}\nDriver: {driver}", - "tooltip": true, - "format-icons": { - "default": "", - "performance": "", - "balanced": "", - "power-saver": "" - } - }, - "battery": { - "interval":1, - "states": { - "good": 95, - "warning": 30, - "critical": 20 - }, - "format": "{capacity}%", - "format-charging": "{capacity}%", - "format-plugged": "{capacity}%", - "format-alt": "{time}", - }, - "custom/expand": { - "format": "", - "tooltip": false - }, - "custom/endpoint":{ - "format": "|", - "tooltip": false - }, - "group/expand": { - "orientation": "horizontal", - "drawer": { - "transition-duration": 600, - "transition-to-left": true, - "click-to-reveal": true - }, - "modules": ["custom/expand", "custom/colorpicker","cpu","memory","temperature","custom/endpoint"], - }, - "tray": { - "icon-size": 14, - "spacing": 10 - }, -} + "on-click": "case \"$(powerprofilesctl get)\" in \"performance\") powerprofilesctl set balanced ;; \"balanced\") powerprofilesctl set power-saver ;; *) powerprofilesctl set performance ;; esac" + }, + "clock": { + "interval": 1, + "format": "{:%H:%M:%S}", + "tooltip-format": "{:%Y %B}\n{calendar}" + } +} diff --git a/waybar/refresh.sh b/waybar/refresh.sh deleted file mode 100755 index adec096..0000000 --- a/waybar/refresh.sh +++ /dev/null @@ -1,2 +0,0 @@ -pkill waybar -waybar diff --git a/waybar/scripts/colorpicker.sh b/waybar/scripts/colorpicker.sh deleted file mode 100755 index 28eb819..0000000 --- a/waybar/scripts/colorpicker.sh +++ /dev/null @@ -1,60 +0,0 @@ -#!/usr/bin/env bash - -check() { - command -v "$1" 1>/dev/null -} - -notify() { - check notify-send && { - notify-send -a "Color Picker" "$@" - return - } - echo "$@" -} - -loc="$HOME/.cache/colorpicker" -[ -d "$loc" ] || mkdir -p "$loc" -[ -f "$loc/colors" ] || touch "$loc/colors" - -limit=10 - -[[ $# -eq 1 && $1 = "-l" ]] && { - cat "$loc/colors" - exit -} - -[[ $# -eq 1 && $1 = "-j" ]] && { - text="$(head -n 1 "$loc/colors")" - - mapfile -t allcolors < <(tail -n +2 "$loc/colors") - # allcolors=($(tail -n +2 "$loc/colors")) - tooltip=" COLORS\n\n" - - tooltip+="-> $text \n" - for i in "${allcolors[@]}"; do - tooltip+=" $i \n" - done - - cat <", "tooltip":"$tooltip"} -EOF - - exit -} - -check hyprpicker || { - notify "hyprpicker is not installed" - exit -} -killall -q hyprpicker -color=$(hyprpicker) - -check wl-copy && { - echo "$color" | sed -z 's/\n//g' | wl-copy -} - -prevColors=$(head -n $((limit - 1)) "$loc/colors") -echo "$color" >"$loc/colors" -echo "$prevColors" >>"$loc/colors" -sed -i '/^$/d' "$loc/colors" -pkill -RTMIN+1 waybar diff --git a/waybar/style.css b/waybar/style.css index e15ed66..e792568 100644 --- a/waybar/style.css +++ b/waybar/style.css @@ -1,168 +1,211 @@ - * { - font-size:15px; - font-family: "Inter"; + border: none; + border-radius: 0; + font-family: JetBrains Mono; + font-size: 13px; + min-height: 0; } -window#waybar{ - all:unset; -} -.modules-left { - padding:7px; - margin:5px; - border-radius:10px; - background: alpha(@background,.5); - box-shadow: 0px 0px 2px rgba(0, 0, 0, .5); -} -.modules-center { - padding:7px; - margin:5px; - border-radius:10px; - background: alpha(@background,.5); - box-shadow: 0px 0px 2px rgba(0, 0, 0, .5); -} -.modules-right { - padding:7px; - margin:5px; - border-radius:10px; - background: alpha(@background,.5); - box-shadow: 0px 0px 2px rgba(0, 0, 0, .5); -} -tooltip { - background:@background; - color: @color7; -} -#clock:hover, #custom-pacman:hover, #custom-notification:hover,#bluetooth:hover,#network:hover,#battery:hover, #cpu:hover,#memory:hover,#temperature:hover{ - transition: all .3s ease; - color:@color9; -} -#custom-notification { - padding: 0px 5px; - transition: all .3s ease; - color:@color7; -} -#clock{ - padding: 0px 5px; - color:@color7; - transition: all .3s ease; -} -#custom-pacman{ - padding: 0px 5px; - transition: all .3s ease; - color:@color7; +window#waybar { + background-color: rgba(43, 48, 59, 0.5); + border-bottom: 3px solid rgba(100, 114, 125, 0.5); + color: #ffffff; + transition-property: background-color; + transition-duration: .5s; + margin: 30px; + border-radius: 0 0 7px 7px; } -#workspaces { - padding: 0px 5px; -} + #workspaces button { - all:unset; - padding: 0px 5px; - color: rgba(0,0,0,0); - text-shadow: 0px 0px 1px rgba(0, 0, 0, .4); + padding: 0 5px; + background-color: transparent; + color: #ffffff; + border-bottom: 3px solid transparent; + opacity: 0.5; } + #workspaces button:hover { - color:rgba(0,0,0,0); - text-shadow: 0px 0px 1px rgba(0, 0, 0, .7); - transition: all 1s ease; + background: rgba(0, 0, 0, 0.2); + box-shadow: inherit; + border-bottom: 3px solid #ffffff; + opacity: 1.0; } -#workspaces button.active { - color: @color9; - border: none; - transition: all 1s ease; -} -#workspaces button.empty { - color: rgba(0,0,0,0); - border: none; - text-shadow: 0px 0px 1.5px rgba(0, 0, 0, .2); -} -#workspaces button.empty:hover { - color: rgba(0,0,0,0); - border: none; - text-shadow: 0px 0px 1.5px rgba(0, 0, 0, .5); - transition: all 1s ease; -} -#workspaces button.empty.active { - color: @color9; - border: none; - transition: all 1s ease; -} -#bluetooth{ - padding: 0px 5px; - transition: all .3s ease; - color:@color7; +#workspaces button.focused { + background-color: transparent; + border-bottom: 3px solid #ffffff; + font-family: "JetBrains Mono Bold"; + font-weight: normal; + font-size: 14px; + opacity: 1.0; } -#network{ - padding: 0px 5px; - transition: all .3s ease; - color:@color7; +#workspaces button.urgent { + background-color: #eb4d4b; } -#battery{ - padding: 0px 5px; - transition: all .3s ease; - color:@color7; - +#mode { + background-color: #64727D; + border-bottom: 3px solid #ffffff; } + +#clock, +#battery, +#cpu, +#memory, +#temperature, +#backlight, +#network, +#pulseaudio, +#power-profiles-daemon, +#custom-media, +#tray, +#mode, +#idle_inhibitor, +#mpd { + padding: 0 10px; + margin: 0 5px; + color: #ffffff; +} + +#window, +#workspaces { + margin: 0 4px; +} + +/* 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; +} + +#battery { + background-color: transparent; + color: #ffffff; +} + #battery.charging { - color: #26A65B; + color: #ffffff; + background-color: #26A65B; } -#battery.warning:not(.charging) { - color: #ffbe61; +@keyframes blink { + to { + background-color: #ffffff; + color: #000000; + } } #battery.critical:not(.charging) { - color: #f53c3c; + background-color: #f53c3c; + color: #ffffff; animation-name: blink; animation-duration: 0.5s; animation-timing-function: linear; animation-iteration-count: infinite; animation-direction: alternate; } -#group-expand{ - padding: 0px 5px; - transition: all .3s ease; -} -#custom-expand{ - padding: 0px 5px; - color:alpha(@foreground,.2); - text-shadow: 0px 0px 2px rgba(0, 0, 0, .7); - transition: all .3s ease; -} -#custom-expand:hover{ - color:rgba(255,255,255,.2); - text-shadow: 0px 0px 2px rgba(255, 255, 255, .5); -} -#custom-colorpicker{ - padding: 0px 5px; -} -#cpu,#memory,#temperature{ - padding: 0px 5px; - transition: all .3s ease; - color:@color7; -} -#custom-endpoint{ - color:transparent; - text-shadow: 0px 0px 1.5px rgba(0, 0, 0, 1); - -} -#tray{ - padding: 0px 5px; - transition: all .3s ease; - -} -#tray menu * { - padding: 0px 5px; - transition: all .3s ease; +label:focus { + background-color: #000000; } -#tray menu separator { - padding: 0px 5px; - transition: all .3s ease; +#network { + background-color: transparent; } -#power-profiles-daemon { - color: white; + +#network.disconnected { + background-color: #f53c3c; } + +#pulseaudio { + background-color: transparent; + color: #ffffff; +} + +#pulseaudio.muted { + background-color: #90b1b1; + color: #2a5c45; +} + +#custom-media { + background-color: #66cc99; + color: #2a5c45; + min-width: 100px; +} + +#custom-media.custom-spotify { + background-color: #66cc99; +} + +#custom-media.custom-vlc { + background-color: #ffa000; +} + +#temperature { + background-color: #f0932b; +} + +#temperature.critical { + background-color: #eb4d4b; +} + +#tray { + background-color: #2980b9; +} + +#idle_inhibitor { + background-color: #2d3436; +} + +#idle_inhibitor.activated { + background-color: #ecf0f1; + color: #2d3436; +} + +#mpd { + background-color: #66cc99; + color: #2a5c45; +} + + + +#mpd.disconnected { + background-color: #f53c3c; +} + +#mpd.stopped { + background-color: #90b1b1; +} + +#mpd.paused { + background-color: #51a37a; +} + +#language { + background: #00b093; + color: #740864; + padding: 0 5px; + margin: 0 5px; + min-width: 16px; +} + +#keyboard-state { + background: #97e1ad; + color: #000000; + padding: 0 0px; + margin: 0 5px; + min-width: 16px; +} + +#keyboard-state > label { + padding: 0 5px; +} + +#keyboard-state > label.locked { + background: red; +} \ No newline at end of file