nixos/home/modules/wm/mango/default.nix
2026-03-14 12:53:43 +01:00

219 lines
6.6 KiB
Nix

{pkgs, ...}: let
wallpaperScript = pkgs.writeShellScriptBin "random-wallpaper" ''
pkill -f swaybg 2>/dev/null || true
walp=$(find "$HOME/wallpapers" -type f \( -iname "*.jpg" -o -iname "*.png" \) | shuf -n 1)
[ -n "$walp" ] && ${pkgs.swaybg}/bin/swaybg -m "fill" -i "$walp" &
'';
in {
home.packages = [wallpaperScript];
wayland.windowManager.mango = {
enable = true;
autostart_sh = ''
dbus-update-activation-environment --systemd WAYLAND_DISPLAY XDG_CURRENT_DESKTOP
systemctl --user start pipewire
systemctl --user start xdg-desktop-portal
${wallpaperScript}/bin/random-wallpaper &
'';
settings = ''
blur=0
blur_layer=0
blur_optimized=1
blur_params_num_passes=2
blur_params_radius=5
blur_params_noise=0.02
blur_params_brightness=0.9
blur_params_contrast=0.9
blur_params_saturation=1.2
shadows=0
layer_shadows=0
shadow_only_floating=1
shadows_size=10
shadows_blur=15
shadows_position_x=0
shadows_position_y=0
shadowscolor=0x000000ff
border_radius=0
no_radius_when_single=0
focused_opacity=1.0
unfocused_opacity=0.99
animations=1
layer_animations=1
animation_type_open=slide
animation_type_close=slide
animation_fade_in=1
animation_fade_out=1
tag_animation_direction=1
zoom_initial_ratio=0.3
zoom_end_ratio=0.8
fadein_begin_opacity=0.5
fadeout_begin_opacity=0.8
animation_duration_move=500
animation_duration_open=400
animation_duration_tag=350
animation_duration_close=800
animation_duration_focus=0
animation_curve_open=0.46,1.0,0.29,1
animation_curve_move=0.46,1.0,0.29,1
animation_curve_tag=0.46,1.0,0.29,1
animation_curve_close=0.08,0.92,0,1
animation_curve_focus=0.46,1.0,0.29,1
animation_curve_opafadeout=0.5,0.5,0.5,0.5
animation_curve_opafadein=0.46,1.0,0.29,1
scroller_structs=0
scroller_default_proportion=0.5
scroller_focus_center=0
scroller_prefer_center=0
edge_scroller_pointer_focus=1
scroller_default_proportion_single=1.0
scroller_proportion_preset=0.5,0.8,1.0
new_is_master=1
default_mfact=0.55
default_nmaster=1
smartgaps=0
enable_hotarea=0
ov_tab_mode=0
overviewgappi=5
overviewgappo=30
no_border_when_single=0
axis_bind_apply_timeout=100
focus_on_activate=1
idleinhibit_ignore_visible=0
sloppyfocus=1
warpcursor=1
focus_cross_monitor=0
focus_cross_tag=0
enable_floating_snap=0
snap_distance=30
drag_tile_to_tile=1
repeat_rate=25
repeat_delay=600
numlockon=1
xkb_rules_layout=es,ru
xkb_rules_options=grp:alt_space_toggle
disable_trackpad=0
tap_to_click=1
tap_and_drag=1
drag_lock=1
trackpad_natural_scrolling=0
disable_while_typing=1
left_handed=0
middle_button_emulation=0
swipe_min_threshold=1
mouse_natural_scrolling=0
gappih=3
gappiv=3
gappoh=3
gappov=3
borderpx=0
cursor_size=24
rootcolor=0x000000ff
bordercolor=0x2a2a2aff
focuscolor=0x3a3a3aff
urgentcolor=0x5a5a5aff
tagrule=id:1,layout_name:deck
tagrule=id:2,layout_name:scroller
tagrule=id:3,layout_name:scroller
tagrule=id:4,layout_name:scroller
tagrule=id:5,layout_name:scroller
tagrule=id:6,layout_name:scroller
tagrule=id:7,layout_name:scroller
tagrule=id:8,layout_name:scroller
tagrule=id:9,layout_name:scroller
bind=SUPER,space,spawn,sh -c "WAYLAND_DISPLAY=$WAYLAND_DISPLAY bemenu-run"
bind=SUPER,t,spawn,foot
bind=SUPER,z,spawn,firefox
bind=SUPER,r,spawn,st
bind=SUPER,w,spawn,${wallpaperScript}/bin/random-wallpaper
bind=SUPER+SHIFT,Print,spawn,~/bin/sss screen
bind=SUPER,Print,spawn,~/bin/sss area
bind=SUPER,q,killclient,
bind=ALT,backslash,togglefloating,
bind=SUPER,s,toggle_scratchpad
bind=SUPER,Tab,focusstack,next
bind=SUPER,Left,focusdir,left
bind=SUPER,Right,focusdir,right
bind=SUPER,Up,focusdir,up
bind=SUPER,Down,focusdir,down
bind=CTRL+ALT,Left,resizewin,-50,+0
bind=CTRL+ALT,Right,resizewin,+50,+0
bind=CTRL+ALT,Up,resizewin,+0,-50
bind=CTRL+ALT,Down,resizewin,+0,+50
bind=CTRL+SHIFT,Left,movewin,-50,+0
bind=CTRL+SHIFT,Right,movewin,+50,+0
bind=CTRL+SHIFT,Up,movewin,+0,-50
bind=CTRL+SHIFT,Down,movewin,+0,+50
bind=SUPER,1,view,1,0
bind=SUPER,2,view,2,0
bind=SUPER,3,view,3,0
bind=SUPER,4,view,4,0
bind=SUPER,5,view,5,0
bind=SUPER,6,view,6,0
bind=SUPER,7,view,7,0
bind=SUPER,8,view,8,0
bind=SUPER,9,view,9,0
bind=SUPER,0,view,10,0
bind=SUPER+SHIFT,1,tag,1,0
bind=SUPER+SHIFT,2,tag,2,0
bind=SUPER+SHIFT,3,tag,3,0
bind=SUPER+SHIFT,4,tag,4,0
bind=SUPER+SHIFT,5,tag,5,0
bind=SUPER+SHIFT,6,tag,6,0
bind=SUPER+SHIFT,7,tag,7,0
bind=SUPER+SHIFT,8,tag,8,0
bind=SUPER+SHIFT,9,tag,9,0
bind=SUPER+SHIFT,0,tag,10,0
bind=ALT+SHIFT,Left,focusmon,left
bind=ALT+SHIFT,Right,focusmon,right
bind=SUPER+ALT,Left,tagmon,left
bind=SUPER+ALT,Right,tagmon,right
bind=ALT+SHIFT,X,incgaps,1
bind=ALT+SHIFT,Z,incgaps,-1
bind=ALT+SHIFT,R,togglegaps
mousebind=SUPER,btn_left,moveresize,curmove
mousebind=SUPER,btn_right,moveresize,curresize
mousebind=NONE,btn_left,toggleoverview,1
axisbind=SUPER,UP,viewtoleft_have_client
axisbind=SUPER,DOWN,viewtoright_have_client
cursor_size=24
cursor_theme=macOS
exec=${wallpaperScript}/bin/random-wallpaper
exec-once=~/.config/mango/autostart.sh
'';
};
home.sessionVariables = {
XCURSOR_THEME = "macOS";
XCURSOR_SIZE = "24";
XDG_CURRENT_DESKTOP = "mango";
BEMENU_BACKEND = "wayland";
};
}