forked from UniverseBow/flake
init (cerulean template)
This commit is contained in:
commit
1b7b1e66f0
65 changed files with 5597 additions and 0 deletions
358
homes/modules/wm/hyprland/default.nix
Executable file
358
homes/modules/wm/hyprland/default.nix
Executable file
|
|
@ -0,0 +1,358 @@
|
|||
# NOTE: hyprland must be enabled in BOTH your host config (for running hyprland)
|
||||
# NOTE: and your home-manager config (for managing hyprland's config files)
|
||||
{pkgs, ...}: {
|
||||
home.packages = with pkgs; [
|
||||
playerctl
|
||||
];
|
||||
|
||||
wayland.windowManager.hyprland = {
|
||||
enable = true;
|
||||
package = null;
|
||||
portalPackage = null;
|
||||
|
||||
xwayland.enable = true;
|
||||
|
||||
# systemd= {
|
||||
# enable = true;
|
||||
# # enable autostart of applications
|
||||
# # REF: `man 8 systemd-xdg-autostart-generator`
|
||||
# enableXdgAutostart = true;
|
||||
# };
|
||||
|
||||
settings = {
|
||||
"$MOD" = "SUPER";
|
||||
|
||||
# applications
|
||||
"$editor" = "hx";
|
||||
"$terminal" = "foot";
|
||||
"$menu" = "fuzzel";
|
||||
"$colorpicker" = "hyprpicker | head -c 7 | wl-copy";
|
||||
"$screenshot_region" = "hyprshot -m region --clipboard-only";
|
||||
"$screenshot_window" = "hyprshot -m window --clipboard-only";
|
||||
"$cursorLock" = "~/scripts/bin/hyprland-cursor-lock";
|
||||
|
||||
# startup programs
|
||||
exec-once = [
|
||||
# TODO: make these independent of hyprland, add these to the
|
||||
"mako &"
|
||||
"awww-daemon &"
|
||||
"waybar &"
|
||||
|
||||
# "wl-paste --type text --watch cliphist store"
|
||||
# "wl-paste --type image --watch cliphist store"
|
||||
# "wl-clip-persist --clipboard regular"
|
||||
# "playerctld daemon"
|
||||
];
|
||||
|
||||
# monitor configuration
|
||||
monitor = [
|
||||
"eDP-1, highres@highrr, 0x0, 1.0"
|
||||
];
|
||||
|
||||
# .__. .___ __..___. . . .___ .___. ._. __ __.
|
||||
# [__] [__ (__ | |__| [__ | | / ` (__
|
||||
# | | [___ .__) | | | [___ | _|_ \__. .__)
|
||||
general = {
|
||||
gaps_in = 12; # margin between windows
|
||||
gaps_out = 25; # margin from windows to monitor edge
|
||||
gaps_workspaces = 0; # margin between workspaces (stacks with gaps_out)
|
||||
# float_gaps = 0; # gaps_out but for floating windows
|
||||
|
||||
border_size = 4;
|
||||
|
||||
"col.active_border" = "rgba(33ccffee) rgba(00ff99ee) 45deg";
|
||||
"col.inactive_border" = "rgba(00000000)";
|
||||
|
||||
# Enable resizing windows by clicking and dragging the border
|
||||
resize_on_border = true;
|
||||
|
||||
# REF: https://wiki.hyprland.org/Configuring/Tearing/
|
||||
allow_tearing = false;
|
||||
|
||||
layout = "dwindle";
|
||||
|
||||
snap = {
|
||||
enabled = false;
|
||||
window_gap = 10;
|
||||
monitor_gap = 10;
|
||||
border_overlap = false;
|
||||
# respect_gaps = false;
|
||||
};
|
||||
};
|
||||
|
||||
decoration = {
|
||||
rounding = 20;
|
||||
rounding_power = 4.0; # Lp norm
|
||||
border_part_of_window = true; # consider border as part of its window
|
||||
# screen_shader = ...; # path to custom GLSL fragment shader
|
||||
|
||||
# window Transparency
|
||||
active_opacity = 1.0;
|
||||
inactive_opacity = 0.95;
|
||||
fullscreen_opacity = 1.0; # fullscreened windows
|
||||
# inactive Window Dimming
|
||||
dim_inactive = false;
|
||||
dim_strength = 0.5;
|
||||
dim_special = 0.2;
|
||||
dim_around = 0.4;
|
||||
|
||||
blur = {
|
||||
enabled = true;
|
||||
new_optimizations = true;
|
||||
xray = false; # floating windows xray through tiling windows
|
||||
ignore_opacity = true;
|
||||
|
||||
# blur Parameters
|
||||
size = 8;
|
||||
passes = 1;
|
||||
noise = 0.0117; # default
|
||||
contrast = 0.8916; # default
|
||||
brightness = 0.8172; # default
|
||||
vibrancy = 0.1696; # default
|
||||
vibrancy_darkness = 0.0; # default
|
||||
|
||||
# blurring For Specific Window Types
|
||||
special = false; # blur special windows
|
||||
popups = false; # blur popups
|
||||
popups_ignorealpha = 0.2;
|
||||
input_methods = false;
|
||||
input_methods_ignorealpha = 0.2;
|
||||
};
|
||||
|
||||
shadow = {
|
||||
enabled = true;
|
||||
ignore_window = true; # only render at edges (not behind)
|
||||
|
||||
range = 3;
|
||||
render_power = 1; # falloff rate
|
||||
sharp = false; # aka infinite shadow.render_power
|
||||
offset = "0 0"; # vec2
|
||||
scale = 1.0;
|
||||
|
||||
color = "rgba(00000000)";
|
||||
color_inactive = "rgba(000000ff)"; # defaults to shadow.color if unset
|
||||
};
|
||||
};
|
||||
|
||||
# REF: https://cubic-bezier.com
|
||||
bezier = [
|
||||
"easeOutQuint,0.23,1,0.32,1"
|
||||
"easeInOutCubic,0.65,0.05,0.36,1"
|
||||
"linear,0,0,1,1"
|
||||
"almostLinear,0.5,0.5,0.75,1.0"
|
||||
"quick,0.15,0,0.1,1"
|
||||
];
|
||||
|
||||
# REF: https://wiki.hyprland.org/Configuring/Animations
|
||||
# Animation Declaration Format:
|
||||
# "animation = NAME, ENABLE, SPEED, BEZIER [,STYLE]"
|
||||
# NOTE: SPEED is in ds (where 1ds = 100ms)
|
||||
animations = [
|
||||
"global, 1, 10, default"
|
||||
"border, 1, 5.39, easeOutQuint"
|
||||
|
||||
"windowsIn, 1, 4, linear, slide bottom"
|
||||
"windowsOut, 1, 10, linear, popin"
|
||||
|
||||
"fadeIn, 1, 1.73, almostLinear"
|
||||
"fadeOut, 1, 1.46, almostLinear"
|
||||
"fade, 1, 3.03, quick"
|
||||
|
||||
"layers, 1, 3.81, easeOutQuint"
|
||||
"layersIn, 1, 4, easeOutQuint, fade"
|
||||
"layersOut, 1, 1.5, linear, fade"
|
||||
|
||||
"fadeLayersIn, 1, 1.79, almostLinear"
|
||||
"fadeLayersOut, 1, 1.39, almostLinear"
|
||||
|
||||
"workspaces, 1, 1.94, almostLinear, fade"
|
||||
"workspacesIn, 1, 1.21, almostLinear, fade"
|
||||
"workspacesOut, 1, 1.94, almostLinear, fade"
|
||||
];
|
||||
|
||||
# REF: https://wiki.hyprland.org/Configuring/Dwindle-Layout
|
||||
dwindle = {
|
||||
# master switch for pseudotiling. enabling is bound to MOD + P in the keybinds section below
|
||||
pseudotile = true;
|
||||
preserve_split = true; # You probably want this
|
||||
};
|
||||
|
||||
# REF: https://wiki.hyprland.org/Configuring/Master-Layout
|
||||
master = {
|
||||
new_status = "master";
|
||||
};
|
||||
|
||||
misc = {
|
||||
#force_default_wallpaper = -1; # Set to 0 or 1 to disable the anime mascot wallpapers
|
||||
disable_hyprland_logo = true;
|
||||
disable_splash_rendering = true;
|
||||
|
||||
enable_anr_dialog = false;
|
||||
font_family = "Geist Mono";
|
||||
};
|
||||
|
||||
input = {
|
||||
# kb_layout = "us";
|
||||
# kb_variant =
|
||||
# kb_model =
|
||||
# kb_options =
|
||||
# kb_rules =
|
||||
|
||||
follow_mouse = 1;
|
||||
|
||||
sensitivity = 0; # -1.0 - 1.0, 0 means no modification
|
||||
accel_profile = "flat";
|
||||
force_no_accel = false; # not recommended to turn on
|
||||
|
||||
repeat_rate = 50;
|
||||
repeat_delay = 300;
|
||||
|
||||
touchpad = {
|
||||
natural_scroll = true;
|
||||
};
|
||||
};
|
||||
|
||||
cursor.no_hardware_cursors = true;
|
||||
|
||||
# standard keypress bindings
|
||||
bind = [
|
||||
# terminal commands
|
||||
"$MOD, RETURN, exec, $terminal"
|
||||
|
||||
# btop
|
||||
"$MOD, P, exec, bash -c \"{ hyprctl clients | rg '^\w*title: btop' &>/dev/null; } && hyprctl dispatch closewindow title:btop || $terminal -T btop btop & disown\""
|
||||
|
||||
"$MOD, R, exec, $menu"
|
||||
|
||||
# lock mouse to window (mostly, for gaming)
|
||||
"$MOD, F1, exec, pkill hyprland-cursor || $cursorLock"
|
||||
"$MOD, F2, exec, $colorpicker"
|
||||
|
||||
# screenshots
|
||||
"$MOD, S, exec, $screenshot_region"
|
||||
"$MOD SHIFT, S, exec, $screenshot_window"
|
||||
|
||||
"$MOD, F, fullscreen"
|
||||
"$MOD SHIFT, F, fullscreenstate, 0 3" # fakefullscreen
|
||||
"$MOD, C, killactive"
|
||||
"$MOD SHIFT, Delete, exit"
|
||||
|
||||
# switch window
|
||||
"$MOD, left, movefocus, l"
|
||||
"$MOD, right, movefocus, r"
|
||||
"$MOD, up, movefocus, u"
|
||||
"$MOD, down, movefocus, d"
|
||||
"$MOD, H, movefocus, l"
|
||||
"$MOD, J, movefocus, d"
|
||||
"$MOD, K, movefocus, u"
|
||||
"$MOD, L, movefocus, r"
|
||||
|
||||
# switch workspaces
|
||||
"$MOD, 1, workspace, 1"
|
||||
"$MOD, 2, workspace, 2"
|
||||
"$MOD, 3, workspace, 3"
|
||||
"$MOD, 4, workspace, 4"
|
||||
"$MOD, 5, workspace, 5"
|
||||
"$MOD, 6, workspace, 6"
|
||||
"$MOD, 7, workspace, 7"
|
||||
"$MOD, 8, workspace, 8"
|
||||
"$MOD, 9, workspace, 9"
|
||||
"$MOD, 0, workspace, 10"
|
||||
"$MOD SHIFT, left, workspace, e-1"
|
||||
"$MOD SHIFT, right, workspace, e+1"
|
||||
|
||||
# move window to workspace
|
||||
"$MOD SHIFT, 1, movetoworkspace, 1"
|
||||
"$MOD SHIFT, 2, movetoworkspace, 2"
|
||||
"$MOD SHIFT, 3, movetoworkspace, 3"
|
||||
"$MOD SHIFT, 4, movetoworkspace, 4"
|
||||
"$MOD SHIFT, 5, movetoworkspace, 5"
|
||||
"$MOD SHIFT, 6, movetoworkspace, 6"
|
||||
"$MOD SHIFT, 7, movetoworkspace, 7"
|
||||
"$MOD SHIFT, 8, movetoworkspace, 8"
|
||||
"$MOD SHIFT, 9, movetoworkspace, 9"
|
||||
"$MOD SHIFT, 0, movetoworkspace, 10"
|
||||
|
||||
# move workspace to monitor
|
||||
"$MOD TAB, 1, movecurrentworkspacetomonitor, DP-2"
|
||||
"$MOD TAB, 2, movecurrentworkspacetomonitor, HDMA-A-1"
|
||||
];
|
||||
|
||||
# bindings for mouse
|
||||
bindm = [
|
||||
"$MOD, mouse:272, movewindow"
|
||||
"$MOD, mouse:273, resizewindow"
|
||||
];
|
||||
|
||||
# bindings that work even while screen is locked
|
||||
bindl = [
|
||||
# WARNING: requires `pkgs.playerctl`
|
||||
", XF86AudioNext, exec, playerctl next"
|
||||
", XF86AudioPause, exec, playerctl play-pause"
|
||||
", XF86AudioPlay, exec, playerctl play-pause"
|
||||
", XF86AudioPrev, exec, playerctl previous"
|
||||
];
|
||||
|
||||
# bindings that work even while screen is locked
|
||||
# and also repeat when the key is held
|
||||
bindel = [
|
||||
",XF86AudioRaiseVolume, exec, wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%+"
|
||||
",XF86AudioLowerVolume, exec, wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%-"
|
||||
",XF86AudioMute, exec, wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle"
|
||||
",XF86AudioMicMute, exec, wpctl set-mute @DEFAULT_AUDIO_SOURCE@ toggle"
|
||||
",XF86MonBrightnessUp, exec, brightnessctl s 10%+"
|
||||
",XF86MonBrightnessDown, exec, brightnessctl s 10%-"
|
||||
];
|
||||
|
||||
windowrule = [
|
||||
# btop process manager
|
||||
{
|
||||
name = "terminal-manager";
|
||||
"match:class" = "^(foot)$";
|
||||
"match:title" = "^(btop)$";
|
||||
float = true;
|
||||
center = true;
|
||||
size = "(monitor_w*0.65) (monitor_h*0.65)";
|
||||
}
|
||||
|
||||
# ignore maximize requests from apps
|
||||
{
|
||||
name = "suppress-maximize";
|
||||
suppress_event = "maximize";
|
||||
"match:class" = ".*";
|
||||
}
|
||||
|
||||
# fix some dragging issues with XWayland
|
||||
{
|
||||
name = "no-focus";
|
||||
no_focus = "on";
|
||||
"match:class" = "^$";
|
||||
"match:title" = "^$";
|
||||
"match:xwayland" = true;
|
||||
"match:float" = true;
|
||||
"match:fullscreen" = false;
|
||||
"match:pin" = false;
|
||||
}
|
||||
|
||||
# TODO: style fakefullscreen windows to clearly indicate their difference
|
||||
# {
|
||||
# name = "fake-fullscreen";
|
||||
# }
|
||||
];
|
||||
|
||||
# █▀▀ █▄░█ █░█ █░█ ▄▀█ █▀█
|
||||
# ██▄ █░▀█ ▀▄▀ ▀▄▀ █▀█ █▀▄
|
||||
env = [
|
||||
"XCURSOR_THEME,Bibata-Modern-Ice"
|
||||
"XCURSOR_SIZE,16"
|
||||
"HYPRCURSOR_THEME,Bibata-Modern-Ice"
|
||||
"HYPRCURSOR_SIZE,16"
|
||||
|
||||
"QT_QPA_PLATFORM,wayland"
|
||||
"QT_QPA_PLATFORMTHEME,xdgdesktopportal" # makes portals work correctly
|
||||
"XDG_MENU_PREFIX,arch-"
|
||||
"XDG_CURRENT_DESKTOP,Hyprland"
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
||||
29
homes/modules/wm/hyprland/hypridle.nix
Executable file
29
homes/modules/wm/hyprland/hypridle.nix
Executable file
|
|
@ -0,0 +1,29 @@
|
|||
{
|
||||
config,
|
||||
pkgs,
|
||||
...
|
||||
}: {
|
||||
services.hypridle = {
|
||||
enable = true;
|
||||
settings = {
|
||||
general = {
|
||||
ignore_dbus_inhibit = false;
|
||||
lock_cmd = "pidof hyprlock || ${pkgs.hyprlock}/bin/hyprlock";
|
||||
before_sleep_cmd = "loginctl lock-session";
|
||||
after_sleep_cmd = "hyprctl dispatch dpms on";
|
||||
};
|
||||
|
||||
listener = [
|
||||
{
|
||||
timeout = 600;
|
||||
on-timeout = "pidof hyprlock || ${pkgs.hyprlock}/bin/hyprlock";
|
||||
}
|
||||
|
||||
{
|
||||
timeout = 660;
|
||||
on-timeout = "systemctl suspend";
|
||||
}
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
||||
115
homes/modules/wm/hyprland/hyprlock.nix
Executable file
115
homes/modules/wm/hyprland/hyprlock.nix
Executable file
|
|
@ -0,0 +1,115 @@
|
|||
{...}: {
|
||||
programs.hyprlock = {
|
||||
enable = true;
|
||||
settings = {
|
||||
background = {
|
||||
monitor = "";
|
||||
# TODO: ooni pls change this to something of your own
|
||||
# path = "$HOME/downloads/wallpaper/kill-my-firstborn/astronaut-pink-blue.png";
|
||||
# color = $color1
|
||||
|
||||
# all these options are taken from hyprland, see https://wiki.hyprland.org/Configuring/Variables/#blur for explanations
|
||||
blur_size = 4;
|
||||
blur_passes = 3; # 0 disables blurring
|
||||
noise = 0.0117;
|
||||
contrast = 1.3000; # Vibrant!!!
|
||||
brightness = 0.8000;
|
||||
vibrancy = 0.2100;
|
||||
vibrancy_darkness = 0.0;
|
||||
};
|
||||
label = [
|
||||
{
|
||||
# Hours
|
||||
monitor = "";
|
||||
text = ''cmd[update:1000] echo "<b><big> $(date +"%H") </big></b>"'';
|
||||
color = "rgb(255, 255, 255, 1)";
|
||||
font_size = 112;
|
||||
font_family = "Geist Mono 10";
|
||||
shadow_passes = 3;
|
||||
shadow_size = 4;
|
||||
|
||||
position = "0, 240";
|
||||
halign = "center";
|
||||
valign = "center";
|
||||
}
|
||||
|
||||
{
|
||||
# Minutes
|
||||
monitor = "";
|
||||
text = ''cmd[update:1000] echo "<b><big> $(date +"%M") </big></b>"'';
|
||||
color = "rgb(255, 255, 255, 1)";
|
||||
font_size = 112;
|
||||
font_family = "Geist Mono 10";
|
||||
shadow_passes = 3;
|
||||
shadow_size = 4;
|
||||
|
||||
position = "0, 120";
|
||||
halign = "center";
|
||||
valign = "center";
|
||||
}
|
||||
|
||||
# Today
|
||||
{
|
||||
monitor = "";
|
||||
text = ''cmd[update:18000000] echo "<b><big> "$(date +'%A')" </big></b>"'';
|
||||
color = "rgb(255, 255, 255, 1)";
|
||||
font_size = 22;
|
||||
font_family = "JetBrainsMono Nerd Font 10";
|
||||
|
||||
position = "0, 30";
|
||||
halign = "center";
|
||||
valign = "center";
|
||||
}
|
||||
|
||||
# Week
|
||||
{
|
||||
monitor = "";
|
||||
text = ''cmd[update:18000000] echo "<b> "$(date +'%d %b')" </b>"'';
|
||||
color = "rgb(255, 255, 255, 1)";
|
||||
font_size = 18;
|
||||
font_family = "JetBrainsMono Nerd Font 10";
|
||||
|
||||
position = "0, 6";
|
||||
halign = "center";
|
||||
valign = "center";
|
||||
}
|
||||
|
||||
{
|
||||
# Degrees
|
||||
monitor = "";
|
||||
# get temperature in Brisbane
|
||||
text = ''cmd[update:18000000] echo "<b>Feels like $(curl -s 'wttr.in/bne?format=%t' | tr -d '+')</b>"'';
|
||||
color = "rgb(255, 255, 255, 1)";
|
||||
font_size = 18;
|
||||
font_family = "Geist Mono 10";
|
||||
|
||||
position = "0, 40";
|
||||
halign = "center";
|
||||
valign = "bottom";
|
||||
}
|
||||
];
|
||||
|
||||
input-field = {
|
||||
monitor = "";
|
||||
size = "300, 50";
|
||||
outline_thickness = 3;
|
||||
|
||||
dots_size = 0.26; # Scale of input-field height, 0.2 - 0.8
|
||||
dots_spacing = 0.64; # Scale of dots' absolute size, 0.0 - 1.0
|
||||
dots_center = true;
|
||||
dots_rouding = -1;
|
||||
|
||||
rounding = 22;
|
||||
outer_color = "rgb(0, 0, 0, 0)";
|
||||
inner_color = "rgb(100, 114, 125, 0.1)";
|
||||
font_color = "rgb(200, 200, 200)";
|
||||
fade_on_empty = true;
|
||||
placeholder_text = "<i>Password...</i>"; # Text rendered in the input box when it's empty.
|
||||
|
||||
position = "0, 120";
|
||||
halign = "center";
|
||||
valign = "bottom";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue