From 4595be05ff14bca88141394d1a6e52d9c417e317 Mon Sep 17 00:00:00 2001 From: srdusr Date: Tue, 1 Aug 2023 15:32:24 +0200 Subject: Adjustments to script (wmctrl function) --- dropdown | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) (limited to 'dropdown') diff --git a/dropdown b/dropdown index 68b8816..eb8f697 100755 --- a/dropdown +++ b/dropdown @@ -181,8 +181,9 @@ if [ -z "$my_term" ]; then esac fi -# Function to toggle the visibility of the dropdown terminal -toggle_dropdown() { + +# Check if wmctrl is available +if command -v wmctrl > /dev/null 2>&1; then # Get the window ID of the dropdown terminal id="$(wmctrl -l | grep "dropdown" | awk '{print $1}')" @@ -197,11 +198,6 @@ toggle_dropdown() { wmctrl -i -r "$id" -b add,hidden fi fi -} - -# Check if wmctrl is available -if command -v wmctrl > /dev/null 2>&1; then - toggle_dropdown else echo "Window manipulation requires wmctrl. Install it and try again." exit 1 -- cgit v1.2.3