]> Freerunner's - dotfiles.git/commitdiff
hypr: new window switcher + fixes
authorAndre Ramnitz <tux.rising@gmail.com>
Sat, 17 May 2025 20:18:11 +0000 (22:18 +0200)
committerAndre Ramnitz <tux.rising@gmail.com>
Sat, 17 May 2025 20:18:11 +0000 (22:18 +0200)
dot-config/hypr/fragments/keybinds.conf
dot-config/hypr/fragments/windowrules.conf
dot-config/hypr/hyprland.conf
dot-config/hypr/scripts/windowswitch-rg.sh

index 7531ea2f5e8be5c29c7ac096cc2ca508af48dac1..cce6f5bc63b55df66657f7bffa3154a00a416be5 100644 (file)
@@ -197,3 +197,5 @@ bind = $mainmod,                    mouse_up, workspace, m-1
 bind = $mainmod,                       mouse_down, workspace, m+1
 bind = $mainmod,                       mouse_left, workspace, r-1
 bind = $mainmod,                       mouse_right, workspace, r+1
+bind = $mod SHIFT, mouse_up, exec, hyprctl -q keyword cursor:zoom_factor 1
+bind = $mod SHIFT, mouse_down, exec, hyprctl -q keyword cursor:zoom_factor 1
index 964094755232905ad9d1e5bd51823aab2f6bf28a..5604053c2a865d05db3cca26f2cc397c4ccb095e 100644 (file)
@@ -6,9 +6,9 @@
 # more windowrules
 
 # handle steam client
-windowrule = float,class:^(steam)$
-windowrule = float,title:^(Steam)$
-windowrule = float,title:^(Freundesliste)$
+windowrule = float, class:^(steam)$
+# windowrule = float, title:^(Steam)$
+# windowrule = float, title:^(Freundesliste)$
 windowrule = stayfocused, title:^()$, class:^(steam)$
 windowrule = minsize 1 1, title:^()$, class:^(steam)$
 windowrule = plugin:hyprbars:nobar,class:^(steam)$
@@ -17,11 +17,11 @@ windowrule = plugin:hyprbars:nobar,title:^(Freundesliste)$
 
 # handle wine/proton games
 $GAMES = ^(steam_app_.*|steam_proton|streaming_client|gamescope)$
-windowrule = noanim, $GAMES
-windowrule = fullscreenstate 2 2, $GAMES
-windowrule = fullscreen, $GAMES
-windowrule = idleinhibit always, $GAMES
-# windowrule = immediate, $GAMES
+windowrule = noanim, class:$GAMES
+windowrule = fullscreenstate 2 2, class:$GAMES
+windowrule = fullscreen, class:$GAMES
+windowrule = idleinhibit always, class:$GAMES
+windowrule = immediate, class:$GAMES
 
 # hide hyprbars on non-floating windows
 windowrule = plugin:hyprbars:nobar, ^floating:0
index 2d28c693e145edc97a737c32f3124913659e0448..cd77b90bd60e0ee0dec4491b8ec11ccb410ee76d 100644 (file)
@@ -10,8 +10,8 @@ source=./base16-colors.conf
 debug:disable_logs = true # file logging. defaults to 1 for production
 
 # See https://wiki.hyprland.org/Configuring/Monitors/
-monitor=DP-1,preferred,0x0,1,vrr,2
-monitor=DP-2,preferred,auto-right,1,vrr,2
+monitor=DP-1,preferred,0x0,1,vrr,3
+monitor=DP-2,preferred,auto-right,1,vrr,3
 
 # unscale XWayland
 xwayland {
@@ -49,6 +49,8 @@ input {
     sensitivity = 0 # -1.0 - 1.0, 0 means no modification.
 }
 
+permission = /usr/(lib|libexec|lib64)/xdg-desktop-portal-hyprland, screencopy, allow
+
 general {
     # See https://wiki.hyprland.org/Configuring/Variables/ for more
     # col.active_border = 0xffffffff
@@ -135,11 +137,14 @@ gestures {
     workspace_swipe = false
 }
 
+render {
+       direct_scanout = false
+}
+
 misc {
     # See https://wiki.hyprland.org/Configuring/Variables/ for more
     force_default_wallpaper = 0 # Set to 0 to disable the anime mascot wallpapers
        key_press_enables_dpms = true
-       vrr = 2
        vfr = true #enable for battery savings
        render_unfocused_fps = 60
        allow_session_lock_restore = 1
@@ -193,7 +198,133 @@ plugin {
                bar_part_of_window = 1
                bar_precedence_over_border = 1
                # hyprbars-button = color, size, icon, on-click
-               hyprbars-button = 0xaa$base08, 20, 󰖭, hyprctl dispatch killactive
+       dynamic-cursors {
+
+        # enables the plugin
+        enabled = true
+
+        # sets the cursor behaviour, supports these values:
+        # tilt    - tilt the cursor based on x-velocity
+        # rotate  - rotate the cursor based on movement direction
+        # stretch - stretch the cursor shape based on direction and velocity
+        # none    - do not change the cursors behaviour
+        mode = none
+
+        # minimum angle difference in degrees after which the shape is changed
+        # smaller values are smoother, but more expensive for hw cursors
+        threshold = 2
+
+        # override the mode behaviour per shape
+        # this is a keyword and can be repeated many times
+        # by default, there are no rules added
+        # see the dedicated `shape rules` section below!
+        # shaperule = <shape-name>, <mode> (optional), <property>: <value>, ...
+        # shaperule = <shape-name>, <mode> (optional), <property>: <value>, ...
+
+        # for mode = rotate
+        rotate {
+
+            # length in px of the simulated stick used to rotate the cursor
+            # most realistic if this is your actual cursor size
+            length = 20
+
+            # clockwise offset applied to the angle in degrees
+            # this will apply to ALL shapes
+            offset = 0.0
+        }
+
+        # for mode = tilt
+        tilt {
+
+            # controls how powerful the tilt is, the lower, the more power
+            # this value controls at which speed (px/s) the full tilt is reached
+            limit = 5000
+
+            # relationship between speed and tilt, supports these values:
+            # linear             - a linear function is used
+            # quadratic          - a quadratic function is used (most realistic to actual air drag)
+            # negative_quadratic - negative version of the quadratic one, feels more aggressive
+            function = negative_quadratic
+        }
+
+        # for mode = stretch
+        stretch {
+
+            # controls how much the cursor is stretched
+            # this value controls at which speed (px/s) the full stretch is reached
+            limit = 3000
+
+            # relationship between speed and stretch amount, supports these values:
+            # linear             - a linear function is used
+            # quadratic          - a quadratic function is used
+            # negative_quadratic - negative version of the quadratic one, feels more aggressive
+            function = quadratic
+        }
+
+        # configure shake to find
+        # magnifies the cursor if its is being shaken
+        shake {
+
+            # enables shake to find
+            enabled = true
+
+            # use nearest-neighbour (pixelated) scaling when shaking
+            # may look weird when effects are enabled
+            nearest = true
+
+            # controls how soon a shake is detected
+            # lower values mean sooner
+            threshold = 4.0
+
+            # magnification level immediately after shake start
+            base = 4.0
+            # magnification increase per second when continuing to shake
+            speed = 2.0
+            # how much the speed is influenced by the current shake intensitiy
+            influence = 0.0
+
+            # maximal magnification the cursor can reach
+            # values below 1 disable the limit (e.g. 0)
+            limit = 10.0
+
+            # time in millseconds the cursor will stay magnified after a shake has ended
+            timeout = 2000
+
+            # show cursor behaviour `tilt`, `rotate`, etc. while shaking
+            effects = false
+
+            # enable ipc events for shake
+            # see the `ipc` section below
+            ipc = false
+        }
+
+        # use hyprcursor to get a higher resolution texture when the cursor is magnified
+        # see the `hyprcursor` section below
+        hyprcursor {
+
+            # use nearest-neighbour (pixelated) scaling when magnifing beyond texture size
+            # this will also have effect without hyprcursor support being enabled
+            # 0 / false - never use pixelated scaling
+            # 1 / true  - use pixelated when no highres image
+            # 2         - always use pixleated scaling
+            nearest = true
+
+            # enable dedicated hyprcursor support
+            enabled = true
+
+            # resolution in pixels to load the magnified shapes at
+            # be warned that loading a very high-resolution image will take a long time and might impact memory consumption
+            # -1 means we use [normal cursor size] * [shake:base option]
+            resolution = -1
+
+            # shape to use when clientside cursors are being magnified
+            # see the shape-name property of shape rules for possible names
+            # specifying clientside will use the actual shape, but will be pixelated
+            fallback = clientside
+        }
+    }
+
+       hyprbars-button = 0xaa$base08, 20, 󰖭, hyprctl dispatch killactive
                hyprbars-button = 0xaa$base0A, 20, 󰁌, hyprctl dispatch fullscreen 1
         }
        hyprexpo {
@@ -204,6 +335,7 @@ plugin {
        }
 }
 
+
 source=./fragments/animations.conf
 source=./fragments/env.conf
 source=./fragments/keybinds.conf
index 334d690e226874c7d53ff9df341593ddfef9fc77..d61c1cc22495c3eb8dfebcff85de7ececec55245 100755 (executable)
@@ -1,5 +1,7 @@
 #!/bin/bash
 
-hyprctl clients | rg ^Window | rg -v '> :' | fuzzel --config="$HOME"/.config/fuzzel/fuzzel-centered.ini -d | awk '{print $2}' | \
-    xargs -I{} hyprctl dispatcher focuswindow "address:0x{}"
+hyprctl clients | rg ^Window | rg -v '> :' | fuzzel --config="$HOME"/.config/fuzzel/fuzzel-centered.ini -d | awk '{print $2}' | \
+    xargs -I{} hyprctl dispatcher focuswindow "address:0x{}"
 
+# from https://www.reddit.com/r/hyprland/comments/113ofeq/comment/msnbom6/?utm_source=share&utm_medium=web3x&utm_name=web3xcss&utm_term=1&utm_content=share_button
+hyprctl -j clients | jq -r '.[] | [([.workspace.name, .class, .title] | join(" => ")), .address]    | @tsv ' | fuzzel --config="$HOME/.config/fuzzel/fuzzel-centered.ini" --dmenu --with-nth=1 --accept-nth=2 --width=128 | xargs -I{} hyprctl dispatch focuswindow "address:{}"