Merge pull request #2 from pagedMov/new-waybar

New waybar config
This commit is contained in:
pagedMov
2024-10-21 08:29:24 -04:00
committed by GitHub
11 changed files with 344 additions and 444 deletions

View File

@@ -41,8 +41,8 @@
} @ inputs: let } @ inputs: let
system = "x86_64-linux"; system = "x86_64-linux";
username = "pagedmov"; username = "pagedmov";
wallpaper = "${self}/media/wallpapers/cabin-2.jpg"; wallpaper = "${self}/media/wallpapers/nord-balloons.png";
base16scheme = "chalk"; # can be easily changed with the chscheme script base16scheme = "nord"; # can be easily changed with the chscheme script
# Map colors from yaml to attribute set # Map colors from yaml to attribute set
# Extracting colors into a set here allows them to be propagated across the entire config # Extracting colors into a set here allows them to be propagated across the entire config

Binary file not shown.

After

Width:  |  Height:  |  Size: 311 KiB

View File

@@ -12,6 +12,7 @@
imports = imports =
[(import ./gtk.nix)] [(import ./gtk.nix)]
++ [(import ./spicetify.nix)] ++ [(import ./spicetify.nix)]
++ [(import ./stylix.nix)]
++ [(import ./starship.nix)] ++ [(import ./starship.nix)]
++ [(import ./userpkgs.nix)] ++ [(import ./userpkgs.nix)]
++ [(import ./zshell.nix)] ++ [(import ./zshell.nix)]

View File

@@ -0,0 +1,19 @@
{
pkgs,
scheme,
wallpaper,
...
}:
{
stylix = {
enable = true;
autoEnable = true;
targets = {
# fzf.enable = true;
# kitty.enable = true;
# vesktop.enable = true;
waybar.enable = false;
};
};
}

View File

