Skip to content

Hyprscrolling - Configuration for two monitors #602

@mr-scrpt

Description

@mr-scrpt

Hi. Thank you for your plugin, it's great. I was thinking of switching from Hyprland to Scroll, but then I found Hyprscrolling.
The problem is that I have two monitors, one large, which can easily fit 2-3 windows across, and the second monitor is small and can only fit one window, but the plugin does not have settings for different monitors. I solved this with gemini scripts and tricks, but I think this is a bad approach. I would really like to have native support. But if anyone is interested, here's what our Gemini solution looks like =))

plugin {
    hyprscrolling {
        column_width = 0.492
        fullscreen_on_one_column = true
        focus_fit_method = 1
    }
}


exec-once = sleep 3 && hyprctl keyword general:layout scrolling
exec-once = hyprpm reload -n
exec-once = ~/.config/hypr/custom/scripts/scroll/scroll_layout.sh


exec = ~/.config/hypr/custom/scripts/scroll/reload_layout.sh


bind = $mainMod, H, layoutmsg, move -col
bind = $mainMod, L, layoutmsg, move +col


bind = $mainMod, K, movefocus, u
bind = $mainMod, J, movefocus, d



bind = $mainMod SHIFT, H, layoutmsg, movewindowto l
bind = $mainMod SHIFT, L, layoutmsg, movewindowto r


bind = $mainMod SHIFT, K, movewindow, u
bind = $mainMod SHIFT, J, movewindow, d

#!/bin/bash
pkill -f scroll_layout.sh
sleep 0.5
hyprctl keyword general:layout scrolling
hyprpm reload -n
sleep 0.5
~/.config/hypr/custom/scripts/scroll/scroll_layout.sh &


#!/bin/bash
MON_BIG="DP-1"
MON_SMALL="HDMI-A-1"
WIDTH_BIG="0.48"
WIDTH_SMALL="0.98"

if [ -z "$HYPRLAND_INSTANCE_SIGNATURE" ]; then
  HYPR_SIG=$(ls -t $XDG_RUNTIME_DIR/hypr/ | grep -v "\.lock" | head -n 1)
  export HYPRLAND_INSTANCE_SIGNATURE="$HYPR_SIG"
fi
SOCKET="$XDG_RUNTIME_DIR/hypr/$HYPRLAND_INSTANCE_SIGNATURE/.socket2.sock"

echo "=== Auto-Scroll: Started ==="

socat -U - UNIX-CONNECT:"$SOCKET" | while read -r line; do
  if [[ "$line" == "focusedmon>>"* ]]; then
    DATA=${line#*>>}
    MON_NAME=${DATA%,*}
    if [[ "$MON_NAME" == "$MON_BIG" ]]; then
      hyprctl keyword plugin:hyprscrolling:column_width $WIDTH_BIG >/dev/null
      hyprctl keyword plugin:hyprscrolling:focus_fit_method 1 >/dev/null
    elif [[ "$MON_NAME" == "$MON_SMALL" ]]; then
      hyprctl keyword plugin:hyprscrolling:column_width $WIDTH_SMALL >/dev/null
      hyprctl keyword plugin:hyprscrolling:focus_fit_method 0 >/dev/null
    fi
  fi
done

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions