Skip to content

Commit

Permalink
Add svg icon for .desktop file (#708)
Browse files Browse the repository at this point in the history
* add SVG icon and .desktop file to Debian package. Renamed icon and .desktop file to package name.
  • Loading branch information
joede authored and xor-gate committed May 5, 2018
1 parent b1b2a2f commit 0af68c0
Show file tree
Hide file tree
Showing 17 changed files with 379 additions and 129 deletions.
3 changes: 0 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -201,9 +201,6 @@ if (CMAKE_SYSTEM_NAME STREQUAL "Linux")
DESTINATION ${STLINK_MODPROBED_DIR}/)
install(FILES ${RULES_FILES}
DESTINATION ${STLINK_UDEV_RULES_DIR}/)
#desktop file for linux launcher
install(FILES src/tools/gui/stlink.desktop DESTINATION ${CMAKE_INSTALL_PREFIX}/share/applications)
install(FILES src/tools/gui/art/stlink-gui_48.png DESTINATION ${CMAKE_INSTALL_PREFIX}/share/icons/hicolor/48x48/apps RENAME stlink-gui.png)
endif()

add_subdirectory(src/gdbserver)
Expand Down
2 changes: 2 additions & 0 deletions debian/stlink-gui.install
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
/usr/bin/stlink-gui*
/usr/share/stlink/stlink-gui.ui
/usr/share/applications/stlink-gui.desktop
/usr/share/icons/hicolor/scalable/apps/stlink-gui.svg
9 changes: 9 additions & 0 deletions src/tools/gui/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,12 @@ install(TARGETS stlink-gui
RUNTIME DESTINATION bin)
install(FILES stlink-gui.ui
DESTINATION ${INSTALLED_UI_DIR})
if (${CMAKE_SYSTEM_NAME} MATCHES "Linux")
# Install desktop entry
install(FILES stlink-gui.desktop
DESTINATION share/applications)
# Install icon
install(FILES art/stlink-gui.svg
DESTINATION share/icons/hicolor/scalable/apps)
endif (${CMAKE_SYSTEM_NAME} MATCHES "Linux")

38 changes: 38 additions & 0 deletions src/tools/gui/art/export-icons.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
#!/bin/sh
#
# create the XPM icon and all resolutions below hicolor as PNG

APPNAME="stlink-gui"
ORIGIN="stlink-gui_icon.svg"
OUTDIR="hicolor"

## possible size options are --export-dpi / --export-width / --export-height
OPTS="-z --export-id-only"
ID="scalable-icon"
RESOLUTIONS="16 22 24 32 48 64 128 256"

if ! [ -d $OUTDIR ]; then
echo "output directory missing. Create it..."
mkdir $OUTDIR
for RES in $RESOLUTIONS; do
mkdir -p $OUTDIR/${RES}x${RES}/apps
done
fi

# create single app icon
inkscape $OPTS --export-width=32 --export-id=$ID --export-png=$APPNAME.png $ORIGIN
if [ $? != 0 ]; then exit 1; fi
convert $APPNAME.png $APPNAME.xpm

# create all the resolutions
ALL=""
for RES in $RESOLUTIONS; do
inkscape $OPTS --export-width=$RES --export-id=$ID --export-png=$OUTDIR/${RES}x${RES}/apps/$APPNAME.png $ORIGIN
ALL="$ALL $OUTDIR/${RES}x${RES}/apps/$APPNAME.png"
done

# this is for windows...
#echo "build Windows icon from $ALL"
#convert $ALL $APPNAME.ico

