nix-dotfiles/home/waybar.nix

377 lines
6.9 KiB
Nix
Raw Permalink Normal View History

2024-09-17 18:14:26 +02:00
{ pkgs, inputs, lib, config, nix-colors, ... }:
2024-09-13 00:32:00 +02:00
2024-09-17 18:14:26 +02:00
{
2024-09-13 00:32:00 +02:00
imports = [
];
2024-09-17 18:14:26 +02:00
programs.waybar = let
inherit (inputs.nix-colors.lib.conversions) hexToRGBString;
inherit (config.colorscheme) colors;
inherit (config.colorscheme) palette;
toRGBA = color: opacity: "rgba(${hexToRGBString "," (lib.removePrefix "#" color)},${opacity})";
in {
2024-09-13 00:32:00 +02:00
enable = true;
style = ''
* {
/* `otf-font-awesome` is required to be installed for icons */
font-family: FontAwesome, Roboto, Helvetica, Arial, sans-serif;
font-size: 13px;
}
window#waybar {
2024-09-17 18:14:26 +02:00
background-color: #${palette.base00};
border-bottom: 3px solid #${palette.base03};
color: ${toRGBA palette.base05 "0.7"};
2024-09-13 00:32:00 +02:00
transition-property: background-color;
transition-duration: .5s;
}
window#waybar.hidden {
opacity: 0.2;
}
/*
window#waybar.empty {
background-color: transparent;
}
window#waybar.solo {
background-color: #${palette.base07};
}
*/
window#waybar.termite {
background-color: #${palette.base03};
}
window#waybar.chromium {
background-color: #${palette.base00};
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 #${palette.base05};
}
/* you can set a style on hover for any module like this */
#pulseaudio:hover {
background-color: #${palette.base0A};
}
#workspaces button {
padding: 0 5px;
background-color: transparent;
color: #${palette.base05};
}
#workspaces button:hover {
2024-09-17 18:14:26 +02:00
background: #${palette.base00};
2024-09-13 00:32:00 +02:00
}
#workspaces button.focused {
background-color: #${palette.base03};
box-shadow: inset 0 -3px #${palette.base05};
}
#workspaces button.urgent {
background-color: #${palette.base08};
}
#mode {
background-color: #${palette.base03};
box-shadow: inset 0 -3px #${palette.base05};
}
#clock,
#battery,
#cpu,
#memory,
#disk,
#temperature,
#backlight,
#network,
#pulseaudio,
#wireplumber,
#custom-media,
#tray,
#mode,
#idle_inhibitor,
#scratchpad,
#power-profiles-daemon,
#mpd {
padding: 0 10px;
color: #${palette.base05};
}
#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;
}
#clock {
background-color: #${palette.base03};
}
#battery {
background-color: #${palette.base05};
color: #${palette.base00};
}
#battery.charging, #battery.plugged {
color: #${palette.base05};
background-color: #${palette.base0B};
}
@keyframes blink {
to {
background-color: #${palette.base05};
color: #${palette.base00};
}
}
/* Using steps() instead of linear as a timing function to limit cpu usage */
#battery.critical:not(.charging) {
background-color: #${palette.base08};
color: #${palette.base05};
animation-name: blink;
animation-duration: 0.5s;
animation-timing-function: steps(12);
animation-iteration-count: infinite;
animation-direction: alternate;
}
#power-profiles-daemon {
padding-right: 15px;
}
2024-09-17 18:14:26 +02:00
/*0b also looked good though. */
2024-09-13 00:32:00 +02:00
#power-profiles-daemon.performance {
2024-09-17 18:14:26 +02:00
background-color: #${palette.base04};
color: #${palette.base00};
2024-09-13 00:32:00 +02:00
}
#power-profiles-daemon.balanced {
2024-09-17 18:14:26 +02:00
background-color: #${palette.base04};
color: #${palette.base00};
2024-09-13 00:32:00 +02:00
}
#power-profiles-daemon.power-saver {
2024-09-17 18:14:26 +02:00
background-color: #${palette.base04};
color: #${palette.base00};
2024-09-13 00:32:00 +02:00
}
label:focus {
2024-09-17 18:14:26 +02:00
background-color: #${palette.base04};
color: #${palette.base00};
2024-09-13 00:32:00 +02:00
}
#cpu {
2024-09-17 18:14:26 +02:00
background-color: #${palette.base04};
color: #${palette.base00};
2024-09-13 00:32:00 +02:00
}
#memory {
2024-09-17 18:14:26 +02:00
background-color: #${palette.base04};
color: #${palette.base00};
2024-09-13 00:32:00 +02:00
}
#disk {
2024-09-17 18:14:26 +02:00
background-color: #${palette.base04};
color: #${palette.base00};
2024-09-13 00:32:00 +02:00
}
#backlight {
2024-09-17 18:14:26 +02:00
background-color: #${palette.base04};
color: #${palette.base00};
2024-09-13 00:32:00 +02:00
}
#network {
2024-09-17 18:14:26 +02:00
background-color: #${palette.base04};
color: #${palette.base00};
2024-09-13 00:32:00 +02:00
}
#network.disconnected {
2024-09-17 18:14:26 +02:00
background-color: #${palette.base0E};
color: #${palette.base00};
2024-09-13 00:32:00 +02:00
}
#pulseaudio {
background-color: #${palette.base0A};
color: #${palette.base00};
}
#pulseaudio.muted {
2024-09-17 18:14:26 +02:00
background-color: #${palette.base0E};
2024-09-13 00:32:00 +02:00
color: #${palette.base03};
}
#wireplumber {
background-color: #${palette.base07};
color: #${palette.base00};
}
#wireplumber.muted {
2024-09-17 18:14:26 +02:00
background-color: #${palette.base0E};
color: #${palette.base00};
2024-09-13 00:32:00 +02:00
}
#custom-media {
2024-09-17 18:14:26 +02:00
background-color: #${palette.base04};
color: #${palette.base00};
2024-09-13 00:32:00 +02:00
min-width: 100px;
}
#custom-media.custom-spotify {
2024-09-17 18:14:26 +02:00
background-color: #${palette.base04};
color: #${palette.base00};
2024-09-13 00:32:00 +02:00
}
#custom-media.custom-vlc {
2024-09-17 18:14:26 +02:00
background-color: #${palette.base04};
color: #${palette.base00};
2024-09-13 00:32:00 +02:00
}
#temperature {
2024-09-17 18:14:26 +02:00
background-color: #${palette.base04};
color: #${palette.base00};
2024-09-13 00:32:00 +02:00
}
#temperature.critical {
2024-09-17 18:14:26 +02:00
background-color: #${palette.base0E};
color: #${palette.base00};
2024-09-13 00:32:00 +02:00
}
#tray {
2024-09-17 18:14:26 +02:00
background-color: #${palette.base04};
color: #${palette.base00};
2024-09-13 00:32:00 +02:00
}
#tray > .passive {
-gtk-icon-effect: dim;
}
#tray > .needs-attention {
-gtk-icon-effect: highlight;
2024-09-17 18:14:26 +02:00
background-color: #${palette.base07};
color: #${palette.base00};
2024-09-13 00:32:00 +02:00
}
#idle_inhibitor {
2024-09-17 18:14:26 +02:00
background-color: #${palette.base04};
color: #${palette.base00};
2024-09-13 00:32:00 +02:00
}
#idle_inhibitor.activated {
2024-09-17 18:14:26 +02:00
background-color: #${palette.base06};
2024-09-13 00:32:00 +02:00
color: #${palette.base00};
}
#mpd {
2024-09-17 18:14:26 +02:00
background-color: #${palette.base04};
color: #${palette.base00};
2024-09-13 00:32:00 +02:00
}
#mpd.disconnected {
2024-09-17 18:14:26 +02:00
background-color: #${palette.base06};
color: #${palette.base00};
2024-09-13 00:32:00 +02:00
}
#mpd.stopped {
background-color: #${palette.base0C};
}
#mpd.paused {
background-color: #${palette.base0B};
}
#language {
2024-09-17 18:14:26 +02:00
background: #${palette.base04};
color: #${palette.base00};
2024-09-13 00:32:00 +02:00
padding: 0 5px;
margin: 0 5px;
min-width: 16px;
}
#keyboard-state {
2024-09-17 18:14:26 +02:00
background: #${palette.base04};
2024-09-13 00:32:00 +02:00
color: #${palette.base00};
padding: 0 0px;
margin: 0 5px;
min-width: 16px;
}
#keyboard-state > label {
padding: 0 5px;
}
#keyboard-state > label.locked {
2024-09-17 18:14:26 +02:00
background: #${palette.base04};
color: #${palette.base00};
2024-09-13 00:32:00 +02:00
}
#scratchpad {
2024-09-17 18:14:26 +02:00
background: #${palette.base00};
color: #${palette.base00};
2024-09-13 00:32:00 +02:00
}
#scratchpad.empty {
background-color: transparent;
}
#privacy {
padding: 0;
2024-09-17 18:14:26 +02:00
color: #${palette.base04};
2024-09-13 00:32:00 +02:00
}
#privacy-item {
2024-09-17 18:14:26 +02:00
color: #${palette.base00};
2024-09-13 00:32:00 +02:00
padding: 0 5px;
}
#privacy-item.screenshare {
2024-09-17 18:14:26 +02:00
background-color: #${palette.base00};
2024-09-13 00:32:00 +02:00
}
#privacy-item.audio-in {
background-color: #${palette.base0B};
}
#privacy-item.audio-out {
background-color: #${palette.base0D};
}
'';
};
}