waybar: rework modules + add dnd mode (#69)
Some checks are pending
git-mirror / gitlab-sync (push) Waiting to run
nix-build / default-build (push) Waiting to run
nix-build / fallarbor-build (push) Waiting to run
nix-build / lavaridge-build (push) Waiting to run
nix-build / mauville-build (push) Waiting to run
nix-build / petalburg-build (push) Waiting to run
nix-build / rustboro-build (push) Waiting to run
nix-check / fmt-check (push) Waiting to run
nix-check / eval-check (push) Waiting to run

* waybar: add do not disturb

* nix fmt

* waybar: reformat and sort

* waybar: add airplane mode icons

* waybar: remove river buttons

* waybar: remove sway close button

* waybar: add tooltip to close button

* waybar: remove unused hyprland and sway window widget configs

* waybar: remove unused css

* waybar/dnd: color red when active

* waybar: simplify tooltips

* nix fmt

* waybar: update logout button icon

* waybar: css cleanup
This commit is contained in:
Aly Raffauf 2024-07-30 19:36:16 -04:00 committed by GitHub
parent 262481ac27
commit 1d4cf53541
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -25,11 +25,13 @@
modules-right = [ modules-right = [
"tray" "tray"
"group/hardware" "group/hardware"
"group/session"
]; ];
"hyprland/workspaces" = { "hyprland/workspaces" = {
"all-outputs" = true; "all-outputs" = true;
"format" = "{icon} {name}"; "format" = "{icon} {name}";
"format-icons" = { "format-icons" = {
"default" = "󰝥"; "default" = "󰝥";
"active" = "󰪥"; "active" = "󰪥";
@ -43,20 +45,15 @@
config.wayland.windowManager.hyprland.package "hyprctl"} dispatch submap reset''; config.wayland.windowManager.hyprland.package "hyprctl"} dispatch submap reset'';
}; };
"hyprland/window" = {
"format" = "";
"max-length" = 100;
"separate-outputs" = true;
"icon" = true;
};
"sway/workspaces" = { "sway/workspaces" = {
"all-outputs" = true; "all-outputs" = true;
"format" = "{icon} {name}"; "format" = "{icon} {name}";
"format-icons" = { "format-icons" = {
"default" = "󰝥"; "default" = "󰝥";
"focused" = "󰪥"; "focused" = "󰪥";
}; };
"sort-by" = "id"; "sort-by" = "id";
}; };
@ -64,51 +61,36 @@
"on-click" = ''${lib.getExe' config.wayland.windowManager.sway.package "swaymsg"} mode default''; "on-click" = ''${lib.getExe' config.wayland.windowManager.sway.package "swaymsg"} mode default'';
}; };
"sway/window" = {
"max-length" = 100;
};
"sway/scratchpad" = { "sway/scratchpad" = {
"format" = "{icon} {count}"; "format" = "{icon} {count}";
"show-empty" = false;
"format-icons" = ["" ""]; "format-icons" = ["" ""];
"show-empty" = false;
"tooltip" = true; "tooltip" = true;
"tooltip-format" = "{app}: {title}"; "tooltip-format" = "{app}: {title}";
}; };
"custom/sway-close" = {
"on-click" = ''${lib.getExe'
config.wayland.windowManager.sway.package "swaymsg"} kill'';
"format" = "󰅗";
};
"custom/hyprland-close" = { "custom/hyprland-close" = {
"on-click" = ''${lib.getExe' "on-click" = ''${lib.getExe'
config.wayland.windowManager.hyprland.package "hyprctl"} dispatch killactive''; config.wayland.windowManager.hyprland.package "hyprctl"} dispatch killactive'';
"format" = "󰅗"; "format" = "󰅗";
}; "tooltip-format" = "Close the focused window.";
"river/window" = {
"max-length" = 100;
};
"river/tags" = {
"num-tags" = 4;
}; };
"clock" = { "clock" = {
"tooltip-format" = "{:%Y-%m-%d | %H:%M}";
"interval" = 60;
"format" = "{:%I:%M%p}"; "format" = "{:%I:%M%p}";
"interval" = 60;
"tooltip-format" = "{:%Y-%m-%d | %H:%M}";
}; };
"battery" = { "battery" = {
"states" = {"critical" = 20;};
"format" = "{icon}"; "format" = "{icon}";
"format-icons" = ["󰁺" "󰁻" "󰁼" "󰁽" "󰁾" "󰁿" "󰂀" "󰂁" "󰂂" "󰁹"]; "format-icons" = ["󰁺" "󰁻" "󰁼" "󰁽" "󰁾" "󰁿" "󰂀" "󰂁" "󰂂" "󰁹"];
"tooltip-format" = '' "tooltip-format" = ''
{capacity}%: {timeTo}. {capacity}%: {timeTo}.
Draw: {power} watts.''; Draw: {power} watts.'';
"states" = {"critical" = 20;};
}; };
"idle_inhibitor" = { "idle_inhibitor" = {
@ -122,25 +104,27 @@
"timeout" = 45; "timeout" = 45;
"tooltip-format-activated" = '' "tooltip-format-activated" = ''
Sleep inhibited. Presentation mode enabled.
System will not sleep.''; System will not sleep.'';
"tooltip-format-deactivated" = '' "tooltip-format-deactivated" = ''
Sleep uninhibited. Presentation mode disabled.
System will sleep normally.''; System will sleep normally.'';
}; };
"bluetooth" = { "bluetooth" = {
"format" = ""; "format" = "";
"format-disabled" = ""; # an empty format will hide the module
"format-connected" = " {num_connections}"; "format-connected" = " {num_connections}";
"format-disabled" = ""; # an empty format will hide the module
"on-click" = lib.getExe' pkgs.blueberry "blueberry";
"tooltip-format" = "{controller_alias} {controller_address}"; "tooltip-format" = "{controller_alias} {controller_address}";
"tooltip-format-connected" = '' "tooltip-format-connected" = ''
{controller_alias} {controller_address} {controller_alias} {controller_address}
{device_enumerate}''; {device_enumerate}'';
"tooltip-format-enumerate-connected" = "{device_alias} {device_address}"; "tooltip-format-enumerate-connected" = "{device_alias} {device_address}";
"on-click" = lib.getExe' pkgs.blueberry "blueberry";
}; };
"pulseaudio" = { "pulseaudio" = {
@ -155,55 +139,89 @@
"default" = ["" "" ""]; "default" = ["" "" ""];
}; };
"scroll-step" = 5;
"ignored-sinks" = ["Easy Effects Sink"]; "ignored-sinks" = ["Easy Effects Sink"];
"on-click" = "${lib.getExe pkgs.pavucontrol} -t 3"; "on-click" = "${lib.getExe pkgs.pavucontrol} -t 3";
"scroll-step" = 5;
}; };
"network" = { "network" = {
"format-wifi" = "{icon}"; "format-disabled" = "󰀝";
"format-disconnected" = "󰀦";
"format-ethernet" = "󰈀"; "format-ethernet" = "󰈀";
"format-disconnected" = "";
"format-icons" = ["󰤟" "󰤢" "󰤥" "󰤨"]; "format-icons" = ["󰤟" "󰤢" "󰤥" "󰤨"];
"tooltip-format" = "{ifname} via {gwaddr} 󰊗"; "format-wifi" = "{icon}";
"tooltip-format-wifi" = "{essid} ({signalStrength}%) {icon}";
"tooltip-format-ethernet" = "{ifname} ";
"tooltip-format-disconnected" = "Disconnected";
"on-click" = "${lib.getExe pkgs.networkmanager_dmenu} -i"; "on-click" = "${lib.getExe pkgs.networkmanager_dmenu} -i";
"tooltip-format" = "{ifname} via {gwaddr} 󰊗";
"tooltip-format-disconnected" = "Disconnected";
"tooltip-format-ethernet" = "{ifname} ";
"tooltip-format-wifi" = "{essid} ({signalStrength}%) {icon}";
}; };
"tray" = {"spacing" = 15;}; "tray" = {"spacing" = 15;};
"custom/dnd" = let
mako-dnd = pkgs.writeShellScript "mako-dnd" ''
show() {
MAKO_MODE=$(${lib.getExe' pkgs.mako "makoctl"} mode)
if echo "$MAKO_MODE" | grep -q "do-not-disturb"; then
printf '{"text": "󰂛", "class": "on", "tooltip": "Notifications snoozed."}\n'
else
printf '{"text": "󰂚", "class": "off","tooltip": "Notifications enabled."}\n'
fi
}
toggle() {
${lib.getExe' pkgs.mako "makoctl"} mode -t do-not-disturb
${lib.getExe' pkgs.procps "pkill"} -SIGRTMIN+2 .waybar-wrapped
}
[ $# -gt 0 ] && toggle || show
'';
in {
"exec" = "${mako-dnd}";
"interval" = "once";
"on-click" = "${mako-dnd} toggle";
"return-type" = "json";
"signal" = 2;
};
"custom/logout" = { "custom/logout" = {
"format" = "󰤆";
"on-click" = ''${lib.getExe config.programs.rofi.package} -i -show power-menu -modi "power-menu:${lib.getExe pkgs.rofi-power-menu} --choices=logout/lockscreen/suspend/shutdown/reboot"''; "on-click" = ''${lib.getExe config.programs.rofi.package} -i -show power-menu -modi "power-menu:${lib.getExe pkgs.rofi-power-menu} --choices=logout/lockscreen/suspend/shutdown/reboot"'';
"format" = "󰗽"; "tooltip-format" = "Manage your session.";
}; };
"custom/menu" = { "custom/menu" = {
"on-click" = "${lib.getExe pkgs.nwg-drawer} -mt 5";
"format" = "󰀻"; "format" = "󰀻";
"on-click" = "${lib.getExe pkgs.nwg-drawer} -mt 5";
"tooltip-format" = "Touch-friendly application menu.";
}; };
"power-profiles-daemon" = { "power-profiles-daemon" = {
"format" = "{icon}"; "format" = "{icon}";
"format-icons" = {
"balanced" = "󰗑";
"default" = "󱐌";
"performance" = "󱐌";
"power-saver" = "󰌪";
};
"tooltip-format" = '' "tooltip-format" = ''
Profile: {profile} Profile: {profile}
Driver: {driver}''; Driver: {driver}'';
"tooltip" = true; "tooltip" = true;
"format-icons" = {
"default" = "󱐌";
"performance" = "󱐌";
"balanced" = "󰗑";
"power-saver" = "󰌪";
};
}; };
"group/hardware" = { "group/hardware" = {
"orientation" = "horizontal"; "orientation" = "horizontal";
modules = ["pulseaudio" "bluetooth" "network" "power-profiles-daemon" "battery" "idle_inhibitor" "custom/logout"]; modules = ["pulseaudio" "bluetooth" "network" "power-profiles-daemon" "battery"];
};
"group/session" = {
"orientation" = "horizontal";
modules = ["custom/dnd" "idle_inhibitor" "custom/logout"];
}; };
}; };
}; };
@ -234,23 +252,6 @@
color: ${config.ar.home.theme.colors.primary}; color: ${config.ar.home.theme.colors.primary};
} }
#submap,
#mode {
padding: 0 15px;
margin: 0 5px;
color: #FFFFFF;
}
#tags button {
padding: 0px 5px;
margin: 0 0px;
color: ${config.ar.home.theme.colors.text};
}
#tags button.focused {
color: ${config.ar.home.theme.colors.primary};
}
#clock, #clock,
#battery, #battery,
#bluetooth, #bluetooth,
@ -259,9 +260,9 @@
#pulseaudio, #pulseaudio,
#wireplumber, #wireplumber,
#idle_inhibitor, #idle_inhibitor,
#custom-dnd,
#custom-logout, #custom-logout,
#custom-menu, #custom-menu,
#custom-sway-close,
#tray { #tray {
padding: 0 7.5px; padding: 0 7.5px;
margin: 0 5px; margin: 0 5px;
@ -275,27 +276,28 @@
color: ${config.ar.home.theme.colors.primary}; color: ${config.ar.home.theme.colors.primary};
} }
#battery.critical:not(.charging) { #battery.critical:not(.charging),
#custom-dnd.on {
color: #e78284; color: #e78284;
} }
#workspaces,
#mode,
#submap,
#scratchpad,
#tray,
#clock, #clock,
#custom-menu,
#custom-sway-close,
#custom-hyprland-close, #custom-hyprland-close,
#hardware { #custom-menu,
#hardware,
#mode,
#scratchpad,
#session,
#submap,
#tray,
#workspaces {
border-radius: 10; border-radius: 10;
background: rgba (36, 36, 36, 0.8); background: rgba (36, 36, 36, 0.8);
margin: 5px 10px 0px 10px; margin: 5px 10px 0px 10px;
padding: 0px 10px 0px 10px; padding: 0px 10px 0px 10px;
} }
#clock, #custom-menu, #custom-sway-close, #custom-hyprland-close { #clock, #custom-menu, #custom-hyprland-close {
padding: 0px 20px 0px 20px; padding: 0px 20px 0px 20px;
} }