Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: Why is this script not working?  (Read 1030 times)

ChairmanPoo

  • Bay Watcher
  • Send in the clowns
    • View Profile
Why is this script not working?
« on: October 23, 2011, 09:22:31 pm »

Quote
#!/bin/sh
cvt 1024 768
xrandr --newmode "1024x768_60.00"   63.50  1024 1072 1176 1328  768 771 775 798 -hsync +vsync
xrandr --addmode VGA1 1024x768_60.00
xrandr --output VGA1 --mode 1024x768_60.00

It works fine when I type it line by line in the terminal. Why doesn't it work when I try to run it as an executable? (I did not forget to enable "allow to run as an executable", for the record)
Logged
Everyone sucks at everything. Until they don't. Not sucking is a product of time invested.

optimumtact

  • Bay Watcher
  • I even have sheep
    • View Profile
Re: Why is this script not working?
« Reply #1 on: October 25, 2011, 05:54:20 am »

If you are familar with the terminal can you use ls -a to determine wether it has the x permission bit set?
Logged
alternately, I could just take some LSD or something...

eggrock

  • Bay Watcher
    • View Profile
Re: Why is this script not working?
« Reply #2 on: October 25, 2011, 01:10:18 pm »

If you are familar with the terminal can you use ls -a to determine wether it has the x permission bit set?

ls -l will show the permissions, -a displays 'dotfiles'.

OP, what error do you get? And why is the string for newmode quoted while the rest are not? (Shouldn't make a difference either way.)
Logged

ILikePie

  • Bay Watcher
  • Call me Ron
    • View Profile
Re: Why is this script not working?
« Reply #3 on: October 25, 2011, 03:16:07 pm »

And why is the string for newmode quoted while the rest are not? (Shouldn't make a difference either way.)
That's just the output of cvt:
Code: [Select]
$ cvt 1024 768
# 1024x768 59.92 Hz (CVT 0.79M3) hsync: 47.82 kHz; pclk: 63.50 MHz
Modeline "1024x768_60.00"   63.50  1024 1072 1176 1328  768 771 775 798 -hsync +vsync
Logged

optimumtact

  • Bay Watcher
  • I even have sheep
    • View Profile
Re: Why is this script not working?
« Reply #4 on: October 25, 2011, 08:15:17 pm »

Spoiler (click to show/hide)

Heh my bad, I thought it might have been wrong but didn't bother to double check.
Logged
alternately, I could just take some LSD or something...

ChairmanPoo

  • Bay Watcher
  • Send in the clowns
    • View Profile
Re: Why is this script not working?
« Reply #5 on: October 25, 2011, 10:30:20 pm »

Hadn't tried running it from console (I intended this to be a clickable in the menu bar). The error I get when doing it from console is "Bad interpreter: No such file or directory".


Managed to fix that by changing endline from windows to linux. Now the error I get is this:


# 1024x768 59.92 Hz (CVT 0.79M3) hsync: 47.82 kHz; pclk: 63.50 MHz
Modeline "1024x768_60.00"   63.50  1024 1072 1176 1328  768 771 775 798 -hsync +vsync
X Error of failed request:  BadName (named color or font does not exist)
  Major opcode of failed request:  149 (RANDR)
  Minor opcode of failed request:  16 (RRCreateMode)
  Serial number of failed request:  27
  Current serial number in output stream:  27


PD: it works now. It was the end of line thing. Thanks everyone :)
« Last Edit: October 26, 2011, 04:24:37 am by ChairmanPoo »
Logged
Everyone sucks at everything. Until they don't. Not sucking is a product of time invested.