Tuesday, July 7, 2015

Mac OS X "Open"

I just love the OS X command 'open'.  No matter where you are you can just type open filename and it'll figure out the associated app and open the file with it.  I wished there was a Linux equivalent 'till go figure... there is one.

I found this stackoverflow post mentioning the command xdg-open.

that's a bit convoluted to write, so i made an alias

alias lopen='xdg-open'

lopen foobar.pdf
lopen .
lopen somefile.py

All of it works flawlessly.  :D I love it

PS. open command is taken by an openvt binary.  Hence lopen.

Hint:  To change the default association, in gnome at least:

Right-click->Properties->Open With->Set as default (lower right).

If you need to add a custom application. (I'll assume you created a .desktop icon and it shows up properly in your gnome menu using alacarte or by hand)

You need to update your:

 ~/.config/mimeapps.list

For example in my case, I added the following line:

text/plain=alacarte-made.desktop;

where alacarte-made.desktop is my sublime editor.

You can fine a list of most of the supported mimetypes in:

/usr/share/applications/defaults.list




Wednesday, April 8, 2015

Fixing Font Rendering In Chrome Fedora

Fonts in general aren't as pretty in Fedora out of the box as they are in Ubuntu.  But the Chrome rendering is horrible.  I had to add this little gem to my ~/.fonts.conf file.

<match target="font">
 <edit name="autohint" mode="assign">
    <bool>true</bool>
 </edit>
 <edit name="hinting" mode="assign">
    <bool>true</bool>
 </edit>
 <edit mode="assign" name="hintstyle">
    <const>hintslight</const>
 </edit>
</match>

Thursday, April 2, 2015

Ubuntu 15.04 Broken Upstart / Working Systemd

Ubuntu 15.04 I believe has switched over to upstart which in turn has broken more then a few 3rd party apps I had installed.

For example whenever I tried to install plex media server I would get the following error:

"initctl: Unable to connect to Upstart: Failed to connect to socket /com/ubuntu/upstart: Connection refused"


Here's the fix that worked for me:

sudo dpkg-divert --local --rename --add /sbin/initctl
ln -s /bin/true /sbin/initctl

Credit for this little tweak: https://www.nesono.com/?q=node/368