From d0383441d1da2998e1757b663264e866a9747722 Mon Sep 17 00:00:00 2001 From: Don Williams Date: Mon, 13 Jul 2026 16:31:09 -0400 Subject: toggle-qs-hyprview checks/restarts service b4 toggle hyprview Signed-off-by: Don Williams On branch development Your branch is up to date with 'origin/development'. Changes to be committed: modified: CHANGELOG.md modified: config/hypr/configs/Keybinds.conf modified: config/hypr/lua/keybinds.lua new file: config/hypr/scripts/toggle-qs-hyprview.sh --- CHANGELOG.md | 3 +++ config/hypr/configs/Keybinds.conf | 2 +- config/hypr/lua/keybinds.lua | 2 +- config/hypr/scripts/toggle-qs-hyprview.sh | 15 +++++++++++++++ 4 files changed, 20 insertions(+), 2 deletions(-) create mode 100755 config/hypr/scripts/toggle-qs-hyprview.sh 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 -- cgit v1.2.3