How to get an icon from the current theme by name? [duplicate]

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP








up vote
2
down vote

favorite













This question already has an answer here:



  • How can I find the location of an icon of a launcher in use?

    3 answers



There's a similar question on Stack Overflow, the reason my question is different is that I can't be certain that the path to an icon will always be the same (for example, some themes use SVG, some use PNG).



I would like to get a full path to an icon from a bash script knowing only its name.



What I mean by name is the one that's used in desktop entries.



For example, here's a line from a firefox.desktop file on my Ubuntu:



Icon=firefox


Somehow that's enough for my system to figure out exactly what the path to an icon is. How can I leverage this functionality in my scripts?



Just in case, I'm using Ubuntu 18.04.







share|improve this question











marked as duplicate by Jacob Vlijm, Sergiy Kolodyazhnyy bash
Users with the  bash badge can single-handedly close bash questions as duplicates and reopen them as needed.

StackExchange.ready(function()
if (StackExchange.options.isMobile) return;

$('.dupe-hammer-message-hover:not(.hover-bound)').each(function()
var $hover = $(this).addClass('hover-bound'),
$msg = $hover.siblings('.dupe-hammer-message');

$hover.hover(
function()
$hover.showInfoMessage('',
messageElement: $msg.clone().show(),
transient: false,
position: my: 'bottom left', at: 'top center', offsetTop: -7 ,
dismissable: false,
relativeToBody: true
);
,
function()
StackExchange.helpers.removeMessages();

);
);
);
Jun 4 at 21:51


This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.


















    up vote
    2
    down vote

    favorite













    This question already has an answer here:



    • How can I find the location of an icon of a launcher in use?

      3 answers



    There's a similar question on Stack Overflow, the reason my question is different is that I can't be certain that the path to an icon will always be the same (for example, some themes use SVG, some use PNG).



    I would like to get a full path to an icon from a bash script knowing only its name.



    What I mean by name is the one that's used in desktop entries.



    For example, here's a line from a firefox.desktop file on my Ubuntu:



    Icon=firefox


    Somehow that's enough for my system to figure out exactly what the path to an icon is. How can I leverage this functionality in my scripts?



    Just in case, I'm using Ubuntu 18.04.







    share|improve this question











    marked as duplicate by Jacob Vlijm, Sergiy Kolodyazhnyy bash
    Users with the  bash badge can single-handedly close bash questions as duplicates and reopen them as needed.

    StackExchange.ready(function()
    if (StackExchange.options.isMobile) return;

    $('.dupe-hammer-message-hover:not(.hover-bound)').each(function()
    var $hover = $(this).addClass('hover-bound'),
    $msg = $hover.siblings('.dupe-hammer-message');

    $hover.hover(
    function()
    $hover.showInfoMessage('',
    messageElement: $msg.clone().show(),
    transient: false,
    position: my: 'bottom left', at: 'top center', offsetTop: -7 ,
    dismissable: false,
    relativeToBody: true
    );
    ,
    function()
    StackExchange.helpers.removeMessages();

    );
    );
    );
    Jun 4 at 21:51


    This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.
















      up vote
      2
      down vote

      favorite









      up vote
      2
      down vote

      favorite












      This question already has an answer here:



      • How can I find the location of an icon of a launcher in use?

        3 answers



      There's a similar question on Stack Overflow, the reason my question is different is that I can't be certain that the path to an icon will always be the same (for example, some themes use SVG, some use PNG).



      I would like to get a full path to an icon from a bash script knowing only its name.



      What I mean by name is the one that's used in desktop entries.



      For example, here's a line from a firefox.desktop file on my Ubuntu:



      Icon=firefox


      Somehow that's enough for my system to figure out exactly what the path to an icon is. How can I leverage this functionality in my scripts?



      Just in case, I'm using Ubuntu 18.04.







      share|improve this question












      This question already has an answer here:



      • How can I find the location of an icon of a launcher in use?

        3 answers



      There's a similar question on Stack Overflow, the reason my question is different is that I can't be certain that the path to an icon will always be the same (for example, some themes use SVG, some use PNG).



      I would like to get a full path to an icon from a bash script knowing only its name.



      What I mean by name is the one that's used in desktop entries.



      For example, here's a line from a firefox.desktop file on my Ubuntu:



      Icon=firefox


      Somehow that's enough for my system to figure out exactly what the path to an icon is. How can I leverage this functionality in my scripts?



      Just in case, I'm using Ubuntu 18.04.





      This question already has an answer here:



      • How can I find the location of an icon of a launcher in use?

        3 answers









      share|improve this question










      share|improve this question




      share|improve this question









      asked Jun 4 at 19:14









      illright

      1298




      1298




      marked as duplicate by Jacob Vlijm, Sergiy Kolodyazhnyy bash
      Users with the  bash badge can single-handedly close bash questions as duplicates and reopen them as needed.

      StackExchange.ready(function()
      if (StackExchange.options.isMobile) return;

      $('.dupe-hammer-message-hover:not(.hover-bound)').each(function()
      var $hover = $(this).addClass('hover-bound'),
      $msg = $hover.siblings('.dupe-hammer-message');

      $hover.hover(
      function()
      $hover.showInfoMessage('',
      messageElement: $msg.clone().show(),
      transient: false,
      position: my: 'bottom left', at: 'top center', offsetTop: -7 ,
      dismissable: false,
      relativeToBody: true
      );
      ,
      function()
      StackExchange.helpers.removeMessages();

      );
      );
      );
      Jun 4 at 21:51


      This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.






      marked as duplicate by Jacob Vlijm, Sergiy Kolodyazhnyy bash
      Users with the  bash badge can single-handedly close bash questions as duplicates and reopen them as needed.

      StackExchange.ready(function()
      if (StackExchange.options.isMobile) return;

      $('.dupe-hammer-message-hover:not(.hover-bound)').each(function()
      var $hover = $(this).addClass('hover-bound'),
      $msg = $hover.siblings('.dupe-hammer-message');

      $hover.hover(
      function()
      $hover.showInfoMessage('',
      messageElement: $msg.clone().show(),
      transient: false,
      position: my: 'bottom left', at: 'top center', offsetTop: -7 ,
      dismissable: false,
      relativeToBody: true
      );
      ,
      function()
      StackExchange.helpers.removeMessages();

      );
      );
      );
      Jun 4 at 21:51


      This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.






















          1 Answer
          1






          active

          oldest

          votes

















          up vote
          0
          down vote













          A search for "gnome desktop file format":



          • brought me here: Desktop files: putting your application in the desktop menus - GNOME

          • which links to here: Desktop Entry Specification

          • which, in the "Recognized desktop entry keys" chapter, links to here: Icon Theme Specification

          • which is where I gave up.





          share|improve this answer






























            1 Answer
            1






            active

            oldest

            votes








            1 Answer
            1






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes








            up vote
            0
            down vote













            A search for "gnome desktop file format":



            • brought me here: Desktop files: putting your application in the desktop menus - GNOME

            • which links to here: Desktop Entry Specification

            • which, in the "Recognized desktop entry keys" chapter, links to here: Icon Theme Specification

            • which is where I gave up.





            share|improve this answer



























              up vote
              0
              down vote













              A search for "gnome desktop file format":



              • brought me here: Desktop files: putting your application in the desktop menus - GNOME

              • which links to here: Desktop Entry Specification

              • which, in the "Recognized desktop entry keys" chapter, links to here: Icon Theme Specification

              • which is where I gave up.





              share|improve this answer

























                up vote
                0
                down vote










                up vote
                0
                down vote









                A search for "gnome desktop file format":



                • brought me here: Desktop files: putting your application in the desktop menus - GNOME

                • which links to here: Desktop Entry Specification

                • which, in the "Recognized desktop entry keys" chapter, links to here: Icon Theme Specification

                • which is where I gave up.





                share|improve this answer















                A search for "gnome desktop file format":



                • brought me here: Desktop files: putting your application in the desktop menus - GNOME

                • which links to here: Desktop Entry Specification

                • which, in the "Recognized desktop entry keys" chapter, links to here: Icon Theme Specification

                • which is where I gave up.






                share|improve this answer















                share|improve this answer



                share|improve this answer








                answered Jun 4 at 20:40



























                community wiki





                glenn jackman













                    Popular posts from this blog

                    How do so many people here on Academia.SE, and in general, afford lavish higher education programs?

                    Trouble downloading packages list due to a “Hash sum mismatch” error

                    How do I move numbers in filenames, in a batch renaming operation?