1

Scenario: the current version of Kate in Ubuntu 18LTS points at their customized version (which doesn't appear to support regex search capability). The bin is: /usr/bin/kate.

Desired solution: run the Kate AppImage (which has the regex search/replace functionality). The AppImage currently resides in ~/Downloads.

Question: how do I redirect the system to execute the AppImage version of Kate, instead of the built-in version?

Can I simply create a link to the AppImage in /usr/bin?

Kurt Pfeifle
  • 86,724
  • 23
  • 248
  • 345
Jay Marm
  • 556
  • 5
  • 12

2 Answers2

0

Yes, it appears you can... i.e. in my case I replaced the existing kate bin with a link that points to the appimage:

# 1st remove the existing kate binary
# (cp kate somewhere first if you want to keep a copy)
sudo rm /usr/bin/kate

# 2nd create a link in the system bin that points to the appimage
sudo link [directory where the appimage resides]/Kate.AppImage /usr/bin/kate

Done! The system will now execute the appimage when 'kate' is executed (e.g. via context menus).

=========================

UPDATE...

The above solution kinda works... it does run the appimage, however the parameters normally passed to kate (i.e. file to open) are lost in the hard link.

So... the better solution is to create a simple executable shell script (named 'kate' in the /usr/bin directory) to execute the appimage:

#!/bin/sh
exec [directory where the appimage resides]/Kate.AppImage "$@"

This passes any provided parms to the appimage.

Jay Marm
  • 556
  • 5
  • 12
0

You may want to keep (for whatever reasons) your system-installed Kate in /usr/bin/kate...

Then do not touch it. Instead create a directory in your $HOME named bin (it may already be present depending on the Linux distro you run).

Inside that directory, create a symlink:

ln -sf ~/Downloads/kate.AppImage ~/bin/kate

This may already work. If not, you have to move the ~/bin directory to the front of your path:

export PATH=${HOME}/bin:${PATH}  # if you use Bash

To permanently modify this $PATH, add this same line into ${HOME}/.bashrc

Kurt Pfeifle
  • 86,724
  • 23
  • 248
  • 345