We have moved to a new Sailfish OS Forum. Please start new discussions there.
4

Icon for terminal command

asked 2020-01-27 23:36:08 +0300

ds1979 gravatar image

Hi Sailors,

I am fooling around with the idea of making icons for some shortcuts.

I want to put the command line

rm -r ~/.mozilla/mozembed/cache2/

Into an icon like this:

[Desktop Entry]
Type=Application
Name=Delete Browser Cache
Icon=/home/nemo/Pictures/cache.jpg
Exec="rm -r ~/.mozilla/mozembed/cache2/"
X-Desktop-File-Install-Version=0.20

Now, this doesn't work. But what shall it preferably be in the line with "Exec="?

Thanks a lot!

edit retag flag offensive close delete

Comments

4

For these tasks of small repeated shell commands there is ShellEx (by acce) on openrepos.
A very nice app

peterleinchen ( 2020-01-28 01:04:54 +0300 )edit
1

There is also qCommand

eson ( 2020-01-28 08:23:04 +0300 )edit

Oh yes, right.

And it provides also app cover command functionality!

peterleinchen ( 2020-01-28 08:43:16 +0300 )edit
1

My goal is to sit in my everyday train and tap once on the icon, then close the window of fingerterm, because then I see the "effect" of the tapping. But thanks for the tips for other stuff so that I don't overdo the icon stuff. ;-)

ds1979 ( 2020-01-28 22:52:49 +0300 )edit

1 Answer

Sort by » oldest newest most voted
5

answered 2020-01-27 23:59:34 +0300

ds1979 gravatar image

SOLVED:

Exec=sh -c "fingerterm -e 'rm -r ~/.mozilla/mozembed/cache2/'"
edit flag offensive delete publish link more

Comments

1

The wrapping of fingerterm with sh -c should not be needed, or?

peterleinchen ( 2020-01-28 01:01:22 +0300 )edit
3

IMO, rather calling fingerterm is superfluous:

Exec=sh -c "rm -r ~/.mozilla/mozembed/cache2/"

olf ( 2020-01-28 01:36:07 +0300 )edit
1

Fingerterm still gives back a "comment" with the cursor, so I know it's done. Otherwise, I would ask myself: "Did it work?", because technical stuff does not always respond as intended. Usually the user is the problem, but you never know. ;-)

ds1979 ( 2020-01-28 22:54:13 +0300 )edit

@olf
Should have worked but does not!
I tried and had black screen and restart of lipstick (not executed the rm command). Hmm? Tested also the desktop file keyword 'Terminal' to no avail??

peterleinchen ( 2020-01-28 23:38:39 +0300 )edit

Thanks, good to know.
Apparently even simple "desktop" stuff behaves quite differently than classic command line experience would suggest.

olf ( 2020-01-29 21:26:16 +0300 )edit
Login/Signup to Answer

Question tools

Follow
3 followers

Stats

Asked: 2020-01-27 23:36:08 +0300

Seen: 286 times

Last updated: Jan 27 '20