Category Archives: Linux

Changing default hindi / marathi / devanagari font in Linux

Difference between Lohit Devanagari and Noto Sans Devanagari
Difference between Lohit Devanagari and Noto Sans Devanagari

Assuming that you are running a fairly modern Linux distro like Ubuntu or Fedora, most likely you’ll get “Lohit Devanagari” pre-installed and should work just fine.

However if you have an itch to change the default devanagari font (which in most of the systems should be Lohit Devanagari), Then all you need a change in ~/.fonts.conf.

Create a .fonts.conf file in your home folder ie. ~/. Or edit the file and add / write the following contents.

<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>
  <match>
    <test name="lang" compare="contains">
      <string>hi</string>
    </test>
    <test name="family">
      <string>sans-serif</string>
    </test>
    <edit name="family" mode="prepend">
      <!-- <string>Lohit Devanagari</string> -->
      <string>Noto Sans Devanagari</string>
    </edit>
  </match>
  <match>
    <test name="lang" compare="contains">
      <string>mr</string>
    </test>
    <test name="family">
      <string>sans-serif</string>
    </test>
    <edit name="family" mode="prepend">
      <!-- <string>Lohit Devanagari</string> -->
      <string>Noto Sans Devanagari</string>
    </edit>
  </match>
  <match>
    <test name="lang" compare="contains">
      <string>hi</string>
    </test>
    <test name="family">
      <string>serif</string>
    </test>
    <edit name="family" mode="prepend">
      <!-- <string>Lohit Devanagari</string> -->
      <string>Noto Sans Devanagari</string>
    </edit>
  </match>
  <match>
    <test name="lang" compare="contains">
      <string>mr</string>
    </test>
    <test name="family">
      <string>serif</string>
    </test>
    <edit name="family" mode="prepend">
      <!-- <string>Lohit Devanagari</string> -->
      <string>Noto Sans Devanagari</string>
    </edit>
  </match>
</fontconfig>

What we are really doing over here is asking the system to use Noto Sans Devanagari font whenever language is hi (Hindi) or mr (Marathi) and consider the same font for both serif and sans-serif families.

Some of the really beautiful fonts that I’ve seen in Devanagari are

Do check the Ek Type Foundry, I’m quite a fan of their fonts!

Note: I’ve tested my settings on Ubuntu 18.04, so anything newer, should work as well.

Update: Focal Fossa (20.04) / GNOME 3.36

I recently updated to the latest Ubuntu LTS, and… the above changes didn’t work. 🙁 After a lot of tinkering (and reading man fonts.conf) I managed to get them working by creating the font config file ~/.config/fontconfig/conf.d/10-devanagari-substitution.conf. The 2 character numerical number is a priority and is a necessity according to Font Configuration – Arch Linux.

Also personally, I’ve found to use just the Noto Sans font downloaded from Google fonts as it tends to include the roman Glyphs along with Devanagari ones.

Fedora 29 and nostalgia

Fedora 29 has released, It had been since the Fedora-Core 2 days that I had used Fedora (rather it was my first foray in linux). We used to wait for computer magazines to deliver free OS CDs. Back then it was a Windows + Fedora. Everytime I had an issue with Fedora I had to switch back to Windows, see what is right / wrong how to go about it and fix it. We didn’t have the comfort of using Smart phones and tablets back then around 2004. Setting up eth0 was still an effort for a newbie like me.

As years moved, Fedora improved and its ability to replace my desktop’s default OS. However still we had to tweak around to make it comfortable. Codecs, font rendering, etc. However it has been one of the most comfortable environments for developers, most of the things available as rpm packages.

Maxing out only till 60%

With Fedora 29, a whole lot has improved, first and foremost, which is on everyone’s mind is GNOME 3.30. This is by far one of the most important GNOME 3x releases. WHY? Install it and you’ll see the amount of RAM that it hogs is way lesser than the earlier versions. Now my 9 yrs old laptop can effectively run GNOME, the modern RAM eating browsers and still leave me room. The new GNOME is lovely and modern yet for the nostalgia the Bluecurve theme deserves a special mention. For years as long GTK2 / GNOME2 ran on my PC, it was the de-facto choice.

