Adding seperate styles for waybar

This commit is contained in:
Tyler Kelley 2024-01-24 03:05:52 -06:00
parent ec817f95a7
commit a40c254834
5 changed files with 312 additions and 22 deletions

25
config/home/default.nix Normal file
View File

@ -0,0 +1,25 @@
{ pkgs, config, ... }:
{
imports = [
# Enable &/ Configure Programs
./style1-waybar.nix
./style2-waybar.nix
./swaync.nix
./swaylock.nix
./starship.nix
./neofetch.nix
./hyprland.nix
./kitty.nix
./rofi.nix
./vim.nix
./bash.nix
./gtk-qt.nix
# Install Programs & Scripts For User
./packages.nix
# Place Home Files Like Pictures
./files.nix
];
}

View File

@ -1,6 +1,6 @@
{ pkgs, config, ... }:
{ pkgs, config, lib, waybarStyle, ... }:
{
lib.mkIf ("${waybarStyle}" == "style1") {
# Configure & Theme Waybar
programs.waybar = {
enable = true;

View File

@ -0,0 +1,281 @@
{ pkgs, config, lib, waybarStyle, ... }:
lib.mkIf ("${waybarStyle}" == "style2") {
# Configure & Theme Waybar
programs.waybar = {
enable = true;
package = pkgs.waybar;
settings = [{
layer = "top";
position = "top";
modules-left = [ "custom/startmenu" "hyprland/window" ];
modules-center = [ "network" "pulseaudio" "cpu" "hyprland/workspaces" "memory" "disk" "clock" ];
modules-right = [ "idle_inhibitor" "custom/themeselector" "custom/notification" "tray" ];
"hyprland/workspaces" = {
format = "{icon}";
format-icons = {
default = " ";
active = " ";
urgent = " ";
};
on-scroll-up = "hyprctl dispatch workspace e+1";
on-scroll-down = "hyprctl dispatch workspace e-1";
};
"clock" = {
format = "{: %I:%M %p}";
tooltip = false;
};
"hyprland/window" = {
max-length = 25;
separate-outputs = false;
};
"memory" = {
interval = 5;
format = " {}%";
tooltip = true;
};
"cpu" = {
interval = 5;
format = " {usage:2}%";
tooltip = true;
};
"disk" = {
format = " {free}";
tooltip = true;
};
"network" = {
format-icons = ["󰤯" "󰤟" "󰤢" "󰤥" "󰤨"];
format-ethernet = ": {bandwidthDownOctets}";
format-wifi = "{icon} {signalStrength}%";
format-disconnected = "󰤮";
tooltip = false;
};
"tray" = {
spacing = 12;
};
"pulseaudio" = {
format = "{icon} {volume}% {format_source}";
format-bluetooth = "{volume}% {icon} {format_source}";
format-bluetooth-muted = " {icon} {format_source}";
format-muted = " {format_source}";
format-source = " {volume}%";
format-source-muted = "";
format-icons = {
headphone = "";
hands-free = "";
headset = "";
phone = "";
portable = "";
car = "";
default = ["" "" ""];
};
on-click = "pavucontrol";
};
"custom/themeselector" = {
tooltip = false;
format = "";
# exec = "theme-selector";
on-click = "theme-selector";
};
"custom/startmenu" = {
tooltip = false;
format = "";
# exec = "rofi -show drun";
on-click = "rofi -show drun";
};
"idle_inhibitor" = {
format = "{icon}";
format-icons = {
activated = "";
deactivated = "";
};
tooltip = "true";
};
"custom/notification" = {
tooltip = false;
format = "{icon} {}";
format-icons = {
notification = "<span foreground='red'><sup></sup></span>";
none = "";
dnd-notification = "<span foreground='red'><sup></sup></span>";
dnd-none = "";
inhibited-notification = "<span foreground='red'><sup></sup></span>";
inhibited-none = "";
dnd-inhibited-notification = "<span foreground='red'><sup></sup></span>";
dnd-inhibited-none = "";
};
return-type = "json";
exec-if = "which swaync-client";
exec = "swaync-client -swb";
on-click = "task-waybar";
escape = true;
};
"battery" = {
states = {
warning = 30;
critical = 15;
};
format = "{icon} {capacity}%";
format-charging = "󰂄 {capacity}%";
format-plugged = "󱘖 {capacity}%";
format-icons = ["󰁺" "󰁻" "󰁼" "󰁽" "󰁾" "󰁿" "󰂀" "󰂁" "󰂂" "󰁹"];
on-click = "";
tooltip = false;
};
}];
style = ''
* {
font-size: 16px;
font-family: JetBrainsMono Nerd Font, Font Awesome, sans-serif;
font-weight: bold;
}
window#waybar {
background-color: #${config.colorScheme.colors.base00};
border-bottom: 1px solid #${config.colorScheme.colors.base00};
border-radius: 0px;
color: #${config.colorScheme.colors.base0F};
}
#workspaces {
background: linear-gradient(180deg, #${config.colorScheme.colors.base01}, #${config.colorScheme.colors.base02});
margin: 5px;
padding: 0px 1px;
border-radius: 15px;
border: 0px;
font-style: normal;
color: #${config.colorScheme.colors.base00};
}
#workspaces button {
padding: 0px 5px;
margin: 4px 3px;
border-radius: 15px;
border: 0px;
color: #${config.colorScheme.colors.base00};
# background-color: #${config.colorScheme.colors.base00};
background: linear-gradient(180deg, #${config.colorScheme.colors.base01}, #${config.colorScheme.colors.base02});
opacity: 1.0;
transition: all 0.3s ease-in-out;
}
#workspaces button.active {
color: #${config.colorScheme.colors.base00};
background: #${config.colorScheme.colors.base04};
border-radius: 15px;
min-width: 40px;
transition: all 0.3s ease-in-out;
opacity: 1.0;
}
#workspaces button:hover {
color: #${config.colorScheme.colors.base00};
background: #${config.colorScheme.colors.base04};
border-radius: 15px;
opacity: 1.0;
}
tooltip {
background: #${config.colorScheme.colors.base00};
border: 1px solid #${config.colorScheme.colors.base04};
border-radius: 10px;
}
tooltip label {
color: #${config.colorScheme.colors.base07};
}
#window {
color: #${config.colorScheme.colors.base05};
background: #${config.colorScheme.colors.base00};
border-radius: 0px 15px 50px 0px;
margin: 5px 5px 5px 0px;
padding: 2px 20px;
}
#memory {
color: #${config.colorScheme.colors.base0F};
background: #${config.colorScheme.colors.base00};
border-radius: 15px 50px 15px 50px;
margin: 5px;
padding: 2px 20px;
}
#clock {
color: #${config.colorScheme.colors.base0B};
background: #${config.colorScheme.colors.base00};
border-radius: 15px 50px 15px 50px;
margin: 5px;
padding: 2px 20px;
}
#idle_inhibitor {
color: #${config.colorScheme.colors.base0A};
background: #${config.colorScheme.colors.base00};
border-radius: 50px 15px 50px 15px;
margin: 5px;
padding: 2px 20px;
}
#cpu {
color: #${config.colorScheme.colors.base07};
background: #${config.colorScheme.colors.base00};
border-radius: 50px 15px 50px 15px;
margin: 5px;
padding: 2px 20px;
}
#disk {
color: #${config.colorScheme.colors.base03};
background: #${config.colorScheme.colors.base00};
border-radius: 15px 50px 15px 50px;
margin: 5px;
padding: 2px 20px;
}
#battery {
color: #${config.colorScheme.colors.base08};
background: #${config.colorScheme.colors.base00};
border-radius: 15px;
margin: 5px;
padding: 2px 20px;
}
#network {
color: #${config.colorScheme.colors.base09};
background: #${config.colorScheme.colors.base00};
border-radius: 50px 15px 50px 15px;
margin: 5px;
padding: 2px 20px;
}
#tray {
color: #${config.colorScheme.colors.base05};
background: #${config.colorScheme.colors.base00};
border-radius: 15px 0px 0px 50px;
margin: 5px 0px 5px 5px;
padding: 2px 20px;
}
#pulseaudio {
color: #${config.colorScheme.colors.base0D};
background: #${config.colorScheme.colors.base00};
border-radius: 50px 15px 50px 15px;
margin: 5px;
padding: 2px 20px;
}
#custom-notification {
color: #${config.colorScheme.colors.base0C};
background: #${config.colorScheme.colors.base00};
border-radius: 15px 50px 15px 50px;
margin: 5px;
padding: 2px 20px;
}
#custom-themeselector {
color: #${config.colorScheme.colors.base0D};
background: #${config.colorScheme.colors.base00};
border-radius: 15px 50px 15px 50px;
margin: 5px;
padding: 2px 20px;
}
#custom-startmenu {
color: #${config.colorScheme.colors.base03};
background: #${config.colorScheme.colors.base00};
border-radius: 50px 15px 50px 15px;
margin: 5px;
padding: 2px 20px;
}
#idle_inhibitor {
color: #${config.colorScheme.colors.base09};
background: #${config.colorScheme.colors.base00};
border-radius: 15px 50px 15px 50px;
margin: 5px;
padding: 2px 20px;
}
'';
};
}

