diff --git a/files/.config/i3/config b/files/.config/i3/config index b155ce3..f5fc075 100644 --- a/files/.config/i3/config +++ b/files/.config/i3/config @@ -102,10 +102,10 @@ bindsym $mod+semicolon focus right focus_follows_mouse no # alternatively, you can use the cursor keys: -bindsym $mod+Left focus left -bindsym $mod+Down focus down -bindsym $mod+Up focus up -bindsym $mod+Right focus right +#bindsym $mod+Left focus left +#bindsym $mod+Down focus down +#bindsym $mod+Up focus up +#bindsym $mod+Right focus right # move focused window bindsym $mod+Shift+j move left diff --git a/files/.local/bin/lock b/files/.local/bin/lock index 5e44901..d55c354 100755 --- a/files/.local/bin/lock +++ b/files/.local/bin/lock @@ -11,7 +11,7 @@ query_prop() { # flush gpg-agent cache 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" \ --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" \ diff --git a/files/.local/bin/wallpaper b/files/.local/bin/wallpaper index 740a3d3..f01bc18 100755 --- a/files/.local/bin/wallpaper +++ b/files/.local/bin/wallpaper @@ -1,4 +1,30 @@ #!/bin/bash -if ! acpi --ac-adapter | grep -q 'off-line'; then - 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" +# Animated wallpaper +# 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