
X2
Source (link to git-repo or to original if based on someone elses unmodified work):
Features:
*) Small
*) Very light memory usage
*) Syntax highlighting
*) Embedded terminal
*) Find/replace/jump to line
*) Customizable file templates.
It is based on gtksouceview and vte so do make sure you have those installed.
You can checkout the git development release here: https://gitorious.org/x2
All Debs have been removed since X2 can now be downloaded from the official debian package archives: http://packages.debian.org/sid/x2
Its licensed under the BSD 3 clause licence, all patches and donations welcome!
If you discover a bug please do let me know either here, or on our bug tracker: http://rockcomputing.dyndns-web.com//flyspray/index.php?project=2&do=index
29/01/12 - 2
Actually uploaded a compilable bundle this time.
29/01/12
1) Enable real time preferences
2) Re-enabled the save as keybinding that had been strangely disabled
3) Fix file templates to be fully integrated
4) Split sources into easier to manage files
06/12/11
1.0.9.0: I have fixed all outstanding bugs I can find at the moment.
22/11/11
1.0.8.6: Another minor version bump to fix the quitting when there are unsaved files thing.
Sorry it took so long, had a few other things on.
21/10/11
1.0.8.5 Minor bugfix release.
20/10/11
Version 1.0.8.4 released and offers more improvements to the file templating again.
Templates can now be created from existing files, ctrl+shift+w to save a file as a template, note this only works if the open file has a file extension.
Some keybindings have been changed, save as has now been remapped to ctrl+shift+s (similar to other gtk apps) and preferences have been remapped to ctrl+, (similar to OSX).
Please do be aware of these changes as I realised that printer support may be required in the future and the ctrl+p keybinding may be needed. But since I do not own a printer I will need some help with this.
18/10/11
Version 1.0.8.3 hopefully fixes the runtime segmentation fault on Fedora systems.
18/10/11
Version 1.0.8.2 released changing the previous behaviour of the graphical templates to be more consistent with the open function.
18/10/11
Version 1.0.8.1 released hopefully fixing two long standing bugs.
18/10/11
Version 1.0.8 released, this builds upon the templating idea and expands it to have a graphical component. CTRL+SHIFT+N to activate (assuming you have installed templates).
10/10/11
Version 1.0.7 released. This includes an expansion to our previous release where if a file that is specified as an argument does not exist then it is created for the user.
Now, if the user also specifies a file type (c, py, etc) so long as the user has a matching template file in ~/.config/X2/templates the template will be loaded reducing the amount of work the user has to do to get started.
These files are totally customisable and can be added or removed to as the user wishes.
To get started create the file ~/.config/X2/templates/template.c with the contents:
#include
int main( int argc, char *argv )
{
printf( "Hello world!\n" );
return( 0 );
}
Then just run X2 from the command line with .c and the template will load the contents into your new file.
To remove this just remove the template.c file.
09/10/11
Fedora 32 rpm uploaded.
08/10/11
Five bugs were closed for this release, some of which were code re-factoring elements which really reduced the amount of code inside X2.
The following bugs have been closed:
#3 Create icon for X2
#8 Files can't be passed in via open with dialog
#14 Write a man page
#15 X2 doesn't see relative paths.
#16 Create files passed onto the command line if they don't already exist.
If you use Arch Linux or a source based distro you can download and run now, otherwise please do wait for the packages to be built. 32 bit rpms and debs will be on their way soon.
Oh and one more thing... This one is for you Steve. Respect and peace out.
06/10/11
Andrea Veri has very kindly packaged X2 for Debian: http://packages.debian.org/sid/x2
04/10/11
Added 64 bit fedora package
Added 64 bit deb package
03/10/11
Added tool tips
02/10/11
Added Ubuntu package!
Added Fedora package!
01/10/11
Fixed the desktop file in the main build scripts so that any packager should not have to write it their selves.
Added load from command line.
30/9/11
Created the .desktop file and taken advantage of the gtk stock text editor icon.
29/9/11
Completed the build system.
Ratings & Comments
103 Comments
Where is a project site? http://rockcomputing.co.uk/ doesn't work.
Sadly my business has had to shut down, I am in the process of creating a new project website for this software alone since I still work on it, any help would be greatly appreciated!
I am close to releasing a new update to X2, I have to just redesign the preferences window to remove clutter and such, this may take a little while longer but should anyone wish to help I would be happy to accept any.
I'm seeing the following error when trying to compile under Debian testing I can compile the release version w/o issues (1.0.9) No errors during ./configure make all make -C src all make[1]: Entering directory `/home/drasey/download/x2/svn/x2/src' gcc -Wall -g -O0 -o x2 main.c `pkg-config --libs --cflags vte gtksourceview-2.0` In file included from main.c:19:0: callbacks.c: In function 'New': callbacks.c:135:9: warning: 'vte_terminal_fork_command' is deprecated (declared at /usr/include/vte-0.0/vte/vtedeprecated.h:82) [-Wdeprecated-declarations] In file included from main.c:19:0: callbacks.c: In function 'destroy': callbacks.c:534:2: warning: passing argument 1 of 'gtk_button_box_set_layout' from incompatible pointer type [enabled by default] /usr/include/gtk-2.0/gtk/gtkbbox.h:71:19: note: expected 'struct GtkButtonBox *' but argument is of type 'struct GtkWidget *' callbacks.c: In function 'drag_data_received_handler': callbacks.c:578:16: warning: pointer targets in initialization differ in signedness [-Wpointer-sign] main.c: At top level: main.c:20:23: fatal error: templates.c: No such file or directory compilation terminated. make[1]: *** [x2] Error 1 make[1]: Leaving directory `/home/drasey/download/x2/svn/x2/src' make: *** [all] Error 2
The git version is currently unbuildable I need to fix that, sorry for the delay, I am fixing that now.
If you try now you should find it buildable now, although I cannot promise stability am working on new features.
Thanks for the quick reply! The compile error is now gone, but for some reason, I'm getting a 64bit binary being built (I'm on a 32bit system) drasey@xxx:~/download/x2: file src/x2 src/x2: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.27, BuildID[sha1]=0x2e6e02e55c34cbc9f7ba208c1781f3f9bdb4cd2d, not stripped
Your welcome, I do try to answer as quick as I can, have you run make clean? Perhaps I uploaded a binary from my 64 bit system to the git repo and it needs removal?
ah, 'make clean' did the trick (sorry, didn't think about trying that)
Don't worry about it, I shall check my git tree and see if I did upload a binary and if so remove it.
May I ask why it is you are building from git anyway?
Up till you mentioned that the git version probably isn't ready for testing, I was simply interested in playing around with "what's changed" (and making sure I could build it when the time came)
Up till you mentioned that the git version probably isn't ready for testing, I was simply interested in playing around with "what's changed" (and making sure I could build it when the time came)
Up till you mentioned that the git version probably isn't ready for testing, I was simply interested in playing around with "what's changed" (and making sure I could build it when the time came)
Hello, starting with version 1.0.8 x2 does not compile on my system anymore. This is the error message: make -C src all make[1]: Entering directory `/usr/src/packages/SOURCES/x2-1.0.8/src' gcc -Wall -g -O0 -o x2 main.c `pkg-config --libs --cflags vte gtksourceview-2.0` In file included from main.c:18:0: callbacks.c: In function ‘New’: callbacks.c:37:2: warning: implicit declaration of function ‘gtk_combo_box_text_new’ callbacks.c:37:19: warning: assignment makes pointer from integer without a cast callbacks.c:133:9: warning: ‘vte_terminal_fork_command’ is deprecated (declared at /usr/include/vte-0.0/vte/vtedeprecated.h:82) In file included from main.c:18:0: callbacks.c: In function ‘Template’: callbacks.c:375:15: warning: initialization discards qualifiers from pointer target type In file included from main.c:18:0: callbacks.c: In function ‘drag_data_received_handler’: callbacks.c:898:16: warning: pointer targets in initialization differ in signedness callbacks.c: In function ‘Populate_CMB’: callbacks.c:1012:2: warning: passing argument 1 of ‘gtk_combo_box_get_model’ from incompatible pointer type /usr/include/gtk-2.0/gtk/gtkcombobox.h:109:15: note: expected ‘struct GtkComboBox *’ but argument is of type ‘struct GtkWidget *’ callbacks.c:1017:16: warning: initialization discards qualifiers from pointer target type callbacks.c:1020:4: warning: implicit declaration of function ‘gtk_combo_box_text_append_text’ callbacks.c:1020:4: warning: implicit declaration of function ‘GTK_COMBO_BOX_TEXT’ /tmp/ccD4IPu6.o: In function `New': /usr/src/packages/SOURCES/x2-1.0.8/src/callbacks.c:37: undefined reference to `gtk_combo_box_text_new' /tmp/ccD4IPu6.o: In function `Populate_CMB': /usr/src/packages/SOURCES/x2-1.0.8/src/callbacks.c:1020: undefined reference to `GTK_COMBO_BOX_TEXT' /usr/src/packages/SOURCES/x2-1.0.8/src/callbacks.c:1020: undefined reference to `gtk_combo_box_text_append_text' collect2: ld returned 1 exit status make[1]: *** [x2] Error 1 make[1]: Leaving directory `/usr/src/packages/SOURCES/x2-1.0.8/src' make: *** [all] Error 2
Is it possible, that you have switched some functions to use/ support gtk3? I have found this on the gtk developers page: Warning gtk_combo_box_get_active_text has been deprecated since version 2.24 and should not be used in newly-written code. If you used this with a GtkComboBox constructed with gtk_combo_box_new_text() then you should now use GtkComboBoxText and gtk_combo_box_text_get_active_text() instead. Or if you used this with a GtkComboBoxEntry then you should now use GtkComboBox with "has-entry" as TRUE and use gtk_entry_get_text (GTK_ENTRY (gtk_bin_get_child (GTK_BIN (combobox))).
Is it possible, that you have switched some functions to use/ support gtk3? I have found this on the gtk developers page: Warning gtk_combo_box_get_active_text has been deprecated since version 2.24 and should not be used in newly-written code. If you used this with a GtkComboBox constructed with gtk_combo_box_new_text() then you should now use GtkComboBoxText and gtk_combo_box_text_get_active_text() instead. Or if you used this with a GtkComboBoxEntry then you should now use GtkComboBox with "has-entry" as TRUE and use gtk_entry_get_text (GTK_ENTRY (gtk_bin_get_child (GTK_BIN (combobox))).
Is it possible, that you have switched some functions to use/ support gtk3? I have found this on the gtk developers page: Warning gtk_combo_box_get_active_text has been deprecated since version 2.24 and should not be used in newly-written code. If you used this with a GtkComboBox constructed with gtk_combo_box_new_text() then you should now use GtkComboBoxText and gtk_combo_box_text_get_active_text() instead. Or if you used this with a GtkComboBoxEntry then you should now use GtkComboBox with "has-entry" as TRUE and use gtk_entry_get_text (GTK_ENTRY (gtk_bin_get_child (GTK_BIN (combobox))).
I don't use those functions, I use gtk_combo_box_text*( ) for my purposes, I have fixed a few warnings in the git version if you want to try that? If you could let me know what distribution you use and architecture I can give it a go, but as it stands I have it working on Arch, Mint and Fedora not yet on opensuse for some reason but I need to know what distro you are using to try and figure out where the problem may lay.
This video shows how the template feature works and how to use it. http://www.youtube.com/watch?v=FUE1eiVj3MA
...the problem is not compiling, the problem is that it doesn't run (at least in Fedora 15 x86_64): Quote:
$ ./src/x2
(x2:11378): GLib-CRITICAL **: g_io_channel_write_chars: assertion `channel != NULL' failed
(x2:11378): GLib-CRITICAL **: g_io_channel_write_chars: assertion `channel != NULL' failed
(x2:11378): GLib-CRITICAL **: g_io_channel_write_chars: assertion `channel != NULL' failed
(x2:11378): GLib-CRITICAL **: g_io_channel_write_chars: assertion `channel != NULL' failed
(x2:11378): GLib-CRITICAL **: g_io_channel_write_chars: assertion `channel != NULL' failed
(x2:11378): GLib-CRITICAL **: g_io_channel_write_chars: assertion `channel != NULL' failed
(x2:11378): GLib-CRITICAL **: g_io_channel_write_chars: assertion `channel != NULL' failed
(x2:11378): GLib-CRITICAL **: g_io_channel_write_chars: assertion `channel != NULL' failed
(x2:11378): GLib-CRITICAL **: g_io_channel_close: assertion `channel != NULL' failed
(x2:11378): GLib-CRITICAL **: g_io_channel_read_line: assertion `channel != NULL' failed
(x2:11378): GLib-CRITICAL **: g_io_channel_read_line: assertion `channel != NULL' failed
(x2:11378): GLib-CRITICAL **: g_io_channel_read_line: assertion `channel != NULL' failed
(x2:11378): GLib-CRITICAL **: g_io_channel_read_line: assertion `channel != NULL' failed
(x2:11378): GLib-CRITICAL **: g_io_channel_read_line: assertion `channel != NULL' failed
(x2:11378): GLib-CRITICAL **: g_io_channel_read_line: assertion `channel != NULL' failed
(x2:11378): GLib-CRITICAL **: g_io_channel_read_line: assertion `channel != NULL' failed
(x2:11378): GLib-CRITICAL **: g_io_channel_read_line: assertion `channel != NULL' failed
(x2:11378): GLib-CRITICAL **: g_io_channel_close: assertion `channel != NULL' failed
Segmentation fault (core dumped)
That's from compiling yes? Can you try the rpm and see if that works? Worst case scenario you can use that. I have a Fedora 64 bit virtual machine and that's what I built the rpm on, and it works fine, do you have all the build and run time dependencies?
Yes, it is from the compiled one. But the same error is from running your rpm package. And yes, I have all the dependencies, to compile and runtime... :(
It looks like I shall have to create a debug build to see exactly where is dies. Oh wait, my build fails now :S That's weird, time to really start digging down.
I got it! Create the following directory: $ mkdir -p ~/.config/X2 and now open x2, and it won't segfault as before (in FC 15) :D If you correct this bug, I can submit it to Fedora because I have the spec file ready.