Archive for julio 2013

Mac Book Pro 6,2 fans setup on Linux 3.10 and Debian Unstable

julio 28, 2013

Once again trying to setup my system so that I can use Linux 3.10 without too much hassle. Now it’s the turn for the fans. Since I used Linux 3.10 I noticed the fans were more noisy than before.

So in order to add fan setup first you need to install macfanctld from mactel-support ppa. I used the raring version.

So I’ve added the:

 /etc/apt/sources.list.d/mactel.list

file so that their contents are:

 deb http://ppa.launchpad.net/mactel-support/ppa/ubuntu raring main

. This way I can install macfanctld with:

 apt-get update
 apt-get install macfanctld

and as I don’t want to get more problems when apt-get dist-upgrading I just disable the new repo by commenting the line.

Now I noticed that the fan setup was still noisy. Finally I found at Ubuntu Linux en un macbook pro a working setup that was not so noisy.

Basically what you have to do is edit:

/etc/macfanctl.conf

and make sure that you replace these lines:

temp_avg_floor: 55 #45
temp_avg_ceiling: 65 #55

temp_TC0P_floor: 55 #50
temp_TC0P_ceiling: 65 #58

temp_TG0P_floor: 55 #50
temp_TG0P_ceiling: 65 #58

Once you have edited you only have to restart macfanctl daemon just like:

service macfanctld restart

and the noise gets down (if your laptop is cold enough of course).

Keyboard backlight brightness on Mac Book Pro 6,2 – Linux 3.10

julio 28, 2013

In the past I didn’t manage to make Keyboard backlight to work. It wasn’t turned on at all. When I updated to two or three months ago Debian Unstable the Keyboard backlight began to work at 100%. It was annoying but I didn’t want to waste my time in that.

Now I have invested some time on controlling that brightness. The article is mainly based on Ubuntu explanation on how to use Keyboard backlight without using pommed. Their zenity based script that let you choose the prefered brightness didn’t convince me.

So based on former screen brightness control script here there is a new one.

Its filename is:

/usr/local/bin/custom-keyboardlight-macbookpro

and its content is:

#!/bin/bash

# Adapted from http://www.linuxquestions.org/questions/linux-laptop-and-netbook-25/script-to-set-up-brightness-of-backlight-in-xfce-903704/
# Script for changing backlight brightness in /sys/class/backlight/acpi_video0/brightness
# can take values 0-15, in real (my notebook) works only values 2-15

#IMPORTANT: you must have writing rights to /sys/.../brightness (I must solute it with visudo or something like that...)
#IMPORTANT: for proper work after reboot must exist directory .bright in your home directory and file last_bright in .bright directory 

#reads content of brightness and save it into variable

BRIGHTNESS_FILE="/sys/class/leds/smc::kbd_backlight/brightness"
BRIGHT_CONF_DIR="$HOME/.keyboardbright"
LAST_BRIGHT_FILE="${BRIGHT_CONF_DIR}/last_bright"
BRIGHT=$(cat ${BRIGHTNESS_FILE})

while getopts "pmlhc" optname
 do
  case "$optname" in
   "p")
    #Add more brightness
    #BRIGHT++
    BRIGHT=$(($BRIGHT+17))
    #protect mechanism (BRIGHT must be lower or equal to 15)
     if (($BRIGHT>255))
     then
        BRIGHT=$((255))
     fi
    ;;
   "m")
    #decrease brightness
    #BRIGHT--
    BRIGHT=$(($BRIGHT-17))
    #protect mechanism (BRIGHT must be bigger or equal to 2)
     if (($BRIGHT<0))
      then         BRIGHT=$((0))
      fi         ;; 
     "l")     echo "Loading last value of brightness."     #Load last value, saved in file last_bright     
     BRIGHT=$(cat ${LAST_BRIGHT_FILE})     
     echo "Last value of brightness was: $BRIGHT"     ;;    
     "h")      echo "Help: "      
               echo "-p    Increase brightness"      
               echo "-m    Decrease brightness"      
               echo "-l    Load last brightness value"      
               echo "-c N Set to custom value"      
               echo "-h    This help"      
               echo "Programmed by: ElectricZero"      
               echo "Improved by: adrian15"      
               exit 0;      ;;     
       "c")      BRIGHT=$2      
         if (($BRIGHT>255))
         then
           BRIGHT=$((255))
         fi

     if (($BRIGHT<0))      
     then         
       BRIGHT=$((0))      
     fi      ;;     
     "?")      echo "Unknown argument, try bright -h for help"      
               exit 1;      ;;     
     *)     # Should not occur     
      echo "Unknown error while processing options"     
      exit 2;     ;;   
      esac 
      done 
      echo "Brightness set on $BRIGHT" 
     #Save variable BRIGHT into file brightness 
     echo $BRIGHT > ${BRIGHTNESS_FILE}
     #Save variable BRIGHT into file last_bright
    if [ ! -d ${BRIGHT_CONF_DIR} ] ; then mkdir ${BRIGHT_CONF_DIR} ; fi
    echo $BRIGHT > ${LAST_BRIGHT_FILE}

