Author Topic: Launch codeblocks with a shell script  (Read 2545 times)

raphasauer

  • Guest
Launch codeblocks with a shell script
« on: December 08, 2016, 07:54:04 pm »
Hello! I'm trying to make codeblock's executable execute a shell script instead of starting codeblocks. I modified the codeblocks.desktop file to execute the script like this:

[[Desktop Entry]
Exec=/usr/share/start_dark.sh
#didn't alter the rest#

And I get an error saying that it can't launch the application. This is the script:

GTK2_RC_FILES=/usr/share/themes/Elegant-GTK/gtk-2.0/gtkrc codeblocks

It's purpose is to launch codeblocks using a custom theme (Elegant GTK). If I run this script in the terminal it launches codeblocks perfectly. However, I want to always start codeblocks with this theme, hence the modification of the executable. Trying to do it in Linux Mint. Any advice? Thanks in advance!

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Launch codeblocks with a shell script
« Reply #1 on: December 08, 2016, 08:01:12 pm »
1. add shebang https://en.wikipedia.org/wiki/Shebang_(Unix)
2. if you're using bash use env BLA=bla codeblocks
3. instead of codeblocks use <fullpath_to>/codeblocks
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]