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

@ -33,7 +33,5 @@
GTK_CSD = "0";
GTK_USE_PORTAL = "1";
GTK_IM_MODULE = "";
MAIL = "~/Mailbox";
};
}

View file

@ -1,8 +1,10 @@
{
settings,
mainMod,
nvidia-offload-enabled,
pkgs,
}:
with builtins;
let
firefox = "firefox";
prefix = if nvidia-offload-enabled then "nvidia-offload" else "";
@ -17,6 +19,8 @@ let
screenshotFolder = "--output-folder ~/Pictures/Screenshots";
clipboardOnly = "${screenshotFolder}";
gamingWorkspace = 7;
toggleWlogout = pkgs.writeShellScriptBin "toggle" ''
if ${pkgs.busybox}/bin/pgrep wlogout > /dev/null; then
${pkgs.busybox}/bin/pkill wlogout
@ -32,6 +36,13 @@ let
rofi "$@"
fi
'';
scrollStep =
let
monitorsNum = length settings.hyprland.monitors;
in
toString (if (monitorsNum == 0) then 1 else monitorsNum);
in
[
''${mainMod}, F, exec, ${browser}''
@ -73,8 +84,8 @@ in
''${mainMod}, k, movefocus, u''
''${mainMod}, j, movefocus, d''
''${mainMod}, mouse_down, workspace, e-1''
''${mainMod}, mouse_up, workspace, e+1''
''${mainMod}, mouse_down, workspace, e-${scrollStep}''
''${mainMod}, mouse_up, workspace, e+${scrollStep}''
''${mainMod} SHIFT, l, movewindow, r''
''${mainMod} SHIFT, h, movewindow, l''
@ -90,6 +101,8 @@ in
'',XF86AudioStop, exec, playerctl stop''
'',XF86AudioMute, exec, wpctl set-mute @DEFAULT_SINK@ toggle''
''${mainMod}, G, workspace, ${toString gamingWorkspace}''
''${mainMod} SHIFT, G, movetoworkspace, ${toString gamingWorkspace}''
# ==== Plugins ==== #
# Overview
# ''${mainMod}, o, hyprtasking:toggle, cursor''

View file

@ -35,8 +35,10 @@
"float, class:^(steam)$,title:^(Friends List)$"
# Steam
"workspace: 5 silent, class: ^(steam)$"
"workspace: 7 silent, class: ^(steam)$"
"workspace: unset, class: ^(steam)$, floating: 1"
# steam game
"workspace: 7 silent, initialClass: steam_app_*"
# Line
"workspace: 2, initialTitle: ^(LINE)$"

View file

@ -28,6 +28,50 @@ let
song_info=$(playerctl metadata --format '{{title}} 󰎆 {{artist}}')
echo "$song_info"
'';
wallpapers = [
(pkgs.fetchurl {
url = "http://files.net.dn/dennis-yu-fVadSuPPE8M-unsplash.jpg";
hash = "sha256-YCusefLnTntOZAh2fIoWuJbm1+iE+RNeWTbn22UDjSU=";
})
(pkgs.fetchurl {
url = "http://files.net.dn/karsten-winegeart-LZRZJam4Avg-unsplash.jpg";
hash = "sha256-NpJhRJRiFCFmdDP/8FDmzIBellSdJ1Y6Pz63QJzkPMk=";
})
(pkgs.fetchurl {
url = "http://files.net.dn/nick-design-q3s4a7FZgjY-unsplash.jpg";
hash = "sha256-kJajqRuf+ZMTaORKKK4A+8MNzGd2SHjMcRYnq9T8LmA=";
})
(pkgs.fetchurl {
url = "http://files.net.dn/oleg-demakov-zEIApnww3fU-unsplash.jpg";
hash = "sha256-79JRnxJdCZOh2u8+5LcUDGjzwE1mMM2ZHrKLn36wd40=";
})
"$HOME/.config/wallpapers/wall.png"
];
# Change Wallpaper
wallRand = pkgs.writeShellScriptBin "wallRand" (
with builtins;
let
pathString = concatStringsSep " " (map (w: "\"" + w + "\"") wallpapers);
in
''
wallpapers=(
${pathString}
)
count="''${#wallpapers[@]}"
random_index=$(( RANDOM % count ))
selected="''${wallpapers[$random_index]}"
if [ ! -f "$selected" ]; then
echo "File not exist: $selected"
exit 1
fi
${pkgs.hyprland}/bin/hyprctl hyprpaper wallpaper ",$selected"
''
);
in
{
home.packages = with pkgs; [
@ -63,6 +107,7 @@ in
disable_logs = true;
};
bind = import ./hypr/bind.nix {
inherit settings;
inherit mainMod;
inherit pkgs;
nvidia-offload-enabled = osConfig.hardware.nvidia.prime.offload.enableOffloadCmd;
@ -88,11 +133,18 @@ in
// input;
};
# === gamemode === #
systemd.user.services.gamemode = lib.mkIf osConfig.programs.gamemode.enable {
Service = {
ExecStart = "${pkgs.gamemode}/bin/gamemoded -r";
};
};
# === hyprpaper === #
services.hyprpaper = {
enable = true;
settings = {
preload = [ "~/.config/wallpapers/wall.png" ];
preload = wallpapers;
wallpaper = [ ", ~/.config/wallpapers/wall.png" ];
splash = false;
ipc = "on";
@ -309,7 +361,7 @@ in
programs.waybar = {
enable = true;
style = ../../home/config/waybar/style.css;
settings = import ../../home/config/waybar/config.nix { inherit terminal osConfig; };
settings = import ../../home/config/waybar/config.nix { inherit terminal osConfig wallRand; };
systemd = {
enable = true;
};

View file

@ -56,6 +56,8 @@
# Thumbnail
ffmpegthumbnailer
thunderbird
]
++ (
if osConfig.programs.steam.enable then

View file

@ -46,6 +46,7 @@
font-size: 15px;
border-width: 3px;
border-color: #ebdbb2;
color: #ebdbb2;
}
.control-center .notification-row:focus,
@ -154,7 +155,7 @@
.widget-title>button:hover {
background: @borderc;
color: #282828;
color: @textc;
}
.widget-label {
@ -163,7 +164,7 @@
.widget-label>label {
font-size: 1rem;
color: @textc;
color: @borderc;
}
.widget-mpris {