mirror of
https://github.com/elkowar/dots-of-war.git
synced 2024-12-27 06:32:23 +00:00
17 lines
465 B
Bash
Executable file
17 lines
465 B
Bash
Executable file
#!/usr/bin/env bash
|
|
|
|
query="$1"
|
|
shift
|
|
if [ -n "$query" ]; then
|
|
scene="$(hueadm scenes | grep -i "$query" | cut -d ' ' -f 1)"
|
|
group="$(hueadm groups | grep Schlafzimmer | cut -d ' ' -f 1)"
|
|
|
|
hueadm recall-scene "$scene" "$group"
|
|
else
|
|
echo "Select a scene from the following list:"
|
|
if [ command -v rg &>/dev/null ]; then
|
|
hueadm scenes | rg '^.*\d$' | awk '{print $2}' | sort -u
|
|
else
|
|
hueadm scenes | awk '{print $2}' | tail -n +2 | sort -u
|
|
fi
|
|
fi
|