epilys/rlr

App launcher & icon missing

Closed this issue · 12 comments

Please consider adding a .desktop launcher file.
Here's an example referencing an icon named rlr. (but kruler or screenruler can be used instead as they're available in many icon themes):

GenericName=Screen Ruler
GenericName[af]=Skerm Liniaal
GenericName[ar]=مسطرة الشاشة
GenericName[bg]=Линийка за екрана
GenericName[bs]=Ekranski lenjir
GenericName[ca]=Regle de la pantalla
GenericName[ca@valencia]=Regle de la pantalla
GenericName[cs]=Obrazovkové pravítko
GenericName[cy]=Mesurydd Sgrîn
GenericName[da]=Skærmlineal
GenericName[de]=Bildschirmlineal
GenericName[el]=Κανόνας οθόνης
GenericName[en_GB]=Screen Ruler
GenericName[eo]=Ekrana liniilo
GenericName[es]=Regla para la pantalla
GenericName[et]=Ekraani joonlaud
GenericName[eu]=Pantailaren erregela
GenericName[fa]=خط‌کش پرده
GenericName[fi]=Näyttöviivain
GenericName[fr]=Règle d'écran
GenericName[ga]=Rialóir Scáileáin
GenericName[gl]=Regra de pantalla
GenericName[he]=סרגל מסך
GenericName[hi]=स्क्रीन मापनी
GenericName[hne]=स्क्रीन मापनी
GenericName[hr]=Ravnalo
GenericName[hu]=Képernyővonalzó
GenericName[ia]=Regula de schermo
GenericName[id]=Penggaris Layar
GenericName[is]=Reglustika
GenericName[it]=Righello per lo schermo
GenericName[ja]=スクリーンルーラー
GenericName[kk]=Экран өлшегіші
GenericName[km]=បន្ទាត់​អេក្រង់
GenericName[ko]=화면 
GenericName[ku]=Rastekê Dîmenderê
GenericName[lt]=Ekrano liniuotė
GenericName[lv]=Ekrāna mērlenta
GenericName[mr]=स्क्रीन मोजपट्टी
GenericName[ms]=Pembaris Skrin
GenericName[nb]=Skjermlinjal
GenericName[nds]=Schirmlineaal
GenericName[ne]=पर्दा रूलर
GenericName[nl]=Schermliniaal
GenericName[nn]=Skjermlinjal
GenericName[pa]=ਸਕਰੀਨ ਰੀਡਰ
GenericName[pl]=Linijka ekranowa
GenericName[pt]=Régua do Ecrã
GenericName[pt_BR]=Régua de tela
GenericName[ro]=Riglă de ecran
GenericName[ru]=Экранная линейка
GenericName[se]=Šearpmalinjála
GenericName[si]=තිරයේ කෝදුව
GenericName[sk]=Pravítko obrazovky
GenericName[sl]=Zaslonsko ravnilo
GenericName[sr]=Екрански лењир
GenericName[sr@ijekavian]=Екрански лењир
GenericName[sr@ijekavianlatin]=Ekranski lenjir
GenericName[sr@latin]=Ekranski lenjir
GenericName[sv]=Skärmlinjal
GenericName[ta]=திரை உருளை
GenericName[tg]=Ҷадвали экрании
GenericName[th]=ไม้บรรทัดบนหน้าจอ
GenericName[tr]=Ekran Cetveli
GenericName[ug]=ئېكران باشقۇرغۇ
GenericName[uk]=Лінійка екрана
GenericName[uz]=Ekran lineykasi
GenericName[uz@cyrillic]=Экран линейкаси
GenericName[vi]=Thước đo màn hình
GenericName[xh]=Screen Ruler
GenericName[x-test]=xxScreen Rulerxx
GenericName[zh_CN]=屏幕标尺工具
GenericName[zh_HK]=螢幕尺規
GenericName[zh_TW]=螢幕尺規
Name=rlr
Exec=rlr
Type=Application
Icon=rlr
Terminal=false
StartupWMClass=rlr
StartupNotify=true
Categories=Gnome;GTK;Graphics;Utilities;

