1
0
Fork 0

use video as wallpaper

This commit is contained in:
Massaki Archambault 2018-05-17 10:25:00 -04:00
parent f0ff21f003
commit 88630141c3
3 changed files with 33 additions and 7 deletions

View File

@ -102,10 +102,10 @@ bindsym $mod+semicolon focus right
focus_follows_mouse no focus_follows_mouse no
# alternatively, you can use the cursor keys: # alternatively, you can use the cursor keys:
bindsym $mod+Left focus left #bindsym $mod+Left focus left
bindsym $mod+Down focus down #bindsym $mod+Down focus down
bindsym $mod+Up focus up #bindsym $mod+Up focus up
bindsym $mod+Right focus right #bindsym $mod+Right focus right
# move focused window # move focused window
bindsym $mod+Shift+j move left bindsym $mod+Shift+j move left

View File

@ -11,7 +11,7 @@ query_prop() {
# flush gpg-agent cache # flush gpg-agent cache
echo RELOADAGENT | gpg-connect-agent echo RELOADAGENT | gpg-connect-agent
exec i3lock --image="$HOME/Pictures/wallpaper" --indicator --force-clock \ exec i3lock --image="$HOME/.local/share/wallpaper.png" --indicator --force-clock \
--veriftext="" --wrongtext="" --noinputtext="" --layoutcolor="00000000" --insidevercolor="00000000" --insidewrongcolor="00000000" --insidecolor="00000000" \ --veriftext="" --wrongtext="" --noinputtext="" --layoutcolor="00000000" --insidevercolor="00000000" --insidewrongcolor="00000000" --insidecolor="00000000" \
--ringvercolor="$(query_color primary)FF" --ringwrongcolor="$(query_color error)FF" --ringcolor="$(query_color fg-enabled)FF" \ --ringvercolor="$(query_color primary)FF" --ringwrongcolor="$(query_color error)FF" --ringcolor="$(query_color fg-enabled)FF" \
--keyhlcolor="$(query_color primary)FF" --bshlcolor="$(query_color secondary)FF" \ --keyhlcolor="$(query_color primary)FF" --bshlcolor="$(query_color secondary)FF" \

View File

@ -1,4 +1,30 @@
#!/bin/bash #!/bin/bash
if ! acpi --ac-adapter | grep -q 'off-line'; then # Animated wallpaper
exec $HOME/.local/bin/mpv-bg --really-quiet --no-config --loop --panscan=1.0 --video-pan-y=-0.1 --scale=oversample "$HOME/Pictures/wallpaper.gif" # quick and dirty script, but it works
wallpaper_source="https://massaki.ca/extra/wallpaper.mp4"
wallpaper_static="$HOME/.local/share/wallpaper.png"
wallpaper_anim="$HOME/.local/share/wallpaper.mp4"
if [ ! -f "$wallpaper_anim" ]; then
# calculate screen geometry
screen_size="$(xrandr --screen 0 | grep '^Screen' | grep -Eo 'current [0-9]+ x [0-9]+' | sed -E 's/current ([0-9]+) x ([0-9]+)/\1 \2/g')"
set -- $screen_size
# download and resize
ffmpeg -i "$wallpaper_source" -vf "scale=w=$1:h=$2:force_original_aspect_ratio=decrease" \
-c:v libx264 -preset slow -r 30 "$wallpaper_anim"
# extract static image
ffmpeg -i "$wallpaper_anim" -vframes 1 "$wallpaper_static"
# set static wallpaper
feh --bg-fill "$wallpaper_static"
fi
if ! acpi --ac-adapter 2>/dev/null | grep -q 'off-line'; then
exec "$HOME/.local/bin/mpv-bg" --really-quiet \
--no-config --no-border --no-audio --vd-lavc-fast --x11-bypass-compositor=no \
--loop --panscan=1.0 --scale=oversample --cache-file=TMP "$wallpaper_anim"
fi fi