Hello everyone need some help to script this command to the start up but I am very new to Linux Mint and to Linux in general. I am learning as I go. I have a touch screen issue and when I calibrate it with the command when i restart the machine it will make me do it again. here is the command I want to script:
xinput map-to-output 13 eDP1
I know how to use terminal a little bit but I don't much about where to put the scripts etc. Really I don't even know how to add that command to a script either.
Please help
Need help to script!!!! new to linux
Forum rules
Topics in this forum are automatically closed 6 months after creation.
Topics in this forum are automatically closed 6 months after creation.
Need help to script!!!! new to linux
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 1 time in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
- catweazel
- Level 19
- Posts: 9763
- Joined: Fri Oct 12, 2012 9:44 pm
- Location: Australian Antarctic Territory
Re: Need help to script!!!! new to linux
Issue this command in a terminal:
Paste your code into /etc/rc.local before the line that reads
ctrl-o + enter to save, ctrl-x to exit.
Finally, issue this command then reboot.
Make a backup of
Code: Select all
sudo nano -w /etc/rc.local
exit 0
ctrl-o + enter to save, ctrl-x to exit.
Finally, issue this command then reboot.
Code: Select all
sudo chmod +x /etc/rc.local
/etc/rc.local
just in case the file gets overwritten by some wayward update."There is, ultimately, only one truth -- cogito, ergo sum -- everything else is an assumption." - Me, my swansong.
Re: Need help to script!!!! new to linux
The previous suggestion is unfortunately not going to work; xinput communicates with the X server, and at rc.local time there is not yet any such thing.
There's a few opportunities for running X startup scripts and the one I'd tend to like best is creating a file /etc/X11/Xsession.d/10custom_map-to-output containing
Other opportunities are the display manager's scripts (which would necessitate you telling us in detail which version of Mint you are running) or even the desktop startup applications. The latter would cause the command to be run on login which may be late or too late. Note, I clearly can't test your specific command/issue; it might be the case that you in fact need it as a display manager script if your issue is of a nature where you need this soonest.
There's a few opportunities for running X startup scripts and the one I'd tend to like best is creating a file /etc/X11/Xsession.d/10custom_map-to-output containing
Code: Select all
[ -x /usr/bin/xinput ] && /usr/bin/xinput map-to-output 13 eDP1
Re: Need help to script!!!! new to linux
Lack of reply and rereading has me wonder if it's useful to provide extra detail. To create mentioned file you can paste into a terminal:
After, verify the file to exist and display its contents with
Code: Select all
echo '[ -x /usr/bin/xinput ] && /usr/bin/xinput map-to-output 13 eDP1' | sudo tee /etc/X11/Xsession.d/10custom_map-to-output
Code: Select all
cat /etc/X11/Xsession.d/10custom_map-to-output
Re: Need help to script!!!! new to linux
I have tried the first answer to the question and i didnt work, Idk maybe i missed something but i did follow the instructions. thanks for the advice tho
Re: Need help to script!!!! new to linux
I have Tried the last Answer to my question and it seem to work I will keep you posted sorry for my delay in replying I have been very busy with work and school to even get on my machine. Thank you for you help