mirror of
https://github.com/anotherhadi/nixy.git
synced 2026-07-06 16:12:33 +02:00
It's moving
This commit is contained in:
@@ -1,9 +1,28 @@
|
||||
{ pkgs, ... }: {
|
||||
{pkgs, ...}: let
|
||||
networkScript = pkgs.writeShellScript "waybar-network" ''
|
||||
for iface in $(${pkgs.iproute2}/bin/ip -br link show | awk '$2 == "UP" {print $1}' | grep -vE '^(lo|tun|proton|wg[0-9]|ppp|vpn|docker|br-|veth|virbr)'); do
|
||||
ip=$(${pkgs.iproute2}/bin/ip addr show "$iface" 2>/dev/null | grep 'inet ' | awk '{print $2}' | cut -d/ -f1 | head -1)
|
||||
if [ -n "$ip" ]; then
|
||||
if [[ "$iface" == wl* ]]; then
|
||||
ssid=$(${pkgs.iw}/bin/iw dev "$iface" link 2>/dev/null | grep SSID | sed 's/.*SSID: //')
|
||||
signal=$(${pkgs.iw}/bin/iw dev "$iface" link 2>/dev/null | grep signal | awk '{print $2}')
|
||||
printf '{"text": "", "class": "wifi", "tooltip": " %s\\n %s dBm"}\n' "$ssid" "$signal"
|
||||
else
|
||||
printf '{"text": "", "class": "ethernet", "tooltip": " %s\\n %s"}\n' "$iface" "$ip"
|
||||
fi
|
||||
exit 0
|
||||
fi
|
||||
done
|
||||
printf '{"text": "", "class": "disconnected", "tooltip": "Disconnected"}\n'
|
||||
'';
|
||||
in {
|
||||
imports = [
|
||||
./settings.nix
|
||||
./style.nix
|
||||
];
|
||||
|
||||
_module.args.networkScript = networkScript;
|
||||
|
||||
programs.waybar.enable = true;
|
||||
stylix.targets.waybar.enable = false;
|
||||
|
||||
@@ -11,11 +30,10 @@
|
||||
playerctl
|
||||
pavucontrol
|
||||
blueman
|
||||
swayosd
|
||||
iw
|
||||
];
|
||||
|
||||
wayland.windowManager.hyprland.settings.exec-once = [
|
||||
"waybar"
|
||||
"swayosd-server"
|
||||
];
|
||||
}
|
||||
|
||||
+40
-127
@@ -1,60 +1,23 @@
|
||||
{ osConfig ? {}, lib, ... }: let
|
||||
hasBluetooth = osConfig.hardware.bluetooth.enable or false;
|
||||
{config, networkScript, ...}: let
|
||||
gaps-out = config.theme.gaps-out;
|
||||
c = config.lib.stylix.colors;
|
||||
in {
|
||||
programs.waybar.settings = [
|
||||
{
|
||||
layer = "top";
|
||||
position = "top";
|
||||
height = 25;
|
||||
margin = "5 0";
|
||||
margin = "${toString gaps-out} ${toString gaps-out} 0";
|
||||
modules-center = ["clock" "tray" "hyprland/workspaces" "custom/network" "bluetooth" "battery" "group/right-hidden"];
|
||||
|
||||
modules-left = [ "group/left-hidden-top" "group/left" ];
|
||||
modules-center = [ "clock" ];
|
||||
modules-right = [ "group/right" "group/right-hidden-top" ];
|
||||
|
||||
# ── Groups ────────────────────────────────────────────────────────
|
||||
|
||||
"group/left" = {
|
||||
orientation = "horizontal";
|
||||
modules = [ "hyprland/workspaces" "mpris" ];
|
||||
};
|
||||
|
||||
# power-profiles-daemon visible + hidden drawer (arrow → battery cpu load)
|
||||
"group/left-hidden-top" = {
|
||||
orientation = "horizontal";
|
||||
modules = [ "power-profiles-daemon" "group/left-hidden" ];
|
||||
};
|
||||
|
||||
"group/left-hidden" = {
|
||||
"group/right-hidden" = {
|
||||
orientation = "horizontal";
|
||||
drawer = {
|
||||
transition-duration = 500;
|
||||
transition-left-to-right = false;
|
||||
click-to-reveal = true;
|
||||
};
|
||||
modules = [ "custom/arrow-right" "battery" "cpu" "load" ];
|
||||
};
|
||||
|
||||
# bluetooth volume network tray (visible)
|
||||
"group/right" = {
|
||||
orientation = "horizontal";
|
||||
modules = lib.optional hasBluetooth "bluetooth" ++ [ "group/group-volume" "network" "tray" ];
|
||||
};
|
||||
|
||||
# hidden drawer (arrow ← memory temp) + ctlcenter visible
|
||||
"group/right-hidden-top" = {
|
||||
orientation = "horizontal";
|
||||
modules = [ "group/right-hidden" "custom/ctlcenter" ];
|
||||
};
|
||||
|
||||
"group/right-hidden" = {
|
||||
orientation = "horizontal";
|
||||
drawer = {
|
||||
transition-duration = 500;
|
||||
transition-left-to-right = true;
|
||||
click-to-reveal = true;
|
||||
};
|
||||
modules = [ "custom/arrow-left" "memory" "temperature" ];
|
||||
modules = ["custom/arrow-right" "power-profiles-daemon" "mpris" "group/group-volume"];
|
||||
};
|
||||
|
||||
"group/group-volume" = {
|
||||
@@ -64,65 +27,47 @@ in {
|
||||
transition-left-to-right = true;
|
||||
reveal-delay = 450;
|
||||
};
|
||||
modules = [ "pulseaudio" "pulseaudio/slider" ];
|
||||
modules = ["pulseaudio" "pulseaudio/slider"];
|
||||
};
|
||||
|
||||
# ── Modules ─────────────────────────────────────────────────────────
|
||||
|
||||
"hyprland/workspaces" = {
|
||||
format = "{icon}";
|
||||
format = "{id}";
|
||||
on-scroll-down = "hyprctl dispatch workspace e+1";
|
||||
on-scroll-up = "hyprctl dispatch workspace e-1";
|
||||
persistent-workspaces."*" = 5;
|
||||
persistent-workspaces."*" = 4;
|
||||
cursor = true;
|
||||
format-icons = {
|
||||
active = "";
|
||||
persistent = "";
|
||||
empty = "";
|
||||
};
|
||||
};
|
||||
|
||||
mpris = {
|
||||
format = "{artist} - {title}";
|
||||
tooltip-format = "{album}";
|
||||
format-paused = " {artist} - {title}";
|
||||
format = "";
|
||||
format-paused = "";
|
||||
tooltip-format = "{title}";
|
||||
tooltip-format-paused = "{title}";
|
||||
on-click = "playerctl play-pause";
|
||||
on-scroll-up = "playerctl previous";
|
||||
on-scroll-down = "playerctl next";
|
||||
max-length = 45;
|
||||
};
|
||||
|
||||
battery = {
|
||||
bat = "BAT1";
|
||||
interval = 20;
|
||||
full-at = 100;
|
||||
tooltip = true;
|
||||
format-full = "";
|
||||
format = "{icon} {capacity}%";
|
||||
format-time = "{H}:{M:02}";
|
||||
format-charging = " {capacity}% ({time})";
|
||||
format-icons = [ "" "" "" "" "" "" "" "" "" ];
|
||||
format = "{icon} ";
|
||||
format-charging = " {icon} ";
|
||||
format-icons = ["" "" "" "" ""];
|
||||
tooltip-format = "{capacity}% · {time}";
|
||||
tooltip-format-full = "Full\n{capacity}%";
|
||||
tooltip-format-charging = "Charging\n{capacity}% · {time}";
|
||||
states = {
|
||||
warning = 30;
|
||||
critical = 15;
|
||||
};
|
||||
};
|
||||
|
||||
cpu = {
|
||||
interval = 30;
|
||||
format = " {usage}%";
|
||||
cursor = true;
|
||||
states = {
|
||||
warning = 80;
|
||||
critical = 90;
|
||||
};
|
||||
};
|
||||
|
||||
load = {
|
||||
interval = 30;
|
||||
format = " {load1}%";
|
||||
cursor = true;
|
||||
};
|
||||
|
||||
"power-profiles-daemon" = {
|
||||
format = "{icon}";
|
||||
tooltip-format = "Power profile: {profile}";
|
||||
@@ -133,22 +78,6 @@ in {
|
||||
};
|
||||
};
|
||||
|
||||
memory = {
|
||||
interval = 10;
|
||||
format = " {used:0.1f}G/{total:0.1f}G";
|
||||
states = {
|
||||
warning = 80;
|
||||
critical = 90;
|
||||
};
|
||||
};
|
||||
|
||||
temperature = {
|
||||
interval = 10;
|
||||
format = "{icon} {temperatureC}°";
|
||||
critical-threshold = 90;
|
||||
format-icons = [ "" "" "" "" "" ];
|
||||
};
|
||||
|
||||
bluetooth = {
|
||||
format = "{}";
|
||||
format-on = "";
|
||||
@@ -156,9 +85,10 @@ in {
|
||||
format-disabled = "";
|
||||
format-connected = "{device_alias}";
|
||||
format-connected-battery = "{device_alias}";
|
||||
tooltip-format = "{device_enumerate}";
|
||||
tooltip-format-enumerate-connected = "{device_alias}";
|
||||
tooltip-format-enumerate-connected-battery = "{device_alias} {device_battery_percentage}%";
|
||||
tooltip-format = "Bluetooth {status}";
|
||||
tooltip-format-connected = "Bluetooth {status}\n{device_enumerate}";
|
||||
tooltip-format-enumerate-connected = " {device_alias}";
|
||||
tooltip-format-enumerate-connected-battery = " {device_alias} {device_battery_percentage}%";
|
||||
on-click-right = "blueman-manager &";
|
||||
};
|
||||
|
||||
@@ -178,9 +108,9 @@ in {
|
||||
portable = "";
|
||||
car = "";
|
||||
default = [
|
||||
"<span size='12pt'></span>"
|
||||
"<span size='12pt'></span>"
|
||||
"<span size='12pt'></span>"
|
||||
""
|
||||
""
|
||||
""
|
||||
];
|
||||
};
|
||||
};
|
||||
@@ -191,19 +121,11 @@ in {
|
||||
cursor = true;
|
||||
};
|
||||
|
||||
network = {
|
||||
"custom/network" = {
|
||||
exec = "${networkScript}";
|
||||
return-type = "json";
|
||||
interval = 10;
|
||||
format-disabled = "";
|
||||
format-disconnected = "";
|
||||
format-wifi = "";
|
||||
format-ethernet = "";
|
||||
tooltip-format = "{essid}
|
||||
|
||||
Frequency: {frequency}GHz
|
||||
Strength: {signalStrength}%
|
||||
|
||||
{bandwidthUpBytes} {bandwidthDownBytes}";
|
||||
on-click-right = "ghostty -e nmtui &";
|
||||
on-click-right = "ghostty -e wifitui &";
|
||||
};
|
||||
|
||||
tray = {
|
||||
@@ -213,38 +135,29 @@ Strength: {signalStrength}%
|
||||
};
|
||||
|
||||
clock = {
|
||||
timezone = "Europe/Paris";
|
||||
timezone = config.var.timeZone;
|
||||
tooltip-format = "<tt><small>{calendar}</small></tt>";
|
||||
format = "{:%H:%M}";
|
||||
format-alt = "{:%H:%M %d %B %Y}";
|
||||
calendar = {
|
||||
mode = "year";
|
||||
weeks-pos = "right";
|
||||
mode-mon-col = 3;
|
||||
mode = "month";
|
||||
format = {
|
||||
months = "<span color='#acb0d0'><b>{}</b></span>";
|
||||
weeks = "<span color='#7aa2f7'><b>W{}</b></span>";
|
||||
weekdays = "<span color='#e0af68'><b>{}</b></span>";
|
||||
days = "<span color='#acb0d0'><b>{}</b></span>";
|
||||
today = "<span color='#41a6b5'><b><u>{}</u></b></span>";
|
||||
months = "<span color='#${c.base04}'><b>{}</b></span>";
|
||||
weekdays = "<span color='#${c.base0A}'><b>{}</b></span>";
|
||||
days = "<span color='#${c.base05}'>{}</span>";
|
||||
today = "<span color='#${c.base0D}'><b><u>{}</u></b></span>";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
"custom/ctlcenter" = {
|
||||
format = "";
|
||||
tooltip = false;
|
||||
on-click = "swaync-client -t &";
|
||||
};
|
||||
|
||||
"custom/arrow-left" = {
|
||||
format = "";
|
||||
format = " ";
|
||||
tooltip = false;
|
||||
cursor = true;
|
||||
};
|
||||
|
||||
"custom/arrow-right" = {
|
||||
format = "";
|
||||
format = " ";
|
||||
tooltip = false;
|
||||
cursor = true;
|
||||
};
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{ config, ... }: let
|
||||
{config, ...}: let
|
||||
c = config.lib.stylix.colors;
|
||||
fg = "#${c.base05}";
|
||||
module-bg = "#${c.base01}";
|
||||
@@ -7,12 +7,16 @@
|
||||
yellow = "#${c.base0A}";
|
||||
green = "#${c.base0B}";
|
||||
blue = "#${c.base0D}";
|
||||
cyan = "#${c.base0C}";
|
||||
mauve = "#${c.base0E}";
|
||||
inactive = "#${c.base03}";
|
||||
highlight = "#${c.base02}";
|
||||
font-size = "${toString config.stylix.fonts.sizes.applications}px";
|
||||
font-size-clock = "${toString (config.stylix.fonts.sizes.applications + 2)}px";
|
||||
in {
|
||||
programs.waybar.style = ''
|
||||
* {
|
||||
font-family: 'CaskaydiaCove Nerd Font Propo';
|
||||
font-family: '${config.stylix.fonts.sansSerif.name}';
|
||||
border: none;
|
||||
border-radius: 0;
|
||||
min-height: 0;
|
||||
@@ -24,81 +28,78 @@ in {
|
||||
#waybar {
|
||||
font-weight: 700;
|
||||
background: transparent;
|
||||
font-size: 14px;
|
||||
font-size: ${font-size};
|
||||
color: ${fg};
|
||||
}
|
||||
|
||||
#temperature,
|
||||
.modules-center {
|
||||
background: ${module-bg};
|
||||
border-radius: 100px;
|
||||
padding: 6px 14px;
|
||||
box-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
|
||||
}
|
||||
|
||||
#clock,
|
||||
#tray,
|
||||
#custom-network,
|
||||
#bluetooth,
|
||||
#battery,
|
||||
#memory,
|
||||
#mpris,
|
||||
#cpu,
|
||||
#load {
|
||||
padding: 1px 7px;
|
||||
min-width: 0;
|
||||
#mpris {
|
||||
padding: 1px 14px;
|
||||
}
|
||||
|
||||
#network,
|
||||
#tray {
|
||||
padding: 1px 6px;
|
||||
#clock {
|
||||
font-size: ${font-size-clock};
|
||||
}
|
||||
|
||||
#backlight,
|
||||
#pulseaudio {
|
||||
#workspaces {
|
||||
padding: 1px 8px;
|
||||
}
|
||||
|
||||
#pulseaudio {
|
||||
padding-left: 4px;
|
||||
padding: 1px 8px 1px 6px;
|
||||
}
|
||||
|
||||
#backlight-slider,
|
||||
#pulseaudio-slider {
|
||||
padding: 0 7px 0 2px;
|
||||
padding: 0 8px 0 2px;
|
||||
}
|
||||
|
||||
#workspaces,
|
||||
#bluetooth,
|
||||
#battery,
|
||||
#memory,
|
||||
#temperature,
|
||||
#cpu,
|
||||
#mpris,
|
||||
#load {
|
||||
margin: 0 3px;
|
||||
#workspaces button {
|
||||
color: ${fg};
|
||||
font-size: ${font-size};
|
||||
border-radius: 100px;
|
||||
padding: 0 5px;
|
||||
margin: 0 1px;
|
||||
}
|
||||
|
||||
#right,
|
||||
#left,
|
||||
#right-hidden-top,
|
||||
#left-hidden-top {
|
||||
padding: 2px 10px;
|
||||
border-radius: 15px;
|
||||
background: ${module-bg};
|
||||
#workspaces button.empty {
|
||||
color: ${inactive};
|
||||
}
|
||||
|
||||
#right-hidden-top,
|
||||
#left-hidden-top {
|
||||
#workspaces button:hover {
|
||||
background: transparent;
|
||||
color: ${fg};
|
||||
}
|
||||
|
||||
#workspaces button.active {
|
||||
color: ${module-bg};
|
||||
background: ${blue};
|
||||
border-radius: 60px;
|
||||
padding: 0 12px;
|
||||
margin: 0 1px;
|
||||
}
|
||||
|
||||
#right, #left {
|
||||
margin: 0 8px;
|
||||
#right-hidden {
|
||||
padding: 0 6px;
|
||||
}
|
||||
|
||||
#clock {
|
||||
background: ${module-bg};
|
||||
padding: 1px 18px;
|
||||
border-radius: 15px;
|
||||
}
|
||||
|
||||
#custom-ctlcenter {
|
||||
margin-left: 7px;
|
||||
#custom-arrow-right {
|
||||
padding: 0 5px;
|
||||
font-size: ${toString (config.stylix.fonts.sizes.applications + 2)}px;
|
||||
}
|
||||
|
||||
#power-profiles-daemon {
|
||||
margin-right: 7px;
|
||||
margin-right: 4px;
|
||||
}
|
||||
|
||||
#network.disabled,
|
||||
@@ -108,42 +109,42 @@ in {
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
#cpu.critical,
|
||||
#memory.critical,
|
||||
#battery {
|
||||
color: ${green};
|
||||
}
|
||||
|
||||
#battery.charging,
|
||||
#battery.full {
|
||||
color: ${green};
|
||||
}
|
||||
|
||||
#network.ethernet,
|
||||
#network.wifi {
|
||||
color: ${cyan};
|
||||
}
|
||||
|
||||
#bluetooth.on,
|
||||
#bluetooth.connected,
|
||||
#bluetooth {
|
||||
color: ${blue};
|
||||
}
|
||||
|
||||
#battery.critical,
|
||||
#temperature.critical,
|
||||
#network.disconnected,
|
||||
#power-profiles-daemon.performance {
|
||||
color: ${red};
|
||||
}
|
||||
|
||||
#cpu.warning,
|
||||
#memory.warning,
|
||||
#battery.warning,
|
||||
#temperature.warning {
|
||||
#battery.warning {
|
||||
color: ${yellow};
|
||||
background: unset;
|
||||
}
|
||||
|
||||
#power-profiles-daemon.power-saver {
|
||||
color: ${green};
|
||||
}
|
||||
|
||||
#custom-start,
|
||||
#custom-ctlcenter {
|
||||
color: ${blue};
|
||||
}
|
||||
|
||||
#workspaces button {
|
||||
color: ${fg};
|
||||
font-size: 14px;
|
||||
border-radius: 100%;
|
||||
padding: 0 2px;
|
||||
margin: 0 3px;
|
||||
}
|
||||
|
||||
#workspaces button:hover {
|
||||
background: transparent;
|
||||
#mpris {
|
||||
color: ${mauve};
|
||||
}
|
||||
|
||||
#mpris.paused {
|
||||
|
||||
Reference in New Issue
Block a user