Change waybar styles

This commit is contained in:
Riley Apeldoorn 2023-09-21 20:38:50 +02:00
parent f6a3d89a8a
commit 3107449982
3 changed files with 65 additions and 97 deletions

View File

@ -5,9 +5,8 @@
global = {
font = "Fira Code 9";
origin = "bottom-right";
offset = "10x10";
offset = "3x50";
frame_width = "2";
frame_color = "#ffffff";
corner_radius = "4";
width = "400";
};

View File

@ -114,7 +114,8 @@ in with lib; {
"${mod}+Alt+a" = "layout toggle stacking splitv";
"${mod}+Alt+s" = "layout toggle tabbed splith";
"${mod}+Escape" = "exec swaylock";
"${mod}+Escape" = "exec ${pkgs.swaylock}/bin/swaylock";
"${mod}+Space" = "exec pkill -SIGUSR1 waybar";
"${mod}+Return" = "exec ${terminal}";
"${mod}+Alt+Return" = "exec ${pkgs.foot}/bin/foot";

View File

@ -36,20 +36,15 @@ in {
target = "sway-session.target";
};
settings = [{
margin = "3";
position = "bottom";
exclusive = false;
layer = "top";
modules-left = [
modules-right = with lib; flatten [
"sway/workspaces"
"sway/mode"
"mpd"
];
modules-right = with lib; flatten [
"cpu"
"disk"
(optional (cfg.battery.name != "") "battery")
(optional (cfg.bluetooth.enable) "bluetooth")
(optional (cfg.network.wifi != "") "network#wifi")
(optional (cfg.network.eth != "") "network#eth")
(optional (cfg.network.vpn != "") "network#vpn")
"network"
(if cfg.audio.wireplumber
then "wireplumber"
else "pulseaudio")
@ -62,35 +57,28 @@ in {
"format-disconnected" = "";
};
"clock#time" = {
"format" = "{:%H:%M:%S}";
"format" = "{:%H:%M}";
"interval" = 1;
};
"clock#date" = {
"format" = "{:%Y-%m-%d}";
"interval" = 60;
};
"network#wifi" = {
"interface" = cfg.network.wifi;
"format" = "wifi";
};
"network#eth" = {
"interface" = cfg.network.eth;
"format" = "eth";
};
"network#vpn" = {
"interface" = cfg.network.vpn;
"format" = "vpn";
"network" = {
"format-wifi" = "{essid}";
"format-ethernet" = "eth";
"format-disconnected" = "";
};
"pulseaudio" = {
"format" = "{desc}: {volume}%";
"format" = "{desc} | {volume}%";
};
"wireplumber" = {
"format" = "{node_name}: {volume}%";
"format" = "{node_name} | {volume}%";
};
"battery" = {
"bat" = cfg.battery.name;
"format-discharging" = "{capacity}% (battery)";
"format-charging" = "{capacity}% (charging)";
"format-discharging" = "{capacity}%";
"format-charging" = "{capacity}%";
"format-full" = "";
"states" = {
"critical" = 20;
@ -101,29 +89,10 @@ in {
"format-on" = "";
"format-connected" = "{device_alias}";
};
"disk" = {
"format" = "{used} :: {free}";
};
"sway/workspaces" = {
"all-outputs" = true;
};
}];
style = let
green = "#27e67a";
yellow = "#edd340";
pink = "#ff4787";
teal = "#1bcf9c";
blue = "#3988e3";
violet = "#9063e6";
lime = "#bfed5a";
red = "#eb3b5b";
disabled = ''
color: #ffffff;
background-color: rgba(207, 207, 207, 0.4);
'';
in ''
# TODO: make this fancy scss
style = ''
/* General/shared styles */
* {
@ -133,7 +102,13 @@ in {
}
window#waybar {
background-color: rgba(0, 0, 0, 0.45);
background-color: transparent;
}
.modules-right {
background-color: #424242;
border-radius: 40px;
padding-left: 2px;
}
#battery,
@ -147,12 +122,9 @@ in {
#pulseaudio,
#wireplumber
{
padding: 2px 10px;
margin: 5px;
padding: 5px 10px;
margin: 5px 2px;
border-radius: 100px;
}
#cpu, #disk, #bluetooth, #mpd {
color: #ffffff;
background-color: rgba(0, 0, 0, 0.4);
}
@ -161,32 +133,34 @@ in {
/* Sway chips */
#workspaces {
margin-left: 5px;
padding: 0;
margin: 5px;
margin: 5px 2px 5px 5px;
border-radius: 200px;
background-color: rgba(0, 0, 0, 0.4);
}
#workspaces button {
margin: 0;
padding: 0 5px;
border: 2px solid;
border-color: transparent;
border-radius: 100px;
color: #ffffff;
background-color: rgba(0, 0, 0, 0.4);
font-size: 9px;
margin: 0;
padding: 0 5px;
}
#workspaces button.visible.focused {
color: #212121;
background-color: ${green};
color: #ffffff;
border-color: #2bdafc;
}
#workspaces button.visible {
color: ${green};
color: #2bdafc;
}
#mode {
background-color: ${teal};
color: #212121;
background-color: #2bdafc;
}
@ -194,69 +168,63 @@ in {
#clock {
color: #ffffff;
background-color: transparent;
padding: 5px 10px;
background-color: rgba(0, 0, 0, 0.4);
}
#clock.date { padding-right: 0; }
#clock.time { padding-left: 0; }
#clock.date {
padding-right: 5px;
margin-right: 0;
border-radius: 14px 0 0 14px;
}
#clock.time {
padding-left: 5px;
margin-left: 0;
border-radius: 0 14px 14px 0;
margin-right: 5px;
}
/* Radio chips */
#network {
background-color: ${green};
}
#network.disconnected {
${disabled}
color: #ffffff;
background-color: transparent;
}
#bluetooth.connected {
background-color: ${blue};
background-color: #3988e3;
}
/* Audio chip */
#pulseaudio,
#wireplumber
{
background-color: ${yellow};
}
#pulseaudio.muted,
#wireplumber.muted
{
${disabled}
color: rgba(207, 207, 207, 0.9);
}
/* Battery chip */
#battery.discharging {
#battery {
border: 2px solid;
border-color: transparent;
border-radius: 200px;
padding: 5px 8px;
color: #ffffff;
background-color: ${violet};
background-color: rgba(0, 0, 0, 0.4);
}
#battery.charging {
background-color: ${lime};
border-color: #2bdafc;
}
#battery.critical {
background-color: ${red};
border-color: #eb3b5b;
}
/* MPD chip */
#mpd.playing {
color: #ffffff;
}
#mpd.paused {
${disabled}
}
'';
};
};