Posts Tagged ‘kde’

Show kde activity name plasmoid

febrero 10, 2017

Introduction

I use Kde activities a lot and I want a simple plasmoid which shows the current activity I’m in. I have so many activities that the activity switcher (not sure of the correct name) would be too big for me to be usable.

 

There’s a plasmoid which it’s aimed originally aimed at showin current application name which we can install and setup so that it shows current activity.

 

application-name plasmoid showing an activity name in a panel

application-name plasmoid showing an activity name in a panel

Its name it’s applicationname-plasmoid .

Fetch and Installation

This installation it’s aimed to your current user. It won’t make the plasmoid available for the rest of the users of your machine.

git clone https://github.com/ilpianista/applicationname-plasmoid
cd applicationname-plasmoid/
zip applicationname.zip package -r
plasmapkg -i applicationname.zip
kbuildsycoca4

Setup

From a panel. Add graphical items. Filter by ‘name’ or search for ‘Application Name’. Double click on it for adding it to the panel.

Then right-click on it. Settings. Select «Always (never display app title)» at the «Show activity name» dropdown. You can optionally set a fixed width too. Finally you just need to click on OK to save the new settings.

 

 

application-name plasmoid Settings window

application-name plasmoid Settings window

Anuncio publicitario

KDE Activities Support for Firefox (Part 1 of 4)

febrero 9, 2017

KDE Activities Support for Firefox (Part 1 of 4)

Part 1: Firefox Accounts local server

Part 2: Firefox Sync-1.5 Server

Part 3: firefoxkde script setup

Part 4: Sync of bookmarks on different profiles

Firefox Accounts local server

Requisites

Nodejs > 4.5.0 (As per Fxa Auth Server requisites)

Nodejs from Jessie is 0.10.29. We need to install it from source. However we will use an special deb repository for that

curl -sL https://deb.nodesource.com/setup_7.x |\
 sudo -E bash -
sudo apt-get install nodejs

Git

sudo apt-get update
sudo apt-get install git

Fxa Auth Server

Fetching Fxa Auth Server

This is one of the two components needed. It’s an auth server.

mkdir fxa-auth-server
cd fxa-auth-server
git clone https://github.com/mozilla/fxa-auth-server/

Fxa Auth Server Requisites

Node >= 4.5.0

We already have it.

Npm

Nodejs 7.x already provides it.

Grunt

# As a new fxaauth user
npm install grunt

Fxa Auth Server Installation

# As the new fxaauth user
cd fxa-auth-server
npm install

Testing Fxa Auth Server

# As the new fxaauth user
cd fxa-auth-server
npm start

Example of server starting ok:

fxa-auth-server.INFO: server.start.1 {"op":"server.start.1","msg":"running on http://127.0.0.1:9000"}

Additional Links

 

Debian Jessie post-installation August 2015

octubre 24, 2015

I recently installed Debian Jessie from scratch in my laptop. Take in mind that I already had a Sid installation and I wanted its same functionality. I am going to describe here some of the post-installation tasks that I did. Some of them are much needed for me. Other ones won’t be interesting for the  most of people.

Activivities

Somehow activities in Debian Jessie’s KDE 4.14.2 did not work out of the box. I cannot live without activities ! I finally found that activities are disabled by default and that you need to install an specific package for them to be installed.

apt-get install libkactivities-bin

Multiarch support

I have an amd64 system and I need i386 support for some applications like Skype.

dpkg --add-architecture i386

apt-get update

Skype with two accounts

I happen to use Skype with two accounts at once. So I needed to recover my /usr/local/bin/skype script which has:


#!/bin/bash
/usr/bin/skype &
/usr/bin/skype --dbpath=~/.SecondInstallation/ &

from my old Sid installation.

FX keys not working as a regular PC

I don’t like FX keys to work as a Mac. In my case, contrary to my old howto (Use Xorg in mac book pro (ES)), I just had to edit:

/etc/modprobe.d/function.conf

add to it:

options hid_apple fnmode=2

and run:
sudo update-initramfs -u
After that you just need to reboot your machine and FX keys worked as I expected for me.

Flash

I tried the recommended Ubuntu partner repository instructions but it used an old flash version. I just used the PepperFlashPlayer Installing Debian wiki page instructions.

Gnome Network Manager

I use gnome network manager instead of the kde one (Maybe I’m wrong on that but I think I found out that kde’s network manager package is no longer there in Jessie). I installed:

apt-get install network-manager-openvpn-gnome

and I recovered files from my old system so that old connections were alive again. I reused files from these two directories:

/etc/NetworkManager/system-connections

and

/etc/NetworkManager/VPN

.

Recover my sound settings

So I want to be able to control my actual device controls from kmix. Not the fake global volumes from pulseaudio which might hide some specific settings.

  • I install: plasma-widget-veromix package to be able to control pulseaudio if needed.
  • Add veromix plasmoid to my kde panels (In order to control pulseaudio from it easily)
  • Thanks to : kmix does not show all channels (part 2) I just edit: /etc/environment and I add to it: KMIX_PULSEAUDIO_DISABLE=1

Oracle Java

Yes, I need sometimes to use official Java. I just used instructions found on: HOW TO INSTALL ORACLE JAVA 8 IN DEBIAN VIA REPOSITORY [JDK8] in order to do it.

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.

Setting up a custom Firefox to use in KDE Activities

marzo 29, 2013

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
for nlink in chrome defaults icons modules ; do
  rm $nlink
  ln -s ../../share/zdfox/$nlink $nlink
done

As per Rebranding Firefox we are going to:

cd /usr/lib/zdfox/chrome
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.

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

zdfox -P pruebasZD3 -no-remote -new-window $url

as a launcher.

Updated Debian Unstable KDE SC to 4.9.5

marzo 29, 2013

I’ve just updated my KDE SC to 4.9.5 version thanks to the qt-kde repository.

I’ve updated my system to the last unstable packages with:

apt-get dist-upgrade

And finally I’ve just used the default instructions from qt-kde and apart from having to uninstall  a qtcurve package everything went fine.

Now I can setup a window or application by its name or class into a given activity (or all of the activities) automatically.

And Dolphin seems way faster than before as it was announced.

Soporte de actividades para Firefox

diciembre 16, 2012

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.
#

ACTIVITY=$(qdbus org.kde.kactivitymanagerd /ActivityManager CurrentActivity)
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

ActivityList=( $(qdbus org.kde.kactivitymanagerd /ActivityManager ListActivities |tr '\n' ' ') )
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