Author Topic: How do you make a tool under Linux?  (Read 5912 times)

Offline Pecan

  • Plugin developer
  • Lives here!
  • ****
  • Posts: 2780
How do you make a tool under Linux?
« on: January 03, 2007, 10:08:37 pm »
In windows, CB will open a project from the Tool menu with the command "start someproject.cbp".

How do you do this under *nix?


Offline Game_Ender

  • Lives here!
  • ****
  • Posts: 551
Re: How do you make a tool under Linux?
« Reply #1 on: January 04, 2007, 04:23:02 am »
I assume "start" is a windows executable/special shell command?  In gnome there a tool called gnome-open which acts just like double clicking a file in folder.

Offline TheTuxKeeper

  • Regular
  • ***
  • Posts: 293
  • daniel2000
Re: How do you make a tool under Linux?
« Reply #2 on: January 04, 2007, 12:19:55 pm »
There's also a WM-independent tool, xdg-open.   :)
Nightly builds for openSUSE

Offline Pecan

  • Plugin developer
  • Lives here!
  • ****
  • Posts: 2780
Re: How do you make a tool under Linux?
« Reply #3 on: January 04, 2007, 10:04:30 pm »
There's also a WM-independent tool, xdg-open.   :)

How can I set a mime-type in ubuntu andLinux?
Code
pecan@andLinux:~/proj/cbKeyMacs$ ls *.cbp
KeyMacsApp-Unix.cbp  KeyMacsApp.cbp

pecan@andLinux:~/proj/cbKeyMacs$ xdg-open KeyMacsApp-Unix.cbp

Warning: unknown mime-type for "KeyMacsApp-Unix.cbp" -- using "application/*"
Error: no "view" mailcap rules found for type "application/*"
pecan@andLinux:~/proj/cbKeyMacs$

Offline TheTuxKeeper

  • Regular
  • ***
  • Posts: 293
  • daniel2000
Re: How do you make a tool under Linux?
« Reply #4 on: January 04, 2007, 10:34:07 pm »
Add these two lines to ~/.mailcap
Code
application/x-codeblocks;codeblocks "%s"
application/x-codeblocks-workspace;codeblocks "%s"
if it still doesn't work add this to ~/.mime.types
Code
application/x-codeblocks cbp
application/x-codeblocks-workspace workspace
« Last Edit: January 05, 2007, 12:21:14 am by daniel2000 »
Nightly builds for openSUSE

Offline Pecan

  • Plugin developer
  • Lives here!
  • ****
  • Posts: 2780
Re: How do you make a tool under Linux?
« Reply #5 on: January 05, 2007, 12:18:26 am »
Add these two lines to ~/.mailcap
Code
application/x-codeblocks;codeblocks "%s"
application/x-codeblocks-workspace;codeblocks "%s"
if it still doesn't work add this to ~/.mime.types
Code
application/x-codeblocks cbp
application/x-codeblocks-workspace workspace

Code
pecan@andLinux:~$ cat .mailcap
application/x-codeblocks;/home/pecan/devel/trunk/src/devel/codeblocks "%s"
application/x-codeblocks-workspace;/home/pecan/devel/trunk/src/devel/codeblocks "%s"

pecan@andLinux:~$ cat .mime.types
application/x-codeblocks cbp
application/x-codeblocks-workspace workspace

pecan@andLinux:~$ xdg-open /home/pecan/proj/cbKeyMacs/KeyMacsApp-Unix.cbp
/home/pecan/devel/trunk/src/devel/codeblocks: error while loading shared libraries: libcodeblocks.so: cannot open shared object file: No such file or directory
Warning: program returned non-zero exit code #127

pecan@andLinux:~/devel/trunk/src/devel$ ls -la
total 43536
drwxr-xr-x  3 pecan pecan     4096 Jan  4 01:22 .
drwxr-xr-x 16 pecan pecan     4096 Jan  1 14:52 ..
-rwxr--r--  1 pecan pecan     7977 Jan  1 14:52 cb_console_runner
-rwxr-xr-x  1 pecan pecan  4950683 Jan  1 14:24 codeblocks
-rwxr--r--  1 pecan pecan      129 Jul 15 11:36 dbg.sh
-rwxr--r--  1 pecan pecan      128 Dec 17 23:44 gdb.sh
-rwxr-xr-x  1 pecan pecan 36568138 Jan  1 14:22 libcodeblocks.so
-rwxr-xr-x  1 pecan pecan  2968223 Jan  1 14:09 libwxscintilla.so
-rwxr-xr-x  1 pecan pecan      126 Jan  4 01:22 run.sh
drwxr-xr-x  3 pecan pecan     4096 Dec 16 17:40 share


I tried setting LD_LIBRARY_PATH and $PATH to /home/pecan/devel/trunk/src/devel . It made no difference.

I wonder what else I can do.

« Last Edit: January 05, 2007, 12:22:53 am by Pecan »

Offline TheTuxKeeper

  • Regular
  • ***
  • Posts: 293
  • daniel2000
Re: How do you make a tool under Linux?
« Reply #6 on: January 05, 2007, 12:27:28 am »
try to replace "/home/pecan/devel/trunk/src/devel/codeblocks" with "/home/pecan/devel/trunk/src/devel/run.sh" in .mailcap  :)
Nightly builds for openSUSE

Offline Pecan

  • Plugin developer
  • Lives here!
  • ****
  • Posts: 2780
Re: How do you make a tool under Linux?
« Reply #7 on: January 05, 2007, 12:52:57 am »
try to replace "/home/pecan/devel/trunk/src/devel/codeblocks" with "/home/pecan/devel/trunk/src/devel/run.sh" in .mailcap  :)

That actually works. But just once. Any further use of xdg-open on a .cbp file gets the following warning:


I'm about ready to give up on this. It's taken all day.

My gut tells me it's not going to work as well as the XP start command which opens any number of .cbp in one "already open" CB.

Oh well, win some, lose some.

Thanks for all the help.


Offline Ceniza

  • Developer
  • Lives here!
  • *****
  • Posts: 1441
    • CenizaSOFT
Re: How do you make a tool under Linux?
« Reply #8 on: January 05, 2007, 01:16:00 am »
It works well in XP because of DDE, and AFAIK there's nothing like DDE for *nix implemented in Code::Blocks, even though wxWidgets has a generic implementation.

Offline Game_Ender

  • Lives here!
  • ****
  • Posts: 551
Re: How do you make a tool under Linux?
« Reply #9 on: January 05, 2007, 01:29:30 am »
We could use dbus in Linux.  It would probably be only a little bit of code.  I don't think it has been integrated with wxWidgets, but it should be to hard to do.