Re: Options to right click and open to view some how.
- Date: Tue, 14 Mar 2017 14:35:02 -0700
- From: David Emme <demme@xxxxxxxxx>
- Subject: Re: Options to right click and open to view some how.
On 03/14/2017 02:06 PM, John_82 wrote:
If I am having problems and need to start poking about in system files that don't have an association I have to scroll through all of the alternatives to get to say kwrite.
That has been driving me nuts for years at times. I had to use windows at work and it's easy to add things to a right click there that will always be present what ever is clicked on.
Is there anything that I can edit to add options to a right click in kde 5.26 ? Associations aren't on as some have no suffix.
I'm no expert, so some of the following may be silly/unnecessary, but
nonetheless it works.
This will add a right-click menu item under Actions to view the selected
file with `less`. I find it very handy. Adjust as needed:
Add file: /home/<user>/.local/share/kservices5/lessThisFile.desktop
[Desktop Action lessThisFile]
Exec=konsole -e ~/scripts/LessHelper.sh %f
Name=View File with less
I put the script in my ~/scripts/ directory. Adjust to suit.
Add file: /home/<user>/scripts/LessHelper.sh
# Custom action to get lesspipe goodness into
# "View with 'less'"
export LESS='--LONG-PROMPT --tabs=4 --RAW-CONTROL-CHARS'
export LESSOPEN="|/usr/local/bin/lesspipe.sh %s"
You don't need `lesspipe` for this to work; it's just an add-on to
colorize the output of `less`. lesspipe can be found at:
You can remove the LESSOPEN line if needed.