I am writing a quick shell script that does something with display settings, but that's irrelevant. The shell script is to be put in any directory where it can be accessed; I chose /usr/local/bin/<dir>/<script>
.
I used a postinst script to create relevant shortcuts and register this script as a startup app. Once configuration is complete, I want /usr/local/bin/<dir>/<script>
to be executed. This seems to execute (as it generates the verbose data) but there are no visual changes as expected (display settings do not take effect). I am expecting the changes to be done for the root user. After installation exits I can run /usr/local/bin/<dir>/<script>
to get the desired effect, but sudo /usr/local/bin/<dir>/<script>
does not produce the same effect, as it is making changes to the root's display settings.
It could be simply solved, if the commands inside postinst can be run WITHOUT root permissions. How can I achieve this?