From 430b60ad1fcedf6adecfad7b37aeaaf15c00f6a3 Mon Sep 17 00:00:00 2001 From: Thomas Voss Date: Tue, 28 Nov 2023 21:58:17 +0100 Subject: Hyprland: Add a submap for prompt-/dmenu-style scripts --- .config/hypr/.exrc | 1 + .config/hypr/.gitignore | 1 + .config/hypr/Makefile | 4 + .config/hypr/hyprland.conf | 165 ----------------------------------------- .config/hypr/hyprland.conf.in | 169 ++++++++++++++++++++++++++++++++++++++++++ .config/hypr/macros.m4 | 14 ++++ 6 files changed, 189 insertions(+), 165 deletions(-) create mode 100644 .config/hypr/.exrc create mode 100644 .config/hypr/.gitignore create mode 100644 .config/hypr/Makefile delete mode 100644 .config/hypr/hyprland.conf create mode 100644 .config/hypr/hyprland.conf.in create mode 100644 .config/hypr/macros.m4 diff --git a/.config/hypr/.exrc b/.config/hypr/.exrc new file mode 100644 index 0000000..a2e90ff --- /dev/null +++ b/.config/hypr/.exrc @@ -0,0 +1 @@ +autocmd BufWritePost hyprland.conf.in make diff --git a/.config/hypr/.gitignore b/.config/hypr/.gitignore new file mode 100644 index 0000000..66e0378 --- /dev/null +++ b/.config/hypr/.gitignore @@ -0,0 +1 @@ +hyprland.conf diff --git a/.config/hypr/Makefile b/.config/hypr/Makefile new file mode 100644 index 0000000..f091ebc --- /dev/null +++ b/.config/hypr/Makefile @@ -0,0 +1,4 @@ +all: hyprland.conf + +hyprland.conf: macros.m4 hyprland.conf.in + m4 macros.m4 hyprland.conf.in >$@ diff --git a/.config/hypr/hyprland.conf b/.config/hypr/hyprland.conf deleted file mode 100644 index b52bdc2..0000000 --- a/.config/hypr/hyprland.conf +++ /dev/null @@ -1,165 +0,0 @@ -exec-once = lux -S 50 -exec-once = wbg $XDG_PICTURES_DIR/bg.* -exec-once = eww daemon && eww open bar -exec-once = dbus-daemon --session --address=unix:path=$XDG_RUNTIME_DIR/bus -exec-once = mako - -monitor = , preferred, auto, 1 - -layerrule = noanim, overlay - -input { - accel_profile = "adaptive" - follow_mouse = 1 - kb_layout = mango, mango, mango - kb_variant = basic, coding, german - kb_options = lv3:lalt_switch,compose:ralt - repeat_delay = 180 - repeat_rate = 35 - sensitivity = 0.8 - natural_scroll = yes - - touchpad { - disable_while_typing = yes - natural_scroll = yes - } -} - -general { - border_size = 3 - col.active_border = rgb(FAA14F) - col.inactive_border = rgba(64727D7F) - gaps_in = 5 - gaps_out = 10 - cursor_inactive_timeout = 3 -} - -decoration { - blur { - enabled = yes - size = 1 - } - - dim_inactive = yes - dim_strength = 0.1 - rounding = 8 -} - -dwindle { - no_gaps_when_only = yes -} - -animations { - enabled = yes - animation = windows, 1, 3, default, slide - animation = border, 1, 2, default - animation = fade, 1, 1, default - animation = workspaces, 1, 3, default, slide -} - -gestures { - workspace_swipe = yes - workspace_swipe_fingers = 4 - workspace_swipe_distance = 400 - workspace_swipe_min_speed_to_force = 10 -} - -misc { - disable_hyprland_logo = true - disable_splash_rendering = true - enable_swallow = true - swallow_regex = ^(foot)$ -} - -$modkey = SUPER - -# WM Behavior -bind = $modkey, F, fullscreen, 0 -bind = $modkey, Q, killactive -bind = $modkey SHIFT, F, togglefloating - -# Programs -bind = $modkey, C, exec, exec foot ec -bind = $modkey, D, exec, exec woman 2>/dev/null -bind = $modkey, E, exec, exec emacsclient -c -a emacs -bind = $modkey, M, exec, exec foot aerc -bind = $modkey, P, exec, exec vlt get 2>/dev/null -bind = $modkey, U, exec, exec uni 2>/dev/null -bind = $modkey, W, exec, exec firefox -bind = $modkey, X, exec, exec chkb 2>/dev/null -bind = $modkey, Space, exec, exec fuzzel --log-level=warning --show-actions -bind = $modkey, Return, exec, exec foot -bind = , Print, exec, exec scst 2>/dev/null -bind = SHIFT, Print, exec, exec scst -f 2>/dev/null - -# Change focused window -bind = $modkey, H, movefocus, l -bind = $modkey, J, movefocus, d -bind = $modkey, K, movefocus, u -bind = $modkey, L, movefocus, r -bind = $modkey, left, movefocus, l -bind = $modkey, down, movefocus, d -bind = $modkey, up, movefocus, u -bind = $modkey, right, movefocus, r - -# Switch workspaces with modkey + [0-9] -bind = $modkey, 0, workspace, 1 -bind = $modkey, 1, workspace, 2 -bind = $modkey, 2, workspace, 3 -bind = $modkey, 3, workspace, 4 -bind = $modkey, 4, workspace, 5 -bind = $modkey, 5, workspace, 6 -bind = $modkey, 6, workspace, 7 -bind = $modkey, 7, workspace, 8 -bind = $modkey, 8, workspace, 9 -bind = $modkey, 9, workspace, 10 -bind = $modkey, 10, workspace, 1 -bind = $modkey, 11, workspace, 2 -bind = $modkey, 12, workspace, 3 -bind = $modkey, 13, workspace, 4 -bind = $modkey, 14, workspace, 5 -bind = $modkey, 15, workspace, 6 -bind = $modkey, 16, workspace, 7 -bind = $modkey, 17, workspace, 8 -bind = $modkey, 18, workspace, 9 -bind = $modkey, 19, workspace, 10 - -# Move active window to a workspace with modkey + SHIFT + [0-9] -bind = $modkey CONTROL, 0, movetoworkspace, 1 -bind = $modkey CONTROL, 1, movetoworkspace, 2 -bind = $modkey CONTROL, 2, movetoworkspace, 3 -bind = $modkey CONTROL, 3, movetoworkspace, 4 -bind = $modkey CONTROL, 4, movetoworkspace, 5 -bind = $modkey CONTROL, 5, movetoworkspace, 6 -bind = $modkey CONTROL, 6, movetoworkspace, 7 -bind = $modkey CONTROL, 7, movetoworkspace, 8 -bind = $modkey CONTROL, 8, movetoworkspace, 9 -bind = $modkey CONTROL, 9, movetoworkspace, 10 -bind = $modkey CONTROL, 10, movetoworkspace, 1 -bind = $modkey CONTROL, 11, movetoworkspace, 2 -bind = $modkey CONTROL, 12, movetoworkspace, 3 -bind = $modkey CONTROL, 13, movetoworkspace, 4 -bind = $modkey CONTROL, 14, movetoworkspace, 5 -bind = $modkey CONTROL, 15, movetoworkspace, 6 -bind = $modkey CONTROL, 16, movetoworkspace, 7 -bind = $modkey CONTROL, 17, movetoworkspace, 8 -bind = $modkey CONTROL, 18, movetoworkspace, 9 -bind = $modkey CONTROL, 19, movetoworkspace, 10 - -# Media keys -binde = , xf86audiomute, exec, amixer -q sset Master toggle -binde = , xf86audiolowervolume, exec, amixer -q sset Master 5%- -binde = , xf86audioraisevolume, exec, amixer -q sset Master 5%+ -binde = , xf86audiomedia, exec, foot -e nvim ~/.config/hypr/hyprland.conf -binde = , xf86monbrightnessup, exec, lux -I 5 -binde = , xf86monbrightnessdown, exec, lux -D 5 -bind = SHIFT, xf86monbrightnessup, exec, lux -S 50 -bind = SHIFT, xf86monbrightnessdown, exec, lux -s 0 - -# Scroll through existing workspaces with modkey + scroll -bind = $modkey, mouse_down, workspace, e+1 -bind = $modkey, mouse_up, workspace, e-1 - -# Move/resize windows with modkey + LMB/RMB and dragging -bindm = $modkey, mouse:272, movewindow -bindm = $modkey, mouse:273, resizewindow diff --git a/.config/hypr/hyprland.conf.in b/.config/hypr/hyprland.conf.in new file mode 100644 index 0000000..eee9d5e --- /dev/null +++ b/.config/hypr/hyprland.conf.in @@ -0,0 +1,169 @@ +exec-once = lux -S 50 +exec-once = wbg $XDG_PICTURES_DIR/bg.* +exec-once = eww daemon && eww open bar +exec-once = dbus-daemon --session --address=unix:path=$XDG_RUNTIME_DIR/bus +exec-once = mako + +monitor = , preferred, auto, 1 + +layerrule = noanim, overlay + +input { + accel_profile = "adaptive" + follow_mouse = 1 + kb_layout = mango, mango, mango + kb_variant = basic, coding, german + kb_options = lv3:lalt_switch,compose:ralt + repeat_delay = 180 + repeat_rate = 35 + sensitivity = 0.8 + natural_scroll = yes + + touchpad { + disable_while_typing = yes + natural_scroll = yes + } +} + +general { + border_size = 3 + col.active_border = rgb(FAA14F) + col.inactive_border = rgba(64727D7F) + gaps_in = 5 + gaps_out = 10 + cursor_inactive_timeout = 3 +} + +decoration { + blur { + enabled = yes + size = 1 + } + + dim_inactive = yes + dim_strength = 0.1 + rounding = 8 +} + +dwindle { + no_gaps_when_only = yes +} + +animations { + enabled = yes + animation = windows, 1, 3, default, slide + animation = border, 1, 2, default + animation = fade, 1, 1, default + animation = workspaces, 1, 3, default, slide +} + +gestures { + workspace_swipe = yes + workspace_swipe_fingers = 4 + workspace_swipe_distance = 400 + workspace_swipe_min_speed_to_force = 10 +} + +misc { + disable_hyprland_logo = true + disable_splash_rendering = true + enable_swallow = true + swallow_regex = ^(foot)$ +} + +$modkey = SUPER + +# WM behavior +bind = $modkey, F, fullscreen, 0 +bind = $modkey, Q, killactive +bind = $modkey SHIFT, F, togglefloating + +# Global programs +bind = $modkey, M, exec, exec foot aerc 2>/dev/null +bind = $modkey, Return, exec, exec foot +bind = $modkey, Space, exec, exec fuzzel --log-level=warning --show-actions +bind = , Print, exec, exec scst 2>/dev/null +bind = SHIFT, Print, exec, exec scst -f 2>/dev/null + +# Prompt-/Dmenu-style programs +__submap(prompt, P, [ + __subbind(C, foot ec) + __subbind(D, woman) + __subbind(E, emacsclient -c -a emacs) + __subbind(P, vlt get) + __subbind(U, uni) + __subbind(W, firefox) + __subbind(X, chkb) +]) + +# Change focused window +bind = $modkey, H, movefocus, l +bind = $modkey, J, movefocus, d +bind = $modkey, K, movefocus, u +bind = $modkey, L, movefocus, r +bind = $modkey, left, movefocus, l +bind = $modkey, down, movefocus, d +bind = $modkey, up, movefocus, u +bind = $modkey, right, movefocus, r + +# Switch workspaces with modkey + [0-9] +bind = $modkey, 0, workspace, 1 +bind = $modkey, 1, workspace, 2 +bind = $modkey, 2, workspace, 3 +bind = $modkey, 3, workspace, 4 +bind = $modkey, 4, workspace, 5 +bind = $modkey, 5, workspace, 6 +bind = $modkey, 6, workspace, 7 +bind = $modkey, 7, workspace, 8 +bind = $modkey, 8, workspace, 9 +bind = $modkey, 9, workspace, 10 +bind = $modkey, 10, workspace, 1 +bind = $modkey, 11, workspace, 2 +bind = $modkey, 12, workspace, 3 +bind = $modkey, 13, workspace, 4 +bind = $modkey, 14, workspace, 5 +bind = $modkey, 15, workspace, 6 +bind = $modkey, 16, workspace, 7 +bind = $modkey, 17, workspace, 8 +bind = $modkey, 18, workspace, 9 +bind = $modkey, 19, workspace, 10 + +# Move active window to a workspace with modkey + SHIFT + [0-9] +bind = $modkey CONTROL, 0, movetoworkspace, 1 +bind = $modkey CONTROL, 1, movetoworkspace, 2 +bind = $modkey CONTROL, 2, movetoworkspace, 3 +bind = $modkey CONTROL, 3, movetoworkspace, 4 +bind = $modkey CONTROL, 4, movetoworkspace, 5 +bind = $modkey CONTROL, 5, movetoworkspace, 6 +bind = $modkey CONTROL, 6, movetoworkspace, 7 +bind = $modkey CONTROL, 7, movetoworkspace, 8 +bind = $modkey CONTROL, 8, movetoworkspace, 9 +bind = $modkey CONTROL, 9, movetoworkspace, 10 +bind = $modkey CONTROL, 10, movetoworkspace, 1 +bind = $modkey CONTROL, 11, movetoworkspace, 2 +bind = $modkey CONTROL, 12, movetoworkspace, 3 +bind = $modkey CONTROL, 13, movetoworkspace, 4 +bind = $modkey CONTROL, 14, movetoworkspace, 5 +bind = $modkey CONTROL, 15, movetoworkspace, 6 +bind = $modkey CONTROL, 16, movetoworkspace, 7 +bind = $modkey CONTROL, 17, movetoworkspace, 8 +bind = $modkey CONTROL, 18, movetoworkspace, 9 +bind = $modkey CONTROL, 19, movetoworkspace, 10 + +# Media keys +binde = , xf86audiomute, exec, amixer -q sset Master toggle +binde = , xf86audiolowervolume, exec, amixer -q sset Master 5%- +binde = , xf86audioraisevolume, exec, amixer -q sset Master 5%+ +binde = , xf86audiomedia, exec, foot -e nvim ~/.config/hypr/hyprland.conf +binde = , xf86monbrightnessup, exec, lux -I 5 +binde = , xf86monbrightnessdown, exec, lux -D 5 +bind = SHIFT, xf86monbrightnessup, exec, lux -S 50 +bind = SHIFT, xf86monbrightnessdown, exec, lux -s 0 + +# Scroll through existing workspaces with modkey + scroll +bind = $modkey, mouse_down, workspace, e+1 +bind = $modkey, mouse_up, workspace, e-1 + +# Move/resize windows with modkey + LMB/RMB and dragging +bindm = $modkey, mouse:272, movewindow +bindm = $modkey, mouse:273, resizewindow diff --git a/.config/hypr/macros.m4 b/.config/hypr/macros.m4 new file mode 100644 index 0000000..f466f63 --- /dev/null +++ b/.config/hypr/macros.m4 @@ -0,0 +1,14 @@ +changequote([,]) + +define(__submap, [ + bind = $modkey, $2, submap, $1 + submap = $1 + $3 + bind = , escape, submap, reset + submap = reset +]) + +define(__subbind, [ + bind = , $1, exec, exec $2 2>/dev/null + bind = , $1, submap, reset +]) -- cgit v1.2.3