mirror of
https://github.com/arthur-pbty/arthur-os.git
synced 2026-08-01 20:28:16 +02:00
Consistency
This commit is contained in:
@@ -44,7 +44,7 @@ if [[ $shell_output == "true" ]]; then
|
||||
start=$(cat /sys/class/power_supply/BAT*/charge_control_start_threshold 2>/dev/null | head -1)
|
||||
|
||||
if [[ -n $end ]]; then
|
||||
if [[ -n $start && $start != "$end" ]]; then
|
||||
if [[ -n $start && $start != $end ]]; then
|
||||
printf 'threshold\t%s-%s%%\n' "$start" "$end"
|
||||
else
|
||||
printf 'threshold\t%s%%\n' "$end"
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
# `cursor-surface`, `slider`, `toggle`, `dropdown`, etc. Unknown names
|
||||
# are ignored and the gallery opens at its normal default position.
|
||||
|
||||
if [[ $# -gt 0 && -n $1 ]]; then
|
||||
if (( $# > 0 )) && [[ -n $1 ]]; then
|
||||
section="$1"
|
||||
payload=$(printf '{"section":"%s"}' "${section//\"/}")
|
||||
else
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
# omarchy:summary=Returns true when an external monitor is physically connected.
|
||||
|
||||
for status in /sys/class/drm/card*-*/status; do
|
||||
[[ "$status" == *-eDP-*/status ]] && continue
|
||||
[[ "$(<"$status")" == "connected" ]] && exit 0
|
||||
[[ $status == *-eDP-*/status ]] && continue
|
||||
[[ $(< $status) == "connected" ]] && exit 0
|
||||
done
|
||||
exit 1
|
||||
|
||||
@@ -37,7 +37,7 @@ export PROTONPATH=GE-Proton
|
||||
export GAMEID=umu-battlenet
|
||||
export PROTON_VERB=run
|
||||
|
||||
if [[ -f "$LAUNCHER" ]]; then
|
||||
if [[ -f $LAUNCHER ]]; then
|
||||
echo "Battle.net is already installed at $PREFIX."
|
||||
launched_installer=0
|
||||
else
|
||||
|
||||
@@ -25,4 +25,4 @@ elif omarchy-hw-nvidia-without-gsp; then
|
||||
PACKAGES+=(lib32-nvidia-580xx-utils)
|
||||
fi
|
||||
|
||||
[[ ${#PACKAGES[@]} -gt 0 ]] && omarchy-pkg-add "${PACKAGES[@]}"
|
||||
(( ${#PACKAGES[@]} > 0 )) && omarchy-pkg-add "${PACKAGES[@]}"
|
||||
|
||||
@@ -32,7 +32,7 @@ EOF
|
||||
esac
|
||||
done
|
||||
|
||||
if [[ ! -f "$LAUNCHER" ]]; then
|
||||
if [[ ! -f $LAUNCHER ]]; then
|
||||
echo "Battle.net is not installed. Run omarchy-install-gaming-battlenet first." >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
@@ -17,7 +17,7 @@ usage() {
|
||||
echo "Usage: omarchy-menu-images [--selected <image>] [--print-name] [--show-labels] [--filterable] [--lazy-thumbnails] [--preload] [--cache-only] <image-dir>..."
|
||||
}
|
||||
|
||||
while [[ $# -gt 0 ]]; do
|
||||
while (( $# > 0 )); do
|
||||
case "$1" in
|
||||
--selected)
|
||||
if (( $# < 2 )); then
|
||||
@@ -199,7 +199,7 @@ elif [[ $rows_cache_hit != true ]]; then
|
||||
for image in "${image_files[@]}"; do
|
||||
thumbnail=$(thumbnail_for "$image")
|
||||
[[ -n $thumbnail ]] || continue
|
||||
if [[ $lazy_thumbnails == true && $cache_only != true && $thumbnail == "$image" ]]; then
|
||||
if [[ $lazy_thumbnails == true && $cache_only != true && $thumbnail == $image ]]; then
|
||||
rows_cacheable=false
|
||||
fi
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
# Render a Plymouth login-screen preview PNG by compositing the staged omarchy
|
||||
# theme assets (recolored with the given text color) onto the background.
|
||||
|
||||
if [[ $# -ne 4 ]]; then
|
||||
if (( $# != 4 )); then
|
||||
echo "Usage: omarchy-plymouth-preview <background-hex> <text-hex> <path-to-logo.png> <output-path>" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
# rebuilds the initramfs. Also syncs the SDDM login screen (the post-logout
|
||||
# screen) with the same colors and logo so boot/login stay visually unified.
|
||||
|
||||
if [[ $# -ne 3 ]]; then
|
||||
if (( $# != 3 )); then
|
||||
echo "Usage: omarchy-plymouth-set <background-hex> <text-hex> <path-to-logo.png>" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
# Resolve a theme by name and apply its unlock.png + colors.toml as the
|
||||
# Plymouth boot screen via omarchy-plymouth-set.
|
||||
|
||||
if [[ $# -ne 1 ]]; then
|
||||
if (( $# != 1 )); then
|
||||
echo "Usage: omarchy-plymouth-set-by-theme <theme-name>" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
@@ -9,7 +9,7 @@ set_fallback_default_browser() {
|
||||
local current_browser
|
||||
current_browser=$(xdg-settings get default-web-browser)
|
||||
|
||||
if [[ $current_browser != "$1" ]]; then
|
||||
if [[ $current_browser != $1 ]]; then
|
||||
return
|
||||
fi
|
||||
|
||||
|
||||
+2
-2
@@ -10,7 +10,7 @@ if [[ ${1:-} == "-q" ]]; then
|
||||
shift
|
||||
fi
|
||||
|
||||
if [[ $# -eq 0 || $1 == "-h" || $1 == "--help" ]]; then
|
||||
if (( $# == 0 )) || [[ $1 == "-h" || $1 == "--help" ]]; then
|
||||
cat <<USAGE
|
||||
Usage: omarchy-shell [-q] <target> <method> [args...]
|
||||
|
||||
@@ -45,7 +45,7 @@ fi
|
||||
|
||||
SHELL_QML="$OMARCHY_PATH/shell/shell.qml"
|
||||
|
||||
if [[ $1 == "shell" && ( $2 == "summon" || $2 == "toggle" ) && $# -eq 3 ]]; then
|
||||
if [[ $1 == "shell" && ( $2 == "summon" || $2 == "toggle" ) ]] && (( $# == 3 )); then
|
||||
set -- "$1" "$2" "$3" "{}"
|
||||
fi
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@ fi
|
||||
BACKGROUND="$(realpath "$1")"
|
||||
CURRENT_BACKGROUND_LINK="$HOME/.config/omarchy/current/background"
|
||||
|
||||
if [[ ! -f "$BACKGROUND" ]]; then
|
||||
if [[ ! -f $BACKGROUND ]]; then
|
||||
echo "File does not exist: $BACKGROUND" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
@@ -136,7 +136,7 @@ main() {
|
||||
case "$1" in
|
||||
--path)
|
||||
shift
|
||||
[[ $# -gt 0 ]] || { echo "Missing value for --path" >&2; return 2; }
|
||||
(( $# > 0 )) || { echo "Missing value for --path" >&2; return 2; }
|
||||
search_path="$1"
|
||||
;;
|
||||
--help | -h)
|
||||
|
||||
Reference in New Issue
Block a user