Español English

Saturday, 17 October 2015

How to install Xmonad in Arch Linux/Manjaro (2/2)

Now it is time to talk about my personal configuration in Xmonad. I will show pieces of the configuration file and I will explain what they mean (no worries, we will not go into Haskell details) and I will show some pictures if needed.
   
myTerminal      = "xterm"

myWorkspaces  = ["1:Main","2:Xat","3:Web","4:Music","5:Video","6", "7", "8", "9"]  

myModMask       = mod4Mask
  
In this code above we can see that xterm will be my terminal, my 9 workspaces (note that the names are strings, then you can change them as you wish) and the modMask button (using the windows button, mod4Mask, to use Xmonad actions).

myLayout = onWorkspace "2:Xat" pidginLayout $ onWorkspace "5:Video" nobordersLayout $ tiled1 ||| Mirror tiled1 ||| nobordersLayout  
 where  
  tiled1 = spacing 5 $ Tall nmaster1 delta ratio  
  --tiled2 = spacing 5 $ Tall nmaster2 delta ratio  
  nmaster1 = 1  
  nmaster2 = 2  
  ratio = 2/3  
  delta = 3/100  
  nobordersLayout = smartBorders $ Full  
  gridLayout = spacing 8 $ Grid       
  --gimpLayout = withIM (0.20) (Role "gimp-toolbox") $ reflectHoriz $ withIM (0.20) (Role "gimp-dock") Full  
  pidginLayout = withIM (18/100) (Role "buddy_list") gridLayout

In this part of the configuration file I am specifying what the behaviours of the different workspaces are. We can see that workspace 2:Xat will be using pidginLayout and workspace 5:Video will be using nobordersLayout. All the other workspaces will have three layouts (you can change them as you wish).

After that, we can see for tiled1 the ratio of the amount of screen we want to use between the master window and the stack. Moreover, we can see how the pidginLayout and nobordersLayout are specified. Please, see below a screenshot for the pidginLayout.

Pidgin running with special layout in workspace 2:Xat

myManageHook = composeAll       
     [ className =? "File Operation Progress"   --> doFloat  
     , resource =? "desktop_window" --> doIgnore  
     , className =? "xfce4-notifyd" --> doIgnore  
     , className =? "Pidgin" --> doShift "2:Xat"  
     , title =? "New Tab - Google Chrome" --> doShift "3:Web"
     , className =? "Firefox" --> doShift "3:Web"
     , className =? "Clementine" --> doShift "4:Music"  
     , className =? "Vlc" --> doShift "5:Video"  
     ]  


In this piece of configuration file we can see the hooks that we want to have in the system. I think they are quite straight forward, but I would like to mention that Firefox is moved always to workspace 3:Web or Vlc is moved to workspace 5:Video.

    ------------------ 
    -- Window Managing
    ------------------
    -- Move focus to the next window    
    , ((mod4Mask, xK_j), windows W.focusDown)
    -- Move focus to the previous window
    , ((mod4Mask, xK_k), windows W.focusUp)
    -- Move focus to the master window
    , ((mod4Mask, xK_m), windows W.focusMaster)
    -- Swap the focused window and the master window
    , ((mod4Mask, xK_Return), windows W.swapMaster)
    -- Swap the focused windows with the next window
    , ((mod4Mask .|. shiftMask, xK_j), windows W.swapDown)
    -- Swap the focused windows with the previos window
    , ((mod4Mask .|. shiftMask, xK_k), windows W.swapUp)
    -- Shrink the master area
    , ((mod4Mask, xK_h), sendMessage Shrink)
    -- Expand the master area
    , ((mod4Mask, xK_l), sendMessage Expand)

This is another important piece of the configuration file. This snippet shows how to interact with the windows you have in a workspace. Let's read a few lines to see how it works. The first one is how to focus on the next window, for that we have to use the combination Win+j or to move to the previous window we have to use the combination Win+k.

    -------
    -- Apps
    -------
    -- Google Chrome
    , ((mod4Mask, xK_g), spawn "google-chrome-stable")
    -- Pidgin
    , ((mod4Mask .|. shiftMask, xK_p), spawn "pidgin")
    -- VirtualBox
    , ((mod4Mask, xK_v), spawn "VirtualBox")
    -- Clementine
    , ((mod4Mask, xK_c), spawn "clementine")
    -- VLC
    , ((mod4Mask .|. shiftMask, xK_v ), spawn "vlc")
    -- Terminator
    , ((mod4Mask, xK_Return), spawn "terminator") -- spawn terminator terminal  
    -- Thunar
    , ((mod4Mask, xK_t), spawn "thunar")  
    -- Dmenu
    , ((mod4Mask, xK_p), spawn "dmenu_run")
    -- Kill the focused app
    , ((mod4Mask .|. shiftMask, xK_c), kill) -- kill the app

The last piece of configuration file shows how to launch applications using shortcuts. As you can see, they are as easy as the movements of the windows. To launch pidgin I will have to use Win+Shift+p or to kill the app which I am focused I will use Win+Shift+c.

Finally, to apply these changes you need to compile Xmonad and restart the session. To compile your changes you only have to write in the terminal:

