Scripts run from Terminal, not executing on dbl click
Posted: Mon Sep 03, 2012 8:44 am
One of the features I missed from upgrading to 13 was the "aero-snap" feature. Looking around I found a way to implement this feature: create a script that uses wmctrl to control the window, assign the script to a keyboard shortcut in the Control Center Panel. Here is the really simple 2 line script I am using (snaps window to the left side at half my monitor width):
The 2nd line works great when typed directly into Terminal. As expected, the terminal window jumps and sizes itself like it's supposed to (assuming it isn't already maximized). However, when running the above script via the shortcut... nothing happens. So I ran it out of Terminal and it tells me:
Also, the same sort of thing happens with one of my python scripts. I am using http://inventwithpython.com/chapters/ to learn a bit of python/pygame. I made 3 of the scripts from that site, and 2 work fine, but the 3rd one won't run except by typing it in Terminal. They were all made executable the same way: clicking the button in the permissions tab, and all have the shebang line added. The troubled script is http://inventwithpython.com/chapter19.html and I have only modified it to add a shebang line at the top:
I am stumped. Can anyone help me determine what is wrong?
Thanks!
Running Linux Mint 13 MATE 64
Code: Select all
#!usr/bin/env bash
wmctrl -r :ACTIVE: -e 0,0,0,960,1200
aero-snap_tiling_windows_LEFT is the name I gave my script. Ya, kinda long, but that doesn't matter. I have definately marked it for execution.aero-snap_tiling_windows_LEFT: command not found
Also, the same sort of thing happens with one of my python scripts. I am using http://inventwithpython.com/chapters/ to learn a bit of python/pygame. I made 3 of the scripts from that site, and 2 work fine, but the 3rd one won't run except by typing it in Terminal. They were all made executable the same way: clicking the button in the permissions tab, and all have the shebang line added. The troubled script is http://inventwithpython.com/chapter19.html and I have only modified it to add a shebang line at the top:
Removing this line does not fix the problem with my 3rd file that it errors out when I double click it and choose Run In Terminal. I thought at first that the pygame module somehow wasn't set up correctly. But then why would it work perfectly when typed from Terminal w/ no other changes, and also work perfectly with or without shebang line when run from Terminal? I installed pygame module via Software Manager, and it never reported any errors. It does seem to be the same sort of problem I am having with the aero-snap script above. This 3rd file is in the same directory as 2 other .py files that work fine.#!usr/bin/env python
I am stumped. Can anyone help me determine what is wrong?
Thanks!
Running Linux Mint 13 MATE 64