Additionally, here's a suggestion for an icon along the lines of the current Gnome style:
rlr

It's based on another icon that comes with an app (Collision) distributed under the BSD-2-Clause license, so I guess you can use my mod of it in your app if you like.

I can't attach .svg's here, so here's the icon's code instead. Just save it into a file and name it rlr.svg to go along with the launcher code in my issue report above. On installation, the icon should go into /usr/share/icons/hicolor/scalable/apps/

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
   height="128px"
   viewBox="0 0 128 128"
   width="128px"
   version="1.1"
   id="svg1457"
   xmlns="http://www.w3.org/2000/svg"
   xmlns:svg="http://www.w3.org/2000/svg">
  <defs
     id="defs1461" />
  <linearGradient
     id="a"
     gradientUnits="userSpaceOnUse"
     x1="8"
     x2="120.0000075"
     y1="123.99999225"
     y2="123.99999225">
    <stop
       offset="0"
       stop-color="#e5a50a"
       id="stop1405" />
    <stop
       offset="0.0357143"
       stop-color="#f6d32d"
       id="stop1407" />
    <stop
       offset="0.0714286"
       stop-color="#e5a50a"
       id="stop1409" />
    <stop
       offset="0.928571"
       stop-color="#e5a50a"
       id="stop1411" />
    <stop
       offset="0.964286"
       stop-color="#f6d32d"
       id="stop1413" />
    <stop
       offset="1"
       stop-color="#e5a50a"
       id="stop1415" />
  </linearGradient>
  <linearGradient
     id="b"
     gradientUnits="userSpaceOnUse"
     x1="46.000003"
     x2="82.000003"
     y1="71.4"
     y2="71.4">
    <stop
       offset="0"
       stop-color="#1f8455"
       id="stop1418" />
    <stop
       offset="0.5"
       stop-color="#26a269"
       id="stop1420" />
    <stop
       offset="1"
       stop-color="#1f8455"
       stop-opacity="0.976471"
       id="stop1422" />
  </linearGradient>
  <path
     d="m 16 40 h 96 c 4.417969 0 8 3.582031 8 8 v 60 c 0 4.417969 -3.582031 8 -8 8 h -96 c -4.417969 0 -8 -3.582031 -8 -8 v -60 c 0 -4.417969 3.582031 -8 8 -8 z m 0 0"
     fill="url(#a)"
     id="path1425" />
  <path
     d="m 16 28 h 96 c 4.417969 0 8 3.582031 8 8 v 56 c 0 4.417969 -3.582031 8 -8 8 h -96 c -4.417969 0 -8 -3.582031 -8 -8 v -56 c 0 -4.417969 3.582031 -8 8 -8 z m 0 0"
     fill="#f6d32d"
     id="path1427" />
  <path
     style="opacity:0.5;stroke-width:1.02109"
     d="M 12.388359,53.522931 V 70.881454 H 23.620345 V 53.522931 Z m 3.063269,3.063269 h 5.105447 v 11.231986 h -5.105447 z"
     id="path3368" />
  <rect
     style="opacity:0.5;stroke-width:1.02109"
     width="3.0632687"
     height="22.463972"
     x="16.472717"
     y="28"
     id="rect3362" />
  <rect
     style="opacity:0.5;stroke-width:1.02109"
     width="3.0632687"
     height="22.463972"
     x="108.46401"
     y="28"
     id="rect3362-6" />
  <path
     id="path3368-1"
     style="opacity:0.5;stroke-width:1.02109"
     d="m 83.920258,95.611328 h 8.167969 v -0.0039 H 86.982758 V 84.375006 h 5.105469 v -3.0625 h -8.167969 z" />
  <path
     id="path3368-1-2"
     style="opacity:0.5;stroke-width:1.02109"
     d="m 103.35932,95.611487 h 8.16796 v -0.0039 h -5.10546 V 84.375165 h 5.10546 v -3.0625 h -8.16796 z" />
  <rect
     style="opacity:0.5;stroke-width:1.02109"
     width="3.0632687"
     height="22.463972"
     x="96.127747"
     y="73.147514"
     id="rect3362-6-7" />
  <rect
     style="opacity:0.5;stroke-width:1.02109"
     width="3.0632687"
     height="11.231986"
     x="22.599253"
     y="28"
     id="rect3364" />
  <rect
     style="opacity:0.5;stroke-width:1.02109"
     width="3.0632687"
     height="17.358522"
     x="47.105324"
     y="28"
     id="rect3366" />
  <rect
     style="opacity:0.5;stroke-width:1.02109"
     width="3.0632687"
     height="11.231986"
     x="28.72579"
     y="28"
     id="rect3370" />
  <rect
     style="opacity:0.5;stroke-width:1.02109"
     width="3.0632687"
     height="11.231986"
     x="34.852249"
     y="28"
     id="rect3372" />
  <rect
     style="opacity:0.5;stroke-width:1.02109"
     width="3.0632687"
     height="11.231986"
     x="40.978786"
     y="28"
     id="rect3374" />
  <rect
     style="opacity:0.5;stroke-width:1.02109"
     width="3.0632687"
     height="11.231986"
     x="53.231861"
     y="28"
     id="rect3376" />
  <rect
     style="opacity:0.5;stroke-width:1.02109"
     width="3.0632687"
     height="11.231986"
     x="59.358398"
     y="28"
     id="rect3378" />
  <rect
     style="opacity:0.5;stroke-width:1.02109"
     width="3.0632687"
     height="11.231986"
     x="65.530594"
     y="28"
     id="rect3376-0" />
  <rect
     style="opacity:0.5;stroke-width:1.02109"
     width="3.0632687"
     height="11.231986"
     x="71.657127"
     y="28"
     id="rect3378-9" />
  <rect
     style="opacity:0.5;stroke-width:1.02109"
     width="3.0632687"
     height="17.358522"
     x="77.793724"
     y="28"
     id="rect3366-3" />
  <rect
     style="opacity:0.5;stroke-width:1.02109"
     width="3.0632687"
     height="11.231986"
     x="83.920258"
     y="28"
     id="rect3376-6" />
  <rect
     style="opacity:0.5;stroke-width:1.02109"
     width="3.0632687"
     height="11.231986"
     x="90.046799"
     y="28"
     id="rect3378-0" />
  <rect
     style="opacity:0.5;stroke-width:1.02109"
     width="3.0632687"
     height="11.231986"
     x="96.218834"
     y="28"
     id="rect3376-0-6" />
  <rect
     style="opacity:0.5;stroke-width:1.02109"
     width="3.0632687"
     height="11.231986"
     x="102.34539"
     y="28"
     id="rect3378-9-2" />
</svg>

That looks great, thank you! Would you like to do a pull request so this change is attributed to you properly? Otherwise I can commit it myself.

Otherwise I can commit it myself.

That would be best. And quickest.
There's no need for attribution in this case.
Just giving back a little bit for using your excellent piece of work.

I've looked at Gnome icon guidelines and thought that the thickness of the icon is not justified for a ruler, so I made a thinner version of it:

rlr

And here's the modified .svg code:

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
   height="128px"
   viewBox="0 0 128 128"
   width="128px"
   version="1.1"
   id="svg1457"
   xmlns="http://www.w3.org/2000/svg"
   xmlns:svg="http://www.w3.org/2000/svg">
  <defs
     id="defs1461" />
  <linearGradient
     id="a"
     gradientUnits="userSpaceOnUse"
     x1="8"
     x2="120.0000075"
     y1="123.99999225"
     y2="123.99999225">
    <stop
       offset="0"
       stop-color="#e5a50a"
       id="stop1405" />
    <stop
       offset="0.0357143"
       stop-color="#f6d32d"
       id="stop1407" />
    <stop
       offset="0.0714286"
       stop-color="#e5a50a"
       id="stop1409" />
    <stop
       offset="0.928571"
       stop-color="#e5a50a"
       id="stop1411" />
    <stop
       offset="0.964286"
       stop-color="#f6d32d"
       id="stop1413" />
    <stop
       offset="1"
       stop-color="#e5a50a"
       id="stop1415" />
  </linearGradient>
  <linearGradient
     id="b"
     gradientUnits="userSpaceOnUse"
     x1="46.000003"
     x2="82.000003"
     y1="71.4"
     y2="71.4">
    <stop
       offset="0"
       stop-color="#1f8455"
       id="stop1418" />
    <stop
       offset="0.5"
       stop-color="#26a269"
       id="stop1420" />
    <stop
       offset="1"
       stop-color="#1f8455"
       stop-opacity="0.976471"
       id="stop1422" />
  </linearGradient>
  <path
     d="m 16 40 h 96 c 4.417969 0 8 3.582031 8 8 v 60 c 0 4.417969 -3.582031 8 -8 8 h -96 c -4.417969 0 -8 -3.582031 -8 -8 v -60 c 0 -4.417969 3.582031 -8 8 -8 z m 0 0"
     fill="url(#a)"
     id="path1425" />
  <g
     id="g341"
     transform="translate(0,10)">
    <path
       d="m 16,28 h 96 c 4.41797,0 8,3.582031 8,8 v 56 c 0,4.417969 -3.58203,8 -8,8 H 16 C 11.582031,100 8,96.417969 8,92 V 36 c 0,-4.417969 3.582031,-8 8,-8 z m 0,0"
       fill="#f6d32d"
       id="path1427" />
    <path
       style="opacity:0.5;stroke-width:1.02109"
       d="M 12.388359,53.522931 V 70.881454 H 23.620345 V 53.522931 Z m 3.063269,3.063269 h 5.105447 v 11.231986 h -5.105447 z"
       id="path3368" />
    <rect
       style="opacity:0.5;stroke-width:1.02109"
       width="3.0632687"
       height="22.463972"
       x="16.472717"
       y="28"
       id="rect3362" />
    <rect
       style="opacity:0.5;stroke-width:1.02109"
       width="3.0632687"
       height="22.463972"
       x="108.46401"
       y="28"
       id="rect3362-6" />
    <path
       id="path3368-1"
       style="opacity:0.5;stroke-width:1.02109"
       d="m 83.920258,95.611328 h 8.167969 v -0.0039 H 86.982758 V 84.375006 h 5.105469 v -3.0625 h -8.167969 z" />
    <path
       id="path3368-1-2"
       style="opacity:0.5;stroke-width:1.02109"
       d="m 103.35932,95.611487 h 8.16796 v -0.0039 h -5.10546 V 84.375165 h 5.10546 v -3.0625 h -8.16796 z" />
    <rect
       style="opacity:0.5;stroke-width:1.02109"
       width="3.0632687"
       height="22.463972"
       x="96.127747"
       y="73.147514"
       id="rect3362-6-7" />
    <rect
       style="opacity:0.5;stroke-width:1.02109"
       width="3.0632687"
       height="11.231986"
       x="22.599253"
       y="28"
       id="rect3364" />
    <rect
       style="opacity:0.5;stroke-width:1.02109"
       width="3.0632687"
       height="17.358522"
       x="47.105324"
       y="28"
       id="rect3366" />
    <rect
       style="opacity:0.5;stroke-width:1.02109"
       width="3.0632687"
       height="11.231986"
       x="28.72579"
       y="28"
       id="rect3370" />
    <rect
       style="opacity:0.5;stroke-width:1.02109"
       width="3.0632687"
       height="11.231986"
       x="34.852249"
       y="28"
       id="rect3372" />
    <rect
       style="opacity:0.5;stroke-width:1.02109"
       width="3.0632687"
       height="11.231986"
       x="40.978786"
       y="28"
       id="rect3374" />
    <rect
       style="opacity:0.5;stroke-width:1.02109"
       width="3.0632687"
       height="11.231986"
       x="53.231861"
       y="28"
       id="rect3376" />
    <rect
       style="opacity:0.5;stroke-width:1.02109"
       width="3.0632687"
       height="11.231986"
       x="59.358398"
       y="28"
       id="rect3378" />
    <rect
       style="opacity:0.5;stroke-width:1.02109"
       width="3.0632687"
       height="11.231986"
       x="65.530594"
       y="28"
       id="rect3376-0" />
    <rect
       style="opacity:0.5;stroke-width:1.02109"
       width="3.0632687"
       height="11.231986"
       x="71.657127"
       y="28"
       id="rect3378-9" />
    <rect
       style="opacity:0.5;stroke-width:1.02109"
       width="3.0632687"
       height="17.358522"
       x="77.793724"
       y="28"
       id="rect3366-3" />
    <rect
       style="opacity:0.5;stroke-width:1.02109"
       width="3.0632687"
       height="11.231986"
       x="83.920258"
       y="28"
       id="rect3376-6" />
    <rect
       style="opacity:0.5;stroke-width:1.02109"
       width="3.0632687"
       height="11.231986"
       x="90.046799"
       y="28"
       id="rect3378-0" />
    <rect
       style="opacity:0.5;stroke-width:1.02109"
       width="3.0632687"
       height="11.231986"
       x="96.218834"
       y="28"
       id="rect3376-0-6" />
    <rect
       style="opacity:0.5;stroke-width:1.02109"
       width="3.0632687"
       height="11.231986"
       x="102.34539"
       y="28"
       id="rect3378-9-2" />
  </g>
