[SOLVED] I would like my desktop resolution to revert back after closing game from script
Linux - GamesThis forum is for all discussion relating to gaming in Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I would like my desktop resolution to revert back after closing game from script
Hello. I am trying to write a script to start my game by changing desktop resolution then when i am finished playing and close the game the desktop will revert back to the previous resolution. Here is what I have and it works as far as getting the game up and running but Ineed it to revert back to 1400x900
Thank you for answering. Yes I tried both of those suggestions. The desktop will not resize without sudo and adding the resize line at the end just executes even before the game fully starts.
I have used dgvoodoo2 in windows for different games but never in linux. Ill give it a try. Ya I wouldnt need the resolution change if the game would go full screen. My other win 95 and 98 games that I used the wrapper for all work under wine without the wrapper but Rollercoaster Tycoon didn't need the wrapper in Windows it worked perfect. But not in wine. I am using Mint LMDE 4. I guess I'll have to try it.
ondoho Thank you for the comment about "sudo xrandr --size 640x480". When I was first making the script it would not resize without sudo. So when you informed me there might be a problem with my system I figured I would try again and this time it works without sudo. However the game still runs the last line "xrandr --size 1400x900" before the game fully starts and I would like it to run upon exit of the game.
Last edited by Krackerjak1; 06-23-2020 at 08:42 AM.
Thanks for the suggestion. I have played with the wait command and read tutorials but can not figure it out. The tutorials lose me. Maybe someone that understands it can look at my script above and show me the line i need.
Works good. I believe the reason it wasn't working before was the way I was starting the game. I used the same command as the wine launcher and just put it into the script. The problem is there is a Program used in that line called start.exe and I believe the wait command was waiting for start.exe. However start.exe is only used for a moment to start rct.exe. So I played around with another way to start rct.exe and the above works great with the wait command.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.