feat: add hyprlock & hypridle
This commit is contained in:
parent
43bb08b86d
commit
e1af19001f
14 changed files with 233 additions and 57 deletions
|
|
@ -10,7 +10,8 @@
|
||||||
- ✅ [treesitter](https://github.com/nvim-treesitter/nvim-treesitter)
|
- ✅ [treesitter](https://github.com/nvim-treesitter/nvim-treesitter)
|
||||||
- ❌ mason (not support on NixOS)
|
- ❌ mason (not support on NixOS)
|
||||||
- [X] Waybar
|
- [X] Waybar
|
||||||
- [X] Swayidle
|
- [X] Hyprlock
|
||||||
|
- [X] Hypridle
|
||||||
- [X] Swaync (Notification Center)
|
- [X] Swaync (Notification Center)
|
||||||
- [X] Hyprpaper (Wallpaper)
|
- [X] Hyprpaper (Wallpaper)
|
||||||
- [X] Ghostty (Terminal)
|
- [X] Ghostty (Terminal)
|
||||||
|
|
|
||||||
BIN
home/config/.face
Normal file
BIN
home/config/.face
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 116 KiB |
93
home/config/hypr/hyprlock.conf
Normal file
93
home/config/hypr/hyprlock.conf
Normal file
|
|
@ -0,0 +1,93 @@
|
||||||
|
$font = CaskaydiaCove Nerd Font
|
||||||
|
$font2 = SF Pro Display Bold
|
||||||
|
|
||||||
|
background {
|
||||||
|
monitor =
|
||||||
|
path = screenshot
|
||||||
|
blur_passes = 3
|
||||||
|
blur_size = 8
|
||||||
|
contrast = 0.8916
|
||||||
|
brightness = 0.8172
|
||||||
|
vibrancy = 0.1696
|
||||||
|
vibrancy_darkness = 0.0
|
||||||
|
}
|
||||||
|
|
||||||
|
# GENERAL
|
||||||
|
general {
|
||||||
|
no_fade_in = false
|
||||||
|
grace = 0
|
||||||
|
disable_loading_bar = false
|
||||||
|
}
|
||||||
|
|
||||||
|
# TIME
|
||||||
|
label {
|
||||||
|
monitor =
|
||||||
|
text = cmd[update:1000] echo "$(date +"%-I:%M%p")"
|
||||||
|
color = rgba(250, 189, 47, .75)
|
||||||
|
font_size = 120
|
||||||
|
font_family = $font2
|
||||||
|
position = 0, -140
|
||||||
|
halign = center
|
||||||
|
valign = top
|
||||||
|
}
|
||||||
|
|
||||||
|
# DAY-DATE-MONTH
|
||||||
|
label {
|
||||||
|
monitor =
|
||||||
|
text = cmd[update:1000] echo "<span>$(date '+%A, %d %B')</span>"
|
||||||
|
color = rgba(225, 225, 225, 0.75)
|
||||||
|
font_size = 30
|
||||||
|
font_family = $font2
|
||||||
|
position = 0, 200
|
||||||
|
halign = center
|
||||||
|
valign = center
|
||||||
|
}
|
||||||
|
|
||||||
|
# LOGO
|
||||||
|
image {
|
||||||
|
monitor =
|
||||||
|
path = $HOME/.face
|
||||||
|
border_size = 2
|
||||||
|
border_color = rgba(255, 255, 255, .75)
|
||||||
|
size = 95
|
||||||
|
rounding = -1
|
||||||
|
rotate = 0
|
||||||
|
reload_time = -1
|
||||||
|
reload_cmd =
|
||||||
|
position = 0, 60
|
||||||
|
halign = center
|
||||||
|
valign = center
|
||||||
|
}
|
||||||
|
|
||||||
|
# USER
|
||||||
|
label {
|
||||||
|
monitor =
|
||||||
|
text = Hello, $USER
|
||||||
|
color = rgba(255, 255, 255, .65)
|
||||||
|
font_size = 25
|
||||||
|
font_family = $font2
|
||||||
|
position = 0, -70
|
||||||
|
halign = center
|
||||||
|
valign = center
|
||||||
|
}
|
||||||
|
|
||||||
|
# INPUT FIELD
|
||||||
|
input-field {
|
||||||
|
monitor =
|
||||||
|
size = 290, 60
|
||||||
|
outline_thickness = 2
|
||||||
|
dots_size = 0.2 # Scale of input-field height, 0.2 - 0.8
|
||||||
|
dots_spacing = 0.2 # Scale of dots' absolute size, 0.0 - 1.0
|
||||||
|
dots_center = true
|
||||||
|
outer_color = rgba(0, 0, 0, 0)
|
||||||
|
inner_color = rgba(60, 56, 54, 0.35)
|
||||||
|
font_color = rgb(200, 200, 200)
|
||||||
|
fade_on_empty = false
|
||||||
|
font_family = $font2
|
||||||
|
placeholder_text = <i><span foreground="##ffffff99">Bruh, come back!</span></i>
|
||||||
|
hide_input = false
|
||||||
|
position = 0, -140
|
||||||
|
halign = center
|
||||||
|
valign = center
|
||||||
|
}
|
||||||
|
|
||||||
|
|
@ -1,4 +0,0 @@
|
||||||
timeout 300 'if pgrep swaylock; then hyprctl dispatch dpms off; fi'
|
|
||||||
resume 'hyprctl dispatch dpms on'
|
|
||||||
timeout 420 'systemctl suspend'
|
|
||||||
before-sleep 'swaylock'
|
|
||||||
|
|
@ -1,31 +0,0 @@
|
||||||
daemonize
|
|
||||||
indicator
|
|
||||||
clock
|
|
||||||
screenshots
|
|
||||||
|
|
||||||
effect-blur=11x11
|
|
||||||
font=JetBrains Mono
|
|
||||||
indicator-radius=80
|
|
||||||
indicator-thickness=8
|
|
||||||
timestr=%I:%M %p
|
|
||||||
datestr=%F
|
|
||||||
|
|
||||||
inside-color=#181926
|
|
||||||
ring-color=#8bd5ca
|
|
||||||
key-hl-color=#a6da95
|
|
||||||
text-color=#cad3f5
|
|
||||||
layout-text-color=#cad3f5
|
|
||||||
layout-bg-color=#181926
|
|
||||||
text-caps-lock-color=#cad3f5
|
|
||||||
|
|
||||||
inside-clear-color=#f4dbd6
|
|
||||||
ring-clear-color=#f0c6c6
|
|
||||||
text-clear-color=#1e2030
|
|
||||||
|
|
||||||
inside-ver-color=#91d7e3
|
|
||||||
ring-ver-color=#7dc4e4
|
|
||||||
text-ver-color=#1e2030
|
|
||||||
|
|
||||||
inside-wrong-color=#ee99a0
|
|
||||||
ring-wrong-color=#ed8796
|
|
||||||
text-wrong-color=#1e2030
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"label" : "lock",
|
"label" : "lock",
|
||||||
"action" : "swaylock",
|
"action" : "hyprlock",
|
||||||
"text" : "Lock",
|
"text" : "Lock",
|
||||||
"keybind" : "l"
|
"keybind" : "l"
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -7,8 +7,6 @@ in
|
||||||
".config/wallpapers".source = "${configDir}/wallpapers";
|
".config/wallpapers".source = "${configDir}/wallpapers";
|
||||||
".config/kitty".source = "${configDir}/kitty";
|
".config/kitty".source = "${configDir}/kitty";
|
||||||
".config/neofetch".source = "${configDir}/neofetch";
|
".config/neofetch".source = "${configDir}/neofetch";
|
||||||
".config/swayidle".source = "${configDir}/swayidle";
|
|
||||||
".config/swaylock".source = "${configDir}/swaylock";
|
|
||||||
".config/wlogout".source = "${configDir}/wlogout";
|
".config/wlogout".source = "${configDir}/wlogout";
|
||||||
".config/waybar" = {
|
".config/waybar" = {
|
||||||
recursive = true;
|
recursive = true;
|
||||||
|
|
@ -36,5 +34,7 @@ in
|
||||||
recursive = true;
|
recursive = true;
|
||||||
source = "${configDir}/ghostty";
|
source = "${configDir}/ghostty";
|
||||||
};
|
};
|
||||||
|
".face".source = "${configDir}/.face";
|
||||||
|
".hyprlock_bg.svg".source = "${configDir}/hyprlock_bg.vsg";
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -23,7 +23,7 @@ in
|
||||||
''${mainMod} ALT, W, exec, ${uwsm} ${scripts}/waybarRestart.sh''
|
''${mainMod} ALT, W, exec, ${uwsm} ${scripts}/waybarRestart.sh''
|
||||||
''${mainMod}, P, pseudo, # dwindle''
|
''${mainMod}, P, pseudo, # dwindle''
|
||||||
''${mainMod}, S, togglesplit, # dwindle''
|
''${mainMod}, S, togglesplit, # dwindle''
|
||||||
''CTRL ${mainMod} SHIFT, L, exec, swaylock''
|
''CTRL ${mainMod} SHIFT, L, exec, hyprlock''
|
||||||
''${mainMod} SHIFT, s, exec, hyprshot -m region --clipboard-only --freeze''
|
''${mainMod} SHIFT, s, exec, hyprshot -m region --clipboard-only --freeze''
|
||||||
''CTRL SHIFT, s, exec, hyprshot -m window --clipboard-only --freeze''
|
''CTRL SHIFT, s, exec, hyprshot -m window --clipboard-only --freeze''
|
||||||
''CTRL SHIFT ${mainMod}, s, exec, hyprshot -m output --clipboard-only --freeze''
|
''CTRL SHIFT ${mainMod}, s, exec, hyprshot -m output --clipboard-only --freeze''
|
||||||
|
|
@ -33,6 +33,9 @@ in
|
||||||
'',F11, fullscreen''
|
'',F11, fullscreen''
|
||||||
''${mainMod}, C, exec, code''
|
''${mainMod}, C, exec, code''
|
||||||
|
|
||||||
|
# Color Picker
|
||||||
|
''${mainMod} SHIFT, P, exec, hyprpicker -f hex -a -z -r''
|
||||||
|
|
||||||
# Cycle windows
|
# Cycle windows
|
||||||
''ALT, TAB, cyclenext''
|
''ALT, TAB, cyclenext''
|
||||||
''ALT, TAB, bringactivetotop''
|
''ALT, TAB, bringactivetotop''
|
||||||
|
|
@ -55,7 +58,6 @@ in
|
||||||
''${mainMod} SHIFT, k, movewindow, u''
|
''${mainMod} SHIFT, k, movewindow, u''
|
||||||
''${mainMod} SHIFT, j, movewindow, d''
|
''${mainMod} SHIFT, j, movewindow, d''
|
||||||
|
|
||||||
|
|
||||||
# Media
|
# Media
|
||||||
'',XF86AudioRaiseVolume, exec, wpctl set-mute @DEFAULT_SINK@ 0 && wpctl set-volume @DEFAULT_SINK@ ${volumeStep}%+''
|
'',XF86AudioRaiseVolume, exec, wpctl set-mute @DEFAULT_SINK@ 0 && wpctl set-volume @DEFAULT_SINK@ ${volumeStep}%+''
|
||||||
'',XF86AudioLowerVolume, exec, wpctl set-mute @DEFAULT_SINK@ 0 && wpctl set-volume @DEFAULT_SINK@ ${volumeStep}%-''
|
'',XF86AudioLowerVolume, exec, wpctl set-mute @DEFAULT_SINK@ 0 && wpctl set-volume @DEFAULT_SINK@ ${volumeStep}%-''
|
||||||
|
|
@ -70,18 +72,20 @@ in
|
||||||
# ==== Plugins ==== #
|
# ==== Plugins ==== #
|
||||||
# Overview
|
# Overview
|
||||||
''${mainMod}, o, hyprexpo:expo, toggle''
|
''${mainMod}, o, hyprexpo:expo, toggle''
|
||||||
] ++ (
|
]
|
||||||
|
++ (
|
||||||
# workspaces
|
# workspaces
|
||||||
# binds $mainMod + [shift +] {1..9} to [move to] workspace {1..9}
|
# binds $mainMod + [shift +] {1..9} to [move to] workspace {1..9}
|
||||||
builtins.concatLists (builtins.genList
|
builtins.concatLists (
|
||||||
(i:
|
builtins.genList (
|
||||||
let ws = i + 1;
|
i:
|
||||||
|
let
|
||||||
|
ws = i + 1;
|
||||||
in
|
in
|
||||||
[
|
[
|
||||||
"${mainMod}, code:1${toString i}, workspace, ${toString ws}"
|
"${mainMod}, code:1${toString i}, workspace, ${toString ws}"
|
||||||
"${mainMod} SHIFT, code:1${toString i}, movetoworkspace, ${toString ws}"
|
"${mainMod} SHIFT, code:1${toString i}, movetoworkspace, ${toString ws}"
|
||||||
]
|
]
|
||||||
|
) 9
|
||||||
)
|
)
|
||||||
9)
|
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -23,8 +23,7 @@ let
|
||||||
systemctl --user import-environment WAYLAND_DISPLAY XDG_CURRENT_DESKTOP &
|
systemctl --user import-environment WAYLAND_DISPLAY XDG_CURRENT_DESKTOP &
|
||||||
uwsm app -- hyprpaper &
|
uwsm app -- hyprpaper &
|
||||||
uwsm app -- waybar -c ~/.config/waybar/config.json -s ~/.config/waybar/style.css &
|
uwsm app -- waybar -c ~/.config/waybar/config.json -s ~/.config/waybar/style.css &
|
||||||
uwsm app -- swayidle -w &
|
systemctl --user enable --now hypridle.service &
|
||||||
uwsm app -- sway-audio-idle-inhibit &
|
|
||||||
uwsm fcitx5 -rd &
|
uwsm fcitx5 -rd &
|
||||||
uwsm app -- fcitx5-remote -r &
|
uwsm app -- fcitx5-remote -r &
|
||||||
uwsm app -- hyprsunset -t 3000k
|
uwsm app -- hyprsunset -t 3000k
|
||||||
|
|
|
||||||
|
|
@ -26,6 +26,13 @@ let
|
||||||
input = import ./hypr/input.nix;
|
input = import ./hypr/input.nix;
|
||||||
plugins = import ./hypr/plugin.nix;
|
plugins = import ./hypr/plugin.nix;
|
||||||
cursorName = "catppuccin-macchiato-lavender-cursors";
|
cursorName = "catppuccin-macchiato-lavender-cursors";
|
||||||
|
|
||||||
|
getCurrentSong = pkgs.writeShellScriptBin "getSong" ''
|
||||||
|
song_info=$(playerctl metadata --format '{{title}} {{artist}}')
|
||||||
|
echo "$song_info"
|
||||||
|
'';
|
||||||
|
|
||||||
|
hyprlockAccent = "lavender";
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
home.packages = with pkgs; [
|
home.packages = with pkgs; [
|
||||||
|
|
@ -81,4 +88,74 @@ in
|
||||||
ipc = "on";
|
ipc = "on";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
programs.hyprlock = {
|
||||||
|
enable = true;
|
||||||
|
importantPrefixes = [
|
||||||
|
"$"
|
||||||
|
"monitor"
|
||||||
|
"size"
|
||||||
|
"source"
|
||||||
|
];
|
||||||
|
|
||||||
|
extraConfig =
|
||||||
|
builtins.readFile ../config/hypr/hyprlock.conf
|
||||||
|
+ ''
|
||||||
|
# CURRENT SONG
|
||||||
|
label {
|
||||||
|
monitor =
|
||||||
|
text = cmd[update:1000] echo "$(${getCurrentSong}/bin/getSong)"
|
||||||
|
color = rgba(235, 219, 178, .75)
|
||||||
|
font_size = 16
|
||||||
|
font_family = $font, $font2
|
||||||
|
position = 0, 80
|
||||||
|
halign = center
|
||||||
|
valign = bottom
|
||||||
|
}
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
|
services.hypridle = {
|
||||||
|
enable = true;
|
||||||
|
settings = {
|
||||||
|
general = {
|
||||||
|
lock_cmd = "pidof hyprlock || hyprlock";
|
||||||
|
before_sleep_cmd = "loginctl lock-session";
|
||||||
|
after_sleep_cmd = "hyprctl dispatch dpms on";
|
||||||
|
ignore_dbus_inhibit = false;
|
||||||
|
ignore_systemd_inhibit = false;
|
||||||
|
};
|
||||||
|
|
||||||
|
listener = [
|
||||||
|
# 2.5min -> set monitor backlight to minimum
|
||||||
|
{
|
||||||
|
timeout = 150;
|
||||||
|
on-timeout = "brightnessctl -s set 10";
|
||||||
|
on-resume = "brightnessctl -r";
|
||||||
|
}
|
||||||
|
# 2.5min -> turn off keyboard backlight
|
||||||
|
{
|
||||||
|
timeout = 150;
|
||||||
|
on-timeout = "brightnessctl -sd rgb:kbd_backlight set 0";
|
||||||
|
on-resume = "brightnessctl -rd rgb:kbd_backlight";
|
||||||
|
}
|
||||||
|
# 5min -> Lock screen
|
||||||
|
{
|
||||||
|
timeout = 300;
|
||||||
|
on-timeout = "loginctl lock-session";
|
||||||
|
}
|
||||||
|
# 5.5min -> Screen off
|
||||||
|
{
|
||||||
|
timeout = 330;
|
||||||
|
on-timeout = "hyprctl dispatch dpms off";
|
||||||
|
on-resume = "hyprctl dispatch dpms on";
|
||||||
|
}
|
||||||
|
# 30min -> Suspend pc
|
||||||
|
# {
|
||||||
|
# timeout = 1800;
|
||||||
|
# on-timeout = "systemctl suspend";
|
||||||
|
# }
|
||||||
|
];
|
||||||
|
};
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
32
pkgs/fonts/sf-pro-display-bold/default.nix
Normal file
32
pkgs/fonts/sf-pro-display-bold/default.nix
Normal file
|
|
@ -0,0 +1,32 @@
|
||||||
|
{
|
||||||
|
stdenvNoCC,
|
||||||
|
lib,
|
||||||
|
fetchurl,
|
||||||
|
}:
|
||||||
|
|
||||||
|
stdenvNoCC.mkDerivation {
|
||||||
|
pname = "sf-pro-display-bold";
|
||||||
|
version = "1.0.0";
|
||||||
|
|
||||||
|
src = fetchurl {
|
||||||
|
url = "https://raw.githubusercontent.com/MartinRGB/MAKA_H5_Album_Project/master/design/font/SF_Pro/SF-Pro-Display-Bold.ttf";
|
||||||
|
sha256 = "sha256-yjCRiRtzDDAnOxbMg8na+Uu0bw+YUmJhbOqBVdURjxQ=";
|
||||||
|
};
|
||||||
|
|
||||||
|
dontUnpack = true;
|
||||||
|
|
||||||
|
installPhase = ''
|
||||||
|
runHook preInstall
|
||||||
|
|
||||||
|
mkdir -p $out/share/fonts/truetype/SF-Pro-Display-Bold
|
||||||
|
install -m444 $src $out/share/fonts/truetype/SF-Pro-Display-Bold/SF-Pro-Display-Bold.ttf
|
||||||
|
|
||||||
|
runHook postInstall
|
||||||
|
'';
|
||||||
|
|
||||||
|
meta = with lib; {
|
||||||
|
description = "SF Pro Display Bold font";
|
||||||
|
homepage = "https://github.com/MartinRGB/MAKA_H5_Album_Project";
|
||||||
|
platforms = platforms.all;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
@ -1,10 +1,17 @@
|
||||||
{ pkgs, nix-version, ... }:
|
{
|
||||||
|
pkgs,
|
||||||
|
lib,
|
||||||
|
nix-version,
|
||||||
|
...
|
||||||
|
}:
|
||||||
let
|
let
|
||||||
nerdfont-pkg =
|
nerdfont-pkg =
|
||||||
if nix-version == "25.05" then
|
if nix-version == "25.05" then
|
||||||
pkgs.nerd-fonts.caskaydia-cove
|
pkgs.nerd-fonts.caskaydia-cove
|
||||||
else
|
else
|
||||||
(pkgs.nerdfonts.override { fonts = [ "CascadiaCode" ]; });
|
(pkgs.nerdfonts.override { fonts = [ "CascadiaCode" ]; });
|
||||||
|
|
||||||
|
sf-pro-display-bold = pkgs.callPackage ../../pkgs/fonts/sf-pro-display-bold { };
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
fonts.packages =
|
fonts.packages =
|
||||||
|
|
@ -14,10 +21,11 @@ in
|
||||||
noto-fonts-cjk-sans
|
noto-fonts-cjk-sans
|
||||||
noto-fonts-cjk-serif
|
noto-fonts-cjk-serif
|
||||||
noto-fonts-emoji
|
noto-fonts-emoji
|
||||||
|
sf-pro-display-bold
|
||||||
])
|
])
|
||||||
++ ([
|
++ [
|
||||||
nerdfont-pkg
|
nerdfont-pkg
|
||||||
]);
|
];
|
||||||
|
|
||||||
fonts.fontDir.enable = true;
|
fonts.fontDir.enable = true;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -36,9 +36,6 @@
|
||||||
|
|
||||||
qt5.qtwayland
|
qt5.qtwayland
|
||||||
qt6.qtwayland
|
qt6.qtwayland
|
||||||
swayidle
|
|
||||||
sway-audio-idle-inhibit # Prevent idle when playing audio
|
|
||||||
swaylock-effects
|
|
||||||
wlogout
|
wlogout
|
||||||
wl-clipboard
|
wl-clipboard
|
||||||
rofi-wayland-unwrapped
|
rofi-wayland-unwrapped
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
{
|
{
|
||||||
services.udev.packages = [ pkgs.yubikey-personalization ];
|
services.udev.packages = [ pkgs.yubikey-personalization ];
|
||||||
|
security.pam.services.hyprlock = { };
|
||||||
security.pam.u2f = {
|
security.pam.u2f = {
|
||||||
enable = true;
|
enable = true;
|
||||||
settings.cue = true;
|
settings.cue = true;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue