Automatic Screen Detection And Configuration Under Awesome WM

Recently I’m mainly interested in automating my day-to-day tasks on Linux laptop. I’ve started with automating back-up process, now come time to automate external screen detection (and configuration).

For couple of months I was struggling with ZSH history to find XRandR commands that enables and disables external screen. During that time I was almost sure that there is another way of handling this task … since eg. Gnome was doing it automatically. First idea was to find part of Gnome that is responsible for this feature and simply just integrate it with Aersome WM. But my from-time-to-time raw searches didn’t snow any interesting resources. Therefore I’ve decided that I must done it by my self … this is how screenful project was born.

What is screenful ?

It is simple extension to Awesome WM that allows you (with little knowledge of Lua and XRandR params) automatically configure connected screen. It integrates udev drm/change event with Awesome and XRandR. First of all there is udev rule that when drm/change event appears inform screenful about output change in particular card. Then screenful will “calculate” which card output was connected/disconnected, computes screen id based on EDID and finally run configured action. When configuration file doesn’t have specified configuration for this id then screenles will append commented configuration for it and run default action.

What is unique in screenful ?

Same as Awesome WM config file, the screenful config file is a Lua script! Therefore you can do anything you can imagine when external monitor is connected/disconnected. For example you can switch mplayer default audio output when you HD TV set is connected using HDMI cable then change it back when you disconnecting HDMI cable. Also you can reorganize yours tags and windows using Awesome Lua API … and more … Honestly I doubt that you can achieve similar behaviour in any different Window Manager 😉

Project is hosted on github if you encounter any issues or have ideas about new functionalities in screenful feel free to fork me, fill a bug or mail me 😉

Biurko developera v2.0

Jeszcze zanim dotarło do mnie biurko i krzesło wiedziałem, że następnym wydatkiem będzie monitor … w założeniach miało to być trochę później ale jak widać na powyższym zdjęciu realizacja nastąpiła dość szybko.

Dziś właśnie dotarł do mnie 24 calowa matryca LCD, zwana potocznie monitorem ;). Ciągle jestem jeszcze zszokowany jej ogromem.  Nie ma co tutaj porównywać z 13,3″ w MacBook’u; trzeba będzie na nowo zaaranżować sobie przestrzeń pracy w Eclipse’ie. Jeszcze większym wyzwaniem będzie odpowiednia konfiguracja awesome (a właściwie to odpowiednie jego oskryptowanie), żeby możliwe było ergonomiczne korzystanie z dostępnej powierzchni wyświetlanego obrazu. Trzeba będzie dobrać odpowiednie skróty do manipulacji oknami oraz do żonglowania nimi między tagami … ech … plany są spore, czas jest ograniczony wszystko zależy od chęci 😉

Jak na razie po podłączeniu pod wielki monitor głównie z niego korzystam, a wyświetlacz w MacBook’u służy wyłącznie w celach relaksacyjnych 😉

Dopiero teraz swoją użyteczność okazuje zagłówek w krześle. Wcześniej kiedy to wpatrywałem się w monitor w laptopie często odrywałem głowę od niego pochylając ją lekko to przodu. Teraz głowa jest cały czas oparta o zagłówek, oczy są na wysokości głównego monitora … nie wiem na ile jest to poprawna postawa ale na pewno jest lepsza niż ta jaką miałem do tej pory.

Następny etap urządzania przestrzeni developera to system nagłaśniający. Wzmacniacz już jest pozostaje tylko dokupić odpowiednie przetworniki (tj. głośniki) … z tym zakupem na pewno się jeszcze wstrzymam dość szaleństw finansowych …