@@ -1,136 +1,97 @@
{...}: {
...
}:
# Grocery list:
# Clock
# CPU/MEM meters
# Home folder and Nix store storage tracking?
# Workspaces (per monitor would be nice)
# A separate bar for both monitors
# secondary monitor will have a vertical bar on the left side
# Can contain more info with two bars
let
workspaces = {
format = "{icon}";
format-icons = {
"1" = "";
"2" = "";
"3" = "";
"4" = "";
"5" = "";
"6" = "";
};
persistent-workspaces = {
"HDMI-A-1" = [ 1 2 3 ];
"DP-1" = [ 4 5 6 ];
};
};
in
{ {
programs.waybar.settings.mainBar = { programs.waybar.settings.mainBar = {
layer = "top"; layer = "bottom";
position = "left"; output = "DP-1";
mod = "dock"; position = "top";
margin-left = 4; name = "mainBar";
margin-right = 0; margin-left = 8;
margin-top = 4; margin-top = 5;
margin-bottom = 4; margin-right = 8;
exclusive = true; mode = "dock";
passthrough = false;
"gtk-layer-shell" = true;
reload_style_on_change = true;
modules-left = [ modules-left = [
"custom/spacer"
"hyprland/workspaces" "hyprland/workspaces"
"custom/spacer" "cava"
];
modules-center = [
"hyprland/window"
]; ];
modules-right = [ modules-right = [
"group/expand" "group/hardware"
"group/expand-3"
"network"
"clock" "clock"
"upower" "group/powerbtns"
"custom/notification"
]; ];
"custom/led" = { "hyprland/workspaces" = workspaces;
format = "<span color='#AFAFAF'>󰍿</span><span color='#AFAFAF'> </span>";
format-alt = "󰍿<span color='#83A1F6'> </span>"; cava = {
on-click = "~/mouse.sh"; framerate = 30;
rotate = 90; autosens = 1;
tooltip = false; sensitivity = 1;
bars = 14;
lower_cutoff_freq = 50;
higher_cutoff_freq = 10000;
method = "pulse";
source = "auto";
stereo = true;
reverse = true;
bar_delimiter = 0;
monstercat = false;
waves = false;
noise_reduction = 0.77;
input_delay = 2;
format-icons = ["" "" "" "" "" "" "" "" ];
}; };
"group/expand-3" = { "group/hardware" = {
orientation = "vertical"; orientation = "inherit";
drawer = {
"transition-duration" = 600;
"children-class" = "not-power";
"transition-to-left" = false;
"click-to-reveal" = false;
};
modules = [ modules = [
"pulseaudio" "custom/disk-icon"
"pulseaudio/slider" "memory"
"cpu"
]; ];
}; };
clock = { "custom/disk-icon" = {
format = "{:%I\n%M}"; exec = ''
interval = 1; df /dev/disk/by-partlabel/disk-main-home | awk '$6 == "/home" {printf "{\"class\": \"disk-icon\", \"tooltip\": \"/home: %.1fGB / %.1fTB\", \"percentage\": \"%.0f\"}\n", $3 / 1024 / 1024, $2 / 1024 / 1024 / 1024, $5}' | jq --unbuffered --compact-output
rotate = 0;
on-click = "/usr/local/bin/ags -t ActivityCenter";
tooltip-format = "<tt>{calendar}</tt>";
calendar = {
mode = "month";
"mode-mon-col" = 3;
"on-scroll" = 1;
"on-click-right" = "mode";
format = {
months = "<span color='#ffead3'><b>{}</b></span>";
weekdays = "<span color='#ffcc66'><b>{}</b></span>";
today = "<span color='#ff6699'><b>{}</b></span>";
};
};
actions = {
"on-click-right" = "mode";
"on-click-forward" = "tz_up";
"on-click-backward" = "tz_down";
"on-scroll-up" = "shift_up";
"on-scroll-down" = "shift_down";
};
};
upower = {
icon-size = 20;
format = "";
on-click = "/home/anik/battery.sh";
tooltip = true;
rotate = 0;
tooltip-spacing = 20;
on-click-right = "pkill waybar & hyprctl dispatch exec waybar";
};
"upower#headset" = {
format = " {percentage}";
"native-path" = "/org/freedesktop/UPower/devices/headset_dev_A6_98_9A_0D_D3_49";
"show-icon" = false;
tooltip = false;
};
"group/expand-4" = {
orientation = "horizontal";
drawer = {
"transition-duration" = 600;
"children-class" = "not-power";
"transition-to-left" = true;
"click-to-reveal" = true;
};
modules = ["upower" "upower/headset"];
};
network = {
tooltip = true;
format-wifi = "{icon}";
format-icons = ["󰤟" "󰤢" "󰤥"];
rotate = 0;
format-ethernet = "󰈀 ";
tooltip-format = ''
Network: <big><b>{essid}</b></big>\n
Signal strength: <b>{signaldBm}dBm ({signalStrength}%)</b>\n
Frequency: <b>{frequency}MHz</b>\n
Interface: <b>{ifname}</b>\n
IP: <b>{ipaddr}/{cidr}</b>\n
Gateway: <b>{gwaddr}</b>\n
Netmask: <b>{netmask}</b>
''; '';
format-linked = "󰈀 {ifname} (No IP)"; interval = 60;
format-disconnected = ""; return-type = "json";
tooltip-format-disconnected = "Disconnected"; rotate = 270;
on-click = "/usr/local/bin/ags -t ControlPanel"; format = "{icon}";
interval = 2; format-icons = [
}; "󰝦" "󰪞" "󰪟" "󰪠" "󰪡" "󰪢" "󰪣" "󰪤" "󰪥"
];
"custom/smallspacer" = {
format = "";
rotate = 0;
}; };
memory = { memory = {
@@ -141,161 +102,116 @@
"󰝦" "󰪞" "󰪟" "󰪠" "󰪡" "󰪢" "󰪣" "󰪤" "󰪥" "󰝦" "󰪞" "󰪟" "󰪠" "󰪡" "󰪢" "󰪣" "󰪤" "󰪥"
]; ];
max-length = 10; max-length = 10;
tooltip-format = "RAM: {used:0.1f} GB / {total:0.1f} GB";
}; };
cpu = { cpu = {
interval = 1; interval = 1;
format = "{icon}";
rotate = 270; rotate = 270;
format = "{icon}";
format-icons = [ format-icons = [
"󰝦" "󰪞" "󰪟" "󰪠" "󰪡" "󰪢" "󰪣" "󰪤" "󰪥" "󰝦" "󰪞" "󰪟" "󰪠" "󰪡" "󰪢" "󰪣" "󰪤" "󰪥"
]; ];
}; tooltip-format = "CPU: {usage:0.1f}%";
"mpris" = {
format = "󰝚 {player_icon}";
rotate = 90;
"format-paused" = "<span color='#2d2d2e'>󰝚 {status_icon}</span>";
"max-length" = 6;
"player-icons" = {
default = "󰏤";
mpv = "󰝚";
};
"status-icons" = {
paused = "󰐊";
};
};
tray = {
"icon-size" = 16;
rotate = 0;
spacing = 3;
};
"group/expand" = {
orientation = "vertical";
drawer = {
"transition-duration" = 600;
"children-class" = "not-power";
"transition-to-left" = true;
};
modules = ["custom/menu" "custom/spacer" "tray"];
};
"custom/menu" = {
format = "󰅃";
rotate = 0;
};
"custom/notification" = {
tooltip = false;
rotate = 0;
format = "{icon}";
format-icons = {
notification = "󱅫";
none = "󰂚";
"dnd-notification" = "󱅫";
"dnd-none" = "󰂚";
"inhibited-notification" = "󱅫";
"inhibited-none" = "󰂚";
"dnd-inhibited-notification" = "󱅫";
"dnd-inhibited-none" = "󰂚";
};
"return-type" = "json";
"exec-if" = "which swaync-client";
exec = "swaync-client -swb";
"on-click-right" = "swaync-client -d -sw";
"on-click" = "swaync-client -t -sw";
escape = true;
};
"hyprland/window" = {
format = "<span weight='bold' >{class}</span>";
"on-click-right" = "pkill waybar & hyprctl dispatch exec waybar";
rotate = 90;
"max-length" = 120;
icon = false;
"icon-size" = 13;
}; };
"custom/power" = { "custom/power" = {
format = "@{}"; on-click = "shutdown now";
rotate = 0; tooltip = false;
"on-click" = "ags -t ControlPanel"; format = " ";
"on-click-right" = "pkill ags";
tooltip = true;
}; };
"custom/spacer" = { "custom/logout" = {
format = "|"; on-click = "hyprctl dispatch exit";
rotate = 90; tooltip = false;
format = "󰗽 ";
}; };
"hyprland/workspaces" = { "custom/reboot" = {
format = "{icon}"; on-click = "reboot";
"format-icons" = { tooltip = false;
default = ""; format = " ";
active = "";
};
}; };
"wlr/workspaces" = { "group/powerbtns" = {
"persistent-workspaces" = { orientation = "horizontal";
"1" = ["HDMI-A-1"]; drawer = {
"2" = ["HDMI-A-1"]; transition-duration = 500;
"3" = ["HDMI-A-1"]; children-class = "power-drawer";
"4" = ["DP-1"]; transition-left-to-right = false;
"5" = ["DP-1"];
"6" = ["DP-1"];
}; };
modules = [
"custom/power"
"custom/logout"
"custom/reboot"
];
}; };
pulseaudio = {
format = "{icon}";
rotate = 0;
format-muted = "";
tooltip-format = "{icon} {desc} // {volume}%";
scroll-step = 5;
format-icons = { clock = {
headphone = " "; format = "{:%I:%M %p}";
"hands-free" = " ";
headset = " ";
phone = " ";
portable = " ";
car = " ";
default = ["" " " " "];
}; };
}; };
# ------------------------------------------
programs.waybar.settings.sideBar = {
layer = "bottom";
output = "HDMI-A-1";
position = "right";
margin-top = 8;
margin-right = 5;
margin-bottom = 8;
name = "sideBar";
mode = "dock";
modules-left = [
"hyprland/workspaces"
];
modules-center = [
];
modules-right = [
"network"
"group/audio"
];
"hyprland/workspaces" = workspaces;
"pulseaudio/slider" = { "pulseaudio/slider" = {
min = 5;
max = 100;
rotate = 0;
device = "pulseaudio";
scroll-step = 1;
orientation = "vertical"; orientation = "vertical";
}; };
cava = { "group/audio" = {
"cava_config" = "~/.config/cava/config"; orientation = "vertical";
framerate = 60; modules = [
autosens = 1; "pulseaudio/slider"
bars = 14; "pulseaudio"
"lower_cutoff_freq" = 50; ];
"higher_cutoff_freq" = 10000;
method = "pulse";
source = "auto";
stereo = true;
reverse = false;
"bar_delimiter" = 0;
monstercat = false;
waves = false;
"noise_reduction" = 0.77;
"input_delay" = 2;
"format-icons" = ["" "" "" "" "" "" "" ""];
actions = {
"on-click-right" = "mode";
}; };
pulseaudio = {
format = "{icon}";
format-muted = " ";
format-icons = {
default = [
" "
" "
];
};
on-click = "pactl set-sink-mute @DEFAULT_SINK@ toggle";
on-click-right = "hyprctl dispatch exec '[float;size 40% 55%] pavucontrol'";
};
network = {
interval = 30;
format-wifi = "󰖩 ";
tooltip-format-wifi = "{essid} ({signalStrength}%)";
format-ethernet = " ";
tooltip-format-ethernet = "{ifname}";
format-disconnected = "󰖪 ";
tooltip-format-disconnected = "Disconnected";
on-click = "hyprctl dispatch exec '[float;size 40% 55%] kitty nmtui'";
}; };
}; };
} }

View File

@@ -30,74 +30,128 @@ in
{ {
programs.waybar.style = '' programs.waybar.style = ''
* { * {
border: none;
border-radius: 0;
font-size: 16px;
font-family: "JetBrains Mono Nerd Font"; font-family: "JetBrains Mono Nerd Font";
font-weight: bold;
font-size: 14;
}
#battery {
font-weight: normal;
font-size: 22px;
color: #a6d189;
background: #${bg.darkest};
border: 2px solid #${bg.dark};
border-radius: 6px;
}
#tray menu * {
font-weight: bold;
font-size: 13px;
color: #FBF1C7;
background: #${bg.darkest};
border: 2px solid #${bg.dark};
border-radius: 6px;
}
#taskbar button {
box-shadow: none;
font-size: 4px;
border-radius: 9px;
color: #A1BDCE;
background: #${bg.darkest};
border: 2px solid #${bg.dark};
border-radius: 6px;
}
tooltip {
background: #${bg.darkester};
color: #${fg.lighter};
font-size: 13px;
border-radius: 7px;
border: 2px solid #${bg.dark};
background: #${bg.darkest};
} }
window#waybar { window#waybar {
opacity: 0.85; border-radius: 20px;
background: #${bg.darkester}; border: 3px solid #${colors.color7};
border: 2px solid #${bg.dark}; background: rgba(46,52,64,0.9);
border-radius: 6px; margin: 20px;
}
window#waybar.empty #window {
background: none;
} }
#workspaces { #workspaces {
font-weight: normal; margin: 3px;
color: transparent; background: #${bg.dark};
margin-left: -5px; border-radius: 20px;
margin-top: 0px;
border: 0px;
border-radius: 6px;
} }
#workspaces button:hover {
border-radius: 20px;
}
#workspaces button.active {
background: #${fg.lightester};
border-radius: 20px;
color: #${bg.darkest};
}
#cava {
background: #${bg.dark};
border-radius: 20px;
margin: 3px 3px 3px 6px;
padding: 0px 15px 0px 15px;
color: #${colors.color6};
}
#window {
margin: 3px;
background: #${bg.dark};
border-radius: 20px;
padding: 0 15px 0 15px;
font-weight: bold;
}
#hardware {
margin: 3px;
padding: 0 10px 0 10px;
background: #${bg.dark};
border-radius: 20px;
}
#custom-disk-icon, #cpu, #memory {
margin-bottom: 4px;
font-size: 20px;
font-weight: bold;
}
#custom-disk-icon {
color: #${colors.color4};
}
#memory {
color: #${colors.color1};
}
#cpu {
color: #${colors.color3};
}
#clock {
font-weight: bold;
background: #${bg.dark};
border-radius: 20px;
margin: 3px;
padding: 0 10px 0 10px;
font-size: 18px;
}
#powerbtns {
background: #${bg.dark};
border-radius: 20px;
margin: 3px;
padding: 0 5px 0 10px;
}
#custom-power {
color: #${colors.color0};
font-size: 18px;
}
#custom-logout {
color: #${colors.color4};
font-size: 18px;
}
#custom-reboot {
color: #${colors.color2};
font-size: 18px;
}
#audio {
background: #${bg.dark};
border-radius: 20px;
margin: 3px;
padding: 5px 0 10px 0;
}
#pulseaudio {
color: #${colors.color4};
font-size: 18px;
}
#backlight-slider slider,
#pulseaudio-slider slider { #pulseaudio-slider slider {
background: #${colors.color3}; background: #${colors.color4};
background-color: transparent; background-color: transparent;
box-shadow: none; box-shadow: none;
} }
#backlight-slider trough,
#pulseaudio-slider trough { #pulseaudio-slider trough {
min-width: 9px; min-width: 9px;
min-height: 90px; min-height: 90px;
@@ -105,105 +159,18 @@ in
background: #343434; background: #343434;
} }
#backlight-slider highlight,
#pulseaudio-slider highlight { #pulseaudio-slider highlight {
border-radius: 8px; border-radius: 8px;
background-color: #2096C0; background-color: #2096C0;
} }
#pulseaudio {
font-weight: normal;
font-size: 18px;
color: #${colors.color3};
background: #${bg.darkest};
border: 2px solid #${bg.dark};
margin: 4px;
margin-bottom: 0px;
border: 2px solid @unfocused_borders;
border-bottom: 2px solid #151515;
border-radius: 6px;
border-bottom-left-radius: 0px;
border-bottom-right-radius: 0px;
}
#network { #network {
font-size: 19px; color: #${colors.color3};
color: #${colors.color4}; font-size: 20px;
background: #${bg.darkest}; background: #${bg.dark};
margin: 4px; border-radius: 20px;
margin-top: 0; margin: 3px;
border: 2px solid @unfocused_borders; padding: 5px 0 5px 6px;
border-top: 2px solid #151515;
border-radius: 6px;
border-top-left-radius: 0px;
border-top-right-radius: 0px;
}
#clock {
color: #${colors.color6};
font-size: 15px;
font-weight: 900;
font-family: "CaskaydiaCove Nerd Font Mono";
background: #${bg.darkest};
margin: 4px;
border-radius: 6px;
border: 2px solid @unfocused_borders;
border-radius: 6px;
}
#custom-notification {
font-family: "JetBrains Mono Nerd Font";
font-size: 21px;
color: #${colors.color7};
background: #${bg.darkest};
margin: 4px;
border: 2px solid @unfocused_borders;
border-radius: 6px;
}
#custom-power {
font-size: 15px;
color: #FFFFFF;
background: rgba(22, 19, 32, 0.9);
background: #${bg.darkest};
border: 2px solid #${bg.dark};
border-radius: 6px;
}
#backlight {
color: #${fg.lighter};
font-weight: normal;
font-size: 19px;
background: #${bg.darkest};
border: 2px solid #${bg.dark};
border-radius: 6px;
}
#custom-spacer {
opacity: 0.0;
}
#tray menu separator {
min-height: 10px;
}
#cpu {
font-weight: normal;
font-size: 22px;
color: #${fg.lighter};
background: #${bg.darkest};
border: 2px solid #${bg.dark};
border-radius: 6px;
}
#memory {
font-weight: normal;
font-size: 22px;
color: #${fg.lighter};
background: #${bg.darkest};
border: 2px solid #${bg.dark};
border-radius: 6px;
} }
''; '';
} }

