Sunday, May 18, 2014

Font settings I used in my Arch Linux install (on USB Pendrive)

I have the following content in my ~/.config/fontconfig/fonts.conf:

 <?xml version='1.0'?>  
 <!DOCTYPE fontconfig SYSTEM 'fonts.dtd'>  
 <fontconfig>  
   <match target="font">  
     <edit mode="assign" name="autohint">  
       <bool>false</bool>  
     </edit>  
   </match>  
   <match target="font">  
     <edit mode="assign" name="rgba">  
       <const>rgb</const>  
     </edit>  
   </match>  
   <match target="font">  
     <edit mode="assign" name="hinting">  
       <bool>true</bool>  
     </edit>  
   </match>  
   <match target="font">  
     <edit mode="assign" name="hintstyle">  
       <const>hintfull</const>  
     </edit>  
   </match>  
   <match target="font">  
     <edit mode="assign" name="antialias">  
       <bool>true</bool>  
     </edit>  
   </match>  
 </fontconfig>  

Also, from AUR, I have installed the package 'ttf-win7-fonts-autodownload'.

Further, I have installed 'ttf-ubuntu-font-family'.

In Firefox I have installed the "Theme Font & Size Changer" add-on.

IIRC, that's all I did to get great (at least to my eyes) fonts in my Arch installation.

By the way, this Arch installation is on a USB pendrive, allowing me to carry my Linux around all the time. Apna Linux Pehen Ke Chalo :-)

Using gsettings to set font preferences in my shiny Ubuntu Gnome 14.04 Desktop

Instead of using gnome-tweak-tool, this time I have used the command line utility 'gsettings' to set my font preferences in Gnome (Ubuntu Gnome - 14.04). After invoking some 'gsettings set ...' commands, I have the following:

 ubuntu-gnome@ubuntu-gnome:~$ gsettings list-recursively org.gnome.settings-daemon.plugins.xsettings   
 org.gnome.settings-daemon.plugins.xsettings disabled-gtk-modules @as []  
 org.gnome.settings-daemon.plugins.xsettings priority 0  
 org.gnome.settings-daemon.plugins.xsettings hinting 'full'  
 org.gnome.settings-daemon.plugins.xsettings overrides {'Gtk/ShellShowsAppMenu': <0>}  
 org.gnome.settings-daemon.plugins.xsettings rgba-order 'rgb'  
 org.gnome.settings-daemon.plugins.xsettings antialiasing 'rgba'  
 org.gnome.settings-daemon.plugins.xsettings active true  
 org.gnome.settings-daemon.plugins.xsettings enabled-gtk-modules @as []  

(Note the keys 'hinting', 'rgba-order' and 'antialiasing')

To know which values are valid for any key, there is the 'range' command. For example, to know what are the possible values I can use for the 'antialiasing' key, I can use the following command:

 ubuntu-gnome@ubuntu-gnome:~$ gsettings range org.gnome.settings-daemon.plugins.xsettings antialiasing  
 enum  
 'none'  
 'grayscale'  
 'rgba'  

That means I can use one of those three enum values for the 'antialiasing' key.

Saturday, May 17, 2014

Prevent desktop icons to show up in Unity Desktop (Ubuntu 14.04)

Just type in the following command at a shell prompt:

 $ gsettings set org.gnome.desktop.background show-desktop-icons false  

Case Insensitive Autocompletion in Bash

Today I learnt how to get case insensitive autocompletion in Bash.

Just put the following line in ~/.inputrc:

 set completion-ignore-case On  

That's it. To learn more about what is really going on, the bash and readline manual pages should be read.


Sunday, May 4, 2014

Using Upstart in Ubuntu 12.04 to set screen brightness during boot in Asus Eee PC

First I wrote a small script in /usr/local/bin to set the brightness to the lowest possible value (the lowest value is plenty bright for my eyes):

 $ cat /usr/local/bin/set-screen-brightness.sh   
 #!/bin/bash  
 echo $1 > /sys/class/backlight/acpi_video0/brightness  

Then I made the script executable. Next I wrote the following upstart script:

 $ cat /etc/init/my-brightness.conf   
 description "Set laptop screen to lowest brightness level"  
 start on runlevel [2]  
 script  
   exec /usr/local/bin/set-screen-brightness.sh 0  
 end script  

(My default runlevel (as indicated by running the runlevel command) is 2)

At the next boot, my screen's brightness is automatically set to the provided 0 value.

If I wanted to start the 'my-brightness' upstart service anytime, I would simply use the following command:

 $ sudo service my-brightness start