new waybar
This commit is contained in:
parent
4c6082972e
commit
25ce5a7780
3 changed files with 196 additions and 254 deletions
|
@ -507,40 +507,203 @@ let
|
|||
|
||||
settings = [
|
||||
({
|
||||
modules-left = [ "sway/workspaces" "sway/mode" ];
|
||||
modules-center = [ "clock" "mpd" ];
|
||||
modules-right = (lib.optional cfg.battery "battery")
|
||||
++ [ "pulseaudio" "network" "memory" "cpu" "temperature" "tray" ];
|
||||
position = "left";
|
||||
width = 50;
|
||||
height = null;
|
||||
|
||||
modules.network.format-wifi = "{signalStrength}% ";
|
||||
modules.network.format-alt = "{ipaddr}";
|
||||
modules.pulseaudio.format = "{volume}% ";
|
||||
modules.memory.format = "{}% ";
|
||||
modules.mpd.rotate = 90;
|
||||
modules.temperature = {
|
||||
format = "{temperatureC}°C {icon}";
|
||||
format-icons = [ "" "" "" ];
|
||||
modules-left = [ "sway/workspaces" "custom/right-arrow-dark" "custom/right-arrow-light" "custom/weather-temp" "custom/weather-precip" "custom/weather-wind" "custom/right-arrow-dark" ];
|
||||
modules-center = [ "custom/left-arrow-dark" "clock#1" "clock#2" "custom/left-arrow-light" "custom/left-arrow-dark" "mpd" "custom/right-arrow-dark" "custom/right-arrow-light" "clock#3" "custom/right-arrow-dark" ];
|
||||
modules-right = [ "custom/left-arrow-dark" "pulseaudio" "custom/left-arrow-light" "custom/left-arrow-dark" "memory" "custom/left-arrow-light" "custom/left-arrow-dark" "cpu" "custom/left-arrow-light" "custom/left-arrow-dark" ] ++ lib.optionals cfg.battery [ "battery" "custom/left-arrow-light" "custom/left-arrow-dark" ] ++ [ "tray" ];
|
||||
|
||||
modules = {
|
||||
"custom/left-arrow-dark" = {
|
||||
format = "";
|
||||
tooltip = false;
|
||||
rotate = 270;
|
||||
};
|
||||
"custom/left-arrow-light" = {
|
||||
format = "";
|
||||
tooltip = false;
|
||||
rotate = 270;
|
||||
};
|
||||
"custom/right-arrow-dark" = {
|
||||
format = "";
|
||||
tooltip = false;
|
||||
rotate = 270;
|
||||
};
|
||||
"custom/right-arrow-light" = {
|
||||
format = "";
|
||||
tooltip = false;
|
||||
rotate = 270;
|
||||
};
|
||||
|
||||
"custom/weather-temp" = {
|
||||
exec = "${pkgs.curl}/bin/curl 'wttr.in/${cfg.location}?format=%c+%t'";
|
||||
on-click = "${pkgs.xdg-utils}/bin/xdg-open 'https://weather.com/weather/today/l/85625'";
|
||||
on-click-right = "${pkgs.xdg-utils}/bin/xdg-open 'https://wttr.in/${cfg.location}'";
|
||||
interval = 3600;
|
||||
};
|
||||
"custom/weather-precip" = {
|
||||
exec = "${pkgs.curl}/bin/curl 'wttr.in/${cfg.location}?format=🌧️+%p'";
|
||||
on-click = "${pkgs.xdg-utils}/bin/xdg-open 'https://www.lightningmaps.org/'";
|
||||
on-click-right = "${pkgs.xdg-utils}/bin/xdg-open 'https://wttr.in/${cfg.location}'";
|
||||
interval = 3600;
|
||||
};
|
||||
"custom/weather-wind" = {
|
||||
exec = "${pkgs.curl}/bin/curl 'wttr.in/${cfg.location}?format=🌬️+%w'";
|
||||
on-click = "${pkgs.xdg-utils}/bin/xdg-open 'https://www.ventusky.com/";
|
||||
on-click-right = "${pkgs.xdg-utils}/bin/xdg-open 'https://wttr.in/${cfg.location}'";
|
||||
interval = 3600;
|
||||
};
|
||||
|
||||
mpd = {
|
||||
rotate = 90;
|
||||
max-length = 40;
|
||||
format = "{stateIcon} {artist} - {title}";
|
||||
format-stopped = "⏹ STOPPED";
|
||||
state-icons = {
|
||||
paused = "";
|
||||
playing = "";
|
||||
};
|
||||
};
|
||||
|
||||
"sway/workspaces" = {
|
||||
disable-scroll = true;
|
||||
};
|
||||
|
||||
"clock#1" = {
|
||||
tooltip = false;
|
||||
format = "{:%a}";
|
||||
};
|
||||
"clock#2" = {
|
||||
tooltip = false;
|
||||
format = "{:%m-%d}";
|
||||
};
|
||||
"clock#3" = {
|
||||
tooltip = false;
|
||||
format = "{:%H:%M}";
|
||||
};
|
||||
|
||||
pulseaudio = {
|
||||
format = "{icon} {volume}%";
|
||||
format-bluetooth = "{icon} {volume}%";
|
||||
format-muted = "MUTE";
|
||||
format-icons = {
|
||||
headphone = "";
|
||||
default = "";
|
||||
};
|
||||
on-click = "${pkgs.pulseaudio}/bin/pactl set-source-mute @DEFAULT_SOURCE@ toggle";
|
||||
on-click-right = "${pkgs.pavucontrol}/bin/pavucontrol";
|
||||
};
|
||||
|
||||
memory = {
|
||||
interval = 10;
|
||||
format = " {}%";
|
||||
};
|
||||
|
||||
cpu = {
|
||||
interval = 10;
|
||||
format = " {usage}%";
|
||||
};
|
||||
|
||||
battery = {
|
||||
states = {
|
||||
good = 90;
|
||||
warning = 25;
|
||||
critical = 10;
|
||||
};
|
||||
format = "{icon} {capacity}%";
|
||||
format-icons = [ "" "" "" "" "" ];
|
||||
};
|
||||
|
||||
tray = {
|
||||
icon-size = 18;
|
||||
spacing = 5;
|
||||
};
|
||||
};
|
||||
|
||||
} // cfg.waybarConfig)
|
||||
];
|
||||
|
||||
style =
|
||||
(
|
||||
builtins.readFile "${pkgs.waybar}/etc/xdg/waybar/style.css" + "\n" + config.colors.waybarCss + "\n" + ''
|
||||
#clock, #battery, #cpu, #memory, #network, #pulseaudio, #tray, #mode, #temperature, #clock, #mpd {
|
||||
margin: 3px 0;
|
||||
padding: 5px 2px;
|
||||
}
|
||||
style = ''
|
||||
window#waybar {
|
||||
background: #${config.colors.base16.base01};
|
||||
color: #${config.colors.base16.base06};
|
||||
}
|
||||
|
||||
* {
|
||||
font-family: "${config.fonts.favFont.name}";
|
||||
font-size: ${toString config.fonts.favFont.size}px;
|
||||
}
|
||||
''
|
||||
);
|
||||
#custom-right-arrow-dark,
|
||||
#custom-left-arrow-dark {
|
||||
color: #${config.colors.base16.base00};
|
||||
font-size: 15px;
|
||||
}
|
||||
#custom-right-arrow-light,
|
||||
#custom-left-arrow-light {
|
||||
color: #${config.colors.base16.base01};
|
||||
background: #${config.colors.base16.base00};
|
||||
font-size: 15px;
|
||||
}
|
||||
|
||||
#workspaces,
|
||||
#clock.1,
|
||||
#clock.2,
|
||||
#clock.3,
|
||||
#pulseaudio,
|
||||
#memory,
|
||||
#cpu,
|
||||
#battery,
|
||||
#disk,
|
||||
#tray,
|
||||
#mode,
|
||||
#custom-weather-temp,
|
||||
#custom-weather-precip,
|
||||
#custom-weather-wind,
|
||||
#mpd {
|
||||
background: #${config.colors.base16.base00};
|
||||
padding: 5px 0;
|
||||
}
|
||||
|
||||
#clock.1 { padding: 5px 0 0 0; }
|
||||
#clock.2 { padding: 0 0 5px 0; }
|
||||
|
||||
#custom-weather-temp { padding: 5px 0 0 0; }
|
||||
#custom-weather-precip { padding: 5px 0; }
|
||||
#custom-weather-wind { padding: 0 0 5px 0; }
|
||||
|
||||
#mpd.playing {
|
||||
color: #${config.colors.base16.base0A};
|
||||
}
|
||||
|
||||
#workspaces button {
|
||||
padding: 0 2px;
|
||||
}
|
||||
#workspaces button.focused {
|
||||
color: #${config.colors.base16.base0A};
|
||||
}
|
||||
#workspaces button:hover {
|
||||
box-shadow: inherit;
|
||||
text-shadow: inherit;
|
||||
}
|
||||
#workspaces button:hover {
|
||||
background: #${config.colors.base16.base02};
|
||||
}
|
||||
|
||||
#pulseaudio {
|
||||
color: #${config.colors.base16.base0B};
|
||||
}
|
||||
#memory {
|
||||
color: #${config.colors.base16.base0C};
|
||||
}
|
||||
#cpu {
|
||||
color: #${config.colors.base16.base0D};
|
||||
}
|
||||
#battery {
|
||||
color: #${config.colors.base16.base0E};
|
||||
}
|
||||
|
||||
* {
|
||||
font-family: "${config.fonts.favFont.name}";
|
||||
font-size: ${toString (config.fonts.favFont.size + 1)}px;
|
||||
}
|
||||
'';
|
||||
};
|
||||
|
||||
programs.mako.enable = true;
|
||||
|
@ -888,6 +1051,13 @@ in
|
|||
default = false;
|
||||
description = "If this PC has a battery";
|
||||
};
|
||||
|
||||
location = mkOption {
|
||||
description = "Your location (used for weather)";
|
||||
example = "US-12345";
|
||||
default = "";
|
||||
type = types.str;
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable (
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue