This forum has been archived. All content is frozen. Please use KDE Discuss instead.

Service menus and paths

Tags: None
(comma "," separated)
User avatar
Don B. Cilly
Registered Member
Posts
31
Karma
0
OS

Service menus and paths

Thu Apr 23, 2020 8:16 pm
OK, it probably is a "cilly" question, but believe me, I have groogled* around for hours.
I have a service menu that passes the absolute path of the Dolphin entry to a bash script.
It works just fine... for me >:(

Meaning, it passes /home/me/thatdirectory to the script, which means, on my machine, it's just fine.
But if I send the script to my friend, it will use /home/me/thatdirectory when it should be /home/he/thatdirectory.

So how would I turn /home/myuser to ~/ ?


* Groogling is what pigs do when rummaging around in the dirt for scraps of food - in an obscure Betelgeusian dialect, as translated by the babel fish.
User avatar
claydoh
Registered Member
Posts
1170
Karma
9
OS

Re: Service menus and paths  Topic is solved

Thu Apr 23, 2020 10:08 pm
This has nothing to do with Dolphin , but /home/myuser = ~
Or, better for scripting, don't use absolute paths use variables like $HOME

You may want to look at bash tutorials for more info


claydoh, proud to be a member of KDE forums since 2008-Oct, and KDE user since 2001
User avatar
Don B. Cilly
Registered Member
Posts
31
Karma
0
OS

Re: Service menus and paths

Fri Apr 24, 2020 12:02 am
But it has to do with Dolphin.
The Dolphin service menu will pass the absolute path to the script.

I have been perusing bash tutorials, service menu tutorials, and forums for hours, and found no way to pass either a relative path or one with $HOME.
User avatar
Don B. Cilly
Registered Member
Posts
31
Karma
0
OS

Re: Service menus and paths

Fri Apr 24, 2020 12:20 am
Actually, it's just lack of sleep. I realised that - of course - my friend can use the absolute path because on his system the service menu will pass the correct one to his script.
Apologies :<


Bookmarks



Who is online

Registered users: abc72656, Bing [Bot], daret, Google [Bot], Sogou [Bot], Yahoo [Bot]