File tree Expand file tree Collapse file tree 2 files changed +46
-1
lines changed
Expand file tree Collapse file tree 2 files changed +46
-1
lines changed Original file line number Diff line number Diff line change @@ -23,7 +23,7 @@ declare-option -docstring \
2323"Ordered list of windowing modules to try and load. An empty list disables
2424both automatic module loading and environment detection, enabling complete
2525manual control of the module loading." \
26- str -list windowing_modules ' tmux' ' screen' ' zellij' ' kitty' ' iterm' ' appleterminal' ' sway' ' wayland' ' x11' ' wezterm'
26+ str -list windowing_modules ' tmux' ' screen' ' zellij' ' kitty' ' iterm' ' appleterminal' ' sway' ' hyprland ' ' wayland' ' x11' ' wezterm'
2727
2828declare-option -docstring %{
2929 windowing module to use in the ' terminal' command
Original file line number Diff line number Diff line change 1+ # https://hypr.land
2+ provide-module hyprland %{
3+
4+ # Ensure we're actually in Hyprland
5+ evaluate-commands %sh{
6+ [ -z " ${kak_opt_windowing_modules} " ] ||
7+ [ " $XDG_CURRENT_DESKTOP " == " Hyprland" ] &&
8+ [ -n " $HYPRLAND_INSTANCE_SIGNATURE " ] ||
9+ echo ' fail hyprland not detected'
10+ }
11+
12+ require-module ' wayland'
13+
14+ alias global hyprland-terminal-window wayland-terminal-window
15+
16+ define-command hyprland-focus-pid -hidden %{
17+ evaluate-commands %sh{
18+ pid=$kak_client_pid
19+ while [ " $( hyprctl dispatch focuswindow pid:$pid ) " != " ok" ]; do
20+ pid=$( ps -p $pid -o ppid= | tr -d " " )
21+ if [ -z $pid ] || [ $pid -le 1 ]; then
22+ echo " fail Can't find PID for Sway window to focus"
23+ break
24+ fi
25+ done
26+ }
27+ }
28+
29+ define-command hyprland-focus -params ..1 -docstring '
30+ hyprland-focus [<kakoune_client>]: focus a given client ' ' s window .
31+ If no client is passed, then the current client is used' \
32+ %{
33+ evaluate-commands %sh{
34+ if [ $# -eq 1 ]; then
35+ printf " evaluate-commands -client '%s' hyprland-focus-pid" " $1 "
36+ else
37+ echo hyprland-focus-pid
38+ fi
39+ }
40+ }
41+ complete-command -menu hyprland-focus client
42+
43+ alias global focus hyprland-focus
44+
45+ }
You can’t perform that action at this time.
0 commit comments