</svg>

@somepaulo would you like to take a look at #7 ? I changed the dark color to have a sufficient contrast with the light background according with https://www.w3.org/TR/WCAG/#contrast-minimum and also replaced the text with the bitmap-like Redaction font.

Here's also an accompanying symbolic icon to complete the pack.
It should go into /usr/share/icons/hicolor/symbolic/apps/ on installation.

rlr-symbolic

And here's the .svg code:

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
   height="16px"
   viewBox="0 0 16 16"
   width="16px"
   version="1.1"
   id="svg4"
   xmlns="http://www.w3.org/2000/svg"
   xmlns:svg="http://www.w3.org/2000/svg">
  <defs
     id="defs8" />
  <rect
     style="fill:#2e3434;fill-opacity:1;stroke:none;stroke-width:0.967207;stroke-miterlimit:4.1;stroke-dasharray:none;paint-order:stroke fill markers"
     id="rect550"
     width="1.5"
     height="12"
     x="0"
     y="1.999953" />
  <rect
     style="fill:#2e3434;fill-opacity:1;stroke:none;stroke-width:0.558419;stroke-miterlimit:4.1;stroke-dasharray:none;paint-order:stroke fill markers"
     id="rect550-3"
     width="1.5"
     height="4"
     x="2.3969791"
     y="1.999953" />
  <rect
     style="fill:#2e3434;fill-opacity:1;stroke:none;stroke-width:0.558419;stroke-miterlimit:4.1;stroke-dasharray:none;paint-order:stroke fill markers"
     id="rect550-3-6"
     width="1.5"
     height="4"
     x="4.7939582"
     y="1.999953" />
  <rect
     style="fill:#2e3434;fill-opacity:1;stroke:none;stroke-width:0.550725;stroke-miterlimit:4.1;stroke-dasharray:none;paint-order:stroke fill markers"
     id="rect550-3-6-1"
     width="1.5"
     height="3.8905334"
     x="8.359128"
     y="-6.2875128"
     transform="rotate(90)" />
  <rect
     style="fill:#2e3434;fill-opacity:1;stroke:none;stroke-width:0.550725;stroke-miterlimit:4.1;stroke-dasharray:none;paint-order:stroke fill markers"
     id="rect550-3-6-1-2"
     width="1.5"
     height="3.8905334"
     x="13.859128"
     y="-6.2875128"
     transform="rotate(90)" />
  <rect
     style="fill:#2e3434;fill-opacity:1;stroke:none;stroke-width:0.558419;stroke-miterlimit:4.1;stroke-dasharray:none;paint-order:stroke fill markers"
     id="rect550-3-7"
     width="1.5"
     height="4"
     x="7.190937"
     y="1.999953" />
  <rect
     style="fill:#2e3434;fill-opacity:1;stroke:none;stroke-width:0.789724;stroke-miterlimit:4.1;stroke-dasharray:none;paint-order:stroke fill markers"
     id="rect550-3-7-5"
     width="1.5"
     height="8"
     x="9.5879164"
     y="1.999953" />
  <rect
     style="fill:#2e3434;fill-opacity:1;stroke:none;stroke-width:0.558419;stroke-miterlimit:4.1;stroke-dasharray:none;paint-order:stroke fill markers"
     id="rect550-3-7-3"
     width="1.5"
     height="4"
     x="11.984895"
     y="1.999953" />
  <rect
     style="fill:#2e3434;fill-opacity:1;stroke:none;stroke-width:0.558419;stroke-miterlimit:4.1;stroke-dasharray:none;paint-order:stroke fill markers"
     id="rect550-3-7-56"
     width="1.5"
     height="4"
     x="14.381874"
     y="1.999953" />
  <rect
     style="fill:#2e3434;fill-opacity:1;stroke:none;stroke-width:0.738719;stroke-miterlimit:4.1;stroke-dasharray:none;paint-order:stroke fill markers"
     id="rect550-3-7-56-2"
     width="1.5"
     height="7"
     x="2.3969791"
     y="8.359128" />
  <rect
     style="fill:#2e3434;fill-opacity:1;stroke:none;stroke-width:0.738719;stroke-miterlimit:4.1;stroke-dasharray:none;paint-order:stroke fill markers"
     id="rect550-3-7-56-9"
     width="1.5"
     height="7"
     x="4.7939582"
     y="8.359128" />
</svg>

I changed the dark color to have a sufficient contrast with the light background ... and also replaced the text with the bitmap-like Redaction font.

Looks great! Keeps both the Gnome style and the original pixelated logo idea, rather than my initial generic thing.

Here's also an accompanying symbolic icon to complete the pack. It should go into /usr/share/icons/hicolor/symbolic/apps/ on installation.

I guess this doesn't go in the .desktop file right? I can't find any documentation.

By the way, cargo doesn't let you install documentation/resource/configuration files unfortunately. So the icons and the launcher would have to be placed manually by the user or someone who packages it in some other format.

I guess this doesn't go in the .desktop file right?

No, it doesn't. It gets picked up automatically by Gnome as long as the icon is named the same as the app icon (with -symbolic added at the end) and placed in the correct folder of the hicolor theme.

So the icons and the launcher would have to be placed manually by the user or someone who packages it in some other format.

I think that on Arch it's achievable through the PKGBUILD file. Don't know about other distros.
I'll leave a comment on AUR so that the packager updates the PKGBUILD when you release the update.

It gets picked up automatically by Gnome as long as the icon is named the same as the app icon (with -symbolic added at the end) and placed in the correct folder of the hicolor theme.

Sounds good then, I will mention the icon and the filesystem path in the README to make it more visible.

Great!
As long as the .desktop file and the icons are included in the package, I guess a packager should be able to make sure they get copied into the right places.

I will mention the icon and the filesystem path

The path for the .desktop file is /usr/share/applications.