waybar redo
This commit is contained in:
parent
0b21647b2b
commit
f5a8935507
14 changed files with 223 additions and 72 deletions
|
|
@ -37,6 +37,7 @@
|
|||
base16 = "#d6acff"; # bright blue
|
||||
base17 = "#ff92df"; # bright purple
|
||||
taskbarText = base04;
|
||||
taskbarBackground = base10;
|
||||
background_paper = "#000000";
|
||||
foreground_paper = "#26052e";
|
||||
};
|
||||
|
|
|
|||
|
|
@ -194,12 +194,13 @@ in
|
|||
"custom/spotify"
|
||||
];
|
||||
right = [
|
||||
"custom/vpn"
|
||||
"wireplumber"
|
||||
"custom/bluetooth"
|
||||
"battery"
|
||||
"network"
|
||||
"wireplumber"
|
||||
"cpu"
|
||||
"memory"
|
||||
"custom/poweroff"
|
||||
"temperature"
|
||||
];
|
||||
};
|
||||
enable = lib.mkDefault enableGraphical;
|
||||
|
|
|
|||
79
modules/waybar/battery.nix
Normal file
79
modules/waybar/battery.nix
Normal file
|
|
@ -0,0 +1,79 @@
|
|||
{
|
||||
lib,
|
||||
config,
|
||||
...
|
||||
}:
|
||||
let
|
||||
name = "battery";
|
||||
in
|
||||
{
|
||||
options.modules.waybar.modules = import ./addname.nix lib name;
|
||||
options.modules.waybar.enabled.${name} = {
|
||||
enable = lib.mkEnableOption "enable ${name} waybar module";
|
||||
};
|
||||
config = lib.mkIf config.modules.waybar.enabled.${name}.enable {
|
||||
programs.waybar = {
|
||||
settings.mainBar.${name} = {
|
||||
states = {
|
||||
full = 100;
|
||||
good = 99;
|
||||
warning = 30;
|
||||
critical = 15;
|
||||
};
|
||||
format = "{capacity}% {icon}";
|
||||
format-charging = "{capacity}% {icon}";
|
||||
format-plugged = "{capacity}% {icon}";
|
||||
format-alt = "{time} {icon}";
|
||||
|
||||
interval = 1;
|
||||
format-full = "";
|
||||
format-icons = [
|
||||
""
|
||||
""
|
||||
""
|
||||
""
|
||||
""
|
||||
];
|
||||
};
|
||||
style = ''
|
||||
#battery {
|
||||
color: #${config.colorScheme.palette.taskbarText};
|
||||
margin: 5px 2px;
|
||||
padding: 0 12px;
|
||||
border-radius: 999px;
|
||||
min-width: 40px;
|
||||
transition: all 0.3s;
|
||||
background-color: #${config.colorScheme.palette.taskbarBackground};
|
||||
}
|
||||
|
||||
#battery.charging,
|
||||
#battery.plugged,
|
||||
#battery.full {
|
||||
color: #${config.colorScheme.palette.taskbarText};
|
||||
background-color: #${config.colorScheme.palette.taskbarBackground};
|
||||
box-shadow: none;
|
||||
}
|
||||
|
||||
#battery.critical:not(.charging) {
|
||||
background-color: transparent;
|
||||
animation: batteryCritical 1.2s linear 0s infinite normal forwards;
|
||||
}
|
||||
|
||||
@keyframes batteryCritical {
|
||||
0% {
|
||||
background-color: #${config.colorScheme.palette.base08};
|
||||
color: #${config.colorScheme.palette.base06};
|
||||
}
|
||||
50% {
|
||||
background-color: #${config.colorScheme.palette.base02};
|
||||
color: #${config.colorScheme.palette.base08};
|
||||
}
|
||||
100% {
|
||||
background-color: #${config.colorScheme.palette.base08};
|
||||
color: #${config.colorScheme.palette.base06};
|
||||
}
|
||||
}
|
||||
'';
|
||||
};
|
||||
};
|
||||
}
|
||||
34
modules/waybar/bluetooth.nix
Normal file
34
modules/waybar/bluetooth.nix
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
{
|
||||
lib,
|
||||
config,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
let
|
||||
name = "custom/bluetooth";
|
||||
in
|
||||
{
|
||||
options.modules.waybar = {
|
||||
modules = import ./addname.nix lib name;
|
||||
enabled.${name} = {
|
||||
enable = lib.mkEnableOption "enable ${name} waybar module";
|
||||
};
|
||||
};
|
||||
config = lib.mkIf config.modules.waybar.enabled.${name}.enable {
|
||||
programs.waybar = {
|
||||
settings.mainBar."${name}" = {
|
||||
format = "";
|
||||
on-click = lib.meta.getExe' pkgs.blueberry "blueberry";
|
||||
};
|
||||
style = ''
|
||||
#custom-bluetooth {
|
||||
color: #${config.colorScheme.palette.taskbarText};
|
||||
margin: 5px 0px;
|
||||
padding: 0 8px;
|
||||
background-color: #${config.colorScheme.palette.taskbarBackground};
|
||||
border-radius: 999px 0 0 999px;
|
||||
}
|
||||
'';
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
@ -19,25 +19,23 @@ in
|
|||
interval = 1;
|
||||
format = "{:%H:%M:%S}";
|
||||
format-alt = "{:%Y-%m-%d %H:%M:%S}";
|
||||
on-click-middle = "gnome-clocks";
|
||||
on-click-middle = lib.meta.getExe' pkgs.gnome-clocks "gnome-clocks";
|
||||
calendar = {
|
||||
weeks-pos = "left";
|
||||
format = {
|
||||
today = "<span color='#FF6666'><u>{}</u></span>"; # TODO: use nix-colors
|
||||
weeks = "<span color='#707A8C'>{}</span>"; # TODO: use nix-colors
|
||||
today = "<span color='#${config.colorScheme.palette.base17}'><u>{}</u></span>"; # TODO: use nix-colors
|
||||
weeks = "<span color='#${config.colorScheme.palette.base17}'>{}</span>"; # TODO: use nix-colors
|
||||
};
|
||||
};
|
||||
home.packages = [
|
||||
pkgs.gnome-clocks
|
||||
];
|
||||
};
|
||||
style = ''
|
||||
#clock {
|
||||
color: #${config.colorScheme.palette.taskbarText};
|
||||
margin: 0px 2px;
|
||||
padding: 0 15px;
|
||||
|
||||
border-radius: 999px;
|
||||
background-color: #${config.colorScheme.palette.taskbarBackground};
|
||||
margin: 5px 0px;
|
||||
margin-right: 2px;
|
||||
padding: 0 12px;
|
||||
border-radius: 999px 0 0 999px;
|
||||
box-shadow: none;
|
||||
}
|
||||
'';
|
||||
|
|
|
|||
|
|
@ -12,17 +12,15 @@ in
|
|||
config = lib.mkIf config.modules.waybar.enabled.${name}.enable {
|
||||
programs.waybar = {
|
||||
settings.mainBar."${name}" = {
|
||||
format = "cpu: {usage}%";
|
||||
format = " {usage}%";
|
||||
tooltip = false;
|
||||
};
|
||||
style = ''
|
||||
#cpu {
|
||||
color: #${config.colorScheme.palette.taskbarText};
|
||||
margin: 0px 0px;
|
||||
padding: 0 15px;
|
||||
|
||||
border-radius: 999px 0px 0px 999px;
|
||||
box-shadow: inset 0 0 0 1px #${config.colorScheme.palette.base01};
|
||||
margin: 5px 0px;
|
||||
padding: 0 8px;
|
||||
background-color: #${config.colorScheme.palette.taskbarBackground};
|
||||
}
|
||||
'';
|
||||
};
|
||||
|
|
|
|||
|
|
@ -48,6 +48,8 @@ in
|
|||
./temperature.nix
|
||||
./wireplumber.nix
|
||||
./spotify.nix
|
||||
./battery.nix
|
||||
./bluetooth.nix
|
||||
../../common/colors.nix
|
||||
];
|
||||
|
||||
|
|
@ -94,7 +96,25 @@ in
|
|||
style = ''
|
||||
* {
|
||||
font-family: "Maple Mono NF";
|
||||
font-size: 14px;
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
window#waybar {
|
||||
background-color: transparent;
|
||||
color: #${config.colorScheme.palette.taskbarText};
|
||||
transition-property: background-color;
|
||||
transition-duration: 0.5s;
|
||||
}
|
||||
window#waybar.hidden {
|
||||
opacity: 0.2;
|
||||
}
|
||||
|
||||
window#waybar.termite {
|
||||
background-color: transparent;
|
||||
}
|
||||
|
||||
window#waybar.chromium {
|
||||
background-color: transparent;
|
||||
}
|
||||
|
||||
button {
|
||||
|
|
|
|||
|
|
@ -12,17 +12,15 @@ in
|
|||
config = lib.mkIf config.modules.waybar.enabled.${name}.enable {
|
||||
programs.waybar = {
|
||||
settings.mainBar."${name}" = {
|
||||
format = "mem: {}%";
|
||||
format = " {}%";
|
||||
tooltip = false;
|
||||
};
|
||||
style = ''
|
||||
#memory {
|
||||
border-radius: 0px 999px 999px 0px;
|
||||
padding: 0 10px;
|
||||
color: #${config.colorScheme.palette.taskbarText};
|
||||
margin: 0px;
|
||||
box-shadow: inset 0px 2px 0 -1px #${config.colorScheme.palette.base01},
|
||||
inset 0px -2px 0 -1px #${config.colorScheme.palette.base01};
|
||||
margin: 5px 0px;
|
||||
padding: 0 8px;
|
||||
background-color: #${config.colorScheme.palette.taskbarBackground};
|
||||
}
|
||||
'';
|
||||
};
|
||||
|
|
|
|||
|
|
@ -12,23 +12,25 @@ in
|
|||
config = lib.mkIf config.modules.waybar.enabled.${name}.enable {
|
||||
programs.waybar = {
|
||||
settings.mainBar."${name}" = {
|
||||
format-wifi = "{essid} ({signalStrength}%) ";
|
||||
format-ethernet = "{ipaddr}/{cidr} ";
|
||||
tooltip-format = "{ifname} via {gwaddr} ";
|
||||
format-linked = "{ifname} (No IP) ";
|
||||
format-disconnected = "Disconnected ";
|
||||
format-alt = "{ifname}: {ipaddr}/{cidr}";
|
||||
format-wifi = "";
|
||||
format-ethernet = "";
|
||||
tooltip-format = "ssid : {essid}\naddr : {ipaddr}/{cidr}\ngate : {gwaddr}\ndev : {ifname}";
|
||||
format-linked = "";
|
||||
format-disconnected = "";
|
||||
format-alt = "{ipaddr}/{cidr}";
|
||||
};
|
||||
style = ''
|
||||
#network {
|
||||
color: #${config.colorScheme.palette.taskbarText};
|
||||
margin: 0px 2px;
|
||||
padding: 0 15px;
|
||||
border-radius: 999px;
|
||||
box-shadow: inset 0 0 0 1px #${config.colorScheme.palette.base01};
|
||||
margin: 5px 0px;
|
||||
padding: 0 8px;
|
||||
background-color: #${config.colorScheme.palette.taskbarBackground};
|
||||
}
|
||||
|
||||
#network.disconnected,
|
||||
#network.disconnected {
|
||||
transition: all 0.2s;
|
||||
color: #${config.colorScheme.palette.base02};
|
||||
}
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
|
|
|||
|
|
@ -17,16 +17,20 @@ in
|
|||
config = lib.mkIf config.modules.waybar.enabled.${name}.enable {
|
||||
programs.waybar = {
|
||||
settings.mainBar.${name} = {
|
||||
exec = ''${pkgs.playerctl}/bin/playerctl metadata --player=spotify -F -f "{{ status }}: {{ artist }} - {{ title }}"'';
|
||||
exec = ''${lib.meta.getExe pkgs.playerctl} metadata --player=spotify -F -f "{{ status }}: {{ artist }} - {{ title }}"'';
|
||||
format = "{}";
|
||||
on-click = "${pkgs.playerctl}/bin/playerctl --player=spotify play-pause";
|
||||
on-scroll-up = "${pkgs.playerctl}/bin/playerctl --player=spotify volume 0.01+";
|
||||
on-scroll-down = "${pkgs.playerctl}/bin/playerctl --player=spotify volume 0.01-";
|
||||
on-click = "${lib.meta.getExe pkgs.playerctl} --player=spotify play-pause";
|
||||
on-click-middle = lib.meta.getExe' pkgs.spotify "spotify";
|
||||
on-scroll-up = "${lib.meta.getExe pkgs.playerctl} --player=spotify volume 0.01+";
|
||||
on-scroll-down = "${lib.meta.getExe pkgs.playerctl} --player=spotify volume 0.01-";
|
||||
};
|
||||
style = ''
|
||||
#custom-spotify {
|
||||
color: #${config.colorScheme.palette.base14};
|
||||
margin-right: 10px;
|
||||
margin: 5px 0px;
|
||||
padding: 0 8px;
|
||||
background-color: #${config.colorScheme.palette.taskbarBackground};
|
||||
border-radius: 0 999px 999px 0;
|
||||
}
|
||||
'';
|
||||
};
|
||||
|
|
|
|||
|
|
@ -10,16 +10,31 @@ in
|
|||
};
|
||||
};
|
||||
config = lib.mkIf config.modules.waybar.enabled.${name}.enable {
|
||||
programs.waybar.settings.mainBar."${name}" = {
|
||||
thermal-zone = 2;
|
||||
hwmon-path = "/sys/class/hwmon/hwmon3/temp1_input";
|
||||
critical-threshold = 80;
|
||||
format = "{temperatureC}°C {icon}";
|
||||
format-icons = [
|
||||
""
|
||||
""
|
||||
""
|
||||
];
|
||||
programs.waybar = {
|
||||
settings.mainBar."${name}" = {
|
||||
thermal-zone = 2;
|
||||
hwmon-path = "/sys/class/hwmon/hwmon3/temp1_input";
|
||||
critical-threshold = 80;
|
||||
format = "{icon} {temperatureC}°C";
|
||||
format-icons = [
|
||||
""
|
||||
""
|
||||
""
|
||||
];
|
||||
};
|
||||
style = ''
|
||||
#temperature {
|
||||
color: #${config.colorScheme.palette.taskbarText};
|
||||
margin: 5px 0px;
|
||||
padding: 0 8px;
|
||||
background-color: #${config.colorScheme.palette.taskbarBackground};
|
||||
border-radius: 0 999px 999px 0;
|
||||
}
|
||||
|
||||
#temperature.critcal {
|
||||
color: #${config.colorScheme.palette.base08};
|
||||
}
|
||||
'';
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -17,17 +17,16 @@ in
|
|||
style = ''
|
||||
#tray {
|
||||
color: #${config.colorScheme.palette.taskbarText};
|
||||
margin: 0px 2px;
|
||||
margin: 5px 0px;
|
||||
padding: 4px 10px;
|
||||
border-radius: 999px 999px 999px 999px;
|
||||
box-shadow: inset 0px 0px 0 1px #${config.colorScheme.palette.base01};
|
||||
border-radius: 999px;
|
||||
background-color: #${config.colorScheme.palette.taskbarBackground};
|
||||
}
|
||||
|
||||
#tray {
|
||||
background-color: transparent;
|
||||
#tray > * {
|
||||
padding: 0 20px;
|
||||
}
|
||||
|
||||
|
||||
#tray > .passive {
|
||||
-gtk-icon-effect: dim;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,9 @@
|
|||
{ lib, config, ... }:
|
||||
{
|
||||
lib,
|
||||
config,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
let
|
||||
name = "wireplumber";
|
||||
in
|
||||
|
|
@ -12,22 +17,21 @@ in
|
|||
config = lib.mkIf config.modules.waybar.enabled.${name}.enable {
|
||||
programs.waybar = {
|
||||
settings.mainBar."${name}" = {
|
||||
format = "{volume}% {icon}";
|
||||
format-muted = "";
|
||||
on-click = "helvum";
|
||||
format = "{icon} {volume}%";
|
||||
format-muted = "";
|
||||
format-icons = [
|
||||
""
|
||||
""
|
||||
""
|
||||
];
|
||||
on-click = lib.meta.getExe' pkgs.helvum "helvum";
|
||||
};
|
||||
style = ''
|
||||
#wireplumber {
|
||||
color: #${config.colorScheme.palette.taskbarText};
|
||||
margin: 0px 2px;
|
||||
padding: 0 15px;
|
||||
border-radius: 999px;
|
||||
box-shadow: inset 0 0 0 1px #${config.colorScheme.palette.base01};
|
||||
margin: 5px 0px;
|
||||
padding: 0 8px;
|
||||
background-color: #${config.colorScheme.palette.taskbarBackground};
|
||||
}
|
||||
'';
|
||||
};
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ in
|
|||
style = ''
|
||||
#workspaces button {
|
||||
transition: all 0.2s;
|
||||
padding: 3px 3px 3px 5px;
|
||||
padding: 4px 4px 4px 5px;
|
||||
margin: 3px;
|
||||
min-width: 15px;
|
||||
min-height: 15px;
|
||||
|
|
@ -42,10 +42,8 @@ in
|
|||
}
|
||||
|
||||
#workspaces {
|
||||
margin: 0 4px;
|
||||
padding: 4px 4px;
|
||||
border-radius: 999px;
|
||||
box-shadow: inset 0px 0px 0 1px #${config.colorScheme.palette.base01};
|
||||
}
|
||||
'';
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue