major refactor and reorg

This commit is contained in:
Matt Nish-Lapidus 2025-02-05 00:50:55 -05:00
parent 0a9342ea3e
commit 332b345753
11 changed files with 290 additions and 78 deletions

62
modules/home/hypridle.nix Normal file
View file

@ -0,0 +1,62 @@
{ inputs, ... }:
{
services.hypridle = {
enable = true;
package = inputs.hypridle.packages.x86_64-linux.default;
settings = {
general = {
lock_cmd = "pidof hyprlock || hyprlock";
before_sleep_cmd = "loginctl lock-session";
};
# TODO: add monitor shut off timout
# battery timers
listener = [
{
timeout = 30;
on-timeout = "systemd-ac-power || light -S 0";
on-resume = "systemd-ac-power || light -I";
}
{
timeout = "30";
on-timeout = "systemd-ac-power || light -s razer/0003:1532:02B6.0004/backlight -S 0";
on-resume = "systemd-ac-power || light -s razer/0003:1532:02B6.0004/backlight -S 40";
}
{
timeout = "120";
on-timeout = "systemd-ac-power || systemd-ac-power && loginctl lock-session";
}
{
timeout = "600";
on-timeout = "systemd-ac-power || systemctl suspend";
}
# ac power timers
{
timeout = "60";
on-timeout = "systemd-ac-power && light -S 0";
on-resume = "systemd-ac-power && light -I";
}
{
timeout = "60";
on-timeout = "systemd-ac-power && light -s razer/0003:1532:02B6.0004/backlight -S 0";
on-resume = "systemd-ac-power && light -s razer/0003:1532:02B6.0004/backlight -S 40";
}
{
timeout = "300";
on-timeout = "systemd-ac-power && loginctl lock-session";
}
{
timeout = "1800";
on-timeout = "systemd-ac-power && systemctl suspend";
}
];
};
};
}

61
modules/home/hyprlock.nix Normal file
View file

@ -0,0 +1,61 @@
{ inputs, ... }:
{
programs.hyprlock = {
enable = true;
package = inputs.hyprlock.packages.x86_64-linux.default;
settings = {
general = {
grace = 3;
hide_cursor = true;
};
background = {
color = "rgb(0,0,0)";
};
input-field = {
outline_thickness = 2;
dots_size = 0.15; # Scale of input-field height, 0.2 - 0.8;
dots_spacing = 0.25; # Scale of dots' absolute size, 0.0 - 1.0;
dots_center = true;
outer_color = "rgba(0, 0, 0, 0)";
inner_color = "rgba(225, 225, 225, 0.25)";
font_color = "rgb(0,0,0)";
fade_on_empty = false;
check_color = "rgb(204, 136, 34)";
placeholder_text = "<i><span foreground="##cdd6f4">hm ...</span></i>";
hide_input = false;
position = "0, 0";
halign = "center";
valign = "center";
font_family = "JetBrains Mono";
};
# DATE
label = [
{
text = "cmd[update:1000] echo \"$(date +\"%A, %B %d\")\"";
color = "rgba(242, 243, 244, 0.75)";
font_size = 32;
font_family = "JetBrains Mono";
position = "0, 300";
halign = "center";
valign = "center";
}
# TIME
{
text = "cmd[update:1000] echo \"$(date +\"%-I:%M\")\"";
color = "rgba(242, 243, 244, 0.75)";
font_size = 32;
font_family = "JetBrains Mono";
position = "0, 200";
halign = center;
valign = center;
}
];
};
};
}

29
modules/home/mako.nix Normal file
View file

@ -0,0 +1,29 @@
{
services.mako = {
enable = true;
maxVisible=5;
sort="-time";
layer="top";
anchor="top-right";
font="JetbrainsMono-Light 12";
backgroundColor="#111111";
textColor="#eeeeee";
width=300;
height=100;
margin="24";
padding="16";
borderSize=2;
borderColor="#eeeeee";
borderRadius=6;
progressColor="over #5588AAFF";
icons=true;
maxIconSize=64;
markup=true;
actions=true;
format="<b>%s</b>\n%b";
defaultTimeout=5000;
ignoreTimeout=false;
};
}

23
modules/home/mpv.nix Normal file
View file

@ -0,0 +1,23 @@
{ pkgs, ... }:
{
programs.mpv = {
enable = true;
package = (pkgs.mpv-unwrapped.wrapper {
scripts = with pkgs.mpvScripts; [
thumbfast
modernz
];
mpv = pkgs.mpv-unwrapped.override {
waylandSupport = true;
ffmpeg = pkgs.ffmpeg-full;
};
});
config = {
osc = "no";
profile = "high-quality";
ytdl-format = "bestvideo+bestaudio";
cache-default = 4000000;
};
};
}

View file

@ -0,0 +1,17 @@
{ inputs, ... }:
{
yazi = {
enable = true;
enableFishIntegration = true;
package = inputs.yazi.packages.x86_64-linux.default;
initLua = ./init.lua;
keymap = {
input.prepend_keymap = [
{ on = "<C-d>"; run = "shell 'ripdrag \"$@\" -x 2>/dev/null &' --confirm"; }
{ on = "y"; run = ["shell 'for path in \"$@\"; do echo \"file://$path\"; done | wl-copy -t text/uri-list'\n" "yank"]; }
{ on = ["g" "r"]; run = "shell 'ya emit cd \"$(git rev-parse --show-toplevel)\"'\n"; }
];
};
};
}

View file

@ -0,0 +1,23 @@
-- adds user and group of hovered file/dir to status bar
Status:children_add(function(self)
local h = self._current.hovered
if h and h.link_to then
return " -> " .. tostring(h.link_to)
else
return ""
end
end, 3300, Status.LEFT)
Status:children_add(function()
local h = cx.active.current.hovered
if h == nil or ya.target_family() ~= "unix" then
return ""
end
return ui.Line {
ui.Span(ya.user_name(h.cha.uid) or tostring(h.cha.uid)):fg("magenta"),
":",
ui.Span(ya.group_name(h.cha.gid) or tostring(h.cha.gid)):fg("magenta"),
" ",
}
end, 500, Status.RIGHT)