mirror of
https://github.com/youwen5/nixos.git
synced 2024-11-24 17:53:51 -08:00
feat: add laptop config for waybar
This commit is contained in:
parent
3e5297d04a
commit
c30ab2e0f0
6 changed files with 194 additions and 2 deletions
|
@ -1,4 +1,4 @@
|
|||
{
|
||||
imports = [ ../theming ../home.nix ../programs ../hyprland/desktop ../waybar ];
|
||||
imports = [ ../theming ../home.nix ../programs ../hyprland/desktop ../waybar/desktop ];
|
||||
}
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
{
|
||||
imports = [ ../theming ../home.nix ../programs ../hyprland/laptop ../waybar ];
|
||||
imports = [ ../theming ../home.nix ../programs ../hyprland/laptop ../waybar/laptop ];
|
||||
}
|
||||
|
||||
|
|
91
users/youwen/linux/waybar/laptop/default.nix
Normal file
91
users/youwen/linux/waybar/laptop/default.nix
Normal file
|
@ -0,0 +1,91 @@
|
|||
{
|
||||
programs.waybar = {
|
||||
enable = true;
|
||||
settings = {
|
||||
mainBar = {
|
||||
layer = "top";
|
||||
position = "top";
|
||||
height = 24;
|
||||
width = 1000;
|
||||
reload-style-on-change = true;
|
||||
margin = "10px 0px 0px 0px";
|
||||
modules-left = [ "hyprland/window" "hyprland/workspaces" ];
|
||||
modules-right = [ "backlight" "group/adjustable" "custom/weather" ];
|
||||
modules-center = [ "network" "group/hardware" "clock" ];
|
||||
"hyprland/workspaces" = {
|
||||
active-only = false;
|
||||
all-outputs = false;
|
||||
format = "{icon}";
|
||||
persistent-workspaces = {
|
||||
eDP-1 = [ 1 ];
|
||||
DP-1 = [ 2 3 4 5 ];
|
||||
};
|
||||
};
|
||||
"group/hardware" = {
|
||||
orientation = "inherit";
|
||||
modules = [ "cpu" "memory" "battery" ];
|
||||
};
|
||||
"group/adjustable" = {
|
||||
orientation = "inherit";
|
||||
drawer = {
|
||||
transition-duration = 500;
|
||||
transition-left-to-right = true;
|
||||
};
|
||||
modules = [ "pulseaudio" "mpris" ];
|
||||
};
|
||||
"custom/weather" = {
|
||||
orientation = "horizontal";
|
||||
exec = ''curl wttr.in/?format="%l:%20%t"'';
|
||||
interval = 10;
|
||||
};
|
||||
cpu = {
|
||||
interval = 10;
|
||||
format = "{usage}% ";
|
||||
};
|
||||
memory = {
|
||||
interval = 10;
|
||||
format = "{percentage}% ";
|
||||
};
|
||||
# mpris = {
|
||||
# format-playing = " {title} ";
|
||||
# format-paused = " {title} ";
|
||||
# format-stopped = "Nothing Playing";
|
||||
# };
|
||||
tray = { spacing = 10; };
|
||||
clock = { format = "{:%a %b %d, %I:%M %p} "; };
|
||||
backlight = {
|
||||
device = "intel_backlight";
|
||||
format = "{percent}% {icon}";
|
||||
format-icons = [ "" "" ];
|
||||
};
|
||||
battery = {
|
||||
states = {
|
||||
good = 95;
|
||||
warning = 20;
|
||||
critical = 10;
|
||||
};
|
||||
format = "{capacity}% {icon}";
|
||||
format-icons = [ "" "" "" "" "" ];
|
||||
};
|
||||
"hyprland/window" = { format = "{class}"; };
|
||||
network = {
|
||||
format-wifi = "{essid} ";
|
||||
format-linked = "{ifname} (No IP) ";
|
||||
format-disconnected = "Disconnected ⚠";
|
||||
format-alt = "{ifname}: {ipaddr}/{cidr}";
|
||||
};
|
||||
pulseaudio = {
|
||||
format = "{volume}% {icon} {format_source}";
|
||||
format-bluetooth = "{volume}% {icon} {format_source}";
|
||||
format-bluetooth-muted = " {icon} {format_source}";
|
||||
format-muted = " {format_source}";
|
||||
format-source = "{volume}% ";
|
||||
format-source-muted = "";
|
||||
format-icons = { default = [ "" "" "" ]; };
|
||||
};
|
||||
};
|
||||
};
|
||||
style = ./waybar.css;
|
||||
systemd.enable = true;
|
||||
};
|
||||
}
|
101
users/youwen/linux/waybar/laptop/waybar.css
Executable file
101
users/youwen/linux/waybar/laptop/waybar.css
Executable file
|
@ -0,0 +1,101 @@
|
|||
* {
|
||||
font-size: 10px;
|
||||
}
|
||||
|
||||
window#waybar {
|
||||
border-bottom: 0px solid #ffffff;
|
||||
background: transparent;
|
||||
transition-property: none;
|
||||
transition-duration: 0s;
|
||||
}
|
||||
|
||||
#workspaces {
|
||||
background: #24273a;
|
||||
padding: 0px 2px 0px 2px;
|
||||
margin: 0px 0px 0px 5px;
|
||||
border-radius: 5px;
|
||||
}
|
||||
|
||||
#workspaces {
|
||||
background: #24273a;
|
||||
padding: 0px 5px 0px 5px;
|
||||
margin: 0px 0px 0px 5px;
|
||||
border-radius: 5px;
|
||||
}
|
||||
|
||||
#workspaces button,
|
||||
#workspaces button:hover {
|
||||
padding: 0;
|
||||
background-color: #24273a;
|
||||
/* color: @color4; */
|
||||
}
|
||||
#workspaces button.active,
|
||||
#workspaces button:hover {
|
||||
/* color: @color8; */
|
||||
}
|
||||
|
||||
#clock,
|
||||
#pulseaudio,
|
||||
#network,
|
||||
#battery,
|
||||
#tray,
|
||||
#mpris,
|
||||
#cpu,
|
||||
#memory,
|
||||
#temperature,
|
||||
#custom-weather,
|
||||
#window,
|
||||
#backlight {
|
||||
background-color: #24273a;
|
||||
/* color: @color4; */
|
||||
opacity: 1;
|
||||
border-radius: 5px;
|
||||
padding: 1px 10px 1px 10px;
|
||||
margin: 0px 5px 0px 0px;
|
||||
}
|
||||
#backlight {
|
||||
margin-right: 0px;
|
||||
padding-right: 3px;
|
||||
border-top-right-radius: 0px;
|
||||
border-bottom-right-radius: 0px;
|
||||
}
|
||||
#mpris {
|
||||
padding-left: 0px;
|
||||
margin-left: 0px;
|
||||
margin-right: 5px;
|
||||
padding-right: 0px;
|
||||
}
|
||||
#pulseaudio {
|
||||
padding-left: 5px;
|
||||
padding-right: 5px;
|
||||
margin-left: 0px;
|
||||
margin-right: 5px;
|
||||
border-top-left-radius: 0px;
|
||||
border-bottom-left-radius: 0px;
|
||||
}
|
||||
#memory,
|
||||
#cpu {
|
||||
padding-right: 2px;
|
||||
/* border-top-right-radius: 0px; */
|
||||
/* border-bottom-right-radius: 0px; */
|
||||
/* border-right-width: 0px; */
|
||||
}
|
||||
#memory,
|
||||
#battery {
|
||||
margin-left: 0px;
|
||||
padding-left: 2px;
|
||||
border-top-left-radius: 0px;
|
||||
border-bottom-left-radius: 0px;
|
||||
border-left-width: 0px;
|
||||
}
|
||||
#battery {
|
||||
padding-right: 13px;
|
||||
}
|
||||
#custom-weather {
|
||||
margin-right: 0px;
|
||||
}
|
||||
|
||||
#window {
|
||||
margin-right: 0px;
|
||||
margin-left: 0px;
|
||||
}
|
Loading…
Reference in a new issue