{ pkgs, lib, config, userName, ... }: let cfg = config.home-manager.users.${userName}; in { monitor = [ ",preferred,auto,auto" "eDP-1,3840x2160@60,auto,1.5" ]; "$terminal" = "kitty"; "$menu" = "fuzzel"; exec-once = [ "wpaperd" ]; env = [ "NIXOS_OZONE_WL,1" "QT_QPA_PLATFORM,wayland" "GDK_BACKEND,wayland" "GDK_SCALE,0.66" "QT_AUTO_SCREEN_SCALE_FACTOR,1" # "AQ_DRM_DEVICES,/dev/dri/by-path/pci-0000:01:00.0-card" ]; xwayland.force_zero_scaling = true; general = { gaps_in = 3; gaps_out = 9; "col.active_border" = "rgba(33ccffee) rgba(00ff95ee) 45deg"; "col.inactive_border" = "rgba(595959aa)"; resize_on_border = false; allow_tearing = false; layout = "dwindle"; }; decoration = { rounding = 5; active_opacity = 1.0; inactive_opacity = 1.0; drop_shadow = false; shadow_range = 4; shadow_render_power = 3; "col.shadow" = "rgba(1a1a1aee)"; blur = { enabled = true; size = 3; passes = 1; vibrancy = 0.1696; # special = true; # popups = true; }; }; animations = { enabled = true; bezier = "myBezier, 0.05, 0.9, 0.1, 1.05"; animation = [ "windows, 1, 1, default, popin 80%" "windowsMove, 0" # "windows, 1, 7, myBezier" # "windowsOut, 1, 7, myBezier, popin 80%" "border, 1, 10, default" "borderangle, 1, 8, default" "fade, 1, 1, default" "workspaces, 1, 1, default, fade" # "workspaces, 1, 6, default" ]; }; dwindle = { pseudotile = false; preserve_split = true; }; master = { new_status = "master"; }; misc = { force_default_wallpaper = -1; disable_hyprland_logo = false; }; input = { kb_layout = "us,us"; kb_variant = "dvp,"; kb_model = ""; kb_options = "compose:caps,grp:win_space_toggle"; kb_rules = ""; follow_mouse = 1; sensitivity = 0; touchpad = { natural_scroll = false; }; }; device = [ { name = "synaptics-tm3512-010"; sensitivity = 0.4; } { name = "tpps/2-elan-trackpoint"; sensitivity = 0.2; } ]; gestures = { workspace_swipe = false; }; dwindle = { # no_gaps_when_only = 1; }; "$mainMod" = "SUPER"; bind = [ "$mainMod, return, exec, $terminal" "$mainMod, Q, killactive" "$mainMod, V, togglefloating" "$mainMod, D, exec, $menu" "$mainMod SHIFT, D, exec, $menu --list-executables-in-path" # "$mainMod, J, togglesplit," "$mainMod SHIFT, L, exec, loginctl lock-session" "$mainMod SHIFT, S, exec, systemctl suspend" "$mainMod SHIFT, E, exit" "$mainMod, left, movefocus, l" "$mainMod, right, movefocus, r" "$mainMod, up, movefocus, u" "$mainMod, down, movefocus, d" "$mainMod SHIFT, left, swapwindow, l" "$mainMod SHIFT, right, swapwindow, r" "$mainMod SHIFT, up, swapwindow, u" "$mainMod SHIFT, down, swapwindow, d" "$mainMod, T, cyclenext" "$mainMod, G, focusmonitor, 0" "$mainMod, C, focusmonitor, 1" "$mainMod, R, focusmonitor, 2" "$mainMod, L, focusmonitor, 3" "$mainMod CTRL, G, movecurrentworkspacetomonitor, 0" "$mainMod CTRL, C, movecurrentworkspacetomonitor, 1" "$mainMod CTRL, R, movecurrentworkspacetomonitor, 2" "$mainMod CTRL, L, movecurrentworkspacetomonitor, 3" "$mainMod, F, fullscreen, 1" "$mainMod SHIFT, F, fullscreen, 0" "$mainMod, code:14, workspace, 1" "$mainMod, code:17, workspace, 2" "$mainMod, code:13, workspace, 3" "$mainMod, code:18, workspace, 4" "$mainMod, code:12, workspace, 5" "$mainMod, code:19, workspace, 6" "$mainMod, code:11, workspace, 7" "$mainMod, code:20, workspace, 8" "$mainMod, code:15, workspace, 9" "$mainMod, code:16, workspace, 10" "$mainMod SHIFT, code:14, movetoworkspacesilent, 1" "$mainMod SHIFT, code:17, movetoworkspacesilent, 2" "$mainMod SHIFT, code:13, movetoworkspacesilent, 3" "$mainMod SHIFT, code:18, movetoworkspacesilent, 4" "$mainMod SHIFT, code:12, movetoworkspacesilent, 5" "$mainMod SHIFT, code:19, movetoworkspacesilent, 6" "$mainMod SHIFT, code:11, movetoworkspacesilent, 7" "$mainMod SHIFT, code:20, movetoworkspacesilent, 8" "$mainMod SHIFT, code:15, movetoworkspacesilent, 9" "$mainMod SHIFT, code:16, movetoworkspacesilent, 10" "CTRL, space, exec, dunstctl close" "CTRL SHIFT, space, exec, dunstctl close-all" "CTRL, period, exec, dunstctl context" "CTRL, comma, exec, dunstctl history-pop" "$mainMod ALT, E, exec, emacsclient -c" ", XF86MonBrightnessUp, exec, lightctl -d up" ", XF86MonBrightnessDown, exec, lightctl -d down" ", XF86AudioRaiseVolume, exec, volumectl -d -u up" ", XF86AudioLowerVolume, exec, volumectl -d -u down" ", XF86AudioMute, exec, volumectl -d toggle-mute" ", XF86AudioMicMute, exec, volumectl -d -m toggle-mute" ", Print, exec, ${pkgs.writeShellScript "screenshot" '' export PATH="${lib.makeBinPath (with pkgs; [ grim slurp wl-clipboard-rs coreutils ])}:$PATH" outFile="$HOME/screenshots/$(date +"%Y-%m-%dT%H:%M:%S").png" grim -g "$(slurp -b 00000080 -c FFFFFFFF -s 00000000 -w 1)" "$outFile" wl-copy --type image/png <"$outFile" ''}" "SHIFT, Print, exec, ${pkgs.writeShellScript "screenshot" '' export PATH="${lib.makeBinPath (with pkgs; [ grim jq wl-clipboard-rs coreutils ])}:$PATH" outFile="$HOME/screenshots/$(date +"%Y-%m-%dT%H:%M:%S").png" grim -o "$(hyprctl monitors -j | jq -r '.[] | select(.focused) | .name')" "$outFile" wl-copy --type image/png <"$outFile" ''}" "CTRL SHIFT, Print, exec, ${pkgs.runCommand "picker" { buildInputs = [ pkgs.makeWrapper ]; } '' makeWrapper ${lib.getExe pkgs.hyprpicker} $out \ --prefix PATH : ${lib.makeBinPath [pkgs.wl-clipboard-rs]} ''} -a" "$mainMod, M, exec, ${pkgs.writeShellScript "qalc-fuzzel" '' export PATH="${lib.makeBinPath (with pkgs; [ wl-clipboard-rs libqalculate cfg.programs.fuzzel.package coreutils findutils libnotify gnugrep ])}:$PATH" RESULTS_DIR="$HOME/.cache/qalc-fuzzel" prev() { FOUND=false while IFS= read -r line; do [[ -n "$line" ]] || continue FOUND=true echo $line done < <(export LC_ALL=C.UTF-8; echo; find "$RESULTS_DIR" -type f -printf $'%T@ %p\n' | sort -n | cut -d' ' -f2- | xargs -r cat) $FOUND || echo } FUZZEL_RES=$(prev | fuzzel --dmenu --prompt "qalc> ") || exit $? if [[ "$FUZZEL_RES" =~ .*\ =\ .* ]]; then QALC_RES="$FUZZEL_RES" QALC_RET=0 else QALC_RES=$(qalc "$FUZZEL_RES" 2>&1) QALC_RET=$? fi [[ -n "$QALC_RES" ]] || exit 1 EXISTING=false fgrep -xrl "$QALC_RES" "$RESULTS_DIR" | xargs -r touch [[ ''${PIPESTATUS[0]} -eq 0 ]] && EXISTING=true if [[ $QALC_RET -eq 0 ]] && ! $EXISTING; then RES_FILE="$RESULTS_DIR"/$(date -uIs).$(tr -Cd 'a-zA-Z0-9' "$RES_FILE" <<<"$QALC_RES" fi [[ "$QALC_RES" =~ .*\ =\ (.*) ]] && QALC_RES="''${BASH_REMATCH[1]}" [[ $QALC_RET -eq 0 ]] && wl-copy "$QALC_RES" notify-send "$QALC_RES" ''}" "$mainMod, E, exec, ${pkgs.writeShellScript "emoji-fuzzel" '' export PATH="${lib.makeBinPath (with pkgs; [ cfg.programs.fuzzel.package wtype wl-clipboard-rs ])}:$PATH" FUZZEL_RES=$(fuzzel --dmenu --prompt "emoji> " <$HOME/.local/share/emoji-data/list.txt) || exit $? [[ -n "$FUZZEL_RES" ]] || exit 1 wl-copy "$(cut -d ':' -f 1 <<<"$FUZZEL_RES" | tr -d '\n')" && wtype -k XF86Paste ''}" "$mainMod CTRL, return, togglespecialworkspace, term" "$mainMod CTRL, e, togglespecialworkspace, edit" "$mainMod CTRL, a, togglespecialworkspace, pavucontrol" "$mainMod CTRL, o, togglespecialworkspace, easyeffects" "$mainMod CTRL, b, togglespecialworkspace, blueman" "$mainMod CTRL, p, togglespecialworkspace, keepass" ]; bindm = [ "$mainMod, mouse:272, movewindow" "$mainMod, mouse:273, resizewindow" ]; bindl = [ ", switch:off:Lid Switch,exec,hyprctl dispatch dpms on eDP-1" ", switch:on:Lid Switch,exec,hyprctl dispatch dpms off eDP-1" ", switch:off:Lid Switch,exec,${pkgs.writeShellScript "clamshell-off" '' export PATH="${lib.makeBinPath (with pkgs; [ jq ])}:$PATH" [[ $(hyprctl monitors -j | jq '.[] | select(.name == "eDP-1") | .disabled') = "true" ]] || exit 0 hyprctl keyword monitor "eDP-1,3840x2160@60,auto,1.5" ''}" ", switch:on:Lid Switch,exec,${pkgs.writeShellScript "clamshell-on" '' export PATH="${lib.makeBinPath (with pkgs; [ jq ])}:$PATH" [[ $(hyprctl monitors -j | jq 'reduce (.[] | select(.disabled == false)) as $_ (0; .+1)') -gt 1 ]] || exit 0 hyprctl keyword monitor "eDP-1,disable" ''}" ]; windowrulev2 = [ "suppressevent maximize fullscreen, class:.*" # "maximize, class:^(Element|thunderbird)$" "workspace special:pavucontrol, class:^org\.pulseaudio\.pavucontrol$" "workspace special:easyeffects, class:^com\.github\.wwmm\.easyeffects$" "workspace special:blueman, class:^\.blueman-manager-wrapped$" "workspace special:keepass silent, class:^org\.keepassxc\.KeePassXC$, title:^(?!Unlock Database.*)(?!.*Access Request)" # "group set always lock invade, class:^Element$" "workspace 2, class:^firefox$" "workspace 4, class:^evince$" "workspace 4, class:^imv$" "workspace 4, class:^org\.pwmt\.zathura$" "workspace 10, class:^mpv$" "float, class:^org\.keepassxc\.KeePassXC$, title:Access Request$" "center, class:^org\.keepassxc\.KeePassXC$, title:Access Request$" "float, class:^org\.keepassxc\.KeePassXC$, title:^Unlock Database" "center, class:^org\.keepassxc\.KeePassXC$, title:^Unlock Database" "float, class:^xdg-desktop-portal-gtk$" "center, class:^xdg-desktop-portal-gtk$" "bordercolor rgba(ffaa33ee) rgba(bfff00ee) 45deg, fullscreen:1" "bordercolor rgba(3366ffee) rgba(6a00ffee) 45deg, xwayland:1" "bordercolor rgba(6633ffee) rgba(ea00ffee) 45deg, xwayland:1, fullscreen:1" ]; workspace = [ "s[true], gapsout:100" "special:term, on-created-empty:kitty" "special:edit, on-created-empty:emacsclient -c" "special:pavucontrol, on-created-empty:pavucontrol" "special:easyeffects, on-created-empty:easyeffects" "special:blueman, on-created-empty:blueman-manager" "special:keepass, on-created-empty:keepassxc" "1, defaultName:comm" "2, defaultName:web" "3, defaultName:work" "4, defaultName:read" ]; layerrule = [ "blur, waybar" "blur, launcher" ]; }