Skip to content

amno1/emacs-desktop-widgets

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Conky-Vision Style Clock

./images/vision-style-clock.png

This demo implements a small clock based on Conky-Vision theme by Bobby Bakes. You will need to have Poiret One font installed in order to run it. To use this one, load emacs-vision-clock.el into your Emacs session.

After the file is loaded into Emacs start applicaiton with: M-x emacs-vision-clock-run . Stop it with: M-x emacs-vision-clock-stop.

Conky-Metro Style Clock

./images/metro-style-clock.png

Similarly, for this one you will need to load emacs-metro-clock.el, and then run M-x emacs-metro-clock-run to start it, and M-x emacs-metro-clock-stop to stop it.

“Metro style” clock is inspired by Conky Metro Clock. This one shouldn’t require anything special installed since it uses Open Sans font.

Obviously for both you will have to comile yourself Emacs with the TheVaffels patch. To try clocks in an Emacs without transparency patch, please comment away alpha-background parameter in respective make-frame function; also useful while tinkering with widgets.

About

This repository contains some small tests, to play with transparency patch by TheVaffel. The patch implements transparent background for Emacs frames, which at least in theory means that we can use Emacs to render some interesting effects on the desktop. In practice there are still some problems, most notably drawing graphics. That could be easily overcome with SVG images, but the patch still does not implement transparency for images. Hopefully this will be solved if patch gets accepted into offical Emacs. Meanwhile, unicode drawing characters (icon fonts, and box drawing characters) might be a way to implement some interesting funcitonality.

Why would we use Emacs instead of Conky?

Well, beside being cool in a nerdy way, I think it make sense for folks who already use Emacs, especially those who run Emacs in server mode. Another reason might be to use Lisp instead of Lua, as a better scripting language. Emacs also provides quite good integration with lots of OS services and third party libraries, which might help to write applications that depend on less external processes which might lead to better utilization of system resources and less dependencies. Conky runs only on X11, while Emacs run on all three major OS:s, which means we could have platform independent widgets, as long as we don’t integrate them with some non-portable third party applications or libraries. Last but not least, did I mention the most important: it is just so darn cool! :).

Currently I have implemented just a small clock, in two slightly different versions. It is nothing special, just a very minimal test to see how it works with transparency and Emacs frames as desktop widgets.

Problems and thoughts

Unlike Conky, Emacs is not really meant to be a desktop drawing tool. One notably difficulty I found was aligning text. We don’t work with pixels in Emacs, we work with columns and rows, so aligning text wasn’t as perfect as I would like it.

I also had a problem with line spacing. In “metro style” I would like to have somewhat denser lines, but I don’t see how to implement this. As I understand the documentation we can use ‘line-spacing’ for this, with nil value meaning no extra spacing applied, but I think it is still too much space between lines. I am not sure how to create effect of denser lines. If anyone knows how to, advice or pr/patch are appreciated.

Another obvious issue is that we can’t easily draw lines, rectangles and other graphics in an Emacs buffer. However we could draw both text, graphics and images to an SVG image, and than just insert the image into Emacs buffer for display in a widget frame. Currently, the transparency patch is just in alpha stage, so it does not support transparent images, but there are Conky scripts that use solid background, so this strategy should be already usable. I haven’t had time to implement some opaque widget, but it sholdn’t be anything special. A desktop widget is just an Emacs frame without decorations, with disabled input and displaying ordinary Emacs buffers like any other Emacs frame. So at least in theory, we can display anything as a desktop widget, org-agenda, calendar, an image, result of any shell script or even use it as a wallpaper in a maximized widget.

About

Drawing dekstop widgets with Emacs a lá Conky

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages