1

I'm using ubuntu 20.04 and I just found out an awesome screenshot tool flameshot, the problem is, it has to be invoked by the terminal command flameshot gui, and everytime opening the terminal is a hassle, hence I'd like to store this command as an icon in the ubuntu dock, so I can click to invoke this. I think this should be possible, but how do I do this?

juztcode
  • 339

1 Answers1

2

for APT Install:

copy the flameshot.desktop file from /usr/share/applications/ to ~/.local/share/applications/ with below command..

sudo cp /usr/share/applications/flameshot.desktop ~/.local/share/applications

then open the file with below command

gedit ~/.local/share/applications/flameshot.desktop

and edit the content to match below content..

Exec=flameshot gui

Then open all apps and choose Flame shot to Add to Favorites..

enter image description here

enter image description here

for SNAP Install:

The flameshot installed by snapd is in /var/lib/snapd/desktop/applications , open the flameshot file there with superuser priviledges and edit the line from:

Exec=env BAMF_DESKTOP_FILE_HINT=/var/lib/snapd/desktop/applications/flameshot_flameshot.desktop /snap/bin/flameshot  

to this:

 Exec=env BAMF_DESKTOP_FILE_HINT=/var/lib/snapd/desktop/applications/flameshot_flameshot.desktop /snap/bin/flameshot gui     

now, launching from the icon works, if the icon itself doesn't appear in the menu, then do what is mentioned with in link: here

juztcode
  • 339
PRATAP
  • 22,460
  • my flameshot isn't located in : /usr/share/applications/flameshot.desktop it seems to be in /snap/bin/flameshot and doesn't have a .desktop there , and at /snap/bin/flameshot which I found by whereis flameshot, it seems there is only a simlink to the actual binary somewhere I don't know – juztcode Oct 01 '20 at 12:36
  • /var/lib/snapd/desktop/applications can you check in this path? I did not knew you installed flameshot as a snap package.. – PRATAP Oct 01 '20 at 12:43
  • flameshot is there but it doesn't have a .desktop extension, and is like this flameshot(Snappy edition) – juztcode Oct 01 '20 at 12:50
  • I followed the linked post, but it doesn't display an icon in the dock when I hit flameshot gui – juztcode Oct 01 '20 at 12:53
  • Is the app showing in All apps (when you click show apps button) add that as favourites.. – PRATAP Oct 01 '20 at 13:11
  • Ok.. I am trying to install flameshot as a snap package.. give me a moment.. – PRATAP Oct 01 '20 at 13:23
  • yes, and I was able to add to favorites, but, it doesn't run from the dock, I think that the problem is that flameshot cannot be run with the command $> flameshot but with the command $> flamshot gui, so , when we click on the dock, the former command gets launched , is there a fix or workaround? – juztcode Oct 01 '20 at 13:28
  • 1
    Ok.. I have tried it in arch linux and yes its not working.. I will try to install Ubuntu 20.04 and see.. – PRATAP Oct 01 '20 at 13:38
  • I just found a solution though, I have posted an answer, thanks for the help, should I merge my answer in yours? – juztcode Oct 01 '20 at 14:51
  • Yours Answer looks great!!! – PRATAP Oct 01 '20 at 14:56
  • yea, but I never mentioned, if I had snapd package or ubuntu – juztcode Oct 01 '20 at 15:05
  • 1
    I just merged it since accepting both the answers were impossible. :-) hope you approve it – juztcode Oct 01 '20 at 15:08
  • BTW, do you think iconifying shell scripts is possible? – juztcode Oct 01 '20 at 17:08
  • sorry no idea.. – PRATAP Oct 02 '20 at 02:33