Overhaul waybar formatting

This commit is contained in:
Kiana Sheibani 2022-03-04 09:50:43 -05:00
parent 3995376fc0
commit e0a2c929fb
9 changed files with 80 additions and 26 deletions

View file

@ -17,10 +17,6 @@ nixpkgs, # The flake's input version of nixpkgs
boot.loader.systemd-boot.enable = true; boot.loader.systemd-boot.enable = true;
boot.loader.efi.canTouchEfiVariables = true; boot.loader.efi.canTouchEfiVariables = true;
networking.wireless.networks = {
"NETGEAR97".psk = "pastelcello694";
};
# Set your time zone. # Set your time zone.
time.timeZone = "America/New_York"; time.timeZone = "America/New_York";

View file

@ -8,7 +8,6 @@
imports = [ imports = [
./sway.nix ./sway.nix
./swaylock.nix ./swaylock.nix
./waybar.nix
./wofi.nix ./wofi.nix
./mako.nix ./mako.nix
]; ];

View file

@ -1,3 +1,6 @@
modules-left:
modules-center:
modules-right:
{ pkgs, ... }: { pkgs, ... }:
{ {
programs.waybar = { programs.waybar = {
@ -6,9 +9,7 @@
settings = [{ settings = [{
height = 30; height = 30;
modules-left = [ "sway/workspaces" "sway/mode" ]; inherit modules-left modules-center modules-right;
modules-center = [ "sway/window" ];
modules-right = [ "pulseaudio" "network" "backlight" "idle_inhibitor" "clock" ];
modules = { modules = {
"sway/mode" = { "sway/mode" = {
@ -50,6 +51,16 @@
format = " {usage}%"; format = " {usage}%";
tooltip = false; tooltip = false;
}; };
"battery" = {
states.warning = 30;
states.low = 15;
states.critical = 5;
format-icons = [ "" "" "" "" "" ];
format = "{icon} {capacity}%";
format-charging = "{icon} {capacity}% ";
format-time = "{H}h {M}m";
};
"memory" = { "memory" = {
format = " {}%"; format = " {}%";
}; };
@ -63,13 +74,13 @@
}; };
"backlight" = { "backlight" = {
# device = "acpi_video1"; # device = "acpi_video1";
format = "{percent}% {icon}"; format = "{icon} {percent}%";
format-icons = [ "" "" ]; format-icons = [ "" "" ];
}; };
"network" = { "network" = {
# interface = "wlp2*"; # (Optional) To force the use of this interface # interface = "wlp2*"; # (Optional) To force the use of this interface
format-wifi = " {essid} <span foreground='#B0B0B0'>{signalStrength}%</span>"; format-wifi = " {essid} <span foreground='#B0B0B0'>{signalStrength}%</span>";
format-ethernet = " wired"; format-ethernet = " wired";
format-disconnected = "disconnected"; format-disconnected = "disconnected";
tooltip-format = "{ifname} {ipaddr}"; tooltip-format = "{ifname} {ipaddr}";
tooltip-format-disconnected = "disconnected"; tooltip-format-disconnected = "disconnected";
@ -77,9 +88,9 @@
"pulseaudio" = { "pulseaudio" = {
# scroll-step = 1; # %, can be a float # scroll-step = 1; # %, can be a float
format = "{icon} {volume}%"; format = "{icon} {volume}%";
format-bluetooth = "{icon} {volume}%"; format-bluetooth = " {icon} {volume}%";
format-bluetooth-muted = "{icon} 0%"; format-bluetooth-muted = " 0%";
format-muted = "{icon} 0%"; format-muted = " {volume}%";
format-icons.headphone = ""; format-icons.headphone = "";
format-icons.hands-free = ""; format-icons.hands-free = "";
@ -87,7 +98,7 @@
format-icons.phone = ""; format-icons.phone = "";
format-icons.portable = ""; format-icons.portable = "";
format-icons.car = ""; format-icons.car = "";
format-icons.default = [ "" "" "" ]; format-icons.default = [ "" "" " " ];
on-click = "pamixer -t"; on-click = "pamixer -t";
}; };
@ -109,7 +120,7 @@
* { * {
border: none; border: none;
border-radius: 0; border-radius: 0;
font-family: "UbuntuMono Nerd Font Mono", sans-serif; font-family: "UbuntuMono Nerd Font", sans-serif;
font-size: 16px; font-size: 16px;
min-height: 0; min-height: 0;
} }
@ -117,8 +128,7 @@
window#waybar { window#waybar {
background-color: rgba(0, 0, 0, 0.6); background-color: rgba(0, 0, 0, 0.6);
color: #ffffff; color: #ffffff;
transition-property: background-color; transition: background-color .2s;
transition-duration: .2s;
padding: 5px 0; padding: 5px 0;
} }
@ -203,15 +213,38 @@
margin-right: 0; margin-right: 0;
} }
#clock {
box-shadow: inset 0 -3px #0a6cf5;
}
#battery {
box-shadow: inset 0 -3px #a0f23c;
}
#battery.warning:not(.charging) {
box-shadow: inset 0 -3px #fcda44;
color: #fce788;
}
#battery.low:not(.charging) {
box-shadow: inset 0 -3px #f93920;
color: #f97f6f;
}
@keyframes blink { @keyframes blink {
to { to {
background-color: #ffffff; color: rgba(0, 0, 0, 0);
color: #000000;
} }
} }
#clock { #battery.critical:not(.charging) {
box-shadow: inset 0 -3px #0a6cf5; box-shadow: inset 0 -3px #400000;
color: #ff2525;
animation: blink 1.5s steps(4, start) infinite;
}
#backlight {
box-shadow: inset 0 -3px #ffff50;
} }
#network { #network {

View file

@ -8,6 +8,10 @@ in {
networking.hostName = "kiana-desktop"; networking.hostName = "kiana-desktop";
networking.wireless.enable = true; networking.wireless.enable = true;
networking.wireless.networks = {
"NETGEAR97".psk = "pastelcello694";
};
# Passwords # Passwords
users.users.kiana = { inherit hashedPassword; }; users.users.kiana = { inherit hashedPassword; };
users.users.root = { inherit hashedPassword; }; users.users.root = { inherit hashedPassword; };

View file

@ -1,4 +1,7 @@
{ ... }: { ... }:
{ {
imports = [ ../../common/home-manager ]; imports = [
../../common/home-manager
./waybar.nix
];
} }

View file

@ -0,0 +1,8 @@
# Home manager is being weird about conflicts,
# so I'm doing this. It sucks, but so does home
# manager, so it's fine.
import ../../common/home-manager/wayland/waybar.nix
[ "sway/workspaces" "sway/mode" ]
[ "sway/window" ]
[ "pulseaudio" "network" "clock" "idle_inhibitor" ]

View file

@ -26,8 +26,8 @@ outputs = { self,
inherit system; inherit system;
modules = [ modules = [
{ _module.args = moduleArgs; } { _module.args = moduleArgs; }
./common/config
./desktop/config ./desktop/config
./common/config
home-manager.nixosModules.home-manager home-manager.nixosModules.home-manager
{ {
home-manager.useGlobalPkgs = true; home-manager.useGlobalPkgs = true;
@ -42,8 +42,8 @@ outputs = { self,
inherit system; inherit system;
modules = [ modules = [
{ _module.args = moduleArgs; } { _module.args = moduleArgs; }
./common/config
./laptop/config ./laptop/config
./common/config
home-manager.nixosModules.home-manager home-manager.nixosModules.home-manager
nixos-hardware.nixosModules.microsoft-surface nixos-hardware.nixosModules.microsoft-surface
{ {

View file

@ -1,4 +1,7 @@
{ ... }: { ... }:
{ {
imports = [ ../../common/home-manager ]; imports = [
../../common/home-manager
./waybar.nix
];
} }

View file

@ -0,0 +1,8 @@
# Home manager is being weird about conflicts,
# so I'm doing this. It sucks, but so does home
# manager, so it's fine.
import ../../common/home-manager/wayland/waybar.nix
[ "sway/workspaces" "sway/mode" ]
[ "sway/window" ]
[ "pulseaudio" "backlight" "network" "battery" "clock" "idle_inhibitor" ]