Thread: Working Directory of Service Menus
hi all. have been gnome user since starting ubuntu in feisty days. have flirted kde here , there never given enough crack of whip. i'm afraid i'm not keen on unity. gnome shell requires effort useable. xfce isn't bad, it's bit rough round edges. it's time give kde go.
sticking point service menus , working directory. i've written simple script rename files in preparation publishing on web.
it lower-cases , replaces spaces , underscores dash. ie "file_name space.txt" become "file-name-with-space.txt". works in gnome nautilus scripts. kde, however, making me work!!!code:#!/bin/bash arg converted_name=$(echo "$arg" | sed -e 's/ /-/g' | sed -e 's/_/-/g' | tr [a-z] [a-z]) mv "$arg" "$converted_name" done
i've made service menu it...
...but it's not quite working properly. "%u" on exec line passes in full path each file. that's nice , comprehensive. however, script won't work that.code:[desktop entry] type=service servicetypes=konqpopupmenu/plugin mimetype=application/octet-stream actions=renameforweb [desktop action renameforweb] name=rename web exec=/home/me/scripts/rename-files.sh %u
example, "/home/me/pictures/file name.jpg" converted "/home/me/pictures/file-name.jpg". "pictures" folder lower-cased, causing script fail.
other option use %n on exec line passes in file names, without path. problem that, working directory isn't files you've selected (ie ~/pictures folder in example). seems using ~/scripts working directory.
realise try , pass working directory service menu script mean re-writing script , making pretty complicated. there way of changing working directory in service menu, before executing script?
"got have" thing. if can working, you've got kde convert on hands!!
help me obi-wan kubuntu. you're hope
Forum The Ubuntu Forum Community Ubuntu Official Flavours Support Desktop Environments [SOLVED] Working Directory of Service Menus
Ubuntu
Comments
Post a Comment