exit 0
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/tools/gui/art/hicolor/16x16/apps/stlink-gui.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/tools/gui/art/stlink-gui.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
130 changes: 130 additions & 0 deletions src/tools/gui/art/stlink-gui.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
200 changes: 200 additions & 0 deletions src/tools/gui/art/stlink-gui.xpm
Original file line number Diff line number Diff line change
@@ -0,0 +1,200 @@
/* XPM */
static char *stlink_gui[] = {
/* columns rows colors chars-per-pixel */
"32 32 162 2 ",
" c #010303",
". c #030608",
"X c #050A0E",
"o c #0C0D0F",
"O c #0A1016",
"+ c #141C24",
"@ c #162226",
"# c #172837",
"$ c #1F383F",
"% c #222B2E",
"& c #25313A",
"* c #002341",
"= c #102841",
"- c #1E2C43",
"; c #1C2E4B",
": c #1B3A45",
"> c #1C3349",
", c #153848",
"< c #16394D",
"1 c #1D3A4B",
"2 c #172D55",
"3 c #1C3C52",
"4 c #193A55",
"5 c #232E42",
"6 c #213145",
"7 c #2C3B46",
"8 c #24364B",
"9 c #24394B",
"0 c #2E3A4C",
"q c #333D4A",
"w c #0E3562",
"e c #003D6F",
"r c #133666",
"t c #163D65",
"y c #183B61",
"u c #12376C",
"i c #0C3A76",
"p c #17434D",
"a c #1D4049",
"s c #184455",
"d c #184851",
"f c #27404C",
"g c #2D444D",
"h c #34434F",
"j c #3C4649",
"k c #384250",
"l c #0F4463",
"z c #164265",
"x c #184261",
"c c #144964",
"v c #184A62",
"b c #144E69",
"n c #135369",
"m c #0A4177",
"M c #00417F",
"N c #0A5277",
"B c #424D55",
"V c #444E5A",
"C c #4A5059",
"Z c #4D5A5E",
"A c #4E5562",
"S c #515B63",
"D c #565E69",
"F c #58646B",
"G c #5D686F",
"H c #5D6670",
"J c #5F6D72",
"K c #656C77",
"L c #676C78",
"P c #6B737C",
"I c #063C84",
"U c #01378C",
"Y c #033295",
"T c #013E98",
"R c #0034A0",
"E c #0036A9",
"W c #003CAF",
"Q c #003CBF",
"! c #004581",
"~ c #074587",
"^ c #004C81",
"/ c #005286",
"( c #005C85",
") c #004297",
"_ c #044D91",
"` c #034B99",
"' c #025A90",
"] c #005898",
"[ c #006382",
"{ c #076988",
"} c #07758F",
"| c #02689C",
" . c #0042A3",
".. c #004CA8",
"X. c #0051A0",
"o. c #0055AB",
"O. c #005BAF",
"+. c #0045B4",
"@. c #0049B9",
"#. c #0052B6",
"$. c #0054BD",
"%. c #005ABC",
"&. c #0060A6",
"*. c #0069A6",
"=. c #0065AC",
"-. c #006FA9",
";. c #0072A6",
":. c #007DA6",
">. c #0073AF",
",. c #006EB3",
"<. c #0065B9",
"1. c #006ABF",
"2. c #0076B0",
"3. c #007EB2",
"4. c #757B83",
"5. c #0036C0",
"6. c #003AC0",
"7. c #0044C0",
"8. c #004CC0",
"9. c #0053C0",
"0. c #005BC0",
"q. c #0064C0",
"w. c #006CC0",
"e. c #0074C0",
"r. c #007CC0",
"t. c #0085A6",
"y. c #0088A6",
"u. c #0082AA",
"i. c #0093A6",
"p. c #0093AE",
"a. c #0087B8",
"s. c #008BB8",
"d. c #0090B1",
"f. c #009EBE",
"g. c #00A3BE",
"h. c #0083C0",
"j. c #008BC0",
"k. c #0093C0",
"l. c #00A2C0",
"z. c #84868A",
"x. c #858B90",
"c. c #8C8E92",
"v. c #919192",
"b. c #94989E",
"n. c #9B9C9C",
"m. c #9D9EA1",
"M. c #9FA1A3",
"N. c #A1A1A1",
"B. c #A6ABAD",
"V. c #A9A9A9",
"C. c #ADB2B4",
"Z. c #B7B7B8",
"A. c #BBBBBC",
"S. c #C2C2C3",
"D. c #C6C7C8",
"F. c #CBCCCC",
"G. c #D2D2D2",
"H. c #DBDBDB",
"J. c #E1E1E1",
"K. c #ECECEC",
"L. c #F4F4F4",
"P. c #FEFEFE",
/* pixels */
"G.V.V.V.V.V.V.V.V.V.V.V.V.V.V.V.V.V.V.V.V.V.V.V.V.V.V.V.V.V.V.J.",
"N. X . X X X X X X X X . X X X X X X X X X X X X X X X X X N.",
"N.. Q 5.5.E 2 ; 0 0 0 > u T 8.i ; > ; ; > > > > - > 1 , r.1.. M.",
"N.. Q 5.Y q G.P.P.P.P.L.F.5 9.; L.P.P.P.P.P.P.P.P.P.P.h e.1.. N.",
"N.. 6.6.5 L.P.J.c.4.m.F.P.8 $.8 H.H.H.J.L.P.P.H.H.H.J.7 e.e.. N.",
"N.. 6.R L P.K.5 Y T U r 5 # 9.~ y y y = V.P.P.+ z x x z r.r.. N.",
"N.. 6.Y z.P.H.2 @.8.9.9.9...0.0.%.0.q.! V.P.P.1 e.e.e.e.r.r.. N.",
"M.. 6.W A P.P.V.k 6 r ) $.9.0.0.q.q.q.! V.P.P.1 e.e.e.r.r.3.. N.",
"M.. Q @.; F.P.P.P.P.F.4.6 ` %.0.q.q.w.! V.P.P.: e.e.r.r.r.h.. N.",
"M.. 7.7.+.2 D S.P.P.P.P.L.q O.q.q.q.q.! V.P.P.> e.r.r.r.r.h.. N.",
"N.. 7.8.8.8. .u > q m.P.P.S.m q.w.q.w.^ V.P.P.1 r.r.r.r.h.h.. N.",
"N.. 7.+. .8.9.9.9.$.w Z.P.K.3 q.w.w.w.^ V.P.P.1 r.r.r.h.h.a.. N.",
"N.. 8. .+ 5 U #.0.0.w Z.P.J.4 w.w.w.w.^ V.P.P.1 r.h.h.h.h.h.. N.",
"M.. 8. .L K.c.V q k b.P.P.x._ w.w.w.e.^ V.P.P.1 r.h.h.h.j.j.. N.",
"M.. @. .C K.P.P.P.P.P.P.A.> 1.w.w.e.e.^ V.P.P.1 h.h.h.h.j.j.. N.",
"N.. 8.$.I 4 q B H P S 7 t <.1.w.e.e.e./ & h h < h.h.j.j.j.j.. N.",
"N.. 9.9.9.0.%.%.o.X.O.q.q.w.w.e.e.e.e.r.r.r.h.h.h.h.j.j.j.k.. N.",
"N.. i i ~ 0.` i m ` w.q.w.w.e.w.e.e.r.r.r.| N N { j.j.j.k.k.. N.",
"N.o z.A.6 0.t N.Z.1 w.w.w.e.e.e.e.r.r.r.r.b n.A.1 j.j.j.k.k.. N.",
"N.o A.P.8 q.t v.V.1 w.w.w.e.e.3.r.r.r.r.h.c G.P.1 j.k.k.k.k.. N.",
"N.o A.P.9 q.M * * e w.] ^ ^ &.' z N >.h.h.b G.P.1 k.f.N [ N X M.",
"N.o A.P.8 q.t v.V.> w.3 N.v.O 4.G.A.7 ;.h.b G.P.1 s.: m.v.@ . M.",
"N.o A.P.8 q.z G.L.4 w.3 L.H.z.F x.P.J.s j.n G.P.$ : D.H.& i.. M.",
"N.o A.P.9 q.z H.P.1 e.3 L.P.7 -.l S.P.f j.b G.P.O D.G.: p.g.. M.",
"N.o A.P.9 w.z H.P.1 e.3 L.K.s r.( V.P.g s.n G.P.A.L.@ p.f.l.. N.",
"N.o A.P.9 w.t H.L.4 e.3 L.H.v h.( N.P.g j.n G.P.j P.C.p f.l.. N.",
"N.o A.P.9 w.x H.L.9 3.3 L.H.v h.( m.P.g k.n G.P.O B P.B.d g.. N.",
"N.o A.P.9 e.z G.P.4 r.s L.H.v a.( N.P.g k.n G.P.a } Z P.B.d . N.",
"N.o B H - e.c S G , r.< G S c j.[ k K # k.n Z J a g.} j J % o m.",
"N.. &.&.=.1.,.*.-.>.h.2.;.;.3.s.a.:.u.t.f.d.y.y.p.g.g.i.i.i.. m.",
"N. X X X X X X X X X X X X X X X X X X X X X X X X X X o o N.",
"J.V.V.V.V.V.V.V.V.V.V.V.V.V.V.V.V.V.V.V.V.V.V.V.V.V.V.V.V.V.V.J."
};
Loading

0 comments on commit 0af68c0

Please sign in to comment.