View File

@ -27,6 +27,7 @@
theLCVariables = "en_US.UTF-8";
theTimezone = "America/Chicago";
theme = "gigavolt";
waybarStyle = "style1"; # can be style1-2
browser = "firefox";
wallpaperGit = "https://gitlab.com/Zaney/my-wallpapers.git";
wallpaperDir = "/home/${username}/Pictures/Wallpapers";
@ -62,6 +63,7 @@
inherit browser; inherit wallpaperDir;
inherit wallpaperGit; inherit flakeDir;
inherit gpuType; inherit cpuType;
inherit waybarStyle;
inherit (inputs.nix-colors.lib-contrib {inherit pkgs;}) gtkThemeFromScheme;
};
home-manager.useGlobalPkgs = true;

View File

@ -1,7 +1,7 @@
{ config, pkgs, inputs, username,
gitUsername, gitEmail, gtkThemeFromScheme,
theme, browser, wallpaperDir, wallpaperGit,
flakeDir, ... }:
flakeDir, waybarStyle, ... }:
{
# Home Manager Settings
@ -16,25 +16,7 @@
imports = [
inputs.nix-colors.homeManagerModules.default
inputs.hyprland.homeManagerModules.default
# Enable &/ Configure Programs
./config/home/waybar.nix
./config/home/swaync.nix
./config/home/swaylock.nix
./config/home/starship.nix
./config/home/neofetch.nix
./config/home/hyprland.nix
./config/home/kitty.nix
./config/home/rofi.nix
./config/home/vim.nix
./config/home/bash.nix
./config/home/gtk-qt.nix
# Install Programs & Scripts For User
./config/home/packages.nix
# Place Home Files Like Pictures
./config/home/files.nix
./config/home
];
# Define Settings For Xresources