diff options
Diffstat (limited to 'bin')
| -rwxr-xr-x | bin/decrement-brightness.sh | 5 | ||||
| -rwxr-xr-x | bin/wallpaper-shuffle | 29 |
2 files changed, 22 insertions, 12 deletions
diff --git a/bin/decrement-brightness.sh b/bin/decrement-brightness.sh new file mode 100755 index 0000000..22499d9 --- /dev/null +++ b/bin/decrement-brightness.sh @@ -0,0 +1,5 @@ +#!/usr/bin/env bash +LIGHT=$(light) +if [[ ${LIGHT%.*} -gt 5 ]]; then + brightnessctl set -q 5%- +fi diff --git a/bin/wallpaper-shuffle b/bin/wallpaper-shuffle index 820bfeb..9f55e0c 100755 --- a/bin/wallpaper-shuffle +++ b/bin/wallpaper-shuffle @@ -1,12 +1,17 @@ -#!/bin/nu -let wallpapers_path = "~/wallpapers/low-poly" -swaymsg -t get_outputs | - rg name | - str trim -a | - split row "," | - split column ":" | - get column2 | - str trim | str trim -c '"' | - each {|output| - swaymsg $"output ($output) bg `find ($wallpapers_path) -type f | shuf -n 1` fill" - } +#!/usr/bin/env bash + +set -o errexit +set -o nounset +set -o pipefail +if [[ "${TRACE-0}" == "1" ]]; then + set -o xtrace +fi + +OUTPUTS=$(swaymsg -t get_outputs | jq -r '.[] | .name') +export WALLPAPERS="$HOME/wallpapers/low-poly" + +main() { + echo "$OUTPUTS" | xargs -I{} sh -c "swaymsg output {} bg $(find "$WALLPAPERS" -type f | shuf -n 1) fill" +} + +main "$@" |
