Add Desktop file to easily start KlipperScreen on a normal Linux desktop (#713)

Co-authored-by: alfrix <alfredomonclus@gmail.com>
This commit is contained in:
Nick Douma 2022-09-22 01:18:22 +02:00 committed by GitHub
parent 2f427f7b82
commit 1b758b85c6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 142 additions and 0 deletions

View File

@ -161,6 +161,13 @@ update_x11()
fi
}
add_desktop_file()
{
DESKTOP=$(<$SCRIPTPATH/KlipperScreen.desktop)
mkdir -p $HOME/.local/share/applications/
echo "$DESKTOP" | tee $HOME/.local/share/applications/KlipperScreen.desktop > /dev/null
}
start_KlipperScreen()
{
echo_text "Starting service..."
@ -177,4 +184,5 @@ modify_user
install_systemd_service
update_x11
echo_ok "KlipperScreen was installed"
add_desktop_file
start_KlipperScreen

11
scripts/KlipperScreen.desktop Executable file
View File

@ -0,0 +1,11 @@
[Desktop Entry]
Name=KlipperScreen
GenericName=Touch screen GUI for Klipper via Moonraker
Icon=$HOME/KlipperScreen/styles/icon.svg
Exec=sh -c "$HOME/.KlipperScreen-env/bin/python $HOME/KlipperScreen/screen.py"
Terminal=false
Type=Application
Categories=Graphics;3DGraphics;Engineering;
Keywords=3D;Printing
StartupNotify=false
StartupWMClass=klipper-screen

123
styles/icon.svg Normal file
View File

@ -0,0 +1,123 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
width="64"
height="64"
viewBox="0 0 64 64"
version="1.1"
id="svg10"
sodipodi:docname="icon.svg"
inkscape:version="1.2.1 (9c6d41e410, 2022-07-14)"
xml:space="preserve"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:dc="http://purl.org/dc/elements/1.1/"><metadata
id="metadata16"><rdf:RDF><cc:Work
rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" /><dc:title>folder</dc:title></cc:Work></rdf:RDF></metadata><defs
id="defs14" /><sodipodi:namedview
pagecolor="#bfbfbf"
bordercolor="#666666"
borderopacity="1"
objecttolerance="10"
gridtolerance="10"
guidetolerance="10"
inkscape:pageopacity="0"
inkscape:pageshadow="2"
inkscape:window-width="1600"
inkscape:window-height="826"
id="namedview12"
showgrid="false"
inkscape:pagecheckerboard="false"
inkscape:zoom="7.6562596"
inkscape:cx="39.510155"
inkscape:cy="26.318334"
inkscape:window-x="0"
inkscape:window-y="0"
inkscape:window-maximized="1"
inkscape:current-layer="svg10"
inkscape:snap-bbox="true"
inkscape:snap-bbox-edge-midpoints="true"
inkscape:document-rotation="0"
inkscape:showpageshadow="0"
inkscape:deskcolor="#bfbfbf" /><!-- Generator: Sketch 52.5 (67469) - http://www.bohemiancoding.com/sketch --><title
id="title2">folder</title><rect
style="fill:#13181c;stroke:#000000;stroke-width:4;stroke-dasharray:none;stop-color:#000000;fill-opacity:1"
id="rect412"
width="55.045174"
height="47.364159"
x="4.4774132"
y="8.3179207"
rx="2"
ry="2" /><desc
id="desc4">Created with Sketch.</desc><path
style="fill:none;stroke:#dd5f01;stroke-width:2;stroke-linecap:butt;stroke-linejoin:miter;stroke-dasharray:none;stroke-opacity:1"
d="m 10.918877,44.683482 4.397769,-10.40131 12.695858,0.02858"
id="path1171"
sodipodi:nodetypes="ccc" /><path
style="fill:none;stroke:#009183;stroke-width:2;stroke-linecap:butt;stroke-linejoin:miter;stroke-dasharray:none;stroke-opacity:1"
d="m 10.004324,40.896808 17.991756,0.08241"
id="path1173" /><path
style="fill:none;stroke:#ffffff;stroke-width:3;stroke-linecap:butt;stroke-linejoin:miter;stroke-dasharray:none;stroke-opacity:1"
d="m 12.5,18.344859 h 10"
id="path1175" /><path
style="fill:none;stroke:#ffffff;stroke-width:3;stroke-linecap:butt;stroke-linejoin:miter;stroke-dasharray:none;stroke-opacity:1"
d="m 12.5,24.783654 h 14"
id="path1177" /><g
id="g20756"><rect
style="fill:#404040;stroke:none;stroke-width:1;stroke-dasharray:none;stop-color:#000000"
id="rect524"
width="10"
height="10"
x="45"
y="14.999999" /><rect
style="fill:#404040;stroke:none;stroke-width:1;stroke-dasharray:none;stop-color:#000000"
id="rect545"
width="10"
height="10"
x="33"
y="14.999999" /><rect
style="font-variation-settings:normal;opacity:1;vector-effect:none;fill:#404040;fill-opacity:1;stroke:none;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;-inkscape-stroke:none;stop-color:#000000;stop-opacity:1"
id="rect547"
width="10"
height="10"
x="45"
y="26.999998" /><rect
style="fill:#404040;stroke:none;stroke-width:1;stroke-dasharray:none;stop-color:#000000"
id="rect549"
width="10"
height="10"
x="33"
y="26.999998" /><rect
style="fill:#404040;stroke:none;stroke-width:1;stroke-dasharray:none;stop-color:#000000"
id="rect551"
width="22"
height="10"
x="33"
y="39" /><path
style="font-variation-settings:normal;opacity:1;vector-effect:none;fill:none;fill-opacity:1;stroke:#ed6500;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;-inkscape-stroke:none;stop-color:#000000;stop-opacity:1"
d="M 33,25 H 43"
id="path14404" /><path
style="fill:none;stroke:#ae007e;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
d="M 45,25 H 55"
id="path14406" /><path
style="fill:none;stroke:#009384;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
d="M 33,37 H 43"
id="path14408" /><path
style="fill:none;stroke:#a7e100;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
d="M 45,37 H 55"
id="path14410" /><path
style="fill:none;fill-opacity:1;stroke:#ed6500;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
d="M 33,49 H 55"
id="path14412" /></g><path
style="fill:none;stroke:#009183;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
d="m 10.5,23.283653 v 3"
id="path20785"
sodipodi:nodetypes="cc" /><path
style="fill:none;stroke:#ed6500;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
d="m 10.5,16.844859 v 3"
id="path20785-9"
sodipodi:nodetypes="cc" /></svg>

After

Width:  |  Height:  |  Size: 5.5 KiB