xmonad --recompile


That's all for today. If anyone has questions or wants more information, please, feel free to write a comment.

Wednesday, 14 October 2015

Como instalar Xmonad en Arch Linux/Manjaro (1/2)

En éste post hablaré sobre como instalar Xmonad y usarlo con mis ficheros de configuración personales para hacerlo funcionar. Recuerda que los videos están hechos con asciinema. Eso significa que puedes copiar texto del video!!

Primer paso es añadir el repositorio archlinuxfr a el fichero /etc/pacman.conf e instalar yaourt.

Instala xmonad, xmobar, dmenu, zsh, git, feh entre otras cosas que son necesarias.

Clona el repositorio dot-files desde mi repositorio en GitHub y activa SLiM como login manager.

Una vez te autentiques en el sistema deberías ver algo parecido a esto:

Hay muchos ficheros de configuración que han sido usados para hacer funcionar esto. Además, sería muy costoso y extenso explicar cada uno de ellos, pero si la gente muestra interes, en alguno o en todos ellos, crearé otra entrada explicandolos.


En el siguiente post hablaré sobre my configuración de Xmonad y como usarlo. Si quieres ver un avance de lo que veremos en el proximo post puedes hechar un vistazo a el fichero ~/.xmonad/xmonad.hs

Para finalizar. Ultimamente he estado jugando un poco con DWM, otro tiling window manager, de suckless.org. Haré una entrada explicando como usarlo y porque creo que es muy interesante.

Monday, 12 October 2015

How to install Xmonad in Arch Linux/Manjaro (1/2)

In this post I will talk about how to install Xmonad and use my personal configuration files to make it run. Remember the videos are made with asciinema. That means you can copy from the video!!

First step is adding archlinuxfr repo to the /etc/pacman.conf file and installing yaourt.

Install xmonad, xmobar, dmenu, zsh, git, feh and all other needed stuff.

Gather dot-files from my repository in GitHub and enable SLiM as login manager.

Once you log into the system you should see something like:

There are plenty of configuration files put in place to make it run. Therefore, it will be so long to explain each of them, but if people are interested in some or all of them I will make another entry explaining them.

In the next post I will talk about the configuration I have in Xmonad and how to use it. If you want to see something in advance have a look to the file ~/.xmonad/xmonad.hs

Finally, recently I have been playing with DWM, another tiling window manager, from suckless.org. I will make another entry in the future explaining about it, because I think is really interesting.

Thursday, 27 August 2015

Installing Manjaro minimal

Manjaro has different flavours and each one has their own installer, but there is a minimal version of Manjaro. The minimal version only installs the required software to start the system. At the end we have something similar such after installing Arch Linux, but we all advantages of Manjaro.

Manjaro minimal net install 64 bits

Manjaro minimal net install 32 bits

Right below you can watch a video where I show how you can install Manjaro minimal (for those ones who remember the old Arch Linux installer this will remind you to it)

NOTE: When it looks like I am doing nothing in the /etc/hostname file actually is installing the system, but it is not shown in the video.

I hope you liked it. In the next post I will explain how to install and configure Xmonad in Manjaro.

Instalación mínima de Manjaro

Manjaro tiene diferentes instaladores dependiendo de que entorno de escritorio vayas a instalar, pero también cuenta con un instalador mínimo. Éste instala sólo lo necesario y nos proporciona un entorno parecido al que tenemos después de instalar Arch Linux, pero con las ventajas de Manjaro.

Manjaro minimal net install 64 bits

Manjaro minimal net install 32 bits

A continuación podéis ver un video en el cual realizo una instalación de Manjaro (para los que llegasteis a conocer el antiguo instalador de Arch Linux os será familiar).

Nota: Cuando tengo el curso encima de /etc/hostname por unos 10 minutos es que el sistema se está instalando. No se porque no se ha grabado bien esa parte.

Espero que os haya gustado. En la siguiente entrada explicaré como instalar y configurar Xmonad en Manjaro.

Thursday, 6 June 2013

Diferentes tipos de redes para VirtualBox

La aplicación VirtualBox nos proporciona diferentes opciones para conectar las máquinas virtuales que hemos creado entre ellas o a diferentes redes. En esta entrada quiero mostraros las opciones que nos proporciona VirtualBox y que características y ventajas nos proporcionan.

Los tipos de conexión que hay disponibles en VirtualBox:
  • NAT (Network Address Translation).
  • Bridged.
  • Red interna.
  • Red sólo anfitrión.
Supongo que la mayoría estáis familiarizados con los dos primeros tipos de conexión, pero los otros dos os pueden resultar confusos. Por eso paso a explicar un poco que características tienen cada tipo y la forma de utilizarlas en el VirtualBox.

NAT:

El NAT (Network Address Translation) es un mecanismo utilizado por routers IP para intercambiar paquetes entre dos redes que asignan mutuamente direcciones incompatibles. En este caso el router es el sistema anfitrión que hace el trabajo de traducción entre las dos redes (la privada de las máquinas virtuales y a la que está conectado el sistema anfitrión). 

