Showing posts with label Mac. Show all posts
Showing posts with label Mac. Show all posts

Wednesday, August 6, 2014

How to delete (and reset) FileZilla preferences in OS X

In order to start with a clean copy of FileZilla (so that, for instance, it allows you to save site passwords again, after once choosing not to!) follow these steps on Mac OS X:

First stop (close) FileZilla. Then navigate to the home directory by typing cd ~. Then locate .filezilla by typing ls -a (optional, obviously!). Remove it by using:
rm -rf ~/.filezilla
Now open FileZilla again!

Thursday, February 27, 2014

Symbolic links in Unix-like OSs

In Unix-like systems, if you have a command-line app, and you want to run it, you will have to type its full address in the terminal, like this
/Users/name/myFolder/app
Or you can navigate to its folder with cd /Users/name/myFolder and then use ./app to run it.

Another way would be to move that application to a folder that is in the system's $PATH . But if you don't want to move the application (and assuming you don't want to change your $PATH either), then you can add a shortcut for your application to a folder that is included in $PATH . To see the list of these folders, type
echo $PATH
and then pick one of the folders displayed. For example, /usr/local/bin . Now we will add a symbolic link (like a shortcut) to our application in this folder. This can be done by
ln -s /Users/name/myFolder/app /usr/local/bin

Perfect! now you can run your app by simply typing app in any terminal! (Of course, app should be the specific name of your app.)

Wednesday, February 26, 2014

Create a launchpad .app for apps that you run from terminal in OS X

I recently installed Inkscape on OS X, and can run the app by typing
inkscape
in a Terminal window. After this, the GUI window for Inkscape opens.

However, it would be nice to add a shortcut to this app to the OS X launchpad. In order to do this, you can follow the steps detailed in this link. For completeness, I will copy the steps mentioned in the link here.

  • Open the AppleScript Editor application. 
  • Type the following text in the editor window:
    tell application "Terminal"
      do script "`which yourAppName`; exit"
    end tell
    
    (Make sure you replace yourAppName with the name of the App!)
  • Then click Save from the File menu. 
  • Pick Application as the File Type
  • Save it in the Application folder with YourArbitraryName.
You are done!

You can also set a custom image for the app's icon:
  • Copy a custom image to the clip-board.
  • Open the Application folder in Finder.
  • Right-click on the newly created app (YourArbitraryName.app).
  • Select Get Info from the menu. 
  • At the top-left of the info window, click on the current icon to select it.
  • Press Command-v to paste the image from the clip-board over the current icon.
Enjoy the custom icon!

 Neater way

The only problem with the above method, is that if your app has a GUI, nonetheless a Terminal window will also be opened and will stay open. What if you want the Terminal window to open, launch your app, and close? I got some hint on how to do just that from this link.

The solution is, just replace the above AppleScript with the one below.
tell application "Terminal"
  do script "`which yourAppName` & exit"
  if (count of (every window whose visible is true)) ≤ 1 then
    quit
  else
    close window 1 without saving
  end if
end tell

Tuesday, February 25, 2014

Package management for Mac

After experimenting with Homebrew, and then MacPorts, I'm finally back to Homebrew again. I have decided that based on its fast package installation, active community, and also the fact that it does not duplicate the packages that are already available.

In case you haven't heard of the above names: Package management systems, like AptGet on Ubuntu, are not readily available on OS X and one needs to choose a third party package manager to tap into the world of Unix-style application packages. Homebrew and Macports are two of the most famous package managers available for OS X.

Monday, February 10, 2014

Retina display support for all apps

New Mac computers have monitors with a higher pixel-density. This makes text look sharp and pretty. However, many open-source projects do not support these high resolutions yet, and the text in these applications looks pixelated.

There are some hacks for making the text in these applications look sharp. One that I had successfully used for TexMaker requires adding the following piece of code to the end of info.plist file in an application's package.
    <key>NSHighResolutionCapable</key>
    <string>True</string>
This goes right before the </dict> tag.

The above method, however, does not work on all applications. FileZilla is one example. I came across a nice application that fixes the text-sharpness and takes care of the above steps as well. It also works on FileZilla. The app is called Retinizer and is found here.