fix: standardize shebangs, error handling, and minor issues in x-* scripts

Normalize shebangs to #!/usr/bin/env bash (x-env-list, x-localip).
Use XDG_CONFIG_HOME in x-change-alacritty-theme. Remove unused
VERBOSE variable in x-multi-ping. Add set -euo pipefail to x-when-down
and x-when-up. Add usage header to x-term-colors. Fix notify-call
to notify-send.sh in x-record.
This commit is contained in:
2026-02-05 20:52:34 +02:00
parent efd9eebc85
commit 7c9096d666
8 changed files with 14 additions and 13 deletions

View File

@@ -8,7 +8,7 @@ set -euo pipefail
# Enable verbosity with VERBOSE=1
VERBOSE="${VERBOSE:-0}"
A_DIR="$HOME/.config/alacritty"
A_DIR="${XDG_CONFIG_HOME:-$HOME/.config}/alacritty"
# Function to print usage information
usage()

View File

@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
#
# List environment variables grouped by the first part before underscore
# protecting environment variables that possibly contain sensitive information.

View File

@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
#
# x-localip: script to display the local IP addresses of the system
#

View File

@@ -39,7 +39,6 @@
# Defaults
LOOP=0
SLEEP=1
VERBOSE=0
TIMEOUT=5
usage()
@@ -60,8 +59,6 @@ while [[ $# -gt 0 ]]; do
exit 0
;;
--verbose)
# shellcheck disable=SC2034
VERBOSE=1
shift
;;
--loop | --forever)

View File

@@ -35,7 +35,7 @@ msg()
# Notify function
notify()
{
notify-call --replace-file "$replace_id" "$@"
notify-send.sh --replace-file "$replace_id" "$@"
}
# Stop recording function

View File

@@ -1,11 +1,13 @@
#!/usr/bin/env bash
#
# This file echoes a bunch of 24-bit color codes
# to the terminal to demonstrate its functionality.
# The foreground escape sequence is ^[38;2;<r>;<g>;<b>m
# The background escape sequence is ^[48;2;<r>;<g>;<b>m
# <r> <g> <b> range from 0 to 255 inclusive.
# The escape sequence ^[0m returns output to default
# Display 24-bit terminal color test.
#
# Usage: x-term-colors
#
# The foreground escape sequence is ^[38;2;<r>;<g>;<b>m
# The background escape sequence is ^[48;2;<r>;<g>;<b>m
# <r> <g> <b> range from 0 to 255 inclusive.
# The escape sequence ^[0m returns output to default
setBackgroundColor()
{

View File

@@ -1,4 +1,5 @@
#!/usr/bin/env bash
set -euo pipefail
#
# Wait until a given host is down (determined by ping) then execute the
# given command

View File

@@ -1,4 +1,5 @@
#!/usr/bin/env bash
set -euo pipefail
#
# Wait until a given host is online (determined by ping) then execute the
# given command