diff --git a/.config/mango/config.conf b/.config/mango/config.conf new file mode 100644 index 0000000..645716c --- /dev/null +++ b/.config/mango/config.conf @@ -0,0 +1,425 @@ +# mango (0.12.9) configuration +# Keybindings mirror the user's river (~/.config/river/init) and dwm +# (~/git/dwm/config.h) setups: MOD1 (Alt) as primary modifier, dwm-style +# tag handling, river-style window movement. +# +# Reference: https://github.com/mangowm/mango/wiki + +# ============================================================================ +# Window effects (scenefx) +# ============================================================================ +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=1.0 + +# ============================================================================ +# Animations +# ============================================================================ +animations=1 +layer_animations=0 +animation_type_open=zoom +animation_type_close=slide +layer_animation_type_open=slide +layer_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=200 +animation_duration_open=100 +animation_duration_tag=0 +animation_duration_close=200 +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 + +# ============================================================================ +# Layouts +# ============================================================================ +# Scroller +scroller_structs=20 +scroller_default_proportion=0.8 +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 + +# Master-Stack (matches river filtile main-ratio 55, main-location left) +new_is_master=1 +default_mfact=0.55 +default_nmaster=1 +smartgaps=1 + +# ============================================================================ +# Overview +# ============================================================================ +hotarea_size=10 +enable_hotarea=1 +hotarea_corner=0 +ov_tab_mode=0 +overviewgappi=5 +overviewgappo=30 + +# ============================================================================ +# Misc behaviour +# ============================================================================ +no_border_when_single=1 +axis_bind_apply_timeout=100 +focus_on_activate=1 +idleinhibit_ignore_visible=0 +sloppyfocus=1 +warpcursor=0 +focus_cross_monitor=0 +focus_cross_tag=0 +enable_floating_snap=0 +snap_distance=30 +cursor_size=24 +drag_tile_to_tile=1 + +# ============================================================================ +# Keyboard (matches river: set-repeat 30 200, layout us,cz(qwerty)) +# ============================================================================ +repeat_rate=30 +repeat_delay=200 +numlockon=0 +xkb_rules_layout=us,cz(qwerty) +xkb_rules_options=grp:win_space_toggle + +# ============================================================================ +# Trackpad +# ============================================================================ +disable_trackpad=1 +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 +# ============================================================================ +mouse_natural_scrolling=0 + +# ============================================================================ +# Appearance / colors (mostly preserved from previous config) +# ============================================================================ +gappih=5 +gappiv=5 +gappoh=10 +gappov=10 +scratchpad_width_ratio=0.8 +scratchpad_height_ratio=0.9 +borderpx=1 +rootcolor=0x1D1F21ff +bordercolor=0x586e75ff +focuscolor=0x93a1a1ff +maximizescreencolor=0x89aa61ff +urgentcolor=0xad401fff +scratchpadcolor=0x516c93ff +globalcolor=0xb153a7ff +overlaycolor=0x14a57cff + +# ============================================================================ +# Per-tag layout (default tile, matches dwm and river filtile) +# Layouts available: tile, scroller, grid, deck, monocle, center_tile, +# vertical_tile, vertical_scroller, dwindle +# ============================================================================ +tagrule=id:1,layout_name:tile +tagrule=id:2,layout_name:tile +tagrule=id:3,layout_name:tile +tagrule=id:4,layout_name:tile +tagrule=id:5,layout_name:tile +tagrule=id:6,layout_name:tile +tagrule=id:7,layout_name:tile +tagrule=id:8,layout_name:tile +tagrule=id:9,layout_name:tile + +# ============================================================================ +# Window rules (mirrors river rule-add and dwm rules) +# ============================================================================ +# Floating apps (from dwm config) +windowrule=isfloating:1,appid:Arandr +windowrule=isfloating:1,appid:Pavucontrol +windowrule=isfloating:1,appid:mpv + +# River rules +windowrule=isfloating:1,appid:float.* +windowrule=isfloating:1,title:yazi +windowrule=isfloating:1,title:river + +# ============================================================================ +# Key Bindings +# +# Modifier convention follows river/dwm: MOD = ALT (Mod1) +# Format: bind=MODIFIERS,KEY,COMMAND,PARAMETERS +# Flags: bindl = works while screen locked +# ============================================================================ + +# --- Compositor control -------------------------------------------------- +bind=SUPER,r,reload_config +# river: Mod1+Shift E exit +bind=ALT+SHIFT,e,quit +# river/dwm: Mod1+Shift C close +bind=ALT+SHIFT,c,killclient + +# --- Launchers ----------------------------------------------------------- +# river/dwm: Mod1 p (menu) +#bind=ALT,p,spawn,fuzzel +bind=ALT,p,spawn,wmenu-run -F -il 16 -f 'LiterationMono Nerd Font 12' -n bbbbbbff -N 222222ff -s eeeeeeff -S 444444ff -m eeeeeeff -M 444444ff + +# river/dwm: Mod1+Shift Return +bind=ALT+SHIFT,Return,spawn,foot + +# Yazi file manager in floating foot (river: Mod1 r) +#bind=ALT,r,spawn,foot -T yazi -W 150x50 -e yazi +bind=ALT,r,spawn,foot -T yazi -W 150x50 -e ranger + +# --- Focus --------------------------------------------------------------- +# river: Mod1 J/K focus-view next/previous (dwm: focusstack +1/-1) +bind=ALT,j,focusstack,next +bind=ALT,k,focusstack,prev + +# Direction-based focus (mango bonus, useful complement) +bind=ALT,Left,focusdir,left +bind=ALT,Right,focusdir,right +bind=ALT,Up,focusdir,up +bind=ALT,Down,focusdir,down + +# --- Swap / move in stack ------------------------------------------------ +# river: Mod1+Shift J/K swap next/previous (dwm: movestack) +bind=ALT+SHIFT,j,exchange_stack_client,next +bind=ALT+SHIFT,k,exchange_stack_client,prev + +# Direction-based swap +bind=ALT+SHIFT,Left,exchange_client,left +bind=ALT+SHIFT,Right,exchange_client,right +bind=ALT+SHIFT,Up,exchange_client,up +bind=ALT+SHIFT,Down,exchange_client,down + +# --- Master / layout tweaks (river filtile ↔ dwm) ------------------------ +# river: Mod1 H/L send-layout-cmd filtile main-ratio -/+5 +# dwm: MOD1 H/L setmfact -/+0.05 +bind=ALT,h,setmfact,-0.05 +bind=ALT,l,setmfact,+0.05 + +# river: Mod1 I/D main-count +/-1 dwm: incnmaster +/-1 +bind=ALT,i,incnmaster,+1 +bind=ALT,d,incnmaster,-1 + +# river: Mod1 Return zoom (bump to top of stack) +bind=ALT,Return,zoom + +# river: Mod1 Tab focus-previous-tags dwm: MOD1 Tab view (last tags) +bind=ALT,Tab,view,-1 + +# --- Layout switching (dwm: t=tile, m=monocle; river: M=monocle) --------- +bind=ALT,t,setlayout,tile +bind=ALT,m,setlayout,monocle +# dwm: MOD1 Space cycles layout +bind=ALT,space,switch_layout + +# --- Float / fullscreen -------------------------------------------------- +# river: Mod1+Shift Space toggle-float dwm: MOD1+Shift Space togglefloating +bind=ALT+SHIFT,space,togglefloating +# river: Mod1 F toggle-fullscreen dwm: MOD1 F (was floating layout) +bind=ALT,f,togglefullscreen +bind=ALT+SHIFT,f,togglefakefullscreen + +# --- Tags 1-9 (river/dwm identical scheme) ------------------------------- +# Mod1+N : view tag N +# Mod1+Shift+N : send window to tag N +# Mod1+Ctrl+N : toggle view of tag N +# Mod1+Ctrl+Shift+N : toggle tag N on focused window +bind=ALT,1,view,1 +bind=ALT,2,view,2 +bind=ALT,3,view,3 +bind=ALT,4,view,4 +bind=ALT,5,view,5 +bind=ALT,6,view,6 +bind=ALT,7,view,7 +bind=ALT,8,view,8 +bind=ALT,9,view,9 + +bind=ALT+SHIFT,1,tag,1 +bind=ALT+SHIFT,2,tag,2 +bind=ALT+SHIFT,3,tag,3 +bind=ALT+SHIFT,4,tag,4 +bind=ALT+SHIFT,5,tag,5 +bind=ALT+SHIFT,6,tag,6 +bind=ALT+SHIFT,7,tag,7 +bind=ALT+SHIFT,8,tag,8 +bind=ALT+SHIFT,9,tag,9 + +bind=ALT+CTRL,1,toggleview,1 +bind=ALT+CTRL,2,toggleview,2 +bind=ALT+CTRL,3,toggleview,3 +bind=ALT+CTRL,4,toggleview,4 +bind=ALT+CTRL,5,toggleview,5 +bind=ALT+CTRL,6,toggleview,6 +bind=ALT+CTRL,7,toggleview,7 +bind=ALT+CTRL,8,toggleview,8 +bind=ALT+CTRL,9,toggleview,9 + +bind=ALT+CTRL+SHIFT,1,toggletag,1 +bind=ALT+CTRL+SHIFT,2,toggletag,2 +bind=ALT+CTRL+SHIFT,3,toggletag,3 +bind=ALT+CTRL+SHIFT,4,toggletag,4 +bind=ALT+CTRL+SHIFT,5,toggletag,5 +bind=ALT+CTRL+SHIFT,6,toggletag,6 +bind=ALT+CTRL+SHIFT,7,toggletag,7 +bind=ALT+CTRL+SHIFT,8,toggletag,8 +bind=ALT+CTRL+SHIFT,9,toggletag,9 + +# All tags (river/dwm: 0) +bind=ALT,0,view,0 +bind=ALT+SHIFT,0,toggletag,0 + +# --- Monitor focus / move (river: Period/Comma; dwm: same) --------------- +bind=ALT,period,focusmon,right +bind=ALT,comma,focusmon,left +bind=ALT+SHIFT,period,tagmon,right +bind=ALT+SHIFT,comma,tagmon,left + +# --- Overview (mango bonus) ---------------------------------------------- +bind=SUPER,Tab,toggleoverview + +# --- Scratchpad ---------------------------------------------------------- +bind=ALT,z,toggle_scratchpad +bind=SUPER,i,minimized +bind=SUPER+SHIFT,i,restore_minimized + +# --- Window state extras ------------------------------------------------- +bind=SUPER,g,toggleglobal +bind=SUPER,o,toggleoverlay +bind=ALT,a,togglemaximizescreen + +# --- Gaps ---------------------------------------------------------------- +bind=ALT+SHIFT,x,incgaps,1 +bind=ALT+SHIFT,z,incgaps,-1 +bind=ALT+SHIFT,r,togglegaps + +# --- Move / resize floating windows (river-style snap & arrow nudge) ----- +# river: Mod1+Super H/J/K/L move 100 here: ctrl+shift arrows nudge 50 +bind=CTRL+SHIFT,Up,movewin,+0,-50 +bind=CTRL+SHIFT,Down,movewin,+0,+50 +bind=CTRL+SHIFT,Left,movewin,-50,+0 +bind=CTRL+SHIFT,Right,movewin,+50,+0 + +# river: Mod1+Super+Shift H/J/K/L resize +bind=CTRL+ALT,Up,resizewin,+0,-50 +bind=CTRL+ALT,Down,resizewin,+0,+50 +bind=CTRL+ALT,Left,resizewin,-50,+0 +bind=CTRL+ALT,Right,resizewin,+50,+0 + +# --- Lock screen (river: Mod1+Shift L spawn waylock) --------------------- +# Wrapper script: locks immediately, then runs a 10 s idle blanker while +# locked (kanshi paused during blank to avoid Lenovo dock profile flip). +bindl=ALT+SHIFT,l,spawn,~/.config/mango/scripts/lock.sh + +# --- Media keys (work in any mode) --------------------------------------- +bindl=NONE,XF86AudioRaiseVolume,spawn,pamixer -i 5 +bindl=NONE,XF86AudioLowerVolume,spawn,pamixer -d 5 +bindl=NONE,XF86AudioMute,spawn,pamixer --toggle-mute +bindl=NONE,XF86AudioPlay,spawn,playerctl play-pause +bindl=NONE,XF86AudioPrev,spawn,playerctl previous +bindl=NONE,XF86AudioNext,spawn,playerctl next +bindl=NONE,XF86AudioMedia,spawn,playerctl play-pause + +# --- Screenshots (grim/slurp, mirrors river) ----------------------------- +bind=NONE,Print,spawn_shell,grim - | tee /home/$USER/scrot/$(date +"%F_%T").png | wl-copy +bind=ALT,Print,spawn_shell,grim -g "$(slurp -d)" - | tee /home/$USER/scrot/$(date +"%F_%T").png | wl-copy +bind=ALT+SHIFT,Print,spawn,hyprpicker -anl + +# ============================================================================ +# Mouse bindings (river: Mod1 left=move, right=resize, middle=toggle float) +# ============================================================================ +mousebind=ALT,btn_left,moveresize,curmove +mousebind=ALT,btn_right,moveresize,curresize +mousebind=ALT,btn_middle,togglefloating + +# Maximize/restore on plain middle-click anywhere (overview/title contexts) +mousebind=SUPER,btn_middle,togglemaximizescreen,0 + +# ============================================================================ +# Axis (scroll) bindings — wheel over root cycles tags +# ============================================================================ +axisbind=SUPER,UP,viewtoleft_have_client +axisbind=SUPER,DOWN,viewtoright_have_client + +# ============================================================================ +# Layer rules +# ============================================================================ +layerrule=animation_type_open:zoom,layer_name:fuzzel +layerrule=animation_type_close:zoom,layer_name:fuzzel + +# ============================================================================ +# Autostart (mirrors river spawn ... block) +# ============================================================================ +env=XDG_CURRENT_DESKTOP,mango +env=XDG_SESSION_TYPE,wayland + +exec-once=dbus-update-activation-environment WAYLAND_DISPLAY XDG_CURRENT_DESKTOP +exec-once=/usr/lib/xdg-desktop-portal-wlr +exec-once=/usr/lib/xdg-desktop-portal + +# Audio +exec-once=pipewire +#exec-once=pipewire-pulse +exec-once=pkill waybar_audio_event_bridge +exec-once=/home/fr/.local/bin/waybar_audio_event_bridge + +# Services +exec-once=dunst +exec-once=udiskie -ANt + +# Color temperature +exec-once=wlsunset -l 50.08 -L 14.42 -t 5000 -T 6500 + +# Wallpaper +exec-once=swaybg -c 1D1F21 + +# Status bar (mango-specific waybar config; river bar config is left intact) +exec-once=waybar -c ~/.config/waybar/config-mango.jsonc + +# Idle: blank after 20 min when unlocked (no auto-lock). Manual lock +# (Alt+Shift+L) and suspend route through ~/.config/mango/scripts/lock.sh +# which adds a 10 s idle blanker for the locked session. Kanshi is +# STOP/CONT-bracketed around every wlopm cycle to keep the Lenovo +# USB-C dock from re-triggering monitor profile switches when DPMS +# drops the DP-MST link. +exec-once=swayidle -w timeout 1200 'pkill -STOP kanshi 2>/dev/null; wlopm --off "*"' resume 'wlopm --on "*"; sleep 0.5; pkill -CONT kanshi 2>/dev/null' before-sleep '~/.config/mango/scripts/lock.sh &' + +# Multi-monitor configuration +exec-once=kanshi diff --git a/.config/mango/scripts/lock.sh b/.config/mango/scripts/lock.sh new file mode 100755 index 0000000..7a0dbfe --- /dev/null +++ b/.config/mango/scripts/lock.sh @@ -0,0 +1,31 @@ +#!/usr/bin/env bash +# Manual screen-lock for mango. +# - Locks via waylock (immediate lockscreen). +# - While locked, runs an aggressive 10 s idle blanker. +# - Pauses kanshi during blank to prevent profile flip-flop on the +# Lenovo USB-C dock (DP-MST drops link on DPMS off). +# - Cleans up on unlock. + +set -e + +# Don't stack lockers if one is already running (re-press, or +# before-sleep firing while already locked). +pgrep -x waylock >/dev/null && exit 0 + +# Short-timeout idle blanker, only alive while we're locked. +swayidle -w \ + timeout 10 'pkill -STOP kanshi 2>/dev/null; wlopm --off "*"' \ + resume 'wlopm --on "*"; sleep 0.5; pkill -CONT kanshi 2>/dev/null' \ + >/dev/null 2>&1 & +LOCK_IDLE_PID=$! + +# Cleanup on unlock: stop the idle watcher, ensure outputs are on, +# and resume kanshi in case the trap fires mid-blank. +trap ' + kill "$LOCK_IDLE_PID" 2>/dev/null || true + wlopm --on "*" 2>/dev/null || true + pkill -CONT kanshi 2>/dev/null || true +' EXIT + +# Block here until waylock exits on successful auth. +waylock diff --git a/.config/waybar/config-mango.jsonc b/.config/waybar/config-mango.jsonc new file mode 100644 index 0000000..0721ea1 --- /dev/null +++ b/.config/waybar/config-mango.jsonc @@ -0,0 +1,119 @@ +{ + "position": "bottom", + "modules-left": ["dwl/tags", "custom/dwm-window"], + "modules-center": [], + //"modules-right": ["custom/spotify", "tray", "network", "bluetooth", "wireplumber", "battery", "clock", "custom/power"], + "modules-right": ["tray", "network", "custom/audio", "clock"], + + + + + "dwl/tags": { + "num-tags": 9, + "tag-labels": ["1", "2", "3", "4", "5", "6", "7", "8", "9"] + }, + + "dwl/window": { + "format": "[{layout}] {title}", + "max-length": 80 + }, + + "custom/dwm-window": { + "exec": "~/.local/bin/tag_windows.sh", + "max-length": 80 + }, + + "clock": { + //"format": "{:%d.%m. %b, %a %H:%M}", + "format": "{:%b %d (%a) %I:%M:%S %p}", + "timezone": "Europe/Prague", + "locale": "en_US.UTF-8", + "interval": 1, + "tooltip-format": "{calendar}", + "calendar": { + "mode" : "year", + "mode-mon-col" : 3, + "weeks-pos" : "right", + "on-scroll" : 1, + "format": { + "months": "{}", + "days": "{}", + "weeks": "W{}", + "weekdays": "{}", + "today": "{}" + } + }, + "actions": { + "on-click-right": "mode", + "on-click-forward": "tz_up", + "on-click-backward": "tz_down", + "on-scroll-up": "shift_up", + "on-scroll-down": "shift_down" + } + }, + + "network": { + "interface": "eth0", + "format-ethernet": "󰈀 {ifname}: {ipaddr}", + "format-disconnected": "󰖪 ", + "tooltip-format-ethernet": "{ifname}: {ipaddr}", + "tooltip-format-disconnected": "Disconnected", + //"on-click": "foot -e nmtui", + //"on-click-right": "~/.scripts/restart_network.sh" + }, + + //"bluetooth": { + // "on-click": "foot bluetuith", + // "on-click-right": "~/.scripts/toggle_bluetooth.sh", + // "format-on": "󰂯", + // "format-off": "󰂲", + // "format-disabled": "󰂲", + // "format-connected": "󰂱" + //}, + + //"wireplumber": { + // "format": "{icon} {volume}%", + // "format-muted": "󰖁 muted", + // "on-click": "pavucontrol -t 3", + // "on-click-right": "pamixer --toggle-mute", + // "max-volume": 125, + // "format-icons": ["", "", ""] + //}, + + "custom/audio": { + "exec": "~/.local/bin/waybar_audio", + "signal": 8, + "return-type": "json", + "format": "{icon} {text}", + "format-icons": { + "speaker": ["", "", " "], + "speaker-muted": "󰖁", + "headphones": "󰋋", + "headphones-muted": "󰟎" + }, + //"interval": 2, + "interval": "once", + "on-click": "pamixer --toggle-mute", + "on-click-right": "~/.local/bin/toggle_audio", + "on-scroll-up": "pamixer --increase 5", + "on-scroll-down": "pamixer --decrease 5" + }, + + //"battery": { + // "states": { + // "good": 95, + // "warning": 30, + // "critical": 15 + // }, + // "format":"{icon} {capacity}%", + // "format-charging": "󰂄 {capacity}%", + // "format-plugged": "󱐋", + // "format-icons": ["󰁺", "󰁻", "󰁼", "󰁽", "󰁾", "󰁿", "󰂀", "󰂁", "󰂂", "󰁹"], + // "interval": 30, + // "tooltip-format": "{time}", + //}, + + "tray": { + "spacing": 10 + } +} diff --git a/.config/waybar/config.jsonc b/.config/waybar/config.jsonc index 25fa9ba..eebeed4 100644 --- a/.config/waybar/config.jsonc +++ b/.config/waybar/config.jsonc @@ -1,6 +1,6 @@ { "position": "bottom", - "modules-left": ["river/tags", "river/window"], + "modules-left": ["river/tags", "river/layout", "river/window"], "modules-center": [], "modules-right": ["tray", "network", "custom/audio", "clock"], @@ -12,6 +12,12 @@ "max-length": 80 }, + "river/layout": { + "format": "{}", + "min-length": 4, + "on-click": "riverctl send-layout-cmd next" + }, + "clock": { //"format": "{:%d.%m. %b, %a %H:%M}", "format": "{:%b %d (%a) %I:%M:%S %p}", @@ -80,7 +86,8 @@ "headphones": "󰋋", "headphones-muted": "󰟎" }, - "interval": 2, + //"interval": 2, + "interval": "once", "on-click": "pamixer --toggle-mute", "on-click-right": "~/.local/bin/toggle_audio", "on-scroll-up": "pamixer --increase 5", diff --git a/.config/waybar/style.css b/.config/waybar/style.css index ef86023..d1f6dd3 100644 --- a/.config/waybar/style.css +++ b/.config/waybar/style.css @@ -9,6 +9,7 @@ window#waybar { background-color: @bg; + padding: 10em; } #tags {