add desktop file for visidata and set as default

This commit is contained in:
Pig Monkey 2019-11-06 20:36:59 -08:00
parent 3e34692d5c
commit 3b8107de9f
2 changed files with 26 additions and 0 deletions

View file

@ -0,0 +1,7 @@
[Desktop Entry]
Name=Visidata
GenericName=Spreadsheet Editor
Exec=vd %U
Terminal=true
Type=Application
MimeType=text/csv;text/tab-separated-values;

View file

@ -12,3 +12,22 @@
- python-xlrd
- python-pandas
state: present
- name: Push visidata desktop file
copy:
src: visidata.desktop
dest: /usr/local/share/applications/visidata.desktop
- name: Verify mimeapps.list exists
file:
path: /etc/xdg/mimeapps.list
state: touch
- name: Set visidata as default application for relevant mimetypes
lineinfile:
dest: /etc/xdg/mimeapps.list
regexp: "{{ item.regexp }}"
line: "{{ item.line }}"
with_items:
- { regexp: '^text/csv=', line: 'text/csv=visidata.desktop' }
- { regexp: '^text/tab-separated-values=', line: 'text/tab-separated-values=browser.desktop' }