Review shell scripts
Signed-off-by: Nikolaos Karaolidis <nick@karaolidis.com>
This commit is contained in:
@@ -1,10 +1,10 @@
|
||||
AMD=/dev/dri/by-path/pci-0000:06:00.0-card
|
||||
NVIDIA=/dev/dri/by-path/pci-0000:01:00.0-card
|
||||
|
||||
if [[ -e "${AMD}" ]]; then
|
||||
CARD=${AMD}
|
||||
if [[ -e "$AMD" ]]; then
|
||||
card=$AMD
|
||||
else
|
||||
CARD=${NVIDIA}
|
||||
card=$NVIDIA
|
||||
fi
|
||||
|
||||
ln -sf "${CARD}" "${HOME}"/.config/hypr/card
|
||||
ln -sf "$card" "$HOME"/.config/hypr/card
|
||||
|
@@ -5,10 +5,10 @@ SEARCH_STRINGS=(
|
||||
)
|
||||
|
||||
for search_string in "${SEARCH_STRINGS[@]}"; do
|
||||
echo "Searching for devices matching: ${search_string}"
|
||||
echo "Searching for devices matching: $search_string"
|
||||
|
||||
for f in $(grep -l "${search_string}" /sys/bus/usb/devices/*/product 2>/dev/null | sed "s/product/power\\/control/"); do
|
||||
echo "Setting power control to 'on' for: ${f}"
|
||||
echo on >| "${f}"
|
||||
for f in $(grep -l "$search_string" /sys/bus/usb/devices/*/product 2>/dev/null | sed "s/product/power\\/control/"); do
|
||||
echo "Setting power control to 'on' for: $f"
|
||||
echo on >| "$f"
|
||||
done
|
||||
done
|
||||
|
Reference in New Issue
Block a user