VBoxManage modifyvm "Nombre Máquina Virtual" --natpf1 "<Nombre de la regla>,tcp|udp,<IP destino>,<Puerto de escucha>,<IP máquina virtual>,<Puerto de la máquina virtual>"

por ejemplo, vamos a crear una regla que nos permita conectarnos por SSH a la máquina virtual ArchLinux, con cualquier IP y desde cualquier IP. Para ello vamos a dejar en blanco el apartado de las IP.

VBoxManage modifyvm "ArchLinux" --natpf1 "ConexionSSH,tcp,,2222,,22"

Bridged:

El Puente conecta segmentos de red formando una sola subred. Para nosotros tenemos dos segmentos de red, uno es el que forman las máquinas virtuales y el otro es la red a la que está conectado el sistema anfitrión. 


VBoxManage modifyvm "Nombre Máquina Virtual" --nic1 bridged --bridgeadapter1 <Adaptador de red adaptador>

Utilizamos la máquina virtual ArchLinux para que se conecte a una red puente.

VBoxManage modifyvm "ArchLinux" --nic1 bridged --bridgeadapter1 eth0

Red interna:

La red interna es similar a la puente en que la máquina virtual se puede comunicar directamente con “el mundo exterior”. Sin embargo, el “el mundo exterior” está limitado a las otras máquinas virtuales en el mismo anfitrión que estén conectadas a la misma red interna. 

Para utilizar este tipo de conexión debemos tener un servidor DHCP primero, para ello ejecutamos la siguiente orden:

VBoxManage dhcpserver add --netname intnet --ip 192.168.2.100 --netmask 255.255.255.0 --lowerip 192.168.2.101 --upperip 192.168.2.254 --enable

Ahora debemos decirle a la máquina virtual que utilize la red que acabamos de crear. Para ello empleamos esta orden:

VBoxManage modifyvm "ArchLinux" --nic1 intnet

Red sólo-afitrión:

La red sóloanfitrión es un híbrido entre la red puente y la res interna. Las máquinas virtuales puede
comunicarse entre si y además con el sistema anfitrión. 

Primero debemos activar un servidor DHCP, como en el caso anterior, y después cambiar el tipo de red en la máquina virtual como en la siguiente orden:

VBoxManage modifyvm "ArchLinux" --nic1 hostonly

Como siempre si alguien tiene alguna duda o quiere preguntar algo, que lo escriba en los comentarios y lo intentaré responder ;)

Tuesday, 19 March 2013

Kali Linux con Mate

Supongo que todos sabéis ya lo que es Kali Linux, o como lo llaman algunos BackTrack 6. Prefiero llamarla Kali Linux, ya que si los creadores han decidido cambiarle el nombre por algo será.

El objetivo de este post es instalar y hacer funcionar el escritorio Mate en Kali Linux. Personalmente no me gusta el gnome3 y prefiero instalar Mate. Para ello vamos a seguir unos sencillos pasos.

El primero es añadir a los orígenes del software el repositorios de mate para Debian. Para ello editamos el fichero /etc/apt/sources.list como en la figura siguiente.

Fichero /etc/apt/sources.list con el repositorios de Mate para Debian
Ahora debemos hacer un apt-get update, pero nos dará un error. Eso es normal tranquilos, debemos instalar el paquete mate-archive-keyring como se puede ver en la figura siguiente.
Instalando el paquete mate-archive-keyring
Ahora ya podemos realizar el apt-get update e instalar los paquetes: alsa-utils, gamin, mate-core, mate-desktop-environment y synaptic. Para ello podemos realizar los mismo que se puede ver en la siguiente figura.
Instalando paquetes necesarios para Mate
Una vez hecho ésto podemos salir de la sesión y acceder pero cambiando el tipo de escritorio como en la siguiente figura.
Login en el sistema con la opción de Mate
Si hemos seleccionado MATE como escritorio ahora podemos ver que tenemos las herramientas de Kali Linux en el menú, pero no de forma ordenada y bonita como en el gnome. Para ello debemos ir a la carpeta /etc/xdg/menus como en la figura siguiente.
Cambiando de carpeta para ir a los menús
Ahora debemos editar el fichero mate-applications.menu y añadir el apartado Kali Linux que podemos ver en la siguiente figura. Yo lo he añadido entre los apartados Internet y Multimedia como en la versión de gnome.
Edición del manú de Mate
Ahora debemos salir de la sesión y autenticarnos de nuevo para acceder al escritorio Mate como hemos hecho anteriormente y ya tendremos el menú de Kali Linux en Mate. Lo podemos ver en la siguiente figura.
Mate con menú Kali Linux
Si también queremos el fondo de escritorio que trae Kali Linux por defecto podemos pulsar el botón derecho en el escritorio y elegimos "cambiar fondo de escritorio". A continuación pulsamos añadir y buscamos en la carpeta /usr/share/wallpapers/kali/contents/images/ ahí encontraremos diferentes versiones del fondo de escritorio.
Buscando la imagen de fondo de escritorio por defecto en Kali Linux
Elegimos la más adecuada a nuestra resolución y ya tendremos un Kali Linux totalmente funcional con Mate.
Kali Linux con Mate