gpt4 book ai didi

linux - 氮气--恢复到比例背景

转载 作者:太空宇宙 更新时间:2023-11-04 05:24:22 25 4
gpt4 key购买 nike

所以我在网上找到了一个脚本,发现它非常适合我的需求。基本上,它编辑氮文件,将其保存的壁纸放入另一张图片中,这样我就可以使用 cron 作业定期更改壁纸。

#!/bin/bash

WPDIR="$HOME/Wallpapers"

random=true
apply=true
wpfile=""

function usage {
if [ $1 -eq 1 ]; then
stream=2
exitcode=255
else
stream=1
exitcode=0
fi
echo "Usage: $(basename $0) [-n|--noapply] [-h|--help] [wallpaper_location]" >&$stream
echo "If wallpaper location is not given a random wallpaper from $WPDIR will be chosen" >&$stream
exit $exitcode
}

# handle arguments
while [ $# -gt 0 ]; do
if [ "$1" = "--help" -o "$1" == "-h" ]; then
usage 0
elif [ "$1" = "--noapply" -o "$1" = "-n" ]; then
apply=false
else
if ! $random; then
usage 1
elif [ ! -f "$1" ]; then
echo "file '$1' not found" >&2
exit 1
fi
random=false
{ cd $(dirname "$1"); dir=$(pwd); }
wpfile="$dir/$(basename "$1")"
fi
shift
done

if $random; then
wpfile=$(ls "$WPDIR"/*.jpg | sort -R | head -n 1)
echo "chose $wpfile" >&2
fi

cat >$HOME/.config/nitrogen/bg-saved.cfg <<EOF
[:0.0]
file=$wpfile
mode=4
bgcolor=# 0 0 0
EOF

if $apply; then
nitrogen --restore
fi

我的问题是图片的缩放。我无法将其设置为以这种方式自动填充。

最佳答案

我很糟糕,我应该感到很糟糕。当写入 >$HOME/.config/nitrogen/bg-saved.cfg 时,模式被设置。这种模式实际上就是氮气提供的模式。尝试使用氮气并查看文件中设置的模式。以我为例,zoomed-fill = 5。

关于linux - 氮气--恢复到比例背景,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35398726/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com