Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Options for aligning wallpaper to center #636

Open
wants to merge 9 commits into
base: master
Choose a base branch
from

Conversation

FalconSN
Copy link

@FalconSN FalconSN commented Nov 12, 2023

Additions in termux-wallpaper:

show_usage () {
	echo "-c         crop image from center"
	echo "-n         fit full image to screen"
}
...
OPT_CENTER=""
OPT_NOCROP=""
...
while getopts :h,:c,:n,:l,f:,u: option
do
	case "$option" in
		c) OPT_CENTER="true" ;;
		n) OPT_NOCROP="true" ;;
	esac
done
...
[[ -n $OPT_CENTER ]] && [[ -n $OPT_NOCROP ]] && echo "$SCRIPTNAME: must specify either -c or -n" && exit 1 ;
...
set --
[ -n "$OPT_CENTER" ] && set -- "$@" --ez center "$OPT_CENTER"
[ -n "$OPT_NOCROP" ] && set -- "$@" --ez nocrop "$OPT_NOCROP"
/data/data/com.termux/files/usr/libexec/termux-api Wallpaper "$@"

Tested images:

Vertical image

Vertical in portrait -c
Vertical in portrait -n
Vertical in landscape -c
Vertical in landscape -n

Horizontal image

Horizontal in portrait -c
Horizontal in portrait -n
Horizontal in landscape -c
Horizontal in landscape -n

Is this the format I'm supposed to use?
And please, ignore unnecessary commits. This is my first time of actually using Github.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant