ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
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.
Introduction to Linux - A Hands on Guide
This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter.
For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own.
Click Here to receive this Complete Guide absolutely free.
I've setup a Linux computer for my mother-in-law and everytime she plays a certain game, it resizes her screen to 640x480... this is fine except that the game doesn't bother to revert back to 1024x768 when she quits. She can't ever remember the steps to reset the resolution from the desktop options menu in KDE. What I want to do it make her a simple icon in the top left corner of her screen that she can click on to reset the screen resolution for her automagically. I figure this can be accomplished easily enough with the proper command line script (that I can point the desktop icon to). Thanks for any help!
Thanks, that xrandr command will work nicely. I know about CTRL ALT+/-, but I'm not going to expect grandma to remember that! A nice big screen icon that says "Restore my screen" is what she needs.
*blink* I don't know why it didn't occur to me before but the obvious solution would be to wrap the game(s) in a script that would automatically reset the resolution if necessary.
Looking at xrandr, this should be simple, the current resolution is shown with a *. Since the default resolution is size "0", it's a trivial matter to check it.
Code:
#!/bin/sh
# run game
res="$(xrandr -q|grep '^\*')"
if [[ "${res:1:1}" != 0 ]]; then
xrandr -s 0
fi
Of course, you'll probably want to keep that icon handy, in case some other program/game frobs with the resolution too...
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.