From: Andre Ramnitz Date: Wed, 20 Dec 2023 07:41:25 +0000 (+0100) Subject: hypr: add window switcher script X-Git-Tag: v0.2~295 X-Git-Url: https://git.ramnitz.eu/?a=commitdiff_plain;h=ddb3099b9498ed87b8f4a6daf48cbe1d24743dac;p=dotfiles.git hypr: add window switcher script --- diff --git a/config/fuzzel/fuzzel-wide.ini b/config/fuzzel/fuzzel-wide.ini new file mode 100644 index 00000000..df2f1bd2 --- /dev/null +++ b/config/fuzzel/fuzzel-wide.ini @@ -0,0 +1,94 @@ +# output= +font=monospace:size=12 +# dpi-aware=auto +# prompt="> " +icon-theme=breeze-dark +# icons-enabled=yes +# fields=filename,name,generic +# password-character=* +# filter-desktop=no +# fuzzy=yes +# show-actions=no +terminal=foot -e +# launch-prefix= + +# anchor=center +lines=20 +width=80 +# tabs=8 +# horizontal-pad=40 +# vertical-pad=8 +# inner-pad=0 + +# image-size-ratio=0.5 + +# line-height= +line-height=20 +# letter-spacing=0 + +# layer = top +# exit-on-keyboard-focus-loss = yes + +[colors] +background=282828dd +text=d8d8d8ff +# match=cb4b16ff +selection=add8e6dd +selection-text=282828ff +# selection-match=cb4b16ff +border=595959ff + +[border] +width=2 +# radius=10 + +[dmenu] +# mode=text # text|index +# exit-immediately-if-empty=no + +[key-bindings] +# cancel=Escape Control+g +# execute=Return KP_Enter Control+y +# execute-or-next=Tab +# execute-input=Shift+Return Shift+KP_Enter +# cursor-left=Left Control+b +# cursor-left-word=Control+Left Mod1+b +# cursor-right=Right Control+f +# cursor-right-word=Control+Right Mod1+f +# cursor-home=Home Control+a +# cursor-end=End Control+e +# delete-prev=BackSpace +# delete-prev-word=Mod1+BackSpace Control+BackSpace +# delete-next=Delete KP_Delete Control+d +# delete-next-word=Mod1+d Control+Delete Control+KP_Delete +# delete-line=Control+k +# prev=Up Control+p +# prev-with-wrap=ISO_Left_Tab +# prev-page=Page_Up KP_Page_Up +# next=Down Control+n +# next-with-wrap=none +# next-page=Page_Down KP_Page_Down + +# custom-N: *dmenu mode only*. Like execute, but with a non-zero +# exit-code; custom-1 exits with code 10, custom-2 with 11, custom-3 +# with 12, and so on. + +# custom-1=Mod1+1 +# custom-2=Mod1+2 +# custom-3=Mod1+3 +# custom-4=Mod1+4 +# custom-5=Mod1+5 +# custom-6=Mod1+6 +# custom-7=Mod1+7 +# custom-8=Mod1+8 +# custom-9=Mod1+9 +# custom-10=Mod1+0 +# custom-11=Mod1+exclam +# custom-12=Mod1+at +# custom-13=Mod1+numbersign +# custom-14=Mod1+dollar +# custom-15=Mod1+percent +# custom-16=Mod1+dead_circumflex +# custom-17=Mod1+ampersand +# custom-18=Mod1+asterix +# custom-19=Mod1+parentleft diff --git a/config/hypr/hyprland.conf b/config/hypr/hyprland.conf index 10e343ef..4bc30040 100644 --- a/config/hypr/hyprland.conf +++ b/config/hypr/hyprland.conf @@ -206,6 +206,7 @@ bind = ALT SHIFT, F12, exec, ~/.config/hypr/scripts/gamemode.sh bind = $mainmod, G, togglegroup bind = $mainmod SHIFT, G, lockactivegroup, toggle bind = $mainmod, TAB, focuscurrentorlast +bind = ALT, TAB, exec, ~/.config/hypr/scripts/windowswitch-rg.sh # Move focus with mainMod + arrow keys bind = $mainmod, left, movefocus, l @@ -264,16 +265,16 @@ 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, movetoworkspace, 1 -bind = $mainmod SHIFT, 2, movetoworkspace, 2 -bind = $mainmod SHIFT, 3, movetoworkspace, 3 -bind = $mainmod SHIFT, 4, movetoworkspace, 4 -bind = $mainmod SHIFT, 5, movetoworkspace, 5 -bind = $mainmod SHIFT, 6, movetoworkspace, 6 -bind = $mainmod SHIFT, 7, movetoworkspace, 7 -bind = $mainmod SHIFT, 8, movetoworkspace, 8 -bind = $mainmod SHIFT, 9, movetoworkspace, 9 -bind = $mainmod SHIFT, 0, movetoworkspace, 10 +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 # Scroll through existing workspaces with mainMod + scroll bind = $mainmod, mouse_down, workspace, e+1 diff --git a/config/hypr/scripts/windowswitch-rg.sh b/config/hypr/scripts/windowswitch-rg.sh new file mode 100755 index 00000000..8f3cf352 --- /dev/null +++ b/config/hypr/scripts/windowswitch-rg.sh @@ -0,0 +1,5 @@ +#!/bin/bash + +hyprctl clients | rg ^Window | rg -v '> :' | fuzzel --config="$HOME"/.config/fuzzel/fuzzel-wide.ini -d | awk '{print $2}' | \ + xargs -I{} hyprctl dispatcher focuswindow "address:0x{}" +