Pages

Tuesday, October 14, 2014

Theme color setting version of Checkgmail

For busy people, here is the script: https://dl.dropboxusercontent.com/u/2677320/checkgmail

I always use checkgmail... I like its simplicity and its sobriety . It 's a  simple python script with some setting files. But there has been no change in its code for a long time and now it is discontinued. It continue to work if we put the right arguments on command line. We can only change  status icons and background color icon to improve his appearance from preferences window.


But to adapt checkgmail's colors to your desktop theme, we need to see what's happened in the script and it is not very easy.
That's why i have improve some things in the code  in order to facilitate the popup windows colors setting directly by editing the start of the scripts without you need to get your hands so dirty.

It is easier to know what i am talking about with some screenshots





The default colors setting is adapt to original Ubuntu theme, but you can change it easily (see below).

install it  and change the setting of this checkgmail version:

Install your distibution checkgmail package
$ sudo apt-get install checkgmail
$ sudo apt-get install apt-get install libcrypt-blowfish-perl\
 libcrypt-simple-perl libfreezethaw-perl libgtk2-trayicon-perl\
 liblwp-protocol-https-perl libxml-simple-perl
( derivative of Debian)

Download the new checkgmai versionl:
$ wget "https://dl.dropboxusercontent.com/u/2677320/checkgmail"

Change permissions:
$ chmod +x ./checkgmail

Replace the old script:
$ sudo mv ./checkgmail /usr/bin

Finally, launch it fromthe menu.
If you want launch it automatically at statup:
$ cp  /usr/share/applications/checkgmail.desktop ~/.config/autostart

You can now open the preferences window (right-click on tray-icon) and complete it.



If you want to set an appropriate error-icon  with ' indicator-messages.svg' and 'indicator-messages-new.svg' from Ubuntu theme, here is the link:
https://dl.dropboxusercontent.com/u/2677320/indicator-messages-error.svg

Setup popup windows colors:

Edit the script (~line 162), read the readme in it and set the colors:
$ gksudo gedit /usr/bin/checkgmail

#######################
# Color + Border setting
#
# use gcolor2 to pick info color
#(to install it on ubuntu: sudo apt-get install gcolor2)
#
# For a finest adaptation to your theme desktop, you can change the icons and
# the background color in the preferences window
#
# For Ubuntu users:
# In the preferences, set user icons to indicator-messages.svg
# and indicator-messages-new.svg from /usr/share/ubuntu-mono-*/status/*/
# A error icon can be download here:
#  https://dl.dropboxusercontent.com/u/2677320/indicator-messages-error.svg
# Set the background color to your panel background color
#
########################################################################
####################### README COLORS #################################
########################################################################
# Color variables with '_GTK' in their name
#(ex: '$win_new_mail_color_GTK_border')
#
# must be declare like that:          
## with decimal          
#my $Black   = Gtk2::Gdk::Color->new (0,0,0);      
#my $Grey    = Gtk2::Gdk::Color->new (150*257, 150*257, 150*257);  
#my $White   = Gtk2::Gdk::Color->new (65535, 65535, 65535);  
# or with hexadecimals          
#my $Red     = Gtk2::Gdk::Color->new (0xFFFF,0,0);    
#my $Yellow  = Gtk2::Gdk::Color->new (0xFFFF,0xFFFF,0);    
#my $Magenta = Gtk2::Gdk::Color->new (0xFFFF,0,0xFFFF);  
#my $Green   = Gtk2::Gdk::Color->new (0,0xFFFF,0);    
#my $Cyan    = Gtk2::Gdk::Color->new (0,0xFFFF,0xFFFF);    
#my $Blue    = Gtk2::Gdk::Color->new (0,0,0xFFFF);      
#my $White   = Gtk2::Gdk::Color->new (0xFFFF,0xFFFF,0xFFFF);  
#              
# Color variables with 'no _GTK' in its name (ex: '$win_no_mail_color_text)
# must be declare like that:          
#my $Grey   = "#AAAAAA";          
#my $White  = "#FFFFFF";          
#my $Black  = "#000000";              
#my $Red    = "#FF0000";              
#my $Green  = "#00FF00";              
###############################################################
## You can add your colors here ...
# Ubuntu ambience theme colors
my $Ambiance_BG_GTK        = Gtk2::Gdk::Color->new (62*257, 62*257, 58*257);
my $Ambiance_Grey_BG_GTK   = Gtk2::Gdk::Color->new (241*257, 241*257, 241*257);
my $Ambiance_Grey_Text_GTK = Gtk2::Gdk::Color->new (213*257, 210*257, 203*257);

my $Ambiance_Text_Bg_Color   = "#3E3E3A";

my $Ambiance_Grey_Bg_Color   = "#F1F1F1";
my $Ambiance_Grey_Text_Color = "#D5D2CB";

# my colors

my $Blue_mail_GTK  = Gtk2::Gdk::Color->new (25*257, 182*257, 238*257); # Blue from indicator-messages-new icon
my $Blue_mail_text = "#19B6EE";
my $Orange_Text    = "#FCAF3E";
my $Purple_Text    = "#CEA4E2";
my $Grey_Text      = "#DDDDDD";
my $White_Text     = "#FFFFFF";
my $Black_Text     = "#333333";
my $Green_Text     = "#71CC59";

##### ... and setting colors here

 #1 WIN POPUP NO MAIL
 $win_no_mail_color_text         = $Ambiance_Grey_Text_Color;
 $win_no_mail_color_text_bg      = $Ambiance_Text_Bg_Color;

  #2 WIN POPUP NEW MAIL + BORDER + BORDER WIDTH

 $win_new_mail_color_GTK_border   = $Blue_mail_GTK; #GTK
 $win_new_mail_color_border_width = 3;
 $win_new_mail_color_GTK_bg       = $Ambiance_Grey_BG_GTK; #GTK

 $win_new_mail_color_text        = $Black_Text;

 $win_new_mail_color_text_bg     = $Ambiance_Grey_Bg_Color;

  #3 WIN POPUP MAIL

   # BG COLOR + BORDER + BORDER WIDTH
 $win_mail_color_GTK_bg_border   = $Blue_mail_GTK; #GTK
 $win_mail_border_width = 1;
 $win_mail_color_GTK_bg          = $Ambiance_BG_GTK; #GTK

    # TEXT COLOR

 $win_mail_color_text    = "";
 $win_mail_color_text_bg = $Ambiance_Text_Bg_Color;

    # CHECK TEXT COLOR

 $win_mail_color_text_check = $White_Text;

    # NUMBER MAIL TEXT COLOR

 $win_mail_color_text_number_mail = $White_Text;

    # SUBJECT COLOR

 $win_mail_color_text_subject = $Orange_Text;
 $win_mail_color_text_subject_under_mouse = $Orange_Text;

    # 'FROM' COLOR

 $win_mail_color_text_from   = $Ambiance_Grey_Text_Color;

    # AUTHOR COLOR

 $win_mail_color_text_author = $Purple_Text;

    # 'OPEN' TEXT COLOR

 $win_mail_color_text_open             = $Green_Text;
 $win_mail_color_text_open_under_mouse = $Green_Text;

   # BODY COLOR

 $win_mail_color_text_body = $White_Text;

  #4 FEN POPUP CHEK

 $win_popup_check_color_text    = $Ambiance_Grey_Text_Color;
 $win_popup_check_color_text_bg = $Ambiance_Text_Bg_Color;

  #5 MENU

 $win_menu_color_GTK_bg   = $Ambiance_BG_GTK; #GTK

 $win_menu_color_GTK_text = $Ambiance_Grey_Text_GTK; #GTK



If you are a perl hacker (which is not really the case for me):

It 's possible to improve the code  integrating colors settings in the preferences window, time to get your groove on!. All colors variables are at the script start now.

Finally just a word to say that we now launch checkgmail without '-no_cookies' argument. it was just enough to put $cookies variable  to 0 line ~67, hopping that we need it a future day and... add original links to delete, mark as read,etc... in the popup window!
It should be able to to code this with  'imap' and 'email'  libraries.
The starting script i have used is the one modified by Stefanie at
http://ubuntuforums.org/showthread.php?t=1520603 that resolve background color bug, and a patch to replace google adress account by the new one found here at http://linuxdeal.com/how-to-fix-checkgmail

GOOD NEWS !!
The Return of the 'manage buttons':
2014-10-11: monojp has hacked checkgmail. It allows to manage again mails from the popup window.

I have re-wright my color themable version base on this hack !

Voila!

Sunday, December 1, 2013

OpenEXR Thumbnails in Ubuntu 12.04

Since Ubuntu 11.10, the thumbnails are not any more made through "gconf ". Files situated in /usr/share/thumbnailers or in $HOME/.local/share/ thumbnailers with the extension .thumbnailer will point to nautilus how to create different images types thumbnails.

I did not find on the Internet (I must little to be badly looked) a "thumbnailer" for files openEXR.

Then here is the solution that I set up...



ImageMagick must  be installed. If it is not the case:

$ sudo apt-get install imagemagick


Then create the script which will be executed for the creation of thumbnails...

$ gedit /your/path/exr-thumbnailer

 ... here is the very simple code:

#!/bin/bash
convert "$1" -thumbnail "x$2" -colorspace sRGB -format png png:"$3"

Make it "excecutable": 

$ chmod +x /your/path/exr-thumbnailer

It is then necessary to create a file or in /usr/share/thumbnailers, if you want that the other users take advantage of it (in this case it will be necessary to create it with the root privileges), or, if you are the only user, in .local/thumbnailers of your personal directory.
Attention: the directory thumbnailers in .local can be absent, in this case it is necessary to create it:
$ mkdir  /home/your login/.local/share/thumbnailers

I chose the second solution:

$ gedit /home/your login/.local/share/thumbnailers/exr.thumbnailer

In the file exr.thumbnailer (with a dot in the name) put this:

[Thumbnailer Entry]
TryExec=/your/path/to/exr-thumbnailer
Exec=/your/path/to/exr-thumbnailer %i %s %o
MimeType=image/x-exr;

Change "your path" with yours.

Then restart nautilus:

$ nautilus -q; nautilus

Or restart your session.
The icons of files EXR should display images.

To open them, I use "Djv Imaging" which you will find here
Install it, then associate EXR files with executable file "djv_view" by means of UbuntuTweak for example.
It detects the images sequences .

Et voilà

Tuesday, January 4, 2011

Kidizoom and Ubuntu Maverick

For Christmas, we gave a camera Vtech Kidizoom Pro to each of our two little girls (yes, I am a grandfather). Unfortunately, when i connect the USB cable... nothing happens! How? A camera which is not recognized by Linux? Strange!  'lsusb' shows me that the KP is seen by the system but does not mount automatically. A bit of Google surf tells me that damned bug no longer allow our beloved OS to mount automatically fat16 partitions... 


After some research about the udev rules, here is a solution that will avoid to mount the KP manually.
The connection is usb1, this is why the loading rate is very slow. And here nothing to do, our OS is innocent.


First, create and edit an udev rules file:
$ sudo touch /etc/udev/rules.d/90-kidizoom.rules
$ sudo gedit /etc/udev/rules.d/90-kidizoom.rules

Then put a line to mounting...
KERNEL=="sd?1", SUBSYSTEMS=="scsi", ACTION=="add", ATTRS{vendor}=="VTech   ", ATTRS{model}=="Kidizoom        ", SYMLINK+="kidizoom", RUN+="/path/to/mount-script %k"

...and this one to unmounting.
KERNEL=="sd?1", SUBSYSTEMS=="scsi", ACTION=="remove", ENV{ID_VENDOR}=="VTech*",  RUN+="/path/to/umount-script %k"

The file can be downloaded here, Be careful to not forget to change the path of RUN and reload udev with:
$ sudo service udev restart

Installe "pmount":
$ sudo apt-get install pmount

Here is the mount script:
#!/bin/bash
mk() {                                       
pumount /dev/$1                      
sleep 1                              
pmount -t vfat /dev/kidizoom KIDIZOOM
xhost local:$2                       
nautilus /media/KIDIZOOM      
}                                            
user=`who | grep :0\) | cut -f 1 -d ' '`     
export DISPLAY=:0.0                          
export -f mk                                 
su $user -c "mk $1 $user"                    

And here, the unmount script:
#!/bin/bash                                        
umk() {                                            
pumount /dev/$1                            
sleep 1                                    
xhost local:$2                             
zenity  --info --text "Kidizoom is unmount"
}                                                  
user=`who | grep :0\) | cut -f 1 -d ' '`           
export -f umk                                      
export DISPLAY=:0.0                                
su $user -c "umk $1 $user"                         

To download this files it is here and there.

Don't forget to set the execute permission (thanx to Marten@UBL):
$ chmod +x /path/to/mount-script; chmod +x /path/to/umount-script

Thank you to sevkeifert for his help
Et voilà ...

English translation of my Blog

More and more visitors visit rcspamsblog through google translation.
That's why I have decided to translate some of my posts in English here.
I am not an expert in english, so I will do my best.
See you soon...