diff options
Diffstat (limited to 'home/waybar')
| -rw-r--r-- | home/waybar/config | 160 | ||||
| -rw-r--r-- | home/waybar/default.nix | 304 | ||||
| -rw-r--r-- | home/waybar/style.css | 330 |
3 files changed, 407 insertions, 387 deletions
diff --git a/home/waybar/config b/home/waybar/config deleted file mode 100644 index 779a9a1..0000000 --- a/home/waybar/config +++ /dev/null @@ -1,160 +0,0 @@ -{ - // ------------------------------------------------------------------------- - // Global configuration - // ------------------------------------------------------------------------- - "ipc": true, - "position": "bottom", - "layer": "top", - "height": 30, - "mode": "dock", - "modules-left": [ - "hyprland/hide", - "hyprland/mode", - "hyprland/workspaces", - "disk", - "memory", - "cpu", - "temperature", - "custom/spotify" - ], - "modules-center": [ - "hyprland/window" - ], - "modules-right": [ - "pulseaudio", - "battery", - "backlight", - "clock#date", - "clock#time", - "network", - "tray" - ], - // ------------------------------------------------------------------------- - // Modules - // ------------------------------------------------------------------------- - "hyprland/hide": { - "hide-on-startup": true - }, - "battery": { - "interval": 1, - "states": { - "low": 30, - "warning": 15, - "critical": 5 - }, - "format": "{icon} {capacity}%", - "format-discharging": "{icon} {capacity}%", - "format-charging": " {capacity}%", - "tooltip-format": "{time} left", - "format-icons": [ - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - ], - "tooltip": true, - "full-at": 95 - }, - "clock#time": { - "interval": 10, - "format": "{:%H:%M}", - "tooltip": false - }, - "clock#date": { - "interval": 60, - "format": "{:%A, %e %b %Y}", - "tooltip": true - }, - "cpu": { - "interval": 2, - "tooltip": true, - "format": " {usage}%", - "states": { - "low": 0, - "normal": 20, - "warning": 70, - "critical": 90 - } - }, - "memory": { - "interval": 5, - "format": " {used:0.1f}G", - "tooltip-format": "{used:0.1f}G / {total:0.1f}G", - "states": { - "warning": 70, - "critical": 90 - } - }, - "network": { - "interval": 1, - "format-wifi": "{icon}", - "format-disconnected": "", - "format-icons": [ - "", - "", - "", - "", - "" - ], - "tooltip-format": "{essid} ({signalStrength}%) - {ifname} - {ipaddr} - {bandwidthDownBits} {bandwidthUpBits}", - "tooltip": true, - }, - "hyprland/mode": { - "format": "<span style=\"italic\"> {}</span>", - "tooltip": false - }, - "hyprland/window": { - "format": "{}", - "max-length": 60, - "tooltip": true - }, - "hyprland/workspaces": { - "all-outputs": true, - "format": "{icon}" - }, - "pulseaudio": { - "scroll-step": 1, - "format": "{icon} {volume}%", - "format-muted": "", - "format-bluetooth": " {icon} {volume}%", - "format-bluetooth-muted": "", - "on-click": "pulseaudio-control togmute", - "on-click-middle": "pulseaudio-control --sink-blacklist 'alsa_output.pci-0000_00_1f.3-platform-skl_hda_dsp_generic.HiFi__hw_sofhdadsp_3__sink,alsa_output.pci-0000_00_1f.3-platform-skl_hda_dsp_generic.HiFi__hw_sofhdadsp_4__sink,alsa_output.pci-0000_00_1f.3-platform-skl_hda_dsp_generic.HiFi__hw_sofhdadsp_5__sink' next-sink" - }, - "temperature": { - "critical-threshold": 90, - "interval": 5, - "format": "{icon} {temperatureC}°C", - "format-icons": [ - "", - "", - "", - "", - "" - ], - "tooltip": true - }, - "disk": { - "interval": 10, - "format": "{free}" - }, - "backlight": { - "device": "intel_backlight", - "format": "{icon} {percent}", - "format-icons": [ - "" - ], - "on-scroll-up": "brightnessctl set +1% -e 6 -n 1", - "on-scroll-down": "brightnessctl set 1%- -e 6 -n 1" - }, - "tray": { - "icon-size": 24, - "spacing": 10 - } -} diff --git a/home/waybar/default.nix b/home/waybar/default.nix index bfe3c39..fd9a735 100644 --- a/home/waybar/default.nix +++ b/home/waybar/default.nix @@ -1,6 +1,304 @@ +{ pkgs, lib, ... }: + +let + waybarTimer = pkgs.writeShellScript "waybar_timer.sh" '' + #!/bin/sh + CUR_TIME=$(date +%s) + STATUS=$(cat /var/tmp/waybar_timer) + + if [ $STATUS == "READY" ]; then + echo "" + elif [ $STATUS == "FINISHED" ]; then + mpv $HOME/.config/waybar/modules/timer.wav & + echo "READY" > /var/tmp/waybar_timer + echo "" + elif [[ $STATUS > $CUR_TIME ]]; then + DIFF=$(( (STATUS - CUR_TIME) )) + echo $( date -d @$DIFF +%M:%S ) + else + if [ -f "/var/tmp/waybar_timer" ]; then + echo "FINISHED" > /var/tmp/waybar_timer + echo "" + else + echo "READY" > /var/tmp/waybar_timer + echo "" + fi + fi + ''; +in + { - programs.waybar = { enable = true; }; + programs.waybar = { + systemd.enable = true; + enable = true; + settings = [ + { + ipc = true; + layer = "top"; + position = "top"; + height = 36; + margin = "5 5 0 5"; + modules-left = [ + "custom/startmenu" + "hyprland/workspaces" + "idle_inhibitor" + "keyboard-state" + "hyprland/language" + "systemd-failed-units" + "wireplumber" + "privacy" + "hyprland/window" + ]; + modules-center = [ + "clock" + "custom/timer" + "mpris" + ]; + modules-right = [ + "network" + "temperature" + "load" + "group/system-status" + "bluetooth" + "tray" + "custom/weather" + "custom/exit" + ]; + + "hyprland/workspaces" = { + format = "{name}"; + format-icons = { + default = " "; + active = " "; + urgent = " "; + }; + on-scroll-up = "${pkgs.hyprland}/bin/hyprctl dispatch workspace e+1"; + on-scroll-down = "${pkgs.hyprland}/bin/hyprctl dispatch workspace e-1"; + }; + + clock = { + interval = 1; + format = "{:%A, %Y-%m-%d %H:%M:%S}"; + tooltip-format = "<big>{:%Y %B}</big>\n<tt><small>{calendar}</small></tt>"; + calendar = { + mode = "year"; + weeks-pos = "right"; + mode-mon-col = 3; + format = { + months = "<span color='#ffead3'><b>{}</b></span>"; + days = "<span color='#ecc6d9'><b>{}</b></span>"; + weeks = "<span color='#99ffdd'><b>W{}</b></span>"; + weekdays = "<span color='#ffcc66'><b>{}</b></span>"; + today = "<span color='#ff6699'><b><u>{}</u></b></span>"; + }; + }; + }; + + "hyprland/window" = { + max-length = 80; + separate-outputs = false; + rewrite = { + "" = "🙈 No Windows?"; + }; + }; + + "hyprland/language" = { + format = "{long}"; + min-length = 14; + }; + + "keyboard-state" = { + capslock = true; + format = "{icon}"; + format-icons = { + locked = ""; + unlocked = ""; + }; + tooltip = false; + }; + + "custom/weather" = { + format = "{}°C"; + tooltip = true; + interval = 3600; + exec = "${pkgs.wttrbar}/bin/wttrbar --date-format=%d.%m.%Y --location=Helsinki"; + return-type = "json"; + }; + + "group/system-status" = { + orientation = "horizontal"; + modules = [ + "cpu" + "memory" + "battery" + "backlight" + ]; + }; + memory = { + interval = 1; + format = " {}%"; + tooltip-format = "{used:0.1f}G / {total:0.1f}G"; + states = { + warning = 70; + critical = 90; + }; + }; + + load = { + interval = 1; + format = "load: {load1:>4}"; + max-length = 10; + }; + + cpu = { + interval = 1; + format = " {usage:>3}%"; + tooltip-format = "{usage}%"; + tooltip = true; + states = { + warning = 70; + critical = 90; + }; + }; + + backlight = { + device = "intel_backlight"; + format = "{icon} {percent}%"; + format-icons = [ "" ]; + on-scroll-up = "${pkgs.brightnessctl}/bin/brightnessctl set +1%"; + on-scroll-down = "${pkgs.brightnessctl}/bin/brightnessctl set 1%-"; + }; + + systemd-failed-units = { + hide-on-ok = false; + format = "✗ {nr_failed}"; + format-ok = "✓"; + system = true; + }; + + temperature = { + format = "{temperatureC}°C "; + }; + + privacy = { + icon-spacing = 4; + icon-size = 18; + transition-duration = 250; + modules = [ + { + type = "screenshare"; + tooltip = true; + tooltip-icon-size = 24; + } + { + type = "audio-out"; + tooltip = true; + tooltip-icon-size = 24; + } + { + type = "audio-in"; + tooltip = true; + tooltip-icon-size = 24; + } + ]; + ignore-monitor = true; + }; + + network = { + tooltip = true; + interval = 1; + format-wifi = "{icon} {essid} ({signalStrength}) up: {bandwidthUpBits:>6} down: {bandwidthDownBits:>6}"; + format-ethernet = "{icon} up: {bandwidthUpBits:>6} down: {bandwidthDownBits:>6}"; + format-disconnected = "⚠ Disconnected"; + tooltip-format = "{ifname}: {ipaddr}/{cidr}\nUp: {bandwidthUpBits:>6}\nDown: {bandwidthDownBits:>6}"; + format-icons = { + wifi = ""; + ethernet = ""; + }; + }; + tray = { + spacing = 12; + }; + bluetooth = { + format = " {status}"; + format-connected = " {device_alias}"; + format-connected-battery = " {device_alias} {device_battery_percentage}%"; + tooltip-format = "{controller_alias}\t{controller_address}\n\n{num_connections} connected"; + tooltip-format-connected = "{controller_alias}\t{controller_address}\n\n{num_connections} connected\n\n{device_enumerate}"; + tooltip-format-enumerate-connected = "{device_alias}\t{device_address}"; + tooltip-format-enumerate-connected-battery = "{device_alias}\t{device_address}\t{device_battery_percentage}%"; + }; + mpris = { + format = "DEFAULT: {player_icon} {dynamic}"; + format-paused = "DEFAULT: {status_icon} <i>{dynamic}</i>"; + interval = 1; + player-icons = { + default = "▶"; + mpv = "🎵"; + }; + status-icons = { + paused = "⏸"; + }; + }; + wireplumber = { + format = "{icon} {volume}%"; + format-muted = " {volume}%"; + format-icons = { + default = [ + "" + "" + "" + ]; + }; + on-click = "${pkgs.lxqt.pavucontrol-qt}/bin/pavucontrol-qt"; + }; + + "custom/timer" = { + tooltip = false; + min-length = 5; + exec = "${waybarTimer}"; + on-click = "date --date='5 minutes' +%s > /var/tmp/waybar_timer"; + on-click-right = "echo READY > /var/tmp/waybar_timer"; + on-click-middle = "date --date='1 minute' +%s > /var/tmp/waybar_timer"; + on-scroll-up = "date --date='5 seconds' +%s > /var/tmp/waybar_timer"; + on-scroll-down = "date --date='30 minutes' +%s > /var/tmp/waybar_timer"; + interval = 1; + }; + + "custom/exit" = { + format = ""; + on-click = "${pkgs.wlogout}/bin/wlogout"; + }; + + "custom/startmenu" = { + format = "⚡"; + on-click = "${pkgs.walker}/bin/walker"; + }; - home.file."./config/waybar/config".source = ./config; - home.file."./config/waybar/style.css".source = ./style.css; + "idle_inhibitor" = { + format = "{icon}"; + format-icons = { + activated = ""; + deactivated = ""; + }; + }; + battery = { + states = { + warning = 30; + critical = 15; + }; + format = "{icon} {capacity}%"; + format-charging = " {capacity}%"; + format-plugged = " {capacity}%"; + format-full = " {capacity}%"; + format-icons = [ + "" + "" + "" + ]; + }; + } + ]; + style = builtins.readFile ./style.css; + }; } diff --git a/home/waybar/style.css b/home/waybar/style.css index 8fe60c7..7e6e821 100644 --- a/home/waybar/style.css +++ b/home/waybar/style.css @@ -1,258 +1,140 @@ -@keyframes blink-low { - 70% { - color: @foreground; - } +/* Nord Theme Colors */ +@define-color nord0 #2e3440; +@define-color nord1 #3b4252; +@define-color nord2 #434c5e; +@define-color nord3 #4c566a; +@define-color nord4 #d8dee9; +@define-color nord5 #e5e9f0; +@define-color nord6 #eceff4; +@define-color nord7 #8fbcbb; +@define-color nord8 #88c0d0; +@define-color nord9 #81a1c1; +@define-color nord10 #5e81ac; +@define-color nord11 #bf616a; +@define-color nord13 #ebcb8b; - to { - color: @foreground; - background-color: #744E0D; - } -} - -@keyframes blink-warning { - 70% { - color: @foreground; - } - - to { - color: @foreground; - background-color: @warning; - } -} - -@keyframes blink-critical { - 70% { - color: @foreground; - } - - to { - color: @foreground; - background-color: @critical; - } -} - - -/* ----------------------------------------------------------------------------- - * Styles - * -------------------------------------------------------------------------- */ - -/* Nord */ -/* Gruvbox */ -@define-color foreground #D4BE98; -@define-color background #202020; -@define-color backgroundlight #2A2A2A; -@define-color mode #a89984; -@define-color workspaces #458588; -@define-color workspacesfocused #83a598; -@define-color sound #E78A4E; -@define-color network #A9B665; -@define-color memory #7DAEA3; -@define-color cpu #8EC07C; -@define-color layout #689d6a; -@define-color battery #A9B665; -@define-color date #282828; -@define-color time #ebdbb2; -@define-color warning #DE655E; -@define-color critical #FB4934; -@define-color temp #A9B665; - -/* Reset all styles */ +/* Base styles */ * { - border: none; - border-radius: 0; - min-height: 0; - margin: 0; - padding: 0; + font-family: 'Iosevka Nerd Font', monospace; + font-size: 18px; + border: none; + border-radius: 8px; + margin: 0; + padding: 0; + min-height: 0; + transition: background-color 0.2s ease-in-out, color 0.2s ease-in-out, opacity 0.2s ease-in-out; } -/* The whole bar */ #waybar { - background: @background; - color: @foreground; - font-family: Sarasa Term K, JetBrainsMono Nerd Font, Material Design Icons, unifont, Fira Code, Terminus, Siji; - font-size: 12pt; - font-weight: bold; -} - -/* Each module */ -#battery, -#clock, -#cpu, -#memory, -#custom-clockify, -#custom-spotify, -#backlight, -#mode, -#network, -#disk, -#pulseaudio, -#workspaces, -#temperature { - padding: 0 10px; - margin: 5px 5px; - border-radius: 10em; - background-color: @backgroundlight; - color: @foreground; -} - -/* Each module that should blink */ -#mode, -#memory, -#temperature, -#battery { - animation-timing-function: ease-out; - animation-iteration-count: infinite; - animation-direction: alternate; -} - -/* Each critical module */ -#memory.critical, -#cpu.critical, -#temperature.critical, -#battery.critical { - color: @critical; -} - -/* Each critical that should blink */ -#mode, -#memory.critical, -#temperature.critical, -#battery.critical.discharging { - animation-name: blink-critical; - animation-duration: 2s; -} - -/* Each warning */ -#network.disconnected, -#memory.warning, -#cpu.warning, -#temperature.warning, -#battery.warning { - color: @warning; -} - -#cpu.low { - color: @memory; + background-color: transparent; + color: @nord5; } -/* Each warning that should blink */ -#battery.warning.discharging { - animation-name: blink-warning; - animation-duration: 3s; +#systemd-failed-units, #temperature, #load, #privacy, #mpris, +#workspaces, #window, #cpu, #memory, #battery, #backlight, +#wireplumber, #network, #bluetooth, #clock, #tray, +#custom-startmenu, #custom-exit, #custom-weather, #idle_inhibitor, #custom-timer, +#language, #keyboard-state { + background-color: rgba(46, 52, 64, 0.9); /* nord0 with opacity */ + color: @nord5; + padding: 0 12px; + margin: 4px 2px; + border-radius: 8px; } -#battery.low.discharging { - animation-name: blink-low; - animation-duration: 5s; +/* Module grouping */ +#wireplumber { + margin-right: 8px; /* Separate from system-status group */ } - -/* And now modules themselves in their respective order */ - -#mode { /* Shown current Sway mode (resize etc.) */ - color: @foreground; - background: @mode; +#group-system-status > * { + background-color: @nord2; + margin: 4px 1px; } - -/* Workspaces stuff */ -#workspaces { - background: #2A2A2A; +#network, #bluetooth { + background-color: @nord3; + margin-left: 8px; /* Separate network group */ } +/* Module-specific colors and styles */ #workspaces button { - padding: 0; - color: #D4BE98; - font-size: 16pt; -} - -#workspaces button.persistent { - color: #3E3E3E; + color: @nord7; + font-size: 16px; + padding: 0 8px; + border-radius: 8px; } - #workspaces button.visible { - color: #FE8019; + color: @nord8; + background-color: @nord1; } - -#network { - color: @network; +#workspaces button:hover { + background-color: @nord2; + color: @nord6; + opacity: 0.9; } - -#disk { - color: #FABD2F; - border-radius: 10em 0 0 10em; - margin-right: 0; + #workspaces button.active { + color: @nord6; } - -#memory { - color: @memory; - margin-right: 0; - margin-left: 0; - border-radius: 0; +#cpu { color: @nord9; } +#memory { color: @nord7; } +#battery { color: @nord7; } +#mpris { color: @nord7; } +#backlight { color: @nord9; } +#wireplumber { color: @nord9; } +#network { color: @nord7; min-width: 220px; } /* Fixed width for consistent alignment */ +#bluetooth { color: @nord10; } +#language { + color: @nord10; + min-width: 40px; /* Ensure visibility */ + background-color: rgba(46, 52, 64, 0.9); /* Explicit nord0 background */ } - -#cpu { - color: @cpu; - margin-right: 0; - margin-left: 0; - border-radius: 0; +#keyboard-state { color: @nord10; } +#custom-weather { color: @nord7; } +#clock { background-color: @nord1; } +#custom-startmenu, #custom-exit, #idle_inhibitor { + font-size: 16px; } - -#temperature { - color: @temp; - border-radius: 0 10em 10em 0; - margin-left: 0; +#custom-startmenu:hover, #custom-exit:hover, #idle_inhibitor:hover { + background-color: @nord2; + color: @nord6; + opacity: 0.9; } -#pulseaudio { - color: @sound; - margin-right: 0; - border-radius: 10em 0 0 10em; +/* Warning and Critical States */ +#cpu.warning, #memory.warning, #battery.warning { + color: @nord13; + animation: blink-warning 2s ease-in-out infinite alternate; } - -#pulseaudio.muted { - color: #3E3E3E; -} - -#battery { - color: @battery; - margin-right: 0; - margin-left: 0; - border-radius: 0; +#cpu.critical, #memory.critical, #battery.critical { + color: @nord11; + animation: blink-critical 1s ease-in-out infinite alternate; } - -#backlight { - color: #D3869B; - margin-left: 0; - border-radius: 0 10em 10em 0; -} - -#clock.date { - background: @date; - color: @foreground; - margin-right: 0; - border-radius: 10em 0 0 10em; +#network.disconnected { + color: @nord11; } -#clock.time { - background: @time; - color: @background; - margin-left: 0; - border-radius: 0 10em 10em 0; +/* Animations */ +@keyframes blink-warning { + to { background-color: @nord13; color: @nord0; } } - -#tray { - margin: 0 5px; +@keyframes blink-critical { + to { background-color: @nord11; color: @nord0; } } +/* Tooltip */ tooltip { - color: @foreground; - background-color: @background; - font-weight: 400; - font-family: Fira Code; - margin: 0 10px; - border-radius: 1em; + background-color: @nord0; + color: @nord5; + border-radius: 8px; + padding: 5px 10px; } - tooltip label { - color: @foreground; - padding: 0 5px; + color: @nord5; +} + +/* Tray */ +#tray > .passive { + color: @nord3; } +#tray > .active { + color: @nord8; + } |
