diff --git a/bin/waybar-module-pomodoro b/bin/waybar-module-pomodoro new file mode 100755 index 0000000..b2c4c78 Binary files /dev/null and b/bin/waybar-module-pomodoro differ diff --git a/config/waybar/leftbar.css b/config/waybar/leftbar.css new file mode 100644 index 0000000..18b65aa --- /dev/null +++ b/config/waybar/leftbar.css @@ -0,0 +1,190 @@ +@define-color bg #010F1D; +@define-color warning-bg #D8C15E; +@define-color urgent-bg #EF5350; +@define-color disabled-bg #204462; +@define-color module-bg #0B253A; +@define-color module-fg white; +@define-color workspace-bg-hover #D8C15E; +@define-color workspace-bg-active #D6DEEB; + +* { + /* `otf-font-awesome` is required to be installed for icons */ + font-family: FontAwesome, Symbols Nerd Font, Inter, sans-serif; + font-weight: 700; + font-size: 14px; +} + +window#waybar { + background-color: @bg; + color: @module-fg; +} + +button { + border-radius: 0; + transition: none; +} + +/* https://github.com/Alexays/Waybar/wiki/FAQ#the-workspace-buttons-have-a-strange-hover-effect */ +button:hover { + box-shadow: inherit; + text-shadow: inherit; +} + +#workspaces { + margin: 5px; +} + +/* MODULE/WORKSPACES */ +#workspaces button { + padding: 0; + background-color: @module-bg; + color: @module-fg; + border: none; + margin-bottom: 5px; +} + +#workspaces button:hover { + color: @bg; + background: @workspace-bg-hover; +} + +#workspaces button.active { + color: @bg; + background: @workspace-bg-active; +} + +#workspaces button.urgent { + color: @bg; + background: @urgent-bg; +} + +#workspaces button:last-child { + margin-bottom: 0; +} + +/* MODULE/BATTERY */ +#battery { + font-size: 20px; + margin: 0 5px; + padding: 5px 0; + background-color: @module-bg; + color: @module-fg; +} + +#battery.warning { + color: @bg; + background-color: @warning-bg; +} + +#battery.critical { + background-color: @urgent-bg; + color: @module-fg; +} + +/* MODULE/CLOCK */ +#clock, +#clock.date { + font-family: Iosudo, monospace; + font-size: 16px; + background-color: @module-bg; + color: @module-fg; + padding: 3px 0; +} + +#clock { + margin: 0 5px; +} + +#clock.date { + margin: 5px; +} + +/* MODULE/PULSEAUDIO-SLIDER */ +#pulseaudio-slider { + margin: 0 5px; + padding: 14px 0; + background-color: @module-bg; + min-height: 60px; +} + +#pulseaudio-slider trough { + border: none; + border-radius: 0; + min-width: 10px; +} + +#pulseaudio-slider highlight { + border: none; + border-radius: 0; +} + +#custom-audio-icon, +#custom-brightness-icon { + font-size: 16px; + padding: 3px 0 5px 0; + background-color: @module-bg; +} + +#custom-audio-icon { + margin: 0px 5px; +} + +#custom-brightness-icon { + margin: 0 5px 5px 5px; +} + +/* MODULE/BACKLIGHT-SLIDER */ +#backlight-slider { + margin: 5px 5px 0 5px; + padding: 14px 0; + background-color: @module-bg; + min-height: 60px; +} + +#backlight-slider trough { + border: none; + border-radius: 0; + min-width: 10px; +} + +#backlight-slider highlight { + border: none; + border-radius: 0; +} + +/* MODULE/NETWORK */ +#network { + margin: 5px; + padding: 4px 5px 4px 4px; + background-color: @module-bg; + color: @module-fg; +} + +#network.disabled, +#network.disconnected { + color: @urgent-bg; + background-color: @disabled-bg; +} + +/* MODULE/TRAY */ +#tray { + margin: 0px 5px; + background-color: @module-bg; + padding: 5px; +} + +#tray > .passive { + -gtk-icon-effect: dim; +} + +#tray > .needs-attention { + -gtk-icon-effect: highlight; + background-color: @urgent-bg; +} + +#custom-power { + font-size: 18px; + margin: 5px; + padding: 3px 5px; + background-color: @urgent-bg; +} diff --git a/config/waybar/leftbar.jsonc b/config/waybar/leftbar.jsonc new file mode 100644 index 0000000..5eb4779 --- /dev/null +++ b/config/waybar/leftbar.jsonc @@ -0,0 +1,110 @@ +// -*- mode: jsonc -*- +{ + "position": "left", + "spacing": 0, + "modules-left": [ + "hyprland/workspaces", + ], + "modules-center": [], + "modules-right": [ + "pulseaudio/slider", + "custom/audio-icon", + "backlight/slider", + "custom/brightness-icon", + "clock", + "clock#date", + "battery", + "network", + // "bluetooth", // better to have blueman-applet instead + "tray", + "custom/power", + ], + // Modules configuration + "hyprland/workspaces": { + "on-scroll-down": "hyprctl dispatch workspace e+1", + "on-scroll-up": "hyprctl dispatch workspace e-1", + "all-outputs": true, + "active-only": false, + "warp-onscroll": false, + "format": "{name}", + }, + "pulseaudio/slider": { + "min": 0, + "max": 100, + "orientation": "vertical", + }, + "custom/audio-icon": { + "format": "󰕾", + "tooltip": false, + }, + "custom/brightness-icon": { + "format": "󰃠", + "tooltip": false, + }, + "backlight/slider": { + "min": 30, + "max": 100, + "orientation": "vertical", + "device": "intel_backlight", + }, + "battery": { + "bat": "BAT0", + "format": "{icon}", + "tooltip-format": "({capacity}%) {timeTo}", + "interval": 60, + "states": { + "warning": 40, + "critical": 20, + }, + "format-icons": [ + "󰁺", + "󰁻", + "󰁼", + "󰁽", + "󰁾", + "󰁿", + "󰂀", + "󰂁", + "󰂂","󰁹", + ] + }, + "clock": { + "format": "{:%H\n%M}", + "tooltip": false, + }, + "clock#date": { + "format": "{:%m\n%d\n%y}", + "tooltip": true, + "tooltip-format": "{:%Y %B}\n{calendar}", + }, + "network": { + "format-wifi": "", + "format-ethernet": "", + "format-linked": "", + "tooltip-format-wifi": " {essid} ({signalStrength}%)", + "tooltip-format-disconnected": "Disconnected", + "format-disconnected": "󰖪", + "on-click": "ghostty -e nmtui", + "tooltip": true, + }, + "bluetooth": { + "format": "󰂯","format-connected": "󰂱", + "format-disabled": "󰂲", + "format-on": "","format-off": "󰂲","on-click": "blueman-manager", + }, + "tray": { + "icon-size": 18, + "spacing": 5 + }, + "custom/power": { + "format": "󰐥", + "tooltip": true, + "tooltip-format": "Power Menu", + "menu": "on-click", + "menu-file": "$HOME/.config/waybar/power_menu.xml", // Menu file in resources folder + "menu-actions": { + "shutdown": "shutdown", + "reboot": "reboot", + } + }, +} diff --git a/config/waybar/power_menu.xml b/config/waybar/power_menu.xml new file mode 100644 index 0000000..79de8f3 --- /dev/null +++ b/config/waybar/power_menu.xml @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + Shutdown + + + + + + + + Reboot + + + + diff --git a/config/waybar/scripts/launch.sh b/config/waybar/scripts/launch.sh new file mode 100755 index 0000000..42969dc --- /dev/null +++ b/config/waybar/scripts/launch.sh @@ -0,0 +1,4 @@ +#!/usr/bin/env fish + +killall waybar +waybar -c ~/.config/waybar/topbar.jsonc -s ~/.config/waybar/topbar.css & diff --git a/config/waybar/topbar.css b/config/waybar/topbar.css new file mode 100644 index 0000000..13e0e1d --- /dev/null +++ b/config/waybar/topbar.css @@ -0,0 +1,122 @@ +@define-color bar-bg #000000; +@define-color bar-fg #D6DEEB; +@define-color bar-fg-l #010F1D; +@define-color bar-fg-muted #8BADC1; +@define-color module-bg #1E1E1E; +@define-color module-bg-muted #637777; +@define-color ws-bg-active #ffffff; +@define-color ws-bg-persistent #1e1e1e; +@define-color bluetooth-bg #4B1B9F; +@define-color custom-red #DC2E29; +@define-color custom-yellow #FFEB95; +@define-color custom-green #ADDB67; + + +* { + font-family: Symbols Nerd Font, SF Pro Display, sans-serif; + font-weight: 700; + font-size: 11px; +} + +window#waybar { + background: transparent; + color: @bar-fg; + padding: 3px; + /* border-bottom: 2px solid #0E293F; */ +} + +button { + border-radius: 0; +} + +#window { + margin: 2px 0 4px 2px; +} + +#workspaces { + margin: 2px 0 4px 100px; +} + +#workspaces button { + background-color: @module-bg; + min-width: 10px; + min-height: inherit; + padding: 0; + margin: 0 1px 0 1px; + transition: background-color 100ms, min-width 100ms; +} + +#workspaces button.persistent { + background-color: @ws-bg-persistent; +} + +#workspaces button.active { + background-color: @ws-bg-active; + min-width: 40px; +} + +#workspaces button.urgent { + min-width: 40px; + background-color: @custom-red; +} + +#clock, +#custom-pomodoro, +#memory, +#custom-power, +#backlight, +#pulseaudio, +#bluetooth, +#network, +#tray { + background-color: @module-bg; + padding: 0 10px; + margin: 2px 0 4px 2px; +} + +#battery { + background-color: @module-bg; + padding: 2px 10px; + margin: 2px 0 4px 1px; +} + +#battery.warning { + background-color: @custom-yellow; + color: @bar-fg-l; +} + +#battery.critical { + background-color: @custom-red; +} + +#clock { + background-color: @custom-green; + color: @bar-fg-l; +} + +#pulseaudio.muted { + color: @module-bg-muted; +} + +#bluetooth.on { + background-color: @bluetooth-bg; +} + +#bluetooth.disabled, +#bluetooth.off { + color: @module-bg-muted; +} + +#network.disconnected, +#network.disabled { + background-color: @module-bg-muted; + color: @bar-fg; +} + +#custom-power { + font-size: 18px; + background-color: @module-bg; + color: #EF5350; + padding: 0 10px; + margin: 2px 2px 4px 2px; +} diff --git a/config/waybar/topbar.jsonc b/config/waybar/topbar.jsonc new file mode 100644 index 0000000..34c7861 --- /dev/null +++ b/config/waybar/topbar.jsonc @@ -0,0 +1,151 @@ +// -*- mode: jsonc -*- +{ + "layer": "top", + "position": "top", + "spacing": 0, + "margin-top": 0, + "margin-left": 0, + "margin-right": 0, + "margin-bottom": 0, + + "modules-left": [ + "hyprland/window", + ], + + "modules-center": [ + ], + + "modules-right": [ + "hyprland/workspaces", + "battery", + "custom/pomodoro", + "clock", + "memory", + "backlight", + "pulseaudio", + "bluetooth", + "network", + "tray", + "custom/power", + ], + + // Modules configuration + "hyprland/window": { + "icon": true, + "icon-size": 18, + "format": "{title}", + }, + + "hyprland/workspaces": { + "on-scroll-down": "hyprctl dispatch workspace e+1", + "on-scroll-up": "hyprctl dispatch workspace e-1", + "all-outputs": true, + "active-only": false, + "warp-onscroll": false, + "format": "", + }, + + "battery": { + "bat": "BAT0", + "interval": 5, + "format": "{icon} {capacity}%", + "format-plugged": "{icon} {capacity}% (CHR)", + "tooltip-format": "({capacity}%) {timeTo}", + "states": { + "warning": 30, + "critical": 20, + }, + "format-icons": { + "charging": "", + "default": [ "", "", "", "", "" ] + } + }, + + "clock": { + "interval": 1, + "format": " {:%H : %M}", + "format-alt": "󰃭 {:%a, %B %d, %Y}", + "tooltip-format": "{:%Y %B}\n{calendar}", + }, + + "custom/pomodoro": { + "format": "{}", + "return-type": "json", + "exec": "waybar-module-pomodoro --work-icon \" \" --break-icon \"\"", + "on-click": "waybar-module-pomodoro toggle", + "on-click-right": "waybar-module-pomodoro reset" + }, + + "memory": { + "interval": 30, + "format": " {used:0.1f}G / {total:0.1f}G" + }, + + "backlight": { + "format": "{icon} {percent}%", + "tooltip-format": "{icon} Brightness: {percent}%", + "format-icons": ["󰃚", "󰃛", "󰃜", "󰃝", "󰃞", "󰃟", "󰃠"] + }, + + "pulseaudio": { + "format": "{icon} {volume}%", + "format-bluetooth": "󰂰 {volume}%", + "format-muted": "󰝟 M", + "format-icons": { + "default": ["󰕿", "󰖀", "󰕾"] + }, + "on-click": "pavucontrol", + "on-click-right": "amixer set Master toggle", + "scroll-step": 4, + }, + + "bluetooth": { + "format": "󰂯 {status}", + "format-on": "󰂯 ON", + "format-off": "󰂲 OFF", + "format-disabled": "󰂲 DA", + "format-connected": "󰂱 ({device_battery_percentage}%)", + "tooltip-format": "({device_battery_percentage}%) {device_alias}", + "tooltip-format-on": "Bluetooth: ON", + "tooltip-format-disabled": "Bluetooth: DISABLED", + "on-click": "blueman-manager", + "on-click-right": "rfkill toggle bluetooth" + }, + + "network": { + "format-wifi": "{icon} {signalStrength}%", + "format-ethernet": " {ipaddr}/{cidr}", + "format-disconnected": "󰤫 DC", + "format-disabled": "󰤮 DA", + "format-linked": "󰈁", + "tooltip-format-ethernet": " {ifname}", + "tooltip-format-wifi": "{icon} {essid} ({signalStrength}%)", + "tooltip-format-disconnected": "󰤫 Disconnected", + "format-icons": [ + "󰤯", + "󰤟", + "󰤢", + "󰤥", + "󰤨" + ], + "on-click": "ghostty -e nmtui", + "tooltip": true, + }, + + "tray": { + "icon-size": 14, + "spacing": 5 + }, + + "custom/power": { + "format": "󰐥", + "tooltip": true, + "tooltip-format": "Power Menu", + "menu": "on-click", + "menu-file": "$HOME/.config/waybar/power_menu.xml", // Menu file in resources folder + "menu-actions": { + "shutdown": "systemctl poweroff", + "reboot": "systemctl reboot", + } + }, +} diff --git a/user/subs/waybar.nix b/user/subs/waybar.nix new file mode 100644 index 0000000..ebe5ea9 --- /dev/null +++ b/user/subs/waybar.nix @@ -0,0 +1,21 @@ +{ config, lib, ... }: + +let + cfg = config.subs.waybar; +in +{ + options = { + subs.waybar.enable = lib.mkOption { + default = false; + type = lib.types.bool; + }; + }; + + config = lib.mkIf cfg.enable { + programs.waybar = { + enable = true; + settings = { + }; + }; + }; +}