Thursday, May 24, 2007

colorpicker in form of xfce4 panel plugin

I'm trying to migrate to xfce4 from kde.
The most important feature I miss is color picker plugin (similar to kcoloredit applet in kde).
Neither xfce4, nor gnome have that.
Going to roll my own. It should be easy, since I only need to pick screen color and put it to clipboard. Picking history could be nice, but I can live without it.

UPD: moved back to KDE, xfce4 is very unstable for me.

3 comments:

konsumer said...

I wrote this:
http://david.konsumer.googlepages.com/color_select

very simple python/gtk tool that makes a color-picker and echo's result. The color-picker has a little brush icon that let's you select a color from your screen.

put it in your path (like /usr/local/bin) and give it permissions to run (chmod 755 /usr/local/bin/color_select)

I use it as a gvim plugin:

amenu  Color.Insert\ Hex\ Color <Esc><Esc>:r!/usr/local/bin/color_select --hex<ENTER>

amenu  Color.Insert\ RGB\ Color <Esc><Esc>:r!/usr/local/bin/color_select --rgb<ENTER>

this adds a "Color" menu.

It has 2 options --hex (default) which is web-style colors, and --rgb, which is python-style.

To get a dialog, I use zenity (already installed on ubuntu systems.) The launcher doesn't seem to understand backticks (run this command and give output) so I put it in another script:

#!/bin/bash
zenity --info --text=`color_select`

The single-quotes are backticks.
Add this as a panel launcher, and your all set.

I had never thought to put it on my taskbar, that's actually really useful. Now I can use it when I'm not in vim.

waker said...

thanks for your reply, though it seems i've had my own applet 2 months earlier :)

strange that i didn't get a email notification about your comment, so i really noticed it just now :(

Vicky said...

Check this out: http://tinytux.blogspot.com/2008/08/4-open-source-color-pickers.html