diff --git a/env/.config/utils-launcher/config.json b/env/.config/utils-launcher/config.json index 219999b..b02cd13 100644 --- a/env/.config/utils-launcher/config.json +++ b/env/.config/utils-launcher/config.json @@ -32,7 +32,7 @@ { "name": "Windows - window stats / picker", "description": "View information from hyprctl about all the current windows.\n\nAllows you to choose an action you would like to perform on the selected window.", - "exec": "$SCRIPTS/hypr/windowctl" + "exec": "$SCRIPTS/hypr/windowctl picker" }, { "name": "Windows - close in active workspace", diff --git a/env/.local/scripts/hypr/preview-stats b/env/.local/scripts/hypr/preview-stats index a596fc1..2899634 100755 --- a/env/.local/scripts/hypr/preview-stats +++ b/env/.local/scripts/hypr/preview-stats @@ -1,8 +1,14 @@ #!/usr/bin/env bash +set -e +set -o nounset +set -o pipefail + SCRIPTS=${SCRIPTS:-$HOME/.local/scripts} THIS_FILE=${BASH_SOURCE[0]} -THIS=$(basename $THIS_FILE) +LOG_LABEL=$(basename $THIS_FILE) +THIS=${THIS:-$LOG_LABEL} +LOG_FILE=${LOG_FILE:-/tmp/$LOG_LABEL.log} usage() { cat < : Get monitor data, optionally providing keys to return. window
: Get window data, optionally providing keys to return. @@ -52,7 +58,7 @@ call_jq() { # Setup logging file and label. source "$SCRIPTS/hypr/logging" -setup-logging "$THIS" +setup-logging "$LOG_FILE" "$LOG_LABEL" # Early out check for help flag if [[ $@ =~ -h ]] || [[ $@ =~ --help ]]; then @@ -63,9 +69,9 @@ elif [[ ! $# -ge 2 ]] || [[ $# -gt 3 ]]; then exit 1 fi -mode=$1 -arg=$2 -arg2=$3 # either optional keys or utils config. +mode=${1:-""} +arg=${2:-""} +arg2=${3:-""} # either optional keys or utils config. if [[ $mode == "monitor" ]]; then call_jq monitors "select(.id == $arg)" "$arg2" diff --git a/env/.local/scripts/hypr/utils-launcher b/env/.local/scripts/hypr/utils-launcher index a65bd1e..bde1e6d 100755 --- a/env/.local/scripts/hypr/utils-launcher +++ b/env/.local/scripts/hypr/utils-launcher @@ -1,7 +1,16 @@ #!/usr/bin/env bash +set -e +set -o nounset +set -o pipefail + +FZF_DEFAULT_OPTS=${FZF_DEFAULT_OPTS:-""} THIS_FILE=${BASH_SOURCE[0]} -THIS=$(basename $THIS_FILE) +LOG_LABEL=$(basename $THIS_FILE) +THIS=${THIS:-$LOG_LABEL} +LOG_FILE=${LOG_FILE:-/tmp/$LOG_LABEL.log} +SCRIPTS=${SCRIPTS:-$HOME/.local/scripts} +XDG_CONFIG_HOME=${XDG_CONFIG_HOME} usage() { cat <>>>>>> Stashed changes