feat: add waybar configuration

This commit is contained in:
oddlama 2024-06-12 18:04:59 +02:00
parent 426a305b67
commit 870a8b122e
No known key found for this signature in database
GPG key ID: 14EFE510775FE39A
5 changed files with 371 additions and 19 deletions

View file

@ -1,33 +1,139 @@
{
lib,
pkgs,
...
}: {
programs.waybar = {
enable = true;
style = builtins.readFile ./waybar-style.css;
settings.main = {
layer = "top";
position = "top";
height = 30;
position = "bottom";
height = 28;
modules-left = ["wlr/workspaces" "wlr/taskbar"];
modules-center = ["hyprland/window"];
modules-right = ["network" "clock" "bluetooth" "cpu" "memory" "tray"];
modules-left = [
"hyprland/workspaces"
"tray"
"hyprland/submap"
"privacy"
];
modules-center = [
"hyprland/window"
];
modules-right = [
"custom/scanqr"
"custom/pickcolor"
#"custom/screencast"
#"custom/gpuscreenrecorder"
"wlr/workspaces" = {
format = "{icon}";
on-click = "activate";
#SPACER
#"brightness"
"pulseaudio#source"
"wireplumber"
"network"
"bluetooth"
#"temps"
"cpu"
"memory"
#"battery"
"custom/notification"
"clock"
];
"custom/scanqr" = {
tooltip = false;
format = "󰐲";
on-click = lib.getExe pkgs.scripts.screenshot-area-scan-qr;
};
"custom/pickcolor" = {
tooltip = false;
format = "";
on-click = "${lib.getExe pkgs.hyprpicker} --autocopy";
};
"custom/notification" = {
tooltip = false;
format = "{icon} {}";
format-icons = {
urgent = "";
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 = "";
};
sort-by-number = true;
all-outputs = true;
return-type = "json";
exec = "swaync-client -swb";
on-click = "swaync-client -t -sw";
on-click-right = "swaync-client -d -sw";
on-click-middle = "swaync-client --close-all";
escape = true;
};
privacy = {
icon-spacing = 4;
icon-size = 18;
transition-duration = 250;
modules = [
{
type = "screenshare";
tooltip = true;
tooltip-icon-size = 24;
}
{
type = "audio-out";
tooltip = true;
tooltip-icon-size = 24;
}
{
type = "audio-in";
tooltip = true;
tooltip-icon-size = 24;
}
];
};
wireplumber = {
format = "<tt>{icon} {volume}%</tt>";
format-muted = "<tt> {volume}%</tt>";
format-icons = ["" ""];
on-click = "hyprctl dispatch exec \"[float;pin;move 80% 50%;size 20% 50%;noborder]\" ${lib.getExe pkgs.pwvucontrol}";
on-click-middle = "${pkgs.wireplumber}/bin/wpctl set-volume @DEFAULT_AUDIO_SINK@ 100%";
on-click-right = "${pkgs.wireplumber}/bin/wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle";
};
"pulseaudio#source" = {
format = "{format_source}";
format-source = "<tt> {volume}%</tt>";
format-source-muted = "<tt> {volume}%</tt>";
on-click = "${lib.getExe pkgs.helvum}";
on-click-middle = "${pkgs.wireplumber}/bin/wpctl set-volume @DEFAULT_AUDIO_SOURCE@ 100%";
on-click-right = "${pkgs.wireplumber}/bin/wpctl set-mute @DEFAULT_AUDIO_SOURCE@ toggle";
on-scroll-up = "${pkgs.wireplumber}/bin/wpctl set-volume @DEFAULT_AUDIO_SOURCE@ 1%+";
on-scroll-down = "${pkgs.wireplumber}/bin/wpctl set-volume @DEFAULT_AUDIO_SOURCE@ 1%-";
};
"hyprland/workspaces" = {
format = "{icon}";
format-icons.urgent = "";
all-outputs = false;
sort-by = "id";
};
clock = {
format = "{:%H:%M}";
format-alt = "{:%A, %B %d, %Y (%R)}";
tooltip-format = "<tt><small>{calendar}</small></tt>";
tooltip-format = "<tt><span size='16pt' font='JetBrains Mono'>{calendar}</span></tt>";
calendar = {
mode = "year";
mode-mon-col = 3;
mode-mon-col = 4;
weeks-pos = "right";
on-scroll = 1;
on-click-right = "mode";
@ -36,7 +142,7 @@
days = "<span color='#ecc6d9'><b>{}</b></span>";
weeks = "<span color='#99ffdd'><b>W{}</b></span>";
weekdays = "<span color='#ffcc66'><b>{}</b></span>";
today = "<span color='#ff6699'><b><u>{}</u></b></span>";
today = "<span bgcolor='#ff6699' color='#000000'><b><u>{}</u></b></span>";
};
actions = {
on-click-right = "mode";
@ -50,9 +156,9 @@
network = {
interval = 5;
format-ethernet = " {ipaddr}/{cidr}"; # Icon: ethernet
format-ethernet = "󰈀 {ipaddr}/{cidr}";
format-disconnected = " Disconnected";
tooltip-format = ": {bandwidthDownBytes} : {bandwidthUpBytes}";
tooltip-format = " {bandwidthUpBytes}\n {bandwidthDownBytes}";
};
bluetooth = {
@ -67,7 +173,7 @@
memory = {
interval = 5;
format = " {}%";
format = " {percentage}%";
states = {
warning = 70;
critical = 90;
@ -76,9 +182,8 @@
cpu = {
interval = 5;
format = " {icon0} {icon1} {icon2} {icon3} {icon4} {icon5} {icon6} {icon7}";
format = " {usage}%";
tooltip-format = "{usage}";
format-icons = ["" "" "" "" "" "" "" ""];
};
tray = {