Skip to content

Commit

Permalink
waybar: updates
Browse files Browse the repository at this point in the history
  • Loading branch information
mobsenpai committed Dec 28, 2024
1 parent dc686ae commit 9b78e88
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 29 deletions.
4 changes: 2 additions & 2 deletions modules/home-manager/desktop/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ in {
};

wallpaper = let
url = "https://i.imgur.com/YU169OL.png";
sha256 = "073rw08hvb3ls8x4j5zsm3bcq97fni3hyzbzrv4akah2sxzibqhr";
url = "https://i.imgur.com/WqurbRF.jpeg";
sha256 = "1xj630lxy5q789llbpfra7w95f14xz60cllf04c8inl19g3qd5dv";
ext = lib.last (lib.splitString "." url);
in {
default = mkOption {
Expand Down
71 changes: 44 additions & 27 deletions modules/home-manager/programs/waybar.nix
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,7 @@ in

settings = {
bar = let
formatIcon = bg: fg: icon: "<span line_height='1.1' background='${bg}' foreground='${fg}'> ${icon} </span>";
formatText = bg: fg: text: "<span line_height='1.1' background='${bg}' foreground='${fg}'> ${text} </span>";
formatIcon = bg: fg: icon: "<span line_height='1.2' background='${bg}' foreground='${fg}'> ${icon} </span>";
in {
exclusive = true;
fixed-center = true;
Expand All @@ -39,23 +38,23 @@ in
modules-right = ["custom/weather" "memory" "cpu" "clock" "group/systray" "custom/notification"];

battery = mkIf isLaptop {
format = "{icon}";
format = "<span line_height='1.2'> {icon} </span>";
format-icons = ["󰂎" "󰁺" "󰁻" "󰁼" "󰁽" "󰁾" "󰁿" "󰂀" "󰂁" "󰂂" "󰁹"];
tooltip-format = "{timeTo}, {capacity}%";
};

clock = {
format = formatIcon xcolors.blue1 xcolors.bg0 "" + formatText xcolors.blue0 xcolors.fg0 "{:%a %b %d - %I:%M %p}";
format-alt = formatIcon xcolors.blue1 xcolors.bg0 "" + formatText xcolors.blue0 xcolors.fg0 "{:%H:%M}";
format = formatIcon xcolors.blue1 xcolors.bg0 "" + " {:%a %b %d - %I:%M %p}";
format-alt = formatIcon xcolors.blue1 xcolors.bg0 "" + " {:%H:%M}";
tooltip-format = "<big>{:%Y %B}</big>\n<tt><small>{calendar}</small></tt>";
};

cpu = {
format = formatIcon xcolors.yellow1 xcolors.bg0 "" + formatText xcolors.bg1 xcolors.yellow0 "{usage}%";
format = formatIcon xcolors.yellow1 xcolors.bg0 "" + " {usage}%";
};

"custom/chevron" = {
format = "";
format = "<span line_height='1.2'>  </span>";
tooltip = false;
};

Expand All @@ -64,7 +63,7 @@ in
in {
exec = "${swaync} -swb";
return-type = "json";
format = "{icon}";
format = "<span line_height='1.2'> {icon} </span>";
format-icons = {
notification = "󱅫";
none = "󰂜";
Expand All @@ -85,7 +84,7 @@ in
playerctl = getExe pkgs.playerctl;
in {
exec = "${playerctl} -a metadata --format '{\"text\": \"{{markup_escape(title)}}\", \"tooltip\": \"{{playerName}} : {{markup_escape(title)}}\", \"alt\": \"{{status}}\", \"class\": \"{{status}}\"}' -F";
format = formatIcon xcolors.purple1 xcolors.bg0 "{icon}" + formatText xcolors.bg1 xcolors.purple0 "{}";
format = formatIcon xcolors.purple1 xcolors.bg0 "{icon}" + " {}";
format-icons = {
"Paused" = "";
"Playing" = "󰎈";
Expand All @@ -101,7 +100,7 @@ in
wttrbar = getExe pkgs.wttrbar;
in {
exec = "${wttrbar} --location Bihar --custom-indicator \"{temp_C} °C\"";
format = formatIcon xcolors.green1 xcolors.bg0 "" + formatText xcolors.bg1 xcolors.green0 "{}";
format = formatIcon xcolors.green1 xcolors.bg0 "" + " {}";
tooltip = true;
interval = 3600;
return-type = "json";
Expand Down Expand Up @@ -133,14 +132,14 @@ in
};

memory = {
format = formatIcon xcolors.aqua1 xcolors.bg0 "" + formatText xcolors.aqua0 xcolors.bg1 "{}%";
format = formatIcon xcolors.aqua1 xcolors.bg0 "" + " {}%";
};

network = let
connection-editor = getExe' pkgs.networkmanagerapplet "nm-connection-editor";
in {
format-wifi = "󰤨";
format-ethernet = "󰈀";
format-wifi = " 󰤨 ";
format-ethernet = " 󰈀 ";
format-disconnected = "";
tooltip-format-wifi = "WiFi: {essid} ({signalStrength}%)\n󰅃 {bandwidthUpBytes} 󰅀 {bandwidthDownBytes}";
tooltip-format-ethernet = "Ethernet: {ifname}\n󰅃 {bandwidthUpBytes} 󰅀 {bandwidthDownBytes}";
Expand All @@ -151,7 +150,7 @@ in
pulseaudio = let
pamixer = getExe pkgs.pamixer;
in {
format = "{icon}";
format = "<span line_height='1.2'> {icon} </span>";
format-bluetooth = "󰂯";
format-muted = "󰖁";
format-icons = {
Expand Down Expand Up @@ -192,25 +191,43 @@ in
padding: 3px;
}
#clock,
#cpu,
#custom-playerctl,
#custom-weather,
#clock {
background: ${xcolors.blue0};
color: ${xcolors.fg0};
padding-right: 6px;
}
#cpu {
background: ${xcolors.bg1};
color: ${xcolors.yellow0};
padding-right: 6px;
}
#custom-playerctl {
background: ${xcolors.bg1};
color: ${xcolors.purple0};
padding-right:6px;
}
#custom-weather {
background: ${xcolors.bg1};
color: ${xcolors.green0};
padding-right: 6px;
}
#memory {
background: ${xcolors.aqua0};
color: ${xcolors.bg1};
padding-right: 6px;
}
#info,
#systray,
#workspaces,
#window,
#memory {
#window{
background: ${xcolors.bg0};
}
#battery,
#custom-notification,
#custom-chevron,
#network {
padding: 0 6px;
}
#workspaces button {
background: ${xcolors.bg0};
color: ${xcolors.gray1};
Expand Down

0 comments on commit 9b78e88

Please sign in to comment.