From a4e88b61a66dcc81d0044763d0f3460eed5964a7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sergio=20La=C3=ADn?= Date: Wed, 18 Oct 2023 18:58:21 +0200 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20feat(hypr):=20quake=20like=20termin?= =?UTF-8?q?al=20added?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .config/hypr/keybinds/binds.conf | 1 + .config/hypr/scripts/quake | 25 +++++++++++++++++++++++++ .config/hypr/themes/luna/rules.conf | 1 + 3 files changed, 27 insertions(+) create mode 100755 .config/hypr/scripts/quake diff --git a/.config/hypr/keybinds/binds.conf b/.config/hypr/keybinds/binds.conf index 88cddeeb..94c3049d 100644 --- a/.config/hypr/keybinds/binds.conf +++ b/.config/hypr/keybinds/binds.conf @@ -10,6 +10,7 @@ bind=SUPER,A,togglefloating, bind=SUPER,P,pseudo, bind=SUPER,F,fullscreen,0 bind=SUPER,Z,exec,pypr zoom +bindr=SUPERSHIFT, Return, exec, ~/.config/hypr/scripts/quake ## Applications bind=SUPER,W,exec,librewolf # Numpad dot diff --git a/.config/hypr/scripts/quake b/.config/hypr/scripts/quake new file mode 100755 index 00000000..bdb0ff4f --- /dev/null +++ b/.config/hypr/scripts/quake @@ -0,0 +1,25 @@ +#!/bin/env bash + +WORKSPACE=$(hyprctl clients -j | jq -rec '.[] | select(.class == "quake") | .workspace .name') +TERM_CMD="kitty -1 --class quake -o background_opacity=0.90 -o hide_window_decorations=yes -o remember_window_size=no" + +if [ "$WORKSPACE" = "" ]; then + echo "start" + hyprctl dispatch -- exec "[float;size 1600 500;center] $TERM_CMD" +elif [ "$WORKSPACE" == "special:quake" ]; then + echo "show" + + hyprctl activewindow | head -n1 | cut -f2 -d ' ' >/tmp/hypr-quake-address + + hyprctl activewindow | rg "fullscreen: 1" && hyprctl dispatch fullscreen + + hyprctl dispatch movetoworkspacesilent "+0,^(quake)\$" + hyprctl dispatch focuswindow "^(quake)\$" + hyprctl dispatch bringactivetotop +else + echo "hide" + + hyprctl dispatch movetoworkspacesilent "special:quake,^(quake)\$" + hyprctl dispatch focuswindow "address:0x$(cat /tmp/hypr-quake-address)" + hyprctl dispatch bringactivetotop +fi diff --git a/.config/hypr/themes/luna/rules.conf b/.config/hypr/themes/luna/rules.conf index b6405602..7338a6b6 100644 --- a/.config/hypr/themes/luna/rules.conf +++ b/.config/hypr/themes/luna/rules.conf @@ -48,6 +48,7 @@ windowrule = float, nm-connection-editor ## Other windowrulev2 = center,class:^(kitty)$ +windowrulev2 = stayfocused,class:quake windowrulev2 = opacity 0.80, class:^(Rofi)$ windowrule = animation slide, Rofi windowrulev2 = animation windowsOut, 0, class:(wleave)