as you might see there are some changes. Now I don’t mind having a 0 value because I actually want the keyboard not to bright at all. That’s different from an screen when you don’t want to miss it as a turned off one or non working one.

I have modified the script as always so that with only 15 types I can go from turned off to turned on at maximum brightness.

Then we need sudo so that we can run it as normal user.

So we edit sudo with the command:

sudoedit /etc/sudoers

so that we add:

normaluser ALL= NOPASSWD:/usr/local/bin/custom-keyboardlight-macbookpro

to it.

Now in my case as I use KDE I needed to setup its shortcuts to use it.

  • Preferences
  • Shortcuts and gestures
  • Custom Shortcuts

 

Then:

  • Right click and select New group which we will name: Keyboard brightness

Now we are going to setup the Increase Keyboard brightness shortcut.

  • Right click on Keyboard brightness
  • New
  • Global shortcut
  • Order / Url

so that we inform:

  • Name of the shorcut: Increase Keyboard brightness
  • Launcher tab: Short cut. I click on None and then I type «Increase keyboard brightness» button.
  • Action tab. Order / Url: sudo /usr/local/bin/custom-keyboardlight-macbookpro -p

Now we are going to setup the Decrease Keyboard brightness shortcut.

  • Right click on Keyboard brightness
  • New
  • Global shortcut
  • Order / Url

so that we inform:

  • Name of the shorcut: Decrease Keyboard brightness
  • Launcher tab: Short cut. I click on None and then I type «Decrease keyboard brightness» button.
  • Action tab. Order / Url: sudo /usr/local/bin/custom-keyboardlight-macbookpro -m

 

Now we just nee to make sure they are activated so that both of these shortcuts have ticks on them.

 

And that’s it you can control Keyboard brightness from your keyboard.

I think that I might even run: /usr/local/bin/custom-keyboardlight-macbookpro -p at kde start so that old keyboard value persists. Why? Because the default value is the backlight being on 100% while I prefer it to be turned off.

Control screen brightness when booting in EFI Mode with Linux 3.10 in MBP 6,2

julio 28, 2013

Making Screen brightness to work in Linux 3.10

As you might know I’m trying to make work my Mac Book Pro 6,2 with Linux 3.10. One thing that didn’t work was screen brightness. I had already dealt with this settings when booting using Nvidia only and when booting with Intel in the Linux 3.2 days.

However the:

/sys/class/backlight/acpi_video0/

path was not changing the brightness. Something wrong was going here.

Well, finally, it seems that the Linux 3.10 handles pretty well the apple backlight even discerning if it has to deal with the Nvidia Graphics card or with the Intel Graphics card. I was put on the trail thanks to this apple_bl.c source code. At the end the module alias is:

mbp_nvidia_bl

So I decided to modprobe it but an error happened. This was the same error I had seen in dmesg around apple_bl line.

apple_bl: `1' invalid for parameter `use_gmux'

So what I needed to do was to remove that use_gmux parametre. You can find it explained in one of my former articles: Usar tarjeta intel integrada en Debian Unstable para MacBook Pro 6,2 .

I just edited the file:

/etc/modprobe.d/apple_bl.conf

and commented the line just in case I wanted to enable back screen brightness control when booting from 3.2 kernel. The optimal thing would be to add this extra parameter or not depending on Linux Kernel version but I think it’s not worth it.

Not after rebooting I was able to make the screen brightness to work.

Changing brightness manually

You only need to echo some value to:

/sys/class/backlight/gmux_backlight/brightness

