Arabic Fonts in Emacs
If you are like Ammar or me and use Emacs to write in both Arabic and English, you might have encountered the problem of using some Arabic font in Emacs and wished that you could use that font but you can't because the English text looks terrible, or vice versa. Well, I found a little trick in Emacs that allows you to assign a font for Arabic text and another font for English text.
There's a function in Emacs called
set-fontset-font that allows us to specify
a range of characters to have a specific font. To assign the Arabic range to
Noto Sans Arabic UI font, for example. All you have to do is to add the
following somewhere in your
init.el if you are using Emacs, or in
dotspacemacs/user-init in your
.spacemacs file if you are using spacemacs:
(let ((ar-font "Noto Sans Arabic UI") (range '(#x000600 . #x0006FF))) (set-fontset-font "fontset-startup" range ar-font) (set-fontset-font "fontset-default" range ar-font) (set-fontset-font "fontset-standard" range ar-font))
It has been almost three years since I posted anything here. I've decided to revive my blog and do some updates here and there. I got a new domain instead of the old one and now the site supports the https protocol (thanks to Let's Encrypt). I was using Pelican to generate my blog. However, this time I've decided to go with Nikola, mainly for two reasons:
- Nikola has good Org mode support,
- Nikola has good multilingual support.
I've been using Spacemacs (An Emacs distribution) to do most of my work for the past two to three years now and I wanted to make publishing new posts as easy as possible. So after trying some ideas and workflows, I've settled on using Nikola with Org mode. Also, I'm planning to publish (hopefully) every post in English and Arabic, so Nikola support for multilingual blogs was a must for me.
What is computer science? is it a scientific discipline? or an engineering discipline? or is it a form of Art? I tried to answer these questions with a small presentation that I gave at the university and I thought should share the slides of that presentation. So, grab it from here.
UPDATE Right now nupic is available at PyPi and can be simply installed by:
I just set up a docker image that will provide an easy development environment for the NuPIC project. The image comes with the following:
- NuPIC Studio
- iPython notebook
- MySQL server
Wacom Intuos Pro and Linux
So a new year and I got my self a little gift, a Wacom Intuos pro. I'm upgrading from an Intuos 3 so my opinions could be a little out of date.
Here is a couple of pictures of the pen and the pen holder.
The cool thing about the pen is the different nibs that you can use. As you can see in the picture below, the nibs are stored in the pen holder and you can choose the one that best suits your style.
The Intuos pro comes in three different sized. I got the small one because it's cheaper :P and I wanted a compact tablet that I can easily carry with me if I want to. The tablet surface feels like paper and It's definitely an improvement over the Intuos 3.
Another thing that I really like about the Intuos pro is the ability to have it work wirelessly. Underneath the tablet there is a removable battery and a compartment for the wireless dongle. You can remove the battery and the wireless dongle if you want to work in wired mode. The battery is charged via the USB cable in wired mode.
Here are closer pictures of the wireless and USB dongle.
Installation and Configuration
The main purpose of this blog post is to show how I got the tablet to work under Linux. I'm using Arch at the moment and when I plugged the tablet in, it did't work. I had to mess with it a bit to get it working.
First off, you need to install the wacom drivers. So run the following command which will install the drivers form the main repos.
Kernel module installation
Then you have to install this kernel module. Thanks to apicici for maintaining this. It's not in the official repos but you can get it from AUR. I'm using yaourt here, but you can use whatever AUR manager you have. Also, you have to have the kernel headers installed before this step, if you don't have them already.
Desktop environment configuration
I use KDE now and there's a cool KCM (KConfig Modules) for the wacom tablet in the AUR. To get it run the following:
Here is a screen shot of it:
The tablet could be used as a big touchpad. While it's good to have the option, it's not really practical because the palm rejection isn't working. So I think disabling the touchpad is better, for now at least. You can do so as shown in the screen shot below:
One awesome feature of this KCS, is the ability to have profiles. Here I have some shortcuts for MyPaint.
So this is it, have fun!
Thanks to Vasco Alexander Basqué for pointing out that the Intuos pro needs xf86-input-wacom version 0.23 or newer. It won't work with older drivers.