Fix style inconsistencies in bin/ (#7518)
* Use (( )) for the numeric argument test Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> * Drop the quotes on a variable inside [[ ]] Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> * Use omarchy-pkg-drop instead of raw pacman -Rns omarchy-pkg-drop already filters to installed packages, so the 2>/dev/null || true suppression is no longer needed. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> * Drop defensive checks around default-set commands ttfx, imagemagick, and networkmanager are all in the default package set, so their commands are runtime invariants and should be invoked directly. Removing the nmcli guard also removes the degraded wifi fallthrough that only ran when nmcli was missing. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> --------- Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Fable 5
parent
3451719ca5
commit
9455496990
@@ -16,7 +16,7 @@ flags=()
|
||||
only=()
|
||||
declare -A excluded
|
||||
|
||||
while [[ $# -gt 0 ]]; do
|
||||
while (( $# > 0 )); do
|
||||
case "$1" in
|
||||
--force | --limits-only) flags+=("$1") ;;
|
||||
--except)
|
||||
|
||||
@@ -116,7 +116,7 @@ main() {
|
||||
local length payload url
|
||||
|
||||
# Detached worker: this is what actually runs yt-dlp and fires notifications.
|
||||
if [[ "${1:-}" == "--download" ]]; then
|
||||
if [[ ${1:-} == "--download" ]]; then
|
||||
download_url "$2"
|
||||
fi
|
||||
|
||||
|
||||
@@ -2,10 +2,6 @@
|
||||
|
||||
# omarchy:summary=Launch the Omarchy screensaver in the default terminal on the system with the correct font configuration.
|
||||
|
||||
if omarchy-cmd-missing ttfx; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Exit early if screensaver is already running
|
||||
pgrep -f '[o]rg.omarchy.screensaver' && exit 0
|
||||
|
||||
|
||||
@@ -34,7 +34,6 @@ print_status() {
|
||||
return
|
||||
fi
|
||||
|
||||
if omarchy-cmd-present nmcli; then
|
||||
nm=$(nmcli -t -f GENERAL.STATE,GENERAL.CONNECTION dev show "$device" 2>/dev/null)
|
||||
state=$(awk -F: '$1 == "GENERAL.STATE" { print $2; exit }' <<<"$nm")
|
||||
ssid=$(awk -F: '$1 == "GENERAL.CONNECTION" { print $2; exit }' <<<"$nm")
|
||||
@@ -47,10 +46,6 @@ print_status() {
|
||||
fi
|
||||
|
||||
printf 'wifi\t%s\t%s\t%s\n' "${ssid:-$device}" "$signal" "$freq"
|
||||
return
|
||||
fi
|
||||
|
||||
printf 'wifi\t%s\t\t\n' "$device"
|
||||
}
|
||||
|
||||
ping_latency_ms() {
|
||||
|
||||
@@ -10,7 +10,7 @@ if [[ -z $1 ]]; then
|
||||
fi
|
||||
|
||||
remove_php() {
|
||||
sudo pacman -Rns --noconfirm php composer php-sqlite xdebug 2>/dev/null || true
|
||||
omarchy-pkg-drop php composer php-sqlite xdebug
|
||||
}
|
||||
|
||||
case "$1" in
|
||||
@@ -50,7 +50,7 @@ laravel)
|
||||
;;
|
||||
symfony)
|
||||
echo -e "Removing Symfony CLI...\n"
|
||||
sudo pacman -Rns --noconfirm symfony-cli 2>/dev/null || true
|
||||
omarchy-pkg-drop symfony-cli
|
||||
;;
|
||||
python)
|
||||
echo -e "Removing Python...\n"
|
||||
|
||||
@@ -101,11 +101,6 @@ if [[ ! -f $image_path ]]; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if omarchy-cmd-missing magick; then
|
||||
echo "ImageMagick is required to convert logo images" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [[ $mode == "braille" ]]; then
|
||||
pixel_width=$((width * 2))
|
||||
pixel_height=$((height * 4))
|
||||
|
||||
Reference in New Issue
Block a user