Skip to content

Commit

Permalink
remove * in openrc-run script
Browse files Browse the repository at this point in the history
Due in POSIX sh subset, basename * will scan root dir

Fixes: #2
Signed-off-by: Mattéo Rossillol‑‑Laruelle <[email protected]>
  • Loading branch information
xz-dev authored and beatussum committed Oct 13, 2024
1 parent 4ede531 commit e541fee
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions save-backlight
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ start()

checkpath -D -o "root:root" "${CACHE_DIR}"

for card in $(basename /sys/class/backlight/*); do
for card in $(ls /sys/class/backlight/); do
card_file="${CACHE_DIR}/${card}"

if [[ -e "${card_file}" ]]; then
Expand All @@ -36,12 +36,12 @@ start()
echo ${blight} > "/sys/class/backlight/${card}/brightness"
else
ewarn "Setting the brightness to zero would cause the"
ewarn "screen to turn off (skipping)"
ewarn "screen to turn off (skipping ${card})"
fi

unset blight
else
ewarn "Cache is empty (skipping)"
ewarn "Cache is empty (skipping ${card})"
fi

eend $? "Cannot restore the brightness of ${card}"
Expand All @@ -56,7 +56,7 @@ stop()

checkpath -D -o "root:root" "${CACHE_DIR}"

for card in $(basename /sys/class/backlight/*); do
for card in $(ls /sys/class/backlight/); do
cat "/sys/class/backlight/${card}/brightness" \
> "${CACHE_DIR}/${card}"

Expand Down

0 comments on commit e541fee

Please sign in to comment.