change waybar config

This commit is contained in:
Frost-Phoenix 2023-11-12 18:17:37 +01:00
parent 902f5c8b7c
commit 470d1bbd54
4 changed files with 619 additions and 189 deletions

View file

@ -1,131 +1,177 @@
{ ... }: { ... }:
{ {
programs.waybar.settings = [ programs.waybar.settings.mainBar = {
{ position= "top";
"layer" = "top"; layer= "top";
"position" = "top"; height= 35;
modules-left = [ margin-top= 0;
"custom/launcher" margin-bottom= 0;
"wlr/workspaces" margin-left= 0;
"temperature" margin-right= 0;
"idle_inhibitor" modules-left= [
]; "custom/launcher"
modules-center = [ "custom/playerctl#backward"
"clock" "custom/playerctl#play"
]; "custom/playerctl#foward"
modules-right = [ "custom/playerlabel"
"pulseaudio" ];
"pulseaudio#microphone" modules-center= [
"memory" "cava#left"
"cpu" "hyprland/workspaces"
"disk" "cava#right"
# "keyboard-state" ];
modules-right= [
"tray"
"pulseaudio"
"network" "network"
"cava" "clock"
"tray" ];
]; clock= {
"custom/launcher" = { format = " {:%a, %d %b, %I:%M %p}";
"format" = " "; tooltip= "true";
"on-click" = "pkill wofi || wofi"; tooltip-format= "<big>{:%Y %B}</big>\n<tt><small>{calendar}</small></tt>";
"tooltip" = false; format-alt= " {:%d/%m}";
}; };
"idle_inhibitor" = { "wlr/workspaces"= {
"format" = "{icon}"; active-only= false;
"format-icons" = { all-outputs= false;
"activated" = ""; disable-scroll= false;
"deactivated" = ""; on-scroll-up= "hyprctl dispatch workspace e-1";
on-scroll-down= "hyprctl dispatch workspace e+1";
format = "{name}";
on-click= "activate";
format-icons= {
urgent= "";
active= "";
default = "";
sort-by-number= true;
}; };
}; };
"disk" = { "cava#left" = {
"path" = "/home"; framerate = 60;
"format" = "󰋊 {percentage_used}%"; autosens = 1;
}; bars = 18;
"custom/wall" = { lower_cutoff_freq = 50;
"on-click" = "wallpaper_random"; higher_cutoff_freq = 10000;
"on-click-middle" = "default_wall"; method = "pipewire";
"on-click-right" = "killall dynamic_wallpaper || dynamic_wallpaper &"; source = "auto";
"format" = " "; stereo = true;
"tooltip" = false; reverse = false;
}; bar_delimiter = 0;
"wlr/workspaces" = { monstercat = false;
"format" = "{icon}"; waves = false;
"on-click" = "activate"; input_delay = 2;
}; format-icons = [
"pulseaudio" = { "<span foreground='#${custom.primary_accent}'></span>"
"scroll-step" = 5; "<span foreground='#${custom.primary_accent}'></span>"
"format" = "{icon} {volume}%"; "<span foreground='#${custom.primary_accent}'></span>"
"format-muted" = "󰸈 Muted"; "<span foreground='#${custom.primary_accent}'></span>"
"format-icons" = { "<span foreground='#${custom.secondary_accent}'></span>"
"default" = [ "" "" "󱄠" ]; "<span foreground='#${custom.secondary_accent}'></span>"
"<span foreground='#${custom.secondary_accent}'></span>"
"<span foreground='#${custom.secondary_accent}'></span>"
];
};
"cava#right" = {
framerate = 60;
autosens = 1;
bars = 18;
lower_cutoff_freq = 50;
higher_cutoff_freq = 10000;
method = "pipewire";
source = "auto";
stereo = true;
reverse = false;
bar_delimiter = 0;
monstercat = false;
waves = false;
input_delay = 2;
format-icons = [
"<span foreground='#${custom.primary_accent}'></span>"
"<span foreground='#${custom.primary_accent}'></span>"
"<span foreground='#${custom.primary_accent}'></span>"
"<span foreground='#${custom.primary_accent}'></span>"
"<span foreground='#${custom.secondary_accent}'></span>"
"<span foreground='#${custom.secondary_accent}'></span>"
"<span foreground='#${custom.secondary_accent}'></span>"
"<span foreground='#${custom.secondary_accent}'></span>"
];
};
"custom/playerctl#backward"= {
format= "󰙣 ";
on-click= "playerctl previous";
on-scroll-up = "playerctl volume .05+";
on-scroll-down = "playerctl volume .05-";
};
"custom/playerctl#play"= {
format= "{icon}";
return-type= "json";
exec= "playerctl -a metadata --format '{\"text\": \"{{artist}} - {{markup_escape(title)}}\", \"tooltip\": \"{{playerName}} : {{markup_escape(title)}}\", \"alt\": \"{{status}}\", \"class\": \"{{status}}\"}' -F";
on-click= "playerctl play-pause";
on-scroll-up = "playerctl volume .05+";
on-scroll-down = "playerctl volume .05-";
format-icons= {
Playing = "<span>󰏥 </span>";
Paused = "<span> </span>";
Stopped = "<span> </span>";
}; };
"on-click" = "pamixer -t"; };
"on-click-right" = "pavucontrol"; "custom/playerctl#foward"= {
"on-click-middle" = "$HOME/.local/bin/toggle_sound_output"; format= "󰙡 ";
"tooltip" = false; on-click= "playerctl next";
}; on-scroll-up = "playerctl volume .05+";
"pulseaudio#microphone" = { on-scroll-down = "playerctl volume .05-";
"format" = "{format_source}"; };
"format-source" = "󰍬 {volume}%"; "custom/playerlabel"= {
"format-source-muted" = "󰍭 Muted"; format= "<span>󰎈 {} 󰎈</span>";
"on-click" = "pamixer --default-source -t"; return-type= "json";
"on-scroll-up" = "pamixer --default-source -i 5"; max-length= 40;
"on-scroll-down" = "pamixer --default-source -d 5"; exec = "playerctl -a metadata --format '{\"text\": \"{{artist}} - {{markup_escape(title)}}\", \"tooltip\": \"{{playerName}} : {{markup_escape(title)}}\", \"alt\": \"{{status}}\", \"class\": \"{{status}}\"}' -F";
"scroll-step" = 5; on-click= "";
"on-click-right" = "pavucontrol"; };
};
"clock" = { memory= {
"interval" = 1; format= "󰍛 {}%";
"format" = "{:%I:%M %p %A %b %d}"; format-alt= "󰍛 {used}/{total} GiB";
"tooltip" = true; interval= 5;
"tooltip-format" = "<tt>{calendar}</tt>"; };
}; cpu= {
"memory" = { format= "󰻠 {usage}%";
"interval" = 1; format-alt= "󰻠 {avg_frequency} GHz";
"format" = "󰟜 {percentage}%"; interval= 5;
"states" = { };
"warning" = 85; network = {
format-wifi = " {signalStrength}%";
format-ethernet = "󰈀 100% ";
tooltip-format = "Connected to {essid} {ifname} via {gwaddr}";
format-linked = "{ifname} (No IP)";
format-disconnected = "󰖪 0% ";
};
tray= {
icon-size= 20;
spacing= 8;
};
pulseaudio= {
format= "{icon} {volume}%";
format-muted= "󰝟";
format-icons= {
default= ["󰕿" "󰖀" "󰕾"];
}; };
}; # on-scroll-up= "bash ~/.scripts/volume up";
"cpu" = { # on-scroll-down= "bash ~/.scripts/volume down";
"interval" = 1; scroll-step= 5;
"format" = "󰇖 {usage}%"; on-click= "pavucontrol";
}; };
"network" = { "custom/randwall"= {
"interval" = 1; format= "󰏘";
"format" = "󰣺 Connected"; # on-click= "bash $HOME/.config/hypr/randwall.sh";
"format-alt" = " {bandwidthUpBytes} {bandwidthDownBytes}"; # on-click-right= "bash $HOME/.config/hypr/wall.sh";
"format-disconnected" = "󰣼 Disconnected"; };
"tooltip" = false; "custom/launcher"= {
}; format= "";
"temperature" = { # on-click= "bash $HOME/.config/rofi/launcher.sh";
"tooltip" = false; # on-click-right= "bash $HOME/.config/rofi/run.sh";
"thermal-zone" = 2; tooltip= "false";
"hwmon-path" = "/sys/class/hwmon/hwmon2/temp1_input"; };
"format" = " {temperatureC}°C"; };
};
"cava" = {
"framerate" = 60;
"autosens" = 1;
"sensitivity" = 10;
"bars" = 6;
"lower_cutoff_freq" = 50;
"higher_cutoff_freq" = 10000;
"method" = "pulse";
"source" = "auto";
"stereo" = true;
"reverse" = false;
"bar_delimiter" = 0;
"monstercat" = false;
"waves" = false;
"noise_reduction" = 0.77;
"input_delay" = 2;
"format-icons" = [ "" "" "" "" "" "" "" "" ];
"on-click-right" = "playerctl play-pause";
};
"tray" = {
"icon-size" = 12;
"spacing" = 5;
};
}
];
} }

View file

@ -1,92 +1,143 @@
{ ... }: {
custom ? {
font = "JetBrainsMono Nerd Font";
fontsize = "12";
primary_accent = "cba6f7";
secondary_accent = "89b4fa";
tertiary_accent = "f5f5f5";
background = "11111B";
},
...
}:
{ {
programs.waybar.style = '' programs.waybar.style = ''
* { * {
font-family: JetBrainsMono Nerd Font; border: none;
font-weight: normal; border-radius: 0px;
font-family: ${custom.font};
font-size: 14px; font-size: 14px;
min-height: 0; min-height: 0;
transition-property: background-color;
transition-duration: 0.5s;
} }
window#waybar { window#waybar {
background-color: transparent; background: ${custom.palette.primary_background_rgba};
} }
window>box { #cava.left, #cava.right {
margin-left: 10px; background: #${custom.palette.tertiary_background_hex};
margin-right: 10px; margin: 5px;
margin-top: 8px; padding: 8px 16px;
border: 2px solid #595959; color: #${custom.primary_accent};
border-radius: 0px; }
background-color: rgba(31, 31, 31, 1); #cava.left {
border-radius: 24px 10px 24px 10px;
}
#cava.right {
border-radius: 10px 24px 10px 24px;
} }
#workspaces { #workspaces {
padding-left: 0px; background: #${custom.palette.tertiary_background_hex};
padding-right: 4px; margin: 5px 5px;
border-radius: 0px; padding: 8px 5px;
border-radius: 16px;
color: #${custom.primary_accent}
} }
#workspaces button { #workspaces button {
padding-top: 5px; padding: 0px 5px;
border-radius: 0px; margin: 0px 3px;
padding-bottom: 5px; border-radius: 16px;
padding-left: 8px; color: transparent;
padding-right: 8px; background: ${custom.palette.primary_background_rgba};
transition: all 0.3s ease-in-out;
} }
#workspaces button.active { #workspaces button.active {
background-color: #595959; background-color: #${custom.secondary_accent};
color: rgb(23, 23, 23); color: #${custom.background};
border-radius: 16px;
min-width: 50px;
background-size: 400% 400%;
transition: all 0.3s ease-in-out;
} }
#workspaces button.urgent { #workspaces button:hover {
color: #fff000; background-color: #${custom.tertiary_accent};
color: #${custom.background};
border-radius: 16px;
min-width: 50px;
background-size: 400% 400%;
} }
tooltip { #tray, #pulseaudio, #network,
background: rgb(48, 45, 65); #custom-playerctl.backward, #custom-playerctl.play, #custom-playerctl.foward{
background: #${custom.palette.tertiary_background_hex};
font-weight: bold;
margin: 5px 0px;
} }
#tray, #pulseaudio, #network {
tooltip label { color: #${custom.tertiary_accent};
color: rgb(217, 224, 238); border-radius: 10px 24px 10px 24px;
padding: 0 20px;
margin-left: 7px;
} }
#clock {
#custom-launcher { color: #${custom.tertiary_accent};
background: #${custom.palette.tertiary_background_hex};
border-radius: 0px 0px 0px 40px;
padding: 10px 10px 15px 25px;
margin-left: 7px;
font-weight: bold;
font-size: 16px; font-size: 16px;
padding-left: 10px; }
padding-right: 6px; #custom-launcher {
color: #6896BA; color: #${custom.secondary_accent};
background: #${custom.palette.tertiary_background_hex};
border-radius: 0px 0px 40px 0px;
margin: 0px;
padding: 0px 35px 0px 15px;
font-size: 28px;
} }
#clock, #custom-playerctl.backward, #custom-playerctl.play, #custom-playerctl.foward {
#memory, background: #${custom.palette.tertiary_background_hex};
#temperature, font-size: 22px;
#cpu,
#mpd,
#custom-wall,
#temperature,
#backlight,
#pulseaudio,
#network,
#battery,
#disk,
#idle_inhibitor {
padding-left: 10px;
padding-right: 10px;
padding-top: 0px;
padding-bottom: 0px;
color: #B9B9B9;
} }
#cava { #custom-playerctl.backward:hover, #custom-playerctl.play:hover, #custom-playerctl.foward:hover{
padding-left: 10px; color: #${custom.tertiary_accent};
padding-right: 10px;
} }
#tray { #custom-playerctl.backward {
padding-right: 8px; color: #${custom.primary_accent};
padding-left: 10px; border-radius: 24px 0px 0px 10px;
padding-left: 16px;
margin-left: 7px;
}
#custom-playerctl.play {
color: #${custom.secondary_accent};
padding: 0 5px;
}
#custom-playerctl.foward {
color: #${custom.primary_accent};
border-radius: 0px 10px 24px 0px;
padding-right: 12px;
margin-right: 7px
}
#custom-playerlabel {
background: #${custom.palette.tertiary_background_hex};
color: #${custom.tertiary_accent};
padding: 0 20px;
border-radius: 24px 10px 24px 10px;
margin: 5px 0;
font-weight: bold;
}
#window{
background: #${custom.palette.tertiary_background_hex};
padding-left: 15px;
padding-right: 15px;
border-radius: 16px;
margin-top: 5px;
margin-bottom: 5px;
font-weight: normal;
font-style: normal;
} }
''; '';
} }

