Download PrusaSlicer from GitHub
This commit is contained in:
parent
d372cd9f09
commit
9e1f29dfd9
8 changed files with 117 additions and 3 deletions
|
|
@ -78,6 +78,8 @@
|
|||
use_inches = 0
|
||||
version_check = 0
|
||||
view_mode = expert
|
||||
tls_accepted_cert_store_location = /etc/ssl/certs/ca-certificates.crt
|
||||
tls_cert_store_accepted = yes
|
||||
|
||||
[filaments]
|
||||
AmazonBasics TPU @MINI = 1
|
||||
|
|
|
|||
2
packer/ansible/roles/prusa-slicer/defaults/main.yml
Normal file
2
packer/ansible/roles/prusa-slicer/defaults/main.yml
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
---
|
||||
prusa_slicer_use_package: false
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
[Desktop Entry]
|
||||
Name=Prusa GCode viewer
|
||||
Exec=/opt/PrusaSlicer/bin/prusa-slicer --gcodeviewer %F
|
||||
Icon=/opt/PrusaSlicer/resources/icons/PrusaSlicer-gcodeviewer.svg
|
||||
Terminal=false
|
||||
Type=Application
|
||||
MimeType=text/x.gcode;
|
||||
Categories=Graphics;3DGraphics;
|
||||
Keywords=3D;Printing;Slicer;
|
||||
12
packer/ansible/roles/prusa-slicer/files/PrusaSlicer.desktop
Normal file
12
packer/ansible/roles/prusa-slicer/files/PrusaSlicer.desktop
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
[Desktop Entry]
|
||||
Name=PrusaSlicer
|
||||
GenericName=3D Printing Software
|
||||
Terminal=false
|
||||
Exec=/opt/PrusaSlicer/bin/prusa-slicer %F
|
||||
Icon=/opt/PrusaSlicer/resources/icons/PrusaSlicer.png
|
||||
Type=Application
|
||||
MimeType=model/stl;application/vnd.ms-3mfdocument;application/prs.wavefront-obj;application/x-amf;
|
||||
Categories=Graphics;3DGraphics;Engineering;
|
||||
Keywords=3D;Printing;Slicer;slice;3D;printer;convert;gcode;stl;obj;amf;SLA
|
||||
StartupNotify=false
|
||||
StartupWMClass=prusa-slicer
|
||||
|
|
@ -1,4 +1,12 @@
|
|||
---
|
||||
- set_fact:
|
||||
prusa_slicer_profiles_directory: /usr/share/PrusaSlicer/profiles
|
||||
when: prusa_slicer_use_package | bool
|
||||
|
||||
- set_fact:
|
||||
prusa_slicer_profiles_directory: /opt/PrusaSlicer/resources/profiles
|
||||
when: not prusa_slicer_use_package | bool
|
||||
|
||||
- name: create skel directories
|
||||
file:
|
||||
path: "/etc/skel/{{ item }}"
|
||||
|
|
@ -10,11 +18,26 @@
|
|||
|
||||
- name: create symlink to vendor profiles
|
||||
file:
|
||||
src: /usr/share/PrusaSlicer/profiles/PrusaResearch.ini
|
||||
src: "{{ prusa_slicer_profiles_directory }}/PrusaResearch.ini"
|
||||
dest: /etc/skel/.config/PrusaSlicer/vendor/PrusaResearch.ini
|
||||
state: link
|
||||
|
||||
- name: Stat /opt/PrusaSlicer
|
||||
stat:
|
||||
path: /opt/PrusaSlicer
|
||||
register: prusa_slicer_stat
|
||||
|
||||
- name: Set version
|
||||
set_fact:
|
||||
prusa_slicer_version: "{{ prusa_slicer_stat.stat.lnk_target | regex_replace('^/opt/PrusaSlicer-(.*)-[0-9]{12}$', '\\1') }}"
|
||||
when: prusa_slicer_stat.stat.exists and prusa_slicer_stat.stat.islnk
|
||||
|
||||
- debug:
|
||||
var: prusa_slicer_version
|
||||
|
||||
- name: Copy Prusa slicer settings
|
||||
copy:
|
||||
content: "{{ prusa_slicer.settings }}"
|
||||
content: |
|
||||
version_system_info_sent = {{ prusa_slicer_version | default('') }}
|
||||
{{ prusa_slicer.settings }}
|
||||
dest: /etc/skel/.config/PrusaSlicer/PrusaSlicer.ini
|
||||
|
|
|
|||
|
|
@ -0,0 +1,60 @@
|
|||
---
|
||||
- name: Get latest release
|
||||
uri:
|
||||
url: https://api.github.com/repos/prusa3d/PrusaSlicer/releases/latest
|
||||
return_content: true
|
||||
register: prusa_slicer_release
|
||||
|
||||
- name: Create tarball tempfile
|
||||
tempfile:
|
||||
state: file
|
||||
suffix: .tar.gz
|
||||
register: prusa_slicer_tarball
|
||||
|
||||
- name: Select asset
|
||||
set_fact:
|
||||
prusa_slicer_asset: "{{ asset }}"
|
||||
when: "asset.name | regex_search('PrusaSlicer-.*linux-x64-GTK3.*\\.tar\\.bz2$')"
|
||||
loop: "{{ prusa_slicer_release.json.assets }}"
|
||||
loop_control:
|
||||
loop_var: asset
|
||||
label: "{{ asset.name }}"
|
||||
|
||||
- name: Download release file
|
||||
get_url:
|
||||
url: "{{ prusa_slicer_asset.browser_download_url }}"
|
||||
dest: "{{ prusa_slicer_tarball.path }}"
|
||||
force: true
|
||||
|
||||
- name: Extract tarball
|
||||
unarchive:
|
||||
src: "{{ prusa_slicer_tarball.path }}"
|
||||
dest: /opt
|
||||
remote_src: true
|
||||
|
||||
- name: Remove tarball
|
||||
ansible.builtin.file:
|
||||
path: "{{ prusa_slicer_tarball.path }}"
|
||||
state: absent
|
||||
when: prusa_slicer_tarball.path is defined
|
||||
|
||||
- name: Create symlink
|
||||
file:
|
||||
src: "/opt/{{ prusa_slicer_directory }}"
|
||||
dest: "/opt/PrusaSlicer"
|
||||
state: link
|
||||
vars:
|
||||
prusa_slicer_directory: "{{ prusa_slicer_asset.name | regex_replace('\\.tar\\.bz2$', '') }}"
|
||||
|
||||
- name: Create applications directory
|
||||
file:
|
||||
path: /usr/local/share/applications/
|
||||
state: directory
|
||||
|
||||
- name: Copy desktop files
|
||||
copy:
|
||||
src: "{{ item }}.desktop"
|
||||
dest: /usr/local/share/applications/{{ item }}.desktop
|
||||
loop:
|
||||
- PrusaSlicer
|
||||
- PrusaGcodeviewer
|
||||
|
|
@ -1,6 +1,12 @@
|
|||
---
|
||||
- block:
|
||||
- import_tasks: install.yml
|
||||
- import_tasks: package.yml
|
||||
when: prusa_slicer_use_package | bool
|
||||
tags:
|
||||
- prusa-slicer:install
|
||||
|
||||
- import_tasks: install_from_github.yml
|
||||
when: not prusa_slicer_use_package | bool
|
||||
tags:
|
||||
- prusa-slicer:install
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue