waybar for mee<3

This commit is contained in:
2026-04-07 22:40:16 +03:00
committed by Sweetbread
parent fd9a6db867
commit e52ee5b09f
4 changed files with 577 additions and 398 deletions
-1
View File
@@ -11,7 +11,6 @@
./user/qt.nix ./user/qt.nix
./user/sops.nix ./user/sops.nix
./user/ssh.nix ./user/ssh.nix
./user/waybar.nix
./user/yazi.nix ./user/yazi.nix
./user/zsh.nix ./user/zsh.nix
-151
View File
@@ -1,151 +0,0 @@
{ osConfig, config, pkgs, ... }: {
home.packages = with pkgs; [
font-awesome
nerd-fonts.symbols-only
playerctl
cava
];
programs.waybar = {
enable = true;
systemd.enable = true;
settings.mainBar = {
modules-left = [
"hyprland/workspaces"
"hyprland/language"
"keyboard-state"
"cava"
];
modules-center = [
"mpris"
];
modules-right = [
"tray"
"group/system"
"pulseaudio"
"battery"
"clock"
];
cava = {
bars = 14;
sleep_timer = 5;
hide_on_silence = true;
bar_delimiter = 0;
input_delay = 0;
format-icons = [" " "" "" "" "" "" "" "" ""];
};
clock = {
tooltip = false;
interval = 5;
format = "{:L%d %b - %H:%M %a}";
};
pulseaudio = {
format = "{icon} {volume}%";
format-icons = {
headphone = "";
hands-free = "";
headset = "";
phone = "";
phone-muted = "";
portable = "";
car = "";
default = ["" ""];
};
on-click = "ghostty --title=pulsemixer -e pulsemixer";
};
mpris = {
format = "{dynamic}";
dynamic-len = if osConfig.host.laptop then 32 else 64;
dynamic-order = [ "title" "artist" "album" ];
};
battery = {
interval = 5;
states = {
warning = 30;
critical = 15;
};
format = "{icon} {capacity}%";
format-icons = {
default = ["󰂎" "󰁺" "󰁻" "󰁼" "󰁽" "󰁾" "󰁿" "󰂀" "󰂁" "󰂂" "󰁹"];
charging = ["󰢟" "󰢜" "󰂆" "󰂇" "󰂈" "󰢝" "󰂉" "󰢞" "󰂊" "󰂋" "󰂅"];
};
};
"keyboard-state" = {
capslock = true;
format = "{icon}";
format-icons = {
locked = "CAPS";
unlocked = "";
};
};
"hyprland/language" = {
format-en = "en";
format-ru = "ru";
};
"group/system" = {
orientation = "inherit";
drawer = {
transition-duration = 500;
transition-left-to-right = false;
};
modules = [
"network"
"custom/mem"
"cpu"
"temperature"
];
};
network = {
format = "{ifname}";
format-wifi = " {essid} ({signalStrength}%)";
format-ethernet = "{ifname}";
format-disconnected = "";
tooltip-format = "{ipaddr}";
max-length = 50;
on-click = "ghostty --title=nmtui -e nmtui";
};
"custom/weather" = {
format = "{}";
tooltip = true;
interval = 1800;
exec = "python3 $HOME/.config/waybar/scripts/wttr.py";
return-type = "json";
};
"custom/mem" = {
format = "{} ";
interval = 3;
exec = "free -h | awk '/Mem:/{printf $3}'";
tooltip = false;
};
cpu = {
interval = 2;
format = "{usage}% ";
min-length = 6;
};
temperature = {
hwmon-path = "/sys/class/hwmon/hwmon5/temp1_input";
critical-threshold = 80;
format = "{temperatureC}°C {icon}";
format-icons = ["" "" "" "" ""];
tooltip = false;
};
};
};
}
+212 -33
View File
@@ -1,35 +1,214 @@
{ config, pkgs, ... }: { { osConfig, config, pkgs, lib, ... }: {
programs.waybar.settings.mainBar.spacing = 4; home.packages = with pkgs; [
programs.waybar.style = let font-awesome
nerd-fonts.symbols-only
playerctl
cava
pulsemixer
];
programs.waybar = {
enable = true;
systemd.enable = true;
settings.mainBar = {
modules-center = [
"group/left"
"group/center"
"group/right"
];
"group/left" = {
orientation = "inherit";
modules = [
"hyprland/workspaces"
"custom/sep-left"
"hyprland/language"
"keyboard-state"
];
};
"group/center" = {
orientation = "inherit";
modules = [
"cava"
"mpris"
];
};
"group/right" = {
orientation = "inherit";
modules = [
"tray"
"custom/sep-left"
"group/system"
"custom/sep-left"
"pulseaudio"
"custom/sep-left"
"battery"
"clock"
];
};
cava = {
bars = 9;
bar_delimiter = 0;
stereo = false;
input_delay = 0;
format-icons = [" " "" "" "" "" "" "" "" ""];
};
clock = {
tooltip = false;
interval = 5;
format = "{:L%d %b - %H:%M %a}";
};
pulseaudio = {
format = "{icon} {volume}%";
format-icons = {
headphone = "";
hands-free = "";
headset = "";
phone = "";
phone-muted = "";
portable = "";
car = "";
default = ["" ""];
};
on-click = "ghostty --title=pulsemixer -e pulsemixer";
};
mpris = {
format = "{dynamic}";
dynamic-len = if osConfig.host.laptop then 16 else 32;
dynamic-order = [ "title" "artist" "album" ];
};
battery = {
interval = 5;
states = {
warning = 30;
critical = 15;
};
format = "{icon} {capacity}% | ";
format-icons = {
default = ["󰂎" "󰁺" "󰁻" "󰁼" "󰁽" "󰁾" "󰁿" "󰂀" "󰂁" "󰂂" "󰁹"];
charging = ["󰢟" "󰢜" "󰂆" "󰂇" "󰂈" "󰢝" "󰂉" "󰢞" "󰂊" "󰂋" "󰂅"];
};
};
"custom/sep-left" = {
format = " | ";
tooltip = false;
};
"keyboard-state" = {
capslock = true;
format = "{icon}";
format-icons = {
locked = "CAPS";
unlocked = "";
};
};
"hyprland/language" = {
format-en = "en";
format-ru = "ru";
};
"group/system" = {
orientation = "inherit";
drawer = {
transition-duration = 500;
transition-left-to-right = false;
};
modules = [
"network"
"custom/mem"
"cpu"
"temperature"
];
};
network = {
format = "{ifname}";
format-wifi = " {essid} ({signalStrength}%)";
format-ethernet = "{ifname}";
format-disconnected = "";
tooltip-format = "{ipaddr}";
max-length = 50;
on-click = "ghostty --title=nmtui -e nmtui";
};
"custom/weather" = {
format = "{}";
tooltip = true;
interval = 1800;
exec = "python3 $HOME/.config/waybar/scripts/wttr.py";
return-type = "json";
};
"custom/mem" = {
format = "{} ";
interval = 3;
exec = "free -h | awk '/Mem:/{printf $3}'";
tooltip = false;
};
cpu = {
interval = 2;
format = "{usage}% ";
min-length = 6;
};
temperature = {
hwmon-path = "/sys/class/hwmon/hwmon5/temp1_input";
critical-threshold = 80;
format = "{temperatureC}°C {icon}";
format-icons = ["" "" "" "" ""];
tooltip = false;
};
};
style = let
colors = config.lib.stylix.colors.withHashtag; colors = config.lib.stylix.colors.withHashtag;
accent = colors.base0E; accent = colors.base0E;
scssFile = pkgs.writeText "waybar.scss" /*scss*/ '' scssFile = pkgs.writeText "waybar.scss" /*scss*/ ''
window#waybar { window#waybar {
background: ${colors.base00}80; background: transparent;
color: ${colors.base05}; color: ${colors.base05};
font-weight: bold; font-weight: bold;
font-size: .85em; font-size: .85em;
& > * { padding: 0 0 6px 0; }
} }
#mpris, .modules-center {
#pulseaudio, background: ${colors.base01}CC;
#network, border-radius: 12px;
#battery, padding: 10px;
#cpu, box-shadow: 5px 5px 10px rgba(0, 0, 0, 0.4);
#temperature,
#custom-mem,
#clock {
background: ${colors.base01};
padding: 8px;
} }
#left,
#right,
#center {
background: ${colors.base02};
padding: 0 2px;
margin: 0 8px;
border-radius: 8px;
}
#left { margin-left: 0; }
#right { margin-right: 0; }
#clock { padding-right: 10px; }
#cava { padding: 0 10px; }
#language { padding: 8px; } #language { padding: 8px; }
#workspaces,
#tray {
background: ${colors.base01};
}
#workspaces button { #workspaces button {
color: ${colors.base05}; color: ${colors.base05};
padding: 0 2px; padding: 0 2px;
@@ -37,52 +216,51 @@
border: 1pt solid transparent; border: 1pt solid transparent;
min-width: 20px; min-width: 20px;
&:hover { background: ${colors.base02}; } &:hover { background: ${colors.base03}; }
&.active { &.active {
background: ${accent}; background: ${accent};
color: ${colors.base00}; color: ${colors.base00};
min-width: 30px; min-width: 25px;
&:hover { &:hover {
border-color: ${accent}; border-color: ${accent};
background: ${colors.base02}; background: ${colors.base03};
color: ${accent}; color: ${accent};
} }
} }
} }
#mpris { #mpris {
border-radius: 0 0 20px 20px; border-radius: 8px;
padding: 10px; padding: 4px;
&:hover { background: ${colors.base02}; } &:hover { background: ${colors.base03}; }
&.playing { &.playing {
border: 3px solid ${accent}; border: 2px solid ${accent};
border-top-color: transparent; padding: 2px;
padding: calc(10px - 3px);
} }
} }
#tray { #tray {
widget { widget {
border: 1pt solid transparent; border: 1pt solid transparent;
&:hover { background: ${colors.base02}; } &:hover { background: ${colors.base03}; }
& > image { padding: 8px; } & > image { padding: 8px; }
} }
& > .passive { border-color: ${colors.base02}; } & > .passive { border-color: ${colors.base03}; }
& > .needs-attention { border-color: ${colors.base09}; } & > .needs-attention { border-color: ${colors.base09}; }
} }
#pulseaudio { #pulseaudio {
&:hover { background: ${colors.base02}; } &:hover { background: ${colors.base03}; }
&.muted { &.muted {
background: ${colors.base08}; background: ${colors.base08};
color: ${colors.base00}; color: ${colors.base01};
&:hover { &:hover {
color: ${colors.base08}; color: ${colors.base08};
background: ${colors.base02}; background: ${colors.base03};
} }
} }
} }
@@ -139,4 +317,5 @@
nativeBuildInputs = [ pkgs.dart-sass ]; nativeBuildInputs = [ pkgs.dart-sass ];
} "sass ${scssFile} $out"; } "sass ${scssFile} $out";
in builtins.readFile cssFile; in builtins.readFile cssFile;
};
} }
+155 -3
View File
@@ -1,6 +1,157 @@
{ config, pkgs, ... }: { { osConfig, config, pkgs, lib, ... }: {
programs.waybar.settings.mainBar.spacing = 8; home.packages = with pkgs; [
programs.waybar.style = let font-awesome
nerd-fonts.symbols-only
playerctl
cava
pulsemixer
];
programs.waybar = {
enable = true;
systemd.enable = true;
settings.mainBar = {
spacing = 8;
modules-left = [
"hyprland/workspaces"
"hyprland/language"
"keyboard-state"
"cava"
];
modules-center = [
"mpris"
];
modules-right = [
"tray"
"group/system"
"pulseaudio"
"battery"
"clock"
];
cava = {
bars = 14;
sleep_timer = 5;
hide_on_silence = true;
bar_delimiter = 0;
input_delay = 0;
format-icons = [" " "" "" "" "" "" "" "" ""];
};
clock = {
tooltip = false;
interval = 5;
format = "{:L%d %b - %H:%M %a}";
};
pulseaudio = {
format = "{icon} {volume}%";
format-icons = {
headphone = "";
hands-free = "";
headset = "";
phone = "";
phone-muted = "";
portable = "";
car = "";
default = ["" ""];
};
on-click = "ghostty --title=pulsemixer -e pulsemixer";
};
mpris = {
format = "{dynamic}";
dynamic-len = if osConfig.host.laptop then 32 else 64;
dynamic-order = [ "title" "artist" "album" ];
};
battery = {
interval = 5;
states = {
warning = 30;
critical = 15;
};
format = "{icon} {capacity}%";
format-icons = {
default = ["󰂎" "󰁺" "󰁻" "󰁼" "󰁽" "󰁾" "󰁿" "󰂀" "󰂁" "󰂂" "󰁹"];
charging = ["󰢟" "󰢜" "󰂆" "󰂇" "󰂈" "󰢝" "󰂉" "󰢞" "󰂊" "󰂋" "󰂅"];
};
};
"keyboard-state" = {
capslock = true;
format = "{icon}";
format-icons = {
locked = "CAPS";
unlocked = "";
};
};
"hyprland/language" = {
format-en = "en";
format-ru = "ru";
};
"group/system" = {
orientation = "inherit";
drawer = {
transition-duration = 500;
transition-left-to-right = false;
};
modules = [
"network"
"custom/mem"
"cpu"
"temperature"
];
};
network = {
format = "{ifname}";
format-wifi = " {essid} ({signalStrength}%)";
format-ethernet = "{ifname}";
format-disconnected = "";
tooltip-format = "{ipaddr}";
max-length = 50;
on-click = "ghostty --title=nmtui -e nmtui";
};
"custom/weather" = {
format = "{}";
tooltip = true;
interval = 1800;
exec = "python3 $HOME/.config/waybar/scripts/wttr.py";
return-type = "json";
};
"custom/mem" = {
format = "{} ";
interval = 3;
exec = "free -h | awk '/Mem:/{printf $3}'";
tooltip = false;
};
cpu = {
interval = 2;
format = "{usage}% ";
min-length = 6;
};
temperature = {
hwmon-path = "/sys/class/hwmon/hwmon5/temp1_input";
critical-threshold = 80;
format = "{temperatureC}°C {icon}";
format-icons = ["" "" "" "" ""];
tooltip = false;
};
};
style = let
colors = config.lib.stylix.colors.withHashtag; colors = config.lib.stylix.colors.withHashtag;
radius = "6px"; radius = "6px";
scssFile = pkgs.writeText "waybar.scss" /*scss*/ '' scssFile = pkgs.writeText "waybar.scss" /*scss*/ ''
@@ -139,6 +290,7 @@
nativeBuildInputs = [ pkgs.dart-sass ]; nativeBuildInputs = [ pkgs.dart-sass ];
} "sass ${scssFile} $out"; } "sass ${scssFile} $out";
in builtins.readFile cssFile; in builtins.readFile cssFile;
};
wayland.windowManager.hyprland.settings.layerrule = [ wayland.windowManager.hyprland.settings.layerrule = [
"blur on, match:namespace waybar" "blur on, match:namespace waybar"