which it’s a new path different from the two scripts that I have. Its maximum value is: 110400 which it’s also different from former values.

Script for changing gmux backlight brightness

We will just reuse some code from older scripts and adapt it the new max brightness. The filename is going to be:

/usr/local/bin/custom-backlight-macbookpro_gmux

and its contents will be:

#!/bin/bash

# Adapted from http://www.linuxquestions.org/questions/linux-laptop-and-netbook-25/script-to-set-up-brightness-of-backlight-in-xfce-903704/
# Script for changing backlight brightness in /sys/class/backlight/acpi_video0/brightness
# can take values 0-15, in real (my notebook) works only values 2-15

#IMPORTANT: you must have writing rights to /sys/.../brightness (I must solute it with visudo or something like that...)
#IMPORTANT: for proper work after reboot must exist directory .bright in your home directory and file last_bright in .bright directory 

#reads content of brightness and save it into variable

BRIGHTNESS_FILE="/sys/class/backlight/gmux_backlight/brightness"
BRIGHT_CONF_DIR="$HOME/.brightgmux"
LAST_BRIGHT_FILE="${BRIGHT_CONF_DIR}/last_bright"
BRIGHT=$(cat ${BRIGHTNESS_FILE})

while getopts "pmlhc" optname
 do
  case "$optname" in
   "p")
    #Add more brightness
    #BRIGHT++
    BRIGHT=$(($BRIGHT+7360))
    #protect mechanism (BRIGHT must be lower or equal to 15)
     if (($BRIGHT>110400))
     then
        BRIGHT=$((110400))
     fi
    ;;
   "m")
    #decrease brightness
    #BRIGHT--
    BRIGHT=$(($BRIGHT-7360))
    #protect mechanism (BRIGHT must be bigger or equal to 2)
     if (($BRIGHT<14720))
     then
        BRIGHT=$((14720))
     fi    
    ;;
   "l")
    echo "Loading last value of brightness."
    #Load last value, saved in file last_bright
    BRIGHT=$(cat ${LAST_BRIGHT_FILE})
    echo "Last value of brightness was: $BRIGHT"
    ;;
   "h")
     echo "Help: "
     echo "-p    Increase brightness"
     echo "-m    Decrease brightness"
     echo "-l    Load last brightness value"
     echo "-c N Set to custom value"
     echo "-h    This help"
     echo "Programmed by: ElectricZero"
     echo "Improved by: adrian15"
     exit 0;
     ;;
    "c")
     BRIGHT=$2
     if (($BRIGHT>110400))
     then
        BRIGHT=$((110400))
     fi

     if (($BRIGHT<14720))
     then
        BRIGHT=$((14720))
     fi
     ;;
    "?")
     echo "Unknown argument, try bright -h for help"
     exit 1;
     ;;
    *)
    # Should not occur
    echo "Unknown error while processing options"
    exit 2;
    ;;
  esac
done
echo "Brightness set on $BRIGHT"
#Save variable BRIGHT into file brightness
echo $BRIGHT > ${BRIGHTNESS_FILE}
#Save variable BRIGHT into file last_bright
if [ ! -d ${BRIGHT_CONF_DIR} ] ; then mkdir ${BRIGHT_CONF_DIR} ; fi
echo $BRIGHT > ${LAST_BRIGHT_FILE}

As I already did I also had to modify my main screen brightness script to use the three of the scripts I now have for screen brightness control.

Screen brightness control wrapper script

 

So the file:

custom-backlight-macbookpro_both

now has:

#!/bin/bash

NVIDIA_BL_BINARY="/usr/local/bin/custom-backlight-macbookpro_nvidia"
INTEL_BL_BINARY="/usr/local/bin/custom-backlight-macbookpro_intel"
GMUX_BL_BINARY="/usr/local/bin/custom-backlight-macbookpro_gmux"

