gnome
Creating your own syntax highlighting in GEdit?
GEdit uses GtkSourceView for its syntax highlighting. You should be able to find the c.lang file it uses to highlight C code by typing a command like this: $ locate gtksourceview | grep /c.lang Once you find the lang file, open it up in a text editor (it’s an XML file) and near the bottom … Read more
How do you get the icon, MIME type, and application associated with a file in the Linux Desktop?
Here is an example of using GLib/GIO to get the information you want. #include <gio/gio.h> #include <stdio.h> int main (int argc, char **argv) { g_thread_init (NULL); g_type_init (); if (argc < 2) return -1; GError *error; GFile *file = g_file_new_for_path (argv[1]); GFileInfo *file_info = g_file_query_info (file, “standard::*”, 0, NULL, &error); const char *content_type = g_file_info_get_content_type … Read more
Start Script when Gnome Starts Up
There is a specification for this purpose, and it works with any desktop environment that supports the specification (eg. KDE, GNOME2, GNOME3, …). You should put a Desktop Entry file (with .desktop extension) inside of ~/.config/autostart (for a user) or /etc/xdg/autostart (for the whole system). In the file you set the script to run (see … Read more
How to make python window run as “Always On Top”?
The question is more like which windowing toolkit are you using ? PyGTK and similar educated googling gave me this: gtk.Window.set_keep_above As mentioned previously it is upto the window manager to respect this setting or not. Edited to include SDL specific stuff Pygame uses SDL to do display work and apprently does not play nice … Read more
Alt key shortcuts not working on gnome terminal with Vim
The problem There are two ways for a terminal emulator to send an Alt key (usually called a Meta key as actual terminals didn’t have Alt). It can either send 8 bit characters and set the high bit when Alt is used, or it can use escape sequences, sending Alt-a as <Esc>a. Vim expects to … Read more
How do you find out which version of GTK+ is installed on Ubuntu?
This suggestion will tell you which minor version of 2.0 is installed. Different major versions will have different package names because they can co-exist on the system (in order to support applications built with older versions). Even for development files, which normally would only let you have one version on the system, you can have … Read more
How to use git with gnome-keyring integration
@marcosdsanchez’s answer is for Arch (which answers the original question) but I’m on Ubuntu. For git >= 2.11: sudo apt-get install libsecret-1-0 libsecret-1-dev cd /usr/share/doc/git/contrib/credential/libsecret sudo make git config –global credential.helper /usr/share/doc/git/contrib/credential/libsecret/git-credential-libsecret For git < 2.11: sudo apt-get install libgnome-keyring-dev cd /usr/share/doc/git/contrib/credential/gnome-keyring sudo make git config –global credential.helper /usr/share/doc/git/contrib/credential/gnome-keyring/git-credential-gnome-keyring