Code::Blocks Forums

User forums => Help => Topic started by: raphasauer on December 08, 2016, 07:54:04 pm

Title: Launch codeblocks with a shell script
Post by: raphasauer 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!
Title: Re: Launch codeblocks with a shell script
Post by: oBFusCATed 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