while getopts "pmlhc" optname
 do
  case "$optname" in
   "p")
    #Add more brightness
    ${NVIDIA_BL_BINARY} -p
    ${INTEL_BL_BINARY} -p
    ${GMUX_BL_BINARY} -p
    ;;
   "m")
    #decrease brightness
    ${NVIDIA_BL_BINARY} -m
    ${INTEL_BL_BINARY} -m
    ${GMUX_BL_BINARY} -m
    ;;
   "l")
    echo "Loading last value of brightness."
    ${NVIDIA_BL_BINARY} -l
    ${INTEL_BL_BINARY} -l
    ${GMUX_BL_BINARY} -l
    ;;
   "h")
     echo "Help: "
     echo "-p    Increase brightness"
     echo "-m    Decrease brightness"
     echo "-l    Load last brightness value"
     echo "-c N Set to custom value"
     echo "-h    This help"
     echo "Programmed by: ElectricZero"
     echo "Improved by: adrian15"
     exit 0;
     ;;
    "c")
     BRIGHT=$2
     if (($BRIGHT>15))
     then
        BRIGHT=$((15))
     fi

     if (($BRIGHT<2))
     then
        BRIGHT=$((2))
     fi
    let INTELBRIGHT=${BRIGHT}*8800
    let GMUXBRIGHT=${BRIGHT}*7360
    ${NVIDIA_BL_BINARY} -c ${BRIGHT} 
    ${INTEL_BL_BINARY} -c ${INTELBRIGHT}
    ${GMUX_BL_BINARY} -c ${GMUXBRIGHT}
     ;;
    "?")
     echo "Unknown argument, try bright -h for help"
     exit 1;
     ;;
    *)
    # Should not occur
    echo "Unknown error while processing options"
    exit 2;
    ;;
  esac
done

So that’s it. Now screen brightness control should work as before. My former kde key bindings should now work as before.

BCM5974 trackpad with Linux Kernel 3.10

julio 27, 2013

As you might know I was using a patched Linux Kernel 3.2 so that my integrated Intel card was used as default. So, here’s the strange thing, although I’m not setting up BCM5974 through xorg.conf (because there’s no xorg.conf file) it seems that booting into the system by Linux Kernel 3.2 or Linux Kernel 3.10 has different behaviour.

When using Linux Kernel 3.10 if I want to right-click I need to tap with two fingers but these two fingers need to be very close one from another. The same thing happens when you want to paste some text, that is middle click. You need to tap with three fingers and these three fingers need to be very close.

Integrated Intel card in Mac Book Pro 6,2 in Linux Kernel 3.10

julio 27, 2013

As I already explained I finally managed to make work my Integrated intel card in my Debian when using kernel 3.2. I needed to patch the kernel and use some boot parametres to make it work.

But, as expected, Linux Kernel 3.10 without any special patch was not working. But it had to. Why? Because I had asked Seth Forsee about this.

It was not until today that I found the answer in an gentoo forum post: Intel graphics not working on Macbook Pro in EFI mode .

In my old setup I had the kernel parametres:

pcie_aspm=force video=efifb i915.lvds_channel=2
i915.modeset=1 i915.lvds_use_ssc=0
drm.debug=0x14 log_buf_len=16M

among other options which I haven’t modified. I had to modify i915.lvds_channel to be i915.lvds_channel_mode which seems it’s the final name for that option.

So now the default kernel parametres are:

pcie_aspm=force video=efifb i915.lvds_channel_mode=2
i915.modeset=1 i915.lvds_use_ssc=0
drm.debug=0x14 log_buf_len=16M

.

Apart from having to tap with three-finger to get the right-click instead of only two-finger tap everything seems to be ok.

Broadcom BCM43224 in Linux Kernel 3.10

julio 27, 2013

When updating to latest Debian Unstable I had the possibility of using Linux Kernel 3.10. However wifi was not working because of Debian wl driver (broadcom-sta) being based on official Broadcom driver.

The old way of using it that I described when I used Linux Kernel 3.2 was no longer working because source code had not been adapted to newest Linux Kernel versions.

 

I had already described this same problem when I tried to use Linux Kernel 3.8.

I was checking arch forum about this issue and they pointed me to Ubuntu where it seems the bcmwl package is the equivalent one for the Debian’s broadcom-sta* ones.

So I went to Ubuntu package bcmwl page and I downloaded most recent package which was the raring one : bcmwl-kernel-source 6.30.223.30+bdcom-0ubuntu3 in amd64 (Release) .

Once I had downloaded the package I just had to install it as another package.  That builds the newest wl code for all the kernels. I suppose I will need to remove broadcom-sta package so that if I dist-upgrade I don’t get any problem.