View File

@@ -1,5 +1,26 @@
{ {
pkgs, pkgs,
}: }:
pkgs.writeShellScriptBin "chscheme" (builtins.readFile ./chscheme.sh) pkgs.writeShellScriptBin "chscheme" ''
/usr/bin/env ls "$(nix-build '<nixpkgs>' -A base16-schemes)"/share/themes | \
sed 's/\.yaml//g' | \
fzf --preview 'cat $(nix-build "<nixpkgs>" -A base16-schemes)/share/themes/{}.yaml | \
while IFS=": " read -r key value; do \
if [[ $key =~ base0[0-9A-F] ]]; then \
clean_value=$(echo $value | tr -d "\""); \
r=$((16#''${clean_value:0:2})); \
g=$((16#''${clean_value:2:2})); \
b=$((16#''${clean_value:4:2})); \
printf "\033[48;2;%d;%d;%dm %-20s %s \033[0m\n" $r $g $b $key $clean_value; \
fi; \
done' | xargs -I {} sed -i '/base16scheme \=/s/\".*\"/\"{}\"/' "$HOME"/.sysflake/flake.nix && \
echo "Successfully changed system color scheme. Rebuild now?" && \
select choice in "Yes" "No"; do
case $choice in
"Yes")
rebuild;exit 0;;
"No")
echo "Exiting...";exit 0;;
esac
done
''

