From 4d8c86df3f63a06d29e2e78a6bf8325473a046b7 Mon Sep 17 00:00:00 2001 From: Nathan Woodburn Date: Fri, 4 Apr 2025 14:50:33 +1100 Subject: [PATCH] feat: Add waybar to git --- .config/.gitignore | 2 + .config/waybar/config | 224 +++++++++++++++++++++++++++++++++++++++ .config/waybar/style.css | 216 +++++++++++++++++++++++++++++++++++++ 3 files changed, 442 insertions(+) create mode 100644 .config/waybar/config create mode 100644 .config/waybar/style.css diff --git a/.config/.gitignore b/.config/.gitignore index 2aad4a9..558df67 100644 --- a/.config/.gitignore +++ b/.config/.gitignore @@ -14,3 +14,5 @@ !rofi/** !backgrounds !backgrounds/** +!waybar +!waybar/** diff --git a/.config/waybar/config b/.config/waybar/config new file mode 100644 index 0000000..68afb6b --- /dev/null +++ b/.config/waybar/config @@ -0,0 +1,224 @@ +{ + "height": 30, + "spacing": 4, + "modules-left": [ + "custom/swaync", + "custom/media" + ], + "modules-center": [ + "custom/workspace1", + "custom/workspace2", + "custom/workspace3", + "custom/workspace4", + "custom/workspace5", + "custom/workspace6", + "custom/workspace7", + "custom/workspace8", + "custom/workspace9", + "custom/workspace10" + // "hyprland/workspaces" + ], + "modules-right": [ + "keyboard-state", + "tray", + "custom/separator", + "network", + "custom/tailscale", + "custom/separator", + "battery", + "custom/separator", + "custom/bluetooth", + "clock" + ], + // Modules configuration + "custom/swaync": { + "on-click": "swaync-client -t -sw", + "tooltip": false, + "format": "  {} | ", + "interval": 1, + "exec": "~/.config/hypr/scripts/get-volume.sh" + }, + "custom/separator": { + "format": "|" + }, + "custom/media": { + "interval": 1, + "exec": "/home/nathan/scripts/music.sh waybar", + "tooltip": false + }, + "custom/tailscale": { + "interval": 10, + "exec": "sleep 2 && /home/nathan/scripts/ts.sh short waybar", + "on-click": "/home/nathan/scripts/ts.sh en toggle", + "exec-on-event": true, + "tooltip": false + }, + "custom/bluetooth": { + "interval": 10, + "exec": "/home/nathan/scripts/bt.sh waybar", + "on-click": "alacritty --class float -e bluetuith", + "exec-on-event": true, + "tooltip": false + }, + "disk": { + "interval": 30, + "format": "{path} {percentage_used}%", + "path": "/", + "on-click": "/home/nathan/scripts/zellij.sh --cwd / zsh" + }, + "keyboard-state": { + "numlock": false, + "capslock": true, + "format": "{icon}", + "format-icons": { + "locked": "Caps ", + "unlocked": "" + } + }, + "clock": { + "tooltip-format": "{:%Y %B}\n{calendar}", + "format": "{:%Y-%m-%d %r}", + "interval": 1 + }, + "cpu": { + "format": "{usage}% ", + "tooltip": true, + "on-click": "/home/nathan/scripts/zellij.sh htop --sort-key=PERCENT_CPU" + }, + "memory": { + "format": "{}% ", + "tooltip": true, + "on-click": "/home/nathan/scripts/zellij.sh htop --sort-key=PERCENT_MEM" + }, + "temperature": { + "critical-threshold": 80, + // "format-critical": "{temperatureC}°C {icon}", + "format": "{temperatureC}°C {icon}", + "format-icons": [ + "", + "", + "", + "", + "" + ] + }, + "battery": { + "states": { + // "good": 95, + "warning": 30, + "critical": 15 + }, + "format": "{icon} {capacity}%", + "format-charging": "󱊥 {capacity}% ", + "format-plugged": " {capacity}%", + // "format-good": "", // An empty format will hide the module + // "format-full": "", + "format-icons": [ + "", + "", + "", + "", + "" + ] + }, + "network": { + "format-wifi": "{essid} ", //({signalStrength}%) + "format-ethernet": "{ipaddr}/{cidr} ", + "tooltip-format": "{ifname} via {gwaddr} ", + "format-linked": "{ifname} (No IP) ", + "format-disconnected": "Disconnected ⚠", + // "format-alt": "{ifname}: {ipaddr}/{cidr}", + "on-click": "alacritty --class float -e iwctl" + }, + "tray": { + "icon-size": 21, + "spacing": 10 + }, + "hyprland/submap": { + "format": "✌️ {}", + "max-length": 8, + "tooltip": false + }, + "hyprland/workspaces": { + "format": "{name}: {icon}", + "format-icons": { + "1": "", + "2": "", + "3": "", + "4": "", + "5": "", + "active": "", + "default": "" + } + }, + "custom/workspace1": { + "interval": 1, + "exec": "~/.config/hypr/scripts/desk.py -w -d 1", + "on-click": "~/.config/hypr/scripts/desk.py -d 1", + "exec-on-event": true, + "tooltip": false + }, + "custom/workspace2": { + "interval": 1, + "exec": "~/.config/hypr/scripts/desk.py -w -d 2", + "on-click": "~/.config/hypr/scripts/desk.py -d 2", + "exec-on-event": true, + "tooltip": false + }, + "custom/workspace3": { + "interval": 1, + "exec": "~/.config/hypr/scripts/desk.py -w -d 3", + "on-click": "~/.config/hypr/scripts/desk.py -d 3", + "exec-on-event": true, + "tooltip": false + }, + "custom/workspace4": { + "interval": 1, + "exec": "~/.config/hypr/scripts/desk.py -w -d 4", + "on-click": "~/.config/hypr/scripts/desk.py -d 4", + "exec-on-event": true, + "tooltip": false + }, + "custom/workspace5": { + "interval": 1, + "exec": "~/.config/hypr/scripts/desk.py -w -d 5", + "on-click": "~/.config/hypr/scripts/desk.py -d 5", + "exec-on-event": true, + "tooltip": false + }, + "custom/workspace6": { + "interval": 1, + "exec": "~/.config/hypr/scripts/desk.py -w -d 6", + "on-click": "~/.config/hypr/scripts/desk.py -d 6", + "exec-on-event": true, + "tooltip": false + }, + "custom/workspace7": { + "interval": 1, + "exec": "~/.config/hypr/scripts/desk.py -w -d 7", + "on-click": "~/.config/hypr/scripts/desk.py -d 7", + "exec-on-event": true, + "tooltip": false + }, + "custom/workspace8": { + "interval": 1, + "exec": "~/.config/hypr/scripts/desk.py -w -d 8", + "on-click": "~/.config/hypr/scripts/desk.py -d 8", + "exec-on-event": true, + "tooltip": false + }, + "custom/workspace9": { + "interval": 1, + "exec": "~/.config/hypr/scripts/desk.py -w -d 9", + "on-click": "~/.config/hypr/scripts/desk.py -d 9", + "exec-on-event": true, + "tooltip": false + }, + "custom/workspace10": { + "interval": 1, + "exec": "~/.config/hypr/scripts/desk.py -w -d 10", + "on-click": "~/.config/hypr/scripts/desk.py -d 10", + "exec-on-event": true, + "tooltip": false + } +} \ No newline at end of file diff --git a/.config/waybar/style.css b/.config/waybar/style.css new file mode 100644 index 0000000..073546f --- /dev/null +++ b/.config/waybar/style.css @@ -0,0 +1,216 @@ +* { + /* `otf-font-awesome` is required to be installed for icons */ + font-family: FiraCode Nerd Font Mono, FontAwesome, Roboto, Helvetica, Arial, sans-serif; + font-size: 15px; +} + +window#waybar { + background-color: rgba(0, 0, 0,0.5); + color: #ffffff; + transition-property: background-color; + transition-duration: .5s; +} + +window#waybar.hidden { + opacity: 0.2; +} + +/* +window#waybar.empty { + background-color: transparent; +} +window#waybar.solo { + background-color: #FFFFFF; +} +*/ + +window#waybar.termite { + background-color: #3F3F3F; +} + +window#waybar.chromium { + background-color: #000000; + border: none; +} + +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; +} + +/* https://github.com/Alexays/Waybar/wiki/FAQ#the-workspace-buttons-have-a-strange-hover-effect */ +button:hover { + background: inherit; + box-shadow: inset 0 -3px #ffffff; +} + +#workspaces button { + padding: 0 5px; + background-color: transparent; + color: #ffffff; +} + +#workspaces button:hover { + background: rgba(0, 0, 0, 0.2); +} + +#workspaces button.focused { + background-color: #64727D; + box-shadow: inset 0 -3px #ffffff; +} + +#workspaces button.urgent { + background-color: #eb4d4b; +} + +#mode { + background-color: #64727D; + border-bottom: 3px solid #ffffff; +} + +#clock, +#battery, +#cpu, +#memory, +#disk, +#temperature, +#backlight, +#network, +#pulseaudio, +#wireplumber, +#custom-media, +#tray, +#mode, +#idle_inhibitor, +#scratchpad, +#mpd { + padding: 0 10px; + 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 { + color: #ffffff; +} + +#battery.charging, #battery.plugged { + color: #26A65B; +} +#battery.warning { + background-color: transparent; +} + +@keyframes blink { + to { + background-color: #ffffff; + color: #000000; + } +} + +#battery.critical:not(.charging) { + background-color: #f53c3c; + color: #ffffff; + animation-name: blink; + animation-duration: 0.5s; + animation-timing-function: linear; + animation-iteration-count: infinite; + animation-direction: alternate; +} + +label:focus { + background-color: #000000; +} + + +#network.disconnected { + background-color: #f53c3c; +} + + +tray { + background-color: #2980b9; +} + +#tray > .passive { + -gtk-icon-effect: dim; +} + +#tray > .needs-attention { + -gtk-icon-effect: highlight; + background-color: #eb4d4b; +} + +#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; + /* margin: 0 5px; */ + /* min-width: 16px; */ +} + +#keyboard-state > label { + padding: 0 5px; +} + +/* #keyboard-state > label.locked { + background: rgba(0, 0, 0, 0.2); +} */ + +#scratchpad { + background: rgba(0, 0, 0, 0.2); +} + +#scratchpad.empty { + background-color: transparent; +}