aurora627d496
modularize hyprland configs, add zoom, scale, rotate script and keybinds
+386 −260
9 files changed
- M .config/hypr/hyprland.conf +13 −258
- A .config/hypr/source/appearance.conf +80 −0
- A .config/hypr/source/environment_variables.conf +22 −0
- A .config/hypr/source/input.conf +27 −0
- A .config/hypr/source/keybinds.conf +117 −0
- A .config/hypr/source/permissions.conf +12 −0
- R .config/hypr/install-plugins.sh → .local/bin/hypr/hypr_update_plugins.sh +0 −0
- A .local/bin/hypr/screen_rotate.sh +114 −0
- M .local/bin/screenshot +1 −2
| @@ -1,18 +1,13 @@ | |||
| 1 | 1 | source = $HOME/.cache/wal/colors-hyprland.conf | |
| 2 | 2 | autogenerated = 0 | |
| 3 | 3 | ||
| 4 | − | ################### | |
| 5 | − | ### MY PROGRAMS ### | |
| 6 | − | ################### | |
| 4 | + | # 1. PROGRAMS | |
| 7 | 5 | $terminal = foot | |
| 8 | 6 | $menu = fuzzel | |
| 9 | 7 | $browser = zen-browser | |
| 10 | 8 | $passwordmanager = keepmenu | |
| 11 | 9 | ||
| 12 | − | ||
| 13 | − | ################# | |
| 14 | − | ### AUTOSTART ### | |
| 15 | − | ################# | |
| 10 | + | # 2. AUTOSTART | |
| 16 | 11 | exec-once = (hyprpm reload -n & kanshi & waybar & swaync & gammastep & hypridle) | |
| 17 | 12 | exec-once = ~/.local/bin/setwall -n | |
| 18 | 13 | exec-once = systemctl --user start hyprpolkitagent | |
| @@ -24,34 +19,11 @@ plugin { | |||
| 24 | 19 | } | |
| 25 | 20 | } | |
| 26 | 21 | ||
| 27 | − | ############################# | |
| 28 | − | ### ENVIRONMENT VARIABLES ### | |
| 29 | − | ############################# | |
| 30 | − | # See https://wiki.hypr.land/Configuring/Environment-variables/ | |
| 31 | − | env = HYPRSHOT_DIR,/home/krolyxon/pix/ss/ | |
| 32 | − | env = XCURSOR_SIZE,24 | |
| 33 | − | env = HYPRCURSOR_SIZE,24 | |
| 34 | − | # env = GTK_THEME,Tokyonight-Dark | |
| 35 | − | ||
| 36 | − | # XDG Specifications | |
| 37 | − | env = XDG_CURRENT_DESKTOP,Hyprland | |
| 38 | − | env = XDG_SESSION_TYPE,wayland | |
| 39 | − | env = XDG_SESSION_DESKTOP,Hyprland | |
| 22 | + | # 3. ENVIRONMENT VARIABLES | |
| 23 | + | source = ~/.config/hypr/source/environment_variables.conf | |
| 40 | 24 | ||
| 41 | − | # Toolkit | |
| 42 | − | env = GDK_BACKEND,wayland,x11,* # GTK: Use Wayland if available; if not, try X11 and then any other GDK backend. | |
| 43 | − | env = QT_QPA_PLATFORM,wayland;xcb # Qt: Use Wayland if available, fall back to X11 if not | |
| 44 | − | env = SDL_VIDEODRIVER,Wayland # Run SDL2 applications on Wayland. Remove or set to x11 if games that provide older versions of SDL cause compatibility issues | |
| 45 | − | env = CLUTTER_BACKEND,wayland # Clutter applications to try and use the Wayland backend | |
| 46 | 25 | ||
| 47 | − | # Nvidia | |
| 48 | − | # env = GBM_BACKEND,nvidia-drm | |
| 49 | − | # env = __GLX_VENDOR_LIBRARY_NAME,nvidia | |
| 50 | − | # env = LIBVA_DRIVER_NAME,nvidia | |
| 51 | − | ||
| 52 | − | ####################### | |
| 53 | − | ### PLUGIN SETTINGS ### | |
| 54 | − | ####################### | |
| 26 | + | # 4. PLUGIN SETTINGS | |
| 55 | 27 | plugin { | |
| 56 | 28 | split-monitor-workspaces { | |
| 57 | 29 | count = 10 | |
| @@ -61,236 +33,19 @@ plugin { | |||
| 61 | 33 | } | |
| 62 | 34 | } | |
| 63 | 35 | ||
| 36 | + | # 5. PERMISSIONS | |
| 37 | + | source = ~/.config/hypr/source/permissions.conf | |
| 64 | 38 | ||
| 65 | 39 | ||
| 66 | − | ################### | |
| 67 | − | ### PERMISSIONS ### | |
| 68 | − | ################### | |
| 69 | − | ecosystem { | |
| 70 | − | enforce_permissions = 1 | |
| 71 | − | } | |
| 72 | − | ||
| 73 | − | permission = /usr/(bin|local/bin)/grim, screencopy, allow | |
| 74 | − | permission = /usr/(bin|local/bin)/hyprlock, screencopy, allow | |
| 75 | − | permission = /usr/(lib|libexec|lib64)/xdg-desktop-portal-hyprland, screencopy, allow | |
| 76 | − | permission = /usr/(bin|local/bin)/hyprpm, plugin, allow | |
| 77 | − | permission = ${lib.escapeRegex (lib.getExe config.programs.hyprlock.package)}, screencopy, allow | |
| 78 | − | ||
| 79 | − | ||
| 80 | − | ##################### | |
| 81 | − | ### LOOK AND FEEL ### | |
| 82 | − | ##################### | |
| 83 | − | general { | |
| 84 | − | gaps_in = 2 | |
| 85 | − | gaps_out = 2 | |
| 86 | − | border_size = 2 | |
| 87 | − | resize_on_border = false | |
| 88 | − | allow_tearing = false | |
| 89 | − | # col.active_border = $color14 $color0 $color0 $color14 45deg | |
| 90 | − | col.active_border = $color14 $color14 $color14 $color14 45deg | |
| 91 | − | col.inactive_border = $color0 $color0 $color0 $color0 45deg | |
| 92 | − | layout = master | |
| 93 | − | } | |
| 94 | − | ||
| 95 | − | decoration { | |
| 96 | − | # rounding = 8 | |
| 97 | − | ||
| 98 | − | ||
| 99 | − | blur { | |
| 100 | − | enabled = false | |
| 101 | − | size = 3 | |
| 102 | − | passes = 1 | |
| 103 | − | } | |
| 104 | − | ||
| 105 | − | ||
| 106 | − | # blur { | |
| 107 | − | # enabled = true | |
| 108 | − | # size = 3 | |
| 109 | − | # passes = 3 | |
| 110 | − | # new_optimizations = true | |
| 111 | − | # vibrancy = 0.1696 | |
| 112 | − | # ignore_opacity = true | |
| 113 | − | # } | |
| 114 | − | } | |
| 115 | − | ||
| 116 | − | animations { | |
| 117 | − | enabled = false | |
| 118 | − | bezier = myBezier, 0.05, 0.9, 0.1, 1.05 | |
| 119 | − | animation = windows, 1, 2, myBezier | |
| 120 | − | animation = windowsOut, 1, 2, default, popin 80% | |
| 121 | − | animation = border, 1, 10, default | |
| 122 | − | animation = borderangle, 1, 8, default | |
| 123 | − | animation = fade, 1, 7, default | |
| 124 | − | animation = workspaces, 1, 1, default | |
| 125 | − | } | |
| 126 | − | ||
| 127 | − | # Ref https://wiki.hypr.land/Configuring/Workspace-Rules/ | |
| 128 | − | # "Smart gaps" / "No gaps when only" | |
| 129 | − | # uncomment all if you wish to use that. | |
| 130 | − | # workspace = w[tv1], gapsout:0, gapsin:0 | |
| 131 | − | # workspace = f[1], gapsout:0, gapsin:0 | |
| 132 | − | # windowrule = bordersize 0, floating:0, onworkspace:w[tv1] | |
| 133 | − | # windowrule = rounding 0, floating:0, onworkspace:w[tv1] | |
| 134 | − | # windowrule = bordersize 0, floating:0, onworkspace:f[1] | |
| 135 | − | # windowrule = rounding 0, floating:0, onworkspace:f[1] | |
| 136 | − | ||
| 137 | − | # See https://wiki.hypr.land/Configuring/Dwindle-Layout/ for more | |
| 138 | − | dwindle { | |
| 139 | − | pseudotile = true# Master switch for pseudotiling. Enabling is bound to mainMod + P in the keybinds section below | |
| 140 | − | preserve_split = true # You probably want this | |
| 141 | − | } | |
| 142 | − | ||
| 143 | − | # See https://wiki.hypr.land/Configuring/Master-Layout/ for more | |
| 144 | − | master { | |
| 145 | − | new_status = master | |
| 146 | − | new_on_top = true | |
| 147 | − | ||
| 148 | − | } | |
| 149 | − | ||
| 150 | − | # https://wiki.hypr.land/Configuring/Variables/#misc | |
| 151 | − | misc { | |
| 152 | − | force_default_wallpaper = -1 # Set to 0 or 1 to disable the anime mascot wallpapers | |
| 153 | − | disable_hyprland_logo = true# If true disables the random hyprland logo / anime girl background. :( | |
| 154 | − | disable_splash_rendering = true | |
| 155 | − | ||
| 156 | − | mouse_move_enables_dpms = true | |
| 157 | − | key_press_enables_dpms = true | |
| 158 | − | ||
| 159 | − | vrr = 0 # Disable adaptive sync | |
| 160 | − | } | |
| 161 | − | ||
| 162 | − | ||
| 163 | − | ############# | |
| 164 | − | ### INPUT ### | |
| 165 | − | ############# | |
| 166 | − | ||
| 167 | − | # https://wiki.hypr.land/Configuring/Variables/#input | |
| 168 | − | input { | |
| 169 | − | kb_layout = us | |
| 170 | − | kb_variant = | |
| 171 | − | kb_model = | |
| 172 | − | kb_options = | |
| 173 | − | kb_rules = | |
| 174 | − | ||
| 175 | − | follow_mouse = 1 | |
| 176 | − | ||
| 177 | − | sensitivity = 0 # -1.0 - 1.0, 0 means no modification. | |
| 178 | − | ||
| 179 | − | touchpad { | |
| 180 | − | natural_scroll = false | |
| 181 | − | } | |
| 182 | − | ||
| 183 | − | repeat_delay = 300 | |
| 184 | − | repeat_rate = 50 | |
| 185 | − | } | |
| 186 | − | ||
| 187 | − | # Example per-device config | |
| 188 | − | # See https://wiki.hypr.land/Configuring/Keywords/#per-device-input-configs for more | |
| 189 | − | device { | |
| 190 | − | name = epic-mouse-v1 | |
| 191 | − | sensitivity = -0.5 | |
| 192 | − | } | |
| 193 | − | ||
| 194 | − | ||
| 195 | − | ################### | |
| 196 | − | ### KEYBINDINGS ### | |
| 197 | − | ################### | |
| 198 | − | ||
| 199 | − | # See https://wiki.hypr.land/Configuring/Keywords/ | |
| 200 | − | $mainMod = SUPER # Sets "Windows" key as main modifier | |
| 201 | − | ||
| 202 | − | # Example binds, see https://wiki.hypr.land/Configuring/Binds/ for more | |
| 203 | − | bind = $mainMod, Return, exec, $terminal | |
| 204 | − | bind = $mainMod SHIFT, X, killactive, | |
| 205 | − | bind = $mainMod SHIFT, Q, exit, | |
| 206 | − | bind = $mainMod, F, Fullscreen | |
| 207 | − | bind = $mainMod SHIFT, F, Fullscreen, 1 | |
| 208 | − | bind = $mainMod SHIFT, R, togglefloating, | |
| 209 | − | bind = $mainMod, R, exec, $menu | |
| 210 | − | bind = $mainMod SHIFT, P, pseudo, # dwindle | |
| 211 | − | bind = $mainMod, J, togglesplit, # dwindle | |
| 212 | − | binde = $mainMod, tab, cyclenext, prev | |
| 213 | − | bind = $mainMod, b, exec, killall waybar || waybar | |
| 214 | − | bind = $mainMod, grave, exec, fuzzelunicode | |
| 215 | − | bind = $mainMod, escape, exec, sysact | |
| 216 | − | ||
| 217 | − | # Applications | |
| 218 | − | bind = $mainMod, W, exec, $browser | |
| 219 | − | bind = $mainMod SHIFT, p, exec, $passwordmanager -C | |
| 220 | − | bind = ,PRINT, exec, screenshot | |
| 221 | − | ||
| 222 | − | # Music Controls | |
| 223 | − | bind = $mainMod, m, exec, $terminal -e zsh -i -c "ncmpcpp" | |
| 224 | − | bind = $mainMod, p, exec, mpc toggle | |
| 225 | − | binde = $mainMod, period, exec, mpc seek +10 | |
| 226 | − | binde = $mainMod, comma, exec, mpc seek -10 | |
| 227 | − | bind = $mainMod SHIFT, period, exec, mpc next | |
| 228 | − | bind = $mainMod SHIFT, comma, exec, mpc prev | |
| 229 | − | ||
| 230 | − | # Swap current focused window with master | |
| 231 | − | bind = $mainMod, space, layoutmsg, swapwithmaster | |
| 232 | − | ||
| 233 | − | # Resize windows with h/j/k/l | |
| 234 | − | binde = $mainMod, h, resizeactive, -30 0 | |
| 235 | − | binde = $mainMod, l, resizeactive, 30 0 | |
| 236 | − | binde = $mainMod, k, resizeactive, 0 -30 | |
| 237 | − | binde = $mainMod, j, resizeactive, 0 30 | |
| 238 | − | ||
| 239 | − | # Switch workspaces with mainMod + [0-9] | |
| 240 | − | bind = $mainMod, 1, split-workspace, 1 | |
| 241 | − | bind = $mainMod, 2, split-workspace, 2 | |
| 242 | − | bind = $mainMod, 3, split-workspace, 3 | |
| 243 | − | bind = $mainMod, 4, split-workspace, 4 | |
| 244 | − | bind = $mainMod, 5, split-workspace, 5 | |
| 245 | − | bind = $mainMod, 6, split-workspace, 6 | |
| 246 | − | bind = $mainMod, 7, split-workspace, 7 | |
| 247 | − | bind = $mainMod, 8, split-workspace, 8 | |
| 248 | − | bind = $mainMod, 9, split-workspace, 9 | |
| 249 | − | bind = $mainMod, 0, split-workspace, 10 | |
| 250 | − | ||
| 251 | − | # Move active window to a workspace with mainMod + SHIFT + [0-9] | |
| 252 | − | bind = $mainMod SHIFT, 1, split-movetoworkspacesilent, 1 | |
| 253 | − | bind = $mainMod SHIFT, 2, split-movetoworkspacesilent, 2 | |
| 254 | − | bind = $mainMod SHIFT, 3, split-movetoworkspacesilent, 3 | |
| 255 | − | bind = $mainMod SHIFT, 4, split-movetoworkspacesilent, 4 | |
| 256 | − | bind = $mainMod SHIFT, 5, split-movetoworkspacesilent, 5 | |
| 257 | − | bind = $mainMod SHIFT, 6, split-movetoworkspacesilent, 6 | |
| 258 | − | bind = $mainMod SHIFT, 7, split-movetoworkspacesilent, 7 | |
| 259 | − | bind = $mainMod SHIFT, 8, split-movetoworkspacesilent, 8 | |
| 260 | − | bind = $mainMod SHIFT, 9, split-movetoworkspacesilent, 9 | |
| 261 | − | bind = $mainMod SHIFT, 0, split-movetoworkspacesilent, 10 | |
| 262 | − | ||
| 263 | − | # Example special workspace (scratchpad) | |
| 264 | − | bind = $mainMod, S, togglespecialworkspace, magic | |
| 265 | − | bind = $mainMod SHIFT, S, movetoworkspace, special:magic | |
| 266 | − | ||
| 267 | − | # Have scratchpad like DWM | |
| 268 | − | workspace = special:h, on-created-empty: $terminal | |
| 269 | − | bind = $mainMod SHIFT, Return, togglespecialworkspace, h | |
| 270 | − | ||
| 271 | − | ||
| 272 | − | # Scroll through existing workspaces with mainMod + scroll | |
| 273 | − | bind = $mainMod, mouse_down, workspace, e+1 | |
| 274 | − | bind = $mainMod, mouse_up, workspace, e-1 | |
| 275 | − | ||
| 276 | − | # Move/resize windows with mainMod + LMB/RMB and dragging | |
| 277 | − | bindm = $mainMod, mouse:272, movewindow | |
| 278 | − | bindm = $mainMod, mouse:273, resizewindow | |
| 40 | + | # 6. LOOK AND FEEL | |
| 41 | + | source = ~/.config/hypr/source/appearance.conf | |
| 279 | 42 | ||
| 280 | − | # Laptop multimedia keys for volume and LCD brightness | |
| 281 | − | bindel = ,XF86AudioRaiseVolume, exec, wpctl set-volume -l 1 @DEFAULT_AUDIO_SINK@ 5%+ | |
| 282 | − | bindel = ,XF86AudioLowerVolume, exec, wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%- | |
| 283 | − | bindel = ,XF86AudioMute, exec, wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle | |
| 284 | − | bindel = ,XF86AudioMicMute, exec, wpctl set-mute @DEFAULT_AUDIO_SOURCE@ toggle | |
| 285 | − | bindel = , XF86MonBrightnessDown, exec, ~/.local/bin/brictl - | |
| 286 | − | bindel = , XF86MonBrightnessUp, exec, ~/.local/bin/brictl + | |
| 43 | + | # 7. INPUT | |
| 44 | + | source = ~/.config/hypr/source/input.conf | |
| 287 | 45 | ||
| 46 | + | # 8. KEYBINDINGS | |
| 47 | + | source = ~/.config/hypr/source/keybinds.conf | |
| 288 | 48 | ||
| 289 | − | # Requires playerctl | |
| 290 | − | bindl = , XF86AudioNext, exec, playerctl next | |
| 291 | − | bindl = , XF86AudioPause, exec, playerctl play-pause | |
| 292 | − | bindl = , XF86AudioPlay, exec, playerctl play-pause | |
| 293 | − | bindl = , XF86AudioPrev, exec, playerctl previous | |
| 294 | 49 | ||
| 295 | 50 | ############################## | |
| 296 | 51 | ### WINDOWS AND WORKSPACES ### | |
| @@ -0,0 +1,80 @@ | |||
| 1 | + | general { | |
| 2 | + | gaps_in = 2 | |
| 3 | + | gaps_out = 2 | |
| 4 | + | border_size = 2 | |
| 5 | + | resize_on_border = false | |
| 6 | + | allow_tearing = false | |
| 7 | + | # col.active_border = $color14 $color0 $color0 $color14 45deg | |
| 8 | + | col.active_border = $color14 $color14 $color14 $color14 45deg | |
| 9 | + | col.inactive_border = $color0 $color0 $color0 $color0 45deg | |
| 10 | + | layout = master | |
| 11 | + | } | |
| 12 | + | ||
| 13 | + | decoration { | |
| 14 | + | # rounding = 8 | |
| 15 | + | ||
| 16 | + | ||
| 17 | + | blur { | |
| 18 | + | enabled = false | |
| 19 | + | size = 3 | |
| 20 | + | passes = 1 | |
| 21 | + | } | |
| 22 | + | ||
| 23 | + | ||
| 24 | + | # blur { | |
| 25 | + | # enabled = true | |
| 26 | + | # size = 3 | |
| 27 | + | # passes = 3 | |
| 28 | + | # new_optimizations = true | |
| 29 | + | # vibrancy = 0.1696 | |
| 30 | + | # ignore_opacity = true | |
| 31 | + | # } | |
| 32 | + | } | |
| 33 | + | ||
| 34 | + | animations { | |
| 35 | + | enabled = false | |
| 36 | + | bezier = myBezier, 0.05, 0.9, 0.1, 1.05 | |
| 37 | + | animation = windows, 1, 2, myBezier | |
| 38 | + | animation = windowsOut, 1, 2, default, popin 80% | |
| 39 | + | animation = border, 1, 10, default | |
| 40 | + | animation = borderangle, 1, 8, default | |
| 41 | + | animation = fade, 1, 7, default | |
| 42 | + | animation = workspaces, 1, 1, default | |
| 43 | + | } | |
| 44 | + | ||
| 45 | + | # Ref https://wiki.hypr.land/Configuring/Workspace-Rules/ | |
| 46 | + | # "Smart gaps" / "No gaps when only" | |
| 47 | + | # uncomment all if you wish to use that. | |
| 48 | + | # workspace = w[tv1], gapsout:0, gapsin:0 | |
| 49 | + | # workspace = f[1], gapsout:0, gapsin:0 | |
| 50 | + | # windowrule = bordersize 0, floating:0, onworkspace:w[tv1] | |
| 51 | + | # windowrule = rounding 0, floating:0, onworkspace:w[tv1] | |
| 52 | + | # windowrule = bordersize 0, floating:0, onworkspace:f[1] | |
| 53 | + | # windowrule = rounding 0, floating:0, onworkspace:f[1] | |
| 54 | + | ||
| 55 | + | # See https://wiki.hypr.land/Configuring/Dwindle-Layout/ for more | |
| 56 | + | dwindle { | |
| 57 | + | pseudotile = true# Master switch for pseudotiling. Enabling is bound to mainMod + P in the keybinds section below | |
| 58 | + | preserve_split = true # You probably want this | |
| 59 | + | } | |
| 60 | + | ||
| 61 | + | # See https://wiki.hypr.land/Configuring/Master-Layout/ for more | |
| 62 | + | master { | |
| 63 | + | new_status = master | |
| 64 | + | new_on_top = true | |
| 65 | + | ||
| 66 | + | } | |
| 67 | + | ||
| 68 | + | # https://wiki.hypr.land/Configuring/Variables/#misc | |
| 69 | + | misc { | |
| 70 | + | force_default_wallpaper = -1 # Set to 0 or 1 to disable the anime mascot wallpapers | |
| 71 | + | disable_hyprland_logo = true# If true disables the random hyprland logo / anime girl background. :( | |
| 72 | + | disable_splash_rendering = true | |
| 73 | + | ||
| 74 | + | mouse_move_enables_dpms = true | |
| 75 | + | key_press_enables_dpms = true | |
| 76 | + | ||
| 77 | + | vrr = 0 # Disable adaptive sync | |
| 78 | + | } | |
| 79 | + | ||
| 80 | + | ||
| @@ -0,0 +1,22 @@ | |||
| 1 | + | # See https://wiki.hypr.land/Configuring/Environment-variables/ | |
| 2 | + | env = HYPRSHOT_DIR,/home/krolyxon/pix/ss/ | |
| 3 | + | env = XCURSOR_SIZE,24 | |
| 4 | + | env = HYPRCURSOR_SIZE,24 | |
| 5 | + | # env = GTK_THEME,Tokyonight-Dark | |
| 6 | + | ||
| 7 | + | # XDG Specifications | |
| 8 | + | env = XDG_CURRENT_DESKTOP,Hyprland | |
| 9 | + | env = XDG_SESSION_TYPE,wayland | |
| 10 | + | env = XDG_SESSION_DESKTOP,Hyprland | |
| 11 | + | ||
| 12 | + | # Toolkit | |
| 13 | + | env = GDK_BACKEND,wayland,x11,* # GTK: Use Wayland if available; if not, try X11 and then any other GDK backend. | |
| 14 | + | env = QT_QPA_PLATFORM,wayland;xcb # Qt: Use Wayland if available, fall back to X11 if not | |
| 15 | + | env = SDL_VIDEODRIVER,Wayland # Run SDL2 applications on Wayland. Remove or set to x11 if games that provide older versions of SDL cause compatibility issues | |
| 16 | + | env = CLUTTER_BACKEND,wayland # Clutter applications to try and use the Wayland backend | |
| 17 | + | ||
| 18 | + | # Nvidia | |
| 19 | + | # env = GBM_BACKEND,nvidia-drm | |
| 20 | + | # env = __GLX_VENDOR_LIBRARY_NAME,nvidia | |
| 21 | + | # env = LIBVA_DRIVER_NAME,nvidia | |
| 22 | + | ||
| @@ -0,0 +1,27 @@ | |||
| 1 | + | # https://wiki.hypr.land/Configuring/Variables/#input | |
| 2 | + | input { | |
| 3 | + | kb_layout = us | |
| 4 | + | kb_variant = | |
| 5 | + | kb_model = | |
| 6 | + | kb_options = | |
| 7 | + | kb_rules = | |
| 8 | + | ||
| 9 | + | follow_mouse = 1 | |
| 10 | + | ||
| 11 | + | sensitivity = 0 # -1.0 - 1.0, 0 means no modification. | |
| 12 | + | ||
| 13 | + | touchpad { | |
| 14 | + | natural_scroll = false | |
| 15 | + | } | |
| 16 | + | ||
| 17 | + | repeat_delay = 300 | |
| 18 | + | repeat_rate = 50 | |
| 19 | + | } | |
| 20 | + | ||
| 21 | + | # Example per-device config | |
| 22 | + | # See https://wiki.hypr.land/Configuring/Keywords/#per-device-input-configs for more | |
| 23 | + | device { | |
| 24 | + | name = epic-mouse-v1 | |
| 25 | + | sensitivity = -0.5 | |
| 26 | + | } | |
| 27 | + | ||
| @@ -0,0 +1,117 @@ | |||
| 1 | + | ################### | |
| 2 | + | ### KEYBINDINGS ### | |
| 3 | + | ################### | |
| 4 | + | ||
| 5 | + | # See https://wiki.hypr.land/Configuring/Keywords/ | |
| 6 | + | $mainMod = SUPER # Sets "Windows" key as main modifier | |
| 7 | + | ||
| 8 | + | # Example binds, see https://wiki.hypr.land/Configuring/Binds/ for more | |
| 9 | + | bind = $mainMod, Return, exec, $terminal | |
| 10 | + | bind = $mainMod SHIFT, X, killactive, | |
| 11 | + | bind = $mainMod SHIFT, Q, exit, | |
| 12 | + | bind = $mainMod, F, Fullscreen | |
| 13 | + | bind = $mainMod SHIFT, F, Fullscreen, 1 | |
| 14 | + | # bind = $mainMod SHIFT, R, togglefloating, | |
| 15 | + | # Smart Float: Toggle float -> Resize to 90% -> Center | |
| 16 | + | bind = $mainMod SHIFT, R, exec, if hyprctl -j activewindow | jq -e '.floating | not'; then hyprctl --batch "dispatch togglefloating; dispatch resizeactive exact 90% 90%; dispatch centerwindow"; else hyprctl dispatch togglefloating; fi | |
| 17 | + | bind = $mainMod, R, exec, $menu | |
| 18 | + | bind = $mainMod SHIFT, P, pseudo, # dwindle | |
| 19 | + | bind = $mainMod, J, togglesplit, # dwindle | |
| 20 | + | binde = $mainMod, tab, cyclenext, prev | |
| 21 | + | bind = $mainMod, b, exec, killall waybar || waybar | |
| 22 | + | bind = $mainMod, grave, exec, fuzzelunicode | |
| 23 | + | bind = $mainMod, escape, exec, sysact | |
| 24 | + | ||
| 25 | + | # Applications | |
| 26 | + | bind = $mainMod, W, exec, $browser | |
| 27 | + | bind = $mainMod SHIFT, p, exec, $passwordmanager -C | |
| 28 | + | bind = ,PRINT, exec, screenshot | |
| 29 | + | ||
| 30 | + | # Music Controls | |
| 31 | + | bind = $mainMod, m, exec, $terminal -e zsh -i -c "ncmpcpp" | |
| 32 | + | bind = $mainMod, p, exec, mpc toggle | |
| 33 | + | binde = $mainMod, period, exec, mpc seek +10 | |
| 34 | + | binde = $mainMod, comma, exec, mpc seek -10 | |
| 35 | + | bind = $mainMod SHIFT, period, exec, mpc next | |
| 36 | + | bind = $mainMod SHIFT, comma, exec, mpc prev | |
| 37 | + | ||
| 38 | + | # Swap current focused window with master | |
| 39 | + | bind = $mainMod, space, layoutmsg, swapwithmaster | |
| 40 | + | ||
| 41 | + | # Resize windows with h/j/k/l | |
| 42 | + | binde = $mainMod, h, resizeactive, -30 0 | |
| 43 | + | binde = $mainMod, l, resizeactive, 30 0 | |
| 44 | + | binde = $mainMod, k, resizeactive, 0 -30 | |
| 45 | + | binde = $mainMod, j, resizeactive, 0 30 | |
| 46 | + | ||
| 47 | + | # Switch workspaces with mainMod + [0-9] | |
| 48 | + | bind = $mainMod, 1, split-workspace, 1 | |
| 49 | + | bind = $mainMod, 2, split-workspace, 2 | |
| 50 | + | bind = $mainMod, 3, split-workspace, 3 | |
| 51 | + | bind = $mainMod, 4, split-workspace, 4 | |
| 52 | + | bind = $mainMod, 5, split-workspace, 5 | |
| 53 | + | bind = $mainMod, 6, split-workspace, 6 | |
| 54 | + | bind = $mainMod, 7, split-workspace, 7 | |
| 55 | + | bind = $mainMod, 8, split-workspace, 8 | |
| 56 | + | bind = $mainMod, 9, split-workspace, 9 | |
| 57 | + | bind = $mainMod, 0, split-workspace, 10 | |
| 58 | + | ||
| 59 | + | # Move active window to a workspace with mainMod + SHIFT + [0-9] | |
| 60 | + | bind = $mainMod SHIFT, 1, split-movetoworkspacesilent, 1 | |
| 61 | + | bind = $mainMod SHIFT, 2, split-movetoworkspacesilent, 2 | |
| 62 | + | bind = $mainMod SHIFT, 3, split-movetoworkspacesilent, 3 | |
| 63 | + | bind = $mainMod SHIFT, 4, split-movetoworkspacesilent, 4 | |
| 64 | + | bind = $mainMod SHIFT, 5, split-movetoworkspacesilent, 5 | |
| 65 | + | bind = $mainMod SHIFT, 6, split-movetoworkspacesilent, 6 | |
| 66 | + | bind = $mainMod SHIFT, 7, split-movetoworkspacesilent, 7 | |
| 67 | + | bind = $mainMod SHIFT, 8, split-movetoworkspacesilent, 8 | |
| 68 | + | bind = $mainMod SHIFT, 9, split-movetoworkspacesilent, 9 | |
| 69 | + | bind = $mainMod SHIFT, 0, split-movetoworkspacesilent, 10 | |
| 70 | + | ||
| 71 | + | # Example special workspace (scratchpad) | |
| 72 | + | bind = $mainMod, S, togglespecialworkspace, magic | |
| 73 | + | bind = $mainMod SHIFT, S, movetoworkspace, special:magic | |
| 74 | + | ||
| 75 | + | # Have scratchpad like DWM | |
| 76 | + | workspace = special:h, on-created-empty: $terminal | |
| 77 | + | bind = $mainMod SHIFT, Return, togglespecialworkspace, h | |
| 78 | + | ||
| 79 | + | # --- Screen Rotate --- | |
| 80 | + | bindld = CTRL ALT, R, Rotate Screen Clockwise, exec, hypr_screen_rotate.sh -90 | |
| 81 | + | bindld = CTRL ALT SHIFT, R, Rotate Screen Anti-Clockwise, exec, hypr_screen_rotate.sh +90 | |
| 82 | + | ||
| 83 | + | # --- Accessibility: Zoom --- | |
| 84 | + | cursor:zoom_disable_aa = true | |
| 85 | + | ||
| 86 | + | # Zoom In | |
| 87 | + | binded = SUPER SHIFT, equal, Zoom In, exec, sh -c "hyprctl keyword cursor:zoom_factor \"$(hyprctl getoption cursor:zoom_factor | awk 'NR==1 {print $2 * 1.25}')\"" | |
| 88 | + | ||
| 89 | + | # Zoom Out | |
| 90 | + | binded = SUPER SHIFT, minus, Zoom Out, exec, sh -c "hyprctl keyword cursor:zoom_factor \"$(hyprctl getoption cursor:zoom_factor | awk 'NR==1 {val = $2 / 1.25; if (val < 1.0) val = 1.0; print val}')\"" | |
| 91 | + | ||
| 92 | + | # Reset Zoom | |
| 93 | + | bindld = SUPER SHIFT, BACKSPACE, Reset Zoom, exec, hyprctl keyword cursor:zoom_factor 1.0 | |
| 94 | + | ||
| 95 | + | # Scroll through existing workspaces with mainMod + scroll | |
| 96 | + | bind = $mainMod, mouse_down, workspace, e+1 | |
| 97 | + | bind = $mainMod, mouse_up, workspace, e-1 | |
| 98 | + | ||
| 99 | + | # Move/resize windows with mainMod + LMB/RMB and dragging | |
| 100 | + | bindm = $mainMod, mouse:272, movewindow | |
| 101 | + | bindm = $mainMod, mouse:273, resizewindow | |
| 102 | + | ||
| 103 | + | # Laptop multimedia keys for volume and LCD brightness | |
| 104 | + | bindel = ,XF86AudioRaiseVolume, exec, wpctl set-volume -l 1 @DEFAULT_AUDIO_SINK@ 5%+ | |
| 105 | + | bindel = ,XF86AudioLowerVolume, exec, wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%- | |
| 106 | + | bindel = ,XF86AudioMute, exec, wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle | |
| 107 | + | bindel = ,XF86AudioMicMute, exec, wpctl set-mute @DEFAULT_AUDIO_SOURCE@ toggle | |
| 108 | + | bindel = , XF86MonBrightnessDown, exec, ~/.local/bin/brictl - | |
| 109 | + | bindel = , XF86MonBrightnessUp, exec, ~/.local/bin/brictl + | |
| 110 | + | ||
| 111 | + | ||
| 112 | + | # Requires playerctl | |
| 113 | + | bindl = , XF86AudioNext, exec, playerctl next | |
| 114 | + | bindl = , XF86AudioPause, exec, playerctl play-pause | |
| 115 | + | bindl = , XF86AudioPlay, exec, playerctl play-pause | |
| 116 | + | bindl = , XF86AudioPrev, exec, playerctl previous | |
| 117 | + | ||
| @@ -0,0 +1,12 @@ | |||
| 1 | + | ecosystem { | |
| 2 | + | enforce_permissions = 1 | |
| 3 | + | } | |
| 4 | + | ||
| 5 | + | permission = /usr/(bin|local/bin)/grim, screencopy, allow | |
| 6 | + | permission = /usr/(bin|local/bin)/hyprlock, screencopy, allow | |
| 7 | + | permission = /usr/(bin|local/bin)/hyprpicker , screencopy, allow | |
| 8 | + | permission = /usr/(lib|libexec|lib64)/xdg-desktop-portal-hyprland, screencopy, allow | |
| 9 | + | permission = /usr/(bin|local/bin)/hyprpm, plugin, allow | |
| 10 | + | permission = ${lib.escapeRegex (lib.getExe config.programs.hyprlock.package)}, screencopy, allow | |
| 11 | + | ||
| 12 | + | ||
[No content changes]
| @@ -0,0 +1,114 @@ | |||
| 1 | + | #!/usr/bin/env bash | |
| 2 | + | # Script taken from and modified little bit from: | |
| 3 | + | # https://github.com/dusklinux/dusky/blob/f8a28f425743e478cddefc327e6e554dfcf9521d/user_scripts/hypr/screen_rotate.sh | |
| 4 | + | ||
| 5 | + | # 1. Strict Mode & Safety (Bash 5+ Standards) | |
| 6 | + | # ------------------------------------------------------------------------------ | |
| 7 | + | set -euo pipefail | |
| 8 | + | IFS=$'\n\t' | |
| 9 | + | ||
| 10 | + | # 2. Global Constants (ANSI-C Quoting for "Elite" Color Handling) | |
| 11 | + | # ------------------------------------------------------------------------------ | |
| 12 | + | readonly C_RED=$'\e[31m' | |
| 13 | + | readonly C_GREEN=$'\e[32m' | |
| 14 | + | readonly C_YELLOW=$'\e[33m' | |
| 15 | + | readonly C_BLUE=$'\e[34m' | |
| 16 | + | readonly C_BOLD=$'\e[1m' | |
| 17 | + | readonly C_RESET=$'\e[0m' | |
| 18 | + | ||
| 19 | + | # cleanup_trap: Ensures clean exit codes are respected. | |
| 20 | + | cleanup_trap() { | |
| 21 | + | local exit_code=$? | |
| 22 | + | if [[ $exit_code -ne 0 ]]; then | |
| 23 | + | printf "%s[ERROR]%s Script aborted unexpectedly (Exit Code: %d).\n" \ | |
| 24 | + | "$C_RED" "$C_RESET" "$exit_code" >&2 | |
| 25 | + | fi | |
| 26 | + | } | |
| 27 | + | trap cleanup_trap EXIT | |
| 28 | + | ||
| 29 | + | # 3. Environment & Privilege Checks | |
| 30 | + | # ------------------------------------------------------------------------------ | |
| 31 | + | # Dependency Check: We need 'jq' for JSON parsing. | |
| 32 | + | if ! command -v jq &> /dev/null; then | |
| 33 | + | printf "%s[ERROR]%s 'jq' is missing. Install it with: sudo pacman -S jq\n" \ | |
| 34 | + | "$C_RED" "$C_RESET" >&2 | |
| 35 | + | exit 1 | |
| 36 | + | fi | |
| 37 | + | ||
| 38 | + | # Root Check: Hyprland IPC fails if executed as root/sudo due to socket ownership. | |
| 39 | + | if [[ $EUID -eq 0 ]]; then | |
| 40 | + | printf "%s[ERROR]%s Root detected. Please run this as your normal user to access the Hyprland socket.\n" \ | |
| 41 | + | "$C_RED" "$C_RESET" >&2 | |
| 42 | + | exit 1 | |
| 43 | + | fi | |
| 44 | + | ||
| 45 | + | # 4. Argument Parsing (+90 or -90) | |
| 46 | + | # ------------------------------------------------------------------------------ | |
| 47 | + | DIRECTION=0 | |
| 48 | + | ||
| 49 | + | if [[ $# -ne 1 ]]; then | |
| 50 | + | printf "%s[INFO]%s Usage: %s [+90|-90]\n" \ | |
| 51 | + | "$C_YELLOW" "$C_RESET" "${0##*/}" | |
| 52 | + | exit 1 | |
| 53 | + | fi | |
| 54 | + | ||
| 55 | + | case "$1" in | |
| 56 | + | "+90") DIRECTION=1 ;; # Clockwise | |
| 57 | + | "-90") DIRECTION=-1 ;; # Counter-Clockwise | |
| 58 | + | *) | |
| 59 | + | printf "%s[ERROR]%s Invalid flag '%s'. Use +90 or -90.\n" \ | |
| 60 | + | "$C_RED" "$C_RESET" "$1" >&2 | |
| 61 | + | exit 1 | |
| 62 | + | ;; | |
| 63 | + | esac | |
| 64 | + | ||
| 65 | + | # 5. Hardware Detection (Smart Query) | |
| 66 | + | # ------------------------------------------------------------------------------ | |
| 67 | + | # We fetch the entire JSON blob once to minimize IPC calls (Performance). | |
| 68 | + | # We select the current focused monitor | |
| 69 | + | MON_STATE=$(hyprctl monitors -j | jq -r '.[] | select(.focused == true)') | |
| 70 | + | ||
| 71 | + | # Extract precise values using jq | |
| 72 | + | NAME=$(printf "%s" "$MON_STATE" | jq -r '.name') | |
| 73 | + | SCALE=$(printf "%s" "$MON_STATE" | jq -r '.scale') | |
| 74 | + | CURRENT_TRANSFORM=$(printf "%s" "$MON_STATE" | jq -r '.transform') | |
| 75 | + | ||
| 76 | + | # Validation: Ensure we actually found a monitor | |
| 77 | + | if [[ -z "$NAME" || "$NAME" == "null" ]]; then | |
| 78 | + | printf "%s[ERROR]%s No active monitors detected via Hyprland IPC.\n" \ | |
| 79 | + | "$C_RED" "$C_RESET" >&2 | |
| 80 | + | exit 1 | |
| 81 | + | fi | |
| 82 | + | ||
| 83 | + | # 6. Transformation Logic (Modulo Arithmetic) | |
| 84 | + | # ------------------------------------------------------------------------------ | |
| 85 | + | # Hyprland Transforms: 0=Normal, 1=90, 2=180, 3=270 | |
| 86 | + | # The '+ 4' ensures we handle negative wraparounds correctly in Bash logic. | |
| 87 | + | NEW_TRANSFORM=$(( (CURRENT_TRANSFORM + DIRECTION + 4) % 4 )) | |
| 88 | + | ||
| 89 | + | # 7. Execution (State overwrite) | |
| 90 | + | # ------------------------------------------------------------------------------ | |
| 91 | + | # We use 'preferred' and 'auto' to remain robust against resolution changes, | |
| 92 | + | # but we STRICTLY inject the detected $SCALE to prevent UI scaling issues. | |
| 93 | + | ||
| 94 | + | printf "%s[INFO]%s Rotating %s%s%s (Scale: %s): %d -> %d\n" \ | |
| 95 | + | "$C_BLUE" "$C_RESET" "$C_BOLD" "$NAME" "$C_RESET" "$SCALE" "$CURRENT_TRANSFORM" "$NEW_TRANSFORM" | |
| 96 | + | ||
| 97 | + | # Apply the new configuration immediately via IPC | |
| 98 | + | if hyprctl keyword monitor "${NAME}, preferred, auto, ${SCALE}, transform, ${NEW_TRANSFORM}" > /dev/null; then | |
| 99 | + | printf "%s[SUCCESS]%s Rotation applied successfully.\n" \ | |
| 100 | + | "$C_GREEN" "$C_RESET" | |
| 101 | + | ||
| 102 | + | # Notify user visually if notify-send is available (optional UX improvement) | |
| 103 | + | if command -v notify-send &> /dev/null; then | |
| 104 | + | notify-send -a "System" "Display Rotated" "Monitor: $NAME\nTransform: $NEW_TRANSFORM" -h string:x-canonical-private-synchronous:display-rotate | |
| 105 | + | fi | |
| 106 | + | else | |
| 107 | + | printf "%s[ERROR]%s Failed to apply Hyprland keyword.\n" \ | |
| 108 | + | "$C_RED" "$C_RESET" >&2 | |
| 109 | + | exit 1 | |
| 110 | + | fi | |
| 111 | + | ||
| 112 | + | # Clean exit | |
| 113 | + | trap - EXIT | |
| 114 | + | exit 0 | |
| @@ -12,7 +12,6 @@ case "$(printf "a selected area (copy)\ncurrent window (copy)\nfull screen (copy | |||
| 12 | 12 | "full screen") hyprshot -m output -o ~/pix/ss -f "pic-full-$(uuidgen | awk -F- '{printf $2}')-$(date '+%y-%m-%d').png" ;; | |
| 13 | 13 | ||
| 14 | 14 | "a selected area (OCR)") tmpfile=$(mktemp /tmp/ocr-XXXXXX.png) && \ | |
| 15 | − | hyprshot -m region -o "$(dirname "$tmpfile")" -f "$(basename "$tmpfile")" && \ | |
| 16 | − | tesseract "$tmpfile" - -l eng | ${ocr_cmd} && rm "$tmpfile" ;; | |
| 15 | + | slurp | grim -g - - | tesseract stdin stdout -l eng | wl-copy | |
| 17 | 16 | esac | |
| 18 | 17 | ||