Thursday, October 11, 2018

Tuesday, September 25, 2018

show date in gnome panel

indicator-applet-complete main applet shows no date.
 it can be edited with dconf-editor
/com/canonical/indicator/datetime/

stolen keybindings

in gnome-flashback + xmonad, indicator-applet-complete steals Super+s.



sudo apt install -y dpkg-dev

mkdir indicator
cd indicator/
apt source indicator-applet-complete

edit the file
indicator-applet-12.10.2+17.10.20170425/src/applet-main.c

by commenting out
//tomboy_keybinder_bind(hotkey_keycode, hotkey_filter, menubar);

cd into the directory containing the package source (e.g indicator-applet-12.10.2+17.10.20170425) and run the following command:
 dch -i
and edit the newly created entry
dpkg-buildpackage -rfakeroot -uc -b

If the build is successful, there will be a .deb file located in the parent
directory (e.g ~/code/hellanzb_0.13-6.1_all.deb).

sources
https://askubuntu.com/questions/28372/how-do-i-get-and-modify-the-source-code-of-packages-installed-through-apt-get

Wednesday, August 1, 2018

other ubuntu version in docker

(as root)
docker run -ti ubuntu:latest /bin/bash
(-ti is interactive)
apt-get and do your stuff.
any change is deleted on exit. 
To save the changes 
get the container id by
docker container ls

then
docker commit <container id> name

to change the startup command you can create a Dockerfile reading

# Use an official Python runtime as a parent image
FROM cubuntu

# Set the working directory to /app
WORKDIR /home/fabio

# Copy the current directory contents into the container at /app
COPY startup.sh /

ENTRYPOINT ["/startup.sh"]

where startup.sh is a script in the same file of the Dockerfile
To mount filesystems of the host (e.g. to use X.In this case,create the user)
docker run --hostname beaver -ti -v /tmp/.X11-unix:/tmp/.X11-unix -v /home/fabio:/home/fabio beaver


sources:
http://fabiorehm.com/blog/2014/09/11/running-gui-apps-with-docker/
https://www.techrepublic.com/article/how-to-commit-changes-to-a-docker-image/
https://forums.docker.com/t/is-it-possible-to-pass-arguments-in-dockerfile/14488/3
https://docs.docker.com/storage/bind-mounts/#choosing-the--v-or---mount-flag
https://stackoverflow.com/questions/43031100/when-to-use-hostname-in-docker


Saturday, July 28, 2018

Missing sound in ubuntu

It may happen that analog output is not available because the system *THINKS* it is unplugged.

install pavucontrol, go to configuration and change the profile

Sunday, July 1, 2018

Arduino bootloader

As of arduino-1.8.5 the bootloader used for arduino uno (as specified in boards.txt uno.bootloader.file=optiboot/optiboot_atmega328.hex) is optiboot

The file location is
~/.arduino15/packages/arduino/hardware/avr/1.6.19/bootloaders/optiboot/

The Makefile uses -mshort-calls which is not defined anymore as of avr-gcc 4.8.2.
Use -mrelax instead

Connections:
https://www.arduino.cc/en/Tutorial/ArduinoISP

Sources:

https://www.avrfreaks.net/forum/where-has-mshort-calls-compiler-option-gone

Tuesday, February 20, 2018

custom ssh welcome message

create an executable script in /etc/update-motd.d/
example:

/etc/update-motd.d/50-poke

#!/bin/sh
PATH="$PATH:/usr/games:/home/ubuntu/bin"; fortune -s | pokemonsay

Monday, February 19, 2018

beaglebone

To install ubuntu on SD follow this guide
 https://qiita.com/TsutomuNakamura/items/ca25402f8f7569642564

in short:
create two partitions,  vfat + ext4, where you extract the uboot and image ,respectively.