dpkg -i bcmwl-kernel-source_6.30.223.30+bdcom-0ubuntu3_amd64.deb

 

Linux Kernel 3.10 and Wifi. That’s great! Let’s hope that in the future Debian includes open source driver so that we can use it without no restriction.  For the record I submitted a bug about this broadcom open source driver.

Debian Unstable Dist Upgrade for using Kde 4.10

julio 17, 2013

Apart from dist-upgrading to latest Debian Unstable I updated my sources.list to include:

deb http://mozilla.debian.net/ experimental iceweasel-aurora

so that I got the latest Firefox. That was Firefox 24.

I’ve had to recreate ZDFox and adapt it to Firefox 24 thanks to: Setting up a custom Firefox to use in KDE Activities updated to Firefox 24.

First of all I recommend you to disable to firefox clean activities script if you use one like me. Because there are some changes needed and if you don’t do them you loose all the non default firefox profiles. So edit the script and put exit 0 at the beginning.

Then, please, update it as described in this updated article: Soporte de actividades para Firefox actualizado para Kde 4.10.

I also noticed that Firefox wasn’t opening windows and tabs from last session so I need to: Firefox 24 and show last opened windows and tabs by default.

And sync wasn’t working as expected so I read Servidor Firefox sync local to recreate sync server to the latest available version. Currently I have problems with syncronisation. Auth problems. It seems you need to remove the old sqlite databases for data and auth after all.

Currently I think that I’m missing the nautilus improvement described at: Que Nautilus no gestione el escritorio. Mejora KDE.

Not sure when but I’ll try to keep this post updated with improvements.

Firefox 24 and show last opened windows and tabs by default

julio 17, 2013

As you might know I use Firefox with Kde activities as explained in: Soporte de actividades para Firefox actualizado para Kde 4.10.

When I updated to Firefox 24 then suddenly everytime I started Firefox there was no window from last session. Was my firefoxkde? Yes, somehow it needed improvement to meet new qdbus calls but even that fixed the last session was lost.

Well, it seems with newer Firefox the default behaviour is to get kind of a blank homepage with default shortcuts to sync, setup and so on.

So… What we need to recover our old default behaviour?

  • Edit
  • Preferences
  • General

When Firefox starts:

Select: Show my windows and tabs from last time

As per my special setup I run:

iceweasel

so that it asked me to run the default profile and change that setting in the default profile. This way the changes are also kept in new iceweasel profiles for new activities.

Soporte de actividades para Firefox actualizado para Kde 4.10

julio 17, 2013

Note: I need to rewrite this article to meet Kde 4.10 changes but I don’t have time to translate it into English. So, exceptionally this article is in Spanish.

Se ha actualiza el articulo: Soporte de actividades para Firefox para que funcione bien en Kde 4.10.

Requisitos

Por un lado se necesita habilitada la sincronización de Firefox con todos las opciones habilitadas excepto las pestañas. A mi no me gusta sincronizar con el servidor oficial de Mozilla así que he habilitado mi propio servidor local de sincronización de Firefox.

Por otro lado hay que verificar que en el directorio:

~/.mozilla/firefox

sólo se tenga un directorio con la forma:

xxxxxxxx.default

Si no fuera así podemos renombrar el directorio y actualizar la ruta en el archivo profiles.ini.

Script firefoxkde

Creamos el fichero:

/usr/local/bin/firefoxkde

y le damos permisos de ejecució con:

chmod +x /usr/local/bin/firefoxkde

Lo editaremos para que su contenido sea:

#!/bin/bash
#
# Compatability for Firefox and kde 4.x's activities.
#
# Kde 4.10 update - Begin
ActivityList=( $(qdbus org.kde.kactivitymanagerd \
/ActivityManager/Activities ListActivities |tr '\n' ' ') )
# Kde 4.10 update - End
FF_FOLDER=$"$HOME/.mozilla/firefox"
DEF_PROF=$"$FF_FOLDER/????????.default"
NEW_PROF=$"$FF_FOLDER/????????.$ACTIVITY"

if [ -d $FF_FOLDER/????????.$ACTIVITY ];
then
        firefox -no-remote -P $ACTIVITY

