From 93fe3b68647acadd1850160873258088b0a45671 Mon Sep 17 00:00:00 2001 From: Michael Housh Date: Thu, 2 Oct 2025 16:28:04 -0400 Subject: [PATCH] feat: Updates keybinds and removes close-all-windows script. --- env/.config/hypr/keybinds.conf | 4 +- env/.local/scripts/close-all-windows | 64 ---------------------------- 2 files changed, 2 insertions(+), 66 deletions(-) delete mode 100755 env/.local/scripts/close-all-windows diff --git a/env/.config/hypr/keybinds.conf b/env/.config/hypr/keybinds.conf index 0e24c75..45f4db4 100644 --- a/env/.config/hypr/keybinds.conf +++ b/env/.config/hypr/keybinds.conf @@ -66,7 +66,7 @@ bindd = $mainMod, U, [U]nifi, exec, bindd = $mainMod SHIFT, U, [U]ninstall desktop app, exec, $uninstallDesktop bindd = $mainMod, V, Clipboard history, exec, $clipboardHistory bindd = $mainMod, W, Close current window, killactive, -bindd = $mainMod SHIFT, W, Close all windows in active workspace, exec, $scripts/close-all-windows --active-workspace +bindd = $mainMod SHIFT, W, Close all windows in active workspace, exec, $scripts/close-windows --active-workspace # Switch to workspaces with mainMod + [0-9] bindd = $mainMod, 1, Switch to workspace [1], workspace, 1 @@ -142,7 +142,7 @@ bindd = $windowMod, 0, Move window to workspace 1[0], movetoworkspace, 10 bindd = $HYPER, J, Toggle split orientation, togglesplit # dwindle bindd = $HYPER, L, [L]ock computer, exec, hyprlock -bindd = $HYPER, W, Close all windows, exec, $scripts/close-all-windows +bindd = $HYPER, W, Close all windows, exec, $scripts/close-windows --all # Move active window to a workspace silently with HYPER + [0-9] bindd = $HYPER, 1, Move window to workspace silent [1], movetoworkspacesilent, 1 diff --git a/env/.local/scripts/close-all-windows b/env/.local/scripts/close-all-windows deleted file mode 100755 index 3e13fdd..0000000 --- a/env/.local/scripts/close-all-windows +++ /dev/null @@ -1,64 +0,0 @@ -#!/usr/bin/env bash - -usage() { - cat < - -OPTIONS: - -a | --active-workspace: Close all windows in the active workspace. - -s | --special : The name of the special workspace. - -h | --help: Show this help page. - -NOTE: - -If no options or workspace id is passed in, it will close all windows in all workspaces. - -EOF -} - -special_flag="0" -workspace_name="" -workspace_id="" -windows=() -SCRIPTS=${SCRIPTS} - -if [[ -z $SCRIPTS ]]; then - echo "SCRIPTS not set in the environment." - echo "Using: ~/.local/scripts" - SCRIPTS=~/.local/scripts -fi - -while [[ $# -gt 0 ]]; do - if [[ $1 =~ ^-s ]] || [[ $1 =~ ^--special ]]; then - shift - special_flag="1" - workspace_name=$1 - elif [[ $1 =~ ^-h ]] || [[ $1 =~ ^--help ]]; then - usage && exit 0 - elif [[ $1 =~ ^-a ]] || [[ $1 =~ ^--active-workspace ]]; then - workspace_id=$(hyprctl activeworkspace -j | jq -r '.id') - else - workspace_id=$1 - fi - shift -done - -if [[ $special_flag == "1" ]] && [[ -z $workspace_name ]]; then - echo -e "\n[ERROR]: must supply name of the special workspace.\n" - usage && exit 1 -fi - -if [[ -n $workspace_id ]]; then - windows+=($(hyprctl clients -j | jq -r ".[] | select(.workspace.id == $workspace_id) | .address")) -elif [[ -n $workspace_name ]]; then - windows+=($(hyprctl clients -j | jq -r ".[] | select(.workspace.name | contains(\"$workspace_name\")) | .address")) -else - windows+=($(hyprctl clients -j | jq -r ".[] | .address")) -fi - -$SCRIPTS/close-window $windows