Squash merge refactor into main

This commit is contained in:
danny 2025-08-09 22:22:19 +08:00
parent 529c9e5fa7
commit b82cd59f4f
35 changed files with 498 additions and 358 deletions

View file

@ -1,8 +1,9 @@
{
settings,
mainMod,
nvidia-offload-enabled,
pkgs,
rofiWall,
monitors ? [ ],
}:
with builtins;
let
@ -11,9 +12,7 @@ let
browser = "${prefix} ${firefox}";
terminal = "ghostty";
filemanager = "${terminal} -e yazi";
scripts = "~/.config/scripts";
freezeShot = "";
screenshotFolder = "--output-folder ~/Pictures/Screenshots";
clipboardOnly = "${screenshotFolder}";
@ -27,20 +26,9 @@ let
fi
'';
toggleRofi = pkgs.writeShellScriptBin "toggle" ''
GDK_PIXBUF_MODULE_FILE="${pkgs.librsvg}/lib/gdk-pixbuf-2.0/${pkgs.librsvg.version}/loaders.cache" # Make rofi load svg
if ${pkgs.busybox}/bin/pgrep rofi > /dev/null; then
${pkgs.busybox}/bin/pkill rofi
else
rofi "$@"
fi
'';
scrollStep =
let
monitorsNum = length settings.hyprland.monitors;
monitorsNum = length monitors;
in
toString (if (monitorsNum == 0) then 1 else monitorsNum);
in
@ -53,19 +41,20 @@ in
''${mainMod}, M, exec, ${toggleWlogout}/bin/toggle''
''${mainMod}, E, exec, ${filemanager}''
''${mainMod}, V, togglefloating, ''
''ALT, SPACE, exec, ${toggleRofi}/bin/toggle -config ~/.config/rofi/apps.rasi -show drun''
''ALT, SPACE, exec, rofi -config ~/.config/rofi/apps.rasi -show drun''
''${mainMod}, W, exec, ${rofiWall}''
''${mainMod}, P, pseudo, # dwindle''
''${mainMod}, S, togglesplit, # dwindle''
''CTRL ${mainMod} SHIFT, L, exec, hyprlock''
# Screenshot
''${mainMod} SHIFT, s, exec, hyprshot -m region ${clipboardOnly} ${freezeShot}''
''CTRL SHIFT, s, exec, hyprshot -m window ${clipboardOnly} ${freezeShot}''
''CTRL SHIFT ${mainMod}, s, exec, hyprshot -m output ${clipboardOnly} ${freezeShot}''
''CTRL ALT, s, exec, hyprshot -m active -m window ${clipboardOnly} ${freezeShot}''
''${mainMod} SHIFT, s, exec, hyprshot -m region ${clipboardOnly}''
''CTRL SHIFT, s, exec, hyprshot -m window ${clipboardOnly}''
''CTRL SHIFT ${mainMod}, s, exec, hyprshot -m output ${clipboardOnly}''
''CTRL ALT, s, exec, hyprshot -m active -m window ${clipboardOnly}''
''${mainMod}, PERIOD, exec, ${toggleRofi}/bin/toggle -modi emoji -show emoji''
''CTRL ${mainMod}, c, exec, ${toggleRofi}/bin/toggle -show calc -modi calc -no-show-match -no-sort''
''${mainMod}, PERIOD, exec, rofi -modi emoji -show emoji''
''CTRL ${mainMod}, c, exec, rofi -show calc -modi calc -no-show-match -no-sort''
''${mainMod}, X, exec, sleep 0.1 && swaync-client -t -sw''
''${mainMod} SHIFT, C, centerwindow''
'',F11, fullscreen''
@ -102,10 +91,6 @@ in
''${mainMod}, G, workspace, ${toString gamingWorkspace}''
''${mainMod} SHIFT, G, movetoworkspace, ${toString gamingWorkspace}''
# ==== Plugins ==== #
# Overview
# ''${mainMod}, o, hyprtasking:toggle, cursor''
# ''${mainMod}, TAB, hyprtasking:toggle, all''
]
++ (
# workspaces

View file

@ -1,16 +0,0 @@
{ mainMod }:
let
resizeStep = builtins.toString 20;
brightnessStep = builtins.toString 10;
volumeStep = builtins.toString 2;
in
[
'',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}%-''
'',XF86MonBrightnessDown, exec, brightnessctl set ${brightnessStep}%-''
'',XF86MonBrightnessUp, exec, brightnessctl set ${brightnessStep}%+''
''${mainMod} CTRL, l, resizeactive, ${resizeStep} 0''
''${mainMod} CTRL, h, resizeactive, -${resizeStep} 0''
''${mainMod} CTRL, k, resizeactive, 0 -${resizeStep}''
''${mainMod} CTRL, j, resizeactive, 0 ${resizeStep}''
]

View file

@ -1,6 +0,0 @@
{ mainMod }:
[
# Move/resize windows with mainMod + LMB/RMB and dragging
''${mainMod}, mouse:272, movewindow''
''${mainMod}, mouse:273, resizewindow''
]

View file

@ -1,17 +0,0 @@
{
pkgs,
terminal,
xcursor-size,
...
}:
let
startupScript = pkgs.writeShellScriptBin "start" ''
# Fix nemo open in terminal
dconf write /org/cinnamon/desktop/applications/terminal/exec "''\'${terminal}''\'" &
dconf write /org/cinnamon/desktop/applications/terminal/exec-arg "''\'''\'" &
dconf write /org/gnome/desktop/interface/cursor-size ${builtins.toString xcursor-size} &
systemctl --user import-environment WAYLAND_DISPLAY XDG_CURRENT_DESKTOP QT_QPA_PLATFORMTHEME &
'';
in
''${startupScript}/bin/start''

View file

@ -9,7 +9,7 @@
follow_mouse = 1;
accel_profile = "flat";
kb_options = [ "caps:swapescape" ];
kb_options = [ "caps:escape" ];
touchpad = {
natural_scroll = true;

View file

@ -1,5 +0,0 @@
[
''desc:ASUSTek COMPUTER INC ASUS VG32VQ1B 0x00002271, 2560x1440@165, 0x0, 1''
''desc:Acer Technologies XV272U V3 1322131231233, 2560x1440@180, -1440x-600, 1, transform, 1''
''desc:LG Display 0x0665, preferred, 0x0, 1.25''
]

View file

@ -1,35 +0,0 @@
{
# hyprtasking = {
# layout = "grid";
# bg_color = "0xffebdbb2";
#
# gap_size = 20;
#
# gestures = {
# enabled = true;
# open_fingers = 3;
# open_distance = 300;
# open_positive = true;
# };
#
# linear = {
# height = 400;
# scroll_speed = 1.1;
# blur = 0;
# };
# };
hyprwinrap = {
class = "kitty-bg";
};
touch_gestures = {
sensitivity = 4.0;
workspace_swipe_fingers = 3;
workspace_swipe_edge = "d";
long_press_delay = 400;
resize_on_border_long_press = true;
edge_margin = 10;
emulate_touchpad_swipe = false;
};
}

View file

@ -1,7 +1,3 @@
{ lib, settings }:
let
inherit (lib) optionalString;
in
{
windowrule = [
"pseudo, class:fcitx"
@ -42,38 +38,21 @@ in
"float, class: ^(org.pulseaudio.pavucontrol)$"
"pin, class: ^(org.pulseaudio.pavucontrol)$"
"animation slide top 20%, class: ^(org.pulseaudio.pavucontrol)$"
(optionalString (
settings.personal.hostname == "dn-pre7780"
) "move 1680 59, class: ^(org.pulseaudio.pavucontrol)$")
(optionalString (
settings.personal.hostname == "dn-pre7780"
) "size 868 561, class: ^(org.pulseaudio.pavucontrol)$")
# Local Send (File Sharing)
"float, class: ^(localsend_app)$"
"pin, class: ^(localsend_app)$"
"animation slide right 20%, class: ^(localsend_app)$"
(optionalString (
settings.personal.hostname == "dn-pre7780"
) "size 523 1372, class: ^(localsend_app)$")
(optionalString (
settings.personal.hostname == "dn-pre7780"
) "move 2024 56, class: ^(localsend_app)$")
# Airplay
"pseudo, class: ^(GStreamer)$"
"pin, class: ^(GStreamer)$"
"float, class: ^(GStreamer)$"
"opacity 1.0, class: ^(GStreamer)$"
(optionalString (settings.personal.hostname == "dn-pre7780") "size 487 1055, class: ^(GStreamer)$")
"animation slide right 20%, class: ^(GStreamer)$"
# Bluetooth
"float, class: ^(blueberry.py)$"
"pin, class: ^(blueberry.py)$"
(optionalString (
settings.personal.hostname == "dn-pre7780"
) "move 1943 59, class: ^(blueberry.py)$")
(optionalString (
settings.personal.hostname == "dn-pre7780"
) "size 605 763, class: ^(blueberry.py)$")
"animation slide top 20%, class: ^(blueberry.py)$"
# Steam
@ -90,8 +69,11 @@ in
# VLC
"workspace: 3, initialClass: ^(vlc), floating: 0"
# vesktop
"workspace: 4 silent, initialClass: ^(vesktop), floating: 0"
# discord
"workspace: 4 silent, initialClass: ^(discord), floating: 0"
# Davinci resolve
"center 1, initialClass: ^(resolve), floating: 1"
];
layerrule = [

View file

@ -1,14 +1,20 @@
{ monitors }:
let
monitorNum = builtins.length monitors;
inherit (builtins)
length
genList
toString
elemAt
;
monitorNum = length monitors;
workspaceNum = 10;
workspaceList = builtins.genList (
workspaceList = genList (
index:
let
currentNum = index - (monitorNum * (index / monitorNum));
default = if index < monitorNum then "true" else "false";
in
"${builtins.toString (index + 1)}, monitor:${builtins.elemAt monitors currentNum}, default:${default}"
"${toString (index + 1)}, monitor:${elemAt monitors currentNum}, default:${default}"
) workspaceNum;
in
if (monitorNum > 0) then workspaceList else [ ]