(files available at http://www.armhf.com/download/)

The OTG ethernet (ethernet over usb) must be enabled (ubuntu 14.04),
by editing the files on the SD or using the serial console.

Using the serial console:
pinheader J1, pin 1:GND, pin 4:beaglebone rx, pin 5 beaglebone TX
On the PC
screen /dev/ttyUSB0 115200

/etc/modules
g_ether

/etc/network/interfaces
auto lo
iface lo inet loopback

auto usb0
iface usb0 inet static
    address 192.168.7.2
    netmask 255.255.255.0
    network 192.168.7.0
    gateway 192.168.7.1
    dns-nameservers 8.8.8.8
The 192.168.7.2 is the IP usually used by beaglebone. However, if network manager is used for sharing the connection (by setting IPv4 Settings / Method = Shared to other computers) it is better to set it to 10.42.0.2 as the pc IP is hardcoded on old distributions (source https://bugs.launchpad.net/ubuntu/+source/network-manager/+bug/1098362 )

auto lo
iface lo inet loopback

auto usb0
iface usb0 inet static
    address 10.42.0.2
    netmask 255.255.255.0
    network 10.42.0.0
    gateway 10.42.0.1
   dns-nameservers 8.8.8.8

(tested on debian)
to assign a fixed mac address to the gadget ethernet, create a file /etc/modprobe.d/something.conf containing

options g_ether host_addr=fa:b1:00:fa:b1:00 dev_addr=fa:b1:00:fa:b1:00

sources:
https://qiita.com/chromabox/items/d4368ccebb0f8822ce74
and
https://askubuntu.com/questions/51226/how-to-add-kernel-module-parameters


The serials must be enabled by creating custom dtb files. Kernel 3.14 does not have capemgr anymore, editing /boot/uboot/uEnv.txt is useless
sudo apt install device-tree-compiler
in /boot/dtbs do
sudo dtc -I dtb -O dts -o am335x-boneblack.dts am335x-boneblack.dtb
this create a text file with the settings. Enable the serial port by editing the file, and then generate a new blob with
sudo dtc -I dts -O dtb -o am335x-boneblack.dtb am335x-boneblack.dts

The edits to do are as follows

/*on debian you may need to add the definitions*/

pinmux_uart1_pins {
pinctrl-single,pins = <0x180 0x30 0x184 0x0>;
linux,phandle = <0x29>;
phandle = <0x29>;
};


pinmux_uart2_pins {                                                            
 108                        pinctrl-single,pins = <0x150 0x21 0x154 0x1>;                          
 109                        linux,phandle = <0x82>;                                                
 110                        phandle = <0x82>;                                                      
 111                };                                                                             
 112                                                                                               
 113                pinmux_uart4_pins {                                                            
 114                        pinctrl-single,pins = <0x70 0x26 0x74 0x6>;                            
 115                        linux,phandle = <0x84>;                                                
 116                        phandle = <0x84>;                                                      
 117                };                         

TO

pinmux_uart2_pins {                                                            
 108                        pinctrl-single,pins = <0x150 0x21 0x154 0x1>;                          
 109                        linux,phandle = <0x82>;                                                
 110                        phandle = <0x82>;                                                      
 111                };                                                                             
 112                                                                                               
 113                pinmux_uart4_pins {                                                            
 114                        pinctrl-single,pins = <0x70 0x26 0x74 0x6>;                            
 115                        linux,phandle = <0x84>;                                                
 116                        phandle = <0x84>;                                                      
 117                };                         


AND

1047                serial@48024000 {                                                            
1048                        compatible = "ti,omap3-uart";                                        
1049                        ti,hwmods = "uart3";                                                
1050                        clock-frequency = <0x2dc6c00>;                                      
1051                        reg = <0x48024000 0x2000>;                                          
1052                        interrupts = <0x4a>;                                                
1053                        status = "disabled";                                                
1054                };    

1065                serial@481a8000 {                                                            
1066                        compatible = "ti,omap3-uart";                                        
1067                        ti,hwmods = "uart5";                                                
1068                        clock-frequency = <0x2dc6c00>;                                      
1069                        reg = <0x481a8000 0x2000>;                                          
1070                        interrupts = <0x2d>;                                                
1071                        status = "disabled";                                                
1072                };

TO

1051                serial@48024000 {                                                            
1052                        compatible = "ti,omap3-uart";                                        
1053                        ti,hwmods = "uart3";                                                
1054                        clock-frequency = <0x2dc6c00>;                                      
1055                        reg = <0x48024000 0x2000>;                                          
1056                        interrupts = <0x4a>;                                                
1057                        status = "okay";                                                    
1058                        pinctrl-names = "default";                                          
1059                        pinctrl-0 = <0x82>;                                                  
1060                        linux,phandle = <0x92>;                                              
1061                        phandle = <0x92>;                                                    
1062                };    

1073                serial@481a8000 {                                                            
1074                        compatible = "ti,omap3-uart";                                        
1075                        ti,hwmods = "uart5";                                                
1076                        clock-frequency = <0x2dc6c00>;                                      
1077                        reg = <0x481a8000 0x2000>;                                          
1078                        interrupts = <0x2d>;                                                
1079                        pinctrl-names = "default";                                          
1080                        pinctrl-0 = <0x84>;                                                  
1081                        status = "okay";                                                    
1082                        linux,phandle = <0x94>;                                              
1083                        phandle = <0x94>;                                                    
1084                };      

where the handles specified in pinmux should not be used elsewhere, and the pinctrl-0 handle in the serial section should be the one specified in the pinmux
source:https://billwaa.wordpress.com/2014/10/13/beaglebone-black-enable-all-uart-ports-at-boot/

to change the i2c speed search for

i2c@4819c000 {
compatible = "ti,omap4-i2c";
#address-cells = <0x1>;
#size-cells = <0x0>;
ti,hwmods = "i2c3";
reg = <0x4819c000 0x1000>;
interrupts = <0x1e>;
status = "okay";
pinctrl-names = "default";
pinctrl-0 = <0x7>;
clock-frequency = <0x186a0>;
linux,phandle = <0x27>;
phandle = <0x27>;
where the frequency is in Hz (in hex),default 100KHz

source: http://randymxj.com/?p=538

tested kernel compilation way:
https://longervision.github.io/2018/01/10/beaglebone-black-uboot-kernel/


Sunday, November 26, 2017

compress pdf

gs -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dPDFSETTINGS=/screen -dNOPAUSE -dQUIET -dBATCH -sOutputFile=output.pdf input.pdf

source:

https://askubuntu.com/questions/113544/how-can-i-reduce-the-file-size-of-a-scanned-pdf-file

Sunday, November 19, 2017

ibus stealing ctrl-space

ctrl space not working in emacs

dconf-editor
Desktop >> ibus >> general >> hotkey
trigger and triggers

source: 
https://askubuntu.com/questions/243639/ctrlspace-has-been-bound-to-invoke-some-input-method-and-does-not-work-in-ema

Wednesday, November 1, 2017

modifier keys (among which windows key) unusable after focusing vmware

reason: caps lock appears in two places: lock and  control in xmodmap

lock        Caps_Lock (0x42)
control     Control_L (0x25),  Caps_Lock (0x42),  Control_R (0x69)

xmodmap becomes empty after giving focus to vmware if a key is doubled

solution:
setxkbmap
xmodmap -e "clear lock"

source:
https://askubuntu.com/questions/493404/ubuntu-14-04-vmware-6-left-ctrl-and-right-shift-not-functioning

Tuesday, October 31, 2017

xxdiff from source

hg clone https://bitbucket.org/blais/xxdiff
cd xxdiff/src
sudo apt install qt5-qmake bison flex
export QT_SELECT=qt5
make -f Makefile.bootstrap
edit Makefile adding -std=c++11 to the CXXFLAGS
make
xxdiff is now in ../bin



Tuesday, August 8, 2017

configure mozc

to configure mozc (e.g. to add emoji conversion dictionary) run

/usr/lib/mozc/mozc_tool --mode=config_dialog

Thursday, May 25, 2017

mount image file

sudo modprobe loop

sudo losetup -f
this returns a new loop device (e.g. /dev/loop4) which can be associated to the image

sudo losetup /dev/loop4 image.img

sudo partprobe /dev/loop4
creates the devices /dev/loop4p1 etc. (for each partition)

sudo mount /dev/loop4p1 /tmp/loop4/

Sunday, April 9, 2017

let's note no sound音なし ubuntu

alsamixer -c 1, raise headphone volume

Monday, March 20, 2017

eagle to wire

in inkscape :
File/ Inscape preferences / SVG output / diable "Allow relative coordinates"
sudo pip3 install svg.path
use https://github.com/fabiodl/eagleUlp/blob/master/svgToWire.py

Monday, March 13, 2017

grub hotkey

grub entries are generated by the scripts in /etc/grub.d/ and collected as /boot/grub/grub.cfg
the overall configuration is in /etc/default/grub
you can edit the script /etc/default/grub/40_custom
by copying entries from  /boot/grub/grub.cfg
to add an hotkey,

menuentry ... --hotkey w {
...


sources:
https://linuxnorth.wordpress.com/2011/03/09/grub2-revisited/
https://bugs.launchpad.net/ubuntu/+source/grub2/+bug/1178618


Thursday, March 2, 2017

eagle keybindings

to add a keybinding for changing wire bend
option-assign
and add new keybindings like
set wire_bend 1
set wire_bend 3

Friday, December 16, 2016

VU meter on foobar 2000

Install foobar2000
http://www.foobar2000.org/download

create a folder named "user-components" in
%APPDATA%\foobar2000

create a folder named "foo_vis_vumeter" in
%APPDATA%\foobar2000\user-componets

put the content of
https://drive.google.com/file/d/0B6yNdh9XmSWKX1lJQ0ZFOWdJTlU/edit
 inside %APPDATA%\foobar2000\user-componets\foo_vis_vumeter

for skins, download

http://orig12.deviantart.net/1d98/f/2016/220/6/5/denon_v6_analog_vu_meters_skin_by_noel62_by_noel62-dad3827.zip


Tuesday, October 18, 2016

include (input) file inside table

to include raw files inside a table define

\makeatletter
\newcommand\primitiveinput[1]
{\@@input #1 }
\makeatother

 and then use it as

  \primitiveinput{proben.tex}


source:
http://tex.stackexchange.com/questions/50694/cannot-use-toprule-when-doing-input-inside-tabular-why

Monday, October 3, 2016

template: detect required argument type of a function and adapt the data consequently

Example: classes' operator () can receive either a type G or a I<G>.
We pass either the argument I<G> or its member x of type G to operator () depending on what the operator is able to take

#include <iostream>

template <typename G> class I{
public:
  G x;
};


template<typename G>
class Caller{   
public:
  template<typename C>
  static void pass(C& c,I<G>& i){c(i.x);}

};

template<typename G>
class Caller<I<G> >{   
public:
  template<typename C>
  static void pass(C& c,I<G>& i){c(i);}
};


template<typename C,typename X>
X getArgumentType(void (C::*f)(X));

template<typename C,typename G>
inline void call(C& c,I<G>& i){
  Caller<typeof(getArgumentType(&C::operator()))>::pass(c,i);
}

 

struct A{
  void operator()(int x){
    std::cout<<"This is A "<<x<<std::endl;
  }
};

struct B{
  void operator()(I<int>& y){
    std::cout<<"This is B "<<y.x<<std::endl;
  }
};



int main(){

  A a;
  B b;
  I<int> y;
  y.x=77;
  call(a,y);
  call(b,y);
}

Wednesday, September 28, 2016

keyboard (language) icon missing

Keyboard icons missing in gnome-flashback


create a new theme
mkdir -p ~/.icons/addflags/status/22

create file ~/.icons/addflags/index.theme with the following content

[Icon Theme]
Name=addflags
Comment=Smooth modern theme designed to be intuitive.
Inherits=moblin

Example=directory-x-normal

#Directory list
Directories= status/22

[status/22]
Size=22
Context=Status
Type=Fixed

where Inherits is the theme you want to use

set the theme (e.g. by gnome-tweak-tool)  to addflags


status/22 contains the icons indicator-keyboard-*.svg
taken from example from
  usr/share/icons/ubuntu-mono-dark/status/22/
(sudo apt-get install ubuntu-mono)

Sunday, September 25, 2016

Windows password

To change the password policy (pwd length, pwd expiration period)
run secpol.msc
navigate to account policy / password policy

To unlock a locked out user
run lusrmgr.msc
double click the user
untick the lock


Wednesday, September 7, 2016

Thursday, July 21, 2016

Custom gnome session

Lightdm looks for

/usr/share/xsessions/cairo-dock-xmonad.desktop

[Desktop Entry]
Name=Cairo-Dock-Xmonad (GNOME)
Comment=This session logs you into GNOME with Cairo-Dock and Xmonad
Exec=gnome-session --session=cairo-dock-xmonad
TryExec=cairo-dock-session
Icon=
Type=Application

The session required components are given in
/usr/share/gnome-session/sessions/cairo-dock-xmonad.session

[GNOME Session]
Name=Cairo-Dock-Xmonad
RequiredComponents=gnome-settings-daemon;xmonad-xcomp;cairo-dock;
DesktopName=Unity

the component is defined in
/usr/share/applications/xmonad-xcomp.desktop

[Desktop Entry]
Type=Application
Name=Xmonad-Xcomp
Exec=xm
NoDisplay=true
X-GNOME-WMName=Xmonad
X-GNOME-Autostart-Phase=WindowManager
X-GNOME-Provides=windowmanager
X-GNOME-Autostart-Notify=true

where xm is the /usr/local/bin script

#!/bin/bash

# Check if xmonad is running
if pgrep "xmonad-x86_64" > /dev/null
then
    echo "xmonad Running"
else
    xmonad --replace&
fi
xcompmgr -C &
wallpaperScript&

Wednesday, July 20, 2016

Remove a package installed from a ppa


to list the ppa the package comes from:

apt-cache policy packagename
e.g.
apt-cache policy cairo-dock

the output is something like
http://ppa.launchpad.net/cairo-dock-team/ppa/ubuntu/ trusty/main amd64 Packages

to downgrade  it
sudo -E ppa-purge ppa:cairo-dock-team/ppa

sources:
http://askubuntu.com/questions/32835/whats-the-name-of-ppa-for-ppa-purge
http://askubuntu.com/questions/307/how-can-ppas-be-removed

super p stolen from xmonad

If <Super>P is associated with xrandr (stealing the keybinding from xmonad):

dconf-editor

disable

org/ gnome / settings-daemon / plugins / media-keys / active

source:
http://askubuntu.com/questions/68463/how-to-disable-global-super-p-shortcut

Tuesday, July 19, 2016

nautilus specify samba's domain name

 smb://WORKGROUP;User@machine.somewhere.com/Share

source:
http://hints.macworld.com/article.php?story=20031203172256827

gnome panel crashing with transparent background

Fix libcairo

--Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=91967
Signed-off-by: Uli Schlachter <psychon@znc.in>
----
 src/cairo-xlib-surface.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/cairo-xlib-surface.c b/src/cairo-xlib-surface.c
index 3f407c3..555c1fe 100644
--- a/src/cairo-xlib-surface.c
+++ b/src/cairo-xlib-surface.c
@@ -807,6 +807,7 @@ _get_image_surface (cairo_xlib_surface_t    *surface,
         }

         cairo_surface_destroy (&image->base);
+        image = NULL;
     }
     }

@@ -1011,7 +1012,8 @@ _get_image_surface (cairo_xlib_surface_t    *surface,
     cairo_device_release (&display->base);

     if (unlikely (status)) {
-    cairo_surface_destroy (&image->base);
+    if (image)
+        cairo_surface_destroy (&image->base);
     return _cairo_surface_create_in_error (status);
     }

--


source:
https://bugs.freedesktop.org/show_bug.cgi?id=91967

Wednesday, July 6, 2016

avconv misc

create  video from images

   avconv -r 20 -i in/%05d.png out.avi

to set codec
 -vcoded _codecname_

e.g. (for windows)
 -vcodec msmpeg4v2

to crop (width:height:x:y)
 -vf crop=128:128:20:20

to resize with nearest neighbor:

 avconv -i in.avi -vf scale=512:512:flags=neighbor out.avi

Thursday, June 16, 2016

transparency of emacs in xmonad

To enable transparency run

xcompmgr -c &


 and in emacs


(set-frame-parameter (selected-frame) 'alpha '(85 . 50))
 (add-to-list 'default-frame-alist '(alpha . (85 . 50)))

sources:

https://www.emacswiki.org/emacs/TransparentEmacs

https://wiki.haskell.org/Xmonad/Frequently_asked_questions#How_do_I_use_compositing_with_xmonad.3F

Wednesday, June 15, 2016

Plymouth and lightdm

If plymouth does not show (purple screen) after nvidia drivers install


In /etc/default/grub
set
GRUB_GFXPAYLOAD_LINUX="keep"


And in /etc/initramfs-tools/conf.d/splash

set

FRAMEBUFFER=y

If you want to check the video resolution, vbeinfo does not work anymore, use

videoinfo


at the GRUB terminal (loaded by pressing C)


To changhe plymouth theme from GUI:

  plymouth-manager

 https://launchpad.net/plymouth-manager


To enable the automatic background for lightdm

dconf  
and set org.gnome.settings-daemon.plugins.background to active


sources:


http://onetransistor.blogspot.jp/2016/03/plymouth-fix-nvidia.html
http://askubuntu.com/questions/577486/how-do-i-run-vbeinfo

http://askubuntu.com/questions/449677/how-do-i-set-the-lightdm-wallpaper-in-ubuntu-14-04

Thursday, June 2, 2016

xmonad master area on the right

to have the master area on the right,

import XMonad.Layout.Reflect 

add in the xmonad hooks replacement section add

 , layoutHook = smartBorders (reflectHoriz $ layoutHook gnomeConfig)


as in 


main = do
    dbus <- D.connectSession
    getWellKnownName dbus
    xmonad $ gnomeConfig
         { logHook = dynamicLogWithPP (prettyPrinter dbus)
 , mouseBindings = myMouseBindings 
 , layoutHook = smartBorders (reflectHoriz $ layoutHook gnomeConfig)
 , normalBorderColor   =  "#808080"
         , focusedBorderColor =  "#00ecec"
         ,  modMask = mod4Mask -- set the mod key to the windows key
 , startupHook = setWMName "LG3D"
         } `additionalKeys` myKeys

sources:
http://xmonad.org/xmonad-docs/xmonad-contrib/XMonad-Layout-Reflect.html
https://donsbot.wordpress.com/2010/03/13/after-3-years-my-xmonad-configuration-now-uses-gnome/

Example of numpy and c integration by ctype

example.c

#include <sys/types.h>

//sum by rows only the elements less than th
void sumLowerThan(double* res, double *a, ssize_t* dims,double th)
{
  int i,j;double v;
  for (i=0; i<dims[0]; i++) {
    res[i]=0;
    for (j=0;j<dims[1];j++){
      v=a[i*dims[1]+j];
      if (v<th){
        res[i]+=v;
      }     
    }//for j   
  }
}

compile with

gcc -shared -Wl,-soname,example -o example.so -fPIC example.c

example.py

#!/usr/bin/env python
import ctypes
import numpy as np


lib = np.ctypeslib.load_library('example', '.')

lib.sumLowerThan.restype = None
lib.sumLowerThan.argtypes = [np.ctypeslib.ndpointer(float, ndim=1,  # res
                                                    flags='aligned, contiguous, writeable'),
                             np.ctypeslib.ndpointer(float, ndim=2,  # a
                                                    flags='aligned, contiguous'),
                             ctypes.POINTER(np.ctypeslib.c_intp),  # dims
                             ctypes.c_double,  # th
                             ]


def sumLowerThan(a, th):
    a = np.require(a, float, ['CONTIGUOUS', 'ALIGNED'])
    res = np.require(np.empty(np.size(a, 0)),
                     float, ['CONTIGUOUS', 'ALIGNED', 'WRITEABLE'])
    lib.sumLowerThan(res, a, a.ctypes.shape, th)
    return res


a = np.random.rand(5, 10)
print(a)
print(sumLowerThan(a, 0.5))


sources:
http://stackoverflow.com/questions/5081875/ctypes-beginner
http://docs.scipy.org/doc/numpy-1.10.1/user/c-info.python-as-glue.html






minimal pyqtgraph multithreading plotting example

#!/usr/bin/env python
import numpy as np
import pyqtgraph as pg
from pyqtgraph.Qt import QtCore, QtGui
import Queue
from threading import Thread


class QtPlotter:

    def __init__(self):
        self.ports = []
        self.timer = pg.QtCore.QTimer()
        self.win = pg.GraphicsWindow()
        self.ax = self.win.addPlot()
        self.timer.timeout.connect(self.update)
        self.timer.start(0)
        self.ax.setAspectLocked(True)

    def getPort(self):
        q = Queue.Queue()
        plt = self.ax.plot()

        self.ports.append((q, plt))
        return q

    def update(self):
        for q, plt in self.ports:
            try:
                    data, color = q.get(block=False)
                    plt.clear()
                    plt.setData(
                        np.asarray(data[0, :]).flatten(),
                        np.asarray(data[1, :]).flatten(), pen=None, symbol="o",
                        symbolPen=pg.mkPen({'color': color, 'width': 2}),
                        symbolSize=1
                    )

            except Queue.Empty:
                pass


def qtLoop():
    import sys
    if (sys.flags.interactive != 1) or not hasattr(QtCore, 'PYQT_VERSION'):
        QtGui.QApplication.instance().exec_()


def example():
    import time
    plotter = QtPlotter()
    curve = plotter.getPort()

    def producer():
        while True:
            curve. put((np.random.random(size=(2, 10)), "#00FFFF"))
            time.sleep(1)

    p = Thread(target=producer)
    p.daemon = True
    p.start()

    qtLoop()

if __name__ == "__main__":
    example()

Monday, May 16, 2016

cygwin change locale

right click, options, text and set the locale

source: https://cygwin.com/cygwin-ug-net/setup-locale.html

Thursday, May 12, 2016

auto complete for ein

if
(setq ein:use-auto-complete t)

gives the error
symbol's function definition is void: ac-define-source

then install auto-complete in emacs
(it comes automatically if you install ac-anaconda)


M-x elpy- config tells what is not installed
install it with pip

source:
https://realpython.com/blog/python/emacs-the-best-python-editor/

Sunday, May 1, 2016

joystick to keyboard emulation

you can use antimicro

for Ubuntu 14.04, 15.04 and 15.10

sudo add-apt-repository ppa:ryochan7/antimicro
sudo apt-get update
sudo apt-get install antimicro

for Ubuntu 16.04

sudo add-apt-repository ppa:nilarimogard/webupd8
sudo apt-get update
sudo apt-get install antimicro


It can be used for playing showel knight


source:
http://www.webupd8.org/2014/09/gamepad-keyboardmouse-mapping-app.html

Sunday, April 24, 2016

jupyter notebook

To have vectorial images
from IPython.display import set_matplotlib_formats
set_matplotlib_formats('png', 'pdf')

source: http://blog.rtwilson.com/how-to-get-nice-vector-graphics-in-your-exported-pdf-ipython-notebooks/

to have inline images

%matplotlib inline
import matplotlib
matplotlib.rcParams["figure.facecolor"]=(1,1,1,1)
matplotlib.rcParams["axes.facecolor"]=(1,1,1,1)

To disable access tokens edit (create)
 .jupyter/jupyter_notebook_config.py

to contain

c.NotebookApp.token = ''
c.NotebookApp.password = ''

Friday, April 22, 2016

ein ipython notebook

ein does not work when the system variables http_proxy and https_proxy are set.

ein:notebooklist-open

gives the error

REQUEST [error] Error (error) while connecting to http://127.0.0.1:8888/api/contents.
REQUEST [error] Callback is not called when stopping process! Explicitly calling from timer.
ein: [error] Content list call http://127.0.0.1:8888/api/contents/ failed with status timeout.

remove the variables and set the proxies manually.

For ELPA:
(setq url-proxy-services '(("no_proxy" . "127.0.0.1")
                           ("http" . "myproxy.com:8080")))

For erc:
(setq socks-noproxy '("localhost"))
(require 'socks)
(setq erc-server-connect-function 'socks-open-network-stream)
(setq socks-server (list "proxyIdentifier" "myproxy.com" 8080 5))

where 5 is the SOCKS version (can be 4)

to have inline images in emacs, libraries for the images are required, otherwise the following error is reported

Error (websocket): in callback `on-message': error: "Not an image: nil"

in windows
copy bin/libpng16-16.dll and bin/zlib1.dll of
https://sourceforge.net/projects/ezwinports/files/libpng-1.6.12-w32-bin.zip/download

to emacs's bin directory

To enable / disable transparent plots:

import matplotlib
matplotlib.rcParams["figure.facecolor"]=(1,1,1,x)
matplotlib.rcParams["axes.facecolor"]=(1,1,1,x)
where x is the alpha (0 for transparent, 1 for fully opaque)


sources:
 https://www.emacswiki.org/emacs/UrlPackage
https://www.emacswiki.org/emacs/ErcProxy
http://stackoverflow.com/questions/2650041/emacs-under-windows-and-png-files

Thursday, April 21, 2016

ipyhon

to autoreload in ipython type

%load_ext autoreload
%autoreload 2


to make it permanent

create a profile
ipython profile create
  
add in
~/.ipython/profile_default/ipython_config.py (win)
~/.config/ipython/profile_default/ipython_config.py (linux, old ipython)
 ~/.ipython/profile_default/ipython_config.py (linux, new ipython)


the following lines

c.InteractiveShellApp.exec_lines = []
c.InteractiveShellApp.exec_lines.append('%load_ext autoreload')
c.InteractiveShellApp.exec_lines.append('%autoreload 2')
c.InteractiveShellApp.exec_lines.append('print("autoreload active")')


source:
http://stackoverflow.com/questions/1907993/autoreload-of-modules-in-ipython/10472712#10472712

map tcp port to another

map port 1234 to be seen as 6667
socat TCP-LISTEN:1234,fork,reuseaddr TCP:localhost:6667

Sunday, November 1, 2015

sharing connection

To enable the IP forwarding

#!/bin/bash
# test if ip-forward is up - if not, enable it:
#
ipf=$(cat /proc/sys/net/ipv4/ip_forward)
if [[ ipf -eq "0" ]] ; then
    echo "1" > /proc/sys/net/ipv4/ip_forward
fi
#
# forward-masquerade
#
iptables -t nat -A POSTROUTING -o ppp0 -j MASQUERADE
#
modprobe ip_conntrack_ftp
modprobe ip_nat_ftp
#
iptables -A FORWARD -p tcp --tcp-flags SYN,RST, SYN -j TCPMSS --clamp-mss-to-pmtu

#
service isc-dhcp-server restart


source:
http://unix.stackexchange.com/questions/16754/how-to-share-the-internet-connection

MTU

to change the MTU for a ppp of the network manager, edit /etc/NetworkManager/system-connections/connection_name at the section ppp

source:
http://ubuntuforums.org/showthread.php?t=1560232


Wednesday, October 21, 2015

vmware

when the kernel modules code need to be corrected, edit
/usr/lib/vmware/modules/source/vmnet.tar

source:
https://communities.vmware.com/message/2450503

Monday, October 19, 2015

clock in gnome-flashback

To enable date-time
dconf-editor (not gconf-editor) and navigate to
com.canonical.indicator

Tuesday, September 22, 2015

Vmware with physical partition under windows

if you get the error Operation on file "\\.\PhysicalDrive1" failed 
then you need to get the disk offline
from a prompt  launch diskpart
and then 
DISKPART > select disk 1
DISKPART > offline disk 


sources:
http://www.experts-exchange.com/Software/VMWare/Q_26689536.html
https://social.technet.microsoft.com/Forums/windowsserver/en-US/48ea44b0-9962-49e3-95a1-568275851753/take-a-hdd-offlineonline?forum=winserverpowershell

Tuesday, September 1, 2015

resize window from command line



use the following script:
source:
http://blog.yjl.im/2012/05/window-resizing-one-liner-using.html

#!/bin/bash
# Using xwininfo and wmctrl to resize a window
# Written by Yu-Jie Lin
# Public Domain

WIN_ID=$(xwininfo | egrep -om 1 '0x[0-9a-z]+')
W=$1
H=$2
X=${3:--1}
Y=${4:--1}

wmctrl -i -r $WIN_ID -e 0,$X,$Y,$W,$H

Saturday, August 22, 2015

custom live cd


 sudo apt-get install uck


dowload ubuntu mini remix
 http://www.ubuntu-mini-remix.org/



 sudo uck-remaster-unpack-iso Downloads/ubuntu-mini-remix-14.04.1-amd64.iso


sudo uck-remaster-unpack-rootfs
sudo uck-remaster-chroot-rootfs


add universe and multiverse to the /etc/apt/sources.list

deb http://archive.ubuntu.com/ubuntu/ trusty main restricted universe multiverse
deb http://security.ubuntu.com/ubuntu/ trusty-security main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu/ trusty-updates main restricted universe multiverse

[apt-get upgrade]

...customize by apt gets ...
you can use apt-get install --no-install-recommends emacs

remove unused kernels by
 dpkg --list | grep linux-image
 sudo apt-get purge <unused ones>




sudo uck-remaster-pack-rootfs
sudo uck-remaster-pack-iso test.iso


for changing the default thema change
 /usr/share/glib-2.0/schemas/org.gnome.desktop.interface.gschema.xml
then
sudo glib-compile-schemas /usr/share/glib-2.0/schemas/


  /usr/share/glib-2.0/schemas/

sources:
 https://code.google.com/p/ardesia/wiki/Create_a_live_distro
https://lists.ubuntu.com/archives/foundations-bugs/2014-August/207632.html
 http://askubuntu.com/questions/65900/how-can-i-change-default-settings-for-new-users

Saturday, August 15, 2015

dark borders firefox

replace
/usr/share/themes/Adwaita/gtk-2.0/gtkrc
 
with this
 
 #Color scheme originally contributed by Franco Gotusso as Clearlooks-DarkOrange 
# Based on Clearlooks-DarkCoffee by Chibi and edited by bvc as Clearlooks-DarkCoffee2

style "clearlooks-default"
{
  GtkMenuItem::selected_shadow_type = none
  GtkWidget::interior_focus = 1
  GtkButton::default_border = { 3, 3, 3, 3 }
  GtkButton::default_outside_border = { 3, 3, 3, 3 }
  GtkRange::trough_border = 2

  GtkWidget::focus_padding = 1

  GtkPaned::handle_size = 6

  GtkRange::slider_width = 15
  GtkRange::stepper_size = 15
  GtkScrollbar::min_slider_length = 30
  GtkCheckButton::indicator_size = 12
  GtkMenuBar::internal-padding = 0

  GtkTreeView::expander_size = 14
  GtkExpander::expander_size = 16

  GtkTreeView::odd_row_color = "#404040"

  GtkWidget::cursor_color           = "#72706E"
  GtkWidget::secondary_cursor_color = "#72706E"

  xthickness = 1
  ythickness = 1

  fg[NORMAL]        = "#d2cfcc" #Main window text
  fg[PRELIGHT]      = "#E9E9E9" #Highlighted widget text
  fg[ACTIVE]        = "#ADA59D" #Inactive widget text
  fg[SELECTED]      = "#E9E9E9"
  fg[INSENSITIVE]   = "#A18989"

  bg[NORMAL]        = "#393f3f" #Backround
  bg[PRELIGHT]      = "#3465A4" #Highlight Widget
  bg[ACTIVE]        = "#2E3232" #Selected Widget
  bg[SELECTED]      = "#3465A4" #The box words are usually in
  bg[INSENSITIVE]   = "#282B2B" #Not active buttons
  base[NORMAL]      = "#4F524F" #Text area widgets
  base[PRELIGHT]    = "#313131" #Check and radio button background
  base[ACTIVE]      = "#313636" #Unfocused Select
  base[SELECTED]    = "#2F4C6D" #Selected Text area item, and that bar over the tabs.
  base[INSENSITIVE] = "#f5f2ee" #

  text[NORMAL]      = "#EEEEEC" #Text area widget text.
  text[PRELIGHT]    = "#E9E9E9" #
  text[ACTIVE]      = "#ADA59D" #
  text[SELECTED]    = "#E9E9E9" #Selected Text area widget text.
  text[INSENSITIVE] = "#757575" #

engine "clearlooks"
   {
    #    sunkenmenubar      = 1       # 0 = disable, 1 = enable
    #    menuitemstyle      = 1       # 0 = flat, 1 = 3d-ish (button)
    #    listviewitemstyle  = 1       # 0 = flat, 1 = 3d-ish (gradient)
    #    progressbarstyle   = 0       # 0 = candy bar, 1 = flat
  }
}

style "clearlooks-wide" = "clearlooks-default"
{
  xthickness = 2
  ythickness = 2
  bg[NORMAL]   = "#414141"
  bg[PRELIGHT] = "#494949"
}

style "clearlooks-button" = "clearlooks-wide"
{
  bg[NORMAL]   = "#414141"
  bg[PRELIGHT] = "#494949"
}

style "clearlooks-notebook" = "clearlooks-wide"
{
  bg[NORMAL] = "#404040"
  bg[ACTIVE] = "#303030"
}

style "clearlooks-tasklist" = "clearlooks-default"
{
  xthickness = 5
  ythickness = 3
}

style "clearlooks-menu" = "clearlooks-default"
{
  xthickness = 2
  ythickness = 1
  bg[NORMAL] = "#404040"
}

style "clearlooks-menu-item" = "clearlooks-default"
{
  xthickness = 2
  ythickness = 3
  fg[PRELIGHT]   = "#E9E9E9"
  text[PRELIGHT] = "#E9E9E9"
  base[PRELIGHT] = "#3465A4"
  base[SELECTED] = "#3465A4"
}

style "clearlooks-menu-itembar" = "clearlooks-default"
{
  xthickness = 3
  ythickness = 3
}

style "clearlooks-tree" = "clearlooks-default"
{
  xthickness = 2
  ythickness = 2
}

style "clearlooks-frame-title" = "clearlooks-default"
{
  fg[NORMAL] = "#e2dfdc"
}

style "clearlooks-panel" = "clearlooks-default"
{
  xthickness = 3
  ythickness = 3
}

style "clearlooks-tooltips" = "clearlooks-default"
{
  xthickness = 4
  ythickness = 4
  bg[NORMAL] = "#3465A4"
}

style "clearlooks-progressbar"  = "clearlooks-default"
{
  xthickness = 1
  ythickness = 1
   fg[PRELIGHT]         = "#e2dfdc"
   bg[NORMAL]           = "#2d1d11"
}

style "clearlooks-combo" = "clearlooks-default"
{
  xthickness = 1
  ythickness = 2
  fg[NORMAL]            = "#141414"
  fg[PRELIGHT]          = "#ed7013"
  fg[ACTIVE]            = "#e2dfdc"
  bg[NORMAL]            = "#414141"
  bg[PRELIGHT]          = "#494949"
}

style "clearlooks-scrollbar" = "clearlooks-default"
{
  fg[NORMAL]            = "#141414"
  fg[PRELIGHT]          = "#e2dfdc"
  fg[ACTIVE]            = "#e2dfdc"
  bg[NORMAL]            = "#414141"
  bg[PRELIGHT]          = "#494949"
}

style "clearlooks-spin" = "clearlooks-wide"
{
  fg[NORMAL]            = "#141414"
  fg[PRELIGHT]          = "#e2dfdc"
  fg[ACTIVE]            = "#e2dfdc"
  bg[PRELIGHT]          = "#414141"
  bg[ACTIVE]            = "#494949"
}

class "GtkWidget" style "clearlooks-default"
class "GtkRange" style "clearlooks-wide"
class "GtkFrame" style "clearlooks-wide"
class "GtkSpinButton" style "clearlooks-spin"
class "GtkStatusbar" style "clearlooks-wide"
class "GtkMenu" style "clearlooks-menu"
class "GtkMenuItem" style "clearlooks-menu-item"
widget_class "*MenuItem.*" style "clearlooks-menu-item"
class "GtkEntry" style "clearlooks-wide"
widget_class "*.tooltips.*.GtkToggleButton" style "clearlooks-tasklist"
widget_class "*.GtkTreeView.GtkButton" style "clearlooks-tree"
widget_class "*.GtkCTree.GtkButton" style "clearlooks-tree"
widget_class "*.GtkList.GtkButton" style "clearlooks-tree"
widget_class "*.GtkCList.GtkButton" style "clearlooks-tree"
widget_class "*.GtkFrame.GtkLabel" style "clearlooks-frame-title"
widget_class "BasePWidget.GtkEventBox.GtkTable.GtkFrame" style "clearlooks-panel"
widget "gtk-tooltips" style "clearlooks-tooltips"
class "GtkNotebook" style "clearlooks-notebook"
class "GtkProgressBar" style "clearlooks-progressbar"
widget_class "*.GtkComboBox.GtkButton" style "clearlooks-combo"
widget_class "*.GtkCombo.GtkButton" style "clearlooks-combo"
class "GtkButton" style "clearlooks-button"
class "GtkScrollbar" style "clearlooks-scrollbar"
 
source:
 http://askubuntu.com/questions/337018/firefox-not-affected-by-gtk-theme

Friday, August 14, 2015

ibus in gnome-flashback

dconf-editor

make
org.gnome.desktop.input-sources.sources read

[('xkb', 'jp'), ('ibus', 'anthy')]

or for mozc

[('ibus', 'mozc-jp')]


to set the keyboard layout for mozc edit
/usr/share/ibus/component/mozc.xml

<layout>default</layout>
to
<layout>jp</layout>
 

if the icon flickers (fcxit) resize it to be 22x22
the icon is located at
/usr/share/fcitx/mozc/icon/mozc.png

sources:
http://note.kurodigi.com/ibus-mozc-kbdlayout/
http://zaka-think.com/linux/ubuntu/elementary-os-fcitx/

Tuesday, July 14, 2015

firefox white bar with adwaita theme

To have a dark theme also in firefox

Select light theme in gnome-tweak-tool, but
move
/usr/share/themes/Adwaita/gtk-3.0/gtk-dark.css
to
/usr/share/themes/Adwaita/gtk-3.0/gtk.css

Wednesday, June 24, 2015

windows share from linux

sudo mount -t cifs -o user=fabio //192.168.6.133/share  /tmp/a

if you get the error

mount: Cannot allocate memory

then change the registry on the windows side:

HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Memory Management\LargeSystemCache - set it to 1 

HKLM\SYSTEM\CurrentControlSet\Services\LanmanServer\Parameters\Size - set it to 3
source:

http://www.linuxquestions.org/questions/linux-server-73/mount-cifs-cannot-allocate-memory-or-remote-i-o-error-after-data-transfer-4175508385/

Friday, April 24, 2015

opencv2 on natty

sudo add-apt-repository ppa:ubuntu-toolchain-r/test
https://launchpad.net/~ubuntu-toolchain-r/+archive/ubuntu/test
apt-get install g++-4.6 libgtk2.0-dev pkg-config

opencv 2.4.11:
http://sourceforge.net/projects/opencvlibrary/files/opencv-unix/2.4.11/


Friday, April 17, 2015

ubuntu old releases apt-get


replace CODENAME with jaunty, etc

## EOL upgrade sources.list
# Required
deb http://old-releases.ubuntu.com/ubuntu/ CODENAME main restricted universe multiverse
deb http://old-releases.ubuntu.com/ubuntu/ CODENAME-updates main restricted universe multiverse
deb http://old-releases.ubuntu.com/ubuntu/ CODENAME-security main restricted universe multiverse

# Optional
#deb http://old-releases.ubuntu.com/ubuntu/ CODENAME-backports main restricted universe multiverse


source:
http://superuser.com/questions/339537/where-can-i-get-the-repositories-for-old-ubuntu-versions

Monday, April 6, 2015

gEDA linux

https://ashwith.wordpress.com/2010/09/10/circuit-simulation-in-gnulinux-lets-begin/

Monday, March 23, 2015

samba mount

smb mnt

to mount from any user add in /etc/fstab

//IP/SHARENAME   /MNTDIR  cifs  user,exec,user=USERNAME,pass=PWD 0 0

where the first user is to allow users to mount, the second is for samba.
exec is for allowing execution of files

you can mount (but the mounter is sudo) from command line with
mount -t cifs -o user=USER -o password=PWD //IP/SHARENAME /MNTDIR

Tuesday, February 3, 2015

sd name (fat32) in linux

 sudo apt-get install mtools

 sudo mlabel -i /dev/sdb1 ::label

in case of the following error
Total number of sectors (7736320) not a multiple of sectors per track (63)!
Add mtools_skip_check=1 to your .mtoolsrc file to skip this test

add to ~/.mtoolsrc as suggested


Friday, January 23, 2015

Agilent u1177a from linux

the bluetooth is a virtual serial, pin 1234, 9600 baud, 8 data bits, 1 stop bit
the following list of commands work

  *Query commands are post-fixed with a "?"
     *For queries regarding the secondary display, append @2 to the command (e.g. CONF? @2)
*IDN?                 - Identification 
SYST:BATT?        - Request batter status. Not sure what units are returned.
CONF?                - Request confirguration (e.g. "VOLT:AC +5.00000000E+00,+1.00000000E-04")
STAT?                - Request unit status. I have not decoded the meaning of the return value for this. (e.g. "000000I00302L00004001")
FETC?                - Request current reading (and FETC? @2 returns current reading on secondary display)
*RST                 - Meter reset
SYST:VERS?        - Unknown, my meter returns 1990.0
SYST:ERR?          - Unknown, probably returns the last error
READ?                 - Request current reading. I don't believe that the @2 option works for this command.
If your meter supports logging (manual or auto) then the following commands can be used:
LOG:AUTO xx        - Request value of auto-log position xx
LOG:HAND xx        - Request value of manual log position xx


source:
http://www.eevblog.com/forum/testgear/agilent-u1272a-data-logging-software-installation/

Sunday, December 21, 2014

brightness laptop

Ubuntu 14.04, xfce (xfce4),

create the file
 /usr/share/X11/xorg.conf.d/20-intel.conf

with content

Section "Device"
        Identifier  "card0"
        Driver      "intel"
        Option      "Backlight"  "intel_backlight"
        BusID       "PCI:0:2:0"
EndSection
 
source:http://itsfoss.com/fix-brightness-ubuntu-1310/ 

Tuesday, November 4, 2014

match qt theme to awaita-dark

apt-get isntall gtk2-engines
(for gtk2 clearlooks)

mkdir .themes
cp /usr/share/themes/Adwaita/ .themes/AdwaitaDark
cd .themes/Adwaita
mv gtk-3.0/gtk-dark.css gtk-3.0/gtk.css


source:
https://bbs.archlinux.org/viewtopic.php?id=151846



replace gtk-2.0/gtkrc with the following

# Color scheme originally contributed by Franco Gotusso as Clearlooks-DarkOrange
# Based on Clearlooks-DarkCoffee by Chibi and edited by bvc as Clearlooks-DarkCoffee2

style "clearlooks-default"
{
  GtkMenuItem::selected_shadow_type = none
  GtkWidget::interior_focus = 1
  GtkButton::default_border = { 3, 3, 3, 3 }
  GtkButton::default_outside_border = { 3, 3, 3, 3 }
  GtkRange::trough_border = 2

  GtkWidget::focus_padding = 1

  GtkPaned::handle_size = 6

  GtkRange::slider_width = 15
  GtkRange::stepper_size = 15
  GtkScrollbar::min_slider_length = 30
  GtkCheckButton::indicator_size = 12
  GtkMenuBar::internal-padding = 0

  GtkTreeView::expander_size = 14
  GtkExpander::expander_size = 16

  GtkTreeView::odd_row_color = "#404040"

  GtkWidget::cursor_color           = "#72706E"
  GtkWidget::secondary_cursor_color = "#72706E"

  xthickness = 1
  ythickness = 1

  fg[NORMAL]        = "#d2cfcc" #Main window text
  fg[PRELIGHT]      = "#E9E9E9" #Highlighted widget text
  fg[ACTIVE]        = "#ADA59D" #Inactive widget text
  fg[SELECTED]      = "#E9E9E9"
  fg[INSENSITIVE]   = "#A18989"

  bg[NORMAL]        = "#393f3f" #Backround
  bg[PRELIGHT]      = "#3465A4" #Highlight Widget
  bg[ACTIVE]        = "#2E3232" #Selected Widget
  bg[SELECTED]      = "#3465A4" #The box words are usually in
  bg[INSENSITIVE]   = "#282B2B" #Not active buttons
  base[NORMAL]      = "#4F524F" #Text area widgets
  base[PRELIGHT]    = "#313131" #Check and radio button background
  base[ACTIVE]      = "#313636" #Unfocused Select
  base[SELECTED]    = "#2F4C6D" #Selected Text area item, and that bar over the tabs.
  base[INSENSITIVE] = "#f5f2ee" #

  text[NORMAL]      = "#EEEEEC" #Text area widget text.
  text[PRELIGHT]    = "#E9E9E9" #
  text[ACTIVE]      = "#ADA59D" #
  text[SELECTED]    = "#E9E9E9" #Selected Text area widget text.
  text[INSENSITIVE] = "#757575" #

engine "clearlooks"
   {
#    sunkenmenubar        = 1       # 0 = disable, 1 = enable
#    menuitemstyle         = 1       # 0 = flat, 1 = 3d-ish (button)
#    listviewitemstyle     = 1       # 0 = flat, 1 = 3d-ish (gradient)
#    progressbarstyle      = 0       # 0 = candy bar, 1 = flat
  }
}

style "clearlooks-wide" = "clearlooks-default"
{
  xthickness = 2
  ythickness = 2
  bg[NORMAL]   = "#414141"
  bg[PRELIGHT] = "#494949"
}

style "clearlooks-button" = "clearlooks-wide"
{
  bg[NORMAL]   = "#414141"
  bg[PRELIGHT] = "#494949"
}

style "clearlooks-notebook" = "clearlooks-wide"
{
  bg[NORMAL] = "#404040"
  bg[ACTIVE] = "#303030"
}

style "clearlooks-tasklist" = "clearlooks-default"
{
  xthickness = 5
  ythickness = 3
}

style "clearlooks-menu" = "clearlooks-default"
{
  xthickness = 2
  ythickness = 1
  bg[NORMAL] = "#404040"
}

style "clearlooks-menu-item" = "clearlooks-default"
{
  xthickness = 2
  ythickness = 3
  fg[PRELIGHT]   = "#E9E9E9"
  text[PRELIGHT] = "#E9E9E9"
  base[PRELIGHT] = "#3465A4"
  base[SELECTED] = "#3465A4"
}

style "clearlooks-menu-itembar" = "clearlooks-default"
{
  xthickness = 3
  ythickness = 3
}

style "clearlooks-tree" = "clearlooks-default"
{
  xthickness = 2
  ythickness = 2
}

style "clearlooks-frame-title" = "clearlooks-default"
{
  fg[NORMAL] = "#e2dfdc"
}

style "clearlooks-panel" = "clearlooks-default"
{
  xthickness = 3
  ythickness = 3
}

style "clearlooks-tooltips" = "clearlooks-default"
{
  xthickness = 4
  ythickness = 4
  bg[NORMAL] = "#3465A4"
}

style "clearlooks-progressbar"    = "clearlooks-default"
{
  xthickness = 1
  ythickness = 1
   fg[PRELIGHT]          = "#e2dfdc"
   bg[NORMAL]             = "#2d1d11"
}

style "clearlooks-combo" = "clearlooks-default"
{
  xthickness = 1
  ythickness = 2
  fg[NORMAL]            = "#141414"
  fg[PRELIGHT]            = "#ed7013"
  fg[ACTIVE]             = "#e2dfdc"
  bg[NORMAL]            = "#414141"
  bg[PRELIGHT]            = "#494949"
}

style "clearlooks-scrollbar" = "clearlooks-default"
{
  fg[NORMAL]            = "#141414"
  fg[PRELIGHT]            = "#e2dfdc"
  fg[ACTIVE]             = "#e2dfdc"
  bg[NORMAL]            = "#414141"
  bg[PRELIGHT]            = "#494949"
}

style "clearlooks-spin" = "clearlooks-wide"
{
  fg[NORMAL]            = "#141414"
  fg[PRELIGHT]            = "#e2dfdc"
  fg[ACTIVE]            = "#e2dfdc"
  bg[PRELIGHT]            = "#414141"
  bg[ACTIVE]             = "#494949"
}

class "GtkWidget" style "clearlooks-default"
class "GtkRange" style "clearlooks-wide"
class "GtkFrame" style "clearlooks-wide"
class "GtkSpinButton" style "clearlooks-spin"
class "GtkStatusbar" style "clearlooks-wide"
class "GtkMenu" style "clearlooks-menu"
class "GtkMenuItem" style "clearlooks-menu-item"
widget_class "*MenuItem.*" style "clearlooks-menu-item"
class "GtkEntry" style "clearlooks-wide"
widget_class "*.tooltips.*.GtkToggleButton" style "clearlooks-tasklist"
widget_class "*.GtkTreeView.GtkButton" style "clearlooks-tree"
widget_class "*.GtkCTree.GtkButton" style "clearlooks-tree"
widget_class "*.GtkList.GtkButton" style "clearlooks-tree"
widget_class "*.GtkCList.GtkButton" style "clearlooks-tree"
widget_class "*.GtkFrame.GtkLabel" style "clearlooks-frame-title"
widget_class "BasePWidget.GtkEventBox.GtkTable.GtkFrame" style "clearlooks-panel"
widget "gtk-tooltips" style "clearlooks-tooltips"
class "GtkNotebook" style "clearlooks-notebook"
class "GtkProgressBar" style "clearlooks-progressbar"
widget_class "*.GtkComboBox.GtkButton" style "clearlooks-combo"
widget_class "*.GtkCombo.GtkButton" style "clearlooks-combo"
class "GtkButton" style "clearlooks-button"
class "GtkScrollbar" style "clearlooks-scrollbar"