Sunday, May 25, 2014

Solution for: Mouse cursor disappears when starting i3 with gnome-settings-daemon (in Arch Linux)

In my arch installation, whenever I start the i3 (or awesome) window manager as a gnome-session (which starts gnome-settings-daemon), the mouse cursor disappears. It is there, since I can click on things, but not visible. It is possible that the same problem exists when other window managers are started (other than gnome shell), but I have not tested with other window managers.

The solution turns out to be to run the following command:

 gsettings set org.gnome.settings-daemon.plugins.cursor active false  

That makes the mouse cursor visible again.

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'>  
   <match target="font">  
     <edit mode="assign" name="autohint">  
   <match target="font">  
     <edit mode="assign" name="rgba">  
   <match target="font">  
     <edit mode="assign" name="hinting">  
   <match target="font">  
     <edit mode="assign" name="hintstyle">  
   <match target="font">  
     <edit mode="assign" name="antialias">  

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  

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/   
 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]  
   exec /usr/local/bin/ 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  

Hiding the Unity2d launcher when not in use (Ubuntu 12.04)

The command to hide the Unity2d launcher when not in use is:

 gsettings set com.canonical.Unity2d.Launcher hide-mode 1