diff options
Diffstat (limited to 'dotfiles/hyprland/.config/hypr/hyprland.conf')
| -rw-r--r-- | dotfiles/hyprland/.config/hypr/hyprland.conf | 204 |
1 files changed, 116 insertions, 88 deletions
diff --git a/dotfiles/hyprland/.config/hypr/hyprland.conf b/dotfiles/hyprland/.config/hypr/hyprland.conf index ce45088..0e582d3 100644 --- a/dotfiles/hyprland/.config/hypr/hyprland.conf +++ b/dotfiles/hyprland/.config/hypr/hyprland.conf @@ -10,12 +10,12 @@ monitor=,preferred,auto,auto # ============================================================================ # Startup Applications # ============================================================================ +exec-once = hyprpm reload exec-once = waybar -exec-once = swww-daemon && sleep 1 && swww img ~/pictures/wallpaper/dark-lion.jpg +exec-once = swww-daemon && sleep 1 && swww img ~/pictures/wallpaper/trondheim-norway.jpg exec-once = dunst exec-once = hypridle exec-once = gammastep -exec-once = nm-applet exec-once = blueman-applet exec-once = /usr/bin/gnome-keyring-daemon --start --components=pkcs11,secrets,ssh exec-once = dbus-update-activation-environment --systemd WAYLAND_DISPLAY XDG_CURRENT_DESKTOP @@ -39,8 +39,8 @@ env = _JAVA_AWT_WM_NONREPARENTING,1 # DWM colors: gray1=#222222, gray2=#444444, gray3=#bbbbbb, gray4=#eeeeee, cyan=#daa520 general { - gaps_in = 5 - gaps_out = 10 + gaps_in = 25 + gaps_out = 30 border_size = 3 col.active_border = rgba(daa520ff) col.inactive_border = rgba(444444ff) @@ -49,7 +49,7 @@ general { } decoration { - rounding = 0 + rounding = 10 blur { enabled = false } @@ -65,6 +65,7 @@ animations { animation = windowsOut, 1, 3, default, popin 80% animation = fade, 1, 3, default animation = workspaces, 1, 3, default + animation = specialWorkspace, 1, 3, default, slidevert } # ============================================================================ @@ -86,7 +87,7 @@ dwindle { input { kb_layout = us kb_options = ctrl:nocaps - follow_mouse = 1 + follow_mouse = 0 touchpad { natural_scroll = true } @@ -108,15 +109,15 @@ xwayland { } # ============================================================================ -# Window Rules +# Window Rules (Hyprland 0.53+ syntax: match:CONDITION, RULE) # ============================================================================ # Floating windows (from DWM rules) -windowrulev2 = float, class:^(Gimp)$ -windowrulev2 = float, class:^(caffeine)$ -windowrulev2 = float, class:^(blueman-services)$ -windowrulev2 = float, class:^(Blueman-manager)$ -windowrulev2 = float, class:^(qalculate-gtk)$ -windowrulev2 = float, title:^(Event Tester)$ +windowrule = match:class ^(Gimp)$, float on +windowrule = match:class ^(caffeine)$, float on +windowrule = match:class ^(blueman-services)$, float on +windowrule = match:class ^(Blueman-manager)$, float on +windowrule = match:class ^(qalculate-gtk)$, float on +windowrule = match:title ^(Event Tester)$, float on # ============================================================================ # Key Bindings @@ -124,36 +125,43 @@ windowrulev2 = float, title:^(Event Tester)$ $mod = SUPER # Terminal and core apps (from DWM) -bind = $mod, T, exec, st +bind = $mod, T, exec, foot bind = $mod, E, exec, emacsclient -c -a "" || emacs bind = $mod, W, exec, $BROWSER -bind = $mod, P, exec, wofi --show drun +bind = $mod, P, exec, fuzzel # From sxhkdrc -bind = $mod, SPACE, exec, wofi --show drun -bind = $mod SHIFT, S, exec, wofi --show ssh +bind = $mod, SPACE, exec, fuzzel bind = $mod SHIFT, W, exec, $ALTBROWSER bind = CTRL ALT, W, exec, tor-browser bind = CTRL ALT, F, exec, thunar bind = $mod, V, exec, virtualbox bind = $mod SHIFT, L, exec, calibre bind = $mod SHIFT, R, exec, shortwave +bind = $mod SHIFT, P, exec, waypaper + +# Theme switching +bind = $mod, Y, exec, set-theme --toggle +bind = $mod SHIFT, Y, exec, set-theme --pick # Window management (from DWM) -bind = $mod, J, layoutmsg, cyclenext -bind = $mod, K, layoutmsg, cycleprev -bind = $mod SHIFT, J, layoutmsg, swapnext -bind = $mod SHIFT, K, layoutmsg, swapprev -bind = $mod, H, resizeactive, -50 0 -bind = $mod, L, resizeactive, 50 0 -bind = $mod, RETURN, layoutmsg, swapwithmaster +# Layout-aware navigation (works across master, scrolling, hy3) +bind = $mod, J, exec, layout-navigate next +bind = $mod, K, exec, layout-navigate prev +bind = $mod SHIFT, J, exec, layout-navigate next move +bind = $mod SHIFT, K, exec, layout-navigate prev move +bind = $mod, H, splitratio, -0.05 +bind = $mod, L, splitratio, +0.05 +bind = $mod, RETURN, layoutmsg, swapwithmaster master bind = $mod, G, centerwindow bind = $mod, TAB, workspace, previous bind = $mod SHIFT, C, killactive -# Layouts (from DWM) -bind = $mod SHIFT, M, exec, hyprctl keyword general:layout master -bind = $mod SHIFT, T, exec, hyprctl keyword general:layout master +# Layouts: master -> tab group (monocle) -> scrolling -> floating +# Click waybar layout icon to cycle, or use direct keybindings: +bind = $mod SHIFT, T, exec, hyprctl keyword general:layout master && hyprctl keyword master:orientation left +bind = $mod SHIFT, M, exec, hyprctl keyword general:layout hy3 && hyprctl dispatch hy3:changegroup tab +bind = $mod SHIFT, S, exec, hyprctl keyword general:layout scrolling bind = $mod SHIFT, F, togglefloating bind = $mod SHIFT, SPACE, togglefloating @@ -161,10 +169,17 @@ bind = $mod SHIFT, SPACE, togglefloating bind = $mod, I, layoutmsg, addmaster bind = $mod, D, layoutmsg, removemaster +# Focus mode (xtra-dispatchers plugin) +# O = "Only this window" / "bring back Others" / "close Others" +bind = $mod, O, exec, hyprctl dispatch plugin:xtd:throwunfocused 10 +bind = $mod SHIFT, O, exec, hyprctl dispatch plugin:xtd:bringallfrom 10 +bind = $mod CTRL, O, exec, hyprctl dispatch plugin:xtd:closeunfocused + # Gaps (from DWM) -bind = $mod, MINUS, exec, hyprctl keyword general:gaps_out $(( $(hyprctl getoption general:gaps_out -j | jq '.int') - 5 )) -bind = $mod, EQUAL, exec, hyprctl keyword general:gaps_out $(( $(hyprctl getoption general:gaps_out -j | jq '.int') + 5 )) -bind = $mod SHIFT, EQUAL, exec, hyprctl keyword general:gaps_out 10 +bind = $mod, MINUS, exec, hyprctl keyword general:gaps_out $(( $(hyprctl getoption general:gaps_out -j | jq -r '.custom' | cut -d' ' -f1) - 5 )) && hyprctl keyword general:gaps_in $(( $(hyprctl getoption general:gaps_in -j | jq -r '.custom' | cut -d' ' -f1) - 5 )) +bind = $mod, EQUAL, exec, hyprctl keyword general:gaps_out $(( $(hyprctl getoption general:gaps_out -j | jq -r '.custom' | cut -d' ' -f1) + 5 )) && hyprctl keyword general:gaps_in $(( $(hyprctl getoption general:gaps_in -j | jq -r '.custom' | cut -d' ' -f1) + 5 )) +bind = $mod SHIFT, EQUAL, exec, hyprctl keyword general:gaps_out 30 && hyprctl keyword general:gaps_in 25 +bind = $mod SHIFT, MINUS, exec, hyprctl keyword general:gaps_out 0 && hyprctl keyword general:gaps_in 0 # Toggle bar bind = $mod, B, exec, killall -SIGUSR1 waybar @@ -185,16 +200,16 @@ bind = $mod, 9, workspace, 9 bind = $mod, 0, workspace, 10 # Move window to workspace (from DWM tag) -bind = $mod SHIFT, 1, movetoworkspace, 1 -bind = $mod SHIFT, 2, movetoworkspace, 2 -bind = $mod SHIFT, 3, movetoworkspace, 3 -bind = $mod SHIFT, 4, movetoworkspace, 4 -bind = $mod SHIFT, 5, movetoworkspace, 5 -bind = $mod SHIFT, 6, movetoworkspace, 6 -bind = $mod SHIFT, 7, movetoworkspace, 7 -bind = $mod SHIFT, 8, movetoworkspace, 8 -bind = $mod SHIFT, 9, movetoworkspace, 9 -bind = $mod SHIFT, 0, movetoworkspace, 10 +bind = $mod SHIFT, 1, movetoworkspacesilent, 1 +bind = $mod SHIFT, 2, movetoworkspacesilent, 2 +bind = $mod SHIFT, 3, movetoworkspacesilent, 3 +bind = $mod SHIFT, 4, movetoworkspacesilent, 4 +bind = $mod SHIFT, 5, movetoworkspacesilent, 5 +bind = $mod SHIFT, 6, movetoworkspacesilent, 6 +bind = $mod SHIFT, 7, movetoworkspacesilent, 7 +bind = $mod SHIFT, 8, movetoworkspacesilent, 8 +bind = $mod SHIFT, 9, movetoworkspacesilent, 9 +bind = $mod SHIFT, 0, movetoworkspacesilent, 10 # Monitor focus (from DWM focusmon) bind = $mod, COMMA, focusmonitor, -1 @@ -202,53 +217,68 @@ bind = $mod, PERIOD, focusmonitor, +1 bind = $mod SHIFT, COMMA, movewindow, mon:-1 bind = $mod SHIFT, PERIOD, movewindow, mon:+1 +# ============================================================================ # Scratchpads (from DWM togglescratch) -# Audio mixer (was MODKEY+a -> spaudio/pulsemixer) +# ============================================================================ +# Using on-created-empty workspace rules - app launches on first toggle, +# subsequent toggles just show/hide the workspace + +# Workspace rules (auto-launch apps when workspace first accessed) +workspace = special:term, on-created-empty:foot --app-id foot-term tmux +workspace = special:audio, on-created-empty:foot --app-id foot-audio pulsemixer +workspace = special:monitor, on-created-empty:foot --app-id foot-monitor gotop +workspace = special:music, on-created-empty:foot --app-id foot-music ncmpcpp +workspace = special:files, on-created-empty:foot --app-id foot-files ranger +workspace = special:htop, on-created-empty:foot --app-id foot-htop htop +workspace = special:network, on-created-empty:foot --app-id foot-network nmtui + +# Keybindings (single bind per scratchpad - just toggle visibility) +bind = $mod SHIFT, RETURN, togglespecialworkspace, term bind = $mod, A, togglespecialworkspace, audio -bind = $mod, A, exec, [workspace special:audio] pgrep -x pulsemixer || st -n spaudio -e pulsemixer -windowrulev2 = float, class:^(st)$, title:^(spaudio)$ -windowrulev2 = size 60% 60%, class:^(st)$, title:^(spaudio)$ -windowrulev2 = center, class:^(st)$, title:^(spaudio)$ -windowrulev2 = workspace special:audio, class:^(st)$, title:^(spaudio)$ - -# System monitor (was MODKEY+m -> spmon/gotop) bind = $mod, M, togglespecialworkspace, monitor -bind = $mod, M, exec, [workspace special:monitor] pgrep -x gotop || st -n spmon -e gotop -windowrulev2 = float, class:^(st)$, title:^(spmon)$ -windowrulev2 = size 60% 60%, class:^(st)$, title:^(spmon)$ -windowrulev2 = workspace special:monitor, class:^(st)$, title:^(spmon)$ - -# Music player (was MODKEY+slash -> spmp/ncmpcpp) bind = $mod, SLASH, togglespecialworkspace, music -bind = $mod, SLASH, exec, [workspace special:music] pgrep -x ncmpcpp || st -n spmp -e ncmpcpp -windowrulev2 = float, class:^(st)$, title:^(spmp)$ -windowrulev2 = size 60% 60%, class:^(st)$, title:^(spmp)$ -windowrulev2 = workspace special:music, class:^(st)$, title:^(spmp)$ - -# Terminal scratchpad (was MODKEY+Shift+Return -> spterm/tmux) -bind = $mod SHIFT, RETURN, togglespecialworkspace, term -bind = $mod SHIFT, RETURN, exec, [workspace special:term] pgrep -f "st.*spterm" || st -n spterm -e tmux -windowrulev2 = float, class:^(st)$, title:^(spterm)$ -windowrulev2 = size 60% 60%, class:^(st)$, title:^(spterm)$ -windowrulev2 = workspace special:term, class:^(st)$, title:^(spterm)$ - -# File manager (was MODKEY+f -> spfm/ranger) bind = $mod, F, togglespecialworkspace, files -bind = $mod, F, exec, [workspace special:files] pgrep -x ranger || st -n spfm -e ranger -windowrulev2 = float, class:^(st)$, title:^(spfm)$ -windowrulev2 = size 60% 60%, class:^(st)$, title:^(spfm)$ -windowrulev2 = workspace special:files, class:^(st)$, title:^(spfm)$ +bind = $mod SHIFT, H, togglespecialworkspace, htop -# Calculator (was MODKEY+x or MODKEY+c -> qalculate) +# Window rules (using app-id/class matching, Hyprland 0.53+ syntax) +# Terminal scratchpad +windowrule = match:class ^(foot-term)$, float on +windowrule = match:class ^(foot-term)$, size (monitor_w*0.6) (monitor_h*0.6) +windowrule = match:class ^(foot-term)$, center on + +# Audio mixer +windowrule = match:class ^(foot-audio)$, float on +windowrule = match:class ^(foot-audio)$, size (monitor_w*0.6) (monitor_h*0.6) +windowrule = match:class ^(foot-audio)$, center on + +# System monitor +windowrule = match:class ^(foot-monitor)$, float on +windowrule = match:class ^(foot-monitor)$, size (monitor_w*0.6) (monitor_h*0.6) +windowrule = match:class ^(foot-monitor)$, center on + +# Music player +windowrule = match:class ^(foot-music)$, float on +windowrule = match:class ^(foot-music)$, size (monitor_w*0.6) (monitor_h*0.6) +windowrule = match:class ^(foot-music)$, center on + +# File manager +windowrule = match:class ^(foot-files)$, float on +windowrule = match:class ^(foot-files)$, size (monitor_w*0.6) (monitor_h*0.6) +windowrule = match:class ^(foot-files)$, center on + +# Htop +windowrule = match:class ^(foot-htop)$, float on +windowrule = match:class ^(foot-htop)$, size (monitor_w*0.6) (monitor_h*0.6) +windowrule = match:class ^(foot-htop)$, center on + +# Network manager +windowrule = match:class ^(foot-network)$, float on +windowrule = match:class ^(foot-network)$, size (monitor_w*0.6) (monitor_h*0.6) +windowrule = match:class ^(foot-network)$, center on + +# Calculator (not a scratchpad, just launches app) bind = $mod, X, exec, qalculate-gtk -bind = $mod, C, exec, qalculate-gtk - -# Htop (was MODKEY+Shift+h -> sptop/htop) -bind = $mod SHIFT, H, togglespecialworkspace, htop -bind = $mod SHIFT, H, exec, [workspace special:htop] pgrep -x htop || st -n sptop -e htop -windowrulev2 = float, class:^(st)$, title:^(sptop)$ -windowrulev2 = size 60% 60%, class:^(st)$, title:^(sptop)$ -windowrulev2 = workspace special:htop, class:^(st)$, title:^(sptop)$ +bind = $mod, C, exec, hyprpicker -a # Media/hardware keys bindel = , XF86AudioRaiseVolume, exec, pactl set-sink-volume @DEFAULT_SINK@ +5% @@ -263,12 +293,9 @@ bind = CTRL ALT, SPACE, exec, amixer set Capture toggle && amixer get Capture | # Bluetooth (from DWM and sxhkdrc) bind = $mod SHIFT, B, exec, blueman-manager -# Screenshots (Wayland: grim + slurp instead of maim) -bind = $mod, S, exec, grim -g "$(slurp)" ~/pictures/screenshots/$(date +%Y.%m.%d-%H%M%S).png && notify-send "Screenshot" "Saved to ~/pictures/screenshots/" -bind = , Print, exec, grim ~/pictures/screenshots/$(date +%Y.%m.%d-%H%M%S).png && notify-send "Screenshot" "Full screen saved" - -# Color picker (Wayland: hyprpicker instead of xcolor) -# bind = $mod, C, exec, hyprpicker -a # conflicts with calculator, uncomment if needed +# Screenshots (grim + slurp + satty for annotation) +bind = $mod, S, exec, grim -g "$(slurp)" - | satty --filename - --output-filename ~/pictures/screenshots/$(date +%Y.%m.%d-%H%M%S).png +bind = , Print, exec, grim - | satty --filename - --output-filename ~/pictures/screenshots/$(date +%Y.%m.%d-%H%M%S).png # Lock screen (from sxhkdrc: super+Escape) bind = $mod, ESCAPE, exec, hyprlock @@ -276,10 +303,11 @@ bind = $mod, ESCAPE, exec, hyprlock # Touchpad toggle bind = $mod, F9, exec, toggle-touchpad -# Exit/session (from DWM) -bind = $mod SHIFT, Q, exec, wofi --show dmenu --prompt "Exit?" -D dmenu/exit="0" < /dev/null && hyprctl dispatch exit +# Exit/session +bind = $mod SHIFT, Q, exec, pgrep -x wlogout || wlogout -b 3 -T 600 -B 600 -L 1200 -R 1200 -c 20 -r 20 bind = $mod SHIFT, BACKSPACE, exit bind = $mod SHIFT, ESCAPE, exec, hyprctl reload +bind = CTRL ALT $mod, K, exec, hyprctl kill # Mouse bindings (from DWM buttons) bindm = $mod, mouse:272, movewindow |