333
modules/home/waybar/tmp.nix Normal file
View file

@ -0,0 +1,333 @@
{
custom ? {
font = "JetBrainsMono Nerd Font";
fontsize = "12";
primary_accent = "cba6f7";
secondary_accent = "89b4fa";
tertiary_accent = "f5f5f5";
background = "11111B";
},
...
}:
{
programs.waybar = {
enable = true;
settings.mainBar = {
position= "top";
layer= "top";
height= 35;
margin-top= 0;
margin-bottom= 0;
margin-left= 0;
margin-right= 0;
modules-left= [
"custom/launcher"
"custom/playerctl#backward"
"custom/playerctl#play"
"custom/playerctl#foward"
"custom/playerlabel"
];
modules-center= [
"cava#left"
"hyprland/workspaces"
"cava#right"
];
modules-right= [
"tray"
"battery"
"pulseaudio"
"network"
"clock"
];
clock= {
format = " {:%a, %d %b, %I:%M %p}";
tooltip= "true";
tooltip-format= "<big>{:%Y %B}</big>\n<tt><small>{calendar}</small></tt>";
format-alt= " {:%d/%m}";
};
"wlr/workspaces"= {
active-only= false;
all-outputs= false;
disable-scroll= false;
on-scroll-up= "hyprctl dispatch workspace e-1";
on-scroll-down= "hyprctl dispatch workspace e+1";
format = "{name}";
on-click= "activate";
format-icons= {
urgent= "";
active= "";
default = "";
sort-by-number= true;
};
};
"cava#left" = {
framerate = 60;
autosens = 1;
bars = 18;
lower_cutoff_freq = 50;
higher_cutoff_freq = 10000;
method = "pipewire";
source = "auto";
stereo = true;
reverse = false;
bar_delimiter = 0;
monstercat = false;
waves = false;
input_delay = 2;
format-icons = [
"<span foreground='#${custom.primary_accent}'></span>"
"<span foreground='#${custom.primary_accent}'></span>"
"<span foreground='#${custom.primary_accent}'></span>"
"<span foreground='#${custom.primary_accent}'></span>"
"<span foreground='#${custom.secondary_accent}'></span>"
"<span foreground='#${custom.secondary_accent}'></span>"
"<span foreground='#${custom.secondary_accent}'></span>"
"<span foreground='#${custom.secondary_accent}'></span>"
];
};
"cava#right" = {
framerate = 60;
autosens = 1;
bars = 18;
lower_cutoff_freq = 50;
higher_cutoff_freq = 10000;
method = "pipewire";
source = "auto";
stereo = true;
reverse = false;
bar_delimiter = 0;
monstercat = false;
waves = false;
input_delay = 2;
format-icons = [
"<span foreground='#${custom.primary_accent}'></span>"
"<span foreground='#${custom.primary_accent}'></span>"
"<span foreground='#${custom.primary_accent}'></span>"
"<span foreground='#${custom.primary_accent}'></span>"
"<span foreground='#${custom.secondary_accent}'></span>"
"<span foreground='#${custom.secondary_accent}'></span>"
"<span foreground='#${custom.secondary_accent}'></span>"
"<span foreground='#${custom.secondary_accent}'></span>"
];
};
"custom/playerctl#backward"= {
format= "󰙣 ";
on-click= "playerctl previous";
on-scroll-up = "playerctl volume .05+";
on-scroll-down = "playerctl volume .05-";
};
"custom/playerctl#play"= {
format= "{icon}";
return-type= "json";
exec= "playerctl -a metadata --format '{\"text\": \"{{artist}} - {{markup_escape(title)}}\", \"tooltip\": \"{{playerName}} : {{markup_escape(title)}}\", \"alt\": \"{{status}}\", \"class\": \"{{status}}\"}' -F";
on-click= "playerctl play-pause";
on-scroll-up = "playerctl volume .05+";
on-scroll-down = "playerctl volume .05-";
format-icons= {
Playing = "<span>󰏥 </span>";
Paused = "<span> </span>";
Stopped = "<span> </span>";
};
};
"custom/playerctl#foward"= {
format= "󰙡 ";
on-click= "playerctl next";
on-scroll-up = "playerctl volume .05+";
on-scroll-down = "playerctl volume .05-";
};
"custom/playerlabel"= {
format= "<span>󰎈 {} 󰎈</span>";
return-type= "json";
max-length= 40;
exec = "playerctl -a metadata --format '{\"text\": \"{{artist}} - {{markup_escape(title)}}\", \"tooltip\": \"{{playerName}} : {{markup_escape(title)}}\", \"alt\": \"{{status}}\", \"class\": \"{{status}}\"}' -F";
on-click= "";
};
battery= {
states= {
good= 95;
warning= 30;
critical= 15;
};
format="{icon} {capacity}%";
format-charging= " {capacity}%";
format-plugged= " {capacity}% ";
format-alt= "{icon} {time}";
format-icons= ["" "" "" "" ""];
};
memory= {
format= "󰍛 {}%";
format-alt= "󰍛 {used}/{total} GiB";
interval= 5;
};
cpu= {
format= "󰻠 {usage}%";
format-alt= "󰻠 {avg_frequency} GHz";
interval= 5;
};
network = {
format-wifi = " {signalStrength}%";
format-ethernet = "󰈀 100% ";
tooltip-format = "Connected to {essid} {ifname} via {gwaddr}";
format-linked = "{ifname} (No IP)";
format-disconnected = "󰖪 0% ";
};
tray= {
icon-size= 20;
spacing= 8;
};
pulseaudio= {
format= "{icon} {volume}%";
format-muted= "󰝟";
format-icons= {
default= ["󰕿" "󰖀" "󰕾"];
};
# on-scroll-up= "bash ~/.scripts/volume up";
# on-scroll-down= "bash ~/.scripts/volume down";
scroll-step= 5;
on-click= "pavucontrol";
};
"custom/randwall"= {
format= "󰏘";
# on-click= "bash $HOME/.config/hypr/randwall.sh";
# on-click-right= "bash $HOME/.config/hypr/wall.sh";
};
"custom/launcher"= {
format= "";
# on-click= "bash $HOME/.config/rofi/launcher.sh";
# on-click-right= "bash $HOME/.config/rofi/run.sh";
tooltip= "false";
};
};
style = ''
* {
border: none;
border-radius: 0px;
font-family: ${custom.font};
font-size: 14px;
min-height: 0;
}
window#waybar {
background: ${custom.palette.primary_background_rgba};
}
#cava.left, #cava.right {
background: #${custom.palette.tertiary_background_hex};
margin: 5px;
padding: 8px 16px;
color: #${custom.primary_accent};
}
#cava.left {
border-radius: 24px 10px 24px 10px;
}
#cava.right {
border-radius: 10px 24px 10px 24px;
}
#workspaces {
background: #${custom.palette.tertiary_background_hex};
margin: 5px 5px;
padding: 8px 5px;
border-radius: 16px;
color: #${custom.primary_accent}
}
#workspaces button {
padding: 0px 5px;
margin: 0px 3px;
border-radius: 16px;
color: transparent;
background: ${custom.palette.primary_background_rgba};
transition: all 0.3s ease-in-out;
}
#workspaces button.active {
background-color: #${custom.secondary_accent};
color: #${custom.background};
border-radius: 16px;
min-width: 50px;
background-size: 400% 400%;
transition: all 0.3s ease-in-out;
}
#workspaces button:hover {
background-color: #${custom.tertiary_accent};
color: #${custom.background};
border-radius: 16px;
min-width: 50px;
background-size: 400% 400%;
}
#tray, #pulseaudio, #network, #battery,
#custom-playerctl.backward, #custom-playerctl.play, #custom-playerctl.foward{
background: #${custom.palette.tertiary_background_hex};
font-weight: bold;
margin: 5px 0px;
}
#tray, #pulseaudio, #network, #battery{
color: #${custom.tertiary_accent};
border-radius: 10px 24px 10px 24px;
padding: 0 20px;
margin-left: 7px;
}
#clock {
color: #${custom.tertiary_accent};
background: #${custom.palette.tertiary_background_hex};
border-radius: 0px 0px 0px 40px;
padding: 10px 10px 15px 25px;
margin-left: 7px;
font-weight: bold;
font-size: 16px;
}
#custom-launcher {
color: #${custom.secondary_accent};
background: #${custom.palette.tertiary_background_hex};
border-radius: 0px 0px 40px 0px;
margin: 0px;
padding: 0px 35px 0px 15px;
font-size: 28px;
}
#custom-playerctl.backward, #custom-playerctl.play, #custom-playerctl.foward {
background: #${custom.palette.tertiary_background_hex};
font-size: 22px;
}
#custom-playerctl.backward:hover, #custom-playerctl.play:hover, #custom-playerctl.foward:hover{
color: #${custom.tertiary_accent};
}
#custom-playerctl.backward {
color: #${custom.primary_accent};
border-radius: 24px 0px 0px 10px;
padding-left: 16px;
margin-left: 7px;
}
#custom-playerctl.play {
color: #${custom.secondary_accent};
padding: 0 5px;
}
#custom-playerctl.foward {
color: #${custom.primary_accent};
border-radius: 0px 10px 24px 0px;
padding-right: 12px;
margin-right: 7px
}
#custom-playerlabel {
background: #${custom.palette.tertiary_background_hex};
color: #${custom.tertiary_accent};
padding: 0 20px;
border-radius: 24px 10px 24px 10px;
margin: 5px 0;
font-weight: bold;
}
#window{
background: #${custom.palette.tertiary_background_hex};
padding-left: 15px;
padding-right: 15px;
border-radius: 16px;
margin-top: 5px;
margin-bottom: 5px;
font-weight: normal;
font-style: normal;
}
'';
};
}

View file

@ -2,10 +2,10 @@
{ {
programs.waybar = { programs.waybar = {
enable = true; enable = true;
systemd = { # systemd = {
enable = false; # enable = false;
target = "graphical-session.target"; # target = "graphical-session.target";
}; # };
}; };
programs.waybar.package = pkgs.waybar.overrideAttrs (oa: { programs.waybar.package = pkgs.waybar.overrideAttrs (oa: {
mesonFlags = (oa.mesonFlags or [ ]) ++ [ "-Dexperimental=true" ]; mesonFlags = (oa.mesonFlags or [ ]) ++ [ "-Dexperimental=true" ];