nixos-config/home-manager/wayland/waybar.nix

319 lines
9.7 KiB
Nix
Raw Normal View History

{ config, pkgs, ... }:
2022-01-06 21:14:02 -05:00
{
programs.waybar = {
enable = true;
2022-03-04 09:50:43 -05:00
settings =
let spanfa = "<span font=\"Font Awesome 5 Regular 11\">";
in [{
2022-09-24 23:30:38 -04:00
height = 32;
margin = "8 8 0";
modules-left = [ "sway/workspaces" "sway/mode" "custom/sep" "cpu" "memory" "temperature" ];
modules-center = [ "sway/window" ];
modules-right =
2023-01-07 20:52:23 -05:00
if config.platform == "laptop" then
[ "battery" "pulseaudio" "backlight" "network" "clock" "idle_inhibitor" ]
else
[ "pulseaudio" "network" "clock" "idle_inhibitor" ];
modules = {
"sway/workspaces" = {
disable-scroll = true;
all-outputs = true;
numeric-first = true;
format = "<big>{icon}</big>";
persistent_workspaces = {
2022-09-23 23:33:11 -04:00
"10:browser" = [];
"20:terminal" = [];
"30:code" = [];
"40:files" = [];
"50:discord" = [];
"60:settings" = [];
};
format-icons = {
terminal = "${spanfa}</span>";
code = "${spanfa}</span>";
browser = "${spanfa}<big></big></span>";
files = "${spanfa}</span>";
discord = "${spanfa}</span>";
settings = "${spanfa}</span>";
};
};
"sway/mode" = {
format = "<span style=\"italic\">{}</span>";
};
"mpd" = {
format = "{stateIcon} {consumeIcon}{randomIcon}{repeatIcon}{singleIcon}{artist} - {album} - {title} ({elapsedTime:%M:%S}/{totalTime:%M:%S}) {songPosition}|{queueLength} ";
format-disconnected = "Disconnected ";
format-stopped = "{consumeIcon}{randomIcon}{repeatIcon}{singleIcon}Stopped ";
unknown-tag = "N/A";
interval = 2;
consume-icons.on = " ";
random-icons.off = "<span color=\"#f53c3c\"></span> ";
random-icons.on = " ";
repeat-icons.on = " ";
single-icons.on = "1 ";
state-icons.paused = "";
state-icons.playing = "";
tooltip-format = "MPD (connected)";
tooltip-format-disconnected = "MPD (disconnected)";
};
"idle_inhibitor" = {
format = "{icon}";
format-icons.activated = "";
format-icons.deactivated = "";
};
"tray" = {
# icon-size = 21;
spacing = 10;
};
"clock" = {
format = "<span font_family=\"Font Awesome 6 Pro Solid 11\"></span> {:%H:%M}";
tooltip-format = "<big>{:%Y %B}</big>\n<tt><small>{calendar}</small></tt>";
format-alt = " {:%Y-%m-%d}";
};
"cpu" = {
format = "<span font=\"Font Awesome 5 Regular 13\"></span> <span rise=\"1pt\">{usage}%</span>";
tooltip = false;
};
"battery" = {
states.warning = 30;
states.low = 15;
states.critical = 5;
format-icons = [ "" "" "" "" "" "" "" "" "" "" "" ];
format = "<span font=\"UbuntuMono Nerd Font 12\">{icon}</span> {capacity}%";
format-charging = "<span font=\"UbuntuMono Nerd Font 12\"> </span>{capacity}%";
format-time = "{H}h {M}m";
};
"memory" = {
format = "${spanfa}<small></small></span> {}%";
};
"temperature" = {
# thermal-zone = 2;
# hwmon-path = "/sys/class/hwmon/hwmon2/temp1_input";
2022-09-24 23:30:38 -04:00
critical-threshold = 80;
format = "${spanfa}<small>{icon}</small></span> {temperatureC}°C";
format-icons = [ "" "" "" "" "" ];
};
"backlight" = {
# device = "acpi_video1";
format = "<span font=\"Font Awesome 5 Regular 12\"><big>{icon}</big></span><small> </small><span rise=\"2pt\">{percent}%</span>";
format-icons = [ "" "" "" "" ];
};
"network" = {
# interface = "wlp2*"; # (Optional) To force the use of this interface
format = "{ifname}";
format-wifi = "${spanfa}<small></small></span> Online";
format-ethernet = "${spanfa} </span>";
format-disconnected = "";
tooltip-format-wifi = "{essid} - {signalStrength}%";
tooltip-format-ethernet = "{signalStrength}%";
tooltip-format-disconnected = "";
};
"pulseaudio" = {
scroll-step = 1;
smooth-scrolling-threshold = 2.0;
2022-09-23 23:43:34 -04:00
format = "${spanfa}{icon}</span> {volume}%";
format-bluetooth = " ${spanfa}{icon}</span> {volume}%";
format-bluetooth-muted = "${spanfa} </span> 0%";
format-muted = "${spanfa}</span> {volume}%";
format-icons.headphone = "";
format-icons.phone = "";
format-icons.portable = "";
format-icons.car = "";
2022-09-23 23:43:34 -04:00
format-icons.default = [ "" "" "" ];
on-click = "pamixer -t";
};
"custom/media" = {
format = "{icon} {}";
return-type = "json";
max-length = 40;
format-icons.spotify = "";
format-icons.default = "🎜";
escape = true;
};
"custom/sep".format = "";
2022-01-06 21:14:02 -05:00
};
}];
2022-01-06 21:14:02 -05:00
style =
''
@define-color background #1a1b26;
@define-color foreground #a9b1d6;
@define-color red #ce7284;
@define-color green #7dc5a0;
@define-color yellow #caaa6a;
@define-color blue #7bc5e4;
@define-color magenta #ad8ee6;
@define-color altred #d5556f;
@define-color altgreen #b9f27c;
@define-color altyellow #ff9e64;
@define-color altblend #282e49;
@define-color empty #474f6f;
@define-color pink #c386c0;
@define-color violet #8682de;
2022-01-06 21:14:02 -05:00
* {
border: none;
font-family: "JetBrainsMono Nerd Font", monospace;
font-size: 13px;
2022-01-06 21:14:02 -05:00
}
window#waybar {
background-color: @background;
border-radius: 8px;
color: @foreground;
2022-09-24 23:30:38 -04:00
padding: 3px 0px;
2022-01-06 21:14:02 -05:00
}
#custom-sep {
color: @altblend;
font-size: 14px;
2022-01-06 21:14:02 -05:00
}
#workspaces {
margin-left: 6px;
2022-01-06 21:14:02 -05:00
}
#workspaces button {
2022-09-24 23:30:38 -04:00
padding: 0px 3px;
border-radius: 0px;
color: @blue;
2022-01-06 21:14:02 -05:00
}
#workspaces button:hover {
box-shadow: inherit;
text-shadow: inherit;
background: @background;
border: none;
2022-09-24 23:30:38 -04:00
padding: 0px 3px;
2022-01-06 21:14:02 -05:00
}
#workspaces button.persistent {color: @empty;}
2022-01-06 21:14:02 -05:00
#workspaces button.focused {
color: shade(@pink, 1.1);
2022-09-24 23:30:38 -04:00
text-shadow: 0px 0px 2px shade(@pink, 1.2);
2022-01-06 21:14:02 -05:00
}
#workspaces button.urgent {
background-color: @altred;
color: #ffffff;
2022-01-06 21:14:02 -05:00
}
#clock,
#battery,
#cpu,
#memory,
#disk,
#temperature,
#network,
#custom-media,
#tray,
#mode,
#idle_inhibitor,
#mpd {
2022-09-24 23:30:38 -04:00
margin: 0px 8px;
2022-01-06 21:14:02 -05:00
}
#idle_inhibitor {
2022-09-24 23:30:38 -04:00
padding: 0px 8px 0px 0px;
2022-01-06 21:14:02 -05:00
}
2022-09-25 00:43:44 -04:00
#cpu {
background-color: @altblend;
2022-09-24 23:30:38 -04:00
margin: 3px 0px 3px 2px;
padding-right: 5px;
padding-left: 8px;
2022-09-24 23:30:38 -04:00
border-radius: 18px 0px 0px 18px;
2022-01-06 21:14:02 -05:00
}
2022-09-25 00:43:44 -04:00
#pulseaudio {
background-color: @altblend;
${
2023-01-07 20:52:23 -05:00
if config.platform == "laptop" then
2022-09-25 00:43:44 -04:00
''
margin: 3px 0px 3px 2px;
padding-right: 5px;
padding-left: 8px;
border-radius: 18px 0px 0px 18px;
''
else
''
margin: 3px 2px;
padding: 0px 8px;
border-radius: 18px;
''
}
}
#backlight, #memory {
background-color: @altblend;
2022-09-24 23:30:38 -04:00
margin: 3px 4px 3px 0px;
padding-left: 5px;
padding-right: 8px;
2022-09-24 23:30:38 -04:00
border-radius: 0px 18px 18px 0px;
2022-01-06 21:14:02 -05:00
}
#network {
background-color: @altblend;
margin: 3px 4px;
2022-09-24 23:30:38 -04:00
padding: 0px 6px;
border-radius: 18px;
2022-01-06 21:14:02 -05:00
}
#window {
font-family: "NotoSans Nerd Font";
font-size: 12px;
2022-01-06 21:14:02 -05:00
}
2022-09-25 00:43:44 -04:00
#mode {
color: @magenta;
text-shadow: 0px 0px 2px shade(@magenta, 1.05);
}
#cpu {color: @green;}
#memory {color: @yellow;}
#temperature {color: @blue;}
#clock {color: @blue;}
2022-09-24 23:30:38 -04:00
#temperature {color: @blue;}
#temperature.critical {color: @altyellow;}
@keyframes blink { to { color: @background; } }
#battery {color: @green;}
#battery.warning:not(.charging) {color: @altyellow;}
#battery.low:not(.charging) {color: @altred;}
2022-09-24 23:30:38 -04:00
#battery.critical:not(.charging) {
color: #ff2525;
animation-name: blink;
animation-duration: 1s;
animation-timing-function: linear;
animation-iteration-count: infinite;
animation-direction: alternate;
}
#backlight {color: @yellow;}
#network {color: @green;}
#pulseaudio {color: @pink;}
#pulseaudio.muted {color: @red;}
#idle_inhibitor.deactivated {color: @altred;}
#idle_inhibitor.activated {color: @altgreen;}
2022-01-06 21:14:02 -05:00
'';
};
}