Squash merge feat/mail-server into main

This commit is contained in:
DACHXY 2025-07-14 16:18:20 +08:00
parent 14f4243aee
commit 06bcfe62ff
21 changed files with 973 additions and 67 deletions

View file

@ -0,0 +1,22 @@
#!/usr/bin/env bash
SERVICE="gamemode"
if [ "$1" = "toggle" ]; then
if systemctl --user is-active --quiet "$SERVICE"; then
systemctl --user stop "$SERVICE"
notify-send "󰊗 Gamemode" "off" >/dev/null 2>&1
else
systemctl --user start "$SERVICE"
notify-send "󰊗 Gamemode" "on" >/dev/null 2>&1
fi
exit 0
fi
if ! systemctl --user is-active --quiet "$SERVICE"; then
echo "{\"text\": \"inactive\", \"tooltip\": \"gamemoded is inactive\", \"alt\": \"inactive\", \"class\": \"inactive\"}"
exit 0
fi
echo "{\"text\": \"active\", \"tooltip\": \"gamemoded is running\", \"alt\": \"active\", \"class\": \"active\"}"
exit 0

View file

@ -1,6 +1,10 @@
{ terminal, osConfig }:
{
terminal,
osConfig,
wallRand,
}:
let
modulesConfig = import ./modules.nix { inherit terminal osConfig; };
modulesConfig = import ./modules.nix { inherit terminal osConfig wallRand; };
in
map (dev: dev // modulesConfig) [
# Monitor 1
@ -26,16 +30,29 @@ map (dev: dev // modulesConfig) [
modules-center = [
"hyprland/window"
];
modules-right = [
"wlr/taskbar"
"custom/wireguard"
"idle_inhibitor"
"network"
"cpu"
"memory"
"pulseaudio"
"custom/swaync"
];
modules-right = (
[
"wlr/taskbar"
]
++ (
if osConfig.programs.gamemode.enable then
[
"custom/gamemode"
]
else
[ ]
)
++ [
"custom/wallRand"
"custom/wireguard"
"idle_inhibitor"
"network"
"cpu"
"memory"
"pulseaudio"
"custom/swaync"
]
);
}
# Monitor 2
{

View file

@ -1,4 +1,8 @@
{ terminal, osConfig }:
{
terminal,
osConfig,
wallRand,
}:
let
terminalRun = "${terminal} -e";
in
@ -247,4 +251,21 @@ in
return-type = "json";
escape = true;
};
"custom/gamemode" = {
format = "{icon}";
format-icons = {
active = "󰊗";
inactive = "󰺷";
};
exec = "~/.config/scripts/gamemodeStatus.sh";
on-click = "~/.config/scripts/gamemodeStatus.sh toggle";
tooltip = true;
interval = 3;
return-type = "json";
escape = true;
};
"custom/wallRand" = {
format = "";
on-click = "${wallRand}/bin/wallRand";
};
}

View file

@ -43,6 +43,8 @@ tooltip label {
#idle_inhibitor,
#custom-cava,
#custom-wireguard,
#custom-gamemode,
#custom-wallRand,
#clock,
#cpu,
#memory,
@ -80,6 +82,8 @@ tooltip label {
#temperature,
#network,
#custom-wireguard,
#custom-gamemode,
#custom-wallRand,
#battery {
margin-left: 4px;
}
@ -126,6 +130,8 @@ tooltip label {
/* Center Icon */
#custom-os,
#custom-wireguard,
#custom-gamemode,
#custom-wallRand,
#network,
#idle_inhibitor {
padding-left: 10px; padding-right: 14px;