else
        firefox -no-remote -createprofile $ACTIVITY
        cp -a $DEF_PROF/* $NEW_PROF/
        cd $NEW_PROF
        rm sessionstore.*
        cd ~
        firefox -no-remote -P $ACTIVITY &

fi

exit

Día a día

Como KDE guarda las sesiones vamos primero a salir del firefox actual con Archivo. Salir. para que kde no guarde la sesión del kde actual.

Si necesario también mataremos el proceso si sigue en marcha.

Deshabilitar arranque

En mi caso necesito deshabilitar el arranque del Firefox por defecto sí o sí. Para eso nos vamos a:

  • Preferencias del sistema
  • Administración del sistema
  • Arranque y Apagado
  • Gestor de sesiones
  • Aplicaciones a excluir de las sesiones

en mi caso tuve que añadir:

firefox-bin,/usr/bin/iceweasel,/usr/lib/iceweasel/firefox-bin,iceweasel

aunque es posible que con /usr/bin/iceweasel ya valga. En sistemas no Debian hay que substituir iceweasel por Firefox.

Finalmente pulsamos en el botón Aplicar.

Icono lanzador de Firefox

Yo lanzo Firefox desde un panel que tengo en la parte inferior de la pantalla. Hago click en él con el botón derecho, propiedades.

En la primera pestaña puedo ver su localización. En mi caso en:

/home/adrian/.local/share/applications

y que su nombre es:

iceweasel-2

.

No obstante el fichero no existe en la localización vista. Editamos el lanzador y le añadimos cualquier cambio y guardamos.
Ahora ya podemos editar el fichero:

/home/adrian/.local/share/applications/iceweasel-2.desktop

.
Los cambios que tenemos que hacer son:

Exec=iceweasel %u

para ser:

Exec=firefoxkde %u

Script para borrar profiles antiguos

Creamos el fichero:

/usr/local/bin/firefox-clean-old-activies-profiles

y le damos permisos de ejecució con:

chmod +x /usr/local/bin/firefox-clean-old-activies-profiles

Lo editaremos para que su contenido sea:

#!/bin/bash
# Kde 4.10 update - Begin
ActivityList=$(qdbus org.kde.kactivitymanagerd \
/ActivityManager/Activities ListActivities)
# Kde 4.10 update - End
FF_FOLDER=$"$HOME/.mozilla/firefox"
PRESERVED_FOLDERS="pruebasZD pruebasZD2 pruebasZD3 1g5dikse.default"
CRASH_REPORTS="Crash Reports"

cd "${FF_FOLDER}"

for ffile in * ; do

  IGNORE_DELETE="NO"

  if [ -d "${ffile}" ] ; then
    if [ "${CRASH_REPORTS}" = "${ffile}" ] ; then
      IGNORE_DELETE="YES"
    fi
    for npreserved in ${PRESERVED_FOLDERS} ; do
      if [ "${npreserved}" = "${ffile}" ] ; then
      IGNORE_DELETE="YES"
      fi
    done
    for nactivity in "${ActivityList[@]}"; do
      if echo "${ffile}" | grep "${nactivity}" >/dev/null 2>&1; then
      IGNORE_DELETE="YES"	
      fi
    done

  else
    continue
  fi

  dir_to_delete="${ffile}"

  if [ ${IGNORE_DELETE} = "NO" ] ; then
    echo -e -n "We are going to delete: ${dir_to_delete}\n"
    rm -rf ${dir_to_delete}
  else
    echo -e -n "DO NOT DELETE: ${dir_to_delete}\n"
  fi

done

dónde en:

PRESERVED_FOLDERS

ponemos los directorios que no queremos que se borren, siempre y cuando no tengan espacios en el nombre. Si tienen espacios habrá que o bien renombrarlos o bien modificar el script para tenerlos en cuenta y excluirlos del borrado.

Finalmente forzaremos el arranque de este script desde:

  • Preferencias del sistema
  • Administración del sistema
  • Arranque y Apagado
  • Autoarranque

Hacemos click en Añade script… y ponemos la ruta al script:

/usr/local/bin/firefox-clean-old-activies-profiles

.
Descartamos: Crear como symlink. Y click en Aceptar.

Inconvenientes

En mi configuración una vez creada la primera ventana del firefox de actividad las nuevas ventanas hay que crearlas desde el mismo Firefox con Archivo. Nueva Ventana. Ya digo. Seguramente sea cosa de mi configuración y no os tiene porque pasar lo mismo.

El otro inconveniente es que no se arrancan las diferentes sesiones de Firefox automáticamente como si se arrancarían programas distintos en cada actividad. Pero, bueno, casi mejor, así se empieza antes a trabajar.

Bibliografía

Setting up a custom Firefox to use in KDE Activities updated to Firefox 24

julio 17, 2013

This is the: Setting up a custom Firefox to use in KDE Activities article but rewritten to work with Firefox 24. This updated howto has been tested to work with Kde 4.10.

Actually the ZDFox application class name detection of kwin window manager is not working as expected because some strange reason and thus the article might be updated for it to work.

The ZDFox rebranding part that seems to work is because of window title being different for Iceweasel and ZDFox.

The problem

Well, let’s see if I can explain it clearly. As you might now, I’m using Zimbra Desktop in an Ubuntu 10.04 chroot and that it’s based on Daver’s Zimbra Desktop on Oneric Ocelot which means that you can use whatever browser you want with it.. What I haven’t explained so far is that I’m experimenting on using a custom profile from Iceweasel (Debian’s Firefox fork) to open Zimbra Desktop.

This profile needs to be excluded from deletion in my Firefox kde script .

So, I’ve recently updated my Debian Unstable to 4.9.5 version and that means that according to the window title or the application class I can force the window to be in a given activity or even in all the activities at the same time.

That’s what I want to do. Open my Zimbra Desktop (actually Iceweasel opened with a given profile) and then kwin pins it into all activities.

When you try to do that you will see that when Iceweasel is starting it has different window titles which are changing:

  • No title
  • Zimbra Desktop
  • Zimbra : Bandeja de entrada.

After some tests I think that kwin detects the No title window title and that’s it.

So… What if I could change the application class (which it’s another variable that you can rely on to change activity and window pinning)? What if I could use Iceweasel or Firefox but with a different name? I suppose that would change the application class and voilà!

Setting up ZDFox

So I’m going to call ZDFox to my custom Iceweasel / Firefox and as you will see as I’m using custom profile I’m going to use the same default profile directory because I don’t need a non-default one, but you might want one.

cd /usr/lib
cp -a iceweasel zdfox
cd /usr/lib/zdfox
mv iceweasel zdfox
cd /usr/bin
ln -s ../lib/zdfox/zdfox zdfox
cd /etc
cp -a iceweasel zdfox
cd /usr/share/
cp -a iceweasel zdfox
cd /usr/lib/zdfox/browser

Modified for Firefox 24 – Begin

for nlink in chrome defaults icons modules ; do
  rm $nlink
  ln -s ../../../share/zdfox/browser/$nlink $nlink
done

Modified for Firefox 24 – End
Added for Firefox 24 – Begin

cd /usr/lib/zdfox
rm firefox-bin
ln -s zdfox firefox-bin

Added for Firefox 24 – End

As per Rebranding Firefox we are going to:
Modified for Firefox 24 – Begin

cd /usr/lib/zdfox/browser/chrome

Modified for Firefox 24 – End

mkdir en-US.dir
cd en-US.dir
unzip ../en-US.jar

Then you edit:

locale/branding/brand.dtd
locale/branding/brand.properties

so that you change the brand names. I’ve also changed brand.properties although it would seem it’s not compulsory.

Now let’s put everything back in the jar.

rm ../en-US.jar
zip -r ../en-US.jar *
cd ..
rm -rf en-US.dir

I’ve also noticed for the application class to be changed you need to edit:

/usr/lib/zdfox/application.ini

and change the Name field. In this same file you can change (or add it if you’re using default Firefox, I think it’s added specifically in Iceweasel):

Profile=mozilla/firefox

so that the profile path is different from the default one. As I’ve already said I’m not going to change it myself.

ZDfox use

So if you run zdfox both the window title and the application class will be ZDFox. So, that’s it, kwin finally detects Zimbra Desktop as a different program and I can pin it to all the activities.

Update
The application class is not changed as it was in old versions. Somehow I’m missing something that has changed between latest used Firefox version and Firefox 245. However you can change it from the command line thanks to:

--class=MyApplicationClass

Finally, if anyone is interested in the Zimbra Desktop part in my Zimbra Desktop launcher now I have:

zdfox -P pruebasZD3 -no-remote --class=ZDFox -new-window $url

as a launcher.