Compare commits

..

2 Commits

3 changed files with 34 additions and 5 deletions

View File

@ -13,6 +13,7 @@
appimage: 'Obsidian-{{latest.json.name}}.AppImage' appimage: 'Obsidian-{{latest.json.name}}.AppImage'
- set_fact: - set_fact:
filepath: '{{ansible_env.HOME}}/.local/bin/{{appimage}}' filepath: '{{ansible_env.HOME}}/.local/bin/{{appimage}}'
iconpath: 'share/icons/hicolor/512x512/apps/obsidian.png'
asset_query: '[?contains(name, `{{appimage}}`)] | [0]' asset_query: '[?contains(name, `{{appimage}}`)] | [0]'
- set_fact: - set_fact:
needs_installed: needs_installed:
@ -31,7 +32,7 @@
state: directory state: directory
with_items: with_items:
- '{{ansible_env.HOME}}/.local/bin' - '{{ansible_env.HOME}}/.local/bin'
- '{{ansible_env.HOME}}/.local/share/icon/hicolor/512x512/apps' - '{{ansible_env.HOME}}/.local/share/icons/hicolor/512x512/apps'
- name: create symlink - name: create symlink
file: file:
@ -40,16 +41,19 @@
state: link state: link
- name: extract squashfs-root for app icon - name: extract squashfs-root for app icon
when: needs_installed
command: command:
cmd: '{{ansible_env.HOME}}/.local/bin/Obsidian --appimage-extract' cmd: '{{ansible_env.HOME}}/.local/bin/Obsidian --appimage-extract'
chdir: '/tmp' chdir: '/tmp'
- name: copy icon file - name: copy icon file
when: needs_installed
copy: copy:
src: '/tmp/squashfs-root/usr/share/icons/hicolor/512x512/apps/obsidian.png' src: '/tmp/squashfs-root/usr/{{iconpath}}'
dest: '{{ansible_env.HOME}}/.local/share/icon/hicolor/512x512/apps/' dest: '{{ansible_env.HOME}}/.local/{{iconpath}}'
- name: remove squashfs-root directory - name: remove squashfs-root directory
when: needs_installed
file: file:
path: '/tmp/squashfs-root' path: '/tmp/squashfs-root'
state: absent state: absent

View File

@ -3,7 +3,7 @@ Name=Obsidian
Exec={{ansible_env.HOME}}/.local/bin/Obsidian Exec={{ansible_env.HOME}}/.local/bin/Obsidian
Terminal=false Terminal=false
Type=Application Type=Application
Icon={{ansible_env.HOME}}/.local/share/icon/hicolor/512x512/apps/obsidian.png Icon=obsidian
StartupWMClass=Obsidian StartupWMClass=Obsidian
X-AppImage-Version={{latest.json.name}} X-AppImage-Version={{latest.json.name}}
Comment=Private and flexible notetaking app that adapts to the way you think. Comment=Private and flexible notetaking app that adapts to the way you think.

View File

@ -16,6 +16,7 @@
appimage: 'WebCatalog-{{releases[0].version}}.AppImage' appimage: 'WebCatalog-{{releases[0].version}}.AppImage'
- set_fact: - set_fact:
filepath: '{{ansible_env.HOME}}/.local/bin/{{appimage}}' filepath: '{{ansible_env.HOME}}/.local/bin/{{appimage}}'
iconpath: 'share/icons/hicolor/512x512/apps/webcatalog.png'
- set_fact: - set_fact:
needs_installed: needs_installed:
@ -28,13 +29,37 @@
dest: '{{ansible_env.HOME}}/.local/bin/{{appimage}}' dest: '{{ansible_env.HOME}}/.local/bin/{{appimage}}'
mode: '0755' mode: '0755'
- name: create directories
file:
path: '{{item}}'
state: directory
with_items:
- '{{ansible_env.HOME}}/.local/bin'
- '{{ansible_env.HOME}}/.local/share/icons/hicolor/512x512/apps'
- name: create symlink - name: create symlink
file: file:
src: '{{filepath}}' src: '{{filepath}}'
dest: '{{ansible_env.HOME}}/.local/bin/WebCatalog' dest: '{{ansible_env.HOME}}/.local/bin/WebCatalog'
state: link state: link
# TODO: icon for desktop file - name: extract squashfs-root for app icon
when: needs_installed
command:
cmd: '{{ansible_env.HOME}}/.local/bin/WebCatalog --appimage-extract'
chdir: '/tmp'
- name: copy icon file
when: needs_installed
copy:
src: '/tmp/squashfs-root/usr/{{iconpath}}'
dest: '{{ansible_env.HOME}}/.local/{{iconpath}}'
- name: remove squashfs-root directory
when: needs_installed
file:
path: '/tmp/squashfs-root'
state: absent
- name: create desktop file - name: create desktop file
template: template: