Xfce

Subdomains
 

./shoutcast-radio

  • March 5, 2009
  • Mike Massonnet
Just like my older post about a "./jamendo-player", this time I am definitely more interested into good online radio stations. And SHOUTcast is the best that comes to my mind! It's been there for years, Winamp is the best music experience ever, and both have been promoting each other even though I don't know/remember what their relation are.

The good things about their widget is that it saves the recent radios and it also has a list of favorites but this one isn't working as-is with the code. It is possible to search for radios and to browse by genre. All of this stuff is saved under ~/.macromedia/Flash_Player/#SharedObjects/<random>/ct.yourminis.com/.



So of course I couldn't resist but embed their available Flash widget inside a window :-) Again the code is very short, it's just about loading — well not a URL this time — an HTML string cause the Flash application all alone doesn't work out, it needs parameters passed outside. I didn't include the callbacks to handle "_blank" links, which means it is not possible to open any links, but this is useless as the widget is fully functionnal.

You can download the source code here.

Here are some installation instructions:
  1. Look into main.c
  2. The first line of main.c is a comment with a command to compile
  3. If you want a menu item in you desktop menu:
    1. Edit the Exec keys in shoutcast-radio.desktop
    2. Copy the desktop file to ${XDG_DATA_HOME:-~/.local/share}/applications
  4. If you don't have a gnome-radio icon, copy gnome-radio.png to ~/.icons/
By the way, I'm linking on the Xfce blog. Why? Cause there might be Xfce users interested into a simple to compile radio application. At least I hope some of you will enjoy it, more than the jamendo thingy :)

Update: The favorites actually do work, it just that the favorite button isn't always clickable.

Colored Notes

  • February 19, 2009
  • Mike Massonnet
I passed the last night to hack on a gtkrc snippet for the Notes plugin, because I couldn't find my sleep well. So being borred I killed a little bit the time to have a colored notes window :-) I know it was possible since always, I just never carred to do it. Using colors showed one annoying problem which are the icons. They don't fit always once you go away from the default gtk theme colors. In consequence I switched them to bold text labels with minus, plus and times. One other thing I didn't succeed with was to theme the menu that is available on the top right corner or Ctrl+M.

Finally the result is nice.

The snippet is the following:
gtk_color_scheme = "notes_fg_color:#E8E58C\nnotes_bg_color:#77741D\nnotes_base_color:#EBE88C\nnotes_text_color:#6B6A4A\nnotes_selected_bg_color:#ACA94E\nnotes_selected_fg_color:#E8E58C"

style "notes-default"
{
xthickness = 2
ythickness = 2

fg[NORMAL] = @notes_fg_color
fg[ACTIVE] = @notes_fg_color
fg[PRELIGHT] = @notes_fg_color
fg[SELECTED] = @notes_selected_fg_color
fg[INSENSITIVE] = shade (3.0,@notes_fg_color)

bg[NORMAL] = @notes_bg_color
bg[ACTIVE] = shade (1.0233,@notes_bg_color)
bg[PRELIGHT] = mix(0.90, shade (1.1,@notes_bg_color), @notes_selected_bg_color)
bg[SELECTED] = @notes_selected_bg_color
bg[INSENSITIVE] = shade (1.03,@notes_bg_color)

base[NORMAL] = @notes_base_color
base[ACTIVE] = shade (0.65,@notes_base_color)
base[PRELIGHT] = @notes_base_color
base[SELECTED] = @notes_selected_bg_color
base[INSENSITIVE] = shade (1.025,@notes_bg_color)

text[NORMAL] = @notes_text_color
text[ACTIVE] = shade (0.95,@notes_base_color)
text[PRELIGHT] = @notes_text_color
text[SELECTED] = @notes_selected_fg_color
text[INSENSITIVE] = mix (0.675,shade (0.95,@notes_bg_color),@notes_fg_color)
}

widget "xfce4-notes-plugin*" style:highest "notes-default"
widget "xfce4-notes-plugin*.*GtkMenu*" style:highest "notes-default"
widget "xfce4-notes-plugin*.*GtkMenuItem*" style:highest "notes-default"
# TODO Set the colors for the menu
The shade() and mix() functions are specific to either Clearlooks or Aurora. But this can be fixed. Actually I didn't include a default rc style inside the notes plugin, in fact this snippet can be saved for instance as notesrc inside your current theme and you add include "notesrc" in the gtkrc file.

All for the sharing, please enjoy.

Update: The shade() and mix() functions are a feature from GTK+ 2.10 just like gtk_color_scheme.

Update: I released a new version 1.6.4 that has a configurable background color setting.

./jamendo-player

  • January 9, 2009
  • Mike Massonnet
I was enough bored from my (small) music collection that I wanted to listen to something new, without actually caring what it is. I know Jamendo has a big load of music with artists uploading music under creative commons licence. So I went on their website to have a look, and they have "widgets". They are a small flash application not bigger than 200x300, but I actually didn't find any link to open such a widget inside an external window, except some lost links on some pages. In conclusion it was enough annoying to get an external player that I fired up vim and wrote a 20 lines C program.

/* gcc `pkg-config --cflags --libs webkit-1.0` main.c -o jamendo-player */

#include <gtk/gtk.h>
#include <webkit/webkit.h>

#define URL_FORMAT "http://widgets.jamendo.com/fr/playlist/?playertype=2008&playlist_id=%s"

int main (int argc, char *argv[])
{
GtkWidget *window;
GtkWidget *webview;
gchar *url;
gchar *playlist_id = argv[1];
if (argc < 2)
{
playlist_id = g_strdup ("65196");
g_message ("Loading the default playlist %s", playlist_id);
}
url = g_strdup_printf (URL_FORMAT, playlist_id);
gtk_init (&argc, &argv);
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
g_signal_connect (window, "delete-event", G_CALLBACK (gtk_main_quit), NULL);
gtk_window_set_icon_name (GTK_WINDOW (window), "multimedia-player");
gtk_window_set_title (GTK_WINDOW (window), "Jamendo Player");
gtk_window_set_resizable (GTK_WINDOW (window), FALSE);
webview = webkit_web_view_new ();
gtk_widget_set_size_request (webview, 200, 300);
gtk_container_add (GTK_CONTAINER (window), webview);
webkit_web_view_open (WEBKIT_WEB_VIEW (webview), url);
gtk_widget_show_all (window);
gtk_main ();
return 0;
}


The result is pleasing, the flash application has nice colors, and is something I would never be able to do with GTK+ :-)

If you like the code, feel free to extend it and send patches, I will enjoy any contribution. For now I will just leave a desktop file inside my applications directory to open it when I am bored again of my music :-p

Update: I hacked a little on the program to handle the links inside the Flash application. This means it is possible to change the playlist, which was one the thing that started to annoy me very much.

However, this update requires WebKit 1.0.3 and GLib 2.16.



This time I'm making the code available here instead of pasting it as it has grown up to 120 lines.

Use Epiphany to set your xfdesktop background

  • July 25, 2007
  • Mike Massonnet
Hi ladies ang guys,

As of my blog entry auto-update-background-list-for-xfdesktop I used to tell how I update my background with a uniq file in the background list. That worked with a shell script that 1) took as argument an image file 2) updated the background list 3) and reloaded xfdesktop.

I updated that script and put it in my git (git.m8t.mine.nu). It can now take a remote file as argument. That combined with the web browser Epiphany, you can apply a background within the browser.

Download that script and make it executable inside your $PATH.

Now run Epiphany with the extensions then:
  1. go to Tools > Extension... and enable the Actions extension
  2. After the Actions are enabled go to Edit > Actions
  3. Press Add and create an action called "Update xfdesktop background"
  4. And set the command to "set-xfdesktop-image.sh"
  5. Check Images in the Applies to
  6. Click Add.

Now go to my wallpapers gallery, choose a wallpaper (click on it to get the fullsize), and right click it. You can apply it by choosing the item "Update xfdesktop background" in the context menu.


Have fun with my hack around xfdesktop,
Mike

Marihela Xfwm theme

  • May 24, 2007
  • Mike Massonnet
I relooked a little bit the Moheli theme with some ideas that throwed my head.


You can go to my gallery, the last screenshots are the most recents. Pick this one.

Dwarf GTK+ theme for Xfce

  • May 17, 2007
  • Mike Massonnet
I was using the Xfce-stellar theme for quite more than a week now. Today I renewed that theme by using the most recent features from the Xfce GTK+ engine like gradients and borders for menu items.

It was an easy hack since both the Xfce-stellar theme and the new default for Xfce are really clean. I mostly changed colors and some other misty stuff. I choosed the name Dwarf, coming from the White Dwarf, since it has a direct relation to Stellar. If you like the next screenshot you can download the theme here: Dwarf.tar.gz.



Edit: I have done some updates while I was travelling by train. There is a gallery with several screenshots and the tarball has been updated too.