📜 ⬆️ ⬇️

Console comfort

It so happened that I had to sit for a long time in the black-black console of my beloved Debian GNU / Linux.
The console is good for everyone, but some of the little things I used to in ordinary DE really lacked.
For example, on the one hand, the specifics of my work required me to always know the current time and, according to this time, to direct my further actions. On the other hand, the fascinating work and the pleasant green font of the console knocked down my internal clock.
It was decided to provide themselves with hours (and in the future, and other information) on the console anytime and anywhere.

The task turned out to be quite simple. I wrote a small daemon, which in the upper right corner of the console displays the current time and load average.
It would seem that all? I guess, yes. Everything.
True, I thought that this demon could be useful to someone else (well, or at least interesting), so I civilized the code and put it under the GPL for general access.
According to the principle of "release early release often" I published what is. Currently, the daemon can output time, uptime and load average. The data set is configured when the daemon is started using parameters.

It's simple.

If there are questions, suggestions or (and suddenly ?!) objections, then I am always open for communication.
')
Sources can be downloaded here: conconky.nanohertz.net

If suddenly someone is interested in how the daemon works, but there is no desire to disassemble the code, then the main functionality is as follows:
if((fd = open("/dev/vcs", O_WRONLY)) < 0) { show_error("Have no rights to write to /dev/vcs"); } lseek(fd, cols - total_len, 0); write(fd, total_res, total_len); 

Source: https://habr.com/ru/post/148163/


All Articles