View File

@@ -1,23 +0,0 @@
#!/usr/bin/env bash
/usr/bin/env ls "$(nix-build '<nixpkgs>' -A base16-schemes)"/share/themes | \
sed 's/\.yaml//g' | \
fzf --preview 'cat $(nix-build "<nixpkgs>" -A base16-schemes)/share/themes/{}.yaml | \
while IFS=": " read -r key value; do \
if [[ $key =~ base0[0-9A-F] ]]; then \
clean_value=$(echo $value | tr -d "\""); \
r=$((16#${clean_value:0:2})); \
g=$((16#${clean_value:2:2})); \
b=$((16#${clean_value:4:2})); \
printf "\033[48;2;%d;%d;%dm %-20s %s \033[0m\n" $r $g $b $key $clean_value; \
fi; \
done' | xargs -I {} sed -i '/base16scheme \=/s/\".*\"/\"{}\"/' "$HOME"/.sysflake/flake.nix && \
echo "Successfully changed system color scheme. Rebuild now?" && \
select choice in "Yes" "No"; do
case $choice in
"Yes")
rebuild;exit 0;;
"No")
echo "Exiting...";exit 0;;
esac
done

View File

@@ -19,7 +19,6 @@
grub.enable = true; grub.enable = true;
gtk.enable = true; gtk.enable = true;
nixos-icons.enable = true; nixos-icons.enable = true;
nixvim.enable = false;
}; };
cursor = { cursor = {
package = pkgs.bibata-cursors; package = pkgs.bibata-cursors;

View File

@@ -4,24 +4,24 @@
programs.nixvim = { programs.nixvim = {
colorschemes.base16 = { colorschemes.base16 = {
enable = true; enable = true;
colorscheme = { #colorscheme = {
base00 = "#${scheme.base00}"; # base00 = "#${scheme.base00}";
base01 = "#${scheme.base01}"; # base01 = "#${scheme.base01}";
base02 = "#${scheme.base02}"; # base02 = "#${scheme.base02}";
base03 = "#${scheme.base03}"; # base03 = "#${scheme.base03}";
base04 = "#${scheme.base04}"; # base04 = "#${scheme.base04}";
base05 = "#${scheme.base05}"; # base05 = "#${scheme.base05}";
base06 = "#${scheme.base06}"; # base06 = "#${scheme.base06}";
base07 = "#${scheme.base07}"; # base07 = "#${scheme.base07}";
base08 = "#${scheme.base08}"; # base08 = "#${scheme.base08}";
base09 = "#${scheme.base09}"; # base09 = "#${scheme.base09}";
base0A = "#${scheme.base0A}"; # base0A = "#${scheme.base0A}";
base0B = "#${scheme.base0B}"; # base0B = "#${scheme.base0B}";
base0C = "#${scheme.base0C}"; # base0C = "#${scheme.base0C}";
base0D = "#${scheme.base0D}"; # base0D = "#${scheme.base0D}";
base0E = "#${scheme.base0E}"; # base0E = "#${scheme.base0E}";
base0F = "#${scheme.base0F}"; # base0F = "#${scheme.base0F}";
}; #};
}; };
enable = true; enable = true;
diagnostics.signs = false; diagnostics.signs = false;