.
This commit is contained in:
parent
9f7701ce6d
commit
f939a3d5bd
7 changed files with 150 additions and 0 deletions
26
scripts/background
Executable file
26
scripts/background
Executable file
|
|
@ -0,0 +1,26 @@
|
|||
#!/bin/sh
|
||||
BACKGROUND_DIR="$HOME/dotfiles/backgrounds/"
|
||||
case "$(uname -a)" in
|
||||
*Darwin*) UEBERZUG_TMP_DIR="$TMPDIR" ;;
|
||||
*) UEBERZUG_TMP_DIR="/tmp" ;;
|
||||
esac
|
||||
|
||||
cleanup() {
|
||||
ueberzugpp cmd -s "$SOCKET" -a exit
|
||||
}
|
||||
trap cleanup HUP INT QUIT TERM EXIT
|
||||
|
||||
UB_PID_FILE="$UEBERZUG_TMP_DIR/.$(uuidgen)"
|
||||
ueberzugpp layer --no-stdin --silent --use-escape-codes --pid-file "$UB_PID_FILE"
|
||||
UB_PID=$(cat "$UB_PID_FILE")
|
||||
|
||||
export SOCKET="$UEBERZUG_TMP_DIR"/ueberzugpp-"$UB_PID".socket
|
||||
|
||||
# run fzf with preview
|
||||
WALLPAPER=$(find $BACKGROUND_DIR -type f | fzf --reverse --preview="ueberzugpp cmd -s $SOCKET -i fzfpreview -a add \
|
||||
-x \$FZF_PREVIEW_LEFT -y \$FZF_PREVIEW_TOP \
|
||||
--max-width \$FZF_PREVIEW_COLUMNS --max-height \$FZF_PREVIEW_LINES \
|
||||
-f {}")
|
||||
|
||||
hyprctl hyprpaper reload ,"$WALLPAPER"
|
||||
ueberzugpp cmd -s "$SOCKET" -a exit
|
||||
Loading…
Add table
Add a link
Reference in a new issue