jueves, 28 de mayo de 2015

Shortcut in Linux

How to create a shortcut in linux that executes a shell script

1. We create the shortcut.


Typically it's a ".desktop" ascii file with these entries although it can have more:

[Desktop Entry]
Type=Application
Encoding=UTF-8
Name=Sample Application Name
Comment=A sample application
Exec=application
Icon=application.png
Terminal=false

- The Name specifies the name of the launcher.
- Exec is the most important line as it specifies which script to launch and how it would be launched. We will leave this field blank til we have the shell script written
- Icon we set the path of the app's icon if available.
- Terminal specifies whether the app needs a terminal to run.

2. We create the shell script.


#!/bin/bash
. ~/.bashrc
PATH=$PATH:/srv/XXXX/XXXX/final_directory;
export PATH
cd /srv/projects/myproject
[some commands executing applications]

The first line is a comment indicating which shell will execute the script, in this case BASH.

The second line is a line that loads all the basrc file extensions

Then we perform some tasks such as adding another value to the system environment variable path and export that new entry.

We change our current directory and finally we call some commands that will launch our application.

3. We link the Exec command of the desktop file to the script


Note: if we have successfully coded our script it should work from the command line writing:

sh <ourscriptname>.sh

In our case an example of launching the shell script from our desktop file by double-clicking is

Exec=gnome-terminal -x bash -c "sh /path/to/thescript/scriptname.sh;bash"

Another linux tip: when we try to open a file sometimes we dont get to choose the right program even selecting "open with other programs". The trick to making appear the application in that list is editing as root its corresponding ".desktop" file normally placed in /usr/shared/applications/<name>.desktop and in the "command" or "Exec" field write at the end of the command the following: "<previous_commands><blank space>%U"

We save... and that should do the trick!!!

sábado, 23 de mayo de 2015

Job as Rigger/Pipeline TD

After a few frenetic weeks rushing to meet the deadline imposed by the CG Student Awards 2015 (13 May) finally i had something to show. And I say finally because for the last months i've applied for jobs where i was aware i needed at least a demo reel, so instead i used to tell my life in neverending emails hoping to get caught by some samaritan producer.

Well this last week was in the end very productive. I had no more than 3 job opportunities:

- The first one was an internship of a month and a half in Lightbox Entertainment thanks to a master colleague that already works there. You never know how important networking is.

- The second one was an internship at a company in Barcelona but the work could presumably be done from here from Madrid. They told me they really liked my work and that they would put me as rigger in spite of the fact that they were looking for a 3d modeler. They revealed to be very kind: i sure would have loved working for them. The company name is PaperFrog and they are currently making a TV3 show regarding animals and dinosaurs.

- The third one, the one i chose, is at a company in the center of Madrid. They are starting the production of a new feature film but they don't have made many claims regarding this yet. The film is intended to deliver next year and i have a contract for almost the rest of the year. I cannot talk really much about it because of the confidential terms but in the press note they released in April they say Spa Studios has done the character development and that the script has been written by the guy that worked in Madagascar 2 and others. It looks really promising.

I leave you here with the show reel i presented to the CG Student Awards. I very doubt that i win anything but the purpose for me was to do some work and have something to show when applying for a job.