Tuesday, April 23, 2013

dwm: For lazy people who like to complicate things first

I am a programmer, therefor I am lazy. It is what is it, programmers are lazy but productive people (ironic isn't it ?) In my last blog post, I explained how I got back to Linux after a quick break and how Arch Linux was fit for me. Even though I was happy with my setup, I wanted more.. and I wanted something simpler. Why ? Because I am lazy ! And on my quest for simpleness, I tried other terminals, I tried GNU screen, I tried to add more and more things to my pypanel..

I ended up browsing the Arch Linux Forum and came across some picture of a window manager that looked simple as 1, 2, 3. I made a little research and found out it was dwm (Dynamic Window Manager) by suckless. OH. MY. GOD. It is what I have been looking for. There is one problem though: unlike OpenBox whose config (or what I have been configuring) was in xml, DWM must be compiled each time you make a change.. and it's in C !!! I am pretty conscious that C is probably one of the must know for programmer but I just did an embedded system class and I hated it so I was a bit skeptical. But I still went on, installed it, tried it, changed the .h (booyaa, I only had to change that file), re-build. The result is beautiful. Minimalist yet powerful. Enough talk, here is the result with very few changes to the original config file:


clean desktop


busy desktop

You might say.. "meh", but to me, this is a palace for a work station. Here are the features I exploited:
  • I discovered Alt+p which launches dmenu (another feature of dwm) which lets me run ANY command without opening a terminal.
  • Each tag (more or less desktops) will be used for one and only one thing. And I have named them just so I know. 
    • You can establish rules like "Chromium will only open in the web tag" or "Sublime Text will only open in the dev tag".
    • You can easily switch tag with alt + x where x is the position of the tag (Alt + 2 would display what's in dev)
  • I can launch a terminal with Shit+Alt+Enter, BUT I had to set which one because somehow dwm assumes you are using urxvt.
  • You can switch between the Tiled mode (which is how it looks on the busy screenshot) or Floating mode. Tiled mode means you let the WM place your windows as long as it fills the screen. Floating mode is what most people are used to but this time, to move a window you must hold the Alt key before dragging it.
  • I can switch between windows easily with my keyboard too !


I kept conky from my setup with OpenBox and the auto-changing wallpaper but that is all. I like this one. 
My status bar font is called ohsnap(.icons). It can be found in AUR.

It's simple, neat and I barely use my mouse. I don't mind recompiling the wm each time. I don't mind if it's in C (C is great anyway, I need to make peace with it). It is worth it. After all, a programmer will spend more time working on something that will save him time than the actual time he saves.

Config can be found at : https://github.com/nylogavins/arch-config

Saturday, April 20, 2013

Back to the sources... open sources !

I have been using Windows for quite some time now (I remember using Ubuntu a few years ago), but I always had an interest in Linux and I never was able to justify why. Recently, as my bachelor degree final project, I released an open-source project (perhaps, a blog post about it will come :D) and after making some researches I am now somewhat able to explain why I like free open-source software. In short: I like collaboration, I like sharing and I like having total control. When using almost any Linux distribution, you get all that and more ! Now, I am not skilled enough to contribute to the Linux kernel or to any distribution base system but I like the idea. But giving me total control on my operating system ? Shut up and take my money ! Oh.. it's free ?! Yay !!

In the past, I scrapped a lot of my Linux or BSD installation by doing things I didn't quite understand. With great power comes great responsibilities after all. But today, I am less immature (because I cannot say I am mature yet) and more aware of what I can and should do. So, I decided to install Arch Linux on my workstation !


Why Arch Linux ? Actually, why installing a certain Linux distribution instead of another ? It is a matter of choice. I tried Gentoo in the past and as much as I like the total control and the range of things I can customize, I just didn't like how emerge was pretty long to install or update some packages (i.e.: x11.. oh boy grab yourself a few movies). As mentioned before, I used Ubuntu before but it is "too" user-friendly for me. So much that when I tried the latest version, I just didn't know how to do simple things (because I like to do things, the complicated way). Fedora.. I like it, but I feel it is waaaaay to heavy but maybe that's just me. I also used FreeBSD for a few years but I wanted to see more.


So I ended up with Arch Linux. I tried it before on my eeePC because it decided to stop working. What I liked about it is that it was relatively easy to install, fast and you decide to install what YOU want. After a fresh install, you do not end up with apps you will discover a few months later and realize you never used. Pacman is also really fast and easy to use in my opinion. It is also backed by a very large community (3 official repositories and a users' project repository).
After messing around for hours, I got something I am pretty much proud of:

















So my installation consists of:

  • OpenBox: No Desktop Environment, just a Window Manager. Onyx is my OB theme but I also applied a GTK+ theme for the look and feel: Orta by using lxappearance.
  • SLiM: My login manager, works and looks great.
  • My "desktop" only has 3 things: conky (that line of text at the top of the screen), pypanel (the taskbar at the bottom of the screen) and feh to apply a wallpaper that actually switches every 15 minutes (I wrote a bash script that those that). You decide what Conky and PyPanel are displaying, which is why it got my attention.
  • Very basic "essential" packages: chromium, sublime text 2, xterm, git. Everything else are extras.
    EDIT: I switched to tilda for my terminal. Tilda is basically a drop-down terminal that I make appear by pressing a single button and i can also make it disappear with that same button. And it opens multiple tabs !!
  • python, ruby, Apache, etc. Things I must have to program.
I discovered some pretty nice packages too along the way:
  • cmus: C* Music Player. A text-based music player. It works great ! You can add medias to your library and just play them, create playlists and pretty much do whatever you want to do with a music player.
  • beets: A text-based media manager. It even corrects the tags of your files and it acts as the database of your mp3 files.
  • yaourt: Yet AnOther User RepOsitory. Same as pacman but you can also update AUR packages.
  • ranger: a text-based file manager with vi-like key bindings
  • task warrior (task): A simple text based todo list.
I seem to like text-based programs huh ? Well yeah. They are usually faster and once you get a grip of the basic, pretty much easy to use.
Now, I am learning the shell more in depth to automate more oft-repeated tasks and I hope to find more cool packages in the repositories.


Config can be found at: https://github.com/nylogavins/arch-config