hyprwm / Hyprland

Hyprland is an independent, highly customizable, dynamic tiling Wayland compositor that doesn't sacrifice on its looks.
https://hyprland.org
BSD 3-Clause "New" or "Revised" License
21.69k stars 899 forks source link

Adding minimum constraint in the zoom out factor #8504

Closed Kspiropali closed 4 hours ago

Kspiropali commented 5 hours ago

Already reported ? *

Regression?

No

System Info and Version

System/Version info ```sh Hyprland 0.45.0 built from branch main at commit a8ff3a452c1c445d24bdd9e7e4fcd66c8ef2a147 (core: move to os/Process from hyprutils). Date: Sat Nov 9 17:14:25 2024 Tag: v0.45.0-2-ga8ff3a45, commits: 5435 built against aquamarine 0.4.3 flags set: debug System Information: System name: Linux Node name: voidgod Release: 6.12.0-rc3-273-tkg-eevdf-llvm Version: #1 SMP PREEMPT_DYNAMIC TKG Fri, 18 Oct 2024 16:06:13 +0000 GPU information: 08:00.0 VGA compatible controller: Advanced Micro Devices, Inc. [AMD/ATI] Navi 10 [Radeon RX 5600 OEM/5600 XT / 5700/5700 XT] (rev c1) (prog-if 00 [VGA controller]) Subsystem: XFX Pine Group Inc. RX 5700 XT RAW II Flags: bus master, fast devsel, latency 0, IRQ 97 Memory at fc00000000 (64-bit, prefetchable) [size=8G] Memory at fe00000000 (64-bit, prefetchable) [size=256M] I/O ports at e000 [size=256] Memory at fcd00000 (32-bit, non-prefetchable) [size=512K] Expansion ROM at fcd80000 [disabled] [size=128K] Capabilities: Kernel driver in use: amdgpu Kernel modules: amdgpu os-release: NAME="Arch Linux" PRETTY_NAME="Arch Linux" ID=arch BUILD_ID=rolling ANSI_COLOR="38;2;23;147;209" HOME_URL="https://archlinux.org/" DOCUMENTATION_URL="https://wiki.archlinux.org/" SUPPORT_URL="https://bbs.archlinux.org/" BUG_REPORT_URL="https://gitlab.archlinux.org/groups/archlinux/-/issues" PRIVACY_POLICY_URL="https://terms.archlinux.org/docs/privacy-policy/" LOGO=archlinux-logo plugins: ======Config-Start====== Config File: /home/kspir/.config/hypr/hyprland.conf: Read Succeeded # See https://wiki.hyprland.org/Configuring/Monitors/ monitor=DP-3,2560x1440@119.99800,0x0,1 monitor=DP-1,2560x1440@164.83501,2561x279,1,vrr,1 xwayland { force_zero_scaling = true } $terminal = footclient $fileManager = hyprctl clients | grep thunar >> /dev/null || thunar $menu = fuzzel --font=SourceCodePro --no-icons --log-level=none --log-no-syslog --background-color=040430FF # Some default env vars. env = XCURSOR_SIZE, 24 env = XCURSOR_THEME, dracula env = HYPRCURSOR_THEME, hyprlol env = HYPRCURSOR_SIZE, 24 #windowrulev2 = immediate, class:.* debug { disable_logs = true } # For all categories, see https://wiki.hyprland.org/Configuring/Variables/ input { kb_layout = us,gr kb_variant = qwerty kb_model = kb_options = grp:win_space_toggle kb_rules = repeat_rate = 80 repeat_delay = 200 follow_mouse = 2 #mouse_refocus = true accel_profile = flat sensitivity = -0.25 #force_no_accel = true } #input type:keyboard xkb_capslock disabled #input type:keyboard xkb_numlock disabled general { # See https://wiki.hyprland.org/Configuring/Variables/ for more gaps_in = 0 gaps_out = 0 border_size = 0 col.active_border = rgba(33ccffee) rgba(00ff99ee) 45deg col.inactive_border = rgba(595959aa) layout = master # Please see https://wiki.hyprland.org/Configuring/Tearing/ before you turn this on allow_tearing = false snap { enabled = true border_overlap = false monitor_gap = 15 border_overlap = 15 } } decoration { # See https://wiki.hyprland.org/Configuring/Variables/ for more rounding = 0 blur { enabled = true size = 3 passes = 1 xray = true } # drop_shadow = yes # shadow_range = 4 # shadow_render_power = 3 # col.shadow = rgba(1a1a1aee) } animations { enabled = yes # Some default animations, see https://wiki.hyprland.org/Configuring/Animations/ for more bezier = myBezier, 0.05, 0.9, 0.1, 1.05 animation = specialWorkspace, 1, 7, myBezier, slidevert animation = windows, 1, 6, myBezier animation = windowsOut, 1, 6, default, popin 80% animation = border, 1, 8, default animation = borderangle, 1, 6, default animation = fade, 1, 7, default animation = workspaces, 1, 5, default } dwindle { # See https://wiki.hyprland.org/Configuring/Dwindle-Layout/ for more pseudotile = yes # master switch for pseudotiling. Enabling is bound to mainMod + P in the keybinds section below preserve_split = yes # you probably want this } gestures { # See https://wiki.hyprland.org/Configuring/Variables/ for more workspace_swipe = off } binds { scroll_event_delay = 1 } misc { initial_workspace_tracking = 0 force_default_wallpaper = 0 disable_hyprland_logo = true focus_on_activate = false mouse_move_focuses_monitor = true vfr = true vrr = 1 animate_manual_resizes = false allow_session_lock_restore = false close_special_on_empty = false middle_click_paste = false enable_swallow = true swallow_regex = ^(footclient)$ } render { direct_scanout = true } cursor { enable_hyprcursor = true #no_warps = true persistent_warps = true #zoom_factor = 1.8 #zoom_rigid = true warp_on_change_workspace = true } opengl { force_introspection = 1 } device { name = keychron-keychron-v7-mouse middle_button_emulation = false accel_profile = flat } # See https://wiki.hyprland.org/Configuring/Keywords/ for more $mainMod = SUPER bindl = , XF86PowerOff, exec, /home/kspir/.local/bin/graceful_shutdown # Volume binds bindl=, XF86AudioRaiseVolume, exec, wpctl set-volume -l 1.5 @DEFAULT_AUDIO_SINK@ 2.5%+ bindl=, XF86AudioLowerVolume, exec, wpctl set-volume -l 0.0 @DEFAULT_AUDIO_SINK@ 2.5%- # custom binds bind = $mainMod, x, exec, pgrep cliphist || cliphist list | wofi --dmenu --pre-display-cmd "echo '%s' | cut -f 2" | cliphist decode | wl-copy bind = $mainMod Shift, X, exec, cliphist wipe bind = $mainMod Shift, R, exec, /home/kspir/.local/bin/color_pick bind = $mainMod, C, exec, /home/kspir/.local/bin/randomwallpaper bind = $mainMod, P, exec, grim -g "$(slurp)" - | wl-copy bind = $mainMod Shift, P, exec, grim -g "$(slurp)" "Pictures/ScreenCapture/"/"$(date +%Y%m%d-%H%M%S)".png bind = $mainMod Shift, V, exec, /home/kspir/.local/bin/screenrecord bind = $mainMod Shift, M, exec, hyprlock bind = $mainMod, return, exec, $terminal bind = $mainMod Shift, Q, killactive, bind = $mainMod, E, exec, $fileManager bind = $mainMod Shift, F, toggleFloating, bind = $mainMod, F, fullscreen, 1 bind = $mainMod, D, exec, $menu bind = $mainMod, mouse_down, exec, hyprctl keyword cursor:zoom_factor "$(hyprctl getoption cursor:zoom_factor | grep float | awk '{print $2 + 0.1}')" bind = $mainMod, mouse_up, exec, hyprctl keyword cursor:zoom_factor "$(hyprctl getoption cursor:zoom_factor | grep float | awk '{print $2 - 0.1}')" # Move focus with mainMod + arrow keys bind = $mainMod, left, movefocus, l bind = $mainMod, right, movefocus, r bind = $mainMod, up, movefocus, u bind = $mainMod, down, movefocus, d # Switch workspaces with mainMod + [0-9] bind = $mainMod, 1, workspace, 1 bind = $mainMod, 2, workspace, 2 bind = $mainMod, 3, workspace, 3 bind = $mainMod, 4, workspace, 4 bind = $mainMod, 5, workspace, 5 bind = $mainMod, 6, workspace, 6 bind = $mainMod, 7, workspace, 7 bind = $mainMod, 8, workspace, 8 bind = $mainMod, 9, workspace, 9 bind = $mainMod, 0, workspace, 10 # Move active window to a workspace with mainMod + SHIFT + [0-9] bind = $mainMod SHIFT, 1, movetoworkspacesilent, 1 bind = $mainMod SHIFT, 2, movetoworkspacesilent, 2 bind = $mainMod SHIFT, 3, movetoworkspacesilent, 3 bind = $mainMod SHIFT, 4, movetoworkspacesilent, 4 bind = $mainMod SHIFT, 5, movetoworkspacesilent, 5 bind = $mainMod SHIFT, 6, movetoworkspacesilent, 6 bind = $mainMod SHIFT, 7, movetoworkspacesilent, 7 bind = $mainMod SHIFT, 8, movetoworkspacesilent, 8 bind = $mainMod SHIFT, 9, movetoworkspacesilent, 9 bind = $mainMod SHIFT, 0, movetoworkspacesilent, 10 # or movetoworkspace to follow app # Example special workspace (scratchpad) bind = $mainMod, S, togglespecialworkspace, magic bind = $mainMod SHIFT, S, movetoworkspacesilent, special:magic # Move/resize windows with mainMod + LMB/RMB and dragging bindm = $mainMod, mouse:272, movewindow bindm = $mainMod, mouse:273, resizewindow # Unmute the mic when the key is pressed bindni=,mouse:282,exec,pactl set-source-mute @DEFAULT_SOURCE@ 0 # Mute the mic when the key is released bindrni=,mouse:282,exec,pactl set-source-mute @DEFAULT_SOURCE@ 1 #exec-once = dbus-update-activation-environment --systemd WAYLAND_DISPLAY XDG_CURRENT_DESKTOP exec-once = /home/kspir/.local/bin/randomwallpaper exec-once = waybar exec-once = /usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1 exec-once = /home/kspir/.local/bin/xdp_fix exec-once = dunst exec-once = gsettings set org.gnome.desktop.wm.preferences button-layout : exec-once = hyprctl setcursor BreezeX-Black 24 exec-once = wl-paste --type text --watch cliphist store exec-once = wl-paste --type image --watch cliphist store #exec-once = hypridle exec-once = fuzzel --daemon exec-once = hyprctl setcursor hyprlol 24 exec-once = /home/kspir/.local/bin/handle_monitor_connect.sh exec-once = /home/kspir/.local/bin/import-gsettings # exec main apps exec-once = thunderbird exec-once = flatpak run dev.vencord.Vesktop #exec-once = flatpak run com.valvesoftware.Steam exec-once = QT_SCALE_FACTOR=1.5 keepassxc exec-once = pavucontrol exec-once = zen-browser exec-once = firewall-config exec-once = foot --server # workspace distribution windowrulev2 = workspace 1 silent, monitor DP-1, class:^(zen-alpha)$ windowrulev2 = workspace 2 silent, monitor DP-3, class:^(dota2)$ windowrulev2 = workspace 2 silent, monitor DP-3, title:^(Lethal Company)$ windowrulev2 = workspace 5 silent, monitor DP-1, floating, title:BepInEx windowrulev2 = workspace 5 silent, monitor DP-1, class:^(steam)$ windowrulev2 = workspace 5 silent, monitor DP-1, class:^(vesktop)$ windowrulev2 = workspace 6 silent, monitor DP-1, class:^(thunderbird)$ windowrulev2 = workspace 7 silent, monitor DP-1, class:^(firewall-config)$ windowrulev2 = workspace 8 silent, monitor DP-1, initialClass:^(org.keepassxc.KeePassXC)$ windowrulev2 = workspace 8 silent, monitor DP-1, initialClass:^(KeePassXC)$ windowrulev2 = pin, float, center, monitor DP-1, initialClass:^(org.keepassxc.KeePassXC)$, title:^(Unlock Database - KeePassXC)$ windowrulev2 = workspace 9 silent, monitor DP-1, class:^(org.pulseaudio.pavucontrol)$ # misc apps windowrulev2 = workspace 5 silent, class:Steam$,title:Steam$ windowrulev2 = float, class:(pop-up|bubble|dialog) windowrulev2 = float, class:(?:Open|Save|Extract) (?:File|Folder|As) windowrulev2 = float, class:^thunar$ windowrulev2 = size 1100 600, class:^thunar$ #windowrulev2 = size 800 500, class:^footclient$ #windowrule = move cursor -50% -50%,^(footclient)$ windowrulev2 = pin, float, center, stayfocused, class:^(polkit-gnome-authentication-agent-1)$ windowrulev2 = pin, class:^gcr-prompter windowrulev2 = float, class:^File Properties$ windowrulev2 = float, class:^xarchiver$ windowrulev2 = float, class:^subl$ windowrulev2 = float, title: Properties windowrulev2 = float, title:Open File windowrulev2 = float, title:Open Folder windowrulev2 = float, title:Open Workspace windowrulev2 = float, class:^(org.gnome.FileRoller)$ windowrulev2 = size 40% 40%, class:^(org.gnome.FileRoller)$ windowrulev2 = float, center, pin, stayfocused, class:^(xdg-desktop-portal-gtk)$ windowrulev2 = float, center, pin, stayfocused, class:^(hyprland-share-picker)$ windowrulev2 = float, center, pin, title:^(Extract)$ #windowrulev2 = size 1100 700, center, class:^(footclient)$ windowrulev2 = float, center, initialTitle:^(Steam Settings)$ layerrule = blur,^(waybar)$ layerrule = ignorezero,^(waybar)$ layerrule = blur,^(fuzzel)$ layerrule = blur,^(wofi)$ layerrule = ignorezero,^(wofi)$ workspace=1,monitor:DP-3 workspace=2,monitor:DP-1 workspace=3,monitor:DP-1 workspace=4,monitor:DP-1 workspace=5,monitor:DP-3 workspace=6,monitor:DP-3 workspace=7,monitor:DP-3 workspace=8,monitor:DP-3 workspace=9,monitor:DP-3 workspace=10,monitor:DP-3 # env variables env = EDITOR,rnano env = BEMENU_BACKEND,wayland env = QT_QPA_PLATFORM,wayland;x11 env = QT_QPA_PLATFORMTHEME,qt5ct env = XDG_CURRENT_DESKTOP,Hyprland env = __JAVA_AWT_WM_NONREPARENTING,1 env = MOZ_ENABLE_WAYLAND,1 #env = WLR_RENDERER,vulkan #env = WLR_DRM_DEVICES,/dev/dri/card0 env = GDK_BACKEND,wayland env = CLUTTER_BACKEND,wayland env = SDL_VIDEODRIVER,wayland;x11 env = XDG_SESSION_TYPE,wayland env = XDG_SESSION_DESKTOP,Hyprland env = VDPAU_DRIVER,radeonsi #env = BROWSER,firefox env = QT_AUTO_SCREEN_SCALE_FACTOR,1 env = QT_WAYLAND_DISABLE_WINDOWDECORATION,1 #env = GTK_THEME,dracula:dark ======Config-End======== ```

Description

So when zooming in and out, there should be limit when zooming out, min scale of 1. Anything below 1 does not really do anything(for now I guess) apart from me having to zoom in until I the zoom scale goes over 1 and then the actual zoom occurs at the monitor.

The reason why I think this should be hard coded and not checked in the binds below, is that zooming out would not make sense? At least for me I guess.

How to reproduce

Basically I am using:

bind = $mainMod, mouse_down, exec, hyprctl keyword cursor:zoom_factor "$(hyprctl getoption cursor:zoom_factor | grep float | awk '{print $2 + 0.1}')"
bind = $mainMod, mouse_up, exec, hyprctl keyword cursor:zoom_factor "$(hyprctl getoption cursor:zoom_factor | grep float | awk '{print $2 - 0.1}')

Zooming out with my mousewheel until I reach a value like:

$ hyprctl getoption cursor:zoom_factor
float: 0.400000
set: true

Would require me to zoom in 7 times until I see any zoom in happening in any of my monitors.

Crash reports, logs, images, videos

No response

vaxerski commented 4 hours ago

this should be done by your script. Hyprland does not clamp or constrain invalid values