diff options
| -rw-r--r-- | CHANGELOG.md | 3 | ||||
| -rw-r--r-- | config/hypr/configs/Keybinds.conf | 2 | ||||
| -rw-r--r-- | config/hypr/lua/keybinds.lua | 2 | ||||
| -rwxr-xr-x | config/hypr/scripts/toggle-qs-hyprview.sh | 15 |
4 files changed, 20 insertions, 2 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md index 7be0fe09..18c349d7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,6 +18,9 @@ ## Updated: +- Added script to toggle `qs-hyprview` + - It checks that it's running and if not restarts it +- Quickshell config files now compatible with all debian versions - QuickShell config files were blocked on Trixie - Trixie now supports quickshell, removed block - QuickShell overview to current version diff --git a/config/hypr/configs/Keybinds.conf b/config/hypr/configs/Keybinds.conf index c867b338..d7433ec6 100644 --- a/config/hypr/configs/Keybinds.conf +++ b/config/hypr/configs/Keybinds.conf @@ -141,7 +141,7 @@ bindd = $mainMod ALT, S, Toggle scrolling V/H, exec, bash -c '[[ $(hyprctl getop $layout = 'smartgrid' # Or, using XDG_CONFIG_HOME: -bind = ctrl, tab, exec, qs -c qs-hyprview ipc call expose toggle $layout +bind = ctrl, tab, exec, $scriptsDir/toggle-qs-hyprview.sh $layout # Cycle windows; if floating bring to top bindd = ALT, Tab, Cycle next window, cyclenext diff --git a/config/hypr/lua/keybinds.lua b/config/hypr/lua/keybinds.lua index 25c72490..82ccbfa7 100644 --- a/config/hypr/lua/keybinds.lua +++ b/config/hypr/lua/keybinds.lua @@ -333,7 +333,7 @@ bind( "CTRL", "tab", exec_cmd( - "qs -c qs-hyprview ipc call expose toggle " + "$HOME/.config/hypr/scripts/toggle-qs-hyprview.sh " .. qs_hyprview_layout ), { description = "qs-hyprview toggle" } diff --git a/config/hypr/scripts/toggle-qs-hyprview.sh b/config/hypr/scripts/toggle-qs-hyprview.sh new file mode 100755 index 00000000..4f00762e --- /dev/null +++ b/config/hypr/scripts/toggle-qs-hyprview.sh @@ -0,0 +1,15 @@ +#!/usr/bin/env bash + +layout="${1:-smartgrid}" +config_name="qs-hyprview" +config_path="${XDG_CONFIG_HOME:-$HOME/.config}/quickshell/${config_name}" + +if ! pgrep -u "${UID}" -f "qs .* -p ${config_path}($| )" >/dev/null 2>&1; then + qs --log-rules "qt.qpa.wayland.textinput.warning=false" -p "${config_path}" >/dev/null 2>&1 & + sleep 0.2 +fi + +if ! qs -c "${config_name}" ipc call expose toggle "${layout}" >/dev/null 2>&1; then + sleep 0.3 + qs -c "${config_name}" ipc call expose toggle "${layout}" +fi |
