You are not logged in.

#1 2012-07-18 23:01:35

Dalvenjia
Member
From: Mexico
Registered: 2012-02-18
Posts: 1

PCManFM and Feh

Hello
I have a little problem here I'm trying to use feh as an image viewer and copied a script from the wiki to do so and works great, but whenever I try to launch it from PCManFM with a Custom Command Line it doesn't work.

my script is ~/bin/fehviewer :

#!/bin/bash

shopt -s nullglob

if [[ ! -f $1 ]]; then
	echo "$0: first argument is not a file" >&2
	exit 1
fi

file=$(basename -- "$1")
dir=$(dirname -- "$1")
arr=()
shift

cd -- "$dir"

for i in *; do
	[[ -f $i ]] || continue
	arr+=("$i")
	[[ $i == $file ]] && c=$((${#arr[@]} - 1))
done

exec feh "$@" -- "${arr[@]:c}" "${arr[@]:0:c}"

and within PCManFM Custom Command Line prompt I've tried:

~/bin/fehviewer %f
/home/MyUser/bin/fehviewer %f
eval /home/MyUser/bin/fehviewer %f

All with the "Execute in terminal emulator" on and off. Nothing seems to work.

Any help greatly appreciated... Thanks.

Offline

#2 2012-11-21 02:37:10

willwolfe
Member
Registered: 2012-03-20
Posts: 2

Re: PCManFM and Feh

I saved my script to /usr/bin and created a FEH.desktop file in /usr/share/applications with the script name as the file to execute. I also edited my /usr/share/applications/mimeinfo.cache file to point all image formats I wanted to use feh for to my .desktop file. Now I just click on any image in PCManFM and it opens in feh. Hope this works for you or you have found a solution.

Offline

Board footer

Powered by FluxBB