The font rendering too has improved off-the-box, Now there is no need to install the freetype-freeworld package, make changes to the ~/.fonts/fonts.conf or .Xresources. I’m not sure what has really changed, whether the patent expiry has come through and we get it as-is without the patent issues.

Hope this Fedora legacy carries on for long. And finally kudos to Redhat, Fedora Team,GNOME and endless other teams for putting in effort for us to consume this beautiful lovely OS which is free!

Fedora magazine has a lovely article that has triggered these memories.

Synergy on Fedora 28 and Ubuntu 18.04 LTS

I was waiting for a few years to upgrade my 16.04LTS and finally when time came I didn’t hesitate. However it created a huge problem! I wasn’t able to sync my mouse and keyboard with synergy (free).

I wondered debugged a lot, first thing I found the synergy version on Fedora was 2.x while that on Ubuntu was 1.8.8. So I downloaded same version of synergy 1.8.8 from my favorite switch mirror.

Yet the problem never got over, I tried to swap the server – client but to no avail. Almost a week got over and I was still haggling with multiple keyboards and mouse combinations. I also read posts about Scroll locks, etc… but that didn’t help either.

But today while browsing on Fedora 28, I found that Mouse movements over Firefox were very laggy (something like dropped frames while painting the mouse), I wondered why. It struck me, these days the default server is wayland server. Lemme try disabling it. Edited /etc/gdm/custom.conf, where I had to just comment-out the line WaylandEnable=false. Ensure the line stays WaylandEnable=false. Edited the Ubuntu config /etc/gdm3/custom.conf (Oh by the way I had installed the vanilla-gnome-desktop package.

Rebooted the systems… and 😎😎😎 Got it working!

Steps to get synergy running

  1. Ensure same version of synergy 1.8.8 on Fedora 28
  2. Disable Wayland on both the systems
  3. Reboot (for goodluck 😀 )

Sample synergy.conf file

section: screens
  ubuntu:
  fedora:
end

section: links
  fedora:
    right = ubuntu
  windows7:
    left = fedora
end

Synergy Command for Server (Fedora in my case)
synergys -n fedora --config /home/rutu/synergy.conf --debug WARNING

Synergy Command for Client (ubuntu in my case)
synergyc --client -d WARNING --name ubuntu 172.16.160.97

Update: I found this Wayland support for Linux client and server #4090

Popcorn Time is back!

Popcorn time the one which got banned, barred, you name it. Is Back ! This time with a new website – http://www.time4popcorn.eu/

For Fedora users like me they’ll get an error

$ ./Popcorn-Time
./Popcorn-Time: error while loading shared libraries: libudev.so.0: cannot open shared object file: No such file or directory

They can simply fix it by installing yum install libgudev1. If the package is already present, just make a sym link.


# ln -s /usr/lib64/libgudev-1.0.so.0 /usr/lib64/libudev.so.0

This will work like charm.

Further you can create a desktop file so that the app reflects in your Super key search (GNOME, Unity, etc)

Here is my popcorntime.desktop file

[Desktop Entry]
Name=Popcorn Time
GenericName=Popcorn Time
Comment=Watch movies online
Exec=/home/rutu/apps/Popcorn/Popcorn-Time %U
Terminal=false
Type=Application
StartupNotify=true
Icon=/home/rutu/apps/Popcorn/Popcorn-time-logo.jpg
Keywords=Videos;Movies;Torrents;HD;Streaming;

Create the file in ~/.local/share/applications.

I’ve also created / cropped a logo.
Popcorn-time-logo

Ubuntu 14.04 LTS first impressions

The Trusty Tahr is out with support for 5 years. Here are the first thoughts about it…

stupid-browser
Stupid Browser comes up when searching “Appearance”
  • Unity feels more responsive than ever, especially the Alt+Tab.
  • New Desktop environments these days (also read as Cinnamon, GNOME Shell) take up a lot of RAM, I wanted to test 14.04’s unity, after few hours usage it too scooped up 320 MB worth of RAM… I expected better 🙁
  • One thing that definitely annoyed me a lot – Everytime I pressed “Alt + D” (Firefox’s shortcut for address bar focus), the HUD used to come up after the address bar focus. Hence after each Alt+D, I had an “Escape key” following up. I hope Canonical listens to this, They might say “F6” is an alternate shortcut that users might use to avoid this problem. The problem doesn’t occur if I’m slow to use the key combination
  • I would’ve loved if Ubuntu packaged the Ubuntu Tweak Tool as default installation.
  • The Web Apps for firefox seem to have gone! Feel bad for its lovers. If lucky u’ll get a notification to add the app, however when opened it opens up the built in Ubuntu Web Browser. No more integration with firefox tabs.
  • When I try to reach the “Appearance” app using the dash, a stupid Browser comes up as the first result
  • This Browser loads up “Ubuntu Home page” There are no UI elements to navigate anywhere else. The only way you could access is thru HUD ! – I have no idea why its included.

The Acid test is still pending, I’ve still got to use it during office hours. With apache, mysql, IntelliJ, Netbeans, Sublime Text all running at once.  Only then will Ubuntu as a desktop will truly be gauged. The test machine is fairly strong.

  • Intel® Core™ i5 CPU M 540 @ 2.53GHz × 4 Intel® Core™ i5 CPU M 540 @ 2.53GHz × 4
  • 3.7 GiB of RAM

All in all, Ubuntu continues to roll out another strong release.

Final Rating: 4/5

Update (30 Apr ’14): The update of Firefox 29 seems to have knocked off the HUD Bug when using Alt + D combination to focus the address bar.

Fedora goes to sleep on USB insert

Did you enable the commands suggested by powertop ?

Thats exactly what happened to me, for days I was wondering why my Fedora 20 x64 was acting weirdly on USB inserts. When I checked journalctl -f,  I found that my system went to sleep !


Jan 29 08:45:27 ruturaj-vartak ntfs-3g[6076]: Version 2013.1.13 integrated FUSE 27
Jan 29 08:45:27 ruturaj-vartak ntfs-3g[6076]: Mounted /dev/sdb1 (Read-Write, label "", NTFS 3.1)
Jan 29 08:45:27 ruturaj-vartak ntfs-3g[6076]: Cmdline options: rw,nodev,nosuid,uid=1000,gid=1000,dmask=0077,fmask=0177,uhelper=udisks2
Jan 29 08:45:27 ruturaj-vartak ntfs-3g[6076]: Mount options: rw,nodev,nosuid,uhelper=udisks2,allow_other,nonempty,relatime,default_permissions,fsname=/dev/sdb1,blkdev,blksize=4096
Jan 29 08:45:27 ruturaj-vartak ntfs-3g[6076]: Global ownership and permissions enforced, configuration type 1
Jan 29 08:45:28 ruturaj-vartak kernel: hda-codec: out of range cmd 0:20:400:fffffbff
Jan 29 08:45:28 ruturaj-vartak systemd-logind[434]: Delay lock is active but inhibitor timeout is reached.
Jan 29 08:45:28 ruturaj-vartak systemd[1]: Starting Sleep.
Jan 29 08:45:28 ruturaj-vartak systemd[1]: Reached target Sleep.
Jan 29 08:45:28 ruturaj-vartak systemd[1]: Starting Suspend...
Jan 29 08:45:28 ruturaj-vartak systemd-sleep[6085]: Suspending system...
Jan 29 08:45:40 ruturaj-vartak PackageKit[2929]: daemon quit
Jan 29 08:46:04 ruturaj-vartak kernel: PM: Syncing filesystems ... done.
Jan 29 08:46:04 ruturaj-vartak kernel: PM: Preparing system for mem sleep
Jan 29 08:46:04 ruturaj-vartak kernel: Freezing user space processes ... (elapsed 0.001 seconds) done.
Jan 29 08:46:04 ruturaj-vartak kernel: Freezing remaining freezable tasks ...
Jan 29 08:46:04 ruturaj-vartak kernel: Freezing of tasks failed after 20.002 seconds (0 tasks refusing to freeze, wq_busy=1):
Jan 29 08:46:04 ruturaj-vartak kernel: Jan 29 08:46:04 ruturaj-vartak kernel: Restarting kernel threads ... done.

I disabled my powertop suggestions which looked like this

echo '1500' > '/proc/sys/vm/dirty_writeback_centisecs';
echo 'min_power' > '/sys/class/scsi_host/host0/link_power_management_policy';
echo 'min_power' > '/sys/class/scsi_host/host1/link_power_management_policy';
echo 'min_power' > '/sys/class/scsi_host/host2/link_power_management_policy';
echo 'min_power' > '/sys/class/scsi_host/host3/link_power_management_policy';
echo '1' > '/sys/module/snd_hda_intel/parameters/power_save';
echo '0' > '/proc/sys/kernel/nmi_watchdog';
echo 'auto' > '/sys/bus/usb/devices/4-1/power/control';
echo 'auto' > '/sys/bus/pci/devices/0000:05:00.0/power/control';
echo 'auto' > '/sys/bus/pci/devices/0000:00:1f.6/power/control';
echo 'auto' > '/sys/bus/pci/devices/0000:00:1c.1/power/control';
echo 'auto' > '/sys/bus/pci/devices/0000:00:1a.7/power/control';
echo 'auto' > '/sys/bus/pci/devices/0000:00:1a.0/power/control';
echo 'auto' > '/sys/bus/pci/devices/0000:00:1a.1/power/control';
echo 'auto' > '/sys/bus/pci/devices/0000:00:02.1/power/control';
echo 'auto' > '/sys/bus/pci/devices/0000:00:02.0/power/control';
echo 'auto' > '/sys/bus/pci/devices/0000:00:00.0/power/control';
echo 'auto' > '/sys/bus/pci/devices/0000:04:00.0/power/control';
echo 'auto' > '/sys/bus/pci/devices/0000:00:1c.0/power/control';
echo 'auto' > '/sys/bus/pci/devices/0000:00:1b.0/power/control';
echo 'auto' > '/sys/bus/pci/devices/0000:00:1f.2/power/control';
echo 'auto' > '/sys/bus/pci/devices/0000:00:1f.0/power/control';
echo 'auto' > '/sys/bus/pci/devices/0000:00:1e.0/power/control';
echo 'auto' > '/sys/bus/pci/devices/0000:00:1d.7/power/control';
echo 'auto' > '/sys/bus/pci/devices/0000:00:1d.3/power/control';
echo 'auto' > '/sys/bus/pci/devices/0000:00:1d.1/power/control';
echo 'auto' > '/sys/bus/pci/devices/0000:00:1d.2/power/control';
echo 'auto' > '/sys/bus/pci/devices/0000:00:1d.0/power/control';
echo 'auto' > '/sys/bus/pci/devices/0000:00:1c.4/power/control';
echo 'auto' > '/sys/bus/pci/devices/0000:00:1c.2/power/control';
echo 'auto' > '/sys/bus/pci/devices/0000:00:1f.3/power/control';
echo 'auto' > '/sys/bus/pci/devices/0000:07:00.0/power/control';
echo 'auto' > '/sys/bus/pci/devices/0000:07:00.2/power/control';
echo 'auto' > '/sys/bus/pci/devices/0000:07:00.3/power/control';
echo 'auto' > '/sys/bus/pci/devices/0000:07:00.4/power/control';

… and voila !! Things started working like normal with USB sticks. I’ve no clue what each of these settings really do.

Installing Handbrake on Fedora 19

If you want to install Handbrake via a yum repo, slaanesh has provided us with the rpm packages.

[root@localhost #] wget http://negativo17.org/repos/fedora-handbrake.repo -O \
    /etc/yum.repos.d/fedora-handbrake.repo

[root@localhost#] yum install HandBrake-gui

UPDATE: I’ve replaced the original fedorapeople repo with the new WORKING repo (non fedora hosted) [Jul